convert line ends
[canaan.git] / prj / cam / src / actreact / reacbase.h
blob255c6a6c91aa17134dc7822856159a4a4969f9ed
1 /*
2 @Copyright Looking Glass Studios, Inc.
3 1996,1997,1998,1999,2000 Unpublished Work.
4 */
6 // $Header: r:/t2repos/thief2/src/actreact/reacbase.h,v 1.6 2000/01/29 12:44:34 adurant Exp $
7 #pragma once
9 #ifndef __REACBASE_H
10 #define __REACBASE_H
12 #include <stimtype.h>
13 #include <senstype.h>
15 ////////////////////////////////////////////////////////////
16 // ACT/REACT REACTION BASE TYPES
20 // Reaction Event
23 struct sReactionEvent
25 sStimEvent* stim;
26 sStimTrigger* trigger;
27 ObjID sensor_obj;
32 // Reaction Descriptor
35 struct sReactionTypeDesc
37 char name[32];
40 #define REACTION_PARAM_TYPE(x) { #x }
41 #define NO_REACTION_PARAM { "None" }
43 struct sReactionDesc
45 char name[32]; // reaction name
46 char friendly_name[64]; // human-readable name
47 struct sReactionTypeDesc param_type; // type of parameter data
48 ulong flags;
52 // Flags for Reaction Descriptor
54 // @NOTE: only use kReactionWorkOnProxy if you know what you're doing. This
55 // means that the effect will be propagated separately on both the host and
56 // proxies for this machine. It's your responsibility to make sure that
57 // this doesn't cause the effect to happen doubly (or worse)...
60 enum eReactionFlags
62 kReactionNoFlags = 0,
63 kReactionEdgeTrigger = 1 << 0, // trigger to start or stop (NYI)
64 kReactionHasDirectObj = 1 << 1, // param uses direct object
65 kReactionHasIndirectObj = 1 << 2, // param uses indirect object
66 kReactionWorkOnProxy = 1 << 3, // propagate even to proxy objects
70 // Reaction results
73 enum eReactionResult_
75 kReactionNormal, // everything is fine
76 kReactionMutate, // I mutated the event. Carry on with the changed version
77 kReactionAbort, // Don't fire more effects
81 // Reaction parameter
85 // Pointy-headed weenie that I am, I agonized over whether the
86 // parameter should be fixed size or not. How could I possibly
87 // decide on a size that was adequate for all reactions? In the end I
88 // decided that the ease of memory management on the receptron side
89 // made it worth doing. (MAHK 9/3)
92 enum eReactionParamObjects
94 kReactDirectObj, // direct object
95 kReactIndirectObj, // indirect object
96 kReactNumObjs, // num of object params
99 struct sReactParamData
101 char bits[32]; // We can increase this size as needed,
102 }; // remembering to version the receptron
103 // loader.
105 struct sReactionParam
107 ObjID obj[kReactNumObjs];
108 sReactParamData data;
112 #endif // __REACBASE_H