public static void mountItemForInventory(EquipedModel equiped, string slot_name, string item_data) { object equipment; int inv_idx = String_functions.getFirstNumberFromString(slot_name); string item_type = item_data.Split(',')[0]; switch (item_type) { case "Weapon": equipment = new WeaponModel(item_data); break; case "Food": equipment = new FoodModel(item_data); break; case "Potions": equipment = new PotionModel(item_data); break; case "Runes": equipment = new ItemModel(item_data); break; default: equipment = new EquipmentModel(item_type, item_data); break; } equiped.InventoryItem[inv_idx] = equipment; }
public static bool requedAmmoEquped(EquipedModel eqp) { if (eqp.Weapon.Name.ToLower().Contains("crossbow")) { if (eqp.Ammo.Name.Contains("bolt")) { return(true); //bolt metals ifs will come, when leveling comes. } else { return(false); } } if (eqp.Weapon.Name.ToLower().Contains("bow")) { if (eqp.Ammo.Name.Contains("arrow")) { return(true); } else { return(false); } } return(true); }
public static bool throwSuccesfulyEqpToInv(EquipedModel equiped, object equipment) { for (int i = 0; i < equiped.InventoryItem.Count; i++) { if ((equiped.InventoryItem[i] as ItemModel).Name.Equals("")) { equiped.InventoryItem[i] = equipment; return(true); } } return(false); }
public static void demountEqp(EquipedModel equiped, string equipment_type) { switch (equipment_type) { case "Head": equiped.Head = new EquipmentModel("Head"); break; case "Neck": equiped.Neck = new EquipmentModel("Neck"); break; case "Cape": equiped.Cape = new EquipmentModel("Cape"); break; case "Ammo": equiped.Ammo = new EquipmentModel("Ammo"); break; case "Body": equiped.Body = new EquipmentModel("Body"); break; case "Shield": equiped.Shield = new EquipmentModel("Shield"); break; case "Legs": equiped.Legs = new EquipmentModel("Legs"); break; case "Feet": equiped.Feet = new EquipmentModel("Feet"); break; case "Hands": equiped.Hands = new EquipmentModel("Hands"); break; case "Ring": equiped.Ring = new EquipmentModel("Ring"); break; case "Weapon": equiped.Weapon = new WeaponModel(); break; default: equiped.InventoryItem[String_functions.getFirstNumberFromString(equipment_type)] = new ItemModel(); ////// break; } }
//equiped functions public static void mountEqp(EquipedModel equiped, object equipment) { switch ((equipment as EquipmentModel).ItemType) { case "Head": equiped.Head = equipment as EquipmentModel; break; case "Neck": equiped.Neck = equipment as EquipmentModel; break; case "Cape": equiped.Cape = equipment as EquipmentModel; break; case "Ammo": equiped.Ammo = equipment as EquipmentModel; break; case "Body": equiped.Body = equipment as EquipmentModel; break; case "Shield": equiped.Shield = equipment as EquipmentModel; break; case "Legs": equiped.Legs = equipment as EquipmentModel; break; case "Feet": equiped.Feet = equipment as EquipmentModel; break; case "Hands": equiped.Hands = equipment as EquipmentModel; break; case "Ring": equiped.Ring = equipment as EquipmentModel; break; case "Weapon": equiped.Weapon = equipment as WeaponModel; break; } }
private static void set_stats_for_attacker(PlayerModel attacker) { CombatModel combat = attacker.Combat; SkillsModel skills = attacker.Skills; EquipedModel eqp = attacker.Equiped; string value = combat.CurretOptions.CombatType; switch (value) { case "Slash": case "Stab": case "Crush": combat.eq_piercing_bonus = eqp.getTotalSlashAtk(); combat.eq_piercing_bonus = eqp.getTotalStabAtk(); combat.eq_piercing_bonus = eqp.getTotalCrushAtk(); combat.eq_dmage_bonus = eqp.getTotalMeleStr(); combat.prayer_piercing_bonus = 1; combat.prayer_dmage_bonus = 1; combat.dmage_lvl = skills.Str_lvl; combat.piercing_lvl = skills.Atk_lvl; break; case "Magic": combat.eq_piercing_bonus = eqp.getTotalMagicAtk(); combat.eq_dmage_bonus = eqp.getTotalMagicStr(); combat.prayer_piercing_bonus = 1; combat.prayer_dmage_bonus = 1; combat.dmage_lvl = skills.Magic_lvl; combat.piercing_lvl = skills.Magic_lvl; break; case "Ranged": combat.eq_piercing_bonus = eqp.getTotalRangedAtk(); combat.eq_dmage_bonus = eqp.getTotalRangedStr(); combat.prayer_piercing_bonus = 1; combat.prayer_dmage_bonus = 1; combat.dmage_lvl = skills.Ranged_lvl; combat.piercing_lvl = skills.Ranged_lvl; break; default: break; } }
private static bool canAttack(PlayerModel attacker) { CombatModel combat = attacker.Combat; EquipedModel eqp = attacker.Equiped; if (combat.CurretOptions.CombatType == "Ranged") { return(EquipedModel.requedAmmoEquped(eqp)); } else if (combat.CurretOptions.CombatType == "Magic") { return(false); } else { return(true); } }
private static void set_stats_for_deffender(PlayerModel deffender, CombatModel attacker_combat) { CombatModel deffender_combat = deffender.Combat; EquipedModel deffender_eqp = deffender.Equiped; SkillsModel deffender_skills = deffender.Skills; string value = attacker_combat.CurretOptions.CombatType; switch (value) { case "Slash": case "Stab": case "Crush": if (value.Equals("Slash")) { deffender_combat.eq_def_bonus = deffender_eqp.getTotalSlashDef(); } if (value.Equals("Stab")) { deffender_combat.eq_def_bonus = deffender_eqp.getTotalStabDef(); } if (value.Equals("Crush")) { deffender_combat.eq_def_bonus = deffender_eqp.getTotalCrushDef(); } deffender_combat.prayer_def_bonus = 1; break; case "Magic": deffender_combat.eq_def_bonus = deffender_eqp.getTotalMagicDef(); deffender_combat.prayer_def_bonus = 1; break; case "Ranged": deffender_combat.eq_def_bonus = deffender_eqp.getTotalRangedDef(); deffender_combat.prayer_def_bonus = 1; break; default: break; } deffender_combat.def_lvl = deffender_skills.Def_lvl; }
public static object getEqp(EquipedModel equiped, string equipment_type) { switch (equipment_type) { case "Head": return(equiped.Head); case "Neck": return(equiped.Neck); case "Cape": return(equiped.Cape); case "Ammo": return(equiped.Ammo); case "Body": return(equiped.Body); case "Shield": return(equiped.Shield); case "Legs": return(equiped.Legs); case "Feet": return(equiped.Feet); case "Hands": return(equiped.Hands); case "Ring": return(equiped.Ring); case "Weapon": return(equiped.Weapon); default: return(null); } }
public CombatModel(SkillsModel player_skills = null, EquipedModel player_equipment = null) { CurretOptions = new CombatCurretOptionModel(); }
public static void mountItem(EquipedModel equiped, string slot_name, string item_data) { switch (slot_name) { case "Head": equiped.Head = new EquipmentModel("Head", item_data); break; case "Neck": equiped.Neck = new EquipmentModel("Neck", item_data); break; case "Cape": equiped.Cape = new EquipmentModel("Cape", item_data); break; case "Ammo": equiped.Ammo = new EquipmentModel("Ammo", item_data); break; case "Weapon": equiped.Weapon = new WeaponModel(item_data); if (equiped.Weapon.is_two_handed) { equiped.Shield = new EquipmentModel("Shield"); } break; case "Body": equiped.Body = new EquipmentModel("Body", item_data); break; case "Shield": equiped.Shield = new EquipmentModel("Shield", item_data); if (equiped.Weapon.is_two_handed) { equiped.Weapon = new WeaponModel(); } break; case "Legs": equiped.Legs = new EquipmentModel("Legs", item_data); break; case "Feet": equiped.Feet = new EquipmentModel("Feet", item_data); break; case "Hands": equiped.Hands = new EquipmentModel("Hands", item_data); break; case "Ring": equiped.Ring = new EquipmentModel("Ring", item_data); break; default: mountItemForInventory(equiped, slot_name, item_data); break; } }