6 #include "ai/weapons/whimstar.h"
7 #define MAX_INVENTORY 42
9 class Player
: public Object
14 // current physics constants (change when you go underwater, etc)
15 int fallspeed
, walkspeed
;
16 int fallaccel
, jumpfallaccel
;
17 int walkaccel
, jumpwalkaccel
;
21 // attributes player is touching: water etc
24 int airleft
; // remaining air (is scaled x10)
25 int airshowtimer
; // used for blinking "100" when coming out of water
27 bool walking
, lastwalking
;
31 bool jumping
; // 1 if jump physics are enabled
33 uint8_t look
; // 0 = not looking, UP = looking up, DOWN = looking down
34 uint8_t lookscroll
; // which way the screen should scroll because of a look
35 uint8_t lookscroll_timer
; // delays a moment before scrolling when player pushes UP/DOWN
37 bool inputs_locked
; // if 1, the controls are turned off (player can't control his sprite)
38 bool inputs_locked_lasttime
;
40 bool dead
; // deactivates player AI...do we really need this?
41 bool hide
; // if 1, player and his statusbar is invisible
42 bool drowned
; // if 1, player drowning code has been activated
43 // if 1, player is invisible and controls unresponsive
44 // but statusbar still shown.
47 bool lookaway
; // 1 makes him look away from screen (eg when you push DOWN)
49 int inventory
[MAX_INVENTORY
]; // list of inventory items we have
50 int ninventory
; // how many objects are in inventory[]
52 Object
*riding
; // if non-null, he is "riding" this object (used for solidity)
53 Object
*lastriding
; // for thud sound
54 // if non-null then this points at an object for which ->riding cannot be set.
55 // This is used when a platform you are riding tries to push you into the ceiling
56 // and so the engine deals with it by having you fall through the platform instead.
58 // object if any that caused player's blocku to be set
59 Object
*bopped_object
;
61 // <UNI mode--used with Ironhead battle
64 // how much fuel you have left in the Booster for this jump
66 int booststate
; // one of BoosterDir enum
68 bool hitwhileboosting
; // bit of a hack, to make hurthop work
70 // controls "+xx" floattext numbers when you gain XP
73 Weapon weapons
[WPN_COUNT
];
76 int maxHealth
; // max health
78 int hurt_time
; // timer for blinks after getting hit
79 bool hurt_flash_state
; // if 1, player is invisible because he's blinking
81 // when displaying the water bubble (air tank item) this is the frame shown
82 uint8_t water_shield_frame
;
83 uint8_t water_shield_timer
;
87 WhimsicalStar whimstar
;
89 // additional "block" points placed further in than the real block points.
90 // if these make it inside a block the player is "pushed" out of the block.
91 // they can get inside the block because his R/L points are further out than his
92 // D/U points because of his odd shape.
97 int nrepel_l
, nrepel_r
, nrepel_u
, nrepel_d
;
100 extern Player
*player
;
101 extern bool pinputs
[INPUT_COUNT
];
102 extern bool lastpinputs
[INPUT_COUNT
];
111 // how much fuel you start out with in the Booster on each jump.
112 // (for both 0.8 and 2.0)
113 #define BOOSTER_FUEL_QTY 50
124 #define EQUIP_BOOSTER08 0x01
125 #define EQUIP_MAP 0x02
126 #define EQUIP_ARMS_BARRIER 0x04
127 #define EQUIP_TURBOCHARGE 0x08
128 #define EQUIP_AIRTANK 0x10
129 #define EQUIP_BOOSTER20 0x20
130 #define EQUIP_MIMIGA_MASK 0x40
131 #define EQUIP_WHIMSTAR 0x80
132 #define EQUIP_NIKUMARU 0x100
134 void AddXP(int xp
, bool quiet
= false);
135 void SubXP(int xp
, bool quiet
= false);