CVorticon.h 2.38 KB
Newer Older
1

2 3 4
#ifndef __CVORTICON__
#define __CVORTICON__

Gerhard Stein's avatar
Gerhard Stein committed
5
#include "engine/vorticon/CVorticonSpriteObject.h"
6 7
#include "../../../common/CPlayer.h"
#include <vector>
8

gerstrong's avatar
gerstrong committed
9 10
// TODO: VOrticon, when charges. His speed is 37. Need to implement it still.

11
#define VORT_JUMP_PROB_EASY     10
12 13
#define VORT_JUMP_PROB          20
#define VORT_JUMP_PROB_HARD     30
14

15 16
#define VORT_MIN_JUMP_HEIGHT    90
#define VORT_MAX_JUMP_HEIGHT    150
17 18 19
#define VORT_MAX_FALL_SPEED     320
#define VORT_JUMP_FRICTION      5

gerstrong's avatar
gerstrong committed
20
#define VORT_WALK_SPEED         28
21
#define VORT_WALK_ANIM_TIME     4
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58


// number of shots to kill
#define VORT_HP                 4
#define VORT_COMMANDER_HP       105

#define VORT_DIE_ANIM_TIME      25
#define VORT2_DIE_ANIM_TIME     25

#define VORT_LOOK_ANIM_TIME     15

#define VORT1_WALK_LEFT_FRAME    70
#define VORT1_WALK_RIGHT_FRAME   74
#define VORT1_LOOK_FRAME         78
#define VORT1_JUMP_RIGHT_FRAME   80
#define VORT1_JUMP_LEFT_FRAME    81
#define VORT1_DYING_FRAME        82

#define VORT2_WALK_LEFT_FRAME    74
#define VORT2_WALK_RIGHT_FRAME   78
#define VORT2_LOOK_FRAME         82
#define VORT2_JUMP_RIGHT_FRAME   84
#define VORT2_JUMP_LEFT_FRAME    85
#define VORT2_DYING_FRAME        86
#define VORT2_DEAD_FRAME         87

#define VORT3_WALK_LEFT_FRAME    63
#define VORT3_WALK_RIGHT_FRAME   67
#define VORT3_LOOK_FRAME         71
#define VORT3_JUMP_RIGHT_FRAME   73
#define VORT3_JUMP_LEFT_FRAME    74
#define VORT3_DYING_FRAME        75
#define VORT3_DEAD_FRAME         76

#define VORT_PALETTE_FLASH_TIME  5

#define VORT_TRAPPED_DIST        160
59

Gerhard Stein's avatar
Gerhard Stein committed
60
class CVorticon : public CVorticonSpriteObject
61 62
{
public:
63
	CVorticon( CMap *p_map, Uint32 x, Uint32 y, char hp=1, object_t objtype=OBJ_VORT);
Gerhard Stein's avatar
Gerhard Stein committed
64
	virtual bool isNearby(CVorticonSpriteObject &theObject);
65
	void getTouchedBy(CVorticonSpriteObject &theObject);
66 67 68
	void process();
	void initiateJump();

Gerhard Stein's avatar
Gerhard Stein committed
69
protected:
70
	int m_Level;
71
	bool &m_Dark;
72 73 74 75 76 77 78 79 80 81 82 83 84 85

	enum {
	VORT_WALK,
	VORT_JUMP,
	VORT_LOOK,
	VORT_DYING,
	VORT2_DYING
	}state;

	unsigned char timer,timer2;
	unsigned int animtimer;
	unsigned char frame;
	unsigned int dist_traveled;

Gerhard Stein's avatar
Gerhard Stein committed
86
	direction_t movedir;
87 88 89 90 91 92 93 94 95 96
	// these hold the animation frames indexes since they're
	// different for each episode
	int WalkLeftFrame;
	int WalkRightFrame;
	int LookFrame;
	int JumpRightFrame;
	int JumpLeftFrame;
	int DyingFrame;
	int DeadFrame;
};
97 98

#endif //__CVORTICON__