Changed Enemy gadgets to be entirely random instead of based on Player gadgets

This commit is contained in:
Felix Ableitner 2013-09-17 23:35:47 +02:00
parent cfa93ca213
commit 7368daa599
2 changed files with 6 additions and 15 deletions

View file

@ -34,7 +34,7 @@ Enemy::Enemy(World& world, Pathfinder& pathfinder,
Character::EquippedItems
Enemy::generateItems(EquippedItems playerItems) {
// Uses cast from enum to int to enum in order to increment enum values.
switch (rand() % 4) {
switch (rand() % 2) {
case 0:
if (playerItems.primary + 1 != Weapon::WeaponType::_LAST)
playerItems.primary =
@ -46,20 +46,12 @@ Enemy::generateItems(EquippedItems playerItems) {
playerItems.secondary =
(Weapon::WeaponType) (((int) (playerItems.secondary) + 1));
break;
case 2:
if (playerItems.left + 1 != Gadget::GadgetType::_LAST)
playerItems.left = (Gadget::GadgetType) (((int) (playerItems.left)
+ 1));
break;
case 3:
if (playerItems.right + 1 != Gadget::GadgetType::_LAST)
playerItems.left = (Gadget::GadgetType) (((int) (playerItems.left)
+ 1));
break;
}
playerItems.left = (Gadget::GadgetType) (rand() % 4);
playerItems.right = (Gadget::GadgetType) (rand() % 4);
return playerItems;
}

View file

@ -23,8 +23,7 @@ public:
NONE,
SHIELD,
HEAL,
RINGOFFIRE,
_LAST
RINGOFFIRE
};
public: