From 17780a19dfe7d302487806093c78a1b67efc1108 Mon Sep 17 00:00:00 2001 From: qndel Date: Wed, 18 Sep 2019 04:07:11 +0200 Subject: [PATCH 1/3] [hellfire] ProcessMonsters bin exact --- Source/monster.cpp | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/Source/monster.cpp b/Source/monster.cpp index 18cd79b73..96f191ef0 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -4634,23 +4634,48 @@ void ProcessMonsters() Monst->_mAISeed = GetRndSeed(); } if (!(monster[mi]._mFlags & MFLAG_NOHEAL) && Monst->_mhitpoints < Monst->_mmaxhp && Monst->_mhitpoints >> 6 > 0) { - if (Monst->mLevel <= 1) { - Monst->_mhitpoints += Monst->mLevel; - } else { + if (Monst->mLevel > 1) { Monst->_mhitpoints += Monst->mLevel >> 1; + } else { + Monst->_mhitpoints += Monst->mLevel; } } mx = Monst->_mx; my = Monst->_my; #ifndef SPAWN +#ifndef HELLFIRE if (dFlags[mx][my] & BFLAG_VISIBLE && Monst->_msquelch == 0 && Monst->MType->mtype == MT_CLEAVER) { PlaySFX(USFX_CLEAVER); } +#else + if (dFlags[mx][my] & BFLAG_VISIBLE && Monst->_msquelch == 0) { + if (Monst->MType->mtype == MT_CLEAVER) { + PlaySFX(USFX_CLEAVER); + } + if (Monst->MType->mtype == 137) { //TODO: apply enums + if (UseCowFarmer) { + PlaySFX(997); + } else { + int sound = 995; + if (!IsUberRoomOpened) + sound = 996; + PlaySFX(sound); + } + } + if (Monst->MType->mtype == 124) + PlaySFX(989); + M_Enemy(mi); + } +#endif #endif if (Monst->_mFlags & MFLAG_TARGETS_MONSTER) { _menemy = Monst->_menemy; if ((DWORD)_menemy >= MAXMONSTERS) { +#ifdef HELLFIRE + return; +#else app_fatal("Illegal enemy monster %d for monster \"%s\"", _menemy, Monst->mName); +#endif } Monst->_lastx = monster[Monst->_menemy]._mfutx; Monst->_menemyx = Monst->_lastx; @@ -4659,7 +4684,11 @@ void ProcessMonsters() } else { _menemy = Monst->_menemy; if ((DWORD)_menemy >= MAX_PLRS) { +#ifdef HELLFIRE + return; +#else app_fatal("Illegal enemy player %d for monster \"%s\"", _menemy, Monst->mName); +#endif } Monst->_menemyx = plr[Monst->_menemy]._px; Monst->_menemyy = plr[Monst->_menemy]._py; From cd0b1f68edbe380b8259291eeb719d3e58ac2d9e Mon Sep 17 00:00:00 2001 From: qndel Date: Wed, 18 Sep 2019 04:12:09 +0200 Subject: [PATCH 2/3] changed ifdef --- Source/monster.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Source/monster.cpp b/Source/monster.cpp index 96f191ef0..53ed19103 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -4643,15 +4643,11 @@ void ProcessMonsters() mx = Monst->_mx; my = Monst->_my; #ifndef SPAWN -#ifndef HELLFIRE - if (dFlags[mx][my] & BFLAG_VISIBLE && Monst->_msquelch == 0 && Monst->MType->mtype == MT_CLEAVER) { - PlaySFX(USFX_CLEAVER); - } -#else if (dFlags[mx][my] & BFLAG_VISIBLE && Monst->_msquelch == 0) { if (Monst->MType->mtype == MT_CLEAVER) { PlaySFX(USFX_CLEAVER); } +#ifdef HELLFIRE if (Monst->MType->mtype == 137) { //TODO: apply enums if (UseCowFarmer) { PlaySFX(997); @@ -4665,8 +4661,8 @@ void ProcessMonsters() if (Monst->MType->mtype == 124) PlaySFX(989); M_Enemy(mi); - } #endif + } #endif if (Monst->_mFlags & MFLAG_TARGETS_MONSTER) { _menemy = Monst->_menemy; From a056586e8072d0964f4a5dd4762b56e7b3b66b45 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Wed, 18 Sep 2019 04:45:06 +0200 Subject: [PATCH 3/3] Apply enums to ProcessMonsters --- Source/monster.cpp | 16 ++++++++-------- enums.h | 2 ++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Source/monster.cpp b/Source/monster.cpp index 53ed19103..6e0b94515 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -4648,18 +4648,18 @@ void ProcessMonsters() PlaySFX(USFX_CLEAVER); } #ifdef HELLFIRE - if (Monst->MType->mtype == 137) { //TODO: apply enums + if (Monst->MType->mtype == MT_NAKRUL) { if (UseCowFarmer) { - PlaySFX(997); + PlaySFX(USFX_NAKRUL6); } else { - int sound = 995; - if (!IsUberRoomOpened) - sound = 996; - PlaySFX(sound); + if (IsUberRoomOpened) + PlaySFX(USFX_NAKRUL4); + else + PlaySFX(USFX_NAKRUL5); } } - if (Monst->MType->mtype == 124) - PlaySFX(989); + if (Monst->MType->mtype == MT_DEFILER) + PlaySFX(USFX_DEFILER8); M_Enemy(mi); #endif } diff --git a/enums.h b/enums.h index d77ed62a8..b3aefe143 100644 --- a/enums.h +++ b/enums.h @@ -1682,6 +1682,8 @@ typedef enum _monster_id { MT_GOLEM = 0x6D, MT_DIABLO = 0x6E, MT_DARKMAGE = 0x6F, + MT_DEFILER = 0x7C, + MT_NAKRUL = 0x89, NUM_MTYPES } _monster_id;