- // Sprite.h: interface for the CSprite class.
- //作者:吴雪平 2002-6-17日修改
- //实现精灵的行为,人工智能可以在这里加入
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_SPRITE_H__ABCAFE21_3E63_11D6_812C_5254AB37CDC9__INCLUDED_)
- #define AFX_SPRITE_H__ABCAFE21_3E63_11D6_812C_5254AB37CDC9__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "camera.h"
- #include "ammomanager.h"
- #include "heightmap.h"
- #include "cmath.h"
- #define IDLE1 0
- #define RUN 1
- #define SHOT_STAND 2
- #define SHOT_SHOULDER 3
- #define JUMP 4
- #define IDLE2 5
- #define SHOT_FALLDOWN 6
- #define IDLE3 7
- #define IDLE4 8
- #define CROUCH 9
- #define CROUCH_CRAWL 10
- #define CROUCH_IDLE 11
- #define CROUCH_DEATH 12
- #define DEATH_FALLBACK 13
- #define DEATH_FALLFORWARD 14
- #define DEATH_FALLBACKSLOW 15
- #define IDLE1_START 0
- #define IDLE1_END 39
- #define RUN_START 40
- #define RUN_END 45
- #define SHOT_STAND_START 46
- #define SHOT_STAND_END 60
- #define SHOT_SHOULDER_START 61
- #define SHOT_SHOULDER_END 66
- #define JUMP_START 67
- #define JUMP_END 73
- #define IDLE2_START 74
- #define IDLE2_END 95
- #define SHOT_FALLDOWN_START 96
- #define SHOT_FALLDOWN_END 112
- #define IDLE3_START 113
- #define IDLE3_END 122
- #define IDLE4_START 123
- #define IDLE4_END 135
- #define CROUCH_START 136
- #define CROUCH_END 154
- #define CROUCH_CRAWL_START 155
- #define CROUCH_CRAWL_END 161
- #define CROUCH_IDLE_START 162
- #define CROUCH_IDLE_END 169
- #define CROUCH_DEATH_START 170
- #define CROUCH_DEATH_END 177
- #define DEATH_FALLBACK_START 178
- #define DEATH_FALLBACK_END 185
- #define DEATH_FALLFORWARD_START 186
- #define DEATH_FALLFORWARD_END 190
- #define DEATH_FALLBACKSLOW_START 191
- #define DEATH_FALLBACKSLOW_END 198
- class CSprite
- {
- public:
- CSprite();
- virtual ~CSprite();
- bool InitSprite(int id,VERTEX startPos,float roty,int totalFrames,
- float height,BOUNDARY_3D boundary,bool bControlled=false);
- void ResetSpriteState(VERTEX resetPos,float rotY,int state);
- void DrawSprite();
- void UpdateSprite();
- void SetSpriteState(int state);
- void CheckState();
- //////////////////////////////
- //protected:
- void CheckSunVisible();
- int m_nID;
- bool m_bControlled;
- bool m_bAttacked;
- bool m_bAttacking;
- float m_Health;
- BOUNDARY_3D m_Boundary;
- CCamera m_Camera;
- // CAmmoManager m_cAmmoManger;
- CHeightmap m_cHmap;
- CMath m_cMath;
- bool m_bHasWeapon;
- float m_RunSpeed;
- float m_angleX;
- float m_height;
- int m_nFrames;
- int m_nState;
- int m_stateStart;
- int m_stateEnd;
- int m_startFrame;
- int m_endFrame;
- float m_percent;
- };
- #endif // !defined(AFX_SPRITE_H__ABCAFE21_3E63_11D6_812C_5254AB37CDC9__INCLUDED_)