mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-07 13:45:42 +12:00
Change default intrest rate,
and start adding ranches
This commit is contained in:
parent
02876ec2b4
commit
81440b1814
7 changed files with 1208 additions and 18 deletions
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
@ -27,20 +27,26 @@ namespace HISP.Game
|
|||
public static int NewUserStartY;
|
||||
public static int GetTileId(int x, int y, bool overlay)
|
||||
{
|
||||
if ((x > Width || x < 0) || (y > Height || y < 0)) // Outside map?
|
||||
return 0x1;
|
||||
|
||||
int pos = ((x * Height) + y);
|
||||
|
||||
if (overlay && Treasure.IsTileBuiredTreasure(x, y))
|
||||
if (pos >= oMapData.Length && overlay)
|
||||
return 1;
|
||||
else if (pos >= MapData.Length && !overlay)
|
||||
return 1;
|
||||
else if (overlay && oMapData[pos] != 1)
|
||||
return oMapData[pos];
|
||||
else if (overlay && Treasure.IsTileBuiredTreasure(x, y))
|
||||
return 193; // Burried Treasure tile.
|
||||
else if (overlay && Treasure.IsTilePotOfGold(x, y))
|
||||
return 186; // Pot of Gold tile.
|
||||
|
||||
if (overlay)
|
||||
return oMapData[pos];
|
||||
else
|
||||
else if (overlay && Ranch.IsRanchHere(x, y))
|
||||
return 170 + Ranch.GetRanchAt(x, y).Upgraded; // Ranch Tile + Upgraded amount
|
||||
else if (overlay)
|
||||
return 1;
|
||||
else if (!overlay)
|
||||
return MapData[pos];
|
||||
else // Not sure how you could even get here.
|
||||
return 1;
|
||||
}
|
||||
public static bool CheckPassable(int x, int y)
|
||||
{
|
||||
|
|
59
Horse Isle Server/HorseIsleServer/Game/Ranch.cs
Normal file
59
Horse Isle Server/HorseIsleServer/Game/Ranch.cs
Normal file
|
@ -0,0 +1,59 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HISP.Game
|
||||
{
|
||||
public class Ranch
|
||||
{
|
||||
public class RanchBuilding
|
||||
{
|
||||
public static List<RanchBuilding> RanchBuildings = new List<RanchBuilding>();
|
||||
public int Id;
|
||||
public string Type;
|
||||
public int Cost;
|
||||
public string Title;
|
||||
public string Description;
|
||||
public int Limit;
|
||||
}
|
||||
public static List<Ranch> Ranches = new List<Ranch>();
|
||||
|
||||
public int X;
|
||||
public int Y;
|
||||
public int Id;
|
||||
public int Value;
|
||||
|
||||
public int OwnerId;
|
||||
public int Upgraded;
|
||||
public Ranch(int x, int y, int id, int value)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Id = id;
|
||||
Value = value;
|
||||
Upgraded = 0;
|
||||
OwnerId = -1;
|
||||
}
|
||||
|
||||
public static bool IsRanchHere(int x, int y)
|
||||
{
|
||||
foreach (Ranch ranch in Ranches)
|
||||
{
|
||||
if (ranch.X == x && ranch.Y == y)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static Ranch GetRanchAt(int x, int y)
|
||||
{
|
||||
foreach(Ranch ranch in Ranches)
|
||||
{
|
||||
if (ranch.X == x && ranch.Y == y)
|
||||
return ranch;
|
||||
}
|
||||
throw new KeyNotFoundException("No Ranch found at x" + x + " y" + y);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -44,9 +44,9 @@ non_violation=true
|
|||
all_users_subscribed=false
|
||||
|
||||
# Equation is: BANK_BALANCE * (1/INTREST_RATE);
|
||||
# on All servers except Black its 8, on black its 3.
|
||||
# on All servers except Black its 3333, on black its 1000.
|
||||
# but of course you can make it whatever you want
|
||||
intrest_rate=8
|
||||
intrest_rate=3333
|
||||
|
||||
# Should print extra debug logs
|
||||
debug=false
|
|
@ -575,6 +575,42 @@ namespace HISP.Server
|
|||
Logger.DebugPrint("Registered Workshop at X: " + wkShop.X + " Y: " + wkShop.Y);
|
||||
|
||||
}
|
||||
int totalRanchLocations = gameData.ranch.ranch_locations.Count;
|
||||
for (int i = 0; i < totalRanchLocations; i++)
|
||||
{
|
||||
int x = gameData.ranch.ranch_locations[i].x;
|
||||
int y = gameData.ranch.ranch_locations[i].y;
|
||||
int id = gameData.ranch.ranch_locations[i].id;
|
||||
int value = gameData.ranch.ranch_locations[i].value;
|
||||
Ranch ranch = new Ranch(x, y, id, value);
|
||||
Ranch.Ranches.Add(ranch);
|
||||
Logger.DebugPrint("Registered Ranch at X: " + ranch.X + " Y: " + ranch.Y);
|
||||
|
||||
}
|
||||
int totalRanchBuildings = gameData.ranch.ranch_buildings.Count;
|
||||
for (int i = 0; i < totalRanchBuildings; i++)
|
||||
{
|
||||
int id = gameData.ranch.ranch_buildings[i].id;
|
||||
string type = gameData.ranch.ranch_buildings[i].type;
|
||||
int cost = gameData.ranch.ranch_buildings[i].cost;
|
||||
string title = gameData.ranch.ranch_buildings[i].title;
|
||||
string description = gameData.ranch.ranch_buildings[i].description;
|
||||
|
||||
Ranch.RanchBuilding building = new Ranch.RanchBuilding();
|
||||
|
||||
if (gameData.ranch.ranch_buildings[i].limit != null)
|
||||
building.Limit = gameData.ranch.ranch_buildings[i].limit;
|
||||
building.Id = id;
|
||||
building.Type = type;
|
||||
building.Cost = cost;
|
||||
building.Title = title;
|
||||
building.Description = description;
|
||||
|
||||
Ranch.RanchBuilding.RanchBuildings.Add(building);
|
||||
Logger.DebugPrint("Registered Ranch Building: "+building.Title);
|
||||
|
||||
}
|
||||
|
||||
HorseInfo.HorseNames = gameData.horses.names.ToObject<string[]>();
|
||||
|
||||
Item.Present = gameData.item.special.present;
|
||||
|
|
|
@ -2486,13 +2486,13 @@ namespace HISP.Server
|
|||
|
||||
// Pac-man the world.
|
||||
if (loggedInUser.X > Map.Width)
|
||||
loggedInUser.Teleport(0, loggedInUser.Y);
|
||||
else if (loggedInUser.X < 0)
|
||||
loggedInUser.Teleport(Map.Width, loggedInUser.Y);
|
||||
else if (loggedInUser.Y > Map.Height)
|
||||
loggedInUser.Teleport(loggedInUser.X, 0);
|
||||
else if (loggedInUser.Y < 0)
|
||||
loggedInUser.Teleport(loggedInUser.X, Map.Height);
|
||||
loggedInUser.Teleport(2, loggedInUser.Y);
|
||||
else if (loggedInUser.X < 2)
|
||||
loggedInUser.Teleport(Map.Width-2, loggedInUser.Y);
|
||||
else if (loggedInUser.Y > Map.Height-2)
|
||||
loggedInUser.Teleport(loggedInUser.X, 2);
|
||||
else if (loggedInUser.Y < 2)
|
||||
loggedInUser.Teleport(loggedInUser.X, Map.Height-2);
|
||||
|
||||
if (loggedInUser.CurrentlyRidingHorse != null)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue