public ArmourMaterialInfo(ArmourMaterial key, string name, int cost, string effect, int defence, int energy, int kinetic, int elemental, List <ArmourType> allowedArmourTypes) { Key = key; Name = name; Cost = cost; Effect = effect; Defence = defence; Energy = energy; Kinetic = kinetic; Elemental = elemental; AllowedArmourTypes = allowedArmourTypes; }
public ArmourBaseAbstract Create(ArmourMaterial material) { if (material == ArmourMaterial.ClothArmour) { return(new ClothRobes()); } if (material == ArmourMaterial.LeatherArmour) { return(new LeatherArmour()); } if (material == ArmourMaterial.PlateArmour) { return(new PlateArmour()); } throw new ArgumentException($"ArmourFactory - no armour available for armour material {material}"); }
public static string GetEffect(ArmourMaterial key) { switch (key) { case ArmourMaterial.Durasteel: break; case ArmourMaterial.Armourplast: return("Lowers armour penalties by 1d10 minus defence."); case ArmourMaterial.Armourweave: return("Light armour only."); case ArmourMaterial.Beskar: return("(Rare) Resists lightsabers."); case ArmourMaterial.Desh: break; case ArmourMaterial.Duraplast: break; case ArmourMaterial.Frasium: break; case ArmourMaterial.Laminanium: break; case ArmourMaterial.Leather: return("Light armour only."); case ArmourMaterial.Phrik: return("Lowers armour penalties by 1d10. Resists lightsabers."); default: throw new ArgumentOutOfRangeException(nameof(key), key, null); } return(""); }
public static int GetCost(ArmourMaterial key) { switch (key) { case ArmourMaterial.Durasteel: return(0); case ArmourMaterial.Armourplast: return(2); case ArmourMaterial.Armourweave: return(1); case ArmourMaterial.Beskar: return(4); case ArmourMaterial.Desh: return(-1); case ArmourMaterial.Duraplast: return(3); case ArmourMaterial.Frasium: return(2); case ArmourMaterial.Laminanium: return(1); case ArmourMaterial.Leather: return(1); case ArmourMaterial.Phrik: return(3); default: throw new ArgumentOutOfRangeException(nameof(key), key, null); } }
public static string GetName(ArmourMaterial key) { switch (key) { case ArmourMaterial.Durasteel: return("Durasteel"); case ArmourMaterial.Armourplast: return("Armourplast"); case ArmourMaterial.Armourweave: return("Armourweave"); case ArmourMaterial.Beskar: return("Beskar"); case ArmourMaterial.Desh: return("Desh"); case ArmourMaterial.Duraplast: return("Duraplast"); case ArmourMaterial.Frasium: return("Frasium"); case ArmourMaterial.Laminanium: return("Laminanium"); case ArmourMaterial.Leather: return("Leather"); case ArmourMaterial.Phrik: return("Phrik"); default: throw new ArgumentOutOfRangeException(nameof(key), key, null); } }
public Armour(int id, string name, string namePlural, ArmourMaterial material, ArmourSlot slot) : base(id, name, namePlural) { Material = material; Slot = slot; }
public static ArmourMaterialInfo Build(ArmourMaterial key) { return(new ArmourMaterialInfo(key, GetName(key), GetCost(key), GetEffect(key), GetDefence(key), GetEnergyResistance(key), GetKineticResistance(key), GetElementalResistance(key), GetAllowedArmourTypes(key))); }
public static List <ArmourType> GetAllowedArmourTypes(ArmourMaterial key) { switch (key) { case ArmourMaterial.Durasteel: return(new List <ArmourType> { ArmourType.None, ArmourType.Light, ArmourType.Medium, ArmourType.Heavy }); case ArmourMaterial.Armourplast: return(new List <ArmourType> { ArmourType.Light, ArmourType.Medium, ArmourType.Heavy }); case ArmourMaterial.Armourweave: return(new List <ArmourType> { ArmourType.Light }); case ArmourMaterial.Beskar: return(new List <ArmourType> { ArmourType.Light, ArmourType.Medium, ArmourType.Heavy }); case ArmourMaterial.Desh: return(new List <ArmourType> { ArmourType.Light, ArmourType.Medium, ArmourType.Heavy }); case ArmourMaterial.Duraplast: return(new List <ArmourType> { ArmourType.Light, ArmourType.Medium, ArmourType.Heavy }); case ArmourMaterial.Frasium: return(new List <ArmourType> { ArmourType.Light, ArmourType.Medium, ArmourType.Heavy }); case ArmourMaterial.Laminanium: return(new List <ArmourType> { ArmourType.Light, ArmourType.Medium, ArmourType.Heavy }); case ArmourMaterial.Leather: return(new List <ArmourType> { ArmourType.Light }); case ArmourMaterial.Phrik: return(new List <ArmourType> { ArmourType.Light, ArmourType.Medium, ArmourType.Heavy }); default: throw new ArgumentOutOfRangeException(nameof(key), key, null); } }
void GetItemData() { //Debug.LogWarning(selectedItem.ItemType); itemName = EditorGUILayout.TextField("Name: ", selectedItem.ItemName, GUILayout.Width(300)); itemID = EditorGUILayout.IntField("ID: ", selectedItem.ItemID, GUILayout.Width(300)); itemShortDesc = EditorGUILayout.TextField("Short Desc.: ", selectedItem.ItemShortDesc, GUILayout.Width(500)); EditorGUILayout.LabelField("Long description:"); itemLongDesc = EditorGUILayout.TextArea(selectedItem.ItemLongDesc, GUILayout.MinHeight(100)); itemWeight = EditorGUILayout.IntField("Weight: ", selectedItem.ItemWeight, GUILayout.Width(300)); itemCost = EditorGUILayout.IntField("Cost: ", selectedItem.ItemCost, GUILayout.Width(300)); itemIcon = EditorGUILayout.ObjectField("Icon: ", selectedItem.GetIcon(), typeof(Texture2D), true) as Texture2D; itemModel = EditorGUILayout.ObjectField("Model: ", selectedItem.GetModel(), typeof(GameObject), true) as GameObject; itemType = (ItemType)EditorGUILayout.EnumPopup("Type: ", selectedItem.ItemType); itemReqPerkIDs = selectedItem.ItemPerkReqIDs; CheckPerks(); switch (selectedItem.ItemType) { case (ItemType.Weapon): baseDamage = EditorGUILayout.IntField("Base Damage: ", selectedItem.WStats.BaseDamage); attackSpeed = EditorGUILayout.IntField("Attack Speed: ", selectedItem.WStats.AttackSpeed); bluntDamage = EditorGUILayout.IntField("Blunt", selectedItem.WStats.BluntDamage); pierceDamage = EditorGUILayout.IntField("Pierce", selectedItem.WStats.PierceDamage); slashDamage = EditorGUILayout.IntField("Slash", selectedItem.WStats.SlashDamage); conditions = selectedItem.WStats.Auras; CheckAuras(); break; case (ItemType.Armour): baseDefence = EditorGUILayout.IntField("Base Defence: ", selectedItem.AStats.BaseDefence); bluntDefence = EditorGUILayout.IntField("Blunt", selectedItem.AStats.BluntDefence); pierceDefence = EditorGUILayout.IntField("Pierce", selectedItem.AStats.PierceDefence); slashDefence = EditorGUILayout.IntField("Slash", selectedItem.AStats.SlashDefence); natureDefence = EditorGUILayout.IntField("Nature", selectedItem.AStats.NatureDefence); thermalDefence = EditorGUILayout.IntField("Thermal", selectedItem.AStats.ThermalDefence); armourType = (ArmourType)EditorGUILayout.EnumPopup("Slot: ", selectedItem.AStats.ArmourType); armourMaterial = (ArmourMaterial)EditorGUILayout.EnumPopup("Material: ", selectedItem.AStats.ArmourMaterial); conditions = selectedItem.AStats.Auras; CheckAuras(); break; case (ItemType.Consumable): consumableType = (ConsumableType)EditorGUILayout.EnumPopup("Type: ", selectedItem.ConStats.ConsumableType); consumableCharges = EditorGUILayout.IntField("Charges", selectedItem.ConStats.Charges); conditions = selectedItem.ConStats.Auras; CheckAuras(); break; case (ItemType.Container): contentItems = selectedItem.CtnStats.ContentItems; contentQuantities = selectedItem.CtnStats.ContentQuantities; CheckContents(); break; case (ItemType.Ingredient): isStackable = selectedItem.IngStats.IsStackable; break; case (ItemType.Misc): isStackable = selectedItem.MiscStats.IsStackable; break; } }
void ShowCreateWindow() { editScrollPos = EditorGUILayout.BeginScrollView(editScrollPos, false, false, GUILayout.MinWidth(540), GUILayout.MinHeight(550)); itemName = EditorGUILayout.TextField("Name: ", itemName, GUILayout.Width(300)); itemID = EditorGUILayout.IntField("ID: ", itemID, GUILayout.Width(300)); itemShortDesc = EditorGUILayout.TextField("Short Desc.: ", itemShortDesc, GUILayout.Width(450)); EditorGUILayout.LabelField("Long description:"); itemLongDesc = EditorGUILayout.TextArea(itemLongDesc, GUILayout.Width(450), GUILayout.MinHeight(100)); itemWeight = EditorGUILayout.IntField("Weight: ", itemWeight, GUILayout.Width(300)); itemCost = EditorGUILayout.IntField("Cost: ", itemCost, GUILayout.Width(300)); itemIcon = EditorGUILayout.ObjectField("Icon: ", itemIcon, typeof(Texture2D), true, GUILayout.Width(450)) as Texture2D; itemModel = EditorGUILayout.ObjectField("Model: ", itemModel, typeof(GameObject), true, GUILayout.Width(450)) as GameObject; itemType = (ItemType)EditorGUILayout.EnumPopup("Type: ", itemType, GUILayout.Width(480)); EditorGUILayout.Space(); switch (itemType) { case (ItemType.Weapon): EditorGUILayout.LabelField("Weapon-specific Attributes", EditorStyles.boldLabel); baseDamage = EditorGUILayout.IntField("Base Damage: ", baseDamage, GUILayout.Width(300)); attackSpeed = EditorGUILayout.IntField("Attack Speed: ", attackSpeed, GUILayout.Width(300)); bluntDamage = EditorGUILayout.IntField("Blunt", bluntDamage, GUILayout.Width(300)); pierceDamage = EditorGUILayout.IntField("Pierce", pierceDamage, GUILayout.Width(300)); slashDamage = EditorGUILayout.IntField("Slash", slashDamage, GUILayout.Width(300)); EditorGUILayout.Space(); showContentsOrAuras = EditorGUILayout.Foldout(showContentsOrAuras, "ON-EQUIP Auras"); if (showContentsOrAuras) { DisplayAuras(); } break; case (ItemType.Armour): EditorGUILayout.LabelField("Armour-specific Attributes", EditorStyles.boldLabel); baseDefence = EditorGUILayout.IntField("Base Defence: ", baseDefence, GUILayout.Width(300)); bluntDefence = EditorGUILayout.IntField("Blunt", bluntDefence, GUILayout.Width(300)); pierceDefence = EditorGUILayout.IntField("Pierce", pierceDefence, GUILayout.Width(300)); slashDefence = EditorGUILayout.IntField("Slash", slashDefence, GUILayout.Width(300)); natureDefence = EditorGUILayout.IntField("Nature", natureDefence, GUILayout.Width(300)); thermalDefence = EditorGUILayout.IntField("Thermal", thermalDefence, GUILayout.Width(300)); armourType = (ArmourType)EditorGUILayout.EnumPopup("Slot: ", armourType, GUILayout.Width(450)); armourMaterial = (ArmourMaterial)EditorGUILayout.EnumPopup("Material: ", armourMaterial, GUILayout.Width(450)); EditorGUILayout.Space(); showContentsOrAuras = EditorGUILayout.Foldout(showContentsOrAuras, "ON-EQUIP Auras"); if (showContentsOrAuras) { DisplayAuras(); } break; case (ItemType.Consumable): EditorGUILayout.LabelField("Consumable-specific Attributes", EditorStyles.boldLabel); consumableType = (ConsumableType)EditorGUILayout.EnumPopup("Type: ", consumableType, GUILayout.Width(450)); consumableCharges = EditorGUILayout.IntField("Uses: ", consumableCharges, GUILayout.Width(300)); EditorGUILayout.Space(); showContentsOrAuras = EditorGUILayout.Foldout(showContentsOrAuras, "ON-USE Auras"); if (showContentsOrAuras) { DisplayAuras(); } break; case (ItemType.Container): EditorGUILayout.LabelField("Container-specific Attributes", EditorStyles.boldLabel); showContentsOrAuras = EditorGUILayout.Foldout(showContentsOrAuras, "CONTAINER CONTENTS"); if (showContentsOrAuras) { DisplayContainerEditor(); } break; case (ItemType.Ingredient): EditorGUILayout.LabelField("Ingredient-specific Attributes", EditorStyles.boldLabel); isStackable = EditorGUILayout.Toggle("Stackable: ", isStackable); break; case (ItemType.Misc): EditorGUILayout.LabelField("Miscellaneous-specific Attributes", EditorStyles.boldLabel); isStackable = EditorGUILayout.Toggle("Stackable: ", isStackable); break; } EditorGUILayout.Space(); showRequirements = EditorGUILayout.Foldout(showRequirements, "REQUIRED PERKS"); if (showRequirements) { DisplayRequirements(); } EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Save", GUILayout.Width(150.0f))) { // Save this item to the database, either as a new item // or as an existing item. if (editorState == EditorState.Create) { SaveNewItem(itemType); } else { SaveExistingItem(itemType); } EditorUtility.SetDirty(itemDatabase); editorState = EditorState.Home; } if (GUILayout.Button("Cancel", GUILayout.Width(150.0f))) { EditorUtility.SetDirty(itemDatabase); editorState = EditorState.Home; } EditorGUILayout.EndHorizontal(); EditorGUILayout.EndScrollView(); }