SotM Engine API
Class documentation for the Sentinels of the Multiverse Engine API.
Loading...
Searching...
No Matches
Trigger< T > Class Template Reference

Contains all information related to a Trigger, which reacts to specific GameActions as they occur. More...

+ Inheritance diagram for Trigger< T >:

Public Member Functions

 Trigger (GameController gameController, Func< T, bool > criteria, Func< T, IEnumerator > response, IEnumerable< TriggerType > types, TriggerTiming timing, CardSource cardSource, IEnumerable< ActionDescription > actionDescriptions=null, bool isConditional=false, bool requireActionSuccess=true, bool? isActionOptional=null, bool outOfPlayTrigger=false, bool? orderMatters=null, TriggerPriority? priority=null, bool ignoreBattleZone=false, bool respondEvenIfPlayedAfterAction=false, CardController copyingCardController=null)
 
IEnumerator ActionPerformed (GameAction action)
 
void AddAssociatedTrigger (ITrigger trigger)
 
virtual object Clone ()
 
int CompareTo (ITrigger otherTrigger)
 
virtual bool DoesMatchTypeAndCriteria (GameAction action)
 
void SetCopyingCardController (CardController copyingCardController)
 
override string ToString ()
 
- Public Member Functions inherited from ITrigger

Protected Member Functions

void AttachAssociatedCardSources (bool attachTriggerToo)
 
virtual bool CheckActionAgainstCriteria (T action)
 
void UnattachAssociatedCardSources (bool removeTriggerToo)
 

Properties

IEnumerable< ActionDescription > ActionDescriptions [get]
 
Type ActionType [get]
 
IEnumerable< ITriggerAssociatedTriggers [get]
 These associated triggers will all be removed with the removal of this trigger.
 
CardSource CardSource [get, set]
 
CardController CopyingCardController [get]
 
Func< T, bool > Criteria [get, set]
 
GameController GameController [get]
 
bool? IgnoreBattleZone [get]
 Returns whether or not this trigger responds to both BattleZones.
 
int Index [get]
 
bool? IsActionOptional [get]
 Returns whether or not the action that would result from this trigger is optional or not. Primiarily used by redirect triggers to reduce unnecessary "ambiguous" triggers. Null if undefined.
 
bool IsConditionalOnSimilar [get, set]
 Sets whether or not the action taken is conditional on other similar actions being taken. For example, if the card reads "Whenever this hero would be dealt 5 or more damage, reduce that damage by 3.".
 
bool IsOutOfPlayTrigger [get]
 
bool IsStatusEffect [get]
 
bool? OrderMatters [get]
 Can be set when the trigger is made to specify if the trigger order matters or not for this trigger. This is used to override the default trigger mananger behaviour. For example, usually a CancelAction trigger doesn't matter the order, since the action will just be cancelled. But between The Unbreakable and Silver Lining, the order does matter because it determines how much life will be regained and which card will be destroyed.
 
TriggerPriority? Priority [get]
 Setting the priority will allow some triggers to go before other triggers is very special situations. Ex. Sustained Influence and Chokepoint when a Construct is destroyed. SI goes first to determine if it comes back into play, or goes to Chokepoint's play area, flipped. This will ONLY take effect if two compared triggers each have a priority defined, and one is higher than the other. So even Priority.High will still get "mixed in" with other triggers that do not have a defined Priority.
 
bool RequireActionSuccess [get]
 
bool RespondEvenIfPlayedAfterAction [get]
 
Func< T, IEnumerator > Response [get]
 
string SourceString [get]
 
StatusEffect StatusEffect [get, set]
 
TriggerTiming Timing [get]
 
IEnumerable< TriggerType > Types [get, protected set]
 
bool UseUnityCoroutines [get]
 
- Properties inherited from ITrigger

Detailed Description

Contains all information related to a Trigger, which reacts to specific GameActions as they occur.

Template Parameters
TThe type of GameAction to which this Trigger responds.
Type Constraints
T :GameAction 

Member Function Documentation

◆ ActionPerformed()

IEnumerator ActionPerformed ( GameAction action)
inline

Implements ITrigger.

◆ AddAssociatedTrigger()

void AddAssociatedTrigger ( ITrigger< T > trigger)
inline

Implements ITrigger.

◆ DoesMatchTypeAndCriteria()

virtual bool DoesMatchTypeAndCriteria ( GameAction action)
inlinevirtual

Implements ITrigger.

◆ SetCopyingCardController()

void SetCopyingCardController ( CardController copyingCardController)
inline

Implements ITrigger.

Property Documentation

◆ ActionDescriptions

IEnumerable<ActionDescription> ActionDescriptions
get

Implements ITrigger.

◆ ActionType

Type ActionType
get

Implements ITrigger.

◆ AssociatedTriggers

IEnumerable<ITrigger> AssociatedTriggers
get

These associated triggers will all be removed with the removal of this trigger.

The associated triggers.

Implements ITrigger.

◆ CardSource

Implements ITrigger.

◆ CopyingCardController

CardController CopyingCardController
get

Implements ITrigger.

◆ IgnoreBattleZone

bool? IgnoreBattleZone
get

Returns whether or not this trigger responds to both BattleZones.

Implements ITrigger.

◆ Index

int Index
get

Implements ITrigger.

◆ IsActionOptional

bool? IsActionOptional
get

Returns whether or not the action that would result from this trigger is optional or not. Primiarily used by redirect triggers to reduce unnecessary "ambiguous" triggers. Null if undefined.

Implements ITrigger.

◆ IsConditionalOnSimilar

bool IsConditionalOnSimilar
getset

Sets whether or not the action taken is conditional on other similar actions being taken. For example, if the card reads "Whenever this hero would be dealt 5 or more damage, reduce that damage by 3.".

Implements ITrigger.

◆ IsOutOfPlayTrigger

bool IsOutOfPlayTrigger
get

Implements ITrigger.

◆ IsStatusEffect

bool IsStatusEffect
get

Implements ITrigger.

◆ OrderMatters

bool? OrderMatters
get

Can be set when the trigger is made to specify if the trigger order matters or not for this trigger. This is used to override the default trigger mananger behaviour. For example, usually a CancelAction trigger doesn't matter the order, since the action will just be cancelled. But between The Unbreakable and Silver Lining, the order does matter because it determines how much life will be regained and which card will be destroyed.

If set to a value, the trigger is specifically saying whether or not the order matters. If not set, the trigger mananger can decide.

Implements ITrigger.

◆ Priority

TriggerPriority? Priority
get

Setting the priority will allow some triggers to go before other triggers is very special situations. Ex. Sustained Influence and Chokepoint when a Construct is destroyed. SI goes first to determine if it comes back into play, or goes to Chokepoint's play area, flipped. This will ONLY take effect if two compared triggers each have a priority defined, and one is higher than the other. So even Priority.High will still get "mixed in" with other triggers that do not have a defined Priority.

Implements ITrigger.

◆ RequireActionSuccess

bool RequireActionSuccess
get

Implements ITrigger.

◆ RespondEvenIfPlayedAfterAction

bool RespondEvenIfPlayedAfterAction
get

Implements ITrigger.

◆ StatusEffect

Implements ITrigger.

◆ Timing

TriggerTiming Timing
get

Implements ITrigger.

◆ Types

IEnumerable<TriggerType> Types
getprotected set

Implements ITrigger.