This commit is contained in:
@@ -6,11 +6,13 @@ public class InfestationEffect : Script, IScriptOnEndTurn, IScriptPreventSelfSwi
|
||||
{
|
||||
private readonly IPokemon _owner;
|
||||
private int _turns;
|
||||
private readonly float _bindDamage;
|
||||
|
||||
public InfestationEffect(IPokemon owner, int turns)
|
||||
public InfestationEffect(IPokemon owner, int turns, float bindDamage)
|
||||
{
|
||||
_owner = owner;
|
||||
_turns = turns;
|
||||
_bindDamage = bindDamage;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -22,8 +24,8 @@ public class InfestationEffect : Script, IScriptOnEndTurn, IScriptPreventSelfSwi
|
||||
/// <inheritdoc />
|
||||
public void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||
{
|
||||
var damage = _owner.BoostedStats.Hp / 8;
|
||||
_owner.Damage(damage, DamageSource.Misc);
|
||||
var damage = _owner.BoostedStats.Hp * _bindDamage;
|
||||
_owner.Damage((uint)damage, DamageSource.Misc);
|
||||
|
||||
_turns--;
|
||||
if (_turns <= 0)
|
||||
@@ -35,6 +37,6 @@ public class InfestationEffect : Script, IScriptOnEndTurn, IScriptPreventSelfSwi
|
||||
/// <inheritdoc />
|
||||
public void ExpectedEndOfTurnDamage(IPokemon pokemon, ref int damage)
|
||||
{
|
||||
damage += (int)(_owner.MaxHealth / 8f);
|
||||
damage += (int)(_owner.MaxHealth * _bindDamage);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user