- // (C) Copyright 1996 by Anthony J. Carin. All Rights Reserved.
- #ifndef DUDE_H
- #define DUDE_H
- #include "baseobj.h"
- #include "attach.h"
- #include "arm.h"
- #include "leg.h"
- #include "head.h"
- #include "personal.h"
- #include "weapon.h"
- extern CString& getpath(CString& filename);
- class antagonist;
- class dude : public baseobject
- {
- public:
- dude(personal *p);
- ~dude();
- virtual void setto(view& v);
- virtual void draw();
- virtual void followcommands(command& c);
- virtual void shirtcolor(COLORREF c);
- virtual void pantscolor(COLORREF c);
- virtual void skincolor(COLORREF c);
- virtual void haircolor(COLORREF c) { c = c; }
- virtual void takedamage(float v);
- void ResetHealth() { m_health = 100; }
- CString& normalpunch() { return getpath(m_personal.normalpunch()); }
- CString& personalpunch() { return m_personal.punchlist(); }
- void righthandhold(baseobject *base) { releaserightweapon(); rightweapon = base; }
- void lefthandhold(baseobject *base) { releaseleftweapon(); leftweapon = base; }
- char isdead() { return (char) (m_health == 0); }
- void pickup();
- CString& filepath() { return m_personal.filepath(); }
- char ismale() { return (char) (m_personal.gender() == MALE); }
- char RightHandEmpty() { return (char)(rightweapon == 0); }
- char LeftHandEmpty() { return (char)(leftweapon == 0); }
- WeaponType RightHandWeaponType() { return (WeaponType)((handheld*)rightweapon)->NumType(); }
- WeaponType LeftHandWeaponType() { return (WeaponType)((handheld*)leftweapon)->NumType(); }
- protected:
- virtual void tiltright(float v);
- virtual void tiltleft(float v);
- virtual void tiltfoward(float v);
- virtual void tiltbackward(float v);
- virtual void turnleft(float v);
- virtual void turnright(float v);
- virtual void moveupward(float v);
- virtual void movefoward(float v);
- virtual void movebackward(float v);
- virtual void clear();
- virtual void personaleffect();
- void setpersonal(personal& p) { m_personal = p; }
- void releaserightweapon();
- void releaseleftweapon();
- view& righthandloc() { return rightarm->handloc(); }
- view& lefthandloc() { return leftarm->handloc(); }
- baseobject *rightweapon;
- baseobject *leftweapon;
- direction rightweapontilt;
- direction leftweapontilt;
- totalarm *rightarm;
- totalarm *leftarm;
- totalleg *rightleg;
- totalleg *leftleg;
- attachment *neck;
- head *m_head;
- personal m_personal;
- short m_health;
- private:
- void checkifgothit(instruction& inst);
- antagonist *findtarget();
- char inrange(view& v);
- float hightlevel;
- };
- inline void dude::tiltright(float v)
- {
- m_view.setzdir((direction) (TC_PI*v));
- }
- inline void dude::tiltleft(float v)
- {
- m_view.setzdir((direction) (-TC_PI*v));
- }
- inline void dude::tiltfoward(float v)
- {
- m_view.setxdir((direction) (TC_PI*v));
- }
- inline void dude::tiltbackward(float v)
- {
- m_view.setxdir((direction) (-TC_PI*v));
- }
- inline void dude::turnleft(float v)
- {
- m_view.setydir(m_view.ydirection() + (direction) (TC_PI*v));
- }
- inline void dude::turnright(float v)
- {
- m_view.setydir(m_view.ydirection() - (direction) (TC_PI*v));
- }
- #endif