mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- CheckStyle.
This commit is contained in:
@@ -12,7 +12,7 @@ import forge.game.player.Player;
|
|||||||
import forge.util.MyRandom;
|
import forge.util.MyRandom;
|
||||||
|
|
||||||
public class CharmAi extends SpellAiLogic {
|
public class CharmAi extends SpellAiLogic {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean canPlayAI(Player ai, SpellAbility sa) {
|
protected boolean canPlayAI(Player ai, SpellAbility sa) {
|
||||||
final Random r = MyRandom.getRandom();
|
final Random r = MyRandom.getRandom();
|
||||||
@@ -23,10 +23,10 @@ public class CharmAi extends SpellAiLogic {
|
|||||||
|
|
||||||
List<AbilitySub> chooseFrom = CharmEffect.makePossibleOptions(sa);
|
List<AbilitySub> chooseFrom = CharmEffect.makePossibleOptions(sa);
|
||||||
List<AbilitySub> chosenList = chooseOptionsAi(ai, timingRight, chooseFrom, num, min);
|
List<AbilitySub> chosenList = chooseOptionsAi(ai, timingRight, chooseFrom, num, min);
|
||||||
|
|
||||||
if (chosenList == null || chosenList.isEmpty()) {
|
if (chosenList == null || chosenList.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// prevent run-away activations - first time will always return true
|
// prevent run-away activations - first time will always return true
|
||||||
return r.nextFloat() <= Math.pow(.6667, sa.getActivationsThisTurn());
|
return r.nextFloat() <= Math.pow(.6667, sa.getActivationsThisTurn());
|
||||||
@@ -51,9 +51,10 @@ public class CharmAi extends SpellAiLogic {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (thisPick != null)
|
if (thisPick != null) {
|
||||||
chosenList.add(thisPick);
|
chosenList.add(thisPick);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return chosenList.size() >= min ? chosenList : null;
|
return chosenList.size() >= min ? chosenList : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user