net.sf.magicproject.clickable.ability
Class TriggeredAbility

java.lang.Object
  extended by net.sf.magicproject.clickable.ability.Ability
      extended by net.sf.magicproject.clickable.ability.UserAbility
          extended by net.sf.magicproject.clickable.ability.TriggeredAbility
All Implemented Interfaces:
Unregisterable, ResolveStackHandler
Direct Known Subclasses:
ReplacementAbility, TriggeredAbilitySet

public class TriggeredAbility
extends UserAbility

Since:
0.80 When this ability is unregistered, the corresponding delayed card, if specified is also removed from the DBZ., 0.82 Triggered abilities are registered avoiding multiple instance of same effects. By default, triggered ability is always registered, but refresh and remover modifier are added as needed., 0.86 mana check is not done in the "isMathing" method since many manas can be played during the ability cost phase.
Author:
Fabrice Daugan

Field Summary
 
Fields inherited from class net.sf.magicproject.clickable.ability.Ability
optimizer, priority
 
Method Summary
 Ability clone(MCard container)
          return a copy of this ability
TODO remove param container since it is not used in this constructor As default, return null
 java.lang.String getAbilityTitle()
          Return ability html title.
 DelayedCard getDelayedCard()
          Return the delayed card.
 java.lang.String getLog(ContextEventListener context)
          Return a String identifying this ability with the name and/or card name.
 boolean isDelayedAbility()
          Return true if this ability is a delayed one.
 boolean isMatching()
          compare the current event to the event activating this ability.
 void removeFromManager()
          Remove from the event manager this listener.
 void setDelayedCard(DelayedCard delayedCard)
           
 java.lang.String toHtmlString(ContextEventListener context)
          Return the HTML code representing this ability.
 
Methods inherited from class net.sf.magicproject.clickable.ability.UserAbility
actionList, checkObjectActions, checkTargetActions, clickOn, effectList, eventComing, getCard, manaNeeded, mouseClicked, recheckTargets, toString, triggerIt
 
Methods inherited from class net.sf.magicproject.clickable.ability.Ability
addLinkedAbility, equals, getCardCopy, getController, getName, getPictureName, getTargetable, getTriggeredClone, getTriggeredCloneChoice, hashCode, hasHighPriority, isAutoResolve, isHidden, isPlayAsSpell, optimizeRegisterToManager, registerToManager, resolveStack, setEvent
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

clone

public Ability clone(MCard container)
Description copied from class: Ability
return a copy of this ability
TODO remove param container since it is not used in this constructor As default, return null

Specified by:
clone in class UserAbility
Parameters:
container - is not used here
Returns:
copy of this ability

setDelayedCard

public void setDelayedCard(DelayedCard delayedCard)
Parameters:
delayedCard -

removeFromManager

public void removeFromManager()
Description copied from interface: Unregisterable
Remove from the event manager this listener.

Specified by:
removeFromManager in interface Unregisterable
Overrides:
removeFromManager in class Ability

isMatching

public boolean isMatching()
Description copied from class: Ability
compare the current event to the event activating this ability. If matching, verify that there enougth mana in the player's mana pool

Overrides:
isMatching in class UserAbility
Returns:
true if this ability can be played responding the current event

toHtmlString

public final java.lang.String toHtmlString(ContextEventListener context)
Description copied from class: Ability
Return the HTML code representing this ability.

Overrides:
toHtmlString in class UserAbility
Parameters:
context - the context needed by event activated
Returns:
the HTML code representing this ability.

getLog

public java.lang.String getLog(ContextEventListener context)
Description copied from class: Ability
Return a String identifying this ability with the name and/or card name.

Specified by:
getLog in class Ability
Parameters:
context - the current context of this ability.
Returns:
a String identifying this ability with the name and/or card name.

getAbilityTitle

public java.lang.String getAbilityTitle()
Description copied from class: Ability
Return ability html title. Type of ability and a few other information

Overrides:
getAbilityTitle in class Ability
Returns:
ability html title. Type of ability and a few other information

isDelayedAbility

public boolean isDelayedAbility()
Return true if this ability is a delayed one.

Returns:
true if this ability is a delayed one.

getDelayedCard

public DelayedCard getDelayedCard()
Return the delayed card. May be null.

Returns:
the delayed card. May be null.


Copyright © 2003-2007 Magic-Project. All Rights Reserved.