| 1 |
/** |
| 2 |
* Displayed sprite |
| 3 |
|
| 4 |
* Copyright (C) 1997, 1998, 1999, 2002, 2003 Seth A. Robinson |
| 5 |
* Copyright (C) 2005, 2007, 2008, 2009, 2014, 2015 Sylvain Beucler |
| 6 |
|
| 7 |
* This file is part of GNU FreeDink |
| 8 |
|
| 9 |
* GNU FreeDink is free software; you can redistribute it and/or |
| 10 |
* modify it under the terms of the GNU General Public License as |
| 11 |
* published by the Free Software Foundation; either version 3 of the |
| 12 |
* License, or (at your option) any later version. |
| 13 |
|
| 14 |
* GNU FreeDink is distributed in the hope that it will be useful, but |
| 15 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 17 |
* General Public License for more details. |
| 18 |
|
| 19 |
* You should have received a copy of the GNU General Public License |
| 20 |
* along with this program. If not, see |
| 21 |
* <http://www.gnu.org/licenses/>. |
| 22 |
*/ |
| 23 |
|
| 24 |
#ifndef _LIVE_SPRITE_H |
| 25 |
#define _LIVE_SPRITE_H |
| 26 |
|
| 27 |
#include "SDL.h" |
| 28 |
#include "rect.h" |
| 29 |
#include <map> |
| 30 |
#include <string> |
| 31 |
|
| 32 |
#include "IOGfxSurface.h" |
| 33 |
|
| 34 |
struct sp |
| 35 |
{ |
| 36 |
int x,moveman; |
| 37 |
int y; |
| 38 |
int mx,my; |
| 39 |
int lpx[51],lpy[51]; |
| 40 |
int speed; |
| 41 |
int brain; |
| 42 |
int seq_orig,dir; |
| 43 |
int seq; |
| 44 |
int frame; |
| 45 |
unsigned long delay; |
| 46 |
int pseq; |
| 47 |
int pframe; |
| 48 |
|
| 49 |
bool active; |
| 50 |
int attrib; |
| 51 |
unsigned long wait; |
| 52 |
int timing; |
| 53 |
int skip; |
| 54 |
int skiptimer; |
| 55 |
int size; |
| 56 |
int que; |
| 57 |
int base_walk; |
| 58 |
int base_idle; |
| 59 |
int base_attack; |
| 60 |
|
| 61 |
int base_hit; |
| 62 |
int last_sound; |
| 63 |
int hard; |
| 64 |
rect alt; |
| 65 |
int althard; |
| 66 |
int sp_index; /* editor_sprite */ |
| 67 |
/*BOOL*/int nocontrol; |
| 68 |
int idle; |
| 69 |
int strength; |
| 70 |
int damage; |
| 71 |
int defense; |
| 72 |
int hitpoints; |
| 73 |
int exp; |
| 74 |
int gold; |
| 75 |
int base_die; |
| 76 |
int kill_ttl; /* time to live */ |
| 77 |
Uint32 kill_start; /* birth */ |
| 78 |
int script_num; |
| 79 |
char text[200]; |
| 80 |
int text_owner; /* if text sprite, sprite that is saying it */ |
| 81 |
IOGfxSurface* text_cache; |
| 82 |
SDL_Rect text_cache_reldst; |
| 83 |
SDL_Color text_cache_color; |
| 84 |
int script; |
| 85 |
int sound; |
| 86 |
int say_stop_callback; /* callback from a say_stop*() DinkC function */ |
| 87 |
int freeze; |
| 88 |
/*bool*/int move_active; |
| 89 |
int move_script; |
| 90 |
int move_dir; |
| 91 |
int move_num; |
| 92 |
/*BOOL*/int move_nohard; |
| 93 |
int follow; |
| 94 |
int nohit; |
| 95 |
/*BOOL*/int notouch; |
| 96 |
unsigned long notouch_timer; |
| 97 |
/*BOOL*/int flying; |
| 98 |
int touch_damage; |
| 99 |
int brain_parm; |
| 100 |
int brain_parm2; |
| 101 |
/*BOOL*/int noclip; |
| 102 |
/*BOOL*/int reverse; |
| 103 |
/*BOOL*/int disabled; |
| 104 |
int target; |
| 105 |
int attack_wait; |
| 106 |
Uint32 move_wait; |
| 107 |
int distance; |
| 108 |
int last_hit; |
| 109 |
/*BOOL*/int live; /* sprite created from say_stop_xy(), and ignored by lsm_kill_all_nonlive_sprites */ |
| 110 |
int range; |
| 111 |
int attack_hit_sound; |
| 112 |
int attack_hit_sound_speed; |
| 113 |
int action; |
| 114 |
int nodraw; |
| 115 |
int frame_delay; |
| 116 |
int picfreeze; |
| 117 |
/* v1.08 */ |
| 118 |
int bloodseq; |
| 119 |
int bloodnum; |
| 120 |
std::map<std::string, int>* custom; |
| 121 |
}; |
| 122 |
|
| 123 |
extern int getpic(int sprite_no); |
| 124 |
extern void check_sprite_status_full(int sprite_no); |
| 125 |
extern void check_sprite_status(int h); |
| 126 |
|
| 127 |
extern void live_sprite_set_kill_start(int h, Uint32 thisTickCount); |
| 128 |
extern bool live_sprite_is_expired(int h, Uint32 thisTickCount); |
| 129 |
|
| 130 |
extern void live_sprite_animate(int h, Uint32 thisTickCount, bool* p_isHitting); |
| 131 |
|
| 132 |
#endif |