3 * Description: Every action that has to do with actors (playable and NPCs).
4 * It has all the lua stuff, which is messy as fuck.
7 class Actor
: public CLuaScript
12 int x
, y
, w
, h
, clip_x
, clip_y
, currentframe
, oldclip
, m_iMethodBase
, walk_time
;
13 float vertical_speed
, falltime
, speed
, ownspeed
, totalspeed
, vertical_acc
, horizontal_acc
;
18 int leftkey
, rightkey
, zkey
, xkey
, ckey
, shotcount
;
25 Game_overwatch
*overwatch
;
28 bool dying
, animating
, animup
, jumplock
, shootlock
,
29 switchlock
, physics
, controllable
, noclip
;
31 Direction currentdirection
;
37 //constructors and destructor.
38 Actor(int, int, const char*, const char*, Map
*, Audio
*, Game_overwatch
*, CLuaVirtualMachine
&);
39 Actor(int, int, const char*, const char*, Actor
*, Direction
, bool, Map
*, Audio
*, Game_overwatch
*, CLuaVirtualMachine
&);
42 //initializer (Common for constructors)
43 void init(int, int, const char*, const char*, Actor
*, Direction
, bool, Map
*, Audio
*, Game_overwatch
*, CLuaVirtualMachine
&);
45 //lua required methods
46 int ScriptCalling (CLuaVirtualMachine
&, int);
47 void HandleReturns (CLuaVirtualMachine
&, const char *);
50 bool can_move(Direction
, int, int);
54 void add_bullet(const char*, const char*);
55 void remove_bullet(void);
56 void accelerate(float, float);
57 void decelerate(float);
72 int get_currentframe(void);
73 void set_currentframe(int);
74 int get_oldclip(void);
75 void set_oldclip(int);
76 float get_vertical_speed(void);
77 void set_vertical_speed(float);
78 float get_vertical_acc(void);
79 void set_vertical_acc(float);
80 float get_falltime(void);
81 void set_falltime(float);
82 SDL_Surface
* get_sprite(void);
83 void set_collision(bool, int);
84 bool get_collision(int);
85 float get_speed(void);
86 void set_speed(float);
87 float get_ownspeed(void);
88 void set_ownspeed(float);
89 float get_totalspeed(void);
90 void set_totalspeed(float);
91 float get_horizontal_acc(void);
92 void set_horizontal_acc(float);
93 Enemy
get_enemy(void);
94 Direction
get_currentdirection(void);
95 int get_leftkey(void);
96 void set_leftkey(int);
97 int get_rightkey(void);
98 void set_rightkey(int);
103 bool get_physics(void);
104 void set_physics(bool);
105 bool get_dying(void);
106 void set_dying(bool);
107 bool get_controllable(void);
109 bool get_noclip(void);
111 //lua accessors (get)
112 int lget_x(CLuaVirtualMachine
&);
113 int lget_y(CLuaVirtualMachine
&);
114 int lget_w(CLuaVirtualMachine
&);
115 int lget_h(CLuaVirtualMachine
&);
116 int lget_clip_x(CLuaVirtualMachine
&);
117 int lget_clip_y(CLuaVirtualMachine
&);
118 int lget_currentframe(CLuaVirtualMachine
&);
119 int lget_oldclip(CLuaVirtualMachine
&);
120 int lget_vertical_speed(CLuaVirtualMachine
&);
121 int lget_falltime(CLuaVirtualMachine
&);
122 int lget_speed(CLuaVirtualMachine
&);
123 int lget_ownspeed(CLuaVirtualMachine
&);
124 int lget_totalspeed(CLuaVirtualMachine
&);
125 int lget_currentdirection(CLuaVirtualMachine
&);
126 int lget_collision(CLuaVirtualMachine
&);
127 int lget_map_sx(CLuaVirtualMachine
&);
128 int lget_map_sy(CLuaVirtualMachine
&);
129 int lget_cfg_max_map_w(CLuaVirtualMachine
&);
130 int lget_cfg_max_map_h(CLuaVirtualMachine
&);
131 int lget_cfg_screen_width(CLuaVirtualMachine
&);
132 int lget_cfg_screen_height(CLuaVirtualMachine
&);
133 int lget_leftkey(CLuaVirtualMachine
&);
134 int lget_rightkey(CLuaVirtualMachine
&);
135 int lget_zkey(CLuaVirtualMachine
&);
136 int lget_xkey(CLuaVirtualMachine
&);
137 int lget_jumplock(CLuaVirtualMachine
&);
138 int lget_shootlock(CLuaVirtualMachine
&);
139 int lget_shotcount(CLuaVirtualMachine
&);
140 int lget_ckey(CLuaVirtualMachine
&);
141 int lget_switchlock(CLuaVirtualMachine
&);
142 int lget_cfg_tile_w(CLuaVirtualMachine
&);
143 int lget_cfg_tile_h(CLuaVirtualMachine
&);
144 int lget_walk_time(CLuaVirtualMachine
&);
146 //lua accessors (set)
147 int lset_x(CLuaVirtualMachine
&);
148 int lset_y(CLuaVirtualMachine
&);
149 int lset_w(CLuaVirtualMachine
&);
150 int lset_h(CLuaVirtualMachine
&);
151 int lset_clip_x(CLuaVirtualMachine
&);
152 int lset_clip_y(CLuaVirtualMachine
&);
153 int lset_currentframe(CLuaVirtualMachine
&);
154 int lset_oldclip(CLuaVirtualMachine
&);
155 int lset_vertical_speed(CLuaVirtualMachine
&);
156 int lset_falltime(CLuaVirtualMachine
&);
157 int lset_speed(CLuaVirtualMachine
&);
158 int lset_ownspeed(CLuaVirtualMachine
&);
159 int lset_totalspeed(CLuaVirtualMachine
&);
160 int lset_currentdirection(CLuaVirtualMachine
&);
161 int lset_collision(CLuaVirtualMachine
&);
162 int lset_map_sx(CLuaVirtualMachine
&);
163 int lset_map_sy(CLuaVirtualMachine
&);
164 int lset_leftkey(CLuaVirtualMachine
&);
165 int lset_rightkey(CLuaVirtualMachine
&);
166 int lset_zkey(CLuaVirtualMachine
&);
167 int lset_xkey(CLuaVirtualMachine
&);
168 int lset_jumplock(CLuaVirtualMachine
&);
169 int lset_shootlock(CLuaVirtualMachine
&);
170 int lset_dying(CLuaVirtualMachine
&);
171 int lset_shotcount(CLuaVirtualMachine
&);
172 int lset_physics(CLuaVirtualMachine
&);
173 int lset_enemy(CLuaVirtualMachine
&);
174 int lset_controllable(CLuaVirtualMachine
&);
175 int lset_switchlock(CLuaVirtualMachine
&);
176 int lset_noclip(CLuaVirtualMachine
&);
177 int lset_walk_time(CLuaVirtualMachine
&);
180 int lcan_move(CLuaVirtualMachine
&);
181 int center_map(CLuaVirtualMachine
&);
182 int ladd_bullet(CLuaVirtualMachine
&);
183 int lload_clip(CLuaVirtualMachine
&);
184 int lplay_sfx(CLuaVirtualMachine
&);
185 int lplay_bgm(CLuaVirtualMachine
&);
186 int lstop_bgm(CLuaVirtualMachine
&);
187 int laccelerate(CLuaVirtualMachine
&);
188 int ldecelerate(CLuaVirtualMachine
&);