20 #ifndef __REACTION_H__ 21 #define __REACTION_H__ 26 #include <csutil/csstring.h> 27 #include <csutil/array.h> 28 #include <iutil/document.h> bool GetRandomValid(int i)
This embodies any perception an NPC might have, or any game event of interest.
const csString GetType(NPC *npc) const
csString GetAffectedBehaviors()
float weight
The weight to apply to deltas.
A MathScript is a mini-program to run.
csArray< Behavior * > affected
csArray< bool > randomsValid
bool SetValue(int i, int value)
Setting the value.
A set of operations building a generic behavior for a NPC.
bool ShouldReact(gemNPCObject *entity)
Check if the player should react to this reaction.
void React(NPC *who, Perception *pcpt)
bool Load(iDocumentNode *node, BehaviorSet &behaviors)
bool DoNotInterrupt(Behavior *behavior)
Check if this is a behavior that shouldn't be interrupted.
csString lastTriggered
Used for debug, show when this was last triggered.
csArray< csString > doNotInterrupt
bool GetValueValid(int i)
DesireType desireType
Indicate the type of desire change this reaction has.
A reaction embodies the change in desire which occurs in an NPC when he perceives something...
MathScript * calcCondition
This is the particular calculation for condition.
NPC * npc
Pointer to the NPC for this brain.
csArray< bool > valuesValid
This object represents each NPC managed by this superclient.
bool OnlyInterrupt(Behavior *behavior)
Check if this is a behavior is on the only interrupt list if set.
BehaviorSet behaviors
The set of behaviors available for this NPCType.
const csString & GetLastTriggerd()
csArray< csString > onlyInterrupt
A collection of behaviors and reactions will represent a type of npc.
float desireValue
The value to use for the desire type.
Reaction(Reaction &other, BehaviorSet &behaviors)
This is the set of Behaviors available for an NPC.
void DeepCopy(Reaction &other, BehaviorSet &behaviors)
const csString & GetEventType() const