forked from External/mage
reworked/simplified/consolidated effects which exchange life totals, added test (fixes #7668)
This commit is contained in:
parent
1abeec9595
commit
d4792e3665
16 changed files with 284 additions and 274 deletions
|
|
@ -50,9 +50,10 @@ public interface Player extends MageItem, Copyable<Player> {
|
|||
|
||||
/**
|
||||
* Current player is real life player (human). Try to use in GUI and network engine only.
|
||||
*
|
||||
* <p>
|
||||
* WARNING, you must use isComputer instead isHuman in card's code (for good Human/AI logic testing in unit tests)
|
||||
* TODO: check combat code and other and replace isHuman to isComputer usage if possible (if AI support that actions)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean isHuman();
|
||||
|
|
@ -61,9 +62,9 @@ public interface Player extends MageItem, Copyable<Player> {
|
|||
|
||||
/**
|
||||
* Current player is AI. Use it in card's code and all other places.
|
||||
*
|
||||
* <p>
|
||||
* It help to split Human/AI logic and test both by unit tests.
|
||||
*
|
||||
* <p>
|
||||
* Usage example: AI hint to skip or auto-calculate choices instead call of real choose dialogs
|
||||
* - unit tests for Human logic: call normal commands
|
||||
* - unit tests for AI logic: call aiXXX commands
|
||||
|
|
@ -125,6 +126,8 @@ public interface Player extends MageItem, Copyable<Player> {
|
|||
*/
|
||||
int gainLife(int amount, Game game, Ability source);
|
||||
|
||||
void exchangeLife(Player player, Ability source, Game game);
|
||||
|
||||
int damage(int damage, UUID attackerId, Ability source, Game game);
|
||||
|
||||
int damage(int damage, UUID attackerId, Ability source, Game game, boolean combatDamage, boolean preventable);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue