MCPcopy Create free account
hub / github.com/Norbyte/ositools / GetInt

Method GetInt

OsiInterface/Functions/DamageFunctions.cpp:76–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74 }
75
76 bool DamageHelpers::GetInt(char const * prop, int32_t & value)
77 {
78 if (strcmp(prop, "CallCharacterHit") == 0) {
79 value = CallCharacterHit ? 1 : 0;
80 } else if (strcmp(prop, "HitType") == 0) {
81 value = (int32_t)HitType;
82 } else if (strcmp(prop, "RollForDamage") == 0) {
83 value = RollForDamage ? 1 : 0;
84 } else if (strcmp(prop, "ProcWindWalker") == 0) {
85 value = ProcWindWalker ? 1 : 0;
86 } else if (strcmp(prop, "ForceReduceDurability") == 0) {
87 value = ForceReduceDurability ? 1 : 0;
88 } else if (strcmp(prop, "HighGround") == 0) {
89 value = (int32_t)HighGround;
90 } else if (strcmp(prop, "CriticalRoll") == 0) {
91 value = (int32_t)Critical;
92 } else if (strcmp(prop, "HitReason") == 0) {
93 value = (int32_t)HitReason;
94 } else if (strcmp(prop, "DamageSourceType") == 0) {
95 value = (int32_t)DamageSourceType;
96 } else if (strcmp(prop, "Strength") == 0) {
97 value = (int32_t)(Strength * 100.0f);
98 } else {
99 auto & propertyMap = gHitDamageInfoPropertyMap;
100 auto flag = propertyMap.getFlag(Hit, prop, false, false);
101 if (flag) {
102 value = *flag ? 1 : 0;
103 } else {
104 auto val = propertyMap.getInt(Hit, prop, false, true);
105 if (val) {
106 value = (int32_t)*val;
107 } else {
108 return false;
109 }
110 }
111 }
112
113 return true;
114 }
115
116 bool DamageHelpers::GetString(char const * prop, char const * & value)
117 {

Callers 2

getIntMethod · 0.80
HitGetIntFunction · 0.80

Calls 2

getFlagMethod · 0.80
getIntMethod · 0.80

Tested by

no test coverage detected