forked from External/mage
* Implemeented consumable flag for asThoughtEffects and a player choice which effect to use if multiple consumable effects allow the same action.
This commit is contained in:
parent
8105d8b26c
commit
90c6637dc2
10 changed files with 78 additions and 18 deletions
|
|
@ -215,6 +215,17 @@ public class ChoiceImpl implements Choice, Serializable {
|
|||
answers.remove(needChoice);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// no key answer found, try to macht by text starting with
|
||||
for (String needChoice : answers) {
|
||||
for (Map.Entry<String, String> currentChoice : this.getKeyChoices().entrySet()) {
|
||||
if (currentChoice.getValue().startsWith(needChoice)) {
|
||||
this.setChoiceByKey(currentChoice.getKey());
|
||||
answers.remove(needChoice);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -231,4 +242,4 @@ public class ChoiceImpl implements Choice, Serializable {
|
|||
}
|
||||
return false; // can't find answer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue