diff options
author | quou <quou@disroot.org> | 2024-10-01 20:40:11 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-10-01 20:40:11 +1000 |
commit | 5ae0a01f81f98b6bed04ec6e3c6a687317489d91 (patch) | |
tree | e024ca4b6fcd63d946a1a73c76f077c326b95bfc | |
parent | f06c36339c3c4d1c3287f710c6963c643bc5219d (diff) |
special charge
-rw-r--r-- | config.h | 1 | ||||
-rw-r--r-- | enemy.c | 3 | ||||
-rw-r--r-- | obj.h | 2 | ||||
-rw-r--r-- | player.c | 1 |
4 files changed, 5 insertions, 2 deletions
@@ -40,6 +40,7 @@ #define player_lunge_force (f1) #define player_slash_damage 1 #define player_health 8 +#define player_special_hits 4 #define enemy_inv_frames 8 #define enemy_demon_move_force 32 @@ -80,7 +80,7 @@ void update_enemy_phys(Enemy* e, const Map* map) { ); } -void update_enemy_hurt(Enemy* e, const World* w) { +void update_enemy_hurt(Enemy* e, World* w) { Rect a; int i; if (e->inv) { @@ -97,6 +97,7 @@ void update_enemy_hurt(Enemy* e, const World* w) { e->vx -= dz->vx; e->vy -= dz->vy; e->inv = enemy_inv_frames; + w->player.charge++; } } } @@ -19,7 +19,7 @@ typedef struct { int anim; int grounded, headbutted, on_ramp, jumping; int cooldown, slashing; - int inv, hp; + int inv, hp, charge; Face face; Rect rect; } Player; @@ -26,6 +26,7 @@ void init_player(Player* p) { p->face = face_right; p->inv = 0; p->hp = player_health; + p->charge = 0; } void update_player_anim(Player* p) { |