Interface Trigger
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractFriendlyCardAura
,Aftermath
,AttributeAura
,AttributeValueAura
,Aura
,BuffAura
,CaptnCookishAura
,CardAura
,CardCostInsteadAura
,CardCostModifier
,ChooseOneOverrideAura
,DiscoverNotSelectedSpellBonusAura
,DoubleBattlecriesAura
,DoubleCombosAura
,DoubleDeathrattlesAura
,DoubleTurnEndTriggersAura
,EffectlessAura
,Enchantment
,EnrageAura
,GatekeeperShaAura
,HeroPowerBonusAura
,HoardingWhelpAura
,IncorruptibilityAura
,LifedrainGrantsArmorInsteadAura
,LifedrainHealsAdditionalAura
,MenagerieMogulAura
,ModifyBuffSpellAura
,ModifyTemporaryAttackSpellAura
,NoggenfoggerAura
,OneTurnCostModifier
,Opener
,PhysicalAttackTargetOverrideAura
,Quest
,ReservoirsAlwaysActiveAura
,ReservoirsNeverActiveAura
,Secret
,SecretsTriggerTwiceAura
,SpecificCardFilterOverrideAura
,SpellAura
,SpellEffectsCastTwiceAura
,SpellOverrideAura
,SpellsCastThriceAura
,SpellsCastTwiceAura
,SpellTargetsAdjacentAura
,StatefulAttributeValueAura
,SupremaciesTriggerTwiceAura
,SupremacyBonusEffectAura
,TargetSelectionOverrideAura
,TheliaSilentdreamerAura
,ToggleCostModifier
,WhereverTheyAreEnchantment
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Clones the trigger with any internal state.void
expire
(GameContext context) Expires the trigger; marks it for removal and prevents it from executing in the future.default boolean
Returnstrue
if the trigger fire in response to the givenGameEvent
.Gets a reference to theEntity
that is "hosting," or owning, the trigger.int
getOwner()
Gets the player who owns this trigger.boolean
interestedIn
(com.hiddenswitch.spellsource.rpc.Spellsource.GameEventTypeMessage.GameEventType eventType) Returns true if this trigger is a listener for the givenSpellsource.GameEventTypeMessage.GameEventType
.boolean
boolean
Checks if, due to the execution of possibly complex rules inside or outside the trigger, the trigger is expired (no longer should fire).boolean
Indicates this trigger cannot change owners.void
onAdd
(GameContext context, Player player, Entity source, Entity host) Called when the trigger is added into aGameContext
's state.boolean
Indicates this trigger is only active for the current turn, then it shouldexpire(GameContext)
.void
onGameEvent
(GameEvent event) Handles an event this triggerqueues(GameEvent)
for and isinterestedIn(com.hiddenswitch.spellsource.rpc.Spellsource.GameEventTypeMessage.GameEventType)
.boolean
Checks if a trigger should queue in response to a specific event.void
setHostReference
(EntityReference entityReference) Sets or changes theEntity
that is the owner / host of this trigger.void
setOwner
(int playerIndex) Sets the player who is the owner of this trigger.
-
Method Details
-
clone
Trigger clone()Clones the trigger with any internal state.- Returns:
- A clone of this trigger.
-
queues
Checks if a trigger should queue in response to a specific event.- Parameters:
event
- A game event.- Returns:
true
if the trigger should queue in response to this event.
-
getHostReference
EntityReference getHostReference()Gets a reference to theEntity
that is "hosting," or owning, the trigger.- Returns:
- An entity reference. This is typically not null.
-
getOwner
int getOwner()Gets the player who owns this trigger.- Returns:
GameContext.PLAYER_1
orGameContext.PLAYER_2
.
-
isExpired
boolean isExpired()Checks if, due to the execution of possibly complex rules inside or outside the trigger, the trigger is expired (no longer should fire).- Returns:
true
if the trigger should be removed and will no longer fire.
-
onAdd
Called when the trigger is added into aGameContext
's state.- Parameters:
context
- The game context.player
-source
-host
-
-
onGameEvent
Handles an event this triggerqueues(GameEvent)
for and isinterestedIn(com.hiddenswitch.spellsource.rpc.Spellsource.GameEventTypeMessage.GameEventType)
.- Parameters:
event
- The game event this trigger is now processing.
-
setHostReference
Sets or changes theEntity
that is the owner / host of this trigger.- Parameters:
entityReference
- The hostEntity
/
-
setOwner
void setOwner(int playerIndex) Sets the player who is the owner of this trigger.- Parameters:
playerIndex
-GameContext.PLAYER_1
orGameContext.PLAYER_2
.
-
isPersistentOwner
boolean isPersistentOwner()Indicates this trigger cannot change owners. For example, aSecret
does not have a persistent owner, because card texts can steal secrets. However, the trigger described by Blessing of Wisdom does have a persistent owner, since the casting player of that spell should always draw the card it receives.- Returns:
true
if the trigger'sonGameEvent(GameEvent)
should be evaluated from the point of view of the owner when the trigger was created, as opposed to what the owner is right now (which may have changed).
-
oneTurnOnly
boolean oneTurnOnly()Indicates this trigger is only active for the current turn, then it shouldexpire(GameContext)
.- Returns:
true
if this is a one-turn long trigger.
-
expire
Expires the trigger; marks it for removal and prevents it from executing in the future.- Parameters:
context
-
-
fires
Returnstrue
if the trigger fire in response to the givenGameEvent
.It is already queued in this situation.
- Parameters:
event
- The currently raised event.- Returns:
true
if the trigger can fire.
-
isActivated
boolean isActivated()
-