public static bool CanEquip(Good good, Good.EquipPosition position) { return(good != null && good.Part == position); }
/// <summary> /// /// </summary> /// <param name="equip"></param> /// <param name="currentEquip"></param> /// <param name="justEffectType">Don't applay Attack, Defend,Evade,LifeMax,ThewMax,ManaMax, just equip effect</param> public void Equiping(Good equip, Good currentEquip, bool justEffectType = false) { //Save for restore var life = Life; var thew = Thew; var mana = Mana; UnEquiping(currentEquip, justEffectType); if (equip != null) { if (!justEffectType) { Attack += equip.Attack; Defend += equip.Defend; Evade += equip.Evade; LifeMax += equip.LifeMax; ThewMax += equip.ThewMax; ManaMax += equip.ManaMax; } switch (equip.TheEffectType) { case Good.GoodEffectType.ThewNotLoseWhenRun: IsNotUseThewWhenRun = true; break; case Good.GoodEffectType.ManaRestore: IsManaRestore = true; break; case Good.GoodEffectType.EnemyFrozen: SetFlyIniAdditionalEffect(Magic.AddonEffect.Frozen); break; case Good.GoodEffectType.EnemyPoisoned: SetFlyIniAdditionalEffect(Magic.AddonEffect.Poision); break; case Good.GoodEffectType.EnemyPetrified: SetFlyIniAdditionalEffect(Magic.AddonEffect.Petrified); break; } switch (equip.SpecialEffect) { case 1: //不断恢复生命 _extraLifeRestorePercent = equip.SpecialEffectValue / 100.0f; break; } if (!string.IsNullOrEmpty(equip.FlyIni)) { _flyIniReplace = Utils.GetMagic(equip.FlyIni, MagicFromCache); } if (!string.IsNullOrEmpty(equip.FlyIni2)) { _flyIni2Replace = Utils.GetMagic(equip.FlyIni2, MagicFromCache); } } //Restore Life = life; Thew = thew; Mana = mana; }