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

Function statGetSTR

src/entity.cpp:8551–8755  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8549}
8550
8551Sint32 statGetSTR(Stat* entitystats, Entity* my)
8552{
8553 Sint32 STR;
8554
8555 if ( !entitystats )
8556 {
8557 return 0;
8558 }
8559
8560 STR = entitystats->STR;
8561
8562 bool cursedItemIsBuff = false;
8563 bool shapeshifted = false;
8564 if ( my && my->behavior == &actPlayer )
8565 {
8566 cursedItemIsBuff = shouldInvertEquipmentBeatitude(entitystats);
8567 if ( my->effectShapeshift != NOTHING )
8568 {
8569 shapeshifted = true;
8570 if ( my->effectShapeshift == TROLL )
8571 {
8572 int bonusSTR = 5;
8573 STR += bonusSTR;
8574 if ( STR >= 0 )
8575 {
8576 STR *= 1.33;
8577 }
8578 }
8579 else if ( my->effectShapeshift == SPIDER )
8580 {
8581 int bonusSTR = 3;
8582 STR += bonusSTR;
8583 if ( STR >= 0 )
8584 {
8585 STR *= 1.25;
8586 }
8587 }
8588 }
8589 }
8590
8591 if ( svFlags & SV_FLAG_HUNGER )
8592 {
8593 if ( entitystats->type != AUTOMATON )
8594 {
8595 if ( entitystats->HUNGER >= getEntityHungerInterval(-1, my, entitystats, HUNGER_INTERVAL_OVERSATIATED) )
8596 {
8597 STR--;
8598 }
8599 if ( entitystats->HUNGER <= getEntityHungerInterval(-1, my, entitystats, HUNGER_INTERVAL_WEAK) )
8600 {
8601 STR--;
8602 }
8603 if ( entitystats->HUNGER <= getEntityHungerInterval(-1, my, entitystats, HUNGER_INTERVAL_STARVING) )
8604 {
8605 STR--;
8606 }
8607 }
8608 else if ( entitystats->type == AUTOMATON

Callers 12

handlePlayerMovementMethod · 0.85
formatItemDetailsMethod · 0.85
actThrownFunction · 0.85
handleMainMenuFunction · 0.85
getAttackMethod · 0.85
getSTRMethod · 0.85
getBaseManaRegenFunction · 0.85
shadowSpecialAbilityMethod · 0.85
displayAttackPowerFunction · 0.85
actParticleTimerFunction · 0.85

Calls 5

getEntityHungerIntervalFunction · 0.85
statGetCHRFunction · 0.85

Tested by

no test coverage detected