public void add_item(game_item item) { weapon_type type = CheckIfWeapon(item.type); game_item temp; item_type t = (type == weapon_type.none) ? item.type : item_type.melee_weapons; if (worn_items.TryGetValue(t, out temp)) { if (temp != null) { stats.DecreseStats(temp.bstats); stats.DecresePStats(temp.pstats); } worn_items[t] = item; } else { worn_items.Add(t, item); } if (type != weapon_type.none) { cc.weapon = type; } asn.AddItem(item); stats.AddStats(item.bstats); stats.AddPStats(item.pstats); //items.Add(item); }
public static weapon_type GetWeaponType(string key, string path) { weapon_type ret = weapon_type.none; if (key.Contains("melee")) { if (path.Contains("spear")) { ret = weapon_type.spear; } else { ret = weapon_type.sword; } if (path.Contains("oversize")) { ret += 1; } } else if (key.Contains("wand")) { ret = weapon_type.wand; } return(ret); }
public void change_weapon() { isSlowGun = !isSlowGun; if (isSlowGun) { weapon = slowGun; } else { weapon = damageGun; } }