From dceab0ce70fa3fea48b3077d6df71df4d9129e0f Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 22 Oct 2018 00:34:47 +0100 Subject: [PATCH] Hardcoding start! toast's stuff specifically. * Marble Zone! * Torch decoration. * Incense burner decoration. * CD Special Stage 1! * The UFO, now with improved death animation! * Turns out I duplicated sounds that already existed in sounds.kart. When we touch up the files later, yalls can remove both `DSFUFOx`'s from it. --- src/dehacked.c | 20 +++++++ src/info.c | 147 ++++++++++++++++++++++++++++++++++++++++++++++++- src/info.h | 23 ++++++++ src/p_enemy.c | 23 +++++++- src/p_inter.c | 14 +++++ src/p_mobj.c | 32 +++++++++++ 6 files changed, 256 insertions(+), 3 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 60d38a63..ff0739b3 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1838,6 +1838,7 @@ static actionpointer_t actionpointers[] = {{A_MineExplode}, "A_MINEEXPLODE"}, // SRB2kart {{A_BallhogExplode}, "A_BALLHOGEXPLODE"}, // SRB2kart {{A_LightningFollowPlayer}, "A_LIGHTNINGFOLLOWPLAYER"}, //SRB2kart + {{A_FlameParticle}, "A_FLAMEPARTICLE"}, // SRB2kart {{A_OrbitNights}, "A_ORBITNIGHTS"}, {{A_GhostMe}, "A_GHOSTME"}, {{A_SetObjectState}, "A_SETOBJECTSTATE"}, @@ -6770,6 +6771,16 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_KLIT11", "S_KLIT12", + // Marble Zone + "S_FLAMEPARTICLE", + "S_MARBLETORCH", + "S_MARBLELIGHT", + "S_MARBLEBURNER", + + // CD Special Stage + "S_CDUFO", + "S_CDUFO_DIE", + #ifdef SEENAMES "S_NAMECHECK", #endif @@ -7423,6 +7434,15 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_KARMAHITBOX", "MT_KARMAWHEEL", + // Marble Zone + "MT_FLAMEPARTICLE", + "MT_MARBLETORCH", + "MT_MARBLELIGHT", + "MT_MARBLEBURNER", + + // CD Special Stage + "MT_CDUFO", + #ifdef SEENAMES "MT_NAMECHECK", #endif diff --git a/src/info.c b/src/info.c index 2efa68ab..19403f51 100644 --- a/src/info.c +++ b/src/info.c @@ -61,7 +61,7 @@ char sprnames[NUMSPRITES + 1][5] = "DEZL","POKE","AUDI","DECO","DOOD","SNES","GBAS","SPRS","BUZB","CHOM", "SACO","CRAB","SHAD","BRNG","BUMP","FLEN","CLAS","PSHW","ISTA","ISTB", "ARRO","ITEM","ITMO","ITMI","ITMN","WANT","PBOM","RETI","AIDU","KSPK", - "LZI1","LZI2","KLIT","VIEW" + "LZI1","LZI2","KLIT","MARB","FUFO","VIEW" }; // Doesn't work with g++, needs actionf_p1 (don't modify this comment) @@ -3066,6 +3066,16 @@ state_t states[NUMSTATES] = {SPR_KLIT, FF_FULLBRIGHT|FF_PAPERSPRITE|5, 2, {A_LightningFollowPlayer}, 0, 0, S_KLIT12}, // S_KLIT11 {SPR_NULL, FF_FULLBRIGHT|FF_PAPERSPRITE, 2, {A_LightningFollowPlayer}, 0, 0, S_KLIT1}, // S_KLIT12 + // Marble Zone + {SPR_MARB, FF_FULLBRIGHT|FF_ANIMATE|5, TICRATE, {NULL}, 3, 3, S_NULL}, // S_FLAMEPARTICLE + {SPR_MARB, FF_FULLBRIGHT|FF_ANIMATE, 8*3, {A_FlameParticle}, 3, 3, S_MARBLETORCH}, // S_MARBLETORCH + {SPR_MARB, FF_FULLBRIGHT|FF_TRANS80|4, -1, {NULL}, 1, 29, S_NULL}, // S_MARBLELIGHT + {SPR_MARB, 9, -1, {NULL}, 0, 0, S_NULL}, // S_MARBLEBURNER + + // CD Special Stage + {SPR_FUFO, 0, 1, {A_Thrust}, 5, 2, S_CDUFO}, // S_CDUFO + {SPR_FUFO, 0, 4, {A_BossScream}, 0, MT_EXPLODE, S_CDUFO_DIE}, // S_CDUFO_DIE + #ifdef SEENAMES {SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK #endif @@ -17211,6 +17221,141 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_FLAMEPARTICLE + -1, // doomednum + S_FLAMEPARTICLE,// spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + FRACUNIT, // radius + FRACUNIT, // height + 0, // display offset + 0, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOGRAVITY|MF_SCENERY|MF_NOCLIPTHING|MF_NOCLIPHEIGHT, // flags + S_NULL // raisestate + }, + + { // MT_MARBLETORCH + 1969, // doomednum + S_MARBLETORCH, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + MT_FLAMEPARTICLE,// painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 12*FRACUNIT, // radius + 45*FRACUNIT, // height + 0, // display offset + 0, // mass + 0, // damage + sfx_None, // activesound + MF_SCENERY|MF_NOGRAVITY|MF_FIRE|MF_PAIN, // flags + S_NULL // raisestate + }, + + { // MT_MARBLELIGHT + -1, // doomednum + S_MARBLELIGHT, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + FRACUNIT, // radius + FRACUNIT, // height + 0, // display offset + 0, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOGRAVITY|MF_SCENERY|MF_NOCLIPTHING|MF_NOCLIPHEIGHT, // flags + S_NULL // raisestate + }, + + { // MT_MARBLEBURNER + 1970, // doomednum + S_MARBLEBURNER, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 24*FRACUNIT, // radius + 96*FRACUNIT, // height + 0, // display offset + 0, // mass + 0, // damage + sfx_None, // activesound + MF_NOTHINK|MF_SOLID, // flags + S_NULL // raisestate + }, + + { // MT_CDUFO + 4050, // doomednum + S_CDUFO, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_CDUFO_DIE, // deathstate + S_NULL, // xdeathstate + sfx_cdfm19, // deathsound + 0, // speed + 70*FRACUNIT, // radius + 70*FRACUNIT, // height + 0, // display offset + 0, // mass + 0, // damage + sfx_None, // activesound + MF_NOGRAVITY|MF_NOCLIPHEIGHT|MF_SPECIAL, // flags + S_NULL // raisestate + }, + // ============================================================================================================================// #ifdef SEENAMES diff --git a/src/info.h b/src/info.h index f14d2121..7c3f3757 100644 --- a/src/info.h +++ b/src/info.h @@ -169,6 +169,7 @@ void A_JawzExplode(); // SRB2kart void A_MineExplode(); // SRB2kart void A_BallhogExplode(); // SRB2kart void A_LightningFollowPlayer(); // SRB2kart: Lightning shield effect player chasing +void A_FlameParticle(); void A_OrbitNights(); void A_GhostMe(); void A_SetObjectState(); @@ -653,6 +654,9 @@ typedef enum sprite SPR_LZI2, // ditto SPR_KLIT, // You have a twisted mind. But this actually is for the diagonal lightning. + SPR_MARB, // Marble Zone sprites + SPR_FUFO, // CD Special Stage UFO (don't ask me why it begins with an F) + SPR_VIEW, // First person view sprites; this is a sprite so that it can be replaced by a specialized MD2 draw! SPR_FIRSTFREESLOT, @@ -3613,6 +3617,16 @@ typedef enum state S_KLIT11, S_KLIT12, + // Marble Zone + S_FLAMEPARTICLE, + S_MARBLETORCH, + S_MARBLELIGHT, + S_MARBLEBURNER, + + // CD Special Stage + S_CDUFO, + S_CDUFO_DIE, + #ifdef SEENAMES S_NAMECHECK, #endif @@ -4283,6 +4297,15 @@ typedef enum mobj_type MT_KARMAHITBOX, MT_KARMAWHEEL, + // Marble Zone + MT_FLAMEPARTICLE, + MT_MARBLETORCH, + MT_MARBLELIGHT, + MT_MARBLEBURNER, + + // CD Special Stage + MT_CDUFO, + #ifdef SEENAMES MT_NAMECHECK, #endif diff --git a/src/p_enemy.c b/src/p_enemy.c index 37dd5899..9e6ce386 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -193,6 +193,7 @@ void A_JawzExplode(mobj_t *actor); // SRB2kart void A_MineExplode(mobj_t *actor); // SRB2kart void A_BallhogExplode(mobj_t *actor); // SRB2kart void A_LightningFollowPlayer(mobj_t *actor); // SRB2kart +void A_FlameParticle(mobj_t *actor); // SRB2kart void A_OrbitNights(mobj_t *actor); void A_GhostMe(mobj_t *actor); void A_SetObjectState(mobj_t *actor); @@ -8403,7 +8404,9 @@ void A_LightningFollowPlayer(mobj_t *actor) if (LUA_CallAction("A_LightningFollowPlayer", actor)) return; #endif - if (actor->target) + if (!actor->target) + return; + { if (actor->extravalue1) // Make the radius also follow the player somewhat accuratly { @@ -8418,7 +8421,23 @@ void A_LightningFollowPlayer(mobj_t *actor) actor->momy = actor->target->momy; actor->momz = actor->target->momz; // Give momentum since we don't teleport to our player literally every frame. } - return; +} + +void A_FlameParticle(mobj_t *actor) +{ + fixed_t rad = actor->radius>>FRACBITS, hei = actor->radius>>FRACBITS; + mobj_t *par; +#ifdef HAVE_BLUA + if (LUA_CallAction("A_FlameParticle", actor)) + return; +#endif + + par = P_SpawnMobj( + actor->x + (P_RandomRange(-rad, rad)<y + (P_RandomRange(-rad, rad)<z + (P_RandomRange(hei/2, hei)<info->painchance); + par->momz = actor->scale<<1; } //} diff --git a/src/p_inter.c b/src/p_inter.c index 5e532c61..96733f27 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -577,6 +577,20 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) special->target->player->kartstuff[k_eggmanblame] = -1; } return; + case MT_CDUFO: // SRB2kart + if (special->fuse || !P_CanPickupItem(player, 1) || (G_BattleGametype() && player->kartstuff[k_bumper] <= 0)) + return; + + player->kartstuff[k_itemroulette] = 1; + player->kartstuff[k_roulettetype] = 1; + + S_StartSound(toucher, sfx_cdfm73); // they don't make this sound in the original game but it's nice to have a "reward" for good play + + //special->momx = special->momy = special->momz = 0; + special->momz = -(3*special->scale)/2; + //P_SetTarget(&special->target, toucher); + special->fuse = 2*TICRATE; + break; // ***************************************** // // Rings, coins, spheres, weapon panels, etc // diff --git a/src/p_mobj.c b/src/p_mobj.c index 84163f1c..981ac8a9 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -7434,6 +7434,10 @@ void P_MobjThinker(mobj_t *mobj) case MT_MINEEXPLOSIONSOUND: P_RemoveMobj(mobj); return; + case MT_CDUFO: + if (mobj->fuse > TICRATE) + mobj->flags2 ^= MF2_DONTDRAW; // only by good fortune does this end with it having MF2_DONTDRAW... don't touch! + break; //} default: break; @@ -8480,6 +8484,31 @@ void P_MobjThinker(mobj_t *mobj) } } } + break; + case MT_CDUFO: + if (!mobj->spawnpoint || mobj->fuse) + break; + + if (mobj->movecount) + { + mobj->movecount--; + break; + } + else if (P_AproxDistance(mobj->x - (mobj->spawnpoint->x<y - (mobj->spawnpoint->y<movecount = 3; + + { + angle_t facing = P_RandomRange(0, 90); + if (facing >= 45) + facing = InvAngle((facing - 45)*ANG1); + else + facing *= ANG1; + + mobj->angle = R_PointToAngle2(mobj->x, mobj->y, mobj->spawnpoint->x<spawnpoint->y<color = SKINCOLOR_AQUA; break; } + case MT_MARBLETORCH: + P_SpawnMobj(mobj->x, mobj->y, mobj->z + (29<