Package horizons :: Package component :: Module stancecomponent :: Class FleeStance
[hide private]
[frames] | no frames]

Class FleeStance

source code

  Component --+    
              |    
StanceComponent --+
                  |
                 FleeStance

Move away from any approaching units

Instance Methods [hide private]
 
__init__(self)
Used for initialization code that does not require any other components.
source code
 
act_idle(self)
If an enemy unit approaches move away from it
source code
 
act_flee(self)
If movemen stops, switch to idle
source code
 
get_approaching_unit(self)
Gets the closest unit that can fire to instance
source code
    Inherited from StanceComponent
 
act(self)
Act according to current state This is called every few second in the instance code
source code
 
act_auto_attack(self)
Method executed when the instance has auto acquired target
source code
 
act_move_back(self)
Method executed when the instance is moving back to it's default location
source code
 
act_user_attack(self)
Method executed when the instance is trying to attack a target selected by the user
source code
 
act_user_move(self)
Method executed when the instance is moving to a location selected by the user
source code
 
get_state(self) source code
 
initialize(self)
This is called by the ComponentHolder after it set the instance.
source code
 
remove(self)
Removes component and reference to instance
source code
 
set_state(self, state) source code
    Inherited from Component
 
__gt__(self, other) source code
 
__lt__(self, other) source code
 
load(self, db, worldid)
This does on load what __init() and initalize() together do on constructions at runtime.
source code
 
save(self, db)
Will do nothing, but will be always called in componentholder code, even if not implemented.
source code
 
session(self) source code
Class Methods [hide private]
    Inherited from Component
 
get_instance(cls, arguments=None)
This function is used to instantiate classes from yaml data.
source code
Class Variables [hide private]
  NAME = 'flee_stance'
hash(x)
    Inherited from Component
  DEPENDENCIES = []
Method Details [hide private]

__init__(self)
(Constructor)

source code 

Used for initialization code that does not require any other components. This is always called first, on construction and on load.

Overrides: Component.__init__
(inherited documentation)

act_idle(self)

source code 

If an enemy unit approaches move away from it

Overrides: StanceComponent.act_idle

act_flee(self)

source code 

If movemen stops, switch to idle

Overrides: StanceComponent.act_flee