public void REST(RBYPokemon Attacker, RBYPokemon Defender) { if (Attacker.SubHPRemaining == Attacker.HealthPoints) { Displayer.RelayMessage("Pokemon is already healthy"); return; } Attacker.PutToSleep(2); Attacker.HealDamage(Attacker.HealthPoints); Defender.NonDmgHit(); }
private void EndOfTurnEffects(RBYPokemon Attacker, RBYPokemon Defender) { switch (Attacker.CurrentStatus) { case StatusConditionInflicted.Poison: Attacker.NormalPoisonDmg(); break; case StatusConditionInflicted.BadPoison: Attacker.BadlyPoisonDmg(); break; case StatusConditionInflicted.Burn: Attacker.BurnDmg(); break; case StatusConditionInflicted.Leech: Defender.HealDamage(Attacker.LeechSeedDmg()); break; } }
private void DamageTypeMove(RBYPokemon Attacker, RBYPokemon Defender, Attacks atk, AttackingMoveSecondary attacktype, bool nomiss = false) { bool crit_chance = CriticalChance(Attacker, false); Attacker.RecalcStats(crit_chance); Defender.RecalcStats(crit_chance); if (!HitOrMiss(Attacker.Accuracy, Defender.Evasion, atk.Accuracy) && !Unhittable(Defender) && !nomiss) { Displayer.AtkMissed(); Defender.NonDmgHit(); return; } ElementTypes type = atk.MoveType; int basepwr = atk.BasePower; bool physpec = PhysicalSpecial(type); float multipler = TypeMatrixCalc(atk.MoveType, Defender.Type1, Defender.Type2); double stab = 1; int power = physpec == true ? Attacker.InBattleAtk : Attacker.InBattleSpecialAtk; int defense = physpec == true ? Defender.InBattleDef : Defender.InBattleSpecialAtk; if (Attacker.Type1 == type || Attacker.Type2 == type) { stab = 1.5; } int dmg = 0; if (attacktype != AttackingMoveSecondary.Turn2 && attacktype != AttackingMoveSecondary.SpecialMech) { if (crit_chance) { Displayer.RelayMessage("Critical Hit!"); } } switch (attacktype) { case AttackingMoveSecondary.None: dmg = DamageCalculation(power, defense, Attacker.Level, basepwr, stab, multipler, crit_chance); Defender.TakeDamage(dmg, physpec, multipler); break; case AttackingMoveSecondary.MultiHit: MultiHitMove(atk.Name, power, defense, Attacker.Level, basepwr, stab, multipler, Defender, physpec, crit_chance); break; case AttackingMoveSecondary.Recoil: dmg = DamageCalculation(power, defense, Attacker.Level, basepwr, stab, multipler, crit_chance); Defender.TakeDamage(dmg, physpec, multipler); RecoilLogic(Defender, Attacker, dmg); break; case AttackingMoveSecondary.SpecialMech: CallSpecialMove(atk.Name, Attacker, Defender); break; case AttackingMoveSecondary.Trap: dmg = DamageCalculation(power, defense, Attacker.Level, basepwr, stab, multipler, crit_chance); Defender.TakeDamage(dmg, physpec, multipler); TrapLogic(Defender, Attacker); break; case AttackingMoveSecondary.Turn2: Attacker.ActivateTwoTurn(atk); break; case AttackingMoveSecondary.Absorbing: dmg = DamageCalculation(power, defense, Attacker.Level, basepwr, stab, multipler, crit_chance); Defender.TakeDamage(dmg, physpec, multipler); Attacker.HealDamage(dmg / 2); break; case AttackingMoveSecondary.Recharge: dmg = DamageCalculation(power, defense, Attacker.Level, basepwr, stab, multipler, crit_chance); Defender.TakeDamage(dmg, physpec, multipler); RechargeLogic(Defender, Attacker); break; } Defender.LastDmg = dmg; if (Defender.CurrentStatus == StatusConditionInflicted.Freeze && atk.MoveType == ElementTypes.FIRE) { Defender.UnFreez(); } SecondaryAffects(Attacker, Defender, atk); }