From dfd51ec6d523fc8e7d15a3cc9dc59f121cb6c592 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 22 Aug 2021 16:36:10 +0200 Subject: [PATCH] - added missing MBF21 Dehacked keys "blood color" and "dropped item". --- src/gamedata/d_dehacked.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/gamedata/d_dehacked.cpp b/src/gamedata/d_dehacked.cpp index e974aacb1..6c2022cda 100644 --- a/src/gamedata/d_dehacked.cpp +++ b/src/gamedata/d_dehacked.cpp @@ -68,6 +68,8 @@ #include "actorptrselect.h" #include "g_levellocals.h" +extern TArray TranslationColors; + void JitDumpLog(FILE *file, VMScriptFunction *func); // [SO] Just the way Randy said to do it :) @@ -1273,6 +1275,37 @@ static int PatchThing (int thingy) { info->meleerange = DEHToDouble(val) - 20; // -20 is needed because DSDA subtracts it in P_CheckMeleeRange, while GZDoom does not. } + else if (linelen == 12 && stricmp(Line1, "dropped item") == 0) + { + if ((unsigned)val < InfoNames.Size()) + { + FDropItem* di = (FDropItem*)ClassDataAllocator.Alloc(sizeof(FDropItem)); + + di->Name = InfoNames[val]->TypeName.GetChars(); + di->Probability = 255; + di->Amount = -1; + info->GetInfo()->DropItems = di; + } + } + else if (linelen == 11 && stricmp(Line1, "blood color") == 0) + { + static const unsigned int bloodcolor[] = { + 0, // 0 - Red (normal) + 0xffcccccc, // 1 - Grey + 0xff63af57, // 2 - Green + 0xff6357af, // 3 - Blue + 0xffffd300, // 4 - Yellow + 0xff333333, // 5 - Black + 0xffff30ff, // 6 - Purple + 0xffffffff, // 7 - White + 0xffff8000, // 8 - Orange + }; + + if (val < 0 || val > 8) val = 0; + unsigned color = bloodcolor[val]; + info->BloodColor = color; + info->BloodTranslation = val == 0? 0 : TRANSLATION(TRANSLATION_Blood, CreateBloodTranslation(color)); + } else if (linelen == 10 && stricmp(Line1, "MBF21 Bits") == 0) { uint32_t value = 0;