1 
2 #ifndef _CARET_H
3 #define _CARET_H
4 
5 enum EffectTypes
6 {
7 	EFFECT_NONE = 0,
8 
9 	EFFECT_STARSOLID,				// "shot hit wall" dissipation effect
10 	EFFECT_STARPOOF,				// "shot exceeded ttl" dissipation effect
11 	EFFECT_FISHY,					// common enemy shot dissipation effect
12 	EFFECT_BLOODSPLATTER,			// "blood" spatter from hitting enemies
13 	EFFECT_BONKPLUS,				// two +'s from player hitting head
14 	EFFECT_BOOMFLASH,				// big white circle flash from enemies exploding etc
15 	EFFECT_LEVELUP,
16 	EFFECT_LEVELDOWN,
17 	EFFECT_QMARK,					// "?" from pressing down with nothing nearby
18 	EFFECT_BONUSFLASH,				// small bright "tink" when hearts/missiles disappear
19 	EFFECT_ZZZZ,					// rising sleeping zzzzz's
20 	EFFECT_EMPTY,					// rising text that says "empty"
21 	EFFECT_SMOKETRAIL,				// small smoke puff
22 	EFFECT_SMOKETRAIL_SLOW,			// small smoke puff (slower animate)
23 	EFFECT_HEY,						// balloon that says "Hey!" (from grasstown)
24 	EFFECT_GUNFISH_BUBBLE,			// bubbles spawned during dissipation of Gunfish shots
25 	EFFECT_LAVA_SPLASH,				// just red version of gunfish bubble, really
26 	EFFECT_BUBBLE_BURST,			// Bubbler dissipation effect. is NOT CENTERED.
27 	EFFECT_SPUR_HIT,				// Spur hit wall effect, used in addition to starsolid.
28 	EFFECT_GHOST_SPARKLE			// rising sparkles from Ballos's dog
29 };
30 
31 
32 namespace Carets
33 {
34 	bool init(void);
35 	void close(void);
36 
37 	void DrawAll(void);
38 	int CountByEffectType(int type);
39 	int DeleteByEffectType(int type);
40 	void DestroyAll(void);
41 };
42 
43 // synonyms
44 #define CountEffectsOfType		Carets::CountByEffectType
45 #define DeleteEffectsOfType		Carets::DeleteByEffectType
46 
47 struct Caret
48 {
49 	void (*OnTick)(Caret *c);
50 
51 	int x, y;
52 	int xinertia, yinertia;
53 	int sprite, frame;
54 
55 	int state;
56 	int effecttype;
57 
58 	int timer, timer2;
59 	int animtimer;
60 
61 	bool invisible;
62 	bool deleted;
63 
64 	Caret *next, *prev;
65 
66 // ---------------------------------------
67 
68 	void Delete();
69 	void Destroy();
70 	void MoveAtDir(int dir, int speed);
71 
72 	void anim(int speed);
73 	void animdie(int speed);
74 };
75 
76 Caret *CreateCaret(int x, int y, int sprite, void (*ontick)(Caret *c), \
77 				   int xinertia=0, int yinertia=0);
78 
79 
80 #endif
81 
82