| 9398 | } |
| 9399 | |
| 9400 | Sint32 statGetPER(Stat* entitystats, Entity* my) |
| 9401 | { |
| 9402 | Sint32 PER; |
| 9403 | |
| 9404 | if ( !entitystats ) |
| 9405 | { |
| 9406 | return 0; |
| 9407 | } |
| 9408 | |
| 9409 | PER = entitystats->PER; |
| 9410 | |
| 9411 | bool cursedItemIsBuff = false; |
| 9412 | bool shapeshifted = false; |
| 9413 | if ( my && my->behavior == &actPlayer ) |
| 9414 | { |
| 9415 | cursedItemIsBuff = shouldInvertEquipmentBeatitude(entitystats); |
| 9416 | if ( my->effectShapeshift != NOTHING ) |
| 9417 | { |
| 9418 | shapeshifted = true; |
| 9419 | if ( my->effectShapeshift == SPIDER ) |
| 9420 | { |
| 9421 | int bonusPER = 5; |
| 9422 | PER += bonusPER; |
| 9423 | if ( PER >= 0 ) |
| 9424 | { |
| 9425 | PER *= 1.33; |
| 9426 | } |
| 9427 | } |
| 9428 | else if ( my->effectShapeshift == CREATURE_IMP ) |
| 9429 | { |
| 9430 | int bonusPER = 3; |
| 9431 | PER += bonusPER; |
| 9432 | if ( PER >= 0 ) |
| 9433 | { |
| 9434 | PER *= 1.25; |
| 9435 | } |
| 9436 | } |
| 9437 | else if ( my->effectShapeshift == RAT ) |
| 9438 | { |
| 9439 | int bonusPER = 3; |
| 9440 | PER += bonusPER; |
| 9441 | if ( PER >= 0 ) |
| 9442 | { |
| 9443 | PER *= 1.25; |
| 9444 | } |
| 9445 | } |
| 9446 | } |
| 9447 | } |
| 9448 | |
| 9449 | if ( svFlags & SV_FLAG_HUNGER ) |
| 9450 | { |
| 9451 | if ( entitystats->type != AUTOMATON ) |
| 9452 | { |
| 9453 | if ( entitystats->HUNGER <= getEntityHungerInterval(-1, my, entitystats, HUNGER_INTERVAL_STARVING) ) |
| 9454 | { |
| 9455 | PER--; |
| 9456 | } |
| 9457 | } |
no test coverage detected