MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / SyncMonsterAnim

Function SyncMonsterAnim

Source/monster.cpp:4152–4205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4150}
4151
4152void SyncMonsterAnim(Monster &monster)
4153{
4154#ifdef _DEBUG
4155 // fix for saves with debug monsters having type originally not on the level
4156 CMonster &monsterType = LevelMonsterTypes[monster.levelType];
4157 if (monsterType.data == nullptr) {
4158 InitMonsterGFX(monsterType);
4159 monsterType.corpseId = 1;
4160 }
4161#endif
4162 if (monster.isUnique()) {
4163 InitTRNForUniqueMonster(monster);
4164 }
4165 MonsterGraphic graphic = MonsterGraphic::Stand;
4166
4167 switch (monster.getVisualMonsterMode()) {
4168 case MonsterMode::Stand:
4169 case MonsterMode::Delay:
4170 case MonsterMode::Talk:
4171 break;
4172 case MonsterMode::MoveNorthwards:
4173 case MonsterMode::MoveSouthwards:
4174 case MonsterMode::MoveSideways:
4175 graphic = MonsterGraphic::Walk;
4176 break;
4177 case MonsterMode::MeleeAttack:
4178 case MonsterMode::RangedAttack:
4179 graphic = MonsterGraphic::Attack;
4180 break;
4181 case MonsterMode::HitRecovery:
4182 graphic = MonsterGraphic::GotHit;
4183 break;
4184 case MonsterMode::Death:
4185 graphic = MonsterGraphic::Death;
4186 break;
4187 case MonsterMode::SpecialMeleeAttack:
4188 case MonsterMode::FadeIn:
4189 case MonsterMode::FadeOut:
4190 case MonsterMode::SpecialStand:
4191 case MonsterMode::SpecialRangedAttack:
4192 case MonsterMode::Heal:
4193 graphic = MonsterGraphic::Special;
4194 break;
4195 case MonsterMode::Charge:
4196 graphic = MonsterGraphic::Attack;
4197 monster.animInfo.currentFrame = 0;
4198 break;
4199 default:
4200 monster.animInfo.currentFrame = 0;
4201 break;
4202 }
4203
4204 monster.changeAnimationData(graphic);
4205}
4206
4207void M_FallenFear(Point position)
4208{

Callers 2

LoadLevelFunction · 0.85
LoadGameFunction · 0.85

Calls 5

InitMonsterGFXFunction · 0.85
InitTRNForUniqueMonsterFunction · 0.85
isUniqueMethod · 0.80
getVisualMonsterModeMethod · 0.80
changeAnimationDataMethod · 0.45

Tested by

no test coverage detected