Adds several new scripts

This commit is contained in:
2024-12-22 11:24:01 +01:00
parent 44cd2ee03e
commit 45439a20a4
5 changed files with 81 additions and 5 deletions

View File

@@ -28,11 +28,12 @@ public class DoublePowerIfTargetDamagedInTurn : Script
var battle = move.User.BattleData?.Battle;
if (battle == null)
return;
var side = battle.Sides[target.BattleData!.SideIndex];
var script = side.VolatileScripts.Get(ScriptUtils.ResolveName<DoublePowerIfTargetDamagedInTurnData>());
if (script?.Script == null)
if (target.BattleData == null)
return;
var side = battle.Sides[target.BattleData.SideIndex];
var data = side.VolatileScripts.Get<DoublePowerIfTargetDamagedInTurnData>();
if (data == null)
return;
var data = (DoublePowerIfTargetDamagedInTurnData)script.Script;
if (data._hitPokemon.Contains(target))
basePower *= 2;
}