MCPcopy Create free account
hub / github.com/crossuo/crossuo / GetDieGroupIndex

Method GetDieGroupIndex

src/Managers/AnimationManager.cpp:198–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198uint8_t CAnimationManager::GetDieGroupIndex(uint16_t graphic, bool running, bool third)
199{
200 assert(graphic < MAX_ANIMATIONS_DATA_INDEX_COUNT);
201 const auto flags = g_Index.m_Anim[graphic].Flags;
202 switch (g_Index.m_Anim[graphic].Type)
203 {
204 case AGT_ANIMAL:
205 {
206 if (flags & AF_USE_2_IF_HITTED_WHILE_RUNNING || flags & AF_CAN_FLYING)
207 {
208 return 2;
209 }
210 if (flags & AF_USE_UOP_ANIMATION)
211 {
212 return running ? 3 : 2;
213 }
214 return running ? LAG_DIE_2 : LAG_DIE_1;
215 }
216 case AGT_SEA_MONSTER:
217 {
218 if (!third)
219 return 8;
220
221 // [[fallthrough]]
222 }
223 case AGT_MONSTER:
224 {
225 if (flags & AF_USE_UOP_ANIMATION)
226 {
227 return running ? 3 : 2;
228 }
229 return running ? HAG_DIE_2 : HAG_DIE_1;
230 }
231 case AGT_HUMAN:
232 case AGT_EQUIPMENT:
233 {
234 return running ? PAG_DIE_2 : PAG_DIE_1;
235 }
236 case AGT_UNKNOWN:
237 default:
238 break;
239 }
240
241 return 0;
242}
243
244void CAnimationManager::GetAnimDirection(uint8_t &dir, bool &mirror)
245{

Callers 2

QFORFunction · 0.80
PACKET_HANDLERFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected