22 #ifndef NUVIE_CORE_EFFECT_H 23 #define NUVIE_CORE_EFFECT_H 26 #include "ultima/nuvie/misc/call_back.h" 27 #include "ultima/nuvie/core/map.h" 28 #include "ultima/nuvie/core/obj_manager.h" 29 #include "ultima/nuvie/core/anim_manager.h" 83 if (retain_count > 0) retain_count--;
85 bool is_retained()
const {
86 return retain_count == 0 ? false :
true;
94 bool is_defunct()
const {
97 uint16 callback(uint16,
CallBack *,
void *)
override {
118 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
129 uint16 initial_tile_rotation;
130 uint16 rotation_amount;
131 uint8 src_tile_y_offset;
132 uint16 finished_tiles;
136 virtual void start_anim();
140 initial_tile_rotation(0), rotation_amount(0), src_tile_y_offset(0),
143 ProjectileEffect(uint16 tileNum,
MapCoord start,
MapCoord target, uint8 speed,
bool trailFlag, uint16 initialTileRotation, uint16 rotationAmount, uint8 src_y_offset);
146 void init(uint16 tileNum,
MapCoord start,
const vector<MapCoord> &t, uint8 speed,
bool trailFlag, uint16 initialTileRotation, uint16 rotationAmount, uint8 src_y_offset);
148 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
151 return &hit_entities;
163 void start_anim()
override;
187 void start_timer(uint32 delay);
192 Effect::delete_self();
195 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override {
196 if (msg == MESG_TIMED) delete_self();
216 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
218 void init_directions();
230 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
240 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
259 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
262 virtual void delete_self() {
263 Effect::delete_self();
265 virtual bool hit_object(
Obj *obj) {
280 :
ExplosiveEffect(x, y, size, dmg), obj(src_obj), original_obj(dont_hit_me) {
282 void delete_self()
override;
283 bool hit_object(
Obj *hit_obj)
override;
301 const Tile *throw_tile;
313 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override = 0;
322 Actor *drop_from_actor;
328 void get_obj(
Obj *obj, uint16 qty);
329 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
332 #define MISSILE_DEFAULT_SPEED 200 333 #define MISSILE_HIT_TARGET TOSS_TO_BLOCKING 334 #define MISSILE_HIT_OBJECTS (TOSS_TO_BLOCKING|TOSS_TO_OBJECT) 335 #define MISSILE_HIT_ACTORS (TOSS_TO_BLOCKING|TOSS_TO_ACTOR) 336 #define MISSILE_HIT_ALL (TOSS_TO_BLOCKING|TOSS_TO_OBJECT|TOSS_TO_ACTOR) 356 const MapCoord &target, uint8 dmg, uint8 intercept = MISSILE_HIT_TARGET, uint16 speed = MISSILE_DEFAULT_SPEED);
358 void init(uint16 tile_num, uint16 obj_n,
const MapCoord &source,
359 const MapCoord &target, uint32 dmg, uint8 intercept, uint32 speed);
362 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
389 uint8 stop_hour, stop_minute;
396 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
401 typedef enum { FADE_PIXELATED, FADE_CIRCLE, FADE_PIXELATED_ONTOP } FadeType;
402 typedef enum { FADE_IN, FADE_OUT } FadeDirection;
418 FadeDirection fade_dir;
420 uint8 pixelated_color;
422 uint16 fade_x, fade_y;
424 uint32 evtime, prev_evtime;
425 uint32 pixel_count, colored_total;
426 uint16 fade_iterations;
429 FadeEffect(FadeType fade, FadeDirection dir, uint32 color = 0, uint32 speed = 0);
433 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
435 bool pixelated_fade_out();
436 bool pixelated_fade_in();
437 bool circle_fade_out();
438 bool circle_fade_in();
443 void init(FadeType fade, FadeDirection dir, uint32 color,
Graphics::ManagedSurface *capture, uint16 x, uint16 y, uint32 speed);
444 void init_pixelated_fade();
445 void init_circle_fade();
447 inline bool find_free_pixel(uint32 &rnum, uint32 pixel_count);
448 uint32 pixels_to_check();
449 bool pixelated_fade_core(uint32 pixels_to_check, sint16 fade_to);
460 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
470 FadeDirection fade_dir;
474 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
481 #define VANISH_WAIT true 482 #define VANISH_NOWAIT false 488 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
500 uint16 num_anim_running;
506 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
509 void add_actor_anim();
512 void add_obj_anim(
Obj *obj);
522 uint16 num_anim_running;
527 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
529 void init(uint8 fade_color, uint16 speed);
530 void add_actor_anim();
531 void add_obj_anim(
Obj *o);
543 void xor_capture(uint8 mod);
552 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
561 uint32 start_length, eff1_length, eff2_length, xray_length;
565 void xor_capture(uint8 mod);
574 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
587 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
594 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
595 virtual void delete_self() {
596 Effect::delete_self();
607 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
618 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
619 virtual void delete_self() {
620 Effect::delete_self();
627 const uint8 peer_tilemap[4] = {
635 const uint8 peer_tile[PEER_TILEW * PEER_TILEW] = {
654 inline void blit_tile(uint16 x, uint16 y, uint8 c);
655 inline void blit_actor(
Actor *actor);
656 inline uint8 get_tilemap_type(uint16 wx, uint16 wy, uint8 wz);
657 void fill_buffer(uint8 *mapbuffer, uint16 x, uint16 y);
661 PeerEffect(uint16 x, uint16 y, uint8 z,
Obj *callback_obj = 0);
664 void delete_self()
override;
675 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
682 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
685 #define EFFECT_PROCESS_GUI_INPUT true 691 bool effect_complete;
696 void run(
bool process_gui_input =
false);
697 uint16 callback(uint16 msg,
CallBack *caller,
void *data)
override;
Definition: managed_surface.h:51
Definition: map_window.h:73
Definition: usecode.h:151
Definition: effect_manager.h:34
Definition: atari-screen.h:60
Definition: actor_manager.h:42
Definition: timed_event.h:209
Definition: detection.h:27
Definition: call_back.h:50
Definition: obj_manager.h:75
Definition: anim_manager.h:112
Definition: timed_event.h:231
Definition: tile_manager.h:113