From e610c41d0f76845c2f735f33697c4765af438751 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sun, 18 Sep 2022 04:33:03 -0400 Subject: [PATCH 1/5] Add Poh-Bee sprites --- src/deh_tables.c | 14 +++++++++++++- src/info.c | 26 ++++++++++++++++++++------ src/info.h | 18 ++++++++++++++++-- src/objects/shrink.c | 29 ++++++++++++++++++++++++++--- 4 files changed, 75 insertions(+), 12 deletions(-) diff --git a/src/deh_tables.c b/src/deh_tables.c index 5fe950e9e..7bb649d2b 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -3759,8 +3759,20 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi "S_GROW_PARTICLE", // Shrink - "S_SHRINK_GUN", + "S_SHRINK_POHBEE", + "S_SHRINK_POHBEE2", + "S_SHRINK_POHBEE3", + "S_SHRINK_POHBEE4", + "S_SHRINK_POHBEE5", + "S_SHRINK_POHBEE6", + "S_SHRINK_POHBEE7", + "S_SHRINK_POHBEE8", + "S_SHRINK_CHAIN", + + "S_SHRINK_GUN", + "S_SHRINK_GUN_OVERLAY", + "S_SHRINK_LASER", "S_SHRINK_PARTICLE", diff --git a/src/info.c b/src/info.c index b0a3becef..6774050b6 100644 --- a/src/info.c +++ b/src/info.c @@ -575,7 +575,9 @@ char sprnames[NUMSPRITES + 1][5] = "HYUU", // Hyudoro "GRWP", // Grow "POHB", // Shrink Poh-Bee - "SHRG", // Shrink gun / laser + "POHC", // Shrink Poh-Bee chain + "SHRG", // Shrink gun + "SHRL", // Shrink laser "SINK", // Kitchen Sink "SITR", // Kitchen Sink Trail "KBLN", // Battle Mode Bumper @@ -4319,10 +4321,22 @@ state_t states[NUMSTATES] = {SPR_GRWP, FF_FULLBRIGHT|FF_ANIMATE, 13, {NULL}, 7, 1, S_NULL}, // S_GROW_PARTICLE + {SPR_POHB, 0, 1, {NULL}, 0, 0, S_SHRINK_POHBEE2}, // S_SHRINK_POHBEE + {SPR_POHB, 1, 1, {NULL}, 0, 0, S_SHRINK_POHBEE3}, // S_SHRINK_POHBEE2 + {SPR_POHB, 0, 1, {NULL}, 0, 0, S_SHRINK_POHBEE4}, // S_SHRINK_POHBEE3 + {SPR_POHB, 2, 1, {NULL}, 0, 0, S_SHRINK_POHBEE5}, // S_SHRINK_POHBEE4 + {SPR_POHB, 0, 1, {NULL}, 0, 0, S_SHRINK_POHBEE6}, // S_SHRINK_POHBEE5 + {SPR_POHB, 3, 1, {NULL}, 0, 0, S_SHRINK_POHBEE7}, // S_SHRINK_POHBEE6 + {SPR_POHB, 0, 1, {NULL}, 0, 0, S_SHRINK_POHBEE8}, // S_SHRINK_POHBEE7 + {SPR_POHB, 2, 1, {NULL}, 0, 0, S_SHRINK_POHBEE}, // S_SHRINK_POHBEE8 + + {SPR_POHC, 0, -1, {NULL}, 0, 0, S_NULL}, // S_SHRINK_CHAIN + {SPR_SHRG, 0, -1, {NULL}, 0, 0, S_NULL}, // S_SHRINK_GUN - {SPR_POHB, 0, -1, {NULL}, 0, 0, S_NULL}, // S_SHRINK_CHAIN - {SPR_SHRG, FF_FULLBRIGHT|1, -1, {NULL}, 0, 0, S_NULL}, // S_SHRINK_LASER - {SPR_SHRG, FF_FULLBRIGHT|2, -1, {NULL}, 0, 0, S_NULL}, // S_SHRINK_PARTICLE + {SPR_SHRG, FF_FULLBRIGHT|1, -1, {NULL}, 0, 0, S_NULL}, // S_SHRINK_GUN_OVERLAY + + {SPR_SHRL, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_SHRINK_LASER + {SPR_SHRL, FF_FULLBRIGHT|1, -1, {NULL}, 0, 0, S_NULL}, // S_SHRINK_PARTICLE {SPR_SINK, 0, 1, {A_SmokeTrailer}, MT_SINKTRAIL, 0, S_SINK}, // S_SINK {SPR_SINK, 0|FF_TRANS80|FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_SINK_SHIELD}, // S_SINK_SHIELD @@ -24075,7 +24089,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_SHRINK_POHBEE -1, // doomednum - S_HYUDORO, // spawnstate + S_SHRINK_POHBEE, // spawnstate 1000, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -24096,7 +24110,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // mass 0, // damage sfx_None, // activesound - MF_NOCLIP|MF_NOCLIPTHING|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_DONTENCOREMAP, // flags + MF_NOCLIP|MF_NOCLIPTHING|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_DONTENCOREMAP|MF_NOSQUISH, // flags S_NULL // raisestate }, diff --git a/src/info.h b/src/info.h index 8acf73ba8..8305e1400 100644 --- a/src/info.h +++ b/src/info.h @@ -1121,7 +1121,9 @@ typedef enum sprite SPR_HYUU, // Hyudoro SPR_GRWP, // Grow SPR_POHB, // Shrink Poh-Bee - SPR_SHRG, // Shrink gun / laser + SPR_POHC, // Shrink Poh-Bee chain + SPR_SHRG, // Shrink gun + SPR_SHRL, // Shrink laser SPR_SINK, // Kitchen Sink SPR_SITR, // Kitchen Sink Trail SPR_KBLN, // Battle Mode Bumper @@ -4752,8 +4754,20 @@ typedef enum state S_GROW_PARTICLE, // Shrink - S_SHRINK_GUN, + S_SHRINK_POHBEE, + S_SHRINK_POHBEE2, + S_SHRINK_POHBEE3, + S_SHRINK_POHBEE4, + S_SHRINK_POHBEE5, + S_SHRINK_POHBEE6, + S_SHRINK_POHBEE7, + S_SHRINK_POHBEE8, + S_SHRINK_CHAIN, + + S_SHRINK_GUN, + S_SHRINK_GUN_OVERLAY, + S_SHRINK_LASER, S_SHRINK_PARTICLE, diff --git a/src/objects/shrink.c b/src/objects/shrink.c index 017c19829..10fb2aa10 100644 --- a/src/objects/shrink.c +++ b/src/objects/shrink.c @@ -34,7 +34,7 @@ // vertical flip // -#define POHBEE_HOVER (256 << FRACBITS) +#define POHBEE_HOVER (128 << FRACBITS) #define POHBEE_SPEED (128 << FRACBITS) #define POHBEE_TIME (30 * TICRATE) #define POHBEE_DIST (4096 << FRACBITS) @@ -68,6 +68,7 @@ enum #define gun_pohbee(o) ((o)->target) #define gun_laser(o) ((o)->tracer) #define gun_chains(o) ((o)->hprev) +#define gun_overlay(o) ((o)->itnext) #define chain_index(o) ((o)->extravalue1) @@ -314,7 +315,7 @@ static void ShrinkLaserThinker(mobj_t *pohbee, mobj_t *gun, mobj_t *laser) mobj_t *particle = NULL; laser->renderflags &= ~RF_DONTDRAW; - laser->color = gun->color; + laser->color = ShrinkLaserColor(pohbee); if (leveltime & 1) { @@ -386,6 +387,7 @@ static void DoGunChains(mobj_t *gun, mobj_t *pohbee) static void ShrinkGunThinker(mobj_t *gun) { mobj_t *pohbee = gun_pohbee(gun); + skincolornum_t gunColor = SKINCOLOR_GREY; if (pohbee == NULL || P_MobjWasRemoved(pohbee) == true) { @@ -394,7 +396,19 @@ static void ShrinkGunThinker(mobj_t *gun) } gun->angle = pohbee->angle; - gun->color = ShrinkLaserColor(pohbee); + + if (pohbee_owner(pohbee) != NULL && P_MobjWasRemoved(pohbee_owner(pohbee)) == false + && pohbee_owner(pohbee)->player != NULL) + { + gunColor = pohbee_owner(pohbee)->player->skincolor; + } + + gun->color = gunColor; + + if (gun_overlay(gun) != NULL && P_MobjWasRemoved(gun_overlay(gun)) == false) + { + gun_overlay(gun)->color = ShrinkLaserColor(pohbee); + } DoGunSwing(gun, pohbee); @@ -411,6 +425,7 @@ void Obj_PohbeeThinker(mobj_t *pohbee) mobj_t *gun = NULL; pohbee->momx = pohbee->momy = pohbee->momz = 0; + pohbee->spritexscale = pohbee->spriteyscale = 2*FRACUNIT; switch (pohbee_mode(pohbee)) { @@ -654,6 +669,7 @@ static void CreatePohbee(player_t *owner, waypoint_t *start, waypoint_t *end, UI const UINT8 numSegs = segVal * (i + 1); mobj_t *gun = P_SpawnMobjFromMobj(pohbee, 0, 0, 0, MT_SHRINK_GUN); + mobj_t *overlay = NULL; mobj_t *laser = NULL; mobj_t *prevChain = NULL; @@ -663,6 +679,13 @@ static void CreatePohbee(player_t *owner, waypoint_t *start, waypoint_t *end, UI gun_numsegs(gun) = numSegs; gun_offset(gun) = P_RandomKey(GUN_SWINGTIME); + overlay = P_SpawnMobjFromMobj(gun, 0, 0, 0, MT_OVERLAY); + + P_SetTarget(&overlay->target, gun); + P_SetTarget(&gun_overlay(gun), overlay); + + P_SetMobjState(overlay, S_SHRINK_GUN_OVERLAY); + laser = P_SpawnMobjFromMobj(gun, 0, 0, 0, MT_SHRINK_LASER); P_SetTarget(&gun_laser(gun), laser); From dc350a77df4f43e73510b9d190fb9f965024f6ec Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sun, 18 Sep 2022 04:43:58 -0400 Subject: [PATCH 2/5] Remove old powerup warning option --- src/d_netcmd.c | 2 -- src/d_netcmd.h | 1 - src/k_kart.c | 25 ++++++------------------- src/k_menudef.c | 3 --- src/objects/shrink.c | 2 +- src/sounds.c | 2 -- src/sounds.h | 2 -- 7 files changed, 7 insertions(+), 30 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 1f7ef33a2..9dcc990a9 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -409,8 +409,6 @@ consvar_t cv_dualjawz = CVAR_INIT ("dualjawz", "On", CV_NETVAR|CV_CHEAT, C static CV_PossibleValue_t kartminimap_cons_t[] = {{0, "MIN"}, {10, "MAX"}, {0, NULL}}; consvar_t cv_kartminimap = CVAR_INIT ("kartminimap", "4", CV_SAVE, kartminimap_cons_t, NULL); consvar_t cv_kartcheck = CVAR_INIT ("kartcheck", "Yes", CV_SAVE, CV_YesNo, NULL); -static CV_PossibleValue_t kartinvinsfx_cons_t[] = {{0, "Music"}, {1, "SFX"}, {0, NULL}}; -consvar_t cv_kartinvinsfx = CVAR_INIT ("kartinvinsfx", "SFX", CV_SAVE, kartinvinsfx_cons_t, NULL); consvar_t cv_kartspeed = CVAR_INIT ("kartspeed", "Auto", CV_NETVAR|CV_CALL|CV_NOINIT, kartspeed_cons_t, KartSpeed_OnChange); static CV_PossibleValue_t kartbumpers_cons_t[] = {{1, "MIN"}, {12, "MAX"}, {0, NULL}}; consvar_t cv_kartbumpers = CVAR_INIT ("kartbumpers", "3", CV_NETVAR|CV_CHEAT, kartbumpers_cons_t, NULL); diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 3a67fc458..1cc3a61d4 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -83,7 +83,6 @@ extern consvar_t cv_tripleorbinaut, cv_quadorbinaut, cv_dualjawz; extern consvar_t cv_kartminimap; extern consvar_t cv_kartcheck; -extern consvar_t cv_kartinvinsfx; extern consvar_t cv_kartspeed; extern consvar_t cv_kartbumpers; extern consvar_t cv_kartfrantic; diff --git a/src/k_kart.c b/src/k_kart.c index 03859aee6..05f2cd4cf 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -241,7 +241,6 @@ void K_RegisterKartStuff(void) CV_RegisterVar(&cv_kartminimap); CV_RegisterVar(&cv_kartcheck); - CV_RegisterVar(&cv_kartinvinsfx); CV_RegisterVar(&cv_kartspeed); CV_RegisterVar(&cv_kartbumpers); CV_RegisterVar(&cv_kartfrantic); @@ -5796,7 +5795,7 @@ void K_DoInvincibility(player_t *player, tic_t time) } else //used to be "if (P_IsDisplayPlayer(player) == false)" { - S_StartSound(player->mo, (cv_kartinvinsfx.value ? sfx_alarmi : sfx_kinvnc)); + S_StartSound(player->mo, sfx_alarmi); } P_RestoreMusic(player); @@ -7012,20 +7011,10 @@ static void K_UpdateInvincibilitySounds(player_t *player) if (player->mo->health > 0 && !P_IsLocalPlayer(player)) // used to be !P_IsDisplayPlayer(player) { - if (cv_kartinvinsfx.value) - { - if (player->invincibilitytimer > 0) // Prioritize invincibility - sfxnum = sfx_alarmi; - else if (player->growshrinktimer > 0) - sfxnum = sfx_alarmg; - } - else - { - if (player->invincibilitytimer > 0) - sfxnum = sfx_kinvnc; - else if (player->growshrinktimer > 0) - sfxnum = sfx_kgrow; - } + if (player->invincibilitytimer > 0) // Prioritize invincibility + sfxnum = sfx_alarmi; + else if (player->growshrinktimer > 0) + sfxnum = sfx_alarmg; } if (sfxnum != sfx_None && !S_SoundPlaying(player->mo, sfxnum)) @@ -7036,8 +7025,6 @@ static void K_UpdateInvincibilitySounds(player_t *player) S_StopSoundByID(player->mo, this); STOPTHIS(sfx_alarmi); STOPTHIS(sfx_alarmg); - STOPTHIS(sfx_kinvnc); - STOPTHIS(sfx_kgrow); #undef STOPTHIS } @@ -10076,7 +10063,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) } else //used to be "if (P_IsDisplayPlayer(player) == false)" { - S_StartSound(player->mo, (cv_kartinvinsfx.value ? sfx_alarmg : sfx_kgrow)); + S_StartSound(player->mo, sfx_alarmg); } P_RestoreMusic(player); diff --git a/src/k_menudef.c b/src/k_menudef.c index ed1e33c42..d97083509 100644 --- a/src/k_menudef.c +++ b/src/k_menudef.c @@ -871,9 +871,6 @@ menuitem_t OPTIONS_Sound[] = {IT_STRING | IT_CVAR, "Character Voices", "Set how often to play character voices in game.", NULL, {.cvar = &cv_kartvoices}, 0, 0}, - {IT_STRING | IT_CVAR, "Powerup Warning", "Set how to warn you from other player's powerups such as Invincibility.", - NULL, {.cvar = &cv_kartinvinsfx}, 0, 0}, - {IT_SPACE | IT_NOTHING, NULL, NULL, NULL, {NULL}, 0, 0}, diff --git a/src/objects/shrink.c b/src/objects/shrink.c index 10fb2aa10..fda826db6 100644 --- a/src/objects/shrink.c +++ b/src/objects/shrink.c @@ -545,7 +545,7 @@ boolean Obj_ShrinkLaserCollide(mobj_t *gun, mobj_t *victim) } else //used to be "if (P_IsDisplayPlayer(victim->player) == false)" { - S_StartSound(victim, (cv_kartinvinsfx.value ? sfx_alarmg : sfx_kgrow)); + S_StartSound(victim, sfx_alarmg); } P_RestoreMusic(victim->player); diff --git a/src/sounds.c b/src/sounds.c index 351e1553f..44f944dc3 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1054,8 +1054,6 @@ sfxinfo_t S_sfx[NUMSFX] = {"kpogos", false, 96, 8, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Pogo Spring use {"alarmi", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Invincibility alarm {"alarmg", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Grow alarm - {"kinvnc", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Invincibility music - {"kgrow", false, 255, 8, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Grow music {"itrol1", true, 96, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Roulette spinning {"itrol2", true, 96, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, {"itrol3", true, 96, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, diff --git a/src/sounds.h b/src/sounds.h index e7248a369..874ce9896 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -1118,8 +1118,6 @@ typedef enum sfx_kpogos, sfx_alarmi, sfx_alarmg, - sfx_kinvnc, - sfx_kgrow, sfx_itrol1, sfx_itrol2, sfx_itrol3, From ab8126b70678aa78e71ec08a043346759a6ca825 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sun, 18 Sep 2022 05:06:45 -0400 Subject: [PATCH 3/5] Add Tyron's sound --- src/objects/shrink.c | 10 ++++++++++ src/sounds.c | 5 ++++- src/sounds.h | 3 +++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/objects/shrink.c b/src/objects/shrink.c index fda826db6..e1e195e67 100644 --- a/src/objects/shrink.c +++ b/src/objects/shrink.c @@ -344,10 +344,20 @@ static void ShrinkLaserThinker(mobj_t *pohbee, mobj_t *gun, mobj_t *laser) particle->destscale = 0; //particle->momz = 2 * particle->scale * P_MobjFlip(particle); + + if (S_SoundPlaying(laser, sfx_beam01) == false) + { + S_StartSound(laser, sfx_beam01); + } } else { laser->renderflags |= RF_DONTDRAW; + + if (S_SoundPlaying(laser, sfx_beam01) == true) + { + S_StopSound(laser); + } } } diff --git a/src/sounds.c b/src/sounds.c index 44f944dc3..1cff40633 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1113,7 +1113,10 @@ sfxinfo_t S_sfx[NUMSFX] = {"ffbonc", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Shout message sound effect - {"sysmsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Server notification"}, + {"sysmsg", false, 255, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Server notification"}, + + // Shrink laser beam + {"beam01", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // SRB2Kart - Engine sounds // Engine class A diff --git a/src/sounds.h b/src/sounds.h index 874ce9896..cb9d3b671 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -1180,6 +1180,9 @@ typedef enum // Shout message sound effect sfx_sysmsg, + // Shrink laser + sfx_beam01, + // Next up: UNIQUE ENGINE SOUNDS! Hoooooo boy... // Engine class A - Low Speed, Low Weight sfx_krta00, From fe960530da17d9994afcbbb1f13f97bbb8269e15 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sun, 18 Sep 2022 05:20:29 -0400 Subject: [PATCH 4/5] Pohbee turns around when reaching the waypoint --- src/objects/shrink.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/objects/shrink.c b/src/objects/shrink.c index e1e195e67..241164aa7 100644 --- a/src/objects/shrink.c +++ b/src/objects/shrink.c @@ -58,6 +58,7 @@ enum #define pohbee_waypoint_cur(o) ((o)->extravalue1) #define pohbee_waypoint_dest(o) ((o)->extravalue2) #define pohbee_height(o) ((o)->movefactor) +#define pohbee_destangle(o) ((o)->movedir) #define pohbee_owner(o) ((o)->target) #define pohbee_guns(o) ((o)->hnext) @@ -239,12 +240,13 @@ static void PohbeeSpawn(mobj_t *pohbee) } PohbeeMoveTo(pohbee, newX, newY, newZ); - pohbee->angle = K_MomentumAngle(pohbee); + pohbee_destangle(pohbee) = K_MomentumAngle(pohbee); if (finalize == true) { // Move to next state pohbee_mode(pohbee) = POHBEE_MODE_ACT; + pohbee_destangle(pohbee) += ANGLE_180; } if (pathfindsuccess == true) @@ -405,7 +407,10 @@ static void ShrinkGunThinker(mobj_t *gun) return; } - gun->angle = pohbee->angle; + if (pohbee_mode(pohbee) == POHBEE_MODE_SPAWN) + { + gun->angle = pohbee->angle; + } if (pohbee_owner(pohbee) != NULL && P_MobjWasRemoved(pohbee_owner(pohbee)) == false && pohbee_owner(pohbee)->player != NULL) @@ -457,6 +462,8 @@ void Obj_PohbeeThinker(mobj_t *pohbee) break; } + pohbee->angle += AngleDeltaSigned(pohbee_destangle(pohbee), pohbee->angle) / 8; + gun = pohbee_guns(pohbee); while (gun != NULL && P_MobjWasRemoved(gun) == false) { From 7aa29f80a9e1975e68611637e2fe5ffdb5e4d745 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sun, 18 Sep 2022 09:13:08 -0400 Subject: [PATCH 5/5] /4 -> /3 --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 03859aee6..a879fdec7 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -8430,7 +8430,7 @@ INT16 K_UpdateSteeringValue(INT16 inputSteering, INT16 destSteering) // player->steering is the turning value, but with easing applied. // Keeps micro-turning from old easing, but isn't controller dependent. - const INT16 amount = KART_FULLTURN/4; + const INT16 amount = KART_FULLTURN/3; INT16 diff = destSteering - inputSteering; INT16 outputSteering = inputSteering;