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

Method isInvisible

src/entity.cpp:9791–9852  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9789-------------------------------------------------------------------------------*/
9790
9791bool Entity::isInvisible() const
9792{
9793 if ( intro )
9794 {
9795 // show up in hi-scores
9796 return false;
9797 }
9798 Stat* entitystats;
9799 if ( (entitystats = getStats()) == NULL )
9800 {
9801 return false;
9802 }
9803
9804 if ( entitystats->getEffectActive(EFF_DUSTED) )
9805 {
9806 return false;
9807 }
9808
9809 // being invisible
9810 if ( entitystats->getEffectActive(EFF_INVISIBLE) )
9811 {
9812 return true;
9813 }
9814
9815 // wearing invisibility cloaks
9816 if ( entitystats->cloak != NULL )
9817 {
9818 if ( entitystats->cloak->type == CLOAK_INVISIBILITY )
9819 {
9820 return true;
9821 }
9822 }
9823
9824 // wearing invisibility ring
9825 if ( entitystats->ring != NULL )
9826 {
9827 if ( entitystats->ring->type == RING_INVISIBILITY )
9828 {
9829 return true;
9830 }
9831 }
9832
9833 if ( this->behavior == &actPlayer )
9834 {
9835 if ( this->skill[2] >= 0 && this->skill[2] < MAXPLAYERS )
9836 {
9837 if ( skillCapstoneUnlockedEntity(PRO_STEALTH) && (stats[this->skill[2]]->sneaking && !stats[this->skill[2]]->defending) )
9838 {
9839 if ( this->skill[9] == 0 ) // player attack variable.
9840 {
9841 return true;
9842 }
9843 }
9844 }
9845 }
9846 /*else if ( skillCapstoneUnlockedEntity(PRO_STEALTH) )
9847 {
9848 return true;

Callers 13

actPlayerFunction · 0.45
actHudWeaponFunction · 0.45
actHudShieldFunction · 0.45
actHudAdditionalFunction · 0.45
actHudArrowModelFunction · 0.45
actArrowFunction · 0.45
resetPlayerHostilityMethod · 0.45
getPlayerHostilityMethod · 0.45
actMonsterFunction · 0.45
item_PotionInvisibilityFunction · 0.45
item_ToolMirrorFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected