diff --git a/src/deh_tables.c b/src/deh_tables.c index 970d73958..2145969b2 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -1198,6 +1198,22 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi // Ancient Shrine "S_ANCIENTSHRINE", + "S_MORB1", + "S_MORB2", + "S_MORB3", + "S_MORB4", + "S_MORB5", + "S_MORB6", + "S_MORB7", + "S_MORB8", + "S_MORB9", + "S_MORB10", + "S_MORB11", + "S_MORB12", + "S_MORB13", + "S_MORB14", + "S_MORB15", + // Chaos Emeralds "S_CHAOSEMERALD1", "S_CHAOSEMERALD2", diff --git a/src/info.c b/src/info.c index 1a8b0d47d..a3bc010e5 100644 --- a/src/info.c +++ b/src/info.c @@ -145,6 +145,7 @@ char sprnames[NUMSPRITES + 1][5] = "EMBM", // Emblem "SPCN", // Spray Can "MMSH", // Ancient Shrine + "MORB", // One Morbillion "EMRC", // Chaos Emeralds "SEMR", // Super Emeralds "ESPK", @@ -1902,6 +1903,22 @@ state_t states[NUMSTATES] = // Ancient Shrine {SPR_MMSH, 0, -1, {NULL}, 0, 0, S_NULL}, // S_ANCIENTSHRINE + {SPR_MORB, 0|FF_ADD, 1, {A_FireShrink}, 2*FRACUNIT/3, 12, S_MORB2}, // S_MORB1 + {SPR_MORB, 1|FF_ADD, 1, {NULL}, 0, 0, S_MORB3}, // S_MORB2 + {SPR_MORB, 2|FF_ADD, 1, {NULL}, 0, 0, S_MORB4}, // S_MORB3 + {SPR_MORB, 3|FF_ADD, 1, {NULL}, 0, 0, S_MORB5}, // S_MORB4 + {SPR_MORB, 4|FF_ADD, 1, {NULL}, 0, 0, S_MORB6}, // S_MORB5 + {SPR_MORB, 5|FF_ADD, 1, {NULL}, 0, 0, S_MORB7}, // S_MORB6 + {SPR_MORB, 6|FF_ADD, 1, {NULL}, 0, 0, S_MORB8}, // S_MORB7 + {SPR_MORB, 7|FF_ADD, 4, {NULL}, 0, 0, S_MORB9}, // S_MORB8 + {SPR_MORB, 6|FF_ADD, 1, {A_FireShrink}, 1, 12, S_MORB10}, // S_MORB9 + {SPR_MORB, 5|FF_ADD, 1, {NULL}, 0, 0, S_MORB11}, // S_MORB10 + {SPR_MORB, 4|FF_ADD, 1, {NULL}, 0, 0, S_MORB12}, // S_MORB11 + {SPR_MORB, 3|FF_ADD, 1, {NULL}, 0, 0, S_MORB13}, // S_MORB12 + {SPR_MORB, 2|FF_ADD, 1, {NULL}, 0, 0, S_MORB14}, // S_MORB13 + {SPR_MORB, 1|FF_ADD, 1, {NULL}, 0, 0, S_MORB15}, // S_MORB14 + {SPR_MORB, 0|FF_ADD, 1, {NULL}, 0, 0, S_NULL}, // S_MORB15 + // Chaos Emeralds {SPR_EMRC, FF_FULLBRIGHT, 1, {NULL}, 0, 0, S_CHAOSEMERALD2}, // S_CHAOSEMERALD1 {SPR_EMRC, FF_FULLBRIGHT|FF_ADD, 1, {NULL}, 0, 0, S_CHAOSEMERALD1}, // S_CHAOSEMERALD2 @@ -1923,7 +1940,7 @@ state_t states[NUMSTATES] = {SPR_LENS, FF_FULLBRIGHT|FF_ADD|FF_TRANS10|FF_ANIMATE|11, 8, {NULL}, 7, 1, S_GAINAX_MID2}, // S_EMERALDFLARE1 // Prison Egg Drops - {SPR_ALTM, 0|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_PRISONEGGDROP_CD + {SPR_ALTM, 0|FF_PAPERSPRITE|FF_SEMIBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_PRISONEGGDROP_CD // Bubble Source {SPR_BBLS, 0, 8, {A_BubbleSpawn}, 2048, 0, S_BUBBLES2}, // S_BUBBLES1 diff --git a/src/info.h b/src/info.h index f9a221151..e609e6ee3 100644 --- a/src/info.h +++ b/src/info.h @@ -700,6 +700,7 @@ typedef enum sprite SPR_EMBM, // Emblem SPR_SPCN, // Spray Can SPR_MMSH, // Ancient Shrine + SPR_MORB, // One Morbillion SPR_EMRC, // Chaos Emeralds SPR_SEMR, // Super Emeralds SPR_ESPK, @@ -2382,6 +2383,22 @@ typedef enum state // Ancient Shrine S_ANCIENTSHRINE, + S_MORB1, + S_MORB2, + S_MORB3, + S_MORB4, + S_MORB5, + S_MORB6, + S_MORB7, + S_MORB8, + S_MORB9, + S_MORB10, + S_MORB11, + S_MORB12, + S_MORB13, + S_MORB14, + S_MORB15, + // Chaos Emeralds S_CHAOSEMERALD1, S_CHAOSEMERALD2, diff --git a/src/m_cond.c b/src/m_cond.c index 5d285f615..1c6530a5b 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -1827,7 +1827,7 @@ static const char *M_GetConditionString(condition_t *cn) else if (cn->type == UC_MAPSPBATTACK) work = "conquer"; else if (cn->type == UC_MAPMYSTICMELODY) - work = "activate the ancient shrine in"; + work = "play a melody for the ancient shrine in"; work = va("%s%s %s", prefix, diff --git a/src/p_enemy.c b/src/p_enemy.c index 084ccb169..81cd6c517 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -12652,11 +12652,11 @@ void A_FireShrink(mobj_t *actor) INT32 locvar1 = var1; INT32 locvar2 = var2; - if (LUA_CallAction(A_FIRESHRINK, actor)) + if (LUA_CallAction(A_FIRESHRINK, actor) || locvar2 == 0) return; actor->destscale = locvar1; - actor->scalespeed = FRACUNIT/locvar2; + actor->scalespeed = mapobjectscale/locvar2; } // Function: A_SpawnPterabytes diff --git a/src/p_mobj.c b/src/p_mobj.c index 89f6fa7c5..5b72fe747 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -7257,16 +7257,55 @@ static boolean P_MobjRegularThink(mobj_t *mobj) } case MT_ANCIENTSHRINE: { - if (P_MobjWasRemoved(mobj->tracer) == false - && mobj->tracer->fuse == 1) - { - if (!(mapheaderinfo[gamemap-1]->records.mapvisited & MV_MYSTICMELODY)) - { - mapheaderinfo[gamemap-1]->records.mapvisited |= MV_MYSTICMELODY; + boolean docolorized = false; - if (!M_UpdateUnlockablesAndExtraEmblems(true, true)) - S_StartSound(NULL, sfx_ncitem); - gamedata->deferredsave = true; + if (P_MobjWasRemoved(mobj->tracer) == false) + { + if (mobj->tracer->fuse == 1) + { + if (!(mapheaderinfo[gamemap-1]->records.mapvisited & MV_MYSTICMELODY)) + { + mapheaderinfo[gamemap-1]->records.mapvisited |= MV_MYSTICMELODY; + + if (!M_UpdateUnlockablesAndExtraEmblems(true, true)) + S_StartSound(NULL, sfx_ncitem); + gamedata->deferredsave = true; + } + } + + // Non-RNG-advancing equivalent of Obj_SpawnEmeraldSparks + if (leveltime % 3 == 0) + { + mobj_t *sparkle = P_SpawnMobjFromMobj( + mobj, + M_RandomRange(-48, 48) * FRACUNIT, + M_RandomRange(-48, 48) * FRACUNIT, + M_RandomRange(0, 64) * FRACUNIT, + MT_SPARK + ); + P_SetMobjState(sparkle, S_MORB1); + + sparkle->color = SKINCOLOR_PLAGUE; + sparkle->momz += 6 * mobj->scale * P_MobjFlip(mobj); + P_SetScale(sparkle, 2); + } + + docolorized = !!(leveltime & 1); + } + + if (mobj->colorized != docolorized) + { + if (docolorized) + { + mobj->colorized = true; + mobj->color = SKINCOLOR_PLAGUE; + mobj->spriteyoffset = 1; + } + else + { + mobj->colorized = false; + mobj->color = SKINCOLOR_NONE; + mobj->spriteyoffset = 0; } } @@ -7678,7 +7717,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj) mobj->renderflags |= RF_SEMIBRIGHT; } - P_SetMobjState(mobj, teststate); + P_SetMobjStateNF(mobj, teststate); if (P_MobjWasRemoved(mobj)) { @@ -7724,7 +7763,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj) M_RandomRange(0, 64) * FRACUNIT, MT_SPARK ); - P_SetMobjState(sparkle, mobjinfo[MT_EMERALDSPARK].spawnstate); + P_SetMobjStateNF(sparkle, mobjinfo[MT_EMERALDSPARK].spawnstate); sparkle->color = M_RandomChance(FRACUNIT/2) ? SKINCOLOR_ULTRAMARINE : SKINCOLOR_MAGENTA; sparkle->momz += 8 * mobj->scale * P_MobjFlip(mobj);