MCPcopy Create free account
hub / github.com/TurningWheel/Barony / statGetINT

Function statGetINT

src/entity.cpp:9281–9379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9279}
9280
9281Sint32 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 )

Callers 15

actHudWeaponFunction · 0.85
getSpellIconTextMethod · 0.85
formatItemIconMethod · 0.85
formatItemDetailsMethod · 0.85
item_PotionRestoreMagicFunction · 0.85
handleMainMenuFunction · 0.85
getINTMethod · 0.85
getBaseManaRegenFunction · 0.85

Tested by

no test coverage detected