Adds battle history, fixes code style

This commit is contained in:
2024-08-23 09:24:00 +02:00
parent d48889e21a
commit e7dc885afd
21 changed files with 80 additions and 70 deletions

View File

@@ -168,7 +168,7 @@ internal static class MoveTurnExecutor
var hitEventBatch = new EventBatchId();
battle.EventHook.Invoke(new MoveHitEvent(executingMove, hitData, target)
{
BatchId = hitEventBatch
BatchId = hitEventBatch,
});
target.Damage(damage, DamageSource.MoveDamage, hitEventBatch);
if (!target.IsFainted)

View File

@@ -22,7 +22,7 @@ public static class TargetResolver
MoveTarget.AllAdjacent => GetAllAdjacent(battle, side, position),
MoveTarget.AllAlly => battle.Sides[side].Pokemon.ToList(),
MoveTarget.AllOpponent => battle.Sides[GetOppositeSide(side)].Pokemon.ToList(),
_ => throw new ArgumentOutOfRangeException(nameof(target), target, null)
_ => throw new ArgumentOutOfRangeException(nameof(target), target, null),
};
}
@@ -49,7 +49,7 @@ public static class TargetResolver
return
[
battle.GetPokemon(side, position), battle.GetPokemon(GetOppositeSide(side), position),
battle.GetPokemon(side, (byte)right)
battle.GetPokemon(side, (byte)right),
];
}
@@ -58,14 +58,14 @@ public static class TargetResolver
return
[
battle.GetPokemon(side, position), battle.GetPokemon(GetOppositeSide(side), position),
battle.GetPokemon(side, (byte)left)
battle.GetPokemon(side, (byte)left),
];
}
return
[
battle.GetPokemon(side, position), battle.GetPokemon(GetOppositeSide(side), position),
battle.GetPokemon(side, (byte)left), battle.GetPokemon(side, (byte)right)
battle.GetPokemon(side, (byte)left), battle.GetPokemon(side, (byte)right),
];
}
@@ -90,7 +90,7 @@ public static class TargetResolver
return
[
battle.GetPokemon(side, position), battle.GetPokemon(side, (byte)left), battle.GetPokemon(side, (byte)right)
battle.GetPokemon(side, position), battle.GetPokemon(side, (byte)left), battle.GetPokemon(side, (byte)right),
];
}
}