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

Class HoldGroundStance

source code

  Component --+        
              |        
StanceComponent --+    
                  |    
  LimitedMoveStance --+
                      |
                     HoldGroundStance

Stance in radius and not attacks units in close range

Instance Methods [hide private]
 
__init__(self)
Used for initialization code that does not require any other components.
source code
    Inherited from LimitedMoveStance
 
act_auto_attack(self)
Check if target still exists or if unit exited the hold ground area
source code
 
act_idle(self)
Find target in range then attack it
source code
 
act_move_back(self)
When moving back try to find target.
source code
 
act_user_attack(self)
If attack ends, update the returning position
source code
 
act_user_move(self)
At the end of user move change the returning position
source code
 
get_instance_data(self) source code
 
get_target(self, radius)
Returns closest attackable unit in radius
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_flee(self)
Method executed when the instance is trying to evade an attack
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 = 'hold_ground_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)