1
#include <InfantryClass.h>
2
#include <HouseTypeClass.h>
3
#include <HouseClass.h>
4
#include <TActionClass.h>
6
#include "../WarheadType/Body.h"
7
#include "../AnimType/Body.h"
9
#include <SpecificStructures.h>
11
/* #188 - InfDeaths */
13
DEFINE_HOOK(5185C8, InfantryClass_ReceiveDamage_InfDeath, 6)
15
GET(InfantryClass *, I, ESI);
16
LEA_STACK(args_ReceiveDamage *, Arguments, 0xD4);
17
GET(DWORD, InfDeath, EDI);
23
if(!I->Type->NotHuman) {
24
if(I->GetHeight() < 10) {
25
WarheadTypeExt::ExtData *pWHData = WarheadTypeExt::ExtMap.Find(Arguments->WH);
26
if(AnimTypeClass *deathAnim = pWHData->InfDeathAnim) {
27
AnimClass *Anim = NULL;
28
GAME_ALLOC(AnimClass, Anim, deathAnim, &I->Location);
30
HouseClass *Invoker = (Arguments->Attacker)
31
? Arguments->Attacker->Owner
32
: Arguments->SourceHouse
35
AnimTypeExt::SetMakeInfOwner(Anim, Invoker, I->Owner, Invoker);
42
return (Handled || InfDeath >= 10)
48
DEFINE_HOOK(51849A, InfantryClass_ReceiveDamage_DeathAnim, 5)
50
GET(InfantryClass *, I, ESI);
51
LEA_STACK(args_ReceiveDamage *, Arguments, 0xD4);
52
GET(DWORD, InfDeath, EDI);
54
// if you got here, a valid DeathAnim for this InfDeath has been defined, and the game has already checked the preconditions
55
// just allocate the anim and set its owner/remap
57
AnimClass *Anim = NULL;
58
GAME_ALLOC(AnimClass, Anim, I->Type->DeathAnims[InfDeath], &I->Location);
60
AnimTypeExt::SetMakeInfOwner(Anim, I->Owner, I->Owner, Arguments->Attacker->Owner);
62
R->EAX<AnimClass *>(Anim);
66
DEFINE_HOOK(6E232E, ActionClass_PlayAnimAt, 5)
68
GET(TActionClass *, pAction, ESI);
69
GET_STACK(HouseClass *, pHouse, 0x1C);
70
LEA_STACK(CoordStruct *, pCoords, 0xC);
72
AnimClass *Anim = NULL;
73
AnimTypeClass *AnimType = AnimTypeClass::Array->GetItem(pAction->arg_90);
75
GAME_ALLOC(AnimClass, Anim, AnimType, pCoords);
77
if(AnimType->MakeInfantry > -1) {
78
AnimTypeExt::SetMakeInfOwner(Anim, pHouse, pHouse, pHouse);
81
R->EAX<AnimClass *>(Anim);