aboutsummaryrefslogtreecommitdiff
path: root/src/entities/caporale.c
diff options
context:
space:
mode:
authornathansmithsmith <nathansmith7@mailfence.com>2023-08-18 22:13:36 -0600
committernathansmithsmith <nathansmith7@mailfence.com>2023-08-18 22:13:36 -0600
commitcbc6853814b0d1c4cd58784ee8e5c619c6491323 (patch)
treea16559e61305223b097e5d96502d1c419575f06a /src/entities/caporale.c
parent97c711ab6b6823d09893582281203dcade1cfe9a (diff)
Caporale has higher hit damage when on low health now
Diffstat (limited to 'src/entities/caporale.c')
-rw-r--r--src/entities/caporale.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/entities/caporale.c b/src/entities/caporale.c
index ff5e6b2..e4566dd 100644
--- a/src/entities/caporale.c
+++ b/src/entities/caporale.c
@@ -62,8 +62,13 @@ void updateGunsCaporale(Game * game, Entity * entity) {
Vector3 direction = Vector3Subtract(player->position, entity->position);
direction = Vector3Normalize(direction);
+ float damage = CAPORALE_BULLET_DAMAGE;
+
+ if (entity->health <= CAPORALE_LOW_HEALTH_THRESHOLD)
+ damage = CAPORALE_LOW_HEALTH_BULLET_DAMAGE;
+
// Create bullet and shoot.
- Bullet bullet = createBulletFromDirection(*entity, direction, CAPORALE_BULLET_DAMAGE);
+ Bullet bullet = createBulletFromDirection(*entity, direction, damage);
shootBulletAtEntity(player, bullet);
}