public void Unequip(PlayerInfo playerInfo) { //Debug.Log("调用了武器卸装函数"); if (!IsEqu) { throw new System.Exception("尚未装备该物品"); } /*if (!playerInfo.equipments.IsSdEquip && type == WeaponType.Shield) * { Debug.Log("副武器为空"); return "副武器为空"; } * if (!playerInfo.equipments.IsWpEquip && type != WeaponType.Shield) * { Debug.Log("武器为空"); return "武器为空"; }*/ IsEqu = false; playerInfo.ATK -= ATK; if (weaponType == WeaponType.Knife) { playerInfo.equipments.IsSdEquip = false; playerInfo.equipments.shield = null; //Debug.Log("卸下了副武器"); SystemMessages.AddMessage("卸下了副武器"); } else { playerInfo.equipments.IsWpEquip = false; playerInfo.equipments.weapon = null; //Debug.Log("卸下了主武器"); SystemMessages.AddMessage("卸下了主武器"); } if (enchant != null) { enchant.Unenchant(playerInfo); } if (suitEffect != null) { SuitEffectInfo sinfo = playerInfo.equipments.suitEffect.Find(s => s.SuittID == suitEffect.SuittID); if (sinfo != null) { sinfo.currentNum--; if (sinfo.currentNum <= 0) { playerInfo.equipments.suitEffect.Remove(sinfo); } sinfo.TryUnEffect(playerInfo); } } ItemInfo info = new ItemInfo(this); info.Quantity++; playerInfo.bag.itemList.Add(info); playerInfo.bag.Current_Size++; }
public void Unequip(PlayerInfo playerInfo, int ring1or2) { //Debug.Log("调用了首饰卸装函数"); if (!IsEqu) { throw new System.Exception("尚未装备该物品"); } IsEqu = false; power_Add.TryPowerDown(playerInfo); switch (jewelry_Type) { case JewelryType.Necklace: playerInfo.equipments.IsNlEquip = false; playerInfo.equipments.necklace = null; //Debug.Log("卸下了项链"); break; case JewelryType.Belt: playerInfo.equipments.IsBtEquip = false; playerInfo.equipments.belt = null; //Debug.Log("卸下了腰饰"); break; case JewelryType.Ring: if (ring1or2 == 1) { playerInfo.equipments.IsRgEquip_1 = false; playerInfo.equipments.ring_1 = null; //Debug.Log("卸下了戒指1"); } else if (ring1or2 == 2) { playerInfo.equipments.IsRgEquip_2 = false; playerInfo.equipments.ring_2 = null; //Debug.Log("卸下了戒指2"); } break; } if (enchant != null) { enchant.Unenchant(playerInfo); } if (suitEffect != null) { SuitEffectInfo sinfo = playerInfo.equipments.suitEffect.Find(s => s.SuittID == suitEffect.SuittID); if (sinfo != null) { sinfo.currentNum--; if (sinfo.currentNum <= 0) { playerInfo.equipments.suitEffect.Remove(sinfo); } sinfo.TryUnEffect(playerInfo); } } ItemInfo info = new ItemInfo(this); info.Quantity++; playerInfo.bag.itemList.Add(info); playerInfo.bag.Current_Size++; }
public void Unequip(PlayerInfo playerInfo) { //Debug.Log("调用了防具卸装函数"); if (!IsEqu) { throw new System.Exception("尚未装备该物品"); } IsEqu = false; playerInfo.DEF -= DEF; switch (armorType) { case ArmorType.Clothes: playerInfo.equipments.IsClEquip = false; playerInfo.equipments.clothes = null; //Debug.Log("卸下了衣服"); SystemMessages.AddMessage("卸下了衣服"); break; case ArmorType.Helmet: playerInfo.equipments.IsHmEquip = false; playerInfo.equipments.helmet = null; //Debug.Log("卸下了头饰"); SystemMessages.AddMessage("卸下了头饰"); break; case ArmorType.WristBand: playerInfo.equipments.IsWBEquip = false; playerInfo.equipments.wristband = null; //Debug.Log("卸下了护腕"); SystemMessages.AddMessage("卸下了护腕"); break; case ArmorType.Shoes: playerInfo.equipments.IsShEquip = false; playerInfo.equipments.shoes = null; //Debug.Log("卸下了鞋履"); SystemMessages.AddMessage("卸下了鞋履"); break; } if (enchant != null) { enchant.Unenchant(playerInfo); } if (suitEffect != null) { SuitEffectInfo sinfo = playerInfo.equipments.suitEffect.Find(s => s.SuittID == suitEffect.SuittID); if (sinfo != null) { sinfo.currentNum--; if (sinfo.currentNum <= 0) { playerInfo.equipments.suitEffect.Remove(sinfo); } sinfo.TryUnEffect(playerInfo); } } ItemInfo info = new ItemInfo(this); info.Quantity++; playerInfo.bag.itemList.Add(info); playerInfo.bag.Current_Size++; }