*Removed redundant runTrigger in card combat damage code.

*Fixed CardsIn requirement for triggers, let's you require numbers of cards in specified zones of specified players.
This commit is contained in:
jendave
2011-08-06 14:54:25 +00:00
parent cc61de4b3b
commit 8d731fe4c4
2 changed files with 2 additions and 9 deletions

View File

@@ -2899,13 +2899,6 @@ public class Card extends MyObservable {
if (isCreature()) if (isCreature())
GameActionUtil.executeCombatDamageToCreatureEffects(source, this, damageToAdd); GameActionUtil.executeCombatDamageToCreatureEffects(source, this, damageToAdd);
GameActionUtil.executeCombatDamageEffects(source, damageToAdd); GameActionUtil.executeCombatDamageEffects(source, damageToAdd);
//Run triggers
HashMap<String,Object> runParams = new HashMap<String,Object>();
runParams.put("DamageSource", source);
runParams.put("DamageTarget",this);
runParams.put("DamageAmount", damageToAdd);
AllZone.TriggerHandler.runTrigger("DamageDone", runParams);
} }
map.put(source, damageToAdd); map.put(source, damageToAdd);
} }

View File

@@ -131,7 +131,7 @@ public abstract class Trigger {
if(mapParams.containsKey("CardsIn")) if(mapParams.containsKey("CardsIn"))
{ {
for(String OCIOper : mapParams.get("OpponentCardsIn").split(",")) for(String OCIOper : mapParams.get("CardsIn").split(","))
{ {
String[] splitOCIO = OCIOper.split("\\."); String[] splitOCIO = OCIOper.split("\\.");
Player player = splitOCIO[0].equals("You") ? hostCard.getController() : hostCard.getController().getOpponent(); Player player = splitOCIO[0].equals("You") ? hostCard.getController() : hostCard.getController().getOpponent();
@@ -142,7 +142,7 @@ public abstract class Trigger {
if(!Card.compare(amt,operator,operand)) if(!Card.compare(amt,operator,operand))
{ {
System.out.println("Requirement failed: Required cards not present/too many cards present."); System.out.println("Requirement failed: Required cards not present/too many cards present in specific zone.");
return false; return false;
} }
} }