| 9279 | } |
| 9280 | |
| 9281 | Sint32 statGetINT(Stat* entitystats, Entity* my) |
| 9282 | { |
| 9283 | Sint32 INT; |
| 9284 | |
| 9285 | if ( !entitystats ) |
| 9286 | { |
| 9287 | return 0; |
| 9288 | } |
| 9289 | |
| 9290 | INT = entitystats->INT; |
| 9291 | |
| 9292 | bool cursedItemIsBuff = false; |
| 9293 | bool shapeshifted = false; |
| 9294 | if ( my && my->behavior == &actPlayer ) |
| 9295 | { |
| 9296 | cursedItemIsBuff = shouldInvertEquipmentBeatitude(entitystats); |
| 9297 | if ( my->effectShapeshift != NOTHING ) |
| 9298 | { |
| 9299 | shapeshifted = true; |
| 9300 | if ( my->effectShapeshift == RAT ) |
| 9301 | { |
| 9302 | int bonusINT = 3; |
| 9303 | INT += bonusINT; |
| 9304 | if ( INT >= 0 ) |
| 9305 | { |
| 9306 | INT *= 1.25; |
| 9307 | } |
| 9308 | } |
| 9309 | else if ( my->effectShapeshift == CREATURE_IMP ) |
| 9310 | { |
| 9311 | int bonusINT = 5; |
| 9312 | INT += bonusINT; |
| 9313 | if ( INT >= 0 ) |
| 9314 | { |
| 9315 | INT *= 1.33; |
| 9316 | } |
| 9317 | } |
| 9318 | } |
| 9319 | } |
| 9320 | |
| 9321 | if ( svFlags & SV_FLAG_HUNGER ) |
| 9322 | { |
| 9323 | if ( entitystats->HUNGER <= getEntityHungerInterval(-1, my, entitystats, HUNGER_INTERVAL_STARVING) ) |
| 9324 | { |
| 9325 | INT--; |
| 9326 | } |
| 9327 | } |
| 9328 | if ( entitystats->helmet != nullptr ) |
| 9329 | { |
| 9330 | if ( entitystats->helmet->type == HAT_WIZARD ) |
| 9331 | { |
| 9332 | if ( entitystats->helmet->beatitude >= 0 || cursedItemIsBuff ) |
| 9333 | { |
| 9334 | INT++; |
| 9335 | } |
| 9336 | INT += (cursedItemIsBuff ? abs(entitystats->helmet->beatitude) : entitystats->helmet->beatitude); |
| 9337 | } |
| 9338 | else if ( entitystats->helmet->type == ARTIFACT_HELM ) |
no test coverage detected