From 4c551a03ca1df504b9c0cc7b64f9f7e99082bd7a Mon Sep 17 00:00:00 2001 From: "James R." Date: Sun, 17 Sep 2023 19:52:30 -0700 Subject: [PATCH 01/18] project_hyudoro: match Z to slope of center point --- src/info.c | 2 +- src/objects/hyudoro.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/info.c b/src/info.c index 2343b81e3..4aaff79e1 100644 --- a/src/info.c +++ b/src/info.c @@ -24673,7 +24673,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // mass 0, // damage sfx_None, // activesound - MF_SPECIAL|MF_NOCLIP|MF_NOGRAVITY|MF_DONTENCOREMAP|MF_APPLYTERRAIN, // flags + MF_SPECIAL|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_DONTENCOREMAP|MF_APPLYTERRAIN|MF_NOSQUISH, // flags S_NULL // raisestate }, diff --git a/src/objects/hyudoro.c b/src/objects/hyudoro.c index b5fa87429..32c190c92 100644 --- a/src/objects/hyudoro.c +++ b/src/objects/hyudoro.c @@ -22,6 +22,7 @@ #include "../s_sound.h" #include "../g_game.h" #include "../k_hitlag.h" +#include "../p_slopes.h" enum { HYU_PATROL, @@ -150,6 +151,14 @@ project_hyudoro (mobj_t *hyu) hyu->angle = angle + ANGLE_90; sine_bob(hyu, angle, FRACUNIT); + + hyu->z = P_GetZAt(center->standingslope, hyu->x, hyu->y, + P_GetMobjGround(center)); + + if (P_IsObjectFlipped(hyu)) + { + hyu->z -= hyu->height; + } } static void @@ -570,6 +579,12 @@ Obj_HyudoroDeploy (mobj_t *master) center->angle = master->angle; Obj_InitHyudoroCenter(center, master); + // Update floorz to the correct position by indicating + // that it should be recalculated by P_MobjThinker. + center->floorz = master->z; + center->ceilingz = master->z + master->height; + center->z = P_GetMobjGround(center) - P_MobjFlip(center); + S_StartSound(master, sfx_s3k92); // scary ghost noise } From 39a867b705507bef20e14e1c5376374b6cb26369 Mon Sep 17 00:00:00 2001 From: "James R." Date: Sun, 17 Sep 2023 18:57:47 -0700 Subject: [PATCH 02/18] Double hyudoro invisibility time --- src/g_game.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index 4769c8b8b..a52d523c1 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -251,7 +251,7 @@ tic_t starttime = 3; const tic_t bulbtime = TICRATE/2; UINT8 numbulbs = 1; -INT32 hyudorotime = 7*TICRATE; +INT32 hyudorotime = 14*TICRATE; INT32 stealtime = TICRATE/2; INT32 sneakertime = TICRATE + (TICRATE/3); INT32 itemtime = 8*TICRATE; From 784090ec00854ea1ea40caa1736b7c290ccfb414 Mon Sep 17 00:00:00 2001 From: "James R." Date: Sun, 17 Sep 2023 19:21:03 -0700 Subject: [PATCH 03/18] Nullify damaging hitlag for players with hyudorotimer --- src/p_inter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_inter.c b/src/p_inter.c index 254275708..60c7bbd8d 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2301,7 +2301,7 @@ static void AddNullHitlag(player_t *player, tic_t oldHitlag) // 1) repeating damage doesn't count // 2) new damage sources still count - if (player->timeshit <= player->timeshitprev) + if (player->timeshit <= player->timeshitprev || player->hyudorotimer > 0) { player->nullHitlag += (player->mo->hitlag - oldHitlag); } From 7940158d96631be5e488f29364e96ee7dcbfd502 Mon Sep 17 00:00:00 2001 From: "James R." Date: Sun, 17 Sep 2023 19:21:28 -0700 Subject: [PATCH 04/18] K_ApplyTripWire: do not apply hitlag if player has hyudorotimer --- src/k_kart.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index e4459385b..11c97fd5a 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4323,7 +4323,11 @@ void K_ApplyTripWire(player_t *player, tripwirestate_t state) } player->tripwireState = state; - K_AddHitLag(player->mo, 10, false); + + if (player->hyudorotimer <= 0) + { + K_AddHitLag(player->mo, 10, false); + } if (state == TRIPSTATE_PASSED && player->spinouttimer && player->speed > 2 * K_GetKartSpeed(player, false, true)) From c850248873adffddc9c5743f5dec1ae2441b9025 Mon Sep 17 00:00:00 2001 From: "James R." Date: Sun, 17 Sep 2023 19:21:57 -0700 Subject: [PATCH 05/18] PIT_SSMineChecks: do not trip Mine radius if player has hyudorotimer --- src/k_collide.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_collide.cpp b/src/k_collide.cpp index 74bc74e71..b897873a8 100644 --- a/src/k_collide.cpp +++ b/src/k_collide.cpp @@ -218,7 +218,7 @@ static inline boolean PIT_SSMineChecks(mobj_t *thing) if (!(thing->flags & MF_SHOOTABLE) || (thing->flags & MF_SCENERY)) return true; - if (thing->player && thing->player->spectator) + if (thing->player && (thing->player->spectator || thing->player->hyudorotimer > 0)) return true; if (P_AproxDistance(P_AproxDistance(thing->x - grenade->x, thing->y - grenade->y), thing->z - grenade->z) > explodedist) From 3b1937684814df3e09280e9f7c1f5839d1595686 Mon Sep 17 00:00:00 2001 From: "James R." Date: Sun, 17 Sep 2023 19:12:12 -0700 Subject: [PATCH 06/18] append_hyudoro, pop_hyudoro: fix linked list handling - Use P_SetTarget to handle reference counting properly - Properly unlink from the start of the list --- src/objects/hyudoro.c | 50 +++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/src/objects/hyudoro.c b/src/objects/hyudoro.c index 32c190c92..c799c4ab4 100644 --- a/src/objects/hyudoro.c +++ b/src/objects/hyudoro.c @@ -91,7 +91,8 @@ get_look_angle (mobj_t *thing) static boolean is_hyudoro (mobj_t *thing) { - return thing && thing->type == MT_HYUDORO; + return !P_MobjWasRemoved(thing) && + thing->type == MT_HYUDORO; } static mobj_t * @@ -346,7 +347,7 @@ append_hyudoro } hyudoro_stackpos(hyu) = lastpos + 1; - *head = hyu; + P_SetTarget(head, hyu); } static void @@ -354,26 +355,37 @@ pop_hyudoro (mobj_t **head) { mobj_t *hyu = *head; - INT32 lastpos; - INT32 thispos; - - if (is_hyudoro(hyu)) + if (!is_hyudoro(hyu)) { - lastpos = hyudoro_stackpos(hyu); - hyu = hyudoro_next(hyu); - - while (is_hyudoro(hyu)) - { - thispos = hyudoro_stackpos(hyu); - - hyudoro_stackpos(hyu) = lastpos; - lastpos = thispos; - - hyu = hyudoro_next(hyu); - } + return; } - *head = hyu; + INT32 lastpos = hyudoro_stackpos(hyu); + + { + mobj_t *next = hyudoro_next(hyu); + + P_SetTarget(head, next); + P_SetTarget(&hyudoro_next(hyu), NULL); + + hyu = next; + } + + if (!is_hyudoro(hyu)) + { + return; + } + + do + { + INT32 thispos = hyudoro_stackpos(hyu); + + hyudoro_stackpos(hyu) = lastpos; + lastpos = thispos; + + hyu = hyudoro_next(hyu); + } + while (is_hyudoro(hyu)); } static void hyudoro_set_held_item_from_player From d86aaa8c0cb2e8217959ce9138ddfae5a9d9e25d Mon Sep 17 00:00:00 2001 From: "James R." Date: Sun, 17 Sep 2023 19:49:46 -0700 Subject: [PATCH 07/18] Hyudoro: smoothly transition vertical position in hovering stack --- src/objects/hyudoro.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/src/objects/hyudoro.c b/src/objects/hyudoro.c index c799c4ab4..72c59f696 100644 --- a/src/objects/hyudoro.c +++ b/src/objects/hyudoro.c @@ -162,6 +162,28 @@ project_hyudoro (mobj_t *hyu) } } +static void +rise_thru_stack (mobj_t *hyu) +{ + mobj_t *target = hyudoro_target(hyu); + + fixed_t spacer = ((target->height / 2) + + (hyu->height * 2)); + + fixed_t sink = hyudoro_stackpos(hyu) * spacer; + + fixed_t zofs = abs(hyu->momz); + fixed_t d = (zofs - sink); + fixed_t speed = d / 8; + + if (abs(d) < abs(speed)) + zofs = sink; + else + zofs -= speed; + + hyu->momz = zofs * P_MobjFlip(target); +} + static void project_hyudoro_hover (mobj_t *hyu) { @@ -171,19 +193,18 @@ project_hyudoro_hover (mobj_t *hyu) angle_t ang = get_look_angle(target) + ANGLE_67h; fixed_t rad = (target->radius * 2) + hyu->radius; - fixed_t zofs = hyudoro_stackpos(hyu) * - ((target->height / 2) + (hyu->height * 2)); - P_MoveOrigin(hyu, target->x - P_ReturnThrustX(hyu, ang, rad), target->y - P_ReturnThrustY(hyu, ang, rad), - target->z + (zofs * P_MobjFlip(target))); + target->z); // Cancel momentum from HYU_RETURN. // (And anything else! I don't trust this game!!) hyu->momx = 0; hyu->momy = 0; + rise_thru_stack(hyu); + hyu->angle = ang; // copies sprite tilting @@ -603,9 +624,6 @@ Obj_HyudoroDeploy (mobj_t *master) void Obj_HyudoroThink (mobj_t *hyu) { - // Might get set from clipping slopes - hyu->momz = 0; - switch (hyudoro_mode(hyu)) { case HYU_PATROL: From 1cd078164860adee6826f255723228a71343d634 Mon Sep 17 00:00:00 2001 From: "James R." Date: Sun, 17 Sep 2023 20:33:10 -0700 Subject: [PATCH 08/18] Hyudoro: spawn ghost trail, colorized to owner, on return to owner --- src/objects/hyudoro.c | 48 ++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/src/objects/hyudoro.c b/src/objects/hyudoro.c index 72c59f696..7dc336768 100644 --- a/src/objects/hyudoro.c +++ b/src/objects/hyudoro.c @@ -321,6 +321,8 @@ move_to_player (mobj_t *hyu) hyu->z = target->z; // stay level with target hyu->angle = angle; + + hyu->color = target->color; } static void @@ -572,6 +574,34 @@ hyudoro_hover_await_stack (mobj_t *hyu) return true; } +static void +trail_ghosts +( mobj_t * hyu, + boolean colorize) +{ + // Spawns every other frame + if (leveltime & 1) + { + return; + } + + mobj_t *ghost = P_SpawnGhostMobj(hyu); + + // Flickers every frame + ghost->extravalue1 = 1; + ghost->extravalue2 = 2; + + // copy per-splitscreen-player visibility + ghost->renderflags = + (hyu->renderflags & RF_DONTDRAW); + + ghost->colorized = colorize; + + ghost->tics = 8; + + P_SetTarget(&ghost->tracer, hyu); +} + void Obj_InitHyudoroCenter (mobj_t * center, mobj_t * master) { @@ -630,26 +660,12 @@ Obj_HyudoroThink (mobj_t *hyu) if (hyudoro_center(hyu)) project_hyudoro(hyu); - if (leveltime & 1) - { - mobj_t *ghost = P_SpawnGhostMobj(hyu); - - // Flickers every frame - ghost->extravalue1 = 1; - ghost->extravalue2 = 2; - - // copy per-splitscreen-player visibility - ghost->renderflags = - (hyu->renderflags & RF_DONTDRAW); - - ghost->tics = 8; - - P_SetTarget(&ghost->tracer, hyu); - } + trail_ghosts(hyu, false); break; case HYU_RETURN: move_to_player(hyu); + trail_ghosts(hyu, true); break; case HYU_HOVER: From 43ca8a2f4cb0e0c94293e2f614adc959212e250e Mon Sep 17 00:00:00 2001 From: "James R." Date: Sun, 17 Sep 2023 20:56:04 -0700 Subject: [PATCH 09/18] Hyudoro: toggle shadow in hovering stack so multiple shadows are not rendered --- src/objects/hyudoro.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/objects/hyudoro.c b/src/objects/hyudoro.c index 7dc336768..9a73ce7b3 100644 --- a/src/objects/hyudoro.c +++ b/src/objects/hyudoro.c @@ -131,6 +131,13 @@ bob_in_place (ANGLE_MAX / bob_speed), -(3*FRACUNIT/4)); } +static void +reset_shadow (mobj_t *hyu) +{ + hyu->shadowcolor = 15; + hyu->whiteshadow = true; +} + static void project_hyudoro (mobj_t *hyu) { @@ -371,6 +378,16 @@ append_hyudoro hyudoro_stackpos(hyu) = lastpos + 1; P_SetTarget(head, hyu); + + /* only first in list gets a shadow */ + if (lastpos == 0) + { + reset_shadow(hyu); + } + else + { + hyu->shadowcolor = 31;/* black - hide it */ + } } static void @@ -399,6 +416,8 @@ pop_hyudoro (mobj_t **head) return; } + reset_shadow(hyu);/* show it */ + do { INT32 thispos = hyudoro_stackpos(hyu); From e0d7d08ddec87420f30ce6cd2eef443f8a6abb20 Mon Sep 17 00:00:00 2001 From: "James R." Date: Sun, 17 Sep 2023 20:35:02 -0700 Subject: [PATCH 10/18] Hyudoro: flickering shadows for patrolling and stealing from a player - Shadow flickers in high contrast colors while patrolling - Shadow flickers black/white for short time after Hyudoro steals from a player - (Resetting shadow for hovering stack already handled by append_hyudoro) --- src/objects/hyudoro.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/objects/hyudoro.c b/src/objects/hyudoro.c index 9a73ce7b3..5f75ca299 100644 --- a/src/objects/hyudoro.c +++ b/src/objects/hyudoro.c @@ -62,6 +62,7 @@ K_ChangePlayerItem #define hyudoro_target(o) ((o)->target) #define hyudoro_stolefrom(o) ((o)->hnext) +#define hyudoro_timer(o) ((o)->movedir) #define hyudoro_center_max_radius(o) ((o)->threshold) #define hyudoro_center_master(o) ((o)->target) @@ -522,6 +523,12 @@ hyudoro_patrol_hit_player hyu->renderflags &= ~(RF_DONTDRAW); + // Reset shadow to default (after alt_shadow) + reset_shadow(hyu); + + // This will flicker the shadow + hyudoro_timer(hyu) = 18; + return true; } @@ -621,6 +628,31 @@ trail_ghosts P_SetTarget(&ghost->tracer, hyu); } +static void +alt_shadow (mobj_t *hyu) +{ + /* spaced out pulse, fake randomness */ + switch (leveltime % (7 + ((leveltime / 8) % 3))) + { + default: + hyu->shadowcolor = 15; + hyu->whiteshadow = false; + break; + case 1: + hyu->shadowcolor = 5; + hyu->whiteshadow = true; + break; + case 2: + hyu->shadowcolor = 181; + hyu->whiteshadow = true; + break; + case 3: + hyu->shadowcolor = 255; + hyu->whiteshadow = true; + break; + } +} + void Obj_InitHyudoroCenter (mobj_t * center, mobj_t * master) { @@ -680,11 +712,15 @@ Obj_HyudoroThink (mobj_t *hyu) project_hyudoro(hyu); trail_ghosts(hyu, false); + alt_shadow(hyu); break; case HYU_RETURN: move_to_player(hyu); trail_ghosts(hyu, true); + + if (hyudoro_timer(hyu) > 0) + hyu->whiteshadow = !hyu->whiteshadow; break; case HYU_HOVER: @@ -695,6 +731,9 @@ Obj_HyudoroThink (mobj_t *hyu) } break; } + + if (hyudoro_timer(hyu) > 0) + hyudoro_timer(hyu)--; } void From 3eeaaefc5fe0974b9447aeecad51a9a065366e1e Mon Sep 17 00:00:00 2001 From: "James R." Date: Sun, 17 Sep 2023 21:15:57 -0700 Subject: [PATCH 11/18] Hyudoro: stack uses modulate blendmode (with ghost trick) if player is in first place - If player is in first place, they cannot use the stack - Use ghost trick to lessen the effect, since modulate blendmode cannot be controlled with translucency --- src/objects/hyudoro.c | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/src/objects/hyudoro.c b/src/objects/hyudoro.c index 5f75ca299..73b7d9b6b 100644 --- a/src/objects/hyudoro.c +++ b/src/objects/hyudoro.c @@ -628,6 +628,43 @@ trail_ghosts P_SetTarget(&ghost->tracer, hyu); } +static void +trail_glow (mobj_t *hyu) +{ + mobj_t *ghost = P_SpawnGhostMobj(hyu); + + // Flickers every frame + ghost->extravalue1 = 1; + ghost->extravalue2 = 0; + + ghost->renderflags = RF_ADD | RF_TRANS80; + + ghost->tics = 2; // this actually does last one tic + + ghost->momz = hyu->momz; // copy stack position +} + +static void +blend_hover_hyudoro (mobj_t *hyu) +{ + player_t *player = get_hyudoro_target_player(hyu); + + hyu->renderflags &= ~(RF_BLENDMASK); + + if (!player) + { + return; + } + + /* 1st place: Hyudoro stack is unusable, so make a visual + indication */ + if (player->position == 1) + { + hyu->renderflags |= RF_MODULATE; + trail_glow(hyu); + } +} + static void alt_shadow (mobj_t *hyu) { @@ -727,8 +764,11 @@ Obj_HyudoroThink (mobj_t *hyu) if (hyudoro_target(hyu)) { project_hyudoro_hover(hyu); - hyudoro_hover_await_stack(hyu); + + if (hyudoro_hover_await_stack(hyu)) + break; } + blend_hover_hyudoro(hyu); break; } From 0a6fedc48a6356eb2da4244b0fdce8aaa693b4db Mon Sep 17 00:00:00 2001 From: "James R." Date: Sun, 17 Sep 2023 21:31:50 -0700 Subject: [PATCH 12/18] Hyudoro: carry item capsule back to player, use MT_EMERALD for collect animation - Carry back item capsule, painted with the skincolor of the player who was stolen from - Give player item by orbiting and shrinking into the player like an emerald - Lock player item box while animation plays, draw an empty item box on the HUD - At end of animation, burst item capsule to place item in player's hotbar - Hyudoros can no longer stack items in the hotbar -- consistent with item capsules - (If you have a Super Ring in your hotbar and Hyudoro is holding a Super Ring too, it will wait for you to use yours) --- MT_ITEMCAPSULE changes: - extravalue2 != 0: use this color on caps - MF2_STRONGBOX: award items like the roulette - Super Ring is placed in the hotbar instead of awarding rings directly - SPB is placed in the hotbar instead of throwing it immediately - DMG_INSTAKILL: don't respawn --- src/objects/emerald.c | 38 +++++++-- src/objects/hyudoro.c | 183 ++++++++++++++++++++++++++++++------------ src/p_inter.c | 26 +++--- src/p_mobj.c | 9 ++- 4 files changed, 185 insertions(+), 71 deletions(-) diff --git a/src/objects/emerald.c b/src/objects/emerald.c index cc7105b54..9174c0fca 100644 --- a/src/objects/emerald.c +++ b/src/objects/emerald.c @@ -304,13 +304,8 @@ void Obj_BeginEmeraldOrbit(mobj_t *emerald, mobj_t *target, fixed_t radius, INT3 spawn_lens_flare(emerald); } -void Obj_GiveEmerald(mobj_t *emerald) +static void give_player(mobj_t *emerald) { - if (P_MobjWasRemoved(emerald_orbit(emerald)) || P_MobjWasRemoved(emerald_award(emerald))) - { - return; - } - player_t *player = emerald_award(emerald)->player; if (!player) @@ -324,6 +319,37 @@ void Obj_GiveEmerald(mobj_t *emerald) S_StartSound(emerald_award(emerald), emerald->info->deathsound); } +void Obj_GiveEmerald(mobj_t *emerald) +{ + if (P_MobjWasRemoved(emerald_orbit(emerald)) || P_MobjWasRemoved(emerald_award(emerald))) + { + return; + } + + // FIXME: emerald orbiting behavior should become its own object. For now, + // though, enjoy these special conditions! + switch (emerald_award(emerald)->type) + { + case MT_PLAYER: + give_player(emerald); + break; + + case MT_ITEMCAPSULE: // objects/hyudoro.c + // DMG_INSTAKILL to kill it without respawning later + P_KillMobj(emerald_award(emerald), emerald_orbit(emerald), emerald_orbit(emerald), DMG_INSTAKILL); + + if (emerald_orbit(emerald)->player) + { + // Unlock item for stacked Hyudoros + emerald_orbit(emerald)->player->itemRoulette.reserved = 0; + } + break; + + default: + break; + } +} + void Obj_SetEmeraldAwardee(mobj_t *emerald, mobj_t *awardee) { P_SetTarget(&emerald_award(emerald), awardee); diff --git a/src/objects/hyudoro.c b/src/objects/hyudoro.c index 73b7d9b6b..516051c04 100644 --- a/src/objects/hyudoro.c +++ b/src/objects/hyudoro.c @@ -28,6 +28,7 @@ enum { HYU_PATROL, HYU_RETURN, HYU_HOVER, + HYU_ORBIT, }; // TODO: make these general functions @@ -38,30 +39,19 @@ K_GetSpeed (mobj_t *mobj) return FixedHypot(mobj->momx, mobj->momy); } -static void -K_ChangePlayerItem -( player_t * player, - INT32 itemtype, - INT32 itemamount) -{ - player->itemtype = itemtype; - player->itemamount = itemamount; - K_UnsetItemOut(player); -} - #define hyudoro_mode(o) ((o)->extravalue1) #define hyudoro_itemtype(o) ((o)->movefactor) #define hyudoro_itemcount(o) ((o)->movecount) #define hyudoro_hover_stack(o) ((o)->threshold) #define hyudoro_next(o) ((o)->tracer) #define hyudoro_stackpos(o) ((o)->reactiontime) -#define hyudoro_delivered(o) (hyudoro_itemtype(o) == KITEM_NONE) // cannot be combined #define hyudoro_center(o) ((o)->target) #define hyudoro_target(o) ((o)->target) #define hyudoro_stolefrom(o) ((o)->hnext) +#define hyudoro_capsule(o) ((o)->hprev) #define hyudoro_timer(o) ((o)->movedir) #define hyudoro_center_max_radius(o) ((o)->threshold) @@ -222,6 +212,30 @@ project_hyudoro_hover (mobj_t *hyu) bob_in_place(hyu, 64); } +static boolean +project_hyudoro_orbit (mobj_t *hyu) +{ + mobj_t *orbit = hyudoro_target(hyu); + + if (P_MobjWasRemoved(orbit)) + { + return false; + } + + P_MoveOrigin(hyu, orbit->x, orbit->y, orbit->z); + hyu->destscale = orbit->scale; + + mobj_t *facing = orbit->target; + + if (!P_MobjWasRemoved(facing)) + { + hyu->angle = R_PointToAngle2( + hyu->x, hyu->y, facing->x, facing->y); + } + + return true; +} + static mobj_t * find_duel_target (mobj_t *ignore) { @@ -276,12 +290,6 @@ do_confused (mobj_t *hyu) // Hyudoro is confused. // Spin around, try to find a new target. - if (hyudoro_delivered(hyu)) - { - // Already delivered, not confused - return; - } - // Try to find new target P_SetTarget(&hyudoro_target(hyu), find_duel_target(hyudoro_stolefrom(hyu))); @@ -336,32 +344,31 @@ move_to_player (mobj_t *hyu) static void deliver_item (mobj_t *hyu) { - mobj_t *target = hyudoro_target(hyu); - player_t *player = target->player; + /* set physical position to visual position in stack */ + hyu->z += hyu->momz; + hyu->momz = 0; - P_SetTarget(&hyudoro_target(hyu), NULL); + mobj_t *emerald = P_SpawnMobjFromMobj( + hyu, 0, 0, 0, MT_EMERALD); - if (player) - { - K_ChangePlayerItem(player, - hyudoro_itemtype(hyu), - player->itemamount + hyudoro_itemcount(hyu)); - } + /* only want emerald for its orbiting behavior, so make + it invisible */ + P_SetMobjState(emerald, S_INVISIBLE); - S_StartSound(target, sfx_itpick); + Obj_BeginEmeraldOrbit( + emerald, hyudoro_target(hyu), 0, 64, 128); - // Stop moving here - hyu->momx = 0; - hyu->momy = 0; + /* See Obj_GiveEmerald. I won't risk relying on the + Hyudoro object in case it is removed first. So go + through the capsule instead. */ + Obj_SetEmeraldAwardee(emerald, hyudoro_capsule(hyu)); - hyu->tics = 4; + /* hyudoro will teleport to emerald (orbit the player) */ + hyudoro_mode(hyu) = HYU_ORBIT; + P_SetTarget(&hyudoro_target(hyu), emerald); - hyu->destscale = target->scale / 4; - hyu->scalespeed = - abs(hyu->scale - hyu->destscale) / hyu->tics; - - // sets as already delivered - hyudoro_itemtype(hyu) = KITEM_NONE; + hyu->renderflags &= ~(RF_DONTDRAW | RF_BLENDMASK); + reset_shadow(hyu); } static void @@ -431,9 +438,71 @@ pop_hyudoro (mobj_t **head) while (is_hyudoro(hyu)); } -static void hyudoro_set_held_item_from_player +static mobj_t * +spawn_capsule (mobj_t *hyu) +{ + mobj_t *caps = P_SpawnMobjFromMobj( + hyu, 0, 0, 0, MT_ITEMCAPSULE); + + /* hyudoro only needs its own shadow */ + caps->shadowscale = 0; + + caps->flags |= + MF_NOGRAVITY | + MF_NOCLIP | + MF_NOCLIPTHING | + MF_NOCLIPHEIGHT; + + /* signal that this item capsule always puts items in the HUD */ + caps->flags2 |= MF2_STRONGBOX; + + P_SetTarget(&hyudoro_capsule(hyu), caps); + + /* capsule teleports to hyudoro */ + P_SetTarget(&caps->target, hyu); + + /* so it looks like hyudoro is holding it */ + caps->sprzoff = 20 * hyu->scale; + + return caps; +} + +static void +update_capsule_position (mobj_t *hyu) +{ + mobj_t *caps = hyudoro_capsule(hyu); + + if (P_MobjWasRemoved(caps)) + return; + + caps->extravalue1 = hyu->scale / 3; + + /* hold it in the hyudoro's hands */ + const fixed_t r = hyu->radius; + caps->sprxoff = FixedMul(r, FCOS(hyu->angle)); + caps->spryoff = FixedMul(r, FSIN(hyu->angle)); +} + +static void +set_item ( mobj_t * hyu, - player_t *player) + INT32 item, + INT32 amount) +{ + mobj_t *caps = P_MobjWasRemoved(hyudoro_capsule(hyu)) + ? spawn_capsule(hyu) : hyudoro_capsule(hyu); + + hyudoro_itemtype(hyu) = item; + hyudoro_itemcount(hyu) = amount; + + caps->threshold = hyudoro_itemtype(hyu); + caps->movecount = hyudoro_itemcount(hyu); +} + +static void +hyudoro_set_held_item_from_player +( mobj_t * hyu, + player_t * player) { if (K_ItemEnabled(KITEM_KITCHENSINK)) { @@ -459,15 +528,13 @@ static void hyudoro_set_held_item_from_player itemCooldowns[player->itemtype - 1] = 0; } - hyudoro_itemtype(hyu) = KITEM_KITCHENSINK; - hyudoro_itemcount(hyu) = 1; + set_item(hyu, KITEM_KITCHENSINK, 1); return; } } - hyudoro_itemtype(hyu) = player->itemtype; - hyudoro_itemcount(hyu) = player->itemamount; + set_item(hyu, player->itemtype, player->itemamount); } static boolean @@ -503,6 +570,11 @@ hyudoro_patrol_hit_player hyudoro_set_held_item_from_player(hyu, player); + if (!P_MobjWasRemoved(hyudoro_capsule(hyu))) + { + hyudoro_capsule(hyu)->extravalue2 = player->skincolor; + } + K_StripItems(player); player->hyudorotimer = hyudorotime; @@ -544,16 +616,13 @@ award_immediately (mobj_t *hyu) return false; } - if (player->itemamount && - player->itemtype != hyudoro_itemtype(hyu)) - { + if (!P_CanPickupItem(player, 1)) return false; - } - // Same as picking up paper items; get stacks - // immediately - if (!P_CanPickupItem(player, 3)) - return false; + // Prevent receiving any more items or even stacked + // Hyudoros! Put on a timer so roulette cannot become + // locked permanently. + player->itemRoulette.reserved = 2*TICRATE; } deliver_item(hyu); @@ -770,8 +839,18 @@ Obj_HyudoroThink (mobj_t *hyu) } blend_hover_hyudoro(hyu); break; + + case HYU_ORBIT: + if (!project_hyudoro_orbit(hyu)) + { + P_RemoveMobj(hyu); + return; + } + break; } + update_capsule_position(hyu); + if (hyudoro_timer(hyu) > 0) hyudoro_timer(hyu)--; } diff --git a/src/p_inter.c b/src/p_inter.c index 60c7bbd8d..732a89dc7 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1687,7 +1687,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget INT16 spacing = (target->radius >> 1) / target->scale; // set respawn fuse - if (K_CapsuleTimeAttackRules() == true) // no respawns + if (damagetype == DMG_INSTAKILL || K_CapsuleTimeAttackRules() == true) // no respawns ; else if (target->threshold == KITEM_SUPERRING) target->fuse = 20*TICRATE; @@ -1752,18 +1752,22 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget { player_t *player = source->player; - // special behavior for ring capsules - if (target->threshold == KITEM_SUPERRING) + // MF2_STRONGBOX: always put the item right in the hotbar! + if (!(target->flags2 & MF2_STRONGBOX)) { - K_AwardPlayerRings(player, 5 * target->movecount, true); - break; - } + // special behavior for ring capsules + if (target->threshold == KITEM_SUPERRING) + { + K_AwardPlayerRings(player, 5 * target->movecount, true); + break; + } - // special behavior for SPB capsules - if (target->threshold == KITEM_SPB) - { - K_ThrowKartItem(player, true, MT_SPB, 1, 0, 0); - break; + // special behavior for SPB capsules + if (target->threshold == KITEM_SPB) + { + K_ThrowKartItem(player, true, MT_SPB, 1, 0, 0); + break; + } } if (target->threshold < 1 || target->threshold >= NUMKARTITEMS) // bruh moment prevention diff --git a/src/p_mobj.c b/src/p_mobj.c index 062db5dce..3a6176d7b 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4443,7 +4443,9 @@ static void P_RefreshItemCapsuleParts(mobj_t *mobj) } // update cap colors - if (itemType == KITEM_SUPERRING) + if (mobj->extravalue2) + color = mobj->extravalue2; + else if (itemType == KITEM_SUPERRING) { color = SKINCOLOR_GOLD; newRenderFlags |= RF_SEMIBRIGHT; @@ -4487,7 +4489,10 @@ static void P_RefreshItemCapsuleParts(mobj_t *mobj) count = mobj->movecount; break; case KITEM_SUPERRING: // always display the number, and multiply it by 5 - count = mobj->movecount * 5; + if (mobj->flags2 & MF2_STRONGBOX) + count = mobj->movecount * 20; // give Super Rings + else + count = mobj->movecount * 5; break; case KITEM_SAD: // never display the number case KITEM_SPB: From 25837afc8c2bdb3e4dae3d9c1d5265377f3b34f5 Mon Sep 17 00:00:00 2001 From: "James R." Date: Sun, 17 Sep 2023 21:40:53 -0700 Subject: [PATCH 13/18] Hyudoro: use B frame when holding item --- src/deh_tables.c | 1 + src/info.c | 1 + src/info.h | 1 + src/objects/hyudoro.c | 2 ++ 4 files changed, 5 insertions(+) diff --git a/src/deh_tables.c b/src/deh_tables.c index 53bf91a7f..fc33e62ef 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -3792,6 +3792,7 @@ const char *const STATE_LIST[] = { // array length left dynamic for sanity testi // Caked-Up Booty-Sheet Ghost "S_HYUDORO", + "S_HYUDORO_RETURNING", // Grow "S_GROW_PARTICLE", diff --git a/src/info.c b/src/info.c index 4aaff79e1..3ee283696 100644 --- a/src/info.c +++ b/src/info.c @@ -4508,6 +4508,7 @@ state_t states[NUMSTATES] = {SPR_GTAR, FF_FULLBRIGHT|FF_PAPERSPRITE, -1, {NULL}, 5, 2, S_NULL}, // S_GARDENTOPARROW {SPR_HYUU, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_HYUDORO + {SPR_HYUU, FF_FULLBRIGHT|1, -1, {NULL}, 0, 0, S_NULL}, // S_HYUDORO_RETURNING {SPR_GRWP, FF_FULLBRIGHT|FF_ANIMATE, 13, {NULL}, 7, 1, S_NULL}, // S_GROW_PARTICLE diff --git a/src/info.h b/src/info.h index ef47c05bc..dc5257a08 100644 --- a/src/info.h +++ b/src/info.h @@ -4950,6 +4950,7 @@ typedef enum state // Caked-Up Booty-Sheet Ghost S_HYUDORO, + S_HYUDORO_RETURNING, // Grow S_GROW_PARTICLE, diff --git a/src/objects/hyudoro.c b/src/objects/hyudoro.c index 516051c04..51b87627e 100644 --- a/src/objects/hyudoro.c +++ b/src/objects/hyudoro.c @@ -601,6 +601,8 @@ hyudoro_patrol_hit_player // This will flicker the shadow hyudoro_timer(hyu) = 18; + P_SetMobjState(hyu, S_HYUDORO_RETURNING); + return true; } From 5c1332f9778953280001f791bec562d29be691b7 Mon Sep 17 00:00:00 2001 From: "James R." Date: Sun, 17 Sep 2023 21:44:42 -0700 Subject: [PATCH 14/18] Add R_CustomShadowZ, Obj_FakeShadowZ, Obj_HyudoroShadowZ; let Hyudoro shadow float while patrolling --- src/k_objects.h | 2 ++ src/objects/hyudoro.c | 18 ++++++++++++++++ src/objects/shadow.cpp | 49 ++++++++++++++++++++++++++++++++++++++++++ src/r_spritefx.cpp | 19 ++++++++++++++++ src/r_things.c | 8 +++++++ src/r_things.h | 1 + 6 files changed, 97 insertions(+) diff --git a/src/k_objects.h b/src/k_objects.h index fe3e17783..c5e7dba5b 100644 --- a/src/k_objects.h +++ b/src/k_objects.h @@ -17,6 +17,7 @@ void Obj_HyudoroDeploy(mobj_t *master); void Obj_HyudoroThink(mobj_t *actor); void Obj_HyudoroCenterThink(mobj_t *actor); void Obj_HyudoroCollide(mobj_t *special, mobj_t *toucher); +boolean Obj_HyudoroShadowZ(mobj_t *actor, fixed_t *return_z, pslope_t **return_slope); /* Garden Top */ void Obj_GardenTopDeploy(mobj_t *rider); @@ -218,6 +219,7 @@ void Obj_SetEmeraldAwardee(mobj_t *emerald, mobj_t *awardee); /* Fake Shadow */ mobj_t *Obj_SpawnFakeShadow(mobj_t *from); void Obj_FakeShadowThink(mobj_t *shadow); +boolean Obj_FakeShadowZ(const mobj_t *shadow, fixed_t *return_z, pslope_t **return_slope); /* Checkpoints */ void Obj_ResetCheckpoints(void); diff --git a/src/objects/hyudoro.c b/src/objects/hyudoro.c index 51b87627e..552b77bfa 100644 --- a/src/objects/hyudoro.c +++ b/src/objects/hyudoro.c @@ -882,3 +882,21 @@ Obj_HyudoroCollide break; } } + +boolean +Obj_HyudoroShadowZ +( mobj_t * hyu, + fixed_t * return_z, + pslope_t ** return_slope) +{ + if (hyudoro_mode(hyu) != HYU_PATROL) + return false; + + if (P_MobjWasRemoved(hyudoro_center(hyu))) + return false; + + *return_z = hyu->z; + *return_slope = hyudoro_center(hyu)->standingslope; + + return true; +} diff --git a/src/objects/shadow.cpp b/src/objects/shadow.cpp index 9aa88213c..58c670ca0 100644 --- a/src/objects/shadow.cpp +++ b/src/objects/shadow.cpp @@ -1,3 +1,6 @@ +#include +#include + #include "../info.h" #include "../k_objects.h" #include "../p_local.h" @@ -19,6 +22,28 @@ struct Shadow : mobj_t bool valid() const { return !P_MobjWasRemoved(this) && !P_MobjWasRemoved(follow()); } + std::optional> z_position() const + { + switch (follow()->type) + { + case MT_HYUDORO: { + fixed_t z; + pslope_t* slope; + + if (Obj_HyudoroShadowZ(follow(), &z, &slope)) + { + return {{z, slope}}; + } + break; + } + + default: + break; + } + + return {}; + } + void destroy() { P_RemoveMobj(this); } void move() @@ -58,3 +83,27 @@ void Obj_FakeShadowThink(mobj_t* shadow) x->move(); } + +boolean Obj_FakeShadowZ(const mobj_t* shadow, fixed_t* return_z, pslope_t** return_slope) +{ + auto x = static_cast(shadow); + + if (!x->valid()) + { + return false; + } + + auto pair = x->z_position(); + + if (!pair) + { + return false; + } + + auto [z, slope] = *pair; + + *return_z = z; + *return_slope = slope; + + return true; +} diff --git a/src/r_spritefx.cpp b/src/r_spritefx.cpp index 756e0a96e..ff0713bc8 100644 --- a/src/r_spritefx.cpp +++ b/src/r_spritefx.cpp @@ -10,6 +10,7 @@ #include "d_player.h" #include "info.h" +#include "k_objects.h" #include "p_tick.h" #include "r_splats.h" #include "r_things.h" @@ -59,3 +60,21 @@ boolean R_SplatSlope(mobj_t* mobj, vector3_t position, pslope_t* slope) return false; } + +boolean R_CustomShadowZ(mobj_t* thing, fixed_t *z, pslope_t** slope) +{ + switch (thing->type) + { + case MT_SHADOW: + if (Obj_FakeShadowZ(thing, z, slope)) + { + return true; + } + break; + + default: + break; + } + + return false; +} diff --git a/src/r_things.c b/src/r_things.c index 967006041..d94ed27af 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1315,6 +1315,14 @@ fixed_t R_GetShadowZ( sector_t *sector; ffloor_t *rover; + if (R_CustomShadowZ(thing, &groundz, &groundslope)) + { + if (shadowslope != NULL) + *shadowslope = groundslope; + + return groundz; + } + // for frame interpolation interpmobjstate_t interp = {0}; diff --git a/src/r_things.h b/src/r_things.h index 642f788d9..8f74f5135 100644 --- a/src/r_things.h +++ b/src/r_things.h @@ -95,6 +95,7 @@ boolean R_ThingIsFlashing(mobj_t *thing); INT32 R_ThingLightLevel(mobj_t *thing); boolean R_SplatSlope(mobj_t *thing, vector3_t position, pslope_t *slope); +boolean R_CustomShadowZ(mobj_t *thing, fixed_t *return_z, pslope_t **return_slope); // -------------- // MASKED DRAWING From 6878c7dd909e09b5c4a43432b3a879a0caf18bb7 Mon Sep 17 00:00:00 2001 From: "James R." Date: Sun, 17 Sep 2023 20:07:11 -0700 Subject: [PATCH 15/18] Apply PF_CASTSHADOW when player touches patrolling Hyudoro's shadow, darken player to pure black --- src/d_player.h | 3 ++- src/deh_tables.c | 2 +- src/k_kart.c | 2 ++ src/objects/hyudoro.c | 2 ++ src/r_spritefx.cpp | 5 +++++ 5 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index ff4b6f40e..03efa55ec 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -78,7 +78,8 @@ typedef enum PF_KICKSTARTACCEL = 1<<4, // Accessibility feature: Is accelerate in kickstart mode? PF_POINTME = 1<<5, // An object is calling for my attention (via Obj_PointPlayersToMobj). Unset every frame! - // 1<<6 free + + PF_CASTSHADOW = 1<<6, // Something is casting a shadow on the player PF_WANTSTOJOIN = 1<<7, // Spectator that wants to join diff --git a/src/deh_tables.c b/src/deh_tables.c index fc33e62ef..b36fa412c 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -5936,7 +5936,7 @@ const char *const PLAYERFLAG_LIST[] = { "KICKSTARTACCEL", // Accessibility feature: Is accelerate in kickstart mode? "POINTME", // An object is calling for my attention (via Obj_PointPlayersToMobj). Unset every frame! - "\x01", // free: 1<<6 (name un-matchable) + "CASTSHADOW", // Something is casting a shadow on the player "WANTSTOJOIN", // Spectator that wants to join diff --git a/src/k_kart.c b/src/k_kart.c index 11c97fd5a..fed523fc4 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7738,6 +7738,8 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) player->cameraOffset = 0; + player->pflags &= ~(PF_CASTSHADOW); + if (player->curshield == KSHIELD_TOP) { mobj_t *top = K_GetGardenTop(player); diff --git a/src/objects/hyudoro.c b/src/objects/hyudoro.c index 552b77bfa..fba0492e3 100644 --- a/src/objects/hyudoro.c +++ b/src/objects/hyudoro.c @@ -560,6 +560,8 @@ hyudoro_patrol_hit_player if (player->hyudorotimer) return false; + player->pflags |= PF_CASTSHADOW; + // NO ITEM? if (!player->itemamount) return false; diff --git a/src/r_spritefx.cpp b/src/r_spritefx.cpp index ff0713bc8..0664819ff 100644 --- a/src/r_spritefx.cpp +++ b/src/r_spritefx.cpp @@ -28,6 +28,11 @@ INT32 R_ThingLightLevel(mobj_t* thing) // Darken on every other frame of instawhip cooldown lightlevel -= 128; } + + if (player->pflags & PF_CASTSHADOW) + { + lightlevel -= 255; + } } return lightlevel; From 2fd5ae3cb35e9aaf56a35c58297378c0af6f9d45 Mon Sep 17 00:00:00 2001 From: "James R." Date: Sun, 17 Sep 2023 20:08:24 -0700 Subject: [PATCH 16/18] Player hyudorotimer: use modulate blendmode instead of flickering - Player invisibility is preserved for other players - Flicker blendmode (and visibility, for other players) at beginning and end of hyudorotimer --- src/k_kart.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index fed523fc4..00ef4bd21 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -11667,23 +11667,19 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if (player->hyudorotimer > 0) { - if (leveltime & 1) + player->mo->renderflags |= RF_DONTDRAW | RF_MODULATE; + player->mo->renderflags &= ~K_GetPlayerDontDrawFlag(player); + + if (!(leveltime & 1) && (player->hyudorotimer < (TICRATE/2) || player->hyudorotimer > hyudorotime-(TICRATE/2))) { - player->mo->renderflags |= RF_DONTDRAW; - } - else - { - if (player->hyudorotimer >= (TICRATE/2) && player->hyudorotimer <= hyudorotime-(TICRATE/2)) - player->mo->renderflags &= ~K_GetPlayerDontDrawFlag(player); - else - player->mo->renderflags &= ~RF_DONTDRAW; + player->mo->renderflags &= ~(RF_DONTDRAW | RF_BLENDMASK); } player->flashing = player->hyudorotimer; // We'll do this for now, let's people know about the invisible people through subtle hints } else if (player->hyudorotimer == 0) { - player->mo->renderflags &= ~RF_DONTDRAW; + player->mo->renderflags &= ~RF_BLENDMASK; } if (player->trickpanel == 1) From 4347af506929c1e8693e8edd2edad75a77ce97b4 Mon Sep 17 00:00:00 2001 From: "James R." Date: Sun, 17 Sep 2023 19:54:35 -0700 Subject: [PATCH 17/18] Hyudoro: increase hitbox size --- src/info.c | 4 ++-- src/objects/hyudoro.c | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/info.c b/src/info.c index 3ee283696..b1f696e79 100644 --- a/src/info.c +++ b/src/info.c @@ -24668,8 +24668,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // xdeathstate sfx_None, // deathsound 0, // speed - 32*FRACUNIT, // radius - 24*FRACUNIT, // height + 40*FRACUNIT, // radius + 80*FRACUNIT, // height 0, // display offset 0, // mass 0, // damage diff --git a/src/objects/hyudoro.c b/src/objects/hyudoro.c index fba0492e3..45d6d771e 100644 --- a/src/objects/hyudoro.c +++ b/src/objects/hyudoro.c @@ -57,6 +57,8 @@ K_GetSpeed (mobj_t *mobj) #define hyudoro_center_max_radius(o) ((o)->threshold) #define hyudoro_center_master(o) ((o)->target) +#define HYU_VISUAL_HEIGHT (24) + static angle_t trace_angle (mobj_t *hyu) { @@ -108,7 +110,7 @@ sine_bob angle_t a, fixed_t sineofs) { - hyu->sprzoff = FixedMul(hyu->height, + hyu->sprzoff = FixedMul(HYU_VISUAL_HEIGHT * hyu->scale, sineofs + FINESINE(a >> ANGLETOFINESHIFT)); } @@ -166,7 +168,7 @@ rise_thru_stack (mobj_t *hyu) mobj_t *target = hyudoro_target(hyu); fixed_t spacer = ((target->height / 2) + - (hyu->height * 2)); + (HYU_VISUAL_HEIGHT * hyu->scale * 2)); fixed_t sink = hyudoro_stackpos(hyu) * spacer; @@ -300,7 +302,7 @@ do_confused (mobj_t *hyu) // Bob very fast bob_in_place(hyu, 32); - hyu->sprzoff += hyu->height; + hyu->sprzoff += HYU_VISUAL_HEIGHT * hyu->scale; } static void From 08056a9ae206340eba0aca81e291f7f4c2f7efec Mon Sep 17 00:00:00 2001 From: "James R." Date: Sun, 17 Sep 2023 21:59:35 -0700 Subject: [PATCH 18/18] hyudoro_patrol_hit_player: do not make 1st place invisible --- src/objects/hyudoro.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/objects/hyudoro.c b/src/objects/hyudoro.c index 45d6d771e..f0573b27a 100644 --- a/src/objects/hyudoro.c +++ b/src/objects/hyudoro.c @@ -581,7 +581,12 @@ hyudoro_patrol_hit_player K_StripItems(player); - player->hyudorotimer = hyudorotime; + /* do not make 1st place invisible */ + if (player->position != 1) + { + player->hyudorotimer = hyudorotime; + } + player->stealingtimer = hyudorotime; P_SetTarget(&hyudoro_stolefrom(hyu), toucher);