diff options
author | salaaad2 <arthurdurant263@gmail.com> | 2022-01-07 16:01:07 +0100 |
---|---|---|
committer | salaaad2 <arthurdurant263@gmail.com> | 2022-01-07 16:01:07 +0100 |
commit | a9fa439d8412b2c682d512bfe9cc9322caa4336e (patch) | |
tree | f33d1441c79d23faaade744a7f1d2ba718562fbb | |
parent | references are weaird, man (diff) | |
download | threshold-a9fa439d8412b2c682d512bfe9cc9322caa4336e.tar.gz threshold-a9fa439d8412b2c682d512bfe9cc9322caa4336e.tar.bz2 threshold-a9fa439d8412b2c682d512bfe9cc9322caa4336e.tar.xz threshold-a9fa439d8412b2c682d512bfe9cc9322caa4336e.tar.zst threshold-a9fa439d8412b2c682d512bfe9cc9322caa4336e.zip |
adjust boss hp and add back fury
-rw-r--r-- | meta/maps/stage_1_boss.bfm | 2 | ||||
-rw-r--r-- | src/gameplay.cpp | 2 | ||||
-rw-r--r-- | src/weapon.hpp | 2 | ||||
-rw-r--r-- | src/wp_assaultrifle.cpp | 12 | ||||
-rw-r--r-- | src/wp_assaultrifle.hpp | 2 | ||||
-rw-r--r-- | src/wp_shotty.cpp | 9 | ||||
-rw-r--r-- | src/wp_shotty.hpp | 2 |
7 files changed, 19 insertions, 12 deletions
diff --git a/meta/maps/stage_1_boss.bfm b/meta/maps/stage_1_boss.bfm index 13ca9e7..dced68f 100644 --- a/meta/maps/stage_1_boss.bfm +++ b/meta/maps/stage_1_boss.bfm @@ -1,3 +1,3 @@ -BOSS 1 5 +BOSS 1 3 ENEMIES 2 100 NEXT stage_1_boss.bfm diff --git a/src/gameplay.cpp b/src/gameplay.cpp index 0fdc67c..6180ae4 100644 --- a/src/gameplay.cpp +++ b/src/gameplay.cpp @@ -277,7 +277,7 @@ Game::shoot() const if (player->currentWeapon->empty == true) { return (0); } - player->currentWeapon->bang(enemies, player->direction, (Vector2){player->posX, player->posY}, &player->victims); + player->currentWeapon->bang(enemies, player); if (player->currentWeapon->empty == true) { player->reloadTime = GetTime(); } diff --git a/src/weapon.hpp b/src/weapon.hpp index 36ac542..447cfe5 100644 --- a/src/weapon.hpp +++ b/src/weapon.hpp @@ -38,7 +38,7 @@ public: const char *r); ~AWeapon(); - virtual int bang(std::vector<Entity> * enemies, Vector2 playerDirection, Vector2 playerPosition, int * victims) = 0; + virtual int bang(std::vector<Entity> * enemies, Entity * player) = 0; void refill(); bool empty; diff --git a/src/wp_assaultrifle.cpp b/src/wp_assaultrifle.cpp index 7438b23..6b9a2c7 100644 --- a/src/wp_assaultrifle.cpp +++ b/src/wp_assaultrifle.cpp @@ -12,7 +12,7 @@ wp_assaultrifle::wp_assaultrifle(const char *s, const char *r) -int wp_assaultrifle::bang(std::vector<Entity> * enemies, Vector2 playerDirection, Vector2 playerPosition, int * victims) +int wp_assaultrifle::bang(std::vector<Entity> * enemies, Entity * player) { if (barrel == 0) { @@ -22,6 +22,8 @@ int wp_assaultrifle::bang(std::vector<Entity> * enemies, Vector2 playerDirection PlaySound(shot); // here // + Vector2 playerDirection = player->direction; + Vector2 playerPosition = (Vector2){player->posX, player->posY}; auto rot1 = Vector2Rotate(playerDirection, -0.2f); auto rot2 = Vector2Rotate(playerDirection, 0.2f); @@ -29,8 +31,8 @@ int wp_assaultrifle::bang(std::vector<Entity> * enemies, Vector2 playerDirection auto add2 = Vector2Add(playerPosition, rot2); auto r = playerDirection; - r.x *= 2; - r.y *= 2; + r.x *= 4; + r.y *= 4; for (auto en = enemies->begin(); en != enemies->end(); en++) { @@ -45,7 +47,9 @@ int wp_assaultrifle::bang(std::vector<Entity> * enemies, Vector2 playerDirection en->direction.x = (playerDirection.x / 2); en->direction.y = (playerDirection.y / 2); } - *victims += 1; + player->victims += 1; + player->fury += 1; + break ; } } // assaultrifle cone diff --git a/src/wp_assaultrifle.hpp b/src/wp_assaultrifle.hpp index 2780a29..c8016da 100644 --- a/src/wp_assaultrifle.hpp +++ b/src/wp_assaultrifle.hpp @@ -16,7 +16,7 @@ class wp_assaultrifle : public AWeapon { wp_assaultrifle(const char *s, const char *r); ~wp_assaultrifle(); - int bang(std::vector<Entity> * enemies, Vector2 playerDirection, Vector2 playerPosition, int * victims) ; + int bang(std::vector<Entity> * enemies, Entity * player); }; diff --git a/src/wp_shotty.cpp b/src/wp_shotty.cpp index 580450e..ae978f4 100644 --- a/src/wp_shotty.cpp +++ b/src/wp_shotty.cpp @@ -7,18 +7,20 @@ #include "entity.hpp" wp_shotty::wp_shotty(const char *s, const char *r) - : AWeapon(10, 10, 10, 1.0, s, r) + : AWeapon(10, 10, 10, 0.5, s, r) {} -int wp_shotty::bang(std::vector<Entity> * enemies, Vector2 playerDirection, Vector2 playerPosition, int * victims) +int wp_shotty::bang(std::vector<Entity> * enemies, Entity * player) { if (barrel == 0 || GetTime() < (t + cooldown)) { return (1); } else { + Vector2 playerDirection = player->direction; + Vector2 playerPosition = (Vector2){player->posX, player->posY}; barrel--; PlaySound(shot); t = GetTime(); @@ -48,7 +50,8 @@ int wp_shotty::bang(std::vector<Entity> * enemies, Vector2 playerDirection, Vect en->direction.x = (playerDirection.x / 2); en->direction.y = (playerDirection.y / 2); } - *victims += 1; + player->victims += 1; + player->fury += 1; } } // shotty cone diff --git a/src/wp_shotty.hpp b/src/wp_shotty.hpp index 2f9b917..48e443a 100644 --- a/src/wp_shotty.hpp +++ b/src/wp_shotty.hpp @@ -16,7 +16,7 @@ class wp_shotty : public AWeapon { wp_shotty(const char *s, const char *r); ~wp_shotty(); - int bang(std::vector<Entity> * enemies, Vector2 playerDirection, Vector2 playerPosition, int * victims) ; + int bang(std::vector<Entity> * enemies, Entity * player) ; }; |