From 62529f748a1f69c73ed351cff2f3cd4bd8072f35 Mon Sep 17 00:00:00 2001 From: lachablock Date: Sat, 24 Jul 2021 19:08:04 +1000 Subject: [PATCH] Add Opulence objects --- src/dehacked.c | 16 +++++++ src/info.c | 120 ++++++++++++++++++++++++++++++++++++++++++++++++- src/info.h | 22 +++++++++ src/p_inter.c | 17 +++++++ src/p_mobj.c | 12 +++++ src/sounds.c | 1 + src/sounds.h | 1 + 7 files changed, 187 insertions(+), 2 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index d509cd49..fab99d80 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6982,6 +6982,15 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_LIZARDMAN", "S_LIONMAN", + // Opulence + "S_OPULENCE_PALMTREE", + "S_OPULENCE_FERN", + + "S_TUMBLEGEM_IDLE", + "S_TUMBLEGEM_ROLL", + "S_TUMBLECOIN_IDLE", + "S_TUMBLECOIN_FLIP", + "S_KARMAFIREWORK1", "S_KARMAFIREWORK2", "S_KARMAFIREWORK3", @@ -7780,6 +7789,13 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_LIZARDMAN", "MT_LIONMAN", + // Opulence + "MT_OPULENCE_PALMTREE", + "MT_OPULENCE_FERN", + + "MT_TUMBLEGEM", + "MT_TUMBLECOIN", + "MT_KARMAFIREWORK", #ifdef SEENAMES diff --git a/src/info.c b/src/info.c index 8ff402ee..2f6516d9 100644 --- a/src/info.c +++ b/src/info.c @@ -65,8 +65,8 @@ char sprnames[NUMSPRITES + 1][5] = "FROG","CBRA","HOLE","BBRA","EGFG","SMKP","MTYM","THWP","SNOB","ICEB", "CNDL","DOCH","DUCK","GTRE","CHES","CHIM","DRGN","LZMN","PGSS","ZTCH", "MKMA","MKMP","RTCH","BOWL","BOWH","BRRL","BRRR","HRSE","TOAH","BFRT", - "OFRT","RFRT","PFRT","ASPK","HBST","HBSO","HBSF","WBLZ","WBLN","FWRK", - "XMS4","XMS5","VIEW" + "OFRT","RFRT","PFRT","ASPK","HBST","HBSO","HBSF","WBLZ","WBLN","OPUL", + "TGEM","TCOI","FWRK","XMS4","XMS5","VIEW" }; // Doesn't work with g++, needs actionf_p1 (don't modify this comment) @@ -3385,6 +3385,14 @@ state_t states[NUMSTATES] = {SPR_WBLZ, 0, -1, {NULL}, 0, 0, S_NULL}, // S_LIZARDMAN {SPR_WBLN, 0, -1, {NULL}, 0, 0, S_NULL}, // S_LIONMAN + {SPR_OPUL, 0, -1, {NULL}, 0, 0, S_NULL}, // S_OPULENCE_PALMTREE + {SPR_OPUL, 1, -1, {NULL}, 0, 0, S_NULL}, // S_OPULENCE_FERN + + {SPR_TGEM, 1, -1, {NULL}, 0, 0, S_NULL}, // S_TUMBLEGEM_IDLE + {SPR_TGEM, FF_ANIMATE|0, -1, {NULL}, 7, 2, S_NULL}, // S_TUMBLEGEM_ROLL + {SPR_TCOI, 2, -1, {NULL}, 0, 0, S_NULL}, // S_TUMBLECOIN_IDLE + {SPR_TCOI, FF_ANIMATE|0, -1, {NULL}, 3, 1, S_NULL}, // S_TUMBLECOIN_FLIP + {SPR_FWRK, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_KARMAFIREWORK2}, // S_KARMAFIREWORK1 {SPR_FWRK, 1|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_KARMAFIREWORK3}, // S_KARMAFIREWORK2 {SPR_FWRK, 2|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_KARMAFIREWORK4}, // S_KARMAFIREWORK3 @@ -20029,6 +20037,114 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_OPULENCE_PALMTREE + 3795, // doomednum + S_OPULENCE_PALMTREE, // 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 + 16<momx || toucher->momy) && (flip * special->momz <= 0)) + { + special->momx = toucher->momx; + special->momy = toucher->momy; + special->momz = flip * max(P_AproxDistance(toucher->momx, toucher->momy) / 4, FixedMul(special->info->speed, special->scale)); + if (flip * toucher->momz > 0) + special->momz += toucher->momz / 8; + if ((statenum_t)(special->state-states) != special->info->seestate) + P_SetMobjState(special, special->info->seestate); + S_StartSound(special, special->info->activesound); + } + } + return; // ***************************************** // // Rings, coins, spheres, weapon panels, etc // diff --git a/src/p_mobj.c b/src/p_mobj.c index 506d7807..3e215fdc 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8851,6 +8851,16 @@ void P_MobjThinker(mobj_t *mobj) } } break; + case MT_TUMBLEGEM: + case MT_TUMBLECOIN: + mobj->friction = 95*FRACUNIT/100; + if ((((statenum_t)(mobj->state-states)) == mobj->info->seestate) + && abs(mobj->momx) < mobj->scale && abs(mobj->momy) < mobj->scale && P_IsObjectOnGround(mobj)) + { + mobj->momx = mobj->momy = 0; + P_SetMobjState(mobj, mobj->info->spawnstate); + } + break; case MT_KARMAFIREWORK: if (mobj->momz == 0) { @@ -9866,6 +9876,8 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) } } break; + case MT_TUMBLEGEM: + mobj->color = P_RandomKey(MAXSKINCOLORS - 1) + 1; default: break; } diff --git a/src/sounds.c b/src/sounds.c index 9285a2a8..c42584a1 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -815,6 +815,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"chain", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Mementos Reaper {"mkuma", false, 96, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Trigger Happy Havoc Monokuma {"toada", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Arid Sands Toad scream + {"gemhit", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Opulence gem/coin tumbling {"bsnipe", false, 96, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Banana sniping {"join", false, 96, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Player joined server {"leave", false, 96, 8, -1, NULL, 0, -1, -1, LUMPERROR}, // Player left server diff --git a/src/sounds.h b/src/sounds.h index 4091081b..3a44f263 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -890,6 +890,7 @@ typedef enum sfx_chain, sfx_mkuma, sfx_toada, + sfx_gemhit, sfx_bsnipe, sfx_join, sfx_leave,