net.sf.magicproject.clickable.ability
Class SystemAbility

java.lang.Object
  extended by net.sf.magicproject.clickable.ability.Ability
      extended by net.sf.magicproject.clickable.ability.SystemAbility
All Implemented Interfaces:
Unregisterable, ResolveStackHandler

public class SystemAbility
extends Ability

Since:
0.60
Author:
Fabrice Daugan

Field Summary
static SystemAbility instance
          An instance used to represent the game.
 
Fields inherited from class net.sf.magicproject.clickable.ability.Ability
optimizer, priority
 
Constructor Summary
SystemAbility(java.io.InputStream inputFile)
          Create an instance of SystemAbility
Structure of InputStream : Data[size] name name + '\0' [...]
 
Method Summary
 MAction[] actionList()
          Return list of actions to play to cast this ability
 MAction[] effectList()
          Return list of actions effects of this ability
 java.lang.String getAbilityTitle()
          Return ability html title.
 MCard getCard()
          Return card where is this ability.
 java.lang.String getLog(ContextEventListener context)
          Return a String identifying this ability with the name and/or card name.
 boolean isMatching()
          compare the current event to the event activating this ability.
 boolean recheckTargets()
          Is this ability contains targeting action.
 boolean triggerIt(ContextEventListener context)
          called when this ability is going to be triggered This method would add this ability to the triggered zone, or perform another play action
 
Methods inherited from class net.sf.magicproject.clickable.ability.Ability
addLinkedAbility, checkObjectActions, checkTargetActions, clone, equals, eventComing, getCardCopy, getController, getName, getPictureName, getTargetable, getTriggeredClone, getTriggeredCloneChoice, hashCode, hasHighPriority, isAutoResolve, isHidden, isPlayAsSpell, manaNeeded, optimizeRegisterToManager, registerToManager, removeFromManager, resolveStack, setEvent, toHtmlString, toString
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

instance

public static SystemAbility instance
An instance used to represent the game.

Constructor Detail

SystemAbility

public SystemAbility(java.io.InputStream inputFile)
              throws java.io.IOException
Create an instance of SystemAbility

Parameters:
inputFile - file containing this ability
Throws:
java.io.IOException
Method Detail

triggerIt

public boolean triggerIt(ContextEventListener context)
Description copied from class: Ability
called when this ability is going to be triggered This method would add this ability to the triggered zone, or perform another play action

Overrides:
triggerIt in class Ability
Parameters:
context - the context needed by event activated
Returns:
true if this ability has been added to the triggered buffer zone, return false otherwise

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

Specified by:
isMatching in class Ability
Returns:
true if this ability can be played responding the current event

actionList

public final MAction[] actionList()
Description copied from class: Ability
Return list of actions to play to cast this ability

Specified by:
actionList in class Ability
Returns:
list of actions to play to cast this ability

getCard

public MCard getCard()
Description copied from class: Ability
Return card where is this ability. As default, it return null.

Specified by:
getCard in interface Unregisterable
Specified by:
getCard in class Ability
Returns:
true card where is this ability

effectList

public MAction[] effectList()
Description copied from class: Ability
Return list of actions effects of this ability

Specified by:
effectList in class Ability
Returns:
list of actions effects of this ability

recheckTargets

public boolean recheckTargets()
Description copied from class: Ability
Is this ability contains targeting action.

Overrides:
recheckTargets in class Ability
Returns:
true if this ability contains targeting action.

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


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