Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -5,17 +5,16 @@ public class PowderEffect : Script, IScriptBlockOutgoingHit
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <inheritdoc />
|
||||
public void BlockOutgoingHit(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref bool block)
|
||||
public void BlockOutgoingHit(IExecutingMove executingMove, IBattlePokemon target, byte hitIndex, ref bool block)
|
||||
{
|
||||
var hit = executingMove.GetHitData(target, hitIndex);
|
||||
if (hit.Type?.Name == TypeNames.Fire)
|
||||
{
|
||||
executingMove.User.BattleData?.Battle.EventHook.Invoke(new DialogEvent("powder_explodes",
|
||||
new Dictionary<string, object>
|
||||
{
|
||||
{ "user", executingMove.User },
|
||||
{ "target", target },
|
||||
}));
|
||||
executingMove.User.Battle.EventHook.Invoke(new DialogEvent("powder_explodes", new Dictionary<string, object>
|
||||
{
|
||||
{ "user", executingMove.User },
|
||||
{ "target", target },
|
||||
}));
|
||||
|
||||
var health = executingMove.User.MaxHealth / 4;
|
||||
executingMove.User.Damage(health, DamageSource.Misc);
|
||||
|
||||
Reference in New Issue
Block a user