mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-21 12:19:15 +12:00
Weirest bug ever happened, it said "Item.ItemInformation" is higher protection level than Item.Tack even though both were public, i eventurally found that it was because Item was "class" where as "Item.Tack" was "public class" so i made everything be "public class"
This commit is contained in:
parent
6a620f4be5
commit
3c25795188
50 changed files with 186 additions and 60 deletions
|
@ -1,7 +1,7 @@
|
|||
using System.Collections.Generic;
|
||||
namespace HISP.Game
|
||||
{
|
||||
class AbuseReport
|
||||
public class AbuseReport
|
||||
{
|
||||
public struct ReportReason
|
||||
{
|
||||
|
|
|
@ -6,7 +6,7 @@ using HISP.Server;
|
|||
|
||||
namespace HISP.Game.Chat
|
||||
{
|
||||
class Chat
|
||||
public class Chat
|
||||
{
|
||||
public struct Correction
|
||||
{
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
using HISP.Player;
|
||||
using HISP.Server;
|
||||
using HISP.Game.Items;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace HISP.Game.Chat
|
||||
{
|
||||
class Command
|
||||
public class Command
|
||||
{
|
||||
|
||||
public static bool Give(string message, string[] args, User user)
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
namespace HISP.Game
|
||||
{
|
||||
// Inventory
|
||||
class InventoryException : Exception { };
|
||||
class InventoryFullException : InventoryException { };
|
||||
class InventoryMaxStackException : InventoryException { };
|
||||
public class InventoryException : Exception { };
|
||||
public class InventoryFullException : InventoryException { };
|
||||
public class InventoryMaxStackException : InventoryException { };
|
||||
}
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
using HISP.Server;
|
||||
using HISP.Game.Items;
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace HISP.Game.Horse
|
||||
{
|
||||
class HorseInfo
|
||||
public class HorseInfo
|
||||
{
|
||||
public enum StatType
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@ using HISP.Server;
|
|||
|
||||
namespace HISP.Game.Horse
|
||||
{
|
||||
class HorseInstance
|
||||
public class HorseInstance
|
||||
{
|
||||
public HorseInstance(HorseInfo.Breed breed, int randomId = -1, string loadName=null, string loadDescription = "", int loadSpoiled=0, string loadCategory="KEEPER", int loadMagicUsed=0, int loadAutoSell=0)
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@ using System.Threading.Tasks;
|
|||
namespace HISP.Game.Horse
|
||||
{
|
||||
|
||||
class WildHorse
|
||||
public class WildHorse
|
||||
{
|
||||
|
||||
public WildHorse(HorseInstance horse, int MapX = -1, int MapY = -1, int despawnTimeout=60, bool addToDatabase = true)
|
||||
|
|
|
@ -5,7 +5,7 @@ using System.Collections.Generic;
|
|||
|
||||
namespace HISP.Game.Inventory
|
||||
{
|
||||
class HorseInventory
|
||||
public class HorseInventory
|
||||
{
|
||||
private User baseUser;
|
||||
private List<HorseInstance> horsesList = new List<HorseInstance>();
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
|
||||
using HISP.Game.Items;
|
||||
|
||||
namespace HISP.Game.Inventory
|
||||
{
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HISP.Game.Items;
|
||||
|
||||
namespace HISP.Game.Inventory
|
||||
{
|
||||
class InventoryItem
|
||||
public class InventoryItem
|
||||
{
|
||||
public InventoryItem()
|
||||
{
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
using System.Linq;
|
||||
using HISP.Player;
|
||||
using HISP.Server;
|
||||
using HISP.Game.Items;
|
||||
|
||||
namespace HISP.Game.Inventory
|
||||
{
|
||||
|
||||
class PlayerInventory : IInventory
|
||||
public class PlayerInventory : IInventory
|
||||
{
|
||||
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
using HISP.Game.Services;
|
||||
using HISP.Server;
|
||||
using HISP.Game.Items;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace HISP.Game.Inventory
|
||||
{
|
||||
class ShopInventory : IInventory
|
||||
public class ShopInventory : IInventory
|
||||
{
|
||||
private Shop baseShop;
|
||||
private List<InventoryItem> inventoryItems;
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HISP.Server;
|
||||
using HISP.Game;
|
||||
|
||||
namespace HISP.Game
|
||||
namespace HISP.Game.Items
|
||||
{
|
||||
class DroppedItems
|
||||
public class DroppedItems
|
||||
{
|
||||
public struct DroppedItem
|
||||
{
|
|
@ -1,10 +1,11 @@
|
|||
using HISP.Player;
|
||||
using HISP.Server;
|
||||
using HISP.Game;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace HISP.Game
|
||||
namespace HISP.Game.Items
|
||||
{
|
||||
class Item
|
||||
public class Item
|
||||
{
|
||||
public struct Effects
|
||||
{
|
||||
|
@ -138,7 +139,10 @@ namespace HISP.Game
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void DoSpecialCases()
|
||||
{
|
||||
Tack.GenerateTackSets();
|
||||
}
|
||||
public static ItemInformation GetItemById(int id)
|
||||
{
|
||||
foreach(ItemInformation item in Items)
|
|
@ -1,7 +1,8 @@
|
|||
using HISP.Security;
|
||||
namespace HISP.Game
|
||||
using HISP.Game;
|
||||
namespace HISP.Game.Items
|
||||
{
|
||||
class ItemInstance
|
||||
public class ItemInstance
|
||||
{
|
||||
public int RandomId;
|
||||
public int ItemId;
|
86
Horse Isle Server/HorseIsleServer/Game/Items/Tack.cs
Normal file
86
Horse Isle Server/HorseIsleServer/Game/Items/Tack.cs
Normal file
|
@ -0,0 +1,86 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using HISP.Server;
|
||||
|
||||
namespace HISP.Game.Items
|
||||
{
|
||||
public class Tack
|
||||
{
|
||||
public class TackSet
|
||||
{
|
||||
public TackSet()
|
||||
{
|
||||
tackItems = new List<Item.ItemInformation>();
|
||||
}
|
||||
|
||||
public string SetName;
|
||||
private List<Item.ItemInformation> tackItems;
|
||||
public void Add(Item.ItemInformation item)
|
||||
{
|
||||
Logger.DebugPrint("Added "+item.Name+" To Tack Set: "+this.SetName);
|
||||
tackItems.Add(item);
|
||||
}
|
||||
public Item.ItemInformation[] TackItems
|
||||
{
|
||||
get
|
||||
{
|
||||
return tackItems.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
private static string capitalizeFirstLetter(string str)
|
||||
{
|
||||
char firstChar = char.ToUpper(str[0]);
|
||||
return firstChar + str.Substring(1);
|
||||
}
|
||||
private static List<TackSet> tackSets = new List<TackSet>();
|
||||
public TackSet[] TackSets
|
||||
{
|
||||
get
|
||||
{
|
||||
return tackSets.ToArray();
|
||||
}
|
||||
}
|
||||
public static TackSet GetSetByName(string name)
|
||||
{
|
||||
foreach(TackSet set in tackSets)
|
||||
{
|
||||
if(set.SetName == name)
|
||||
{
|
||||
return set;
|
||||
}
|
||||
}
|
||||
throw new KeyNotFoundException("No TackSet with name: "+name+" was found.");
|
||||
}
|
||||
|
||||
public static void GenerateTackSets()
|
||||
{
|
||||
foreach(Item.ItemInformation itemInfo in Item.Items)
|
||||
{
|
||||
if(itemInfo.Type == "TACK")
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
TackSet set = GetSetByName(capitalizeFirstLetter(itemInfo.EmbedSwf));
|
||||
set.Add(itemInfo);
|
||||
}
|
||||
catch(KeyNotFoundException)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
TackSet tackSet = new TackSet();
|
||||
tackSet.SetName = capitalizeFirstLetter(itemInfo.EmbedSwf);
|
||||
tackSet.Add(itemInfo);
|
||||
tackSets.Add(tackSet);
|
||||
Logger.DebugPrint("Created Tack Set: "+tackSet.SetName);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@ using HISP.Server;
|
|||
|
||||
namespace HISP.Game
|
||||
{
|
||||
class Map
|
||||
public class Map
|
||||
{
|
||||
public struct TerrainTile
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@ using System.Drawing;
|
|||
|
||||
namespace HISP.Game
|
||||
{
|
||||
class Messages
|
||||
public class Messages
|
||||
{
|
||||
public static int RequiredChatViolations;
|
||||
public static int DefaultInventoryMax;
|
||||
|
@ -517,7 +517,21 @@ namespace HISP.Game
|
|||
|
||||
// Click
|
||||
public static string NothingInterestingHere;
|
||||
|
||||
|
||||
public static string FormatTackBoost(string stat, int amount)
|
||||
{
|
||||
return TackBonusFormat.Replace("%BOOST%",amount.ToString("N0")).Replace("%STAT%",stat);
|
||||
}
|
||||
|
||||
public static string FormatTackSetPeice(string itemName, string itemDescription, string bonus)
|
||||
{
|
||||
return TackSetPeiceFormat.Replace("%ITEMNAME%",itemName).Replace("%ITEMDESC%", itemDescription).Replace("%BONUS%",bonus);
|
||||
}
|
||||
|
||||
public static string FormatTackSetView(int iconId, string tackSetName, string swf)
|
||||
{
|
||||
return TackViewSetFormat.Replace("%ICONID%",iconId.ToString()).Replace("%SETNAME%", tackSetName).Replace("%SWF%",swf);
|
||||
}
|
||||
|
||||
public static string FormatWhispererHorseFoundMeta(string mapXys)
|
||||
{
|
||||
|
|
|
@ -3,6 +3,7 @@ using HISP.Game.Inventory;
|
|||
using HISP.Game.Services;
|
||||
using HISP.Player;
|
||||
using HISP.Server;
|
||||
using HISP.Game.Items;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
@ -10,7 +11,7 @@ using System.Drawing;
|
|||
|
||||
namespace HISP.Game
|
||||
{
|
||||
class Meta
|
||||
public class Meta
|
||||
{
|
||||
// Meta
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ using System.Collections.Generic;
|
|||
|
||||
namespace HISP.Game
|
||||
{
|
||||
class Npc
|
||||
public class Npc
|
||||
{
|
||||
public struct NpcReply
|
||||
{
|
||||
|
|
|
@ -4,10 +4,11 @@ using System.Linq;
|
|||
using HISP.Game.Inventory;
|
||||
using HISP.Player;
|
||||
using HISP.Server;
|
||||
using HISP.Game.Items;
|
||||
|
||||
namespace HISP.Game
|
||||
{
|
||||
class Quest
|
||||
public class Quest
|
||||
{
|
||||
public const string Shovel = "SHOVEL";
|
||||
public const string Binoculars = "BINOCS";
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
using HISP.Player;
|
||||
using HISP.Game.Items;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
@ -7,7 +9,7 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace HISP.Game.Services
|
||||
{
|
||||
class Inn
|
||||
public class Inn
|
||||
{
|
||||
private static List<Inn> listInns = new List<Inn>();
|
||||
public static Inn[] Inns
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
using HISP.Game.Inventory;
|
||||
using HISP.Server;
|
||||
using HISP.Game.Items;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace HISP.Game.Services
|
||||
{
|
||||
class Shop
|
||||
public class Shop
|
||||
{
|
||||
public int Id;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace HISP.Game.Services
|
||||
{
|
||||
class Transport
|
||||
public class Transport
|
||||
{
|
||||
public struct TransportLocation
|
||||
{
|
||||
|
|
|
@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace HISP.Game.Services
|
||||
{
|
||||
class Vet
|
||||
public class Vet
|
||||
{
|
||||
|
||||
public static List<Vet> Vets = new List<Vet>();
|
||||
|
|
|
@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace HISP.Game.SwfModules
|
||||
{
|
||||
class Brickpoet
|
||||
public class Brickpoet
|
||||
{
|
||||
public struct PoetryEntry {
|
||||
public int Id;
|
||||
|
|
|
@ -4,7 +4,7 @@ using System.Collections.Generic;
|
|||
|
||||
namespace HISP.Game
|
||||
{
|
||||
class Tracking
|
||||
public class Tracking
|
||||
{
|
||||
public enum TrackableItem
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@ using HISP.Server;
|
|||
namespace HISP.Game
|
||||
{
|
||||
|
||||
class World
|
||||
public class World
|
||||
{
|
||||
public struct Isle
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue