Skip to content
Permalink
Browse files

Rebalanced throwing and firing accuracy training

  • Loading branch information
MeridianOXC committed Jan 12, 2016
1 parent 9b3ef2f commit 1e39183b919bcf1963eb8e2b6c8c18a834d8be6e
Showing with 42 additions and 2 deletions.
  1. +23 −1 src/Battlescape/ProjectileFlyBState.cpp
  2. +19 −1 src/Battlescape/TileEngine.cpp
@@ -310,7 +310,23 @@ bool ProjectileFlyBState::createNewProjectile()
_unit->setCache(0);
_parent->getMap()->cacheUnit(_unit);
_parent->getMod()->getSoundByDepth(_parent->getDepth(), Mod::ITEM_THROW)->play(-1, _parent->getMap()->getSoundAngle(_unit->getPosition()));
_unit->addThrowingExp();
// experience training
if (_projectileItem->getRules()->getBattleType() == BT_GRENADE)
{
if (_projectileItem->getFuseTimer() >= 0)
{
// e.g. primed frag grenade, primed smoke grenade
_unit->addThrowingExp();
}
}
else if (_projectileItem->getRules()->getBattleType() == BT_PROXIMITYGRENADE)
{
if (_projectileItem->getFuseTimer() >= 0)
{
// e.g. primed landmine
_unit->addThrowingExp();
}
}
}
else
{
@@ -346,6 +362,12 @@ bool ProjectileFlyBState::createNewProjectile()
_parent->getSave()->removeItem(_ammo);
_action.weapon->setAmmoItem(0);
}
// experience training
if (_action.weapon->getRules()->getClipSize() == 1)
{
// e.g. fired (=not thrown) molotovs, black powder bombs, acid flasks, ...
_unit->addThrowingExp();
}
}
else
{
@@ -1107,7 +1107,25 @@ bool TileEngine::hitUnit(BattleUnit *unit, BattleUnit *target, const Position &r
}
if (rangeAtack && target->getOriginalFaction() == FACTION_HOSTILE)
{
unit->addFiringExp();
// experience training
BattleItem *bi = unit->getItem(unit->getActiveHand());
if (bi == 0)
{
// do nothing, the damage was caused either by disposable "firing" weapon (Black Powder Bomb) or grenade; or something else?
}
else
{
if (bi != 0 && bi->getRules()->getArcingShot())
{
// e.g. combat bow
unit->addThrowingExp();
}
else
{
// e.g. fuso knives, x-bow, sniper rifle, rocket launcher, ...
unit->addFiringExp();
}
}
}
}

0 comments on commit 1e39183

Please sign in to comment.
You can’t perform that action at this time.