| 3324 | } |
| 3325 | |
| 3326 | bool OperateFountains(Player &player, Object &fountain) |
| 3327 | { |
| 3328 | bool applied = false; |
| 3329 | switch (fountain._otype) { |
| 3330 | case OBJ_BLOODFTN: |
| 3331 | if (&player != MyPlayer) |
| 3332 | return false; |
| 3333 | |
| 3334 | if (player._pHitPoints < player._pMaxHP) { |
| 3335 | PlaySfxLoc(LS_FOUNTAIN, fountain.position); |
| 3336 | player._pHitPoints += 64; |
| 3337 | player._pHPBase += 64; |
| 3338 | if (player._pHitPoints > player._pMaxHP) { |
| 3339 | player._pHitPoints = player._pMaxHP; |
| 3340 | player._pHPBase = player._pMaxHPBase; |
| 3341 | } |
| 3342 | applied = true; |
| 3343 | } else |
| 3344 | PlaySfxLoc(LS_FOUNTAIN, fountain.position); |
| 3345 | break; |
| 3346 | case OBJ_PURIFYINGFTN: |
| 3347 | if (&player != MyPlayer) |
| 3348 | return false; |
| 3349 | |
| 3350 | if (player._pMana < player._pMaxMana) { |
| 3351 | PlaySfxLoc(LS_FOUNTAIN, fountain.position); |
| 3352 | |
| 3353 | player._pMana += 64; |
| 3354 | player._pManaBase += 64; |
| 3355 | if (player._pMana > player._pMaxMana) { |
| 3356 | player._pMana = player._pMaxMana; |
| 3357 | player._pManaBase = player._pMaxManaBase; |
| 3358 | } |
| 3359 | |
| 3360 | applied = true; |
| 3361 | } else |
| 3362 | PlaySfxLoc(LS_FOUNTAIN, fountain.position); |
| 3363 | break; |
| 3364 | case OBJ_MURKYFTN: |
| 3365 | if (fountain._oSelFlag == 0) |
| 3366 | break; |
| 3367 | PlaySfxLoc(LS_FOUNTAIN, fountain.position); |
| 3368 | fountain._oSelFlag = 0; |
| 3369 | AddMissile( |
| 3370 | player.position.tile, |
| 3371 | player.position.tile, |
| 3372 | player._pdir, |
| 3373 | MissileID::Infravision, |
| 3374 | TARGET_MONSTERS, |
| 3375 | player.getId(), |
| 3376 | 0, |
| 3377 | 2 * leveltype); |
| 3378 | applied = true; |
| 3379 | if (&player == MyPlayer) |
| 3380 | NetSendCmdLoc(MyPlayerId, false, CMD_OPERATEOBJ, fountain.position); |
| 3381 | break; |
| 3382 | case OBJ_TEARFTN: { |
| 3383 | if (fountain._oSelFlag == 0) |
no test coverage detected