Class OrCondition
java.lang.Object
net.demilich.metastone.game.spells.desc.condition.Condition
net.demilich.metastone.game.spells.desc.condition.OrCondition
- All Implemented Interfaces:
Serializable
,HasDesc<ConditionDesc>
This condition passes if any of the conditions in
ConditionArg.CONDITIONS
also pass.
If no conditions pass, or no conditions are specified, this condition does not pass (returns false
).
This can be used to disable hero powers from being cast, to create a passive hero power. For example:
{ "type": "HERO_POWER", "passiveTriggers": [{ "eventTrigger": { ... }, "spell": { "class": "HeroPowerSpell", "spell": { ... } } }], "condition": { "class": "OrCondition" } }
This card cannot be "played" but its passive trigger contains its text.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Condition
protected boolean
isFulfilled
(GameContext context, Player player, ConditionDesc desc, Entity source, Entity target) protected boolean
WhenCondition.targetConditionArgOverridesSuppliedTarget()
istrue
, the result of the condition on each of the resolved targets isand
-ed if this istrue
.protected boolean
WhenCondition.targetConditionArgOverridesSuppliedTarget()
istrue
, the result of the condition on each of the resolved targets isor
-ed if this istrue
.Methods inherited from class net.demilich.metastone.game.spells.desc.condition.Condition
equals, getDesc, hashCode, isFulfilled, isFulfilledForTarget, requiresAtLeastOneTarget, setDesc, singleTargetOnly, targetConditionArgOverridesSuppliedTarget, usesFilter
-
Constructor Details
-
OrCondition
-
-
Method Details
-
create
-
isFulfilled
protected boolean isFulfilled(GameContext context, Player player, ConditionDesc desc, Entity source, Entity target) - Specified by:
isFulfilled
in classCondition
-
multipleTargetsEvaluatedAsAnd
protected boolean multipleTargetsEvaluatedAsAnd()Description copied from class:Condition
WhenCondition.targetConditionArgOverridesSuppliedTarget()
istrue
, the result of the condition on each of the resolved targets isand
-ed if this istrue
.Should not be
true
whenCondition.multipleTargetsEvaluatedAsOr()
is alsotrue
.- Overrides:
multipleTargetsEvaluatedAsAnd
in classCondition
- Returns:
-
multipleTargetsEvaluatedAsOr
protected boolean multipleTargetsEvaluatedAsOr()Description copied from class:Condition
WhenCondition.targetConditionArgOverridesSuppliedTarget()
istrue
, the result of the condition on each of the resolved targets isor
-ed if this istrue
.Should not be
true
whenCondition.multipleTargetsEvaluatedAsAnd()
is alsotrue
.- Overrides:
multipleTargetsEvaluatedAsOr
in classCondition
- Returns:
-