Module npc_guard :: Class NPC_guard
[hide private]
[frames] | no frames]

Class NPC_guard

source code


A guard is a low-level NPC fighter who will quickly engage and can call for reinforcements.

Instance Methods [hide private]
 
__init__(self, name='guard', descr=None)
create a new GameObject
source code
 
accept_action(self, action, actor, context)
receive and process the effects of an action
source code
 
take_turn(self)
Take action when your turn comes.
source code

Inherited from gameactor.GameActor: interact, set_context, take_action

Inherited from gameactor.GameActor (private): _accept_attack

Inherited from gameobject.GameObject: __str__, add_object, get_object, get_objects, load, possible_actions

Inherited from base.Base: get, set

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Instance Variables [hide private]

Inherited from gameobject.GameObject: objects

Inherited from base.Base: attributes, description, name

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, name='guard', descr=None)
(Constructor)

source code 

create a new GameObject

Parameters:
  • name - display name of this object
  • descr - human description of this object
Overrides: object.__init__

accept_action(self, action, actor, context)

source code 

receive and process the effects of an action

Parameters:
  • action - GameAction being performed
  • actor - GameActor) initiating the action
  • context - GameContext in which action is being taken
Returns:
(boolean success, string description of the effect)

The only special things about a guard ar that, if attacked (1) he counter-attacks (2) he can call for reinforcements.

Overrides: gameobject.GameObject.accept_action

take_turn(self)

source code 

Take action when your turn comes. The only actions this test Guard can take are fighting back

Overrides: gameactor.GameActor.take_turn