Browse Source

Mai cleaver (#471)

* Clean up MAI_Cleaver

* Clean up ActivateSpawn
pull/25/head
Anders Jenbo 7 years ago committed by Robin Eklind
parent
commit
cf01a9dbb9
  1. 57
      Source/monster.cpp

57
Source/monster.cpp

@ -4317,33 +4317,29 @@ void __fastcall MAI_Fallen(int i)
void __fastcall MAI_Cleaver(int i)
{
int v1; // esi
MonsterStruct *v2; // esi
int v3; // ecx
int v4; // edx
int v5; // edi
int v6; // ebp
int v7; // ebx
int arglist; // [esp+8h] [ebp-4h]
MonsterStruct *Monst;
int x, y, mx, my, md;
v1 = i;
arglist = i;
if ((DWORD)i >= MAXMONSTERS)
TermMsg("MAI_Cleaver: Invalid monster %d", i);
v2 = &monster[v1];
if (v2->_mmode == MM_STAND && v2->_msquelch) {
v3 = v2->_mx;
v4 = v2->_my;
v5 = v3 - (unsigned char)v2->_menemyx;
v6 = v4 - (unsigned char)v2->_menemyy;
v7 = GetDirection(v3, v4, v2->_lastx, v2->_lasty);
v2->_mdir = v7;
if (abs(v5) >= 2 || abs(v6) >= 2)
M_CallWalk(arglist, v7);
Monst = &monster[i];
if (Monst->_mmode == MM_STAND && Monst->_msquelch) {
mx = Monst->_mx;
my = Monst->_my;
x = mx - Monst->_menemyx;
y = my - Monst->_menemyy;
md = GetDirection(mx, my, Monst->_lastx, Monst->_lasty);
Monst->_mdir = md;
if (abs(x) >= 2 || abs(y) >= 2)
M_CallWalk(i, md);
else
M_StartAttack(arglist);
if (v2->_mmode == MM_STAND)
v2->_mAnimData = v2->MType->Anims[MA_STAND].Data[v7];
M_StartAttack(i);
if (Monst->_mmode == MM_STAND)
Monst->_mAnimData = Monst->MType->Anims[MA_STAND].Data[md];
}
}
@ -7031,16 +7027,13 @@ int __fastcall M_SpawnSkel(int x, int y, int dir)
void __fastcall ActivateSpawn(int i, int x, int y, int dir)
{
int v4; // eax
dMonster[x][y] = i + 1;
v4 = i;
monster[v4]._mx = x;
monster[v4]._mfutx = x;
monster[v4]._moldx = x;
monster[v4]._my = y;
monster[v4]._mfuty = y;
monster[v4]._moldy = y;
monster[i]._mx = x;
monster[i]._mfutx = x;
monster[i]._moldx = x;
monster[i]._my = y;
monster[i]._mfuty = y;
monster[i]._moldy = y;
M_StartSpStand(i, dir);
}

Loading…
Cancel
Save