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

Method SetInt

OsiInterface/Functions/DamageFunctions.cpp:154–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152 }
153
154 void DamageHelpers::SetInt(char const * prop, int32_t value)
155 {
156 if (strcmp(prop, "CallCharacterHit") == 0) {
157 if (Type == DamageHelpers::HT_CustomHit) {
158 CallCharacterHit = value > 0;
159 } else {
160 OsiError("Property 'CallCharacterHit' can only be set for custom hits");
161 }
162 }
163 else if (strcmp(prop, "HitType") == 0) {
164 auto val = EnumInfo<osidbg::HitType>::Find((osidbg::HitType)value);
165 if (val) {
166 HitType = (osidbg::HitType)value;
167 } else {
168 OsiError("Invalid value for enum 'HitType': " << value);
169 }
170 }
171 else if (strcmp(prop, "RollForDamage") == 0) {
172 RollForDamage = value > 0;
173 }
174 else if (strcmp(prop, "ProcWindWalker") == 0) {
175 ProcWindWalker = value > 0;
176 } else if (strcmp(prop, "ForceReduceDurability") == 0) {
177 ForceReduceDurability = value > 0;
178 }
179 else if (strcmp(prop, "HighGround") == 0) {
180 auto val = EnumInfo<HighGroundBonus>::Find((HighGroundBonus)value);
181 if (val) {
182 HighGround = (HighGroundBonus)value;
183 } else {
184 OsiError("Invalid value for enum 'HighGround': " << value);
185 }
186 }
187 else if (strcmp(prop, "CriticalRoll") == 0) {
188 auto val = EnumInfo<CriticalRoll>::Find((CriticalRoll)value);
189 if (val) {
190 Critical = (CriticalRoll)value;
191 } else {
192 OsiError("Invalid value for enum 'CriticalRoll': " << value);
193 }
194 }
195 else if (strcmp(prop, "HitReason") == 0) {
196 // FIXME enum + filter
197 HitReason = (uint32_t)value;
198 }
199 else if (strcmp(prop, "DamageSourceType") == 0) {
200 auto val = EnumInfo<CauseType>::Find((CauseType)value);
201 if (val) {
202 DamageSourceType = (CauseType)value;
203 } else {
204 OsiError("Invalid value for enum 'DamageSourceType': " << value);
205 }
206 }
207 else if (strcmp(prop, "Strength") == 0) {
208 if (Type == DamageHelpers::HT_CustomHit) {
209 Strength = value / 100.0f;
210 } else {
211 OsiError("Property 'Strength' can only be set for custom hits");

Callers 3

setIntMethod · 0.45
HitSetIntFunction · 0.45
ProjectileSetIntFunction · 0.45

Calls 2

setFlagMethod · 0.80
setIntMethod · 0.80

Tested by

no test coverage detected