Closed nskins closed 6 years ago
Forget it - this is going to be too complex due to equipping weapons. I suppose we can just pass on this.
EDIT: an alternative solution might be to just throw an exception during battle if someone doesn't have any BattleCommands
.
Weird things happen in battle when a
Fighter
does not have any battle commands. In the case ofPlayer
, the battle cannot proceed as there is no command to select. In the case ofMonster
, the game crashes.One option to fix this would be to force the
Fighter
to have the defaultAttack
(created viaAttack.new
) when noBattleCommands
are given to the constructor. Additionally, we would need to enforce that thebattle_commands
array could not be empty (throw an exception when trying to remove the lastBattleCommand
).We should also verify that
battle_commands
is read-only. I think it is already.