More abilities, refactor IPokemon.SetStatus to pass pokemon that caused the status change
All checks were successful
Build / Build (push) Successful in 50s

This commit is contained in:
2025-06-15 12:29:13 +02:00
parent defb1349ca
commit 85d97cb9e6
37 changed files with 214 additions and 46 deletions

View File

@@ -34,7 +34,7 @@ public class Bounce : Script
var random = battle.Random;
if (random.EffectChance(30, move, target, hit))
{
target.SetStatus("paralyzed", false);
target.SetStatus("paralyzed", move.User);
}
}
}

View File

@@ -14,7 +14,7 @@ public class FireFang : Script
var random = battleData.Battle.Random;
if (random.EffectChance(10, move, target, hit))
{
target.SetStatus("burned", false);
target.SetStatus("burned", move.User);
}
// It also has an independent 10% chance of causing the target to flinch, if the user attacks before the target.

View File

@@ -28,7 +28,7 @@ public class FlameWheel : Script
if (move.Battle.Random.EffectChance(_burnChance, move, target, hit))
{
target.SetStatus("burned", false);
target.SetStatus("burned", move.User);
}
}
}

View File

@@ -20,7 +20,7 @@ public class FlareBlitz : Script
if (battleData.Battle.Random.EffectChance(10, move, target, hit))
{
target.SetStatus("burned", false);
target.SetStatus("burned", move.User);
}
move.User.Damage(recoilDamage, DamageSource.Misc);

View File

@@ -31,7 +31,7 @@ public class FreezeDry : Script
if (battleData.Battle.Random.EffectChance(10, move, target, hit))
{
target.SetStatus("frozen", false);
target.SetStatus("frozen", move.User);
}
}
}

View File

@@ -17,7 +17,7 @@ public class FreezeShock : BaseChargeMove<RequireChargeEffect>
if (battleData.Battle.Random.EffectChance(30, move, target, hit))
{
target.SetStatus("paralyzed", false);
target.SetStatus("paralyzed", move.User);
}
}
}

View File

@@ -17,7 +17,7 @@ public class IceBurn : BaseChargeMove<RequireChargeEffect>
if (battleData.Battle.Random.EffectChance(30, move, target, hit))
{
target.SetStatus("burned", false);
target.SetStatus("burned", move.User);
}
}
}

View File

@@ -14,7 +14,7 @@ public class IceFang : Script
if (battleData.Battle.Random.EffectChance(10, move, target, hit))
{
target.SetStatus("frozen", false);
target.SetStatus("frozen", move.User);
}
if (battleData.Battle.Random.EffectChance(10, move, target, hit))
{

View File

@@ -22,7 +22,7 @@ public class PoisonTail : Script
if (battleData.Battle.Random.EffectChance(10, move, target, hit))
{
target.SetStatus(ScriptUtils.ResolveName<BadlyPoisoned>(), false);
target.SetStatus(ScriptUtils.ResolveName<BadlyPoisoned>(), move.User);
}
}
}

View File

@@ -24,7 +24,8 @@ public class Rest : Script
return;
}
if (move.User.SetStatus(ScriptUtils.ResolveName<Sleep>(), true) && move.User.StatusScript.Script is Sleep sleep)
if (move.User.SetStatus(ScriptUtils.ResolveName<Sleep>(), move.User) &&
move.User.StatusScript.Script is Sleep sleep)
sleep.Turns = 2;
}
}

View File

@@ -20,6 +20,6 @@ public class SetStatus : Script
{
if (_status == null)
throw new Exception("Missing required parameter 'status'");
target.SetStatus(_status, false);
target.SetStatus(_status, move.User);
}
}

View File

@@ -12,7 +12,7 @@ public class ThunderFang : Script
var random = move.Battle.Random;
if (random.EffectChance(10, move, target, hit))
{
target.SetStatus(ScriptUtils.ResolveName<Paralyzed>(), false);
target.SetStatus(ScriptUtils.ResolveName<Paralyzed>(), move.User);
}
if (random.EffectChance(10, move, target, hit))
{

View File

@@ -6,7 +6,7 @@ public class ToxicThread : Script
/// <inheritdoc />
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
{
target.SetStatus(ScriptUtils.ResolveName<Status.Poisoned>(), false);
target.SetStatus(ScriptUtils.ResolveName<Status.Poisoned>(), move.User);
target.ChangeStatBoost(Statistic.Speed, -1, false, false);
}
}

View File

@@ -14,6 +14,6 @@ public class TriAttack : Script
ScriptUtils.ResolveName<Status.Paralyzed>(),
ScriptUtils.ResolveName<Status.Frozen>(),
]);
target.SetStatus(status, false);
target.SetStatus(status, move.User);
}
}

View File

@@ -11,7 +11,7 @@ public class Twineedle : Script
{
if (move.Battle.Random.EffectChance(20, move, target, hit))
{
target.SetStatus(ScriptUtils.ResolveName<Status.Poisoned>(), false);
target.SetStatus(ScriptUtils.ResolveName<Status.Poisoned>(), move.User);
}
}
}

View File

@@ -12,7 +12,7 @@ public class VoltTackle : Script
if (move.Battle.Random.EffectChance(10, move, target, hit))
{
target.SetStatus(ScriptUtils.ResolveName<Status.Paralyzed>(), false);
target.SetStatus(ScriptUtils.ResolveName<Status.Paralyzed>(), move.User);
}
}
}