Action Functions

From theFarWilds
Revision as of 19:09, 14 April 2010 by Jed (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

An action object represents an action either about to happen or that already happened or that you are building to have happen.

Example

void afterAction(Action action)
{
       if(action.getCardActor().getName()=="Bindweed")
	{
		Entity target=action.getEntityTarget(0);
		if( target.getController()==gAIPlayer)
		{
			string msg="Bindweed on the enemy????";
                       statusMsg(nullPlayer,msg);
		}
	}
}

Constructors

Methods

int getType();
// possible values: MOVE, MELEE, SHOOT, OTHER 

Player getController();

Card getCardActor();
// Card will be invalid if this wasn't a card that acted

Entity getEntityActor();
// Entity will be invalid if this wasn't an Entity that acted
 
Entity getEntityTarget(int index)

Location getLocTarget(int index)