Skip to content

Commit

Permalink
tutorial and attack range fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jonylu7 committed May 31, 2024
1 parent 319a91c commit 3c3a82b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions include/Avatar/Avatar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ class Avatar : public Util::GameObject, public Selectable, public Huntable {

public:
Avatar(){};
Avatar(UnitType unit, HouseType house)
: m_ID(GameObjectID(UnitType::NONE, house)){};
Avatar(UnitType unit, HouseType house, Weapon weapon = COLT_45)
: m_ID(GameObjectID(UnitType::NONE, house)) {
getAttackAndDamage()->setWeapon(std::make_shared<Weapon>(weapon));
};
~Avatar() override{};

virtual void Start(glm::vec2 spawnlocationcell);
Expand Down
2 changes: 1 addition & 1 deletion include/Avatar/Weapon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,6 @@ class Weapon {
WeaponType m_Type;
};

const Weapon COLT_45(180, 5.75, 100, 100, WeaponType::COLT_45);
const Weapon COLT_45(180, 4, 100, 100, WeaponType::COLT_45);

#endif // PRACTICALTOOLSFORSIMPLEDESIGN_WEAPON_HPP
5 changes: 3 additions & 2 deletions include/Mechanics/NemesisManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ class NemesisManager {
}
if (hunter->getDistance(
m_Nemesis[hunter]->getCurrentLocationInCell()) <=
hunter->getAttackAndDamage()->getWeapon()->getFireRange() *
CELL_SIZE.x) // check with in range
hunter->getAttackAndDamage()
->getWeapon()
->getFireRange()) // check with in range
{
return true;
} else {
Expand Down

0 comments on commit 3c3a82b

Please sign in to comment.