From b6a8df557ea5290b11d65cc0bd11d11ce58fa53d Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Wed, 27 May 2015 00:45:34 -0400 Subject: [PATCH 001/808] New Match weapon/ammo dropping method. P_PlayerWeaponPanelOrAmmoBurst will go through all of the player's weapon rings and either drop the weapon panel itself (with no ammo attached, and no ammo taken away!) OR if the player has ammo but no weapon, it drops the ammo instead (and you lose it). --- src/lua_baselib.c | 11 +++++++ src/p_inter.c | 77 +++++++++++++++++++++++++++++++++++++++++++---- src/p_local.h | 1 + 3 files changed, 83 insertions(+), 6 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 9b0a34f17..57bee95ed 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1100,6 +1100,16 @@ static int lib_pPlayerWeaponAmmoBurst(lua_State *L) return 0; } +static int lib_pPlayerWeaponPanelOrAmmoBurst(lua_State *L) +{ + player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + NOHUD + if (!player) + return LUA_ErrInvalid(L, "player_t"); + P_PlayerWeaponPanelOrAmmoBurst(player); + return 0; +} + static int lib_pPlayerEmeraldBurst(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); @@ -1965,6 +1975,7 @@ static luaL_Reg lib[] = { {"P_PlayerRingBurst",lib_pPlayerRingBurst}, {"P_PlayerWeaponPanelBurst",lib_pPlayerWeaponPanelBurst}, {"P_PlayerWeaponAmmoBurst",lib_pPlayerWeaponAmmoBurst}, + {"P_PlayerWeaponPanelOrAmmoBurst", lib_pPlayerWeaponPanelOrAmmoBurst}, {"P_PlayerEmeraldBurst",lib_pPlayerEmeraldBurst}, {"P_PlayerFlagBurst",lib_pPlayerFlagBurst}, {"P_PlayRinglossSound",lib_pPlayRinglossSound}, diff --git a/src/p_inter.c b/src/p_inter.c index d305cfc83..97a8624c1 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -437,7 +437,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) { INT32 pindex = special->info->mass - (INT32)pw_infinityring; - player->powers[special->info->mass] += (UINT16)special->info->reactiontime; + player->powers[special->info->mass] += (UINT16)special->reactiontime; player->ringweapons |= 1 << (pindex-1); if (player->powers[special->info->mass] > rw_maximums[pindex]) @@ -3093,11 +3093,7 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings) P_PlayerEmeraldBurst(player, false); // Spill weapons first - if (player->ringweapons) - P_PlayerWeaponPanelBurst(player); - - // Spill the ammo - P_PlayerWeaponAmmoBurst(player); + P_PlayerWeaponPanelOrAmmoBurst(player); for (i = 0; i < num_rings; i++) { @@ -3354,6 +3350,75 @@ void P_PlayerWeaponAmmoBurst(player_t *player) } } +void P_PlayerWeaponPanelOrAmmoBurst(player_t *player) +{ + mobj_t *mo; + angle_t fa; + fixed_t ns; + INT32 i = 0; + fixed_t z; + + #define SETUP_DROP(thingtype) \ + z = player->mo->z; \ + if (player->mo->eflags & MFE_VERTICALFLIP) \ + z += player->mo->height - mobjinfo[thingtype].height; \ + fa = ((i*FINEANGLES/16) + (player->mo->angle>>ANGLETOFINESHIFT)) & FINEMASK; \ + ns = FixedMul(3*FRACUNIT, player->mo->scale); \ + + #define DROP_WEAPON(rwflag, pickup, ammo, power) \ + if (player->ringweapons & rwflag) \ + { \ + player->ringweapons &= ~rwflag; \ + SETUP_DROP(pickup) \ + mo = P_SpawnMobj(player->mo->x, player->mo->y, z, pickup); \ + mo->reactiontime = 0; \ + mo->flags2 |= MF2_DONTRESPAWN; \ + mo->flags &= ~(MF_NOGRAVITY|MF_NOCLIPHEIGHT); \ + P_SetTarget(&mo->target, player->mo); \ + mo->fuse = 12*TICRATE; \ + mo->destscale = player->mo->scale; \ + P_SetScale(mo, player->mo->scale); \ + mo->momx = FixedMul(FINECOSINE(fa),ns); \ + if (!(twodlevel || (player->mo->flags2 & MF2_TWOD))) \ + mo->momy = FixedMul(FINESINE(fa),ns); \ + P_SetObjectMomZ(mo, 4*FRACUNIT, false); \ + if (i & 1) \ + P_SetObjectMomZ(mo, 4*FRACUNIT, true); \ + ++i; \ + } \ + else if (player->powers[power] > 0) \ + { \ + SETUP_DROP(ammo) \ + mo = P_SpawnMobj(player->mo->x, player->mo->y, z, ammo); \ + mo->health = player->powers[power]; \ + mo->flags2 |= MF2_DONTRESPAWN; \ + mo->flags &= ~(MF_NOGRAVITY|MF_NOCLIPHEIGHT); \ + P_SetTarget(&mo->target, player->mo); \ + mo->fuse = 12*TICRATE; \ + mo->destscale = player->mo->scale; \ + P_SetScale(mo, player->mo->scale); \ + mo->momx = FixedMul(FINECOSINE(fa),ns); \ + if (!(twodlevel || (player->mo->flags2 & MF2_TWOD))) \ + mo->momy = FixedMul(FINESINE(fa),ns); \ + P_SetObjectMomZ(mo, 3*FRACUNIT, false); \ + if (i & 1) \ + P_SetObjectMomZ(mo, 3*FRACUNIT, true); \ + player->powers[power] = 0; \ + ++i; \ + } + + DROP_WEAPON(RW_BOUNCE, MT_BOUNCEPICKUP, MT_BOUNCERING, pw_bouncering); + DROP_WEAPON(RW_RAIL, MT_RAILPICKUP, MT_RAILRING, pw_railring); + DROP_WEAPON(RW_AUTO, MT_AUTOPICKUP, MT_AUTOMATICRING, pw_automaticring); + DROP_WEAPON(RW_EXPLODE, MT_EXPLODEPICKUP, MT_EXPLOSIONRING, pw_explosionring); + DROP_WEAPON(RW_SCATTER, MT_SCATTERPICKUP, MT_SCATTERRING, pw_scatterring); + DROP_WEAPON(RW_GRENADE, MT_GRENADEPICKUP, MT_GRENADERING, pw_grenadering); + DROP_WEAPON(0, 0, MT_INFINITYRING, pw_infinityring); + + #undef DROP_WEAPON + #undef SETUP_DROP +} + // // P_PlayerEmeraldBurst // diff --git a/src/p_local.h b/src/p_local.h index 1e0a9e2eb..337cc3663 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -371,6 +371,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget void P_PlayerRingBurst(player_t *player, INT32 num_rings); /// \todo better fit in p_user.c void P_PlayerWeaponPanelBurst(player_t *player); void P_PlayerWeaponAmmoBurst(player_t *player); +void P_PlayerWeaponPanelOrAmmoBurst(player_t *player); void P_PlayerEmeraldBurst(player_t *player, boolean toss); void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck); From 67fcff7ee7260e75cb6be8e708fc9ce44fe0bee3 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Wed, 27 May 2015 01:13:26 -0400 Subject: [PATCH 002/808] New Match ammo consumption rules. Weapon rings can now be fired with no rings at double the ammo cost. --- src/p_user.c | 61 +++++++++++++++++--------------------------------- src/st_stuff.c | 2 +- 2 files changed, 22 insertions(+), 41 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 32dc8733f..1f13e6c38 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3130,72 +3130,64 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) mobj_t *mo = NULL; player->pflags |= PF_ATTACKDOWN; + #define TAKE_AMMO(player, power) \ + player->powers[power]--; \ + if (player->health <= 1) \ + { \ + if (player->powers[power] > 0) \ + player->powers[power]--; \ + } \ + else \ + { \ + player->health--; \ + player->mo->health--; \ + } + if (cmd->buttons & BT_FIRENORMAL) // No powers, just a regular ring. goto firenormal; //code repetition sucks. // Bounce ring else if (player->currentweapon == WEP_BOUNCE && player->powers[pw_bouncering]) { - if (player->health <= 1) - return; + TAKE_AMMO(player, pw_bouncering); P_SetWeaponDelay(player, TICRATE/4); mo = P_SpawnPlayerMissile(player->mo, MT_THROWNBOUNCE, MF2_BOUNCERING); if (mo) mo->fuse = 3*TICRATE; // Bounce Ring time - - player->powers[pw_bouncering]--; - player->mo->health--; - player->health--; } // Rail ring else if (player->currentweapon == WEP_RAIL && player->powers[pw_railring]) { - if (player->health <= 1) - return; + TAKE_AMMO(player, pw_railring); P_SetWeaponDelay(player, (3*TICRATE)/2); mo = P_SpawnPlayerMissile(player->mo, MT_REDRING, MF2_RAILRING|MF2_DONTDRAW); // Rail has no unique thrown object, therefore its sound plays here. S_StartSound(player->mo, sfx_rail1); - - player->powers[pw_railring]--; - player->mo->health--; - player->health--; } // Automatic else if (player->currentweapon == WEP_AUTO && player->powers[pw_automaticring]) { - if (player->health <= 1) - return; + TAKE_AMMO(player, pw_automaticring); player->pflags &= ~PF_ATTACKDOWN; P_SetWeaponDelay(player, 2); mo = P_SpawnPlayerMissile(player->mo, MT_THROWNAUTOMATIC, MF2_AUTOMATIC); - - player->powers[pw_automaticring]--; - player->mo->health--; - player->health--; } // Explosion else if (player->currentweapon == WEP_EXPLODE && player->powers[pw_explosionring]) { - if (player->health <= 1) - return; + TAKE_AMMO(player, pw_explosionring); P_SetWeaponDelay(player, (3*TICRATE)/2); mo = P_SpawnPlayerMissile(player->mo, MT_THROWNEXPLOSION, MF2_EXPLOSION); - - player->powers[pw_explosionring]--; - player->mo->health--; - player->health--; } // Grenade else if (player->currentweapon == WEP_GRENADE && player->powers[pw_grenadering]) { - if (player->health <= 1) - return; + TAKE_AMMO(player, pw_grenadering); P_SetWeaponDelay(player, TICRATE/3); mo = P_SpawnPlayerMissile(player->mo, MT_THROWNGRENADE, MF2_EXPLOSION); @@ -3205,10 +3197,6 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) //P_InstaThrust(mo, player->mo->angle, FixedMul(mo->info->speed, player->mo->scale)); mo->fuse = mo->info->mass; } - - player->powers[pw_grenadering]--; - player->mo->health--; - player->health--; } // Scatter // Note: Ignores MF2_RAILRING @@ -3218,8 +3206,7 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) angle_t shotangle = player->mo->angle; angle_t oldaiming = player->aiming; - if (player->health <= 1) - return; + TAKE_AMMO(player, pw_scatterring); P_SetWeaponDelay(player, (2*TICRATE)/3); // Center @@ -3245,10 +3232,6 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) player->mo->z = oldz; player->aiming = oldaiming; - - player->powers[pw_scatterring]--; - player->mo->health--; - player->health--; return; } // No powers, just a regular ring. @@ -3286,6 +3269,8 @@ firenormal: } } + #undef TAKE_AMMO + if (mo) { if (mo->flags & MF_MISSILE && mo->flags2 & MF2_RAILRING) @@ -9223,10 +9208,6 @@ void P_PlayerAfterThink(player_t *player) if (player->currentweapon == WEP_RAIL && (!(player->ringweapons & RW_RAIL) || !player->powers[pw_railring])) player->currentweapon = 0; - // If you're out of rings, but have Infinity Rings left, switch to that. - if (player->currentweapon != 0 && player->health <= 1 && player->powers[pw_infinityring]) - player->currentweapon = 0; - if (P_IsLocalPlayer(player) && (player->pflags & PF_WPNDOWN) && player->currentweapon != oldweapon) S_StartSound(NULL, sfx_wepchg); diff --git a/src/st_stuff.c b/src/st_stuff.c index 6e19b92ff..940d0f6fa 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1349,7 +1349,7 @@ static void ST_drawWeaponRing(powertype_t weapon, INT32 rwflag, INT32 wepflag, I txtflags |= V_YELLOWMAP; if (weapon == pw_infinityring - || (stplyr->ringweapons & rwflag && stplyr->health > 1)) + || (stplyr->ringweapons & rwflag)) txtflags |= V_20TRANS; else { From c6c4ab7c53bbe3a70bbdd3f033dac83f7a4e9c7f Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Wed, 27 May 2015 02:08:18 -0400 Subject: [PATCH 003/808] New emerald behavior in Match. No longer turns you super, instead emeralds steal points from enemy players and give you (and relevant teammates) an invincibility + super sneakers monitor. --- src/lua_baselib.c | 23 ++++++++ src/p_inter.c | 132 +++++++++++++++++++++++++++------------------- src/p_local.h | 1 + src/p_user.c | 80 ++++++++++++++++------------ 4 files changed, 147 insertions(+), 89 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 57bee95ed..411dc00cf 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -561,6 +561,17 @@ static int lib_pAddPlayerScore(lua_State *L) return 0; } +static int lib_pStealPlayerScore(lua_State *L) +{ + player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + UINT32 amount = (UINT32)luaL_checkinteger(L, 2); + NOHUD + if (!player) + return LUA_ErrInvalid(L, "player_t"); + P_StealPlayerScore(player, amount); + return 0; +} + static int lib_pPlayerInPain(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); @@ -1217,6 +1228,16 @@ static int lib_pDoNightsScore(lua_State *L) return 0; } +static int lib_pDoMatchSuper(lua_State *L) +{ + player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + NOHUD + if (!player) + return LUA_ErrInvalid(L, "player_t"); + P_DoMatchSuper(player); + return 0; +} + // P_SPEC //////////// @@ -1925,6 +1946,7 @@ static luaL_Reg lib[] = { {"P_GetPlayerSpinHeight",lib_pGetPlayerSpinHeight}, {"P_GetPlayerControlDirection",lib_pGetPlayerControlDirection}, {"P_AddPlayerScore",lib_pAddPlayerScore}, + {"P_StealPlayerScore",lib_pStealPlayerScore}, {"P_PlayerInPain",lib_pPlayerInPain}, {"P_DoPlayerPain",lib_pDoPlayerPain}, {"P_ResetPlayer",lib_pResetPlayer}, @@ -1984,6 +2006,7 @@ static luaL_Reg lib[] = { {"P_PlayLivesJingle",lib_pPlayLivesJingle}, {"P_CanPickupItem",lib_pCanPickupItem}, {"P_DoNightsScore",lib_pDoNightsScore}, + {"P_DoMatchSuper",lib_pDoMatchSuper}, // p_spec {"P_Thrust",lib_pThrust}, diff --git a/src/p_inter.c b/src/p_inter.c index 97a8624c1..e7f671ad1 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -217,6 +217,72 @@ void P_DoNightsScore(player_t *player) dummymo->destscale = 2*FRACUNIT; } +// +// P_DoMatchSuper +// +// Checks if you have all 7 pw_emeralds, then turns you "super". =P +// +void P_DoMatchSuper(player_t *player) +{ + UINT16 match_emeralds = player->powers[pw_emeralds]; + boolean doteams = false; + int i; + + // If this gametype has teams, check every player on your team for emeralds. + if (G_GametypeHasTeams()) + { + doteams = true; + for (i = 0; i < MAXPLAYERS; i++) + if (players[i].ctfteam == player->ctfteam) + match_emeralds |= players[i].powers[pw_emeralds]; + } + + if (!ALL7EMERALDS(match_emeralds)) + return; + + // Got 'em all? Turn "super"! + player->powers[pw_emeralds] = 0; + player->powers[pw_invulnerability] = invulntics + 1; + player->powers[pw_sneakers] = player->powers[pw_invulnerability]; + if (P_IsLocalPlayer(player) && !player->powers[pw_super]) + { + S_StopMusic(); + if (mariomode) + { + S_ChangeMusic(mus_minvnc, false); + G_GhostAddColor(GHC_INVINCIBLE); + } + else + S_ChangeMusic(mus_invinc, false); + } + + // Also steal 50 points from every enemy, sealing your victory. + P_StealPlayerScore(player, 50); + + // In a team game? + // Check everyone else on your team for emeralds, and turn those helpful assisting players invincible too. + if (doteams) + for (i = 0; i < MAXPLAYERS; i++) + if (playeringame[i] && players[i].ctfteam == player->ctfteam + && players[i].powers[pw_emeralds] != 0) + { + players[i].powers[pw_emeralds] = 0; + player->powers[pw_invulnerability] = invulntics + 1; + player->powers[pw_sneakers] = player->powers[pw_invulnerability]; + if (P_IsLocalPlayer(player) && !player->powers[pw_super]) + { + S_StopMusic(); + if (mariomode) + { + S_ChangeMusic(mus_minvnc, false); + G_GhostAddColor(GHC_INVINCIBLE); + } + else + S_ChangeMusic(mus_invinc, false); + } + } +} + /** Takes action based on a ::MF_SPECIAL thing touched by a player. * Actually, this just checks a few things (heights, toucher->player, no * objectplace, no dead or disappearing things) @@ -524,7 +590,10 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; if (special->threshold) + { player->powers[pw_emeralds] |= special->info->speed; + P_DoMatchSuper(player); + } else emeralds |= special->info->speed; @@ -545,6 +614,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; player->powers[pw_emeralds] |= special->threshold; + P_DoMatchSuper(player); break; // Secret emblem thingy @@ -1356,7 +1426,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) } if (player->powers[pw_invulnerability] || player->powers[pw_flashing] - || (player->powers[pw_super] && !(ALL7EMERALDS(player->powers[pw_emeralds])))) + || player->powers[pw_super]) return; if (player->powers[pw_shield] || player->bot) //If One-Hit Shield { @@ -2434,16 +2504,7 @@ static inline boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *sou P_PlayerRingBurst(player, player->mo->health - 1); } - if (inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player) && player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])) - { - player->health -= 10; - if (player->health < 2) - player->health = 2; - target->health = player->health; - } - else - player->health = target->health = 1; - + player->health = target->health = 1; return true; } @@ -2654,16 +2715,6 @@ static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype) { - if (!(inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player) && player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))) - { - P_DoPlayerPain(player, source, inflictor); - - P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2); - - if ((source && source->type == MT_SPIKE) || damagetype == DMG_SPIKE) // spikes - S_StartSound(player->mo, sfx_spkdth); - } - if (source && source->player && !player->powers[pw_super]) //don't score points against super players { // Award no points when players shoot each other when cv_friendlyfire is on. @@ -2913,7 +2964,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da } } else if (player->powers[pw_invulnerability] || player->powers[pw_flashing] // ignore bouncing & such in invulnerability - || (player->powers[pw_super] && !(ALL7EMERALDS(player->powers[pw_emeralds]) && inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player)))) + || player->powers[pw_super]) { if (force || (inflictor && (inflictor->flags & MF_MISSILE) && (inflictor->flags2 & MF2_SUPERFIRE) @@ -2960,24 +3011,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da } } - if (inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player) && player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])) - { - if (player->powers[pw_shield]) - { - P_RemoveShield(player); - return true; - } - else - { - player->health -= (10 * (1 << (INT32)(player->powers[pw_super] / 10500))); - if (player->health < 2) - player->health = 2; - } - - if (gametype == GT_CTF && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG))) - P_PlayerFlagBurst(player, false); - } - else if (damagetype & DMG_DEATHMASK) + if (damagetype & DMG_DEATHMASK) player->health = 0; else { @@ -3001,13 +3035,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da P_DamageMobj(source, target, target, 1, 0); // do the damage - if (player && player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]) && inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player)) - { - target->health -= (10 * (1 << (INT32)(player->powers[pw_super] / 10500))); - if (target->health < 2) - target->health = 2; - } - else if (damagetype & DMG_DEATHMASK) + if (damagetype & DMG_DEATHMASK) target->health = 0; else target->health -= damage; @@ -3022,10 +3050,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da } if (player) - { - if (!(player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))) - P_ResetPlayer(target->player); - } + P_ResetPlayer(target->player); else switch (target->type) { @@ -3051,10 +3076,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if (target->state == &states[target->info->spawnstate] && target->info->seestate != S_NULL) { if (player) - { - if (!(player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))) - P_SetPlayerMobjState(target, target->info->seestate); - } + P_SetPlayerMobjState(target, target->info->seestate); else P_SetMobjState(target, target->info->seestate); } diff --git a/src/p_local.h b/src/p_local.h index 337cc3663..b23f9fdf8 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -385,6 +385,7 @@ void P_ResetStarposts(void); boolean P_CanPickupItem(player_t *player, boolean weapon); void P_DoNightsScore(player_t *player); +void P_DoMatchSuper(player_t *player); // // P_SPEC diff --git a/src/p_user.c b/src/p_user.c index 1f13e6c38..14c87a503 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -997,6 +997,7 @@ void P_DoSuperTransformation(player_t *player, boolean giverings) P_PlayerFlagBurst(player, false); } + // Adds to the player's score void P_AddPlayerScore(player_t *player, UINT32 amount) { @@ -1083,6 +1084,42 @@ void P_AddPlayerScore(player_t *player, UINT32 amount) } } +// Steals from every enemy's score. +void P_StealPlayerScore(player_t *player, UINT32 amount) +{ + boolean teams = G_GametypeHasTeams(); + UINT32 stolen = 0; + int i; + for (i = 0; i < MAXPLAYERS; i++) + { + if (&players[i] == player + || (teams && players[i].ctfteam == player->ctfteam)) + continue; + if (players[i].score >= amount) + { + stolen += amount; + players[i].score -= amount; + } + else + { + stolen += players[i].score; + players[i].score = 0; + } + } + if (stolen > 0) + { + // In team match, all stolen points are removed from the enemy team's running score. + if (gametype == GT_TEAMMATCH) + { + if (player->ctfteam == 1) + bluescore -= amount; + else if (player->ctfteam == 2) + redscore -= amount; + } + P_AddPlayerScore(player, stolen); + } +} + // // P_PlayLivesJingle // @@ -3321,7 +3358,7 @@ static void P_DoSuperStuff(player_t *player) return; // NiGHTS Super doesn't mix with normal super // Does player have all emeralds? If so, flag the "Ready For Super!" - if ((ALL7EMERALDS(emeralds) || ALL7EMERALDS(player->powers[pw_emeralds])) && player->health > 50) + if (ALL7EMERALDS(emeralds) && player->health > 50) player->pflags |= PF_SUPERREADY; else player->pflags &= ~PF_SUPERREADY; @@ -3329,7 +3366,7 @@ static void P_DoSuperStuff(player_t *player) if (player->powers[pw_super]) { // If you're super and not Sonic, de-superize! - if (!((ALL7EMERALDS(emeralds)) && (player->charflags & SF_SUPER)) && !(ALL7EMERALDS(player->powers[pw_emeralds]))) + if (!(ALL7EMERALDS(emeralds) && player->charflags & SF_SUPER)) { player->powers[pw_super] = 0; P_SetPlayerMobjState(player->mo, S_PLAY_STND); @@ -3462,12 +3499,12 @@ static void P_DoSuperStuff(player_t *player) // boolean P_SuperReady(player_t *player) { - if ((player->pflags & PF_SUPERREADY) && !player->powers[pw_super] && !player->powers[pw_tailsfly] + if (player->pflags & PF_SUPERREADY && !player->powers[pw_super] && !player->powers[pw_tailsfly] && !(player->powers[pw_shield] & SH_NOSTACK) && !player->powers[pw_invulnerability] && !(maptol & TOL_NIGHTS) // don't turn 'regular super' in nights levels && player->pflags & PF_JUMPED - && ((player->charflags & SF_SUPER) || ALL7EMERALDS(player->powers[pw_emeralds]))) + && player->charflags & SF_SUPER) return true; return false; @@ -3995,13 +4032,6 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) player->pflags |= PF_GLIDING|PF_THOKKED; player->glidetime = 0; - if (player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])) - { - // Glide at double speed while super. - glidespeed *= 2; - player->pflags &= ~PF_THOKKED; - } - P_SetPlayerMobjState(player->mo, S_PLAY_GLIDE); P_InstaThrust(player->mo, player->mo->angle, FixedMul(glidespeed, player->mo->scale)); player->pflags &= ~(PF_SPINNING|PF_STARTDASH); @@ -4115,8 +4145,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) player->pflags &= ~PF_JUMPDOWN; // Repeat abilities, but not double jump! - if ((player->charability2 == CA2_MULTIABILITY && player->charability != CA_DOUBLEJUMP) - || (player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))) + if (player->charability2 == CA2_MULTIABILITY && player->charability != CA_DOUBLEJUMP) player->secondjump = 0; else if (player->charability == CA_FLOAT && player->secondjump == 1) player->secondjump = 2; @@ -4360,9 +4389,6 @@ static void P_2dMovement(player_t *player) if (cmd->forwardmove != 0) P_SetObjectMomZ(player->mo, FixedDiv(cmd->forwardmove*FRACUNIT,10*FRACUNIT), false); - if (player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])) - player->mo->momz *= 2; - player->mo->momx = 0; } else if (cmd->sidemove != 0 && !(player->pflags & PF_GLIDING || player->exiting @@ -4556,11 +4582,7 @@ static void P_3dMovement(player_t *player) if (player->climbing) { if (cmd->forwardmove) - { P_SetObjectMomZ(player->mo, FixedDiv(cmd->forwardmove*FRACUNIT, 10*FRACUNIT), false); - if (player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])) - player->mo->momz *= 2; - } } else if (!analogmove && cmd->forwardmove != 0 && !(player->pflags & PF_GLIDING || player->exiting @@ -4601,12 +4623,7 @@ static void P_3dMovement(player_t *player) } // Sideways movement if (player->climbing) - { - if (player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])) - P_InstaThrust(player->mo, player->mo->angle-ANGLE_90, FixedMul(FixedDiv(cmd->sidemove*FRACUNIT, 5*FRACUNIT), player->mo->scale)); - else - P_InstaThrust(player->mo, player->mo->angle-ANGLE_90, FixedMul(FixedDiv(cmd->sidemove*FRACUNIT, 10*FRACUNIT), player->mo->scale)); - } + P_InstaThrust(player->mo, player->mo->angle-ANGLE_90, FixedMul(FixedDiv(cmd->sidemove*FRACUNIT, 10*FRACUNIT), player->mo->scale)); // Analog movement control else if (analogmove) { @@ -6510,8 +6527,8 @@ static void P_MovePlayer(player_t *player) P_ResetPlayer(player); // down, stop gliding. if (onground) P_SetPlayerMobjState(player->mo, S_PLAY_WALK); - else if ((player->charability2 == CA2_MULTIABILITY) - || (player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]) && player->charability == CA_GLIDEANDCLIMB)) + else if (player->charability2 == CA2_MULTIABILITY + && player->charability == CA_GLIDEANDCLIMB) { player->pflags |= PF_JUMPED; P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); @@ -6764,11 +6781,6 @@ static void P_MovePlayer(player_t *player) { if ((player->powers[pw_shield] & SH_NOSTACK) == SH_JUMP && !player->powers[pw_super]) P_DoJumpShield(player); - else if (player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]) && player->charability == CA_FLY) - { - P_DoJumpShield(player); - player->mo->momz *= 2; - } } // Bomb shield activation if ((player->powers[pw_shield] & SH_NOSTACK) == SH_BOMB) @@ -8924,7 +8936,7 @@ void P_PlayerThink(player_t *player) if (player->powers[pw_flashing] && player->powers[pw_flashing] < UINT16_MAX && ((player->pflags & PF_NIGHTSMODE) || player->powers[pw_flashing] < flashingtics)) player->powers[pw_flashing]--; - if (player->powers[pw_tailsfly] && player->powers[pw_tailsfly] < UINT16_MAX && player->charability != CA_SWIM && !(player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))) // tails fly counter + if (player->powers[pw_tailsfly] && player->powers[pw_tailsfly] < UINT16_MAX && player->charability != CA_SWIM) // tails fly counter player->powers[pw_tailsfly]--; if (player->powers[pw_underwater] && (player->pflags & PF_GODMODE || (player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL)) From 1c1acb9f0e9ac543b33604a7173b7c6d78291f19 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Wed, 27 May 2015 04:01:58 -0400 Subject: [PATCH 004/808] Add emeraldspawndelay for Match "super" Emeralds will not spawn while players are still enjoying their victory dance now. --- src/g_game.c | 1 + src/p_inter.c | 5 +++-- src/p_mobj.c | 8 +++----- src/p_mobj.h | 1 + src/p_setup.c | 1 + 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 643ec8c93..7176d90dc 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -86,6 +86,7 @@ UINT8 modeattacking = ATTACKING_NONE; boolean disableSpeedAdjust = false; boolean imcontinuing = false; boolean runemeraldmanager = false; +UINT16 emeraldspawndelay = 60*TICRATE; // menu demo things UINT8 numDemos = 3; diff --git a/src/p_inter.c b/src/p_inter.c index e7f671ad1..d5c82fefc 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -241,9 +241,10 @@ void P_DoMatchSuper(player_t *player) return; // Got 'em all? Turn "super"! + emeraldspawndelay = invulntics + 1; player->powers[pw_emeralds] = 0; - player->powers[pw_invulnerability] = invulntics + 1; - player->powers[pw_sneakers] = player->powers[pw_invulnerability]; + player->powers[pw_invulnerability] = emeraldspawndelay; + player->powers[pw_sneakers] = emeraldspawndelay; if (P_IsLocalPlayer(player) && !player->powers[pw_super]) { S_StopMusic(); diff --git a/src/p_mobj.c b/src/p_mobj.c index 9565648c2..7742d63e1 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -657,14 +657,12 @@ void P_EmeraldManager(void) else break; - if (leveltime < TICRATE) // Start of map - spawnpoints[j]->threshold = 60*TICRATE + P_Random() * (TICRATE/5); - else - spawnpoints[j]->threshold = P_Random() * (TICRATE/5); - + spawnpoints[j]->threshold = emeraldspawndelay + P_Random() * (TICRATE/5); break; } } + + emeraldspawndelay = 0; } // diff --git a/src/p_mobj.h b/src/p_mobj.h index 8e782b92e..5a4e01caf 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -444,5 +444,6 @@ void P_EmeraldManager(void); extern mapthing_t *huntemeralds[MAXHUNTEMERALDS]; extern INT32 numhuntemeralds; extern boolean runemeraldmanager; +extern UINT16 emeraldspawndelay; extern INT32 numstarposts; #endif diff --git a/src/p_setup.c b/src/p_setup.c index f2b0c49d8..196f6a471 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2015,6 +2015,7 @@ static void P_LevelInitStuff(void) // special stage tokens, emeralds, and ring total tokenbits = 0; runemeraldmanager = false; + emeraldspawndelay = 60*TICRATE; nummaprings = 0; // emerald hunt From 4a1f0ce91c658608cd0682a60d9d2385d0cb1c1a Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Wed, 27 May 2015 05:24:31 -0400 Subject: [PATCH 005/808] New attract shield active Homing attack when activating the attract shield while jumping. --- src/dehacked.c | 1 + src/info.c | 3 ++- src/info.h | 1 + src/lua_baselib.c | 3 ++- src/p_local.h | 2 +- src/p_mobj.c | 7 ++++++- src/p_user.c | 41 +++++++++++++++++++++++++++++++++++------ 7 files changed, 48 insertions(+), 10 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 227c48b69..31fb571c1 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5375,6 +5375,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_MAGN10", "S_MAGN11", "S_MAGN12", + "S_MAGN13", "S_FORC1", "S_FORC2", diff --git a/src/info.c b/src/info.c index 775996092..58a652f82 100644 --- a/src/info.c +++ b/src/info.c @@ -1757,6 +1757,7 @@ state_t states[NUMSTATES] = {SPR_MAGN, FF_FULLBRIGHT|FF_TRANS40| 9, 2, {NULL}, 0, 0, S_MAGN11}, // S_MAGN10 {SPR_MAGN, FF_FULLBRIGHT|FF_TRANS40|10, 2, {NULL}, 0, 0, S_MAGN12}, // S_MAGN11 {SPR_MAGN, FF_FULLBRIGHT|FF_TRANS40|11, 2, {NULL}, 0, 0, S_MAGN1 }, // S_MAGN12 + {SPR_MAGN, FF_FULLBRIGHT|FF_TRANS10|12, 2, {NULL}, 0, 0, S_MAGN1 }, // S_MAGN13 {SPR_FORC, FF_TRANS50 , 3, {NULL}, 0, 0, S_FORC2 }, // S_FORC1 {SPR_FORC, FF_TRANS50|1, 3, {NULL}, 0, 0, S_FORC3 }, // S_FORC2 @@ -10365,7 +10366,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // seesound 8, // reactiontime sfx_None, // attacksound - S_NULL, // painstate + S_MAGN13, // painstate SKINCOLOR_NONE, // painchance sfx_None, // painsound S_NULL, // meleestate diff --git a/src/info.h b/src/info.h index 44a3dd012..a6d5dbd3f 100644 --- a/src/info.h +++ b/src/info.h @@ -2262,6 +2262,7 @@ typedef enum state S_MAGN10, S_MAGN11, S_MAGN12, + S_MAGN13, S_FORC1, S_FORC2, diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 9b0a34f17..9c09e726e 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -791,10 +791,11 @@ static int lib_pReturnThrustY(lua_State *L) static int lib_pLookForEnemies(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + boolean nonenemies = lua_opttrueboolean(L, 2); NOHUD if (!player) return LUA_ErrInvalid(L, "player_t"); - lua_pushboolean(L, P_LookForEnemies(player)); + lua_pushboolean(L, P_LookForEnemies(player, nonenemies)); return 1; } diff --git a/src/p_local.h b/src/p_local.h index 1e0a9e2eb..db10cdb1c 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -164,7 +164,7 @@ fixed_t P_ReturnThrustX(mobj_t *mo, angle_t angle, fixed_t move); fixed_t P_ReturnThrustY(mobj_t *mo, angle_t angle, fixed_t move); void P_InstaThrustEvenIn2D(mobj_t *mo, angle_t angle, fixed_t move); -boolean P_LookForEnemies(player_t *player); +boolean P_LookForEnemies(player_t *player, boolean nonenemies); void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius); void P_HomingAttack(mobj_t *source, mobj_t *enemy); /// \todo doesn't belong in p_user boolean P_SuperReady(player_t *player); diff --git a/src/p_mobj.c b/src/p_mobj.c index 9565648c2..b79350092 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -5608,12 +5608,17 @@ void P_MobjThinker(mobj_t *mobj) case MT_BLACKORB: case MT_WHITEORB: case MT_GREENORB: - case MT_YELLOWORB: case MT_BLUEORB: case MT_PITYORB: if (!P_AddShield(mobj)) return; break; + case MT_YELLOWORB: + if (!P_AddShield(mobj)) + return; + if (mobj->target->player->homing) + P_SetMobjState(mobj, mobj->info->painstate); + break; case MT_WATERDROP: P_SceneryCheckWater(mobj); if ((mobj->z <= mobj->floorz || mobj->z <= mobj->watertop) diff --git a/src/p_user.c b/src/p_user.c index 32dc8733f..ad0b7b76a 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3971,7 +3971,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) if (player->charability == CA_HOMINGTHOK && !player->homing) { - if (P_LookForEnemies(player)) + if (P_LookForEnemies(player, true)) { if (player->mo->tracer) player->homing = 3*TICRATE; @@ -6792,6 +6792,17 @@ static void P_MovePlayer(player_t *player) if (!(player->powers[pw_super] || player->powers[pw_invulnerability])) P_BlackOw(player); } + // Attract shield activation + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT) + { + if (!(player->pflags & PF_THOKKED)) + { + player->pflags |= PF_THOKKED; + player->homing = 2; + if (P_LookForEnemies(player, false) && player->mo->tracer) + player->homing = 3*TICRATE; + } + } } // Super Sonic move if (player->charflags & SF_SUPER && player->powers[pw_super] && player->speed > FixedMul(5<mo->scale) @@ -6807,8 +6818,20 @@ static void P_MovePlayer(player_t *player) } } + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT) + { + if (player->homing && player->mo->tracer) + { + if (!(player->pflags & PF_JUMPED) + || player->mo->tracer->health <= 0 + || player->mo->tracer->flags2 & MF2_FRET) + player->homing = 0; + else + P_HomingAttack(player->mo, player->mo->tracer); + } + } // HOMING option. - if (player->charability == CA_HOMINGTHOK) + else if (player->charability == CA_HOMINGTHOK) { // If you've got a target, chase after it! if (player->homing && player->mo->tracer) @@ -7410,9 +7433,9 @@ void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius) // // P_LookForEnemies // Looks for something you can hit - Used for homing attack -// Includes monitors and springs! +// If nonenemies is true, includes monitors and springs! // -boolean P_LookForEnemies(player_t *player) +boolean P_LookForEnemies(player_t *player, boolean nonenemies) { mobj_t *mo; thinker_t *think; @@ -7425,7 +7448,8 @@ boolean P_LookForEnemies(player_t *player) continue; // not a mobj thinker mo = (mobj_t *)think; - if (!(mo->flags & (MF_ENEMY|MF_BOSS|MF_MONITOR|MF_SPRING))) + if ((nonenemies && !(mo->flags & (MF_ENEMY|MF_BOSS|MF_MONITOR|MF_SPRING))) + || (!nonenemies && !(mo->flags & (MF_ENEMY|MF_BOSS)))) continue; // not a valid enemy if (mo->health <= 0) // dead @@ -7524,7 +7548,12 @@ void P_HomingAttack(mobj_t *source, mobj_t *enemy) // Home in on your target ns = FixedMul(source->info->speed, source->scale); } else if (source->player) - ns = FixedDiv(FixedMul(source->player->actionspd, source->scale), 3*FRACUNIT/2); + { + if (source->player->charability == CA_HOMINGTHOK) + ns = FixedDiv(FixedMul(source->player->actionspd, source->scale), 3*FRACUNIT/2); + else //if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT) + ns = FixedMul(80*FRACUNIT, source->scale); + } source->momx = FixedMul(FixedDiv(enemy->x - source->x, dist), ns); source->momy = FixedMul(FixedDiv(enemy->y - source->y, dist), ns); From 65f2d4b80f857d25aab7961968c6fdfa1c8d3cd4 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Wed, 27 May 2015 05:59:42 -0400 Subject: [PATCH 006/808] Add PF_SHIELDABILITY This flag is used as a distinction between the character ability CA_HOMINGTHOK and the attract shield's active ability. --- src/d_player.h | 3 +-- src/p_map.c | 4 ++-- src/p_mobj.c | 2 +- src/p_user.c | 30 ++++++++++-------------------- 4 files changed, 14 insertions(+), 25 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index b9fcdef75..5ef19c9ac 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -152,8 +152,7 @@ typedef enum /*** misc ***/ PF_FORCESTRAFE = 1<<29, // Turning inputs are translated into strafing inputs PF_ANALOGMODE = 1<<30, // Analog mode? - - // free: 1<<30 and 1<<31 + PF_SHIELDABILITY = 1<<31 // Thokked with shield ability } pflags_t; typedef enum diff --git a/src/p_map.c b/src/p_map.c index 46e32e385..ab2b1662c 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -121,7 +121,7 @@ void P_DoSpring(mobj_t *spring, mobj_t *object) /*Someone want to make these work like bumpers?*/ return; } - + object->eflags |= MFE_SPRUNG; // apply this flag asap! spring->flags &= ~(MF_SOLID|MF_SPECIAL); // De-solidify @@ -188,7 +188,7 @@ void P_DoSpring(mobj_t *spring, mobj_t *object) localangle2 = spring->angle; } - pflags = object->player->pflags & (PF_JUMPED|PF_SPINNING|PF_THOKKED); // I still need these. + pflags = object->player->pflags & (PF_JUMPED|PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY); // I still need these. P_ResetPlayer(object->player); if (P_MobjFlip(object)*vertispeed > 0) diff --git a/src/p_mobj.c b/src/p_mobj.c index b79350092..26ff7b92b 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2183,7 +2183,7 @@ static void P_PlayerZMovement(mobj_t *mo) if (!(mo->player->pflags & PF_GLIDING)) mo->player->pflags &= ~PF_JUMPED; - mo->player->pflags &= ~PF_THOKKED; + mo->player->pflags &= ~(PF_THOKKED|PF_SHIELDABILITY); //mo->player->pflags &= ~PF_GLIDING; mo->player->jumping = 0; mo->player->secondjump = 0; diff --git a/src/p_user.c b/src/p_user.c index ad0b7b76a..089c0dc9b 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -661,7 +661,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) player->mo->height = player->mo->tracer->height; } - player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_THOKKED|PF_SPINNING|PF_DRILLING); + player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_THOKKED|PF_SHIELDABILITY|PF_SPINNING|PF_DRILLING); player->homing = 0; player->mo->fuse = 0; player->speed = 0; @@ -874,7 +874,7 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor) // Useful when you want to kill everything the player is doing. void P_ResetPlayer(player_t *player) { - player->pflags &= ~(PF_ROPEHANG|PF_ITEMHANG|PF_MACESPIN|PF_SPINNING|PF_JUMPED|PF_GLIDING|PF_THOKKED|PF_CARRIED); + player->pflags &= ~(PF_ROPEHANG|PF_ITEMHANG|PF_MACESPIN|PF_SPINNING|PF_JUMPED|PF_GLIDING|PF_THOKKED|PF_SHIELDABILITY|PF_CARRIED); player->jumping = 0; player->secondjump = 0; player->glidetime = 0; @@ -6797,7 +6797,7 @@ static void P_MovePlayer(player_t *player) { if (!(player->pflags & PF_THOKKED)) { - player->pflags |= PF_THOKKED; + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; player->homing = 2; if (P_LookForEnemies(player, false) && player->mo->tracer) player->homing = 3*TICRATE; @@ -6818,25 +6818,15 @@ static void P_MovePlayer(player_t *player) } } - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT) - { - if (player->homing && player->mo->tracer) - { - if (!(player->pflags & PF_JUMPED) - || player->mo->tracer->health <= 0 - || player->mo->tracer->flags2 & MF2_FRET) - player->homing = 0; - else - P_HomingAttack(player->mo, player->mo->tracer); - } - } // HOMING option. - else if (player->charability == CA_HOMINGTHOK) + if (player->charability == CA_HOMINGTHOK + || (player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT) { // If you've got a target, chase after it! if (player->homing && player->mo->tracer) { - P_SpawnThokMobj(player); + if (!(player->pflags & PF_SHIELDABILITY)) + P_SpawnThokMobj(player); P_HomingAttack(player->mo, player->mo->tracer); // But if you don't, then stop homing. @@ -6852,7 +6842,7 @@ static void P_MovePlayer(player_t *player) if (player->mo->tracer->flags2 & MF2_FRET) P_InstaThrust(player->mo, player->mo->angle, -(player->speed>>3)); - if (!(player->mo->tracer->flags & MF_BOSS)) + if (!(player->pflags & PF_SHIELDABILITY) && !(player->mo->tracer->flags & MF_BOSS)) player->pflags &= ~PF_THOKKED; } } @@ -7549,9 +7539,9 @@ void P_HomingAttack(mobj_t *source, mobj_t *enemy) // Home in on your target } else if (source->player) { - if (source->player->charability == CA_HOMINGTHOK) + if (source->player->charability == CA_HOMINGTHOK && !(source->player->pflags & PF_SHIELDABILITY)) ns = FixedDiv(FixedMul(source->player->actionspd, source->scale), 3*FRACUNIT/2); - else //if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT) + else ns = FixedMul(80*FRACUNIT, source->scale); } From 18920e486d1de6c43716d80b469171ab85df0d94 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Wed, 27 May 2015 06:07:38 -0400 Subject: [PATCH 007/808] Add sfx to Attract shield dash. Because it seemed really weird for a sudden shift of momentum to be unaccompanied. --- src/p_user.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/p_user.c b/src/p_user.c index 089c0dc9b..dcb05e8ee 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6799,6 +6799,7 @@ static void P_MovePlayer(player_t *player) { player->pflags |= PF_THOKKED|PF_SHIELDABILITY; player->homing = 2; + S_StartSound(player->mo, sfx_spdpad); if (P_LookForEnemies(player, false) && player->mo->tracer) player->homing = 3*TICRATE; } From 7118925959f16fab6be85c3138280f78640fe92c Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Wed, 27 May 2015 06:43:24 -0400 Subject: [PATCH 008/808] Fix broken P_RingDamage bug from c6c4ab7c Accidentally snipped too much out of P_DamageMobj's subfunctions... --- src/p_inter.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/p_inter.c b/src/p_inter.c index d5c82fefc..7fb81dede 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2716,6 +2716,13 @@ static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype) { + P_DoPlayerPain(player, source, inflictor); + + P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2); + + if ((source && source->type == MT_SPIKE) || damagetype == DMG_SPIKE) // spikes + S_StartSound(player->mo, sfx_spkdth); + if (source && source->player && !player->powers[pw_super]) //don't score points against super players { // Award no points when players shoot each other when cv_friendlyfire is on. From ecd867ab3552ad310f0edd0d006e3c14ec514f29 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Wed, 27 May 2015 21:08:30 -0400 Subject: [PATCH 009/808] Change A_BombShield to add P_BlackOw. Now when you obtain an Armageddon Shield, and you already HAVE one, the first one explodes _while_ applying the second. --- src/p_enemy.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index ef9ff5dda..7d94e105d 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3200,12 +3200,13 @@ void A_BombShield(mobj_t *actor) player = actor->target->player; - if ((player->powers[pw_shield] & SH_NOSTACK) != SH_BOMB) - { - player->powers[pw_shield] = SH_BOMB|(player->powers[pw_shield] & SH_STACK); - P_SpawnShieldOrb(player); - } + // If you already have a bomb shield, use it! + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_BOMB) + P_BlackOw(player); + // Now we know for certain that we don't have a bomb shield, so add one. :3 + player->powers[pw_shield] = SH_BOMB|(player->powers[pw_shield] & SH_STACK); + P_SpawnShieldOrb(player); S_StartSound(player->mo, actor->info->seesound); } From 8a1411b1222eddeaf1a6a4493351de040ffb2e55 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Wed, 27 May 2015 22:06:27 -0400 Subject: [PATCH 010/808] Attraction homing tweaks. Lower homing speed. Retain velocity after hitting your target. --- src/p_user.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index dcb05e8ee..6206b5d4c 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6820,8 +6820,21 @@ static void P_MovePlayer(player_t *player) } // HOMING option. - if (player->charability == CA_HOMINGTHOK - || (player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT) + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT + && player->pflags & PF_SHIELDABILITY) + { + if (player->homing && player->mo->tracer) + { + P_HomingAttack(player->mo, player->mo->tracer); + if (player->mo->tracer->health <= 0 || (player->mo->tracer->flags2 & MF2_FRET)) + player->homing = 0; + } + + // If you're not jumping, then you obviously wouldn't be homing. + if (!(player->pflags & PF_JUMPED)) + player->homing = 0; + } + else if (player->charability == CA_HOMINGTHOK) { // If you've got a target, chase after it! if (player->homing && player->mo->tracer) @@ -7543,7 +7556,7 @@ void P_HomingAttack(mobj_t *source, mobj_t *enemy) // Home in on your target if (source->player->charability == CA_HOMINGTHOK && !(source->player->pflags & PF_SHIELDABILITY)) ns = FixedDiv(FixedMul(source->player->actionspd, source->scale), 3*FRACUNIT/2); else - ns = FixedMul(80*FRACUNIT, source->scale); + ns = FixedMul(45*FRACUNIT, source->scale); } source->momx = FixedMul(FixedDiv(enemy->x - source->x, dist), ns); From 406d809bc2d05048f374bf2a4602f302c5275159 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Wed, 27 May 2015 22:57:11 -0400 Subject: [PATCH 011/808] Change attract homing thok to negate Z. Do not keep Z momentum from homing. It is a bad idea. --- src/p_user.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 6206b5d4c..ea4d83938 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6827,7 +6827,12 @@ static void P_MovePlayer(player_t *player) { P_HomingAttack(player->mo, player->mo->tracer); if (player->mo->tracer->health <= 0 || (player->mo->tracer->flags2 & MF2_FRET)) + { + P_SetObjectMomZ(player->mo, 6*FRACUNIT, false); + if (player->mo->eflags & MFE_UNDERWATER) + player->mo->momz = FixedMul(player->mo->momz, FRACUNIT/3); player->homing = 0; + } } // If you're not jumping, then you obviously wouldn't be homing. @@ -6839,8 +6844,7 @@ static void P_MovePlayer(player_t *player) // If you've got a target, chase after it! if (player->homing && player->mo->tracer) { - if (!(player->pflags & PF_SHIELDABILITY)) - P_SpawnThokMobj(player); + P_SpawnThokMobj(player); P_HomingAttack(player->mo, player->mo->tracer); // But if you don't, then stop homing. @@ -6856,7 +6860,7 @@ static void P_MovePlayer(player_t *player) if (player->mo->tracer->flags2 & MF2_FRET) P_InstaThrust(player->mo, player->mo->angle, -(player->speed>>3)); - if (!(player->pflags & PF_SHIELDABILITY) && !(player->mo->tracer->flags & MF_BOSS)) + if (!(player->mo->tracer->flags & MF_BOSS)) player->pflags &= ~PF_THOKKED; } } From bed8dc4c7c8c87a4af19fb75ac27bb2b00259413 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Thu, 28 May 2015 03:24:55 -0400 Subject: [PATCH 012/808] Tails ringslinger buff. Any character with CA_FLY will now throw rings 1.5x as fast. --- src/p_mobj.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 7742d63e1..3f6d039a0 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9534,7 +9534,7 @@ mobj_t *P_SPMAngle(mobj_t *source, mobjtype_t type, angle_t angle, UINT8 allowai { mobj_t *th; angle_t an; - fixed_t x, y, z, slope = 0; + fixed_t x, y, z, slope = 0, speed; // angle at which you fire, is player angle an = angle; @@ -9566,9 +9566,13 @@ mobj_t *P_SPMAngle(mobj_t *source, mobjtype_t type, angle_t angle, UINT8 allowai P_SetTarget(&th->target, source); + speed = th->info->speed; + if (source->player && source->player->charability == CA_FLY) + speed = FixedMul(speed, 3*FRACUNIT/2); + th->angle = an; - th->momx = FixedMul(th->info->speed, FINECOSINE(an>>ANGLETOFINESHIFT)); - th->momy = FixedMul(th->info->speed, FINESINE(an>>ANGLETOFINESHIFT)); + th->momx = FixedMul(speed, FINECOSINE(an>>ANGLETOFINESHIFT)); + th->momy = FixedMul(speed, FINESINE(an>>ANGLETOFINESHIFT)); if (allowaim) { @@ -9576,7 +9580,7 @@ mobj_t *P_SPMAngle(mobj_t *source, mobjtype_t type, angle_t angle, UINT8 allowai th->momy = FixedMul(th->momy,FINECOSINE(source->player->aiming>>ANGLETOFINESHIFT)); } - th->momz = FixedMul(th->info->speed, slope); + th->momz = FixedMul(speed, slope); //scaling done here so it doesn't clutter up the code above th->momx = FixedMul(th->momx, th->scale); From 2d141739680dbc7802269596f89a3bb1590a663e Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Fri, 29 May 2015 02:35:24 -0400 Subject: [PATCH 013/808] Allow spin button Jump Shield normally. If you walk off a cliff with a jump shield, you can now press EITHER the jump or spin buttons to activate it and double jump. --- src/p_user.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index ea4d83938..613fbe68d 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3832,11 +3832,13 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) if (cmd->buttons & BT_USE && !(player->pflags & PF_JUMPDOWN) && !player->exiting && !P_PlayerInPain(player)) { - if (onground || player->climbing || player->pflags & (PF_CARRIED|PF_ITEMHANG|PF_ROPEHANG)) - {} - else if (player->pflags & PF_MACESPIN && player->mo->tracer) - {} - else if (!(player->pflags & PF_SLIDING) && ((gametype != GT_CTF) || (!player->gotflag))) + if (onground || player->climbing || player->pflags & (PF_CARRIED|PF_ITEMHANG|PF_ROPEHANG|PF_SLIDING) + || (player->pflags & PF_MACESPIN && player->mo->tracer)) + ; + else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_JUMP + && !(player->pflags & PF_JUMPED)) + P_DoJumpShield(player); + else if (gametype != GT_CTF || !player->gotflag) { #ifdef HAVE_BLUA if (!LUAh_JumpSpinSpecial(player)) From 99066429de332494f76d6da177a5793840f225ee Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Fri, 29 May 2015 15:47:54 -0400 Subject: [PATCH 014/808] Add PF_SHIELDABILITY to dehacked. --- src/dehacked.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dehacked.c b/src/dehacked.c index 31fb571c1..7b6606b5d 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7267,6 +7267,7 @@ static const char *const PLAYERFLAG_LIST[] = { /*** misc ***/ "FORCESTRAFE", // Translate turn inputs into strafe inputs "ANALOGMODE", // Analog mode? + "SHIELDABILITY", // Thokked with shield ability NULL // stop loop here. }; From 8cde0121d03f140c476e538be88b063c286f835c Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 14 Aug 2015 15:55:24 +0100 Subject: [PATCH 015/808] Remove the switch-to-seestate behavior in P_DamageMobj. In Doom there was a random chance of enemies either being stunned (painstate) or instead just deciding to attack you (seetstate), but in SRB2 painstate is ALWAYS used beforehand. --- src/p_inter.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index d305cfc83..146be5077 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3048,16 +3048,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da // if not intent on another player, // chase after this one P_SetTarget(&target->target, source); - if (target->state == &states[target->info->spawnstate] && target->info->seestate != S_NULL) - { - if (player) - { - if (!(player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))) - P_SetPlayerMobjState(target, target->info->seestate); - } - else - P_SetMobjState(target, target->info->seestate); - } } return true; From 6bc1a5fdefbeeb710cab5ebd8ddf7cd161f0cd24 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 15 Aug 2015 21:07:16 +0100 Subject: [PATCH 016/808] Okay, major overhaul time! *player->health (formerly the "HUD" health) is now to be known as player->rings, and now acts as the player's actual ring count *player->mo->health (formerly rings + 1) is now always 1 when alive, regardless of ring count; if player with rings is damaged, this is untouched Damage in normal SP/Coop gameplay has been tested and still works fine; still a lot of mess to clear up though Tag damaging probably is broken now, I'll fix this later --- src/d_clisrv.c | 7 ++- src/d_clisrv.h | 3 +- src/d_netcmd.c | 2 +- src/d_player.h | 6 +-- src/g_game.c | 2 +- src/hu_stuff.c | 36 +++++++------- src/lua_baselib.c | 2 +- src/lua_playerlib.c | 8 ++-- src/m_cheat.c | 6 +-- src/m_menu.c | 4 +- src/p_enemy.c | 18 +++---- src/p_inter.c | 79 +++++++++++++++---------------- src/p_mobj.c | 17 +++---- src/p_saveg.c | 4 +- src/p_setup.c | 2 +- src/p_spec.c | 22 ++++----- src/p_tick.c | 2 +- src/p_user.c | 113 ++++++++++++++++---------------------------- src/st_stuff.c | 18 +++---- src/y_inter.c | 14 +++--- 20 files changed, 164 insertions(+), 201 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index c0179ca1b..d08badd4a 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -495,7 +495,7 @@ static inline void resynch_write_player(resynch_pak *rsp, const size_t i) rsp->powers[j] = (UINT16)SHORT(players[i].powers[j]); // Score is resynched in the rspfirm resync packet - rsp->health = 0; // resynched with mo health + rsp->rings = LONG(players[i].rings); rsp->lives = players[i].lives; rsp->continues = players[i].continues; rsp->scoreadd = players[i].scoreadd; @@ -577,7 +577,6 @@ static inline void resynch_write_player(resynch_pak *rsp, const size_t i) rsp->hasmo = true; rsp->health = LONG(players[i].mo->health); - rsp->angle = (angle_t)LONG(players[i].mo->angle); rsp->x = LONG(players[i].mo->x); rsp->y = LONG(players[i].mo->y); @@ -620,7 +619,7 @@ static void resynch_read_player(resynch_pak *rsp) players[i].powers[j] = (UINT16)SHORT(rsp->powers[j]); // Score is resynched in the rspfirm resync packet - players[i].health = rsp->health; + players[i].rings = LONG(rsp->rings); players[i].lives = rsp->lives; players[i].continues = rsp->continues; players[i].scoreadd = rsp->scoreadd; @@ -2244,7 +2243,7 @@ static void CL_RemovePlayer(INT32 playernum) } count--; - rings = players[playernum].health - 1; + rings = players[playernum].rings; increment = rings/count; for (i = 0; i < MAXPLAYERS; i++) diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 6bc06f13a..bf07f035c 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -155,7 +155,7 @@ typedef struct UINT16 powers[NUMPOWERS]; // Score is resynched in the confirm resync packet - INT32 health; + INT32 rings; SINT8 lives; SINT8 continues; UINT8 scoreadd; @@ -231,6 +231,7 @@ typedef struct //player->mo stuff UINT8 hasmo; //boolean + INT32 health; angle_t angle; fixed_t x; fixed_t y; diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 557715064..537588e4b 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2558,7 +2558,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum) if (players[playernum].spectator) { players[playernum].score = 0; - players[playernum].health = 1; + players[playernum].rings = 0; if (players[playernum].mo) players[playernum].mo->health = 1; } diff --git a/src/d_player.h b/src/d_player.h index e2a1081b0..8c3df4883 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -278,10 +278,8 @@ typedef struct player_s // It is updated with cmd->aiming. angle_t aiming; - // This is only used between levels, - // mo->health is used during levels. - /// \todo Remove this. We don't need a second health definition for players. - INT32 health; + // player's ring count + INT32 rings; SINT8 pity; // i pity the fool. INT32 currentweapon; // current weapon selected. diff --git a/src/g_game.c b/src/g_game.c index 643ec8c93..41b875ce7 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2177,7 +2177,7 @@ void G_PlayerReborn(INT32 player) p->pflags |= PF_JUMPDOWN; p->playerstate = PST_LIVE; - p->health = 1; // 0 rings + p->rings = 0; // 0 rings p->panim = PA_IDLE; // standing animation if ((netgame || multiplayer) && !p->spectator) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 80e30beb5..dd7418f60 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -1198,7 +1198,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I V_DrawString(x + 20, y, ((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0) - | ((players[tab[i].num].health > 0) ? 0 : V_60TRANS) + | ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_60TRANS) | V_ALLOWLOWERCASE, tab[i].name); // Draw emeralds @@ -1208,7 +1208,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I HU_DrawEmeralds(x-12,y+2,tab[i].emeralds); } - if (players[tab[i].num].health <= 0) + if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0) V_DrawSmallTranslucentPatch (x, y-4, V_80TRANS, livesback); else V_DrawSmallScaledPatch (x, y-4, 0, livesback); @@ -1220,7 +1220,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I V_DrawSmallScaledPatch(x, y-4, 0, superprefix[players[tab[i].num].skin]); else { - if (players[tab[i].num].health <= 0) + if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0) V_DrawSmallTranslucentPatch(x, y-4, V_80TRANS, faceprefix[players[tab[i].num].skin]); else V_DrawSmallScaledPatch(x, y-4, 0, faceprefix[players[tab[i].num].skin]); @@ -1236,7 +1236,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I else { colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE); - if (players[tab[i].num].health <= 0) + if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0) V_DrawSmallTranslucentMappedPatch (x, y-4, V_80TRANS, faceprefix[players[tab[i].num].skin], colormap); else V_DrawSmallMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap); @@ -1244,10 +1244,10 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I } if (G_GametypeUsesLives()) //show lives - V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE|((players[tab[i].num].health > 0) ? 0 : V_60TRANS), va("%dx", players[tab[i].num].lives)); + V_DrawRightAlignedString(x, y+4, V_ALLOWLOWERCASE|((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_60TRANS), va("%dx", players[tab[i].num].lives)); else if (G_TagGametype() && players[tab[i].num].pflags & PF_TAGIT) { - if (players[tab[i].num].health <= 0) + if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0) V_DrawSmallTranslucentPatch(x-32, y-4, V_60TRANS, tagico); else V_DrawSmallScaledPatch(x-32, y-4, 0, tagico); @@ -1260,13 +1260,13 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I if (players[tab[i].num].exiting) V_DrawRightAlignedString(x+240, y, 0, va("%i:%02i.%02i", G_TicsToMinutes(players[tab[i].num].realtime,true), G_TicsToSeconds(players[tab[i].num].realtime), G_TicsToCentiseconds(players[tab[i].num].realtime))); else - V_DrawRightAlignedString(x+240, y, ((players[tab[i].num].health > 0) ? 0 : V_60TRANS), va("%u", tab[i].count)); + V_DrawRightAlignedString(x+240, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_60TRANS), va("%u", tab[i].count)); } else - V_DrawRightAlignedString(x+240, y, ((players[tab[i].num].health > 0) ? 0 : V_60TRANS), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count))); + V_DrawRightAlignedString(x+240, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_60TRANS), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count))); } else - V_DrawRightAlignedString(x+240, y, ((players[tab[i].num].health > 0) ? 0 : V_60TRANS), va("%u", tab[i].count)); + V_DrawRightAlignedString(x+240, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_60TRANS), va("%u", tab[i].count)); y += 16; } @@ -1311,7 +1311,7 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer) strlcpy(name, tab[i].name, 9); V_DrawString(x + 20, y, ((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0) - | ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT) + | ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT) | V_ALLOWLOWERCASE, name); if (gametype == GT_CTF) @@ -1337,12 +1337,12 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer) else { colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE); - if (players[tab[i].num].health <= 0) + if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0) V_DrawSmallTranslucentMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap); else V_DrawSmallMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap); } - V_DrawRightAlignedThinString(x+120, y, ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count)); + V_DrawRightAlignedThinString(x+120, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count)); } } @@ -1367,7 +1367,7 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline strlcpy(name, tab[i].name, 9); V_DrawString(x + 20, y, ((tab[i].num == whiteplayer) ? V_YELLOWMAP : 0) - | ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT) + | ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT) | V_ALLOWLOWERCASE, name); if (G_GametypeUsesLives()) //show lives @@ -1390,7 +1390,7 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline V_DrawSmallScaledPatch (x, y-4, 0, superprefix[players[tab[i].num].skin]); else { - if (players[tab[i].num].health <= 0) + if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0) V_DrawSmallTranslucentPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin]); else V_DrawSmallScaledPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin]); @@ -1406,7 +1406,7 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline else { colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo ? players[tab[i].num].mo->color : tab[i].color, GTC_CACHE); - if (players[tab[i].num].health <= 0) + if (players[tab[i].num].mo && players[tab[i].num].mo->health <= 0) V_DrawSmallTranslucentMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap); else V_DrawSmallMappedPatch (x, y-4, 0, faceprefix[players[tab[i].num].skin], colormap); @@ -1421,13 +1421,13 @@ void HU_DrawDualTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scoreline if (players[tab[i].num].exiting) V_DrawRightAlignedThinString(x+156, y, 0, va("%i:%02i.%02i", G_TicsToMinutes(players[tab[i].num].realtime,true), G_TicsToSeconds(players[tab[i].num].realtime), G_TicsToCentiseconds(players[tab[i].num].realtime))); else - V_DrawRightAlignedThinString(x+156, y, ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count)); + V_DrawRightAlignedThinString(x+156, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count)); } else - V_DrawRightAlignedThinString(x+156, y, ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count))); + V_DrawRightAlignedThinString(x+156, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT), va("%i:%02i.%02i", G_TicsToMinutes(tab[i].count,true), G_TicsToSeconds(tab[i].count), G_TicsToCentiseconds(tab[i].count))); } else - V_DrawRightAlignedThinString(x+120, y, ((players[tab[i].num].health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count)); + V_DrawRightAlignedThinString(x+120, y, ((players[tab[i].num].mo && players[tab[i].num].mo->health > 0) ? 0 : V_TRANSLUCENT), va("%u", tab[i].count)); y += 16; if (y > 160) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 2a5ff8d65..50324d8f2 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1068,7 +1068,7 @@ static int lib_pPlayerRingBurst(lua_State *L) if (!player) return LUA_ErrInvalid(L, "player_t"); if (num_rings == -1) - num_rings = player->health - 1; + num_rings = player->rings; P_PlayerRingBurst(player, num_rings); return 0; } diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 64513ab97..64396670b 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -118,8 +118,8 @@ static int player_get(lua_State *L) lua_pushfixed(L, plr->bob); else if (fastcmp(field,"aiming")) lua_pushangle(L, plr->aiming); - else if (fastcmp(field,"health")) - lua_pushinteger(L, plr->health); + else if (fastcmp(field,"rings")) + lua_pushinteger(L, plr->rings); else if (fastcmp(field,"pity")) lua_pushinteger(L, plr->pity); else if (fastcmp(field,"currentweapon")) @@ -368,8 +368,8 @@ static int player_set(lua_State *L) else if (plr == &players[secondarydisplayplayer]) localaiming2 = plr->aiming; } - else if (fastcmp(field,"health")) - plr->health = (INT32)luaL_checkinteger(L, 3); + else if (fastcmp(field,"rings")) + plr->rings = (INT32)luaL_checkinteger(L, 3); else if (fastcmp(field,"pity")) plr->pity = (SINT8)luaL_checkinteger(L, 3); else if (fastcmp(field,"currentweapon")) diff --git a/src/m_cheat.c b/src/m_cheat.c index 4da9b3ba7..dde3376f8 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -625,7 +625,7 @@ void Command_CauseCfail_f(void) players[consoleplayer].mo->y = 123311; //cfail cansuled kthxbye players[consoleplayer].mo->z = 123311; players[consoleplayer].score = 1337; - players[consoleplayer].health = 1337; + players[consoleplayer].rings = 1337; players[consoleplayer].mo->destscale = 25; P_SetThingPosition(players[consoleplayer].mo); @@ -739,7 +739,7 @@ void Command_Setrings_f(void) if (COM_Argc() > 1) { // P_GivePlayerRings does value clamping - players[consoleplayer].health = players[consoleplayer].mo->health = 1; + players[consoleplayer].rings = 0; P_GivePlayerRings(&players[consoleplayer], atoi(COM_Argv(1))); if (!G_IsSpecialStage(gamemap) || !useNightsSS) players[consoleplayer].totalring -= atoi(COM_Argv(1)); //undo totalring addition done in P_GivePlayerRings @@ -1241,7 +1241,7 @@ void Command_ObjectPlace_f(void) // Like the classics, recover from death by entering objectplace if (players[0].mo->health <= 0) { - players[0].mo->health = players[0].health = 1; + players[0].mo->health = 1; players[0].deadtimer = 0; op_oldflags1 = mobjinfo[MT_PLAYER].flags; ++players[0].lives; diff --git a/src/m_menu.c b/src/m_menu.c index 88893b3c6..f19c4da3d 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3789,7 +3789,7 @@ static void M_HandleImageDef(INT32 choice) static void M_PandorasBox(INT32 choice) { (void)choice; - CV_StealthSetValue(&cv_dummyrings, max(players[consoleplayer].health - 1, 0)); + CV_StealthSetValue(&cv_dummyrings, max(players[consoleplayer].rings, 0)); CV_StealthSetValue(&cv_dummylives, players[consoleplayer].lives); CV_StealthSetValue(&cv_dummycontinues, players[consoleplayer].continues); M_SetupNextMenu(&SR_PandoraDef); @@ -3797,7 +3797,7 @@ static void M_PandorasBox(INT32 choice) static boolean M_ExitPandorasBox(void) { - if (cv_dummyrings.value != max(players[consoleplayer].health - 1, 0)) + if (cv_dummyrings.value != max(players[consoleplayer].rings, 0)) COM_ImmedExecute(va("setrings %d", cv_dummyrings.value)); if (cv_dummylives.value != players[consoleplayer].lives) COM_ImmedExecute(va("setlives %d", cv_dummylives.value)); diff --git a/src/p_enemy.c b/src/p_enemy.c index 3cc9aaca2..303e74880 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -655,15 +655,15 @@ boolean P_LookForPlayers(mobj_t *actor, boolean allaround, boolean tracer, fixed if ((netgame || multiplayer) && player->spectator) continue; - if (player->health <= 0) - continue; // dead - if (player->pflags & PF_INVIS) continue; // ignore notarget if (!player->mo || P_MobjWasRemoved(player->mo)) continue; + if (player->mo->health <= 0) + continue; // dead + if (dist > 0 && P_AproxDistance(P_AproxDistance(player->mo->x - actor->x, player->mo->y - actor->y), player->mo->z - actor->z) > dist) continue; // Too far away @@ -727,7 +727,7 @@ static boolean P_LookForShield(mobj_t *actor) player = &players[actor->lastlook]; - if (player->health <= 0 || !player->mo) + if (!player->mo || player->mo->health <= 0) continue; // dead //When in CTF, don't pull rings that you cannot pick up. @@ -2721,7 +2721,7 @@ void A_BossDeath(mobj_t *mo) // make sure there is a player alive for victory for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i] && (players[i].health > 0 + if (playeringame[i] && ((players[i].mo && players[i].mo->health > 0) || ((netgame || multiplayer) && (players[i].lives > 0 || players[i].continues > 0)))) break; @@ -8268,7 +8268,7 @@ void A_RingDrain(mobj_t *actor) } player = actor->target->player; - P_GivePlayerRings(player, -min(locvar1, player->mo->health-1)); + P_GivePlayerRings(player, -min(locvar1, player->rings)); } // Function: A_SplitShot @@ -8578,7 +8578,7 @@ void A_CheckTargetRings(mobj_t *actor) if (!(actor->target) || !(actor->target->player)) return; - if (actor->target->player->health >= locvar1) + if (actor->target->player->rings >= locvar1) P_SetMobjState(actor, locvar2); } @@ -8600,7 +8600,7 @@ void A_CheckRings(mobj_t *actor) #endif for (i = 0; i < MAXPLAYERS; i++) - cntr += players[i].health-1; + cntr += players[i].rings; if (cntr >= locvar1) P_SetMobjState(actor, locvar2); @@ -9172,7 +9172,7 @@ void A_ForceWin(mobj_t *actor) for (i = 0; i < MAXPLAYERS; i++) { - if (playeringame[i] && (players[i].health > 0 + if (playeringame[i] && ((players[i].mo && players[i].mo->health > 0) || ((netgame || multiplayer) && (players[i].lives > 0 || players[i].continues > 0)))) break; } diff --git a/src/p_inter.c b/src/p_inter.c index de90f419e..3bf0e68a5 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -796,16 +796,14 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (G_IsSpecialStage(gamemap) && !player->exiting) { // In special stages, share rings. Everyone gives up theirs to the player who touched the capsule for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i] && (&players[i] != player) && players[i].mo->health > 1) + if (playeringame[i] && (&players[i] != player) && players[i].rings > 0) { - toucher->health += players[i].mo->health-1; - player->health = toucher->health; - players[i].mo->health = 1; - players[i].health = players[i].mo->health; + player->rings += players[i].rings; + players[i].rings = 0; } } - if (!(player->health > 1) || player->exiting) + if (player->rings <= 0 || player->exiting) return; // Mark the player as 'pull into the capsule' @@ -1366,11 +1364,10 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) else { P_PlayRinglossSound(toucher); - if (toucher->health > 10) - toucher->health -= 10; + if (player->rings >= 10) + player->rings -= 10; else - toucher->health = 1; - player->health = toucher->health; + player->rings = 0; } P_DoPlayerPain(player, special, NULL); @@ -1475,6 +1472,9 @@ static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *sour if (!player) return; // Impossible! + if (!player->mo) + return; // Also impossible! + if (!netgame) return; // Presumably it's obvious what's happening in splitscreen. @@ -1483,7 +1483,7 @@ static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *sour return; #endif - deadtarget = (player->health <= 0); + deadtarget = (player->mo->health <= 0); // Target's name snprintf(targetname, sizeof(targetname), "%s%s%s", @@ -2428,26 +2428,25 @@ static inline boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *sou return true; } - if (target->health <= 1) // Death + if (player->rings > 0) // Ring loss + { + P_PlayRinglossSound(target); + P_PlayerRingBurst(player, player->rings); + } + else // Death { P_PlayDeathSound(target); P_PlayVictorySound(source); // Killer laughs at you! LAUGHS! BWAHAHAHHAHAA!! } - else if (target->health > 1) // Ring loss - { - P_PlayRinglossSound(target); - P_PlayerRingBurst(player, player->mo->health - 1); - } if (inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player) && player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds])) { - player->health -= 10; - if (player->health < 2) - player->health = 2; - target->health = player->health; + player->rings -= 10; + if (player->rings < 1) + player->rings = 1; } else - player->health = target->health = 1; + player->rings = 0; return true; } @@ -2497,7 +2496,7 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage) // Burst weapons and emeralds in Match/CTF only if (source && (gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF)) { - P_PlayerRingBurst(player, player->health - 1); + P_PlayerRingBurst(player, player->rings); P_PlayerEmeraldBurst(player, false); } @@ -2942,9 +2941,9 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da P_ShieldDamage(player, inflictor, source, damage); damage = 0; } - else if (player->mo->health > 1) // No shield but have rings. + else if (player->rings > 0) // No shield but have rings. { - damage = player->mo->health - 1; + damage = player->rings; P_RingDamage(player, inflictor, source, damage, damagetype); } else // No shield, no rings, no invincibility. @@ -2974,26 +2973,28 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da } else { - player->health -= (10 * (1 << (INT32)(player->powers[pw_super] / 10500))); - if (player->health < 2) - player->health = 2; + player->rings -= (10 * (1 << (INT32)(player->powers[pw_super] / 10500))); + if (player->rings < 1) + player->rings = 1; } if (gametype == GT_CTF && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG))) P_PlayerFlagBurst(player, false); + damage = 0; } else if (damagetype & DMG_DEATHMASK) - player->health = 0; - else + player->rings = 0; + else if (damage == 0 || player->rings) //quickfix to just get things back to normal ...for now (sans Tag, I'll deal with that later) { - player->health -= damage; // mirror mobj health here - target->player->powers[pw_flashing] = flashingtics; if (damage > 0) // don't spill emeralds/ammo/panels for shield damage P_PlayerRingBurst(player, damage); + player->rings -= damage; + target->player->powers[pw_flashing] = flashingtics; + damage = 0; } - if (player->health < 0) - player->health = 0; + if (player->rings < 0) + player->rings = 0; P_HitDeathMessages(player, inflictor, source, damagetype); @@ -3006,13 +3007,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da P_DamageMobj(source, target, target, 1, 0); // do the damage - if (player && player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]) && inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player)) - { - target->health -= (10 * (1 << (INT32)(player->powers[pw_super] / 10500))); - if (target->health < 2) - target->health = 2; - } - else if (damagetype & DMG_DEATHMASK) + if (damagetype & DMG_DEATHMASK) target->health = 0; else target->health -= damage; @@ -3078,7 +3073,7 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings) return; // If no health, don't spawn ring! - if (player->mo->health <= 1) + if (player->rings <= 0) num_rings = 0; if (num_rings > 32 && !(player->pflags & PF_NIGHTSFALL)) diff --git a/src/p_mobj.c b/src/p_mobj.c index 8ea71d6c7..d0a6b2432 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3357,15 +3357,15 @@ boolean P_BossTargetPlayer(mobj_t *actor, boolean closest) player = &players[actor->lastlook]; - if (player->health <= 0) - continue; // dead - if (player->pflags & PF_INVIS || player->bot || player->spectator) continue; // ignore notarget if (!player->mo || P_MobjWasRemoved(player->mo)) continue; + if (player->mo->health <= 0) + continue; //dead + if (!P_CheckSight(actor, player->mo)) continue; // out of sight @@ -3395,15 +3395,15 @@ boolean P_SupermanLook4Players(mobj_t *actor) { if (playeringame[c]) { - if (players[c].health <= 0) - continue; // dead - if (players[c].pflags & PF_INVIS) continue; // ignore notarget if (!players[c].mo || players[c].bot) continue; + if (players[c].mo->health <= 0) + continue; // dead + playersinthegame[stop] = &players[c]; stop++; } @@ -6175,7 +6175,7 @@ void P_MobjThinker(mobj_t *mobj) P_SetTarget(&mobj->target, NULL); for (i = 0; i < MAXPLAYERS; i++) if (playeringame[i] && players[i].mo - && players[i].mare == mobj->threshold && players[i].health > 1) + && players[i].mare == mobj->threshold && players[i].rings > 0) { fixed_t dist = P_AproxDistance(players[i].mo->x - mobj->x, players[i].mo->y - mobj->y); if (dist < shortest) @@ -7819,7 +7819,8 @@ void P_SpawnPlayer(INT32 playernum) // the dead body mobj retains the skin through the 'spritedef' override). mobj->skin = &skins[p->skin]; - mobj->health = p->health; + mobj->health = 1; + p->rings = 0; p->playerstate = PST_LIVE; p->bonustime = false; diff --git a/src/p_saveg.c b/src/p_saveg.c index 2afcfd0ef..5a2da118b 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -125,7 +125,7 @@ static inline void P_NetArchivePlayers(void) WRITEANGLE(save_p, players[i].aiming); WRITEANGLE(save_p, players[i].awayviewaiming); WRITEINT32(save_p, players[i].awayviewtics); - WRITEINT32(save_p, players[i].health); + WRITEINT32(save_p, players[i].rings); WRITESINT8(save_p, players[i].pity); WRITEINT32(save_p, players[i].currentweapon); @@ -300,7 +300,7 @@ static inline void P_NetUnArchivePlayers(void) players[i].aiming = READANGLE(save_p); players[i].awayviewaiming = READANGLE(save_p); players[i].awayviewtics = READINT32(save_p); - players[i].health = READINT32(save_p); + players[i].rings = READINT32(save_p); players[i].pity = READSINT8(save_p); players[i].currentweapon = READINT32(save_p); diff --git a/src/p_setup.c b/src/p_setup.c index f2b0c49d8..10f4f4bc3 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2057,7 +2057,7 @@ static void P_LevelInitStuff(void) players[i].gotcontinue = false; players[i].xtralife = players[i].deadtimer = players[i].numboxes = players[i].totalring = players[i].laps = 0; - players[i].health = 1; + players[i].rings = 0; players[i].aiming = 0; players[i].pflags &= ~PF_TIMEOVER; diff --git a/src/p_spec.c b/src/p_spec.c index cb3340ee4..6712f40ec 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -1592,10 +1592,10 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller if (!playeringame[i] || players[i].spectator) continue; - if (!players[i].mo || players[i].mo->health < 1) + if (!players[i].mo || players[i].rings <= 0) continue; - rings += players[i].mo->health-1; + rings += players[i].rings; } } else @@ -1603,7 +1603,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller if (!(actor && actor->player)) return false; // no player to count rings from here, sorry - rings = actor->health-1; + rings = actor->player->rings; } if (triggerline->flags & ML_NOCLIMB) @@ -3499,10 +3499,9 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers break; case 9: // Ring Drainer (Floor Touch) case 10: // Ring Drainer (No Floor Touch) - if (leveltime % (TICRATE/2) == 0 && player->mo->health > 1) + if (leveltime % (TICRATE/2) == 0 && player->rings > 0) { - player->mo->health--; - player->health--; + player->rings--; S_StartSound(player->mo, sfx_itemup); } break; @@ -3510,7 +3509,7 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers if (player->powers[pw_invulnerability] || player->powers[pw_flashing] || player->powers[pw_super] || player->exiting || player->bot) break; - if (!(player->powers[pw_shield] || player->mo->health > 1)) // Don't do anything if no shield or rings anyway + if (!(player->powers[pw_shield] || player->rings > 0)) // Don't do anything if no shield or rings anyway break; if (player->powers[pw_shield]) @@ -3518,14 +3517,13 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers P_RemoveShield(player); S_StartSound(player->mo, sfx_shldls); // Ba-Dum! Shield loss. } - else if (player->mo->health > 1) + else if (player->rings > 0) { P_PlayRinglossSound(player->mo); - if (player->mo->health > 10) - player->mo->health -= 10; + if (player->rings >= 10) + player->rings -= 10; else - player->mo->health = 1; - player->health = player->mo->health; + player->rings = 0; } P_DoPlayerPain(player, NULL, NULL); // this does basically everything that was here before diff --git a/src/p_tick.c b/src/p_tick.c index 15d3abc80..3c7820c2d 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -469,7 +469,7 @@ static inline void P_DoSpecialStageStuff(void) for (i = 0; i < MAXPLAYERS; i++) if (playeringame[i]) { - ssrings += (players[i].mo->health-1); + ssrings += players[i].rings; // If in water, deplete timer 6x as fast. if ((players[i].mo->eflags & MFE_TOUCHWATER) diff --git a/src/p_user.c b/src/p_user.c index c7d612efc..2f384de34 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -704,7 +704,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) { for (i = 0; i < MAXPLAYERS; i++) if (playeringame[i]/* && players[i].pflags & PF_NIGHTSMODE*/) - total_rings += players[i].health-1; + total_rings += players[i].rings; } for (i = 0; i < MAXPLAYERS; i++) @@ -722,8 +722,8 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) } else { - players[i].finishedrings = (INT16)(players[i].health - 1); - P_AddPlayerScore(&players[i], (players[i].health - 1) * 50); + players[i].finishedrings = (INT16)(players[i].rings); + P_AddPlayerScore(&players[i], (players[i].rings) * 50); } // Add score to leaderboards now @@ -734,7 +734,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) players[i].lastmarescore = players[i].marescore; players[i].marescore = 0; - players[i].mo->health = players[i].health = 1; + players[i].rings = 0; P_DoPlayerExit(&players[i]); } } @@ -742,12 +742,12 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) { /// \todo Handle multi-mare special stages. // Ring bonus - P_AddPlayerScore(player, (player->health - 1) * 50); + P_AddPlayerScore(player, (player->rings) * 50); player->lastmare = (UINT8)oldmare; player->texttimer = 4*TICRATE; player->textvar = 4; // Score and grades - player->finishedrings = (INT16)(player->health - 1); + player->finishedrings = (INT16)(player->rings); // Add score to temp leaderboards if (!(netgame||multiplayer) && P_IsLocalPlayer(player)) @@ -758,7 +758,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) player->marescore = 0; player->marebegunat = leveltime; - player->mo->health = player->health = 1; + player->rings = 0; } else { @@ -901,30 +901,23 @@ void P_GivePlayerRings(player_t *player, INT32 num_rings) if (!player->mo) return; - player->mo->health += num_rings; - player->health += num_rings; + player->rings += num_rings; if (!G_IsSpecialStage(gamemap) || !useNightsSS) player->totalring += num_rings; // Can only get up to 9999 rings, sorry! - if (player->mo->health > 10000) - { - player->mo->health = 10000; - player->health = 10000; - } - else if (player->mo->health < 1) - { - player->mo->health = 1; - player->health = 1; - } + if (player->rings > 9999) + player->rings = 9999; + else if (player->rings < 0) + player->rings = 0; // Now extra life bonuses are handled here instead of in P_MovePlayer, since why not? if (!ultimatemode && !modeattacking && !G_IsSpecialStage(gamemap) && G_GametypeUsesLives()) { INT32 gainlives = 0; - while (player->xtralife < maxXtraLife && player->health > 100 * (player->xtralife+1)) + while (player->xtralife < maxXtraLife && player->rings >= 100 * (player->xtralife+1)) { ++gainlives; ++player->xtralife; @@ -975,10 +968,7 @@ void P_DoSuperTransformation(player_t *player, boolean giverings) player->mo->momx = player->mo->momy = player->mo->momz = 0; if (giverings) - { - player->mo->health = 51; - player->health = player->mo->health; - } + player->rings = 50; // Just in case. if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOSSMUSIC)) @@ -3135,7 +3125,7 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) // Bounce ring else if (player->currentweapon == WEP_BOUNCE && player->powers[pw_bouncering]) { - if (player->health <= 1) + if (player->rings <= 0) return; P_SetWeaponDelay(player, TICRATE/4); @@ -3145,13 +3135,12 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) mo->fuse = 3*TICRATE; // Bounce Ring time player->powers[pw_bouncering]--; - player->mo->health--; - player->health--; + player->rings--; } // Rail ring else if (player->currentweapon == WEP_RAIL && player->powers[pw_railring]) { - if (player->health <= 1) + if (player->rings <= 0) return; P_SetWeaponDelay(player, (3*TICRATE)/2); @@ -3161,13 +3150,12 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) S_StartSound(player->mo, sfx_rail1); player->powers[pw_railring]--; - player->mo->health--; - player->health--; + player->rings--; } // Automatic else if (player->currentweapon == WEP_AUTO && player->powers[pw_automaticring]) { - if (player->health <= 1) + if (player->rings <= 0) return; player->pflags &= ~PF_ATTACKDOWN; P_SetWeaponDelay(player, 2); @@ -3175,26 +3163,24 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) mo = P_SpawnPlayerMissile(player->mo, MT_THROWNAUTOMATIC, MF2_AUTOMATIC); player->powers[pw_automaticring]--; - player->mo->health--; - player->health--; + player->rings--; } // Explosion else if (player->currentweapon == WEP_EXPLODE && player->powers[pw_explosionring]) { - if (player->health <= 1) + if (player->rings <= 0) return; P_SetWeaponDelay(player, (3*TICRATE)/2); mo = P_SpawnPlayerMissile(player->mo, MT_THROWNEXPLOSION, MF2_EXPLOSION); player->powers[pw_explosionring]--; - player->mo->health--; - player->health--; + player->rings--; } // Grenade else if (player->currentweapon == WEP_GRENADE && player->powers[pw_grenadering]) { - if (player->health <= 1) + if (player->rings <= 0) return; P_SetWeaponDelay(player, TICRATE/3); @@ -3207,8 +3193,7 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) } player->powers[pw_grenadering]--; - player->mo->health--; - player->health--; + player->rings--; } // Scatter // Note: Ignores MF2_RAILRING @@ -3218,7 +3203,7 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) angle_t shotangle = player->mo->angle; angle_t oldaiming = player->aiming; - if (player->health <= 1) + if (player->rings <= 0) return; P_SetWeaponDelay(player, (2*TICRATE)/3); @@ -3247,8 +3232,7 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) player->aiming = oldaiming; player->powers[pw_scatterring]--; - player->mo->health--; - player->health--; + player->rings--; return; } // No powers, just a regular ring. @@ -3272,7 +3256,7 @@ firenormal: // Red Ring else { - if (player->health <= 1) + if (player->rings <= 0) return; P_SetWeaponDelay(player, TICRATE/4); @@ -3281,8 +3265,7 @@ firenormal: if (mo) P_ColorTeamMissile(mo, player); - player->mo->health--; - player->health--; + player->rings--; } } @@ -3336,7 +3319,7 @@ static void P_DoSuperStuff(player_t *player) return; // NiGHTS Super doesn't mix with normal super // Does player have all emeralds? If so, flag the "Ready For Super!" - if ((ALL7EMERALDS(emeralds) || ALL7EMERALDS(player->powers[pw_emeralds])) && player->health > 50) + if ((ALL7EMERALDS(emeralds) || ALL7EMERALDS(player->powers[pw_emeralds])) && player->rings >= 50) player->pflags |= PF_SUPERREADY; else player->pflags &= ~PF_SUPERREADY; @@ -3374,10 +3357,7 @@ static void P_DoSuperStuff(player_t *player) // Deplete one ring every second while super if ((leveltime % TICRATE == 0) && !(player->exiting)) - { - player->health--; - player->mo->health--; - } + player->rings--; switch (player->skin) { @@ -3412,7 +3392,7 @@ static void P_DoSuperStuff(player_t *player) G_GhostAddColor(GHC_SUPER); // Ran out of rings while super! - if (player->health <= 1 || player->exiting) + if (player->rings <= 0 || player->exiting) { player->powers[pw_emeralds] = 0; // lost the power stones P_SpawnGhostMobj(player->mo); @@ -3465,12 +3445,6 @@ static void P_DoSuperStuff(player_t *player) P_SetPlayerMobjState(player->mo, S_PLAY_RIDE); break; } - - if (!player->exiting) - { - player->health = 1; - player->mo->health = 1; - } } // Inform the netgame that the champion has fallen in the heat of battle. @@ -5392,12 +5366,10 @@ static void P_DoNiGHTSCapsule(player_t *player) if (G_IsSpecialStage(gamemap)) { // In special stages, share rings. Everyone gives up theirs to the capsule player always, because we can't have any individualism here! for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i] && (&players[i] != player) && players[i].mo->health > 1) + if (playeringame[i] && (&players[i] != player) && players[i].rings > 0) { - player->mo->health += players[i].mo->health-1; - player->health = player->mo->health; - players[i].mo->health = 1; - players[i].health = players[i].mo->health; + player->rings += players[i].rings; + players[i].rings = 0; } } @@ -5406,10 +5378,9 @@ static void P_DoNiGHTSCapsule(player_t *player) && player->mo->y == player->capsule->y && player->mo->z == player->capsule->z+(player->capsule->height/3)) { - if (player->mo->health > 1) + if (player->rings > 0) { - player->mo->health--; - player->health--; + player->rings--; player->capsule->health--; player->capsule->extravalue1++; @@ -6129,7 +6100,7 @@ static void P_PlayerDropWeapon(player_t *player) if (mo) { - player->mo->health--; + player->rings--; P_InstaThrust(mo, player->mo->angle-ANGLE_180, 8*FRACUNIT); P_SetObjectMomZ(mo, 4*FRACUNIT, false); mo->flags2 |= MF2_DONTRESPAWN; @@ -6416,7 +6387,7 @@ static void P_MovePlayer(player_t *player) if (playeringame[i]) players[i].exiting = (14*TICRATE)/5 + 1; } - else if (player->health > 1) + else if (player->rings > 0) P_DamageMobj(player->mo, NULL, NULL, 1, 0); player->pflags &= ~PF_NIGHTSFALL; } @@ -8613,7 +8584,7 @@ void P_PlayerThink(player_t *player) #endif // todo: Figure out what is actually causing these problems in the first place... - if ((player->health <= 0 || player->mo->health <= 0) && player->playerstate == PST_LIVE) //you should be DEAD! + if (player->mo->health <= 0 && player->playerstate == PST_LIVE) //you should be DEAD! { CONS_Debug(DBG_GAMELOGIC, "P_PlayerThink: Player %s in PST_LIVE with 0 health. (\"Zombie bug\")\n", sizeu1(playeri)); player->playerstate = PST_DEAD; @@ -8713,7 +8684,7 @@ void P_PlayerThink(player_t *player) // it to the exit, you're a goner! else if (countdown == 1 && !player->exiting && player->lives > 0) { - if (netgame && player->health > 0) + if (netgame && player->mo->health > 0) CONS_Printf(M_GetText("%s ran out of time.\n"), player_names[player-players]); player->pflags |= PF_TIMEOVER; @@ -8802,7 +8773,7 @@ void P_PlayerThink(player_t *player) { player->score = 0; player->mo->health = 1; - player->health = 1; + player->rings = 0; } if ((netgame || multiplayer) && player->lives <= 0) @@ -9270,7 +9241,7 @@ void P_PlayerAfterThink(player_t *player) player->currentweapon = 0; // If you're out of rings, but have Infinity Rings left, switch to that. - if (player->currentweapon != 0 && player->health <= 1 && player->powers[pw_infinityring]) + if (player->currentweapon != 0 && player->rings <= 0 && player->powers[pw_infinityring]) player->currentweapon = 0; if (P_IsLocalPlayer(player) && (player->pflags & PF_WPNDOWN) && player->currentweapon != oldweapon) diff --git a/src/st_stuff.c b/src/st_stuff.c index 6e19b92ff..65a52d60e 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -660,9 +660,9 @@ static void ST_drawTime(void) static inline void ST_drawRings(void) { - INT32 ringnum = max(stplyr->health-1, 0); + INT32 ringnum = max(stplyr->rings, 0); - ST_DrawPatchFromHudWS(HUD_RINGS, ((stplyr->health <= 1 && leveltime/5 & 1) ? rrings : sborings)); + ST_DrawPatchFromHudWS(HUD_RINGS, ((stplyr->rings <= 0 && leveltime/5 & 1) ? rrings : sborings)); if (objectplacing) ringnum = op_currentdoomednum; @@ -671,8 +671,8 @@ static inline void ST_drawRings(void) INT32 i; ringnum = 0; for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i] && players[i].mo && players[i].mo->health > 1) - ringnum += players[i].mo->health - 1; + if (playeringame[i] && players[i].mo && players[i].rings > 0) + ringnum += players[i].rings; } ST_DrawNumFromHudWS(HUD_RINGSNUM, ringnum); @@ -1133,11 +1133,11 @@ static void ST_drawNiGHTSHUD(void) INT32 i; total_ringcount = 0; for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i] /*&& players[i].pflags & PF_NIGHTSMODE*/ && players[i].health) - total_ringcount += players[i].health - 1; + if (playeringame[i] /*&& players[i].pflags & PF_NIGHTSMODE*/ && players[i].rings) + total_ringcount += players[i].rings; } else - total_ringcount = stplyr->health-1; + total_ringcount = stplyr->rings; if (stplyr->capsule) { @@ -1349,7 +1349,7 @@ static void ST_drawWeaponRing(powertype_t weapon, INT32 rwflag, INT32 wepflag, I txtflags |= V_YELLOWMAP; if (weapon == pw_infinityring - || (stplyr->ringweapons & rwflag && stplyr->health > 1)) + || (stplyr->ringweapons & rwflag && stplyr->rings > 0)) txtflags |= V_20TRANS; else { @@ -1383,7 +1383,7 @@ static void ST_drawMatchHUD(void) if (stplyr->powers[pw_infinityring]) ST_drawWeaponRing(pw_infinityring, 0, 0, offset, infinityring); - else if (stplyr->health > 1) + else if (stplyr->rings > 0) V_DrawScaledPatch(8 + offset, STRINGY(162), V_SNAPTOLEFT, normring); else V_DrawTranslucentPatch(8 + offset, STRINGY(162), V_SNAPTOLEFT|V_80TRANS, normring); diff --git a/src/y_inter.c b/src/y_inter.c index 2f2edf7ca..37a8bc4cc 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -792,13 +792,13 @@ static void Y_UpdateRecordReplays(void) if ((mainrecords[gamemap-1]->time == 0) || (players[consoleplayer].realtime < mainrecords[gamemap-1]->time)) mainrecords[gamemap-1]->time = players[consoleplayer].realtime; - if ((UINT16)(players[consoleplayer].health - 1) > mainrecords[gamemap-1]->rings) - mainrecords[gamemap-1]->rings = (UINT16)(players[consoleplayer].health - 1); + if ((UINT16)(players[consoleplayer].rings) > mainrecords[gamemap-1]->rings) + mainrecords[gamemap-1]->rings = (UINT16)(players[consoleplayer].rings); // Save demo! bestdemo[255] = '\0'; lastdemo[255] = '\0'; - G_SetDemoTime(players[consoleplayer].realtime, players[consoleplayer].score, (UINT16)(players[consoleplayer].health-1)); + G_SetDemoTime(players[consoleplayer].realtime, players[consoleplayer].score, (UINT16)(players[consoleplayer].rings)); G_CheckDemoStatus(); I_mkdir(va("%s"PATHSEP"replay", srb2home), 0755); @@ -1373,7 +1373,7 @@ static void Y_CalculateCompetitionWinners(void) bestat[j] = true; times[i] = players[i].realtime; - rings[i] = (UINT32)max(players[i].health-1, 0); + rings[i] = (UINT32)max(players[i].rings, 0); maxrings[i] = (UINT32)players[i].totalring; monitors[i] = (UINT32)players[i].numboxes; scores[i] = (UINT32)min(players[i].score, 99999990); @@ -1388,7 +1388,7 @@ static void Y_CalculateCompetitionWinners(void) else bestat[0] = false; - if (max(players[i].health-1, 0) >= max(players[j].health-1, 0)) + if (max(players[i].rings, 0) >= max(players[j].rings, 0)) points[i]++; else bestat[1] = false; @@ -1511,7 +1511,7 @@ static void Y_SetRingBonus(player_t *player, y_bonus_t *bstruct) { strncpy(bstruct->patch, "YB_RING", sizeof(bstruct->patch)); bstruct->display = true; - bstruct->points = max(0, (player->health-1) * 100); + bstruct->points = max(0, (player->rings) * 100); } // @@ -1559,7 +1559,7 @@ static void Y_SetPerfectBonus(player_t *player, y_bonus_t *bstruct) for (i = 0; i < MAXPLAYERS; i++) { if (!playeringame[i]) continue; - sharedringtotal += players[i].health - 1; + sharedringtotal += players[i].rings; } if (!sharedringtotal || sharedringtotal < nummaprings) data.coop.gotperfbonus = 0; From 7dcf0d3d09564fdab4163b33a58b864fb4bab04e Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 1 Oct 2015 20:02:44 +0100 Subject: [PATCH 017/808] Fix an error from match-balancing being merged in. Apparently match-balancing also doesn't have a prototype for P_StealPlayerScore for whatever reason. --- src/p_inter.c | 1 - src/p_local.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_inter.c b/src/p_inter.c index 60ba32c90..9f29401a0 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3025,7 +3025,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da } if (damagetype & DMG_DEATHMASK) - damage = 0; player->rings = 0; else if (damage == 0 || player->rings) //quickfix to just get things back to normal ...for now (sans Tag, I'll deal with that later) { diff --git a/src/p_local.h b/src/p_local.h index 359b7b842..30582ba1a 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -123,6 +123,7 @@ fixed_t P_GetPlayerHeight(player_t *player); fixed_t P_GetPlayerSpinHeight(player_t *player); INT32 P_GetPlayerControlDirection(player_t *player); void P_AddPlayerScore(player_t *player, UINT32 amount); +void P_StealPlayerScore(player_t *player, UINT32 amount); void P_ResetCamera(player_t *player, camera_t *thiscam); boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam); void P_SlideCameraMove(camera_t *thiscam); From 175561cc7f34cd8f02162605b00731dc5e55074f Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 5 Oct 2015 17:13:34 +0100 Subject: [PATCH 018/808] Check if God mode is one before even going to NiGHTS or player vs player damaging code or whatever. --- src/p_inter.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 9f29401a0..83d20689e 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2383,8 +2383,7 @@ static inline void P_NiGHTSDamage(mobj_t *target, mobj_t *source) player_t *player = target->player; tic_t oldnightstime = player->nightstime; - if (!player->powers[pw_flashing] - && !(player->pflags & PF_GODMODE)) + if (!player->powers[pw_flashing]) { angle_t fa; @@ -2891,6 +2890,9 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if (player->exiting) return false; + if (player->pflags & PF_GODMODE) + return false; + if (!(target->player->pflags & (PF_NIGHTSMODE|PF_NIGHTSFALL)) && (maptol & TOL_NIGHTS)) return false; @@ -2953,9 +2955,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da return false; } - if (!force && player->pflags & PF_GODMODE) - return false; - // Instant-Death if (damagetype & DMG_DEATHMASK) P_KillPlayer(player, source, damage); From 31b2919847abbc79b33723e0f2495e3ce4aac5ad Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 5 Oct 2015 20:18:45 +0100 Subject: [PATCH 019/808] Added a "damagetype" argument to P_ShieldDamage. We don't use MT_NULL to hack in damage for sector specials anymore, after all. Must have forgotten to do this back when I originally implemented damage types, oh well. --- src/p_inter.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 83d20689e..af8b90040 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2686,7 +2686,7 @@ void P_RemoveShield(player_t *player) player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK; } -static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage) +static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype) { // Must do pain first to set flashing -- P_RemoveShield can cause damage P_DoPlayerPain(player, source, inflictor); @@ -2695,7 +2695,7 @@ static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2); - if (source && (source->type == MT_SPIKE || (source->type == MT_NULL && source->threshold == 43))) // spikes + if ((source && source->type == MT_SPIKE) || damagetype == DMG_SPIKE) // spikes S_StartSound(player->mo, sfx_spkdth); else S_StartSound (player->mo, sfx_shldls); // Ba-Dum! Shield loss. @@ -2971,7 +2971,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da return false; // Metal Sonic walk through flame !! else { // Oh no! Metal Sonic is hit !! - P_ShieldDamage(player, inflictor, source, damage); + P_ShieldDamage(player, inflictor, source, damage, damagetype); return true; } } @@ -2997,7 +2997,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da #endif else if (!player->powers[pw_super] && (player->powers[pw_shield] || player->bot)) //If One-Hit Shield { - P_ShieldDamage(player, inflictor, source, damage); + P_ShieldDamage(player, inflictor, source, damage, damagetype); damage = 0; } else if (player->rings > 0) // No shield but have rings. @@ -3019,7 +3019,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da else { damage = 0; - P_ShieldDamage(player, inflictor, source, damage); + P_ShieldDamage(player, inflictor, source, damage, damagetype); } } From a84c2c6081e1dd0329556da8b04c6b716a7e492f Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 6 Oct 2015 21:14:11 +0100 Subject: [PATCH 020/808] Some cleanup and reordering --- src/p_inter.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index af8b90040..b7f581abb 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2920,7 +2920,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da return false; // Don't hit yourself with your own paraloop, baka if (source && source->player && !cv_friendlyfire.value && (gametype == GT_COOP - || (G_GametypeHasTeams() && target->player->ctfteam == source->player->ctfteam))) + || (G_GametypeHasTeams() && player->ctfteam == source->player->ctfteam))) return false; // Don't run eachother over in special stages and team games and such } #ifdef HAVE_BLUA @@ -2995,7 +2995,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da else if (LUAh_MobjDamage(target, inflictor, source, damage)) return true; #endif - else if (!player->powers[pw_super] && (player->powers[pw_shield] || player->bot)) //If One-Hit Shield + else if (player->powers[pw_shield] || player->bot) //If One-Hit Shield { P_ShieldDamage(player, inflictor, source, damage, damagetype); damage = 0; @@ -3005,22 +3005,19 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da damage = player->rings; P_RingDamage(player, inflictor, source, damage, damagetype); } + // To reduce griefing potential, don't allow players to be killed + // by friendly fire. Spilling their rings and other items is enough. + else if (!force && G_GametypeHasTeams() + && source && source->player && (source->player->ctfteam == player->ctfteam) + && cv_friendlyfire.value) + { + damage = 0; + P_ShieldDamage(player, inflictor, source, damage, damagetype); + } else // No shield, no rings, no invincibility. { - // To reduce griefing potential, don't allow players to be killed - // by friendly fire. Spilling their rings and other items is enough. - if (force || !(G_GametypeHasTeams() - && source && source->player && (source->player->ctfteam == player->ctfteam) - && cv_friendlyfire.value)) - { - damage = 1; - P_KillPlayer(player, source, damage); - } - else - { - damage = 0; - P_ShieldDamage(player, inflictor, source, damage, damagetype); - } + damage = 1; + P_KillPlayer(player, source, damage); } if (damagetype & DMG_DEATHMASK) From d7b402e3c4c63139791ff8b05a760c340001a571 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 6 Oct 2015 22:05:32 +0100 Subject: [PATCH 021/808] More cleanup, most notably dumping ring spilling code in P_RingDamage ...one wonders why P_RingDamage didn't already do that in the first place --- src/p_inter.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index b7f581abb..d5eff8d2a 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2747,6 +2747,10 @@ static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, IN // Ring loss sound plays despite hitting spikes P_PlayRinglossSound(player->mo); // Ringledingle! + P_PlayerRingBurst(player, damage); + player->rings -= damage; + if (player->rings < 0) + player->rings = 0; } /** Damages an object, which may or may not be a player. @@ -2957,7 +2961,10 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da // Instant-Death if (damagetype & DMG_DEATHMASK) + { P_KillPlayer(player, source, damage); + player->rings = 0; + } else if (metalrecording) { if (!inflictor) @@ -3004,6 +3011,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da { damage = player->rings; P_RingDamage(player, inflictor, source, damage, damagetype); + damage = 0; } // To reduce griefing potential, don't allow players to be killed // by friendly fire. Spilling their rings and other items is enough. @@ -3020,20 +3028,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da P_KillPlayer(player, source, damage); } - if (damagetype & DMG_DEATHMASK) - player->rings = 0; - else if (damage == 0 || player->rings) //quickfix to just get things back to normal ...for now (sans Tag, I'll deal with that later) - { - if (damage > 0) // don't spill emeralds/ammo/panels for shield damage - P_PlayerRingBurst(player, damage); - player->rings -= damage; - target->player->powers[pw_flashing] = flashingtics; - damage = 0; - } - - if (player->rings < 0) - player->rings = 0; - P_HitDeathMessages(player, inflictor, source, damagetype); P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2); From 265a607b58103ee11d793e514918226c0eacceb6 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 31 Dec 2015 08:38:23 -0800 Subject: [PATCH 022/808] rewrite of monitors to accomodate repeat use monitors. It's a lot nicer in general, honestly. I think a couple bugs with custom monitors respawning got fixed in the process. Note that a monitorgfx.wad is needed if you want to see things besides s for monitors, due to graphic changes. --- src/dehacked.c | 391 ++++---- src/hardware/hw_light.c | 43 +- src/info.c | 2056 +++++++++++++++++++++++---------------- src/info.h | 436 +++++---- src/p_enemy.c | 313 +++--- src/p_inter.c | 7 +- src/p_local.h | 2 + src/p_map.c | 2 +- src/p_mobj.c | 205 ++-- src/p_user.c | 2 +- src/sounds.c | 1 + src/sounds.h | 1 + 12 files changed, 2009 insertions(+), 1450 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 0ba054f07..d0f582385 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1628,6 +1628,9 @@ static actionpointer_t actionpointers[] = {{A_Pain}, "A_PAIN"}, {{A_Fall}, "A_FALL"}, {{A_MonitorPop}, "A_MONITORPOP"}, + {{A_BigMonitorPop}, "A_BIGMONITORPOP"}, + {{A_BigMonitorRestore}, "A_BIGMONITORRESTORE"}, + {{A_BigMonitorSparkle}, "A_BIGMONITORSPARKLE"}, {{A_Look}, "A_LOOK"}, {{A_Chase}, "A_CHASE"}, {{A_FaceStabChase}, "A_FACESTABCHASE"}, @@ -4855,170 +4858,169 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_CANNONLAUNCHER2", "S_CANNONLAUNCHER3", - // Super Ring Box - "S_SUPERRINGBOX", - "S_SUPERRINGBOX1", - "S_SUPERRINGBOX2", - "S_SUPERRINGBOX3", - "S_SUPERRINGBOX4", - "S_SUPERRINGBOX5", - "S_SUPERRINGBOX6", + // Monitor Miscellany + "S_BOXSPARKLE1", + "S_BOXSPARKLE2", + "S_BOXSPARKLE3", - // Red Team Ring Box - "S_REDRINGBOX", - "S_REDRINGBOX1", + "S_BOX_FLICKER", + "S_BOX_POP1", + "S_BOX_POP2", - // Blue Team Ring Box - "S_BLUERINGBOX", - "S_BLUERINGBOX1", + "S_BIGBOX_FLICKER", + "S_BIGBOX_OFF1", + "S_BIGBOX_OFF2", + "S_BIGBOX_OFF3", + "S_BIGBOX_OFF4", + "S_BIGBOX_OFF5", + "S_BIGBOX_OFF6", + "S_BIGBOX_OFF7", - // Super Sneakers Box - "S_SHTV", - "S_SHTV1", - "S_SHTV2", - "S_SHTV3", - "S_SHTV4", - "S_SHTV5", - "S_SHTV6", + // Monitor States (one per box) + "S_MYSTERY_BOX", + "S_RING_BOX", + "S_PITY_BOX", + "S_ATTRACT_BOX", + "S_FORCE_BOX", + "S_ARMAGEDDON_BOX", + "S_WHIRLWIND_BOX", + "S_ELEMENTAL_BOX", + "S_SNEAKERS_BOX", + "S_INVULN_BOX", + "S_1UP_BOX", + "S_EGGMAN_BOX", + "S_MIXUP_BOX", + "S_GRAVITY_BOX", + "S_RECYCLER_BOX", + "S_SCORE1K_BOX", + "S_SCORE10K_BOX", - // Invincibility Box - "S_PINV", - "S_PINV1", - "S_PINV2", - "S_PINV3", - "S_PINV4", - "S_PINV5", - "S_PINV6", + // Repeat Monitor States (one per box) + "S_MYSTERY_BIGBOX", + "S_RING_BIGBOX", + "S_PITY_BIGBOX", + "S_ATTRACT_BIGBOX", + "S_FORCE_BIGBOX", + "S_ARMAGEDDON_BIGBOX", + "S_WHIRLWIND_BIGBOX", + "S_ELEMENTAL_BIGBOX", + "S_SNEAKERS_BIGBOX", + "S_INVULN_BIGBOX", + "S_1UP_BIGBOX", + "S_EGGMAN_BIGBOX", + "S_MIXUP_BIGBOX", + "S_GRAVITY_BIGBOX", + "S_RECYCLER_BIGBOX", + "S_SCORE1K_BIGBOX", + "S_SCORE10K_BIGBOX", - // 1-Up Box - "S_PRUP", - "S_PRUP1", - "S_PRUP2", - "S_PRUP3", - "S_PRUP4", - "S_PRUP5", - "S_PRUP6", + // Team Ring Boxes (these are special) + "S_RING_REDBOX1", + "S_RING_REDBOX2", + "S_REDBOX_POP1", + "S_REDBOX_POP2", - // Ring Shield Box - "S_YLTV", - "S_YLTV1", - "S_YLTV2", - "S_YLTV3", - "S_YLTV4", - "S_YLTV5", - "S_YLTV6", + "S_RING_BLUEBOX1", + "S_RING_BLUEBOX2", + "S_BLUEBOX_POP1", + "S_BLUEBOX_POP2", - // Force Shield Box - "S_BLTV1", - "S_BLTV2", - "S_BLTV3", - "S_BLTV4", - "S_BLTV5", - "S_BLTV6", - "S_BLTV7", + // Box Icons -- 5 states each, one for each part of the twirl + "S_RING_ICON1", + "S_RING_ICON2", + "S_RING_ICON3", + "S_RING_ICON4", + "S_RING_ICON5", - // Bomb Shield Box - "S_BKTV1", - "S_BKTV2", - "S_BKTV3", - "S_BKTV4", - "S_BKTV5", - "S_BKTV6", - "S_BKTV7", + "S_PITY_ICON1", + "S_PITY_ICON2", + "S_PITY_ICON3", + "S_PITY_ICON4", + "S_PITY_ICON5", - // Jump Shield Box - "S_WHTV1", - "S_WHTV2", - "S_WHTV3", - "S_WHTV4", - "S_WHTV5", - "S_WHTV6", - "S_WHTV7", + "S_ATTRACT_ICON1", + "S_ATTRACT_ICON2", + "S_ATTRACT_ICON3", + "S_ATTRACT_ICON4", + "S_ATTRACT_ICON5", - // Water Shield Box - "S_GRTV", - "S_GRTV1", - "S_GRTV2", - "S_GRTV3", - "S_GRTV4", - "S_GRTV5", - "S_GRTV6", + "S_FORCE_ICON1", + "S_FORCE_ICON2", + "S_FORCE_ICON3", + "S_FORCE_ICON4", + "S_FORCE_ICON5", - // Pity Shield Box - "S_PITV1", - "S_PITV2", - "S_PITV3", - "S_PITV4", - "S_PITV5", - "S_PITV6", - "S_PITV7", + "S_ARMAGEDDON_ICON1", + "S_ARMAGEDDON_ICON2", + "S_ARMAGEDDON_ICON3", + "S_ARMAGEDDON_ICON4", + "S_ARMAGEDDON_ICON5", - // Eggman Box - "S_EGGTV1", - "S_EGGTV2", - "S_EGGTV3", - "S_EGGTV4", - "S_EGGTV5", - "S_EGGTV6", - "S_EGGTV7", + "S_WHIRLWIND_ICON1", + "S_WHIRLWIND_ICON2", + "S_WHIRLWIND_ICON3", + "S_WHIRLWIND_ICON4", + "S_WHIRLWIND_ICON5", - // Teleport Box - "S_MIXUPBOX1", - "S_MIXUPBOX2", - "S_MIXUPBOX3", - "S_MIXUPBOX4", - "S_MIXUPBOX5", - "S_MIXUPBOX6", - "S_MIXUPBOX7", + "S_ELEMENTAL_ICON1", + "S_ELEMENTAL_ICON2", + "S_ELEMENTAL_ICON3", + "S_ELEMENTAL_ICON4", + "S_ELEMENTAL_ICON5", - // Recycler Box - "S_RECYCLETV1", - "S_RECYCLETV2", - "S_RECYCLETV3", - "S_RECYCLETV4", - "S_RECYCLETV5", - "S_RECYCLETV6", - "S_RECYCLETV7", + "S_SNEAKERS_ICON1", + "S_SNEAKERS_ICON2", + "S_SNEAKERS_ICON3", + "S_SNEAKERS_ICON4", + "S_SNEAKERS_ICON5", - // Question Box - "S_RANDOMBOX1", - "S_RANDOMBOX2", - "S_RANDOMBOX3", + "S_INVULN_ICON1", + "S_INVULN_ICON2", + "S_INVULN_ICON3", + "S_INVULN_ICON4", + "S_INVULN_ICON5", - // Gravity Boots Box - "S_GBTV1", - "S_GBTV2", - "S_GBTV3", - "S_GBTV4", - "S_GBTV5", - "S_GBTV6", - "S_GBTV7", + "S_1UP_ICON1", + "S_1UP_ICON2", + "S_1UP_ICON3", + "S_1UP_ICON4", + "S_1UP_ICON5", - // Score boxes - "S_SCORETVA1", - "S_SCORETVA2", - "S_SCORETVA3", - "S_SCORETVA4", - "S_SCORETVA5", - "S_SCORETVA6", - "S_SCORETVA7", - "S_SCORETVB1", - "S_SCORETVB2", - "S_SCORETVB3", - "S_SCORETVB4", - "S_SCORETVB5", - "S_SCORETVB6", - "S_SCORETVB7", + "S_EGGMAN_ICON1", + "S_EGGMAN_ICON2", + "S_EGGMAN_ICON3", + "S_EGGMAN_ICON4", + "S_EGGMAN_ICON5", - // Monitor Explosion - "S_MONITOREXPLOSION1", - "S_MONITOREXPLOSION2", + "S_MIXUP_ICON1", + "S_MIXUP_ICON2", + "S_MIXUP_ICON3", + "S_MIXUP_ICON4", + "S_MIXUP_ICON5", - "S_REDMONITOREXPLOSION1", - "S_REDMONITOREXPLOSION2", + "S_GRAVITY_ICON1", + "S_GRAVITY_ICON2", + "S_GRAVITY_ICON3", + "S_GRAVITY_ICON4", + "S_GRAVITY_ICON5", - "S_BLUEMONITOREXPLOSION1", - "S_BLUEMONITOREXPLOSION2", + "S_RECYCLER_ICON1", + "S_RECYCLER_ICON2", + "S_RECYCLER_ICON3", + "S_RECYCLER_ICON4", + "S_RECYCLER_ICON5", + + "S_SCORE1K_ICON1", + "S_SCORE1K_ICON2", + "S_SCORE1K_ICON3", + "S_SCORE1K_ICON4", + "S_SCORE1K_ICON5", + + "S_SCORE10K_ICON1", + "S_SCORE10K_ICON2", + "S_SCORE10K_ICON3", + "S_SCORE10K_ICON4", + "S_SCORE10K_ICON5", "S_ROCKET", @@ -6760,47 +6762,68 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_BIGAIRMINE", "MT_CANNONLAUNCHER", - // Monitor Boxes - "MT_SUPERRINGBOX", - "MT_REDRINGBOX", - "MT_BLUERINGBOX", - "MT_SNEAKERTV", - "MT_INV", - "MT_PRUP", // 1up Box - "MT_YELLOWTV", // Attract shield TV - "MT_BLUETV", // Force shield TV - "MT_BLACKTV", // Bomb shield TV - "MT_WHITETV", // Jump shield TV - "MT_GREENTV", // Elemental shield TV - "MT_PITYTV", // Pity shield TV - "MT_EGGMANBOX", - "MT_MIXUPBOX", - "MT_RECYCLETV", - "MT_RECYCLEICO", - "MT_QUESTIONBOX", - "MT_GRAVITYBOX", - "MT_SCORETVSMALL", - "MT_SCORETVLARGE", - // Monitor miscellany - "MT_MONITOREXPLOSION", - "MT_REDMONITOREXPLOSION", - "MT_BLUEMONITOREXPLOSION", - "MT_RINGICO", - "MT_SHOESICO", - "MT_INVCICO", - "MT_1UPICO", - "MT_YSHIELDICO", - "MT_BSHIELDICO", - "MT_KSHIELDICO", - "MT_WSHIELDICO", - "MT_GSHIELDICO", - "MT_PITYSHIELDICO", - "MT_EGGMANICO", - "MT_MIXUPICO", - "MT_GRAVITYICO", - "MT_SCOREICOSMALL", - "MT_SCOREICOLARGE", + "MT_BOXSPARKLE", + + // Monitor boxes -- regular + "MT_RING_BOX", + "MT_PITY_BOX", + "MT_ATTRACT_BOX", + "MT_FORCE_BOX", + "MT_ARMAGEDDON_BOX", + "MT_WHIRLWIND_BOX", + "MT_ELEMENTAL_BOX", + "MT_SNEAKERS_BOX", + "MT_INVULN_BOX", + "MT_1UP_BOX", + "MT_EGGMAN_BOX", + "MT_MIXUP_BOX", + "MT_MYSTERY_BOX", + "MT_GRAVITY_BOX", + "MT_RECYCLER_BOX", + "MT_SCORE1K_BOX", + "MT_SCORE10K_BOX", + + // Monitor boxes -- repeating (big) boxes + "MT_RING_BIGBOX", + "MT_PITY_BIGBOX", + "MT_ATTRACT_BIGBOX", + "MT_FORCE_BIGBOX", + "MT_ARMAGEDDON_BIGBOX", + "MT_WHIRLWIND_BIGBOX", + "MT_ELEMENTAL_BIGBOX", + "MT_SNEAKERS_BIGBOX", + "MT_INVULN_BIGBOX", + "MT_1UP_BIGBOX", + "MT_EGGMAN_BIGBOX", + "MT_MIXUP_BIGBOX", + "MT_MYSTERY_BIGBOX", + "MT_GRAVITY_BIGBOX", + "MT_RECYCLER_BIGBOX", + "MT_SCORE1K_BIGBOX", + "MT_SCORE10K_BIGBOX", + + // Monitor boxes -- special + "MT_RING_REDBOX", + "MT_RING_BLUEBOX", + + // Monitor icons + "MT_RING_ICON", + "MT_PITY_ICON", + "MT_ATTRACT_ICON", + "MT_FORCE_ICON", + "MT_ARMAGEDDON_ICON", + "MT_WHIRLWIND_ICON", + "MT_ELEMENTAL_ICON", + "MT_SNEAKERS_ICON", + "MT_INVULN_ICON", + "MT_1UP_ICON", + "MT_EGGMAN_ICON", + "MT_MIXUP_ICON", + "MT_GRAVITY_ICON", + "MT_RECYCLER_ICON", + "MT_SCORE1K_ICON", + "MT_SCORE10K_ICON", // Projectiles "MT_ROCKET", diff --git a/src/hardware/hw_light.c b/src/hardware/hw_light.c index fb369387f..094495f91 100644 --- a/src/hardware/hw_light.c +++ b/src/hardware/hw_light.c @@ -247,27 +247,30 @@ light_t *t_lspr[NUMSPRITES] = &lspr[NOLIGHT], // SPR_BMNE // Monitor Boxes - &lspr[NOLIGHT], // SPR_SRBX - &lspr[NOLIGHT], // SPR_RRBX - &lspr[NOLIGHT], // SPR_BRBX - &lspr[NOLIGHT], // SPR_SHTV - &lspr[NOLIGHT], // SPR_PINV - &lspr[NOLIGHT], // SPR_YLTV - &lspr[NOLIGHT], // SPR_BLTV - &lspr[NOLIGHT], // SPR_BKTV - &lspr[NOLIGHT], // SPR_WHTV - &lspr[NOLIGHT], // SPR_GRTV - &lspr[NOLIGHT], // SPR_ELTV - &lspr[NOLIGHT], // SPR_EGGB - &lspr[NOLIGHT], // SPR_MIXU - &lspr[NOLIGHT], // SPR_RECY - &lspr[NOLIGHT], // SPR_QUES - &lspr[NOLIGHT], // SPR_GBTV - &lspr[NOLIGHT], // SPR_PRUP - &lspr[NOLIGHT], // SPR_PTTV + &lspr[NOLIGHT], // SPR_MSTV + &lspr[NOLIGHT], // SPR_XLTV - // Monitor Miscellany - &lspr[NOLIGHT], // SPR_MTEX + &lspr[NOLIGHT], // SPR_TRRI + &lspr[NOLIGHT], // SPR_TBRI + + &lspr[NOLIGHT], // SPR_TVRI + &lspr[NOLIGHT], // SPR_TVPI + &lspr[NOLIGHT], // SPR_TVAT + &lspr[NOLIGHT], // SPR_TVFO + &lspr[NOLIGHT], // SPR_TVAR + &lspr[NOLIGHT], // SPR_TVWW + &lspr[NOLIGHT], // SPR_TVEL + &lspr[NOLIGHT], // SPR_TVSS + &lspr[NOLIGHT], // SPR_TVIV + &lspr[NOLIGHT], // SPR_TV1U + &lspr[NOLIGHT], // SPR_TV1P + &lspr[NOLIGHT], // SPR_TVEG + &lspr[NOLIGHT], // SPR_TVMX + &lspr[NOLIGHT], // SPR_TVMY + &lspr[NOLIGHT], // SPR_TVGV + &lspr[NOLIGHT], // SPR_TVRC + &lspr[NOLIGHT], // SPR_TV1K + &lspr[NOLIGHT], // SPR_TVTK // Projectiles &lspr[NOLIGHT], // SPR_MISL diff --git a/src/info.c b/src/info.c index 8d7c249ad..d00ecc5dc 100644 --- a/src/info.c +++ b/src/info.c @@ -34,26 +34,26 @@ char sprnames[NUMSPRITES + 1][5] = "FAKE","EGGP","EFIR","EGGQ","EGGR","BRAK","BGOO","BMSL","EGGT","RCKT", "ELEC","TARG","NPLM","MNPL","METL","MSCF","MSCB","RING","TRNG","EMMY", "TOKE","RFLG","BFLG","NWNG","EMBM","CEMG","EMER","FANS","BUBL","SIGN", - "STEM","SPIK","SFLM","USPK","STPT","BMNE","SRBX","RRBX","BRBX","SHTV", - "PINV","YLTV","BLTV","BKTV","WHTV","GRTV","ELTV","EGGB","MIXU","RECY", - "QUES","GBTV","PRUP","PTTV","MTEX","MISL","TORP","ENRG","MINE","JBUL", - "TRLS","CBLL","AROW","CFIR","FWR1","FWR2","FWR3","FWR4","BUS1","BUS2", - "THZP","ALRM","GARG","SEWE","DRIP","CRL1","CRL2","CRL3","BCRY","CHAN", - "FLAM","ESTA","SMCH","BMCH","SMCE","BMCE","BTBL","STBL","CACT","FLME", - "DFLM","XMS1","XMS2","XMS3","BSZ1","BSZ2","BSZ3","BSZ4","BSZ5","BSZ6", - "BSZ7","BSZ8","STLG","DBAL","RCRY","ARMA","ARMF","ARMB","WIND","MAGN", - "ELEM","FORC","PITY","IVSP","SSPK","GOAL","BIRD","BUNY","MOUS","CHIC", - "COWZ","RBRD","SPRY","SPRR","SPRB","YSPR","RSPR","RAIN","SNO1","SPLH", - "SPLA","SMOK","BUBP","BUBO","BUBN","BUBM","POPP","TFOG","SEED","PRTL", - "SCOR","DRWN","TTAG","GFLG","RRNG","RNGB","RNGR","RNGI","RNGA","RNGE", - "RNGS","RNGG","PIKB","PIKR","PIKA","PIKE","PIKS","PIKG","TAUT","TGRE", - "TSCR","COIN","CPRK","GOOM","BGOM","FFWR","FBLL","SHLL","PUMA","HAMM", - "KOOP","BFLM","MAXE","MUS1","MUS2","TOAD","NDRN","SUPE","SUPZ","NDRL", - "NSPK","NBMP","HOOP","NSCR","NPRU","CAPS","SUPT","SPRK","BOM1","BOM2", - "BOM3","BOM4","ROIA","ROIB","ROIC","ROID","ROIE","ROIF","ROIG","ROIH", - "ROII","ROIJ","ROIK","ROIL","ROIM","ROIN","ROIO","ROIP","BBAL","GWLG", - "GWLR","SRBA","SRBB","SRBC","SRBD","SRBE","SRBF","SRBG","SRBH","SRBI", - "SRBJ","SRBK","SRBL","SRBM","SRBN","SRBO", + "STEM","SPIK","SFLM","USPK","STPT","BMNE","MSTV","XLTV","TRRI","TBRI", + "TVRI","TVPI","TVAT","TVFO","TVAR","TVWW","TVEL","TVSS","TVIV","TV1U", + "TV1P","TVEG","TVMX","TVMY","TVGV","TVRC","TV1K","TVTK","MISL","TORP", + "ENRG","MINE","JBUL","TRLS","CBLL","AROW","CFIR","FWR1","FWR2","FWR3", + "FWR4","BUS1","BUS2","THZP","ALRM","GARG","SEWE","DRIP","CRL1","CRL2", + "CRL3","BCRY","CHAN","FLAM","ESTA","SMCH","BMCH","SMCE","BMCE","BTBL", + "STBL","CACT","FLME","DFLM","XMS1","XMS2","XMS3","BSZ1","BSZ2","BSZ3", + "BSZ4","BSZ5","BSZ6","BSZ7","BSZ8","STLG","DBAL","RCRY","ARMA","ARMF", + "ARMB","WIND","MAGN","ELEM","FORC","PITY","IVSP","SSPK","GOAL","BIRD", + "BUNY","MOUS","CHIC","COWZ","RBRD","SPRY","SPRR","SPRB","YSPR","RSPR", + "RAIN","SNO1","SPLH","SPLA","SMOK","BUBP","BUBO","BUBN","BUBM","POPP", + "TFOG","SEED","PRTL","SCOR","DRWN","TTAG","GFLG","RRNG","RNGB","RNGR", + "RNGI","RNGA","RNGE","RNGS","RNGG","PIKB","PIKR","PIKA","PIKE","PIKS", + "PIKG","TAUT","TGRE","TSCR","COIN","CPRK","GOOM","BGOM","FFWR","FBLL", + "SHLL","PUMA","HAMM","KOOP","BFLM","MAXE","MUS1","MUS2","TOAD","NDRN", + "SUPE","SUPZ","NDRL","NSPK","NBMP","HOOP","NSCR","NPRU","CAPS","SUPT", + "SPRK","BOM1","BOM2","BOM3","BOM4","ROIA","ROIB","ROIC","ROID","ROIE", + "ROIF","ROIG","ROIH","ROII","ROIJ","ROIK","ROIL","ROIM","ROIN","ROIO", + "ROIP","BBAL","GWLG","GWLR","SRBA","SRBB","SRBC","SRBD","SRBE","SRBF", + "SRBG","SRBH","SRBI","SRBJ","SRBK","SRBL","SRBM","SRBN","SRBO", }; char spr2names[NUMPLAYERSPRITES][5] = @@ -1239,172 +1239,171 @@ state_t states[NUMSTATES] = {SPR_NULL, 0, 1, {A_LobShot}, MT_CANNONBALL, 4*TICRATE, S_CANNONLAUNCHER3}, // S_CANNONLAUNCHER2 {SPR_NULL, 0, 2, {A_SetRandomTics}, TICRATE/2, 3*TICRATE, S_CANNONLAUNCHER1}, // S_CANNONLAUNCHER3 - // Super Ring Box - {SPR_SRBX, 0, 2, {NULL}, 0, 0, S_SUPERRINGBOX1}, // S_SUPERRINGBOX - {SPR_MTEX, 0, 1, {NULL}, 0, 0, S_SUPERRINGBOX}, // S_SUPERRINGBOX1 - {SPR_SRBX, 1, 4, {A_MonitorPop}, 0, 0, S_SUPERRINGBOX3}, // S_SUPERRINGBOX2 - {SPR_YLTV, 2, 4, {NULL}, 0, 0, S_SUPERRINGBOX4}, // S_SUPERRINGBOX3 - {SPR_YLTV, 3, 4, {NULL}, 0, 0, S_SUPERRINGBOX5}, // S_SUPERRINGBOX4 - {SPR_YLTV, 4, 4, {NULL}, 0, 0, S_SUPERRINGBOX6}, // S_SUPERRINGBOX5 - {SPR_SRBX, 1, 18, {A_RingBox}, 0, 0, S_NULL}, // S_SUPERRINGBOX6 + // Monitor Miscellany + {SPR_NSPK, FF_TRANS40, 20, {NULL}, 0, 0, S_BOXSPARKLE2}, // S_BOXSPARKLE1 + {SPR_NSPK, FF_TRANS60, 10, {NULL}, 0, 0, S_BOXSPARKLE3}, // S_BOXSPARKLE2 + {SPR_NSPK, FF_TRANS80, 5, {NULL}, 0, 0, S_NULL}, // S_BOXSPARKLE3 - // Red Team Ring Box - {SPR_RRBX, 0, 2, {NULL}, 0, 0, S_REDRINGBOX1}, // S_REDRINGBOX - {SPR_RRBX, 1, 1, {NULL}, 0, 0, S_REDRINGBOX}, // S_REDRINGBOX1 + {SPR_MSTV, 0, 1, {NULL}, 0, 0, S_SPAWNSTATE}, // S_BOX_FLICKER + {SPR_MSTV, 0, 4, {A_MonitorPop}, 0, 0, S_BOX_POP2}, // S_BOX_POP1 + {SPR_MSTV, 1, -1, {NULL}, 0, 0, S_NULL}, // S_BOX_POP2 - // Blue Team Ring Box - {SPR_BRBX, 0, 2, {NULL}, 0, 0, S_BLUERINGBOX1}, // S_BLUERINGBOX - {SPR_BRBX, 1, 1, {NULL}, 0, 0, S_BLUERINGBOX}, // S_BLUERINGBOX1 + {SPR_XLTV, 0, 1, {NULL}, 0, 0, S_SPAWNSTATE}, // S_BIGBOX_FLICKER + {SPR_XLTV, 1, 89, {A_BigMonitorPop}, 0, 0, S_BIGBOX_OFF2}, // S_BIGBOX_OFF1 + {SPR_XLTV, 2, 4, {A_PlayAttackSound}, 0, 0, S_BIGBOX_OFF3}, // S_BIGBOX_OFF2 + {SPR_XLTV, 3, 4, {NULL}, 0, 0, S_BIGBOX_OFF4}, // S_BIGBOX_OFF3 + {SPR_XLTV, 4, 4, {NULL}, 0, 0, S_BIGBOX_OFF5}, // S_BIGBOX_OFF4 + {SPR_XLTV, 5, 2, {NULL}, 0, 0, S_BIGBOX_OFF6}, // S_BIGBOX_OFF5 + {SPR_XLTV, 6, 2, {NULL}, 0, 0, S_BIGBOX_OFF7}, // S_BIGBOX_OFF6 + {SPR_XLTV, 6, 0, {A_BigMonitorRestore}, 0, 0, S_SPAWNSTATE}, // S_BIGBOX_OFF7 - // Super Sneakers Box - {SPR_SHTV, 0, 2, {NULL}, 0, 0, S_SHTV1}, // S_SHTV - {SPR_MTEX, 0, 1, {NULL}, 0, 0, S_SHTV}, // S_SHTV1 - {SPR_SHTV, 1, 4, {A_MonitorPop}, 0, 0, S_SHTV3}, // S_SHTV2 - {SPR_YLTV, 2, 4, {NULL}, 0, 0, S_SHTV4}, // S_SHTV3 - {SPR_YLTV, 3, 4, {NULL}, 0, 0, S_SHTV5}, // S_SHTV4 - {SPR_YLTV, 4, 4, {NULL}, 0, 0, S_SHTV6}, // S_SHTV5 - {SPR_SHTV, 1, 18, {A_SuperSneakers}, 0, 0, S_NULL}, // S_SHTV6 + // Monitor States (one per box) + {SPR_TVMY, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_MYSTERY_BOX + {SPR_TVRI, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_RING_BOX + {SPR_TVPI, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_PITY_BOX + {SPR_TVAT, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_ATTRACT_BOX + {SPR_TVFO, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_FORCE_BOX + {SPR_TVAR, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_ARMAGEDDON_BOX + {SPR_TVWW, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_WHIRLWIND_BOX + {SPR_TVEL, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_ELEMENTAL_BOX + {SPR_TVSS, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_SNEAKERS_BOX + {SPR_TVIV, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_INVULN_BOX + {SPR_TV1P, 0, 2, {A_1upThinker}, 0, 0, S_BOX_FLICKER}, // S_1UP_BOX + {SPR_TVEG, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_EGGMAN_BOX + {SPR_TVMX, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_MIXUP_BOX + {SPR_TVGV, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_GRAVITY_BOX + {SPR_TVRC, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_RECYCLER_BOX + {SPR_TV1K, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_SCORE1K_BOX + {SPR_TVTK, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_SCORE10K_BOX - // Invincibility Box - {SPR_PINV, 0, 2, {NULL}, 0, 0, S_PINV1}, // S_PINV - {SPR_MTEX, 0, 1, {NULL}, 0, 0, S_PINV}, // S_PINV1 - {SPR_PINV, 1, 4, {A_MonitorPop}, 0, 0, S_PINV3}, // S_PINV2 - {SPR_PINV, 2, 4, {NULL}, 0, 0, S_PINV4}, // S_PINV3 - {SPR_PINV, 3, 4, {NULL}, 0, 0, S_PINV5}, // S_PINV4 - {SPR_PINV, 4, 4, {NULL}, 0, 0, S_PINV6}, // S_PINV5 - {SPR_PINV, 1, 18, {A_Invincibility}, 0, 0, S_NULL}, // S_PINV6 + // Repeat Monitor States (one per box) + {SPR_TVMY, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_MYSTERY_BIGBOX + {SPR_TVRI, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_RING_BIGBOX + {SPR_TVPI, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_PITY_BIGBOX + {SPR_TVAT, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_ATTRACT_BIGBOX + {SPR_TVFO, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_FORCE_BIGBOX + {SPR_TVAR, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_ARMAGEDDON_BIGBOX + {SPR_TVWW, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_WHIRLWIND_BIGBOX + {SPR_TVEL, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_ELEMENTAL_BIGBOX + {SPR_TVSS, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_SNEAKERS_BIGBOX + {SPR_TVIV, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_INVULN_BIGBOX + {SPR_TV1P, 1, 2, {A_DualAction}, S_MYSTERY_BIGBOX, S_1UP_BOX, S_BIGBOX_FLICKER}, // S_1UP_BIGBOX + {SPR_TVEG, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_EGGMAN_BIGBOX + {SPR_TVMX, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_MIXUP_BIGBOX + {SPR_TVGV, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_GRAVITY_BIGBOX + {SPR_TVRC, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_RECYCLER_BIGBOX + {SPR_TV1K, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_SCORE1K_BIGBOX + {SPR_TVTK, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_SCORE10K_BIGBOX - // 1up Box - {SPR_PRUP, 2, 2, {A_1upThinker}, 0, 0, S_PRUP1}, // S_PRUP - {SPR_MTEX, 0, 1, {NULL}, 0, 0, S_PRUP}, // S_PRUP1 - {SPR_PRUP, 3, 4, {A_MonitorPop}, 0, 0, S_PRUP3}, // S_PRUP2 - {SPR_PINV, 2, 4, {NULL}, 0, 0, S_PRUP4}, // S_PRUP3 - {SPR_PINV, 3, 4, {NULL}, 0, 0, S_PRUP5}, // S_PRUP4 - {SPR_PINV, 4, 4, {NULL}, 0, 0, S_PRUP6}, // S_PRUP5 - {SPR_PRUP, 3, 18, {A_ExtraLife}, 0, 0, S_NULL}, // S_PRUP6 + // Team Ring Boxes (these are special) + {SPR_TRRI, 0, 2, {NULL}, 0, 0, S_RING_REDBOX2}, // S_RING_REDBOX1 + {SPR_TRRI, 1, 1, {NULL}, 0, 0, S_RING_REDBOX1}, // S_RING_REDBOX2 + {SPR_TRRI, 1, 4, {A_MonitorPop}, 0, 0, S_REDBOX_POP2}, // S_REDBOX_POP1 + {SPR_TRRI, 2, -1, {NULL}, 0, 0, S_NULL}, // S_REDBOX_POP2 - // Ring Shield Box - {SPR_YLTV, 0, 2, {NULL}, 0, 0, S_YLTV1}, // S_YLTV - {SPR_MTEX, 0, 1, {NULL}, 0, 0, S_YLTV}, // S_YLTV1 - {SPR_YLTV, 1, 4, {A_MonitorPop}, 0, 0, S_YLTV3}, // S_YLTV2 - {SPR_YLTV, 2, 4, {NULL}, 0, 0, S_YLTV4}, // S_YLTV3 - {SPR_YLTV, 3, 4, {NULL}, 0, 0, S_YLTV5}, // S_YLTV4 - {SPR_YLTV, 4, 4, {NULL}, 0, 0, S_YLTV6}, // S_YLTV5 - {SPR_YLTV, 1, 18, {A_RingShield},0, 0, S_NULL}, // S_YLTV6 + {SPR_TBRI, 0, 2, {NULL}, 0, 0, S_RING_BLUEBOX2}, // S_RING_BLUEBOX1 + {SPR_TBRI, 1, 1, {NULL}, 0, 0, S_RING_BLUEBOX1}, // S_RING_BLUEBOX2 + {SPR_TBRI, 1, 4, {A_MonitorPop}, 0, 0, S_BLUEBOX_POP2}, // S_BLUEBOX_POP1 + {SPR_TBRI, 2, -1, {NULL}, 0, 0, S_NULL}, // S_BLUEBOX_POP2 - // Force Shield Box - {SPR_BLTV, 0, 2, {NULL}, 0, 0, S_BLTV2}, // S_BLTV1 - {SPR_MTEX, 0, 1, {NULL}, 0, 0, S_BLTV1}, // S_BLTV2 - {SPR_BLTV, 1, 4, {A_MonitorPop}, 0, 0, S_BLTV4}, // S_BLTV3 - {SPR_BLTV, 2, 4, {NULL}, 0, 0, S_BLTV5}, // S_BLTV4 - {SPR_BLTV, 3, 4, {NULL}, 0, 0, S_BLTV6}, // S_BLTV5 - {SPR_BLTV, 4, 4, {NULL}, 0, 0, S_BLTV7}, // S_BLTV6 - {SPR_BLTV, 1, 18, {A_ForceShield}, 0, 0, S_NULL}, // S_BLTV7 + // Box Icons -- 5 states each, one for each part of the twirl + {SPR_TVRI, 2, 4, {NULL}, 0, 0, S_RING_ICON2}, // S_RING_ICON1 + {SPR_TVRI, 3, 4, {NULL}, 0, 0, S_RING_ICON3}, // S_RING_ICON2 + {SPR_TVRI, 4, 4, {NULL}, 0, 0, S_RING_ICON4}, // S_RING_ICON3 + {SPR_TVRI, 5, 4, {NULL}, 0, 0, S_RING_ICON5}, // S_RING_ICON4 + {SPR_TVRI, 2, 18, {A_RingBox}, 0, 0, S_NULL}, // S_RING_ICON5 - // Bomb Shield Box - {SPR_BKTV, 0, 2, {NULL}, 0, 0, S_BKTV2}, // S_BKTV1 - {SPR_MTEX, 0, 1, {NULL}, 0, 0, S_BKTV1}, // S_BKTV2 - {SPR_BKTV, 1, 4, {A_MonitorPop}, 0, 0, S_BKTV4}, // S_BKTV3 - {SPR_BKTV, 2, 4, {NULL}, 0, 0, S_BKTV5}, // S_BKTV4 - {SPR_BKTV, 3, 4, {NULL}, 0, 0, S_BKTV6}, // S_BKTV5 - {SPR_BKTV, 4, 4, {NULL}, 0, 0, S_BKTV7}, // S_BKTV6 - {SPR_BKTV, 1, 18, {A_BombShield}, 0, 0, S_NULL}, // S_BKTV7 + {SPR_TVPI, 2, 4, {NULL}, 0, 0, S_PITY_ICON2}, // S_PITY_ICON1 + {SPR_TVPI, 3, 4, {NULL}, 0, 0, S_PITY_ICON3}, // S_PITY_ICON2 + {SPR_TVPI, 4, 4, {NULL}, 0, 0, S_PITY_ICON4}, // S_PITY_ICON3 + {SPR_TVPI, 5, 4, {NULL}, 0, 0, S_PITY_ICON5}, // S_PITY_ICON4 + {SPR_TVPI, 2, 18, {A_PityShield}, 0, 0, S_NULL}, // S_PITY_ICON5 - // Jump Shield Box - {SPR_WHTV, 0, 2, {NULL}, 0, 0, S_WHTV2}, // S_WHTV1 - {SPR_MTEX, 0, 1, {NULL}, 0, 0, S_WHTV1}, // S_WHTV2 - {SPR_WHTV, 1, 4, {A_MonitorPop}, 0, 0, S_WHTV4}, // S_WHTV3 - {SPR_WHTV, 2, 4, {NULL}, 0, 0, S_WHTV5}, // S_WHTV4 - {SPR_WHTV, 3, 4, {NULL}, 0, 0, S_WHTV6}, // S_WHTV5 - {SPR_WHTV, 4, 4, {NULL}, 0, 0, S_WHTV7}, // S_WHTV6 - {SPR_WHTV, 1, 18, {A_JumpShield}, 0, 0, S_NULL}, // S_WHTV7 + {SPR_TVAT, 2, 4, {NULL}, 0, 0, S_ATTRACT_ICON2}, // S_ATTRACT_ICON1 + {SPR_TVAT, 3, 4, {NULL}, 0, 0, S_ATTRACT_ICON3}, // S_ATTRACT_ICON2 + {SPR_TVAT, 4, 4, {NULL}, 0, 0, S_ATTRACT_ICON4}, // S_ATTRACT_ICON3 + {SPR_TVAT, 5, 4, {NULL}, 0, 0, S_ATTRACT_ICON5}, // S_ATTRACT_ICON4 + {SPR_TVAT, 2, 18, {A_RingShield},0, 0, S_NULL}, // S_ATTRACT_ICON5 - // Elemental Shield Box - {SPR_ELTV, 0, 2, {NULL}, 0, 0, S_GRTV1}, // S_GRTV - {SPR_MTEX, 0, 1, {NULL}, 0, 0, S_GRTV}, // S_GRTV1 - {SPR_ELTV, 1, 4, {A_MonitorPop}, 0, 0, S_GRTV3}, // S_GRTV2 - {SPR_ELTV, 2, 4, {NULL}, 0, 0, S_GRTV4}, // S_GRTV3 - {SPR_ELTV, 3, 4, {NULL}, 0, 0, S_GRTV5}, // S_GRTV4 - {SPR_ELTV, 4, 4, {NULL}, 0, 0, S_GRTV6}, // S_GRTV5 - {SPR_ELTV, 1, 18, {A_WaterShield}, 0, 0, S_NULL}, // S_GRTV6 + {SPR_TVFO, 2, 4, {NULL}, 0, 0, S_FORCE_ICON2}, // S_FORCE_ICON1 + {SPR_TVFO, 3, 4, {NULL}, 0, 0, S_FORCE_ICON3}, // S_FORCE_ICON2 + {SPR_TVFO, 4, 4, {NULL}, 0, 0, S_FORCE_ICON4}, // S_FORCE_ICON3 + {SPR_TVFO, 5, 4, {NULL}, 0, 0, S_FORCE_ICON5}, // S_FORCE_ICON4 + {SPR_TVFO, 2, 18, {A_ForceShield}, 0, 0, S_NULL}, // S_FORCE_ICON5 - // Pity Shield Box - {SPR_GRTV, 0, 2, {NULL}, 0, 0, S_PITV2}, // S_PITV1 - {SPR_MTEX, 0, 1, {NULL}, 0, 0, S_PITV1}, // S_PITV2 - {SPR_GRTV, 1, 4, {A_MonitorPop}, 0, 0, S_PITV4}, // S_PITV3 - {SPR_GRTV, 2, 4, {NULL}, 0, 0, S_PITV5}, // S_PITV4 - {SPR_GRTV, 3, 4, {NULL}, 0, 0, S_PITV6}, // S_PITV5 - {SPR_GRTV, 4, 4, {NULL}, 0, 0, S_PITV7}, // S_PITV6 - {SPR_GRTV, 1, 18, {A_PityShield}, 0, 0, S_NULL}, // S_PITV7 + {SPR_TVAR, 2, 4, {NULL}, 0, 0, S_ARMAGEDDON_ICON2}, // S_ARMAGEDDON_ICON1 + {SPR_TVAR, 3, 4, {NULL}, 0, 0, S_ARMAGEDDON_ICON3}, // S_ARMAGEDDON_ICON2 + {SPR_TVAR, 4, 4, {NULL}, 0, 0, S_ARMAGEDDON_ICON4}, // S_ARMAGEDDON_ICON3 + {SPR_TVAR, 5, 4, {NULL}, 0, 0, S_ARMAGEDDON_ICON5}, // S_ARMAGEDDON_ICON4 + {SPR_TVAR, 2, 18, {A_BombShield}, 0, 0, S_NULL}, // S_ARMAGEDDON_ICON5 - // Eggman Box - {SPR_EGGB, 0, 2, {NULL}, 0, 0, S_EGGTV2}, // S_EGGTV1 - {SPR_MTEX, 0, 1, {NULL}, 0, 0, S_EGGTV1}, // S_EGGTV2 - {SPR_EGGB, 1, 4, {A_MonitorPop}, 0, 0, S_EGGTV4}, // S_EGGTV3 - {SPR_BKTV, 2, 4, {NULL}, 0, 0, S_EGGTV5}, // S_EGGTV4 - {SPR_BKTV, 3, 4, {NULL}, 0, 0, S_EGGTV6}, // S_EGGTV5 - {SPR_BKTV, 4, 4, {NULL}, 0, 0, S_EGGTV7}, // S_EGGTV6 - {SPR_EGGB, 1, 18, {A_EggmanBox}, 0, 0, S_NULL}, // S_EGGTV7 + {SPR_TVWW, 2, 4, {NULL}, 0, 0, S_WHIRLWIND_ICON2}, // S_WHIRLWIND_ICON1 + {SPR_TVWW, 3, 4, {NULL}, 0, 0, S_WHIRLWIND_ICON3}, // S_WHIRLWIND_ICON2 + {SPR_TVWW, 4, 4, {NULL}, 0, 0, S_WHIRLWIND_ICON4}, // S_WHIRLWIND_ICON3 + {SPR_TVWW, 5, 4, {NULL}, 0, 0, S_WHIRLWIND_ICON5}, // S_WHIRLWIND_ICON4 + {SPR_TVWW, 2, 18, {A_JumpShield}, 0, 0, S_NULL}, // S_WHIRLWIND_ICON5 - // Teleport Box - {SPR_MIXU, 0, 2, {NULL}, 0, 0, S_MIXUPBOX2}, // S_MIXUPBOX1 - {SPR_MTEX, 0, 1, {NULL}, 0, 0, S_MIXUPBOX1}, // S_MIXUPBOX2 - {SPR_MIXU, 1, 4, {A_MonitorPop}, 0, 0, S_MIXUPBOX4}, // S_MIXUPBOX3 - {SPR_WHTV, 2, 4, {NULL}, 0, 0, S_MIXUPBOX5}, // S_MIXUPBOX4 - {SPR_WHTV, 3, 4, {NULL}, 0, 0, S_MIXUPBOX6}, // S_MIXUPBOX5 - {SPR_WHTV, 4, 4, {NULL}, 0, 0, S_MIXUPBOX7}, // S_MIXUPBOX6 - {SPR_MIXU, 1, 18, {A_MixUp}, 0, 0, S_NULL}, // S_MIXUPBOX7 + {SPR_TVEL, 2, 4, {NULL}, 0, 0, S_ELEMENTAL_ICON2}, // S_ELEMENTAL_ICON1 + {SPR_TVEL, 3, 4, {NULL}, 0, 0, S_ELEMENTAL_ICON3}, // S_ELEMENTAL_ICON2 + {SPR_TVEL, 4, 4, {NULL}, 0, 0, S_ELEMENTAL_ICON4}, // S_ELEMENTAL_ICON3 + {SPR_TVEL, 5, 4, {NULL}, 0, 0, S_ELEMENTAL_ICON5}, // S_ELEMENTAL_ICON4 + {SPR_TVEL, 2, 18, {A_WaterShield}, 0, 0, S_NULL}, // S_ELEMENTAL_ICON5 - // Recycler Box - {SPR_RECY, 0, 2, {NULL}, 0, 0, S_RECYCLETV2}, // S_RECYCLETV1 - {SPR_MTEX, 0, 1, {NULL}, 0, 0, S_RECYCLETV1}, // S_RECYCLETV2 - {SPR_RECY, 1, 4, {A_MonitorPop}, 0, 0, S_RECYCLETV4}, // S_RECYCLETV3 - {SPR_GRTV, 2, 4, {NULL}, 0, 0, S_RECYCLETV5}, // S_RECYCLETV4 - {SPR_GRTV, 3, 4, {NULL}, 0, 0, S_RECYCLETV6}, // S_RECYCLETV5 - {SPR_GRTV, 4, 4, {NULL}, 0, 0, S_RECYCLETV7}, // S_RECYCLETV6 - {SPR_RECY, 1, 18, {A_RecyclePowers}, 0, 0, S_NULL}, // S_RECYCLETV7 + {SPR_TVSS, 2, 4, {NULL}, 0, 0, S_SNEAKERS_ICON2}, // S_SNEAKERS_ICON1 + {SPR_TVSS, 3, 4, {NULL}, 0, 0, S_SNEAKERS_ICON3}, // S_SNEAKERS_ICON2 + {SPR_TVSS, 4, 4, {NULL}, 0, 0, S_SNEAKERS_ICON4}, // S_SNEAKERS_ICON3 + {SPR_TVSS, 5, 4, {NULL}, 0, 0, S_SNEAKERS_ICON5}, // S_SNEAKERS_ICON4 + {SPR_TVSS, 2, 18, {A_SuperSneakers}, 0, 0, S_NULL}, // S_SNEAKERS_ICON5 - // Question Box - {SPR_QUES, 0, 2, {NULL}, 0, 0, S_RANDOMBOX2}, // S_RANDOMBOX1 - {SPR_MTEX, 0, 1, {NULL}, 0, 0, S_RANDOMBOX1}, // S_RANDOMBOX2 - {SPR_QUES, 0, 1, {A_MonitorPop}, 0, 0, S_NULL}, // S_RANDOMBOX3 + {SPR_TVIV, 2, 4, {NULL}, 0, 0, S_INVULN_ICON2}, // S_INVULN_ICON1 + {SPR_TVIV, 3, 4, {NULL}, 0, 0, S_INVULN_ICON3}, // S_INVULN_ICON2 + {SPR_TVIV, 4, 4, {NULL}, 0, 0, S_INVULN_ICON4}, // S_INVULN_ICON3 + {SPR_TVIV, 5, 4, {NULL}, 0, 0, S_INVULN_ICON5}, // S_INVULN_ICON4 + {SPR_TVIV, 2, 18, {A_Invincibility}, 0, 0, S_NULL}, // S_INVULN_ICON5 - // Gravity Boots Box - {SPR_GBTV, 0, 2, {NULL}, 0, 0, S_GBTV2}, // S_GBTV1 - {SPR_MTEX, 0, 1, {NULL}, 0, 0, S_GBTV1}, // S_GBTV2 - {SPR_GBTV, 1, 4, {A_MonitorPop}, 0, 0, S_GBTV4}, // S_GBTV3 - {SPR_BLTV, 2, 4, {NULL}, 0, 0, S_GBTV5}, // S_GBTV4 - {SPR_BLTV, 3, 4, {NULL}, 0, 0, S_GBTV6}, // S_GBTV5 - {SPR_BLTV, 4, 4, {NULL}, 0, 0, S_GBTV7}, // S_GBTV6 - {SPR_GBTV, 1, 18, {A_GravityBox}, 0, 0, S_NULL}, // S_GBTV7 + {SPR_TV1P, 2, 4, {NULL}, 0, 0, S_1UP_ICON2}, // S_1UP_ICON1 + {SPR_TV1U, 3, 4, {NULL}, 0, 0, S_1UP_ICON3}, // S_1UP_ICON2 + {SPR_TV1U, 4, 4, {NULL}, 0, 0, S_1UP_ICON4}, // S_1UP_ICON3 + {SPR_TV1U, 5, 4, {NULL}, 0, 0, S_1UP_ICON5}, // S_1UP_ICON4 + {SPR_TV1P, 2, 18, {A_ExtraLife}, 0, 0, S_NULL}, // S_1UP_ICON5 - // Score Box (1k) - {SPR_PTTV, 0, 2, {NULL}, 0, 0, S_SCORETVA2}, // S_SCORETVA1 - {SPR_MTEX, 0, 1, {NULL}, 0, 0, S_SCORETVA1}, // S_SCORETVA2 - {SPR_PTTV, 1, 4, {A_MonitorPop}, 0, 0, S_SCORETVA4}, // S_SCORETVA3 - {SPR_PTTV, 2, 4, {NULL}, 0, 0, S_SCORETVA5}, // S_SCORETVA4 - {SPR_PTTV, 3, 4, {NULL}, 0, 0, S_SCORETVA6}, // S_SCORETVA5 - {SPR_PTTV, 4, 4, {NULL}, 0, 0, S_SCORETVA7}, // S_SCORETVA6 - {SPR_PTTV, 1, 18, {A_AwardScore}, 0, 0, S_NULL}, // S_SCORETVA7 + {SPR_TVEG, 2, 4, {NULL}, 0, 0, S_EGGMAN_ICON2}, // S_EGGMAN_ICON1 + {SPR_TVEG, 3, 4, {NULL}, 0, 0, S_EGGMAN_ICON3}, // S_EGGMAN_ICON2 + {SPR_TVEG, 4, 4, {NULL}, 0, 0, S_EGGMAN_ICON4}, // S_EGGMAN_ICON3 + {SPR_TVEG, 5, 4, {NULL}, 0, 0, S_EGGMAN_ICON5}, // S_EGGMAN_ICON4 + {SPR_TVEG, 2, 18, {A_EggmanBox}, 0, 0, S_NULL}, // S_EGGMAN_ICON5 - // Score Box (10k) - {SPR_PTTV, 5, 2, {NULL}, 0, 0, S_SCORETVB2}, // S_SCORETVB1 - {SPR_MTEX, 0, 1, {NULL}, 0, 0, S_SCORETVB1}, // S_SCORETVB2 - {SPR_PTTV, 6, 4, {A_MonitorPop}, 0, 0, S_SCORETVB4}, // S_SCORETVB3 - {SPR_PTTV, 7, 4, {NULL}, 0, 0, S_SCORETVB5}, // S_SCORETVB4 - {SPR_PTTV, 8, 4, {NULL}, 0, 0, S_SCORETVB6}, // S_SCORETVB5 - {SPR_PTTV, 9, 4, {NULL}, 0, 0, S_SCORETVB7}, // S_SCORETVB6 - {SPR_PTTV, 6, 18, {A_AwardScore}, 0, 0, S_NULL}, // S_SCORETVB7 + {SPR_TVMX, 2, 4, {NULL}, 0, 0, S_MIXUP_ICON2}, // S_MIXUP_ICON1 + {SPR_TVMX, 3, 4, {NULL}, 0, 0, S_MIXUP_ICON3}, // S_MIXUP_ICON2 + {SPR_TVMX, 4, 4, {NULL}, 0, 0, S_MIXUP_ICON4}, // S_MIXUP_ICON3 + {SPR_TVMX, 5, 4, {NULL}, 0, 0, S_MIXUP_ICON5}, // S_MIXUP_ICON4 + {SPR_TVMX, 2, 18, {A_MixUp}, 0, 0, S_NULL}, // S_MIXUP_ICON5 - // Monitor Explosion - {SPR_MTEX, 0, 4, {NULL}, 0, 0, S_MONITOREXPLOSION2}, // S_MONITOREXPLOSION1 - {SPR_MTEX, 1, -1, {NULL}, 0, 0, S_NULL}, // S_MONITOREXPLOSION2 + {SPR_TVGV, 2, 4, {NULL}, 0, 0, S_GRAVITY_ICON2}, // S_GRAVITY_ICON1 + {SPR_TVGV, 3, 4, {NULL}, 0, 0, S_GRAVITY_ICON3}, // S_GRAVITY_ICON2 + {SPR_TVGV, 4, 4, {NULL}, 0, 0, S_GRAVITY_ICON4}, // S_GRAVITY_ICON3 + {SPR_TVGV, 5, 4, {NULL}, 0, 0, S_GRAVITY_ICON5}, // S_GRAVITY_ICON4 + {SPR_TVGV, 2, 18, {A_GravityBox}, 0, 0, S_NULL}, // S_GRAVITY_ICON5 - {SPR_RRBX, 1, 4, {NULL}, 0, 0, S_REDMONITOREXPLOSION2}, // S_REDMONITOREXPLOSION1 - {SPR_RRBX, 2, -1, {NULL}, 0, 0, S_NULL}, // S_REDMONITOREXPLOSION2 + {SPR_TVRC, 2, 4, {NULL}, 0, 0, S_RECYCLER_ICON2}, // S_RECYCLER_ICON1 + {SPR_TVRC, 3, 4, {NULL}, 0, 0, S_RECYCLER_ICON3}, // S_RECYCLER_ICON2 + {SPR_TVRC, 4, 4, {NULL}, 0, 0, S_RECYCLER_ICON4}, // S_RECYCLER_ICON3 + {SPR_TVRC, 5, 4, {NULL}, 0, 0, S_RECYCLER_ICON5}, // S_RECYCLER_ICON4 + {SPR_TVRC, 2, 18, {A_RecyclePowers}, 0, 0, S_NULL}, // S_RECYCLER_ICON5 - {SPR_BRBX, 1, 4, {NULL}, 0, 0, S_BLUEMONITOREXPLOSION2}, // S_BLUEMONITOREXPLOSION1 - {SPR_BRBX, 2, -1, {NULL}, 0, 0, S_NULL}, // S_BLUEMONITOREXPLOSION2 + {SPR_TV1K, 2, 4, {NULL}, 0, 0, S_SCORE1K_ICON2}, // S_SCORE1K_ICON1 + {SPR_TV1K, 3, 4, {NULL}, 0, 0, S_SCORE1K_ICON3}, // S_SCORE1K_ICON2 + {SPR_TV1K, 4, 4, {NULL}, 0, 0, S_SCORE1K_ICON4}, // S_SCORE1K_ICON3 + {SPR_TV1K, 5, 4, {NULL}, 0, 0, S_SCORE1K_ICON5}, // S_SCORE1K_ICON4 + {SPR_TV1K, 2, 18, {A_AwardScore}, 0, 0, S_NULL}, // S_SCORE1K_ICON5 + + {SPR_TVTK, 2, 4, {NULL}, 0, 0, S_SCORE10K_ICON2}, // S_SCORE10K_ICON1 + {SPR_TVTK, 3, 4, {NULL}, 0, 0, S_SCORE10K_ICON3}, // S_SCORE10K_ICON2 + {SPR_TVTK, 4, 4, {NULL}, 0, 0, S_SCORE10K_ICON4}, // S_SCORE10K_ICON3 + {SPR_TVTK, 5, 4, {NULL}, 0, 0, S_SCORE10K_ICON5}, // S_SCORE10K_ICON4 + {SPR_TVTK, 2, 18, {A_AwardScore}, 0, 0, S_NULL}, // S_SCORE10K_ICON5 + + // --- {SPR_MISL, FF_FULLBRIGHT, 1, {A_SmokeTrailer}, MT_SMOKE, 0, S_ROCKET}, // S_ROCKET @@ -6083,417 +6082,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_SUPERRINGBOX - 400, // doomednum - S_SUPERRINGBOX, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_SUPERRINGBOX, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_SUPERRINGBOX2,// deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - MT_MONITOREXPLOSION, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_RINGICO, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - { // MT_REDRINGBOX - 414, // doomednum - S_REDRINGBOX, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_REDRINGBOX, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_SUPERRINGBOX2,// deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - MT_REDMONITOREXPLOSION, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_RINGICO, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - { // MT_BLUERINGBOX - 415, // doomednum - S_BLUERINGBOX, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_BLUERINGBOX, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_SUPERRINGBOX2,// deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - MT_BLUEMONITOREXPLOSION, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_RINGICO, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - { // MT_SNEAKERTV - 407, // doomednum - S_SHTV, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_SHTV, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_SHTV2, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - MT_MONITOREXPLOSION, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_SHOESICO, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - { // MT_INV - 408, // doomednum - S_PINV, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_PINV, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_PINV2, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - MT_MONITOREXPLOSION, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_INVCICO, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - // 1-up box - { // MT_PRUP - 409, // doomednum - S_PRUP, // spawnstate - 1, // spawnhealth - S_PLAY_BOX1, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_PRUP, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_PRUP2, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - MT_MONITOREXPLOSION, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_1UPICO, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_RUNSPAWNFUNC, // flags - S_NULL // raisestate - }, - - { // MT_YELLOWTV - 402, // doomednum - S_YLTV, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_YLTV, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_YLTV2, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - MT_MONITOREXPLOSION, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_YSHIELDICO, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - { // MT_BLUETV - 403, // doomednum - S_BLTV1, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_BLTV1, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_BLTV3, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - MT_MONITOREXPLOSION, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_BSHIELDICO, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - // bomb shield box - { // MT_BLACKTV - 404, // doomednum - S_BKTV1, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_BKTV1, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_BKTV3, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - MT_MONITOREXPLOSION, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_KSHIELDICO, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - // jump shield box - { // MT_WHITETV - 405, // doomednum - S_WHTV1, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_WHTV1, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_WHTV3, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - MT_MONITOREXPLOSION, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_WSHIELDICO, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - { // MT_GREENTV - 406, // doomednum - S_GRTV, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_GRTV, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_GRTV2, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - MT_MONITOREXPLOSION, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_GSHIELDICO, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - { // MT_PITYTV - 401, // doomednum - S_PITV1, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_PITV1, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_PITV3, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - MT_MONITOREXPLOSION, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_PITYSHIELDICO, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - { // MT_EGGMANBOX - 410, // doomednum - S_EGGTV1, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_EGGTV1, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_EGGTV3, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - MT_MONITOREXPLOSION, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_EGGMANICO, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - { // MT_MIXUPBOX - 411, // doomednum - S_MIXUPBOX1, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_MIXUPBOX1, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_MIXUPBOX3, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - MT_MONITOREXPLOSION, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_MIXUPICO, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - { // MT_RECYCLETV - 416, // doomednum - S_RECYCLETV1, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_None, // attacksound - S_RECYCLETV1, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_RECYCLETV3, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - MT_MONITOREXPLOSION, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_RECYCLEICO, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - { // MT_RECYCLEICO + { // MT_BOXSPARKLE -1, // doomednum - S_RECYCLETV3, // spawnstate + S_BOXSPARKLE1, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -6506,210 +6097,993 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // missilestate S_NULL, // deathstate S_NULL, // xdeathstate - sfx_None, // deathsound - 2*FRACUNIT, // speed - 8*FRACUNIT, // radius - 14*FRACUNIT, // height + sfx_pop, // deathsound + 3*FRACUNIT, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height 0, // display offset 100, // mass - 62*FRACUNIT, // damage + 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags + MF_NOGRAVITY|MF_SCENERY|MF_NOBLOCKMAP|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, - { // MT_QUESTIONBOX + { // MT_RING_BOX + 400, // doomednum + S_RING_BOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_RING_BOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BOX_POP1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 1, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_RING_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_PITY_BOX + 401, // doomednum + S_PITY_BOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_PITY_BOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BOX_POP1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 1, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_PITY_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_ATTRACT_BOX + 402, // doomednum + S_ATTRACT_BOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_ATTRACT_BOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BOX_POP1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 1, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_ATTRACT_ICON,// damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_FORCE_BOX + 403, // doomednum + S_FORCE_BOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_FORCE_BOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BOX_POP1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 1, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_FORCE_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_ARMAGEDDON_BOX + 404, // doomednum + S_ARMAGEDDON_BOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_ARMAGEDDON_BOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BOX_POP1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 1, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_ARMAGEDDON_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_WHIRLWIND_BOX + 405, // doomednum + S_WHIRLWIND_BOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_WHIRLWIND_BOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BOX_POP1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 1, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_WHIRLWIND_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_ELEMENTAL_BOX + 406, // doomednum + S_ELEMENTAL_BOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_ELEMENTAL_BOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BOX_POP1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 1, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_ELEMENTAL_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_SNEAKERS_BOX + 407, // doomednum + S_SNEAKERS_BOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_SNEAKERS_BOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BOX_POP1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 1, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_SNEAKERS_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_INVULN_BOX + 408, // doomednum + S_INVULN_BOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_INVULN_BOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BOX_POP1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 1, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_INVULN_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_1UP_BOX + 409, // doomednum + S_1UP_BOX, // spawnstate + 1, // spawnhealth + S_PLAY_BOX1, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_1UP_BOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BOX_POP1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 1, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_1UP_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_EGGMAN_BOX + 410, // doomednum + S_EGGMAN_BOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_EGGMAN_BOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BOX_POP1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_EGGMAN_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_MIXUP_BOX + 411, // doomednum + S_MIXUP_BOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_MIXUP_BOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BOX_POP1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 1, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_MIXUP_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_MYSTERY_BOX 412, // doomednum - S_RANDOMBOX1, // spawnstate + S_MYSTERY_BOX, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound 8, // reactiontime sfx_None, // attacksound - S_RANDOMBOX1, // painstate + S_MYSTERY_BOX, // painstate 0, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_RANDOMBOX3, // deathstate + S_BOX_POP1, // deathstate S_NULL, // xdeathstate sfx_pop, // deathsound - MT_MONITOREXPLOSION, // speed + 0, // speed 16*FRACUNIT, // radius 32*FRACUNIT, // height 0, // display offset 100, // mass - 0, // damage + MT_UNKNOWN, // damage sfx_None, // activesound MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, - { // MT_GRAVITYBOX + { // MT_GRAVITY_BOX 413, // doomednum - S_GBTV1, // spawnstate + S_GRAVITY_BOX, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound 8, // reactiontime sfx_None, // attacksound - S_GBTV1, // painstate + S_GRAVITY_BOX, // painstate 0, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_GBTV3, // deathstate + S_BOX_POP1, // deathstate S_NULL, // xdeathstate sfx_pop, // deathsound - MT_MONITOREXPLOSION, // speed + 0, // speed 16*FRACUNIT, // radius 32*FRACUNIT, // height 0, // display offset 100, // mass - MT_GRAVITYICO, // damage - sfx_cgot, // activesound + MT_GRAVITY_ICON, // damage + sfx_None, // activesound MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, - { // MT_SCORETVSMALL + { // MT_RECYCLER_BOX + 416, // doomednum + S_RECYCLER_BOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_RECYCLER_BOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BOX_POP1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 1, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_RECYCLER_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_SCORE1K_BOX 418, // doomednum - S_SCORETVA1, // spawnstate + S_SCORE1K_BOX, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_token, // seesound + sfx_None, // seesound 8, // reactiontime sfx_None, // attacksound - S_SCORETVA1, // painstate + S_SCORE1K_BOX, // painstate 0, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SCORETVA3, // deathstate + S_BOX_POP1, // deathstate S_NULL, // xdeathstate sfx_pop, // deathsound - MT_MONITOREXPLOSION, // speed + 0, // speed 16*FRACUNIT, // radius 32*FRACUNIT, // height 0, // display offset 100, // mass - MT_SCOREICOSMALL, // damage + MT_SCORE1K_ICON, // damage sfx_None, // activesound MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, - { // MT_SCORETVLARGE + { // MT_SCORE10K_BOX 419, // doomednum - S_SCORETVB1, // spawnstate + S_SCORE10K_BOX, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_token, // seesound + sfx_None, // seesound 8, // reactiontime sfx_None, // attacksound - S_SCORETVB1, // painstate + S_SCORE10K_BOX, // painstate 0, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_SCORETVB3, // deathstate + S_BOX_POP1, // deathstate S_NULL, // xdeathstate sfx_pop, // deathsound - MT_MONITOREXPLOSION, // speed + 0, // speed 16*FRACUNIT, // radius 32*FRACUNIT, // height 0, // display offset 100, // mass - MT_SCOREICOLARGE, // damage + MT_SCORE10K_ICON, // damage sfx_None, // activesound MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, - { // MT_MONITOREXPLOSION - -1, // doomednum - S_MONITOREXPLOSION1, // spawnstate - 0, // spawnhealth + { // MT_RING_BIGBOX + 430, // doomednum + S_RING_BIGBOX, // spawnstate + 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound 8, // reactiontime - sfx_None, // attacksound - S_XPLD1, // painstate + sfx_monton, // attacksound + S_RING_BIGBOX, // painstate 0, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_NULL, // deathstate + S_BIGBOX_OFF1, // deathstate S_NULL, // xdeathstate - sfx_None, // deathsound + sfx_pop, // deathsound 0, // speed - 8*FRACUNIT, // radius - 8*FRACUNIT, // height + 16*FRACUNIT, // radius + 32*FRACUNIT, // height 0, // display offset - MT_EXPLODE, // mass - 0, // damage + 100, // mass + MT_RING_ICON, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, - { // MT_REDMONITOREXPLOSION - -1, // doomednum - S_REDMONITOREXPLOSION1, // spawnstate - 0, // spawnhealth + { // MT_PITY_BIGBOX + 431, // doomednum + S_PITY_BIGBOX, // spawnstate + 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound 8, // reactiontime - sfx_None, // attacksound - S_XPLD1, // painstate + sfx_monton, // attacksound + S_PITY_BIGBOX, // painstate 0, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_NULL, // deathstate + S_BIGBOX_OFF1, // deathstate S_NULL, // xdeathstate - sfx_None, // deathsound + sfx_pop, // deathsound 0, // speed - 8*FRACUNIT, // radius - 8*FRACUNIT, // height + 16*FRACUNIT, // radius + 32*FRACUNIT, // height 0, // display offset - MT_EXPLODE, // mass - 0, // damage + 100, // mass + MT_PITY_ICON, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, - { // MT_BLUEMONITOREXPLOSION - -1, // doomednum - S_BLUEMONITOREXPLOSION1, // spawnstate - 0, // spawnhealth + { // MT_ATTRACT_BIGBOX + 432, // doomednum + S_ATTRACT_BIGBOX, // spawnstate + 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound 8, // reactiontime - sfx_None, // attacksound - S_XPLD1, // painstate + sfx_monton, // attacksound + S_ATTRACT_BIGBOX, // painstate 0, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_NULL, // deathstate + S_BIGBOX_OFF1, // deathstate S_NULL, // xdeathstate - sfx_None, // deathsound + sfx_pop, // deathsound 0, // speed - 8*FRACUNIT, // radius - 8*FRACUNIT, // height + 16*FRACUNIT, // radius + 32*FRACUNIT, // height 0, // display offset - MT_EXPLODE, // mass - 0, // damage + 100, // mass + MT_ATTRACT_ICON,// damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags S_NULL // raisestate }, - { // MT_RINGICO + { // MT_FORCE_BIGBOX + 433, // doomednum + S_FORCE_BIGBOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_monton, // attacksound + S_FORCE_BIGBOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BIGBOX_OFF1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_FORCE_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_ARMAGEDDON_BIGBOX + 434, // doomednum + S_ARMAGEDDON_BIGBOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_monton, // attacksound + S_ARMAGEDDON_BIGBOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BIGBOX_OFF1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_ARMAGEDDON_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_WHIRLWIND_BIGBOX + 435, // doomednum + S_WHIRLWIND_BIGBOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_monton, // attacksound + S_WHIRLWIND_BIGBOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BIGBOX_OFF1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_WHIRLWIND_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_ELEMENTAL_BIGBOX + 436, // doomednum + S_ELEMENTAL_BIGBOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_monton, // attacksound + S_ELEMENTAL_BIGBOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BIGBOX_OFF1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_ELEMENTAL_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_SNEAKERS_BIGBOX + 437, // doomednum + S_SNEAKERS_BIGBOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_monton, // attacksound + S_SNEAKERS_BIGBOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BIGBOX_OFF1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_SNEAKERS_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_INVULN_BIGBOX + 438, // doomednum + S_INVULN_BIGBOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_monton, // attacksound + S_INVULN_BIGBOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BIGBOX_OFF1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_INVULN_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_1UP_BIGBOX + 439, // doomednum + S_1UP_BIGBOX, // spawnstate + 1, // spawnhealth + S_PLAY_BOX1, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_monton, // attacksound + S_1UP_BIGBOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BIGBOX_OFF1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_1UP_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_EGGMAN_BIGBOX + 440, // doomednum + S_EGGMAN_BIGBOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_monton, // attacksound + S_EGGMAN_BIGBOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BIGBOX_OFF1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_EGGMAN_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_MIXUP_BIGBOX + 441, // doomednum + S_MIXUP_BIGBOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_monton, // attacksound + S_MIXUP_BIGBOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BIGBOX_OFF1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_MIXUP_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_MYSTERY_BIGBOX + 442, // doomednum + S_MYSTERY_BIGBOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_monton, // attacksound + S_MYSTERY_BIGBOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BIGBOX_OFF1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_UNKNOWN, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_GRAVITY_BIGBOX + 443, // doomednum + S_GRAVITY_BIGBOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_monton, // attacksound + S_GRAVITY_BIGBOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BIGBOX_OFF1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_GRAVITY_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_RECYCLER_BIGBOX + 446, // doomednum + S_RECYCLER_BIGBOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_monton, // attacksound + S_RECYCLER_BIGBOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BIGBOX_OFF1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_RECYCLER_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_SCORE1K_BIGBOX + 448, // doomednum + S_SCORE1K_BIGBOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_monton, // attacksound + S_SCORE1K_BIGBOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BIGBOX_OFF1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_SCORE1K_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_SCORE10K_BIGBOX + 449, // doomednum + S_SCORE10K_BIGBOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_monton, // attacksound + S_SCORE10K_BIGBOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BIGBOX_OFF1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_SCORE10K_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_RING_REDBOX + 414, // doomednum + S_RING_REDBOX1, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_RING_REDBOX1, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_REDBOX_POP1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_RING_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_RING_BLUEBOX + 415, // doomednum + S_RING_BLUEBOX1, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_RING_BLUEBOX1, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BLUEBOX_POP1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_RING_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_RING_ICON -1, // doomednum - S_SUPERRINGBOX2, // spawnstate + S_RING_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_itemup, // seesound @@ -6734,9 +7108,171 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_SHOESICO + { // MT_PITY_ICON -1, // doomednum - S_SHTV2, // spawnstate + S_PITY_ICON1, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_shield, // 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 + 2*FRACUNIT, // speed + 8*FRACUNIT, // radius + 14*FRACUNIT, // height + 0, // display offset + 100, // mass + 62*FRACUNIT, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags + S_NULL // raisestate + }, + + { // MT_ATTRACT_ICON + -1, // doomednum + S_ATTRACT_ICON1, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_shield, // 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 + 2*FRACUNIT, // speed + 8*FRACUNIT, // radius + 14*FRACUNIT, // height + 0, // display offset + 100, // mass + 62*FRACUNIT, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags + S_NULL // raisestate + }, + + { // MT_FORCE_ICON + -1, // doomednum + S_FORCE_ICON1, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_shield, // 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 + 2*FRACUNIT, // speed + 8*FRACUNIT, // radius + 14*FRACUNIT, // height + 0, // display offset + 100, // mass + 62*FRACUNIT, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags + S_NULL // raisestate + }, + + { // MT_ARMAGEDDON_ICON + -1, // doomednum + S_ARMAGEDDON_ICON1, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_shield, // 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 + 2*FRACUNIT, // speed + 8*FRACUNIT, // radius + 14*FRACUNIT, // height + 0, // display offset + 100, // mass + 62*FRACUNIT, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags + S_NULL // raisestate + }, + + { // MT_WHIRLWIND_ICON + -1, // doomednum + S_WHIRLWIND_ICON1, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_shield, // 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 + 2*FRACUNIT, // speed + 8*FRACUNIT, // radius + 14*FRACUNIT, // height + 0, // display offset + 100, // mass + 62*FRACUNIT, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags + S_NULL // raisestate + }, + + { // MT_ELEMENTAL_ICON + -1, // doomednum + S_ELEMENTAL_ICON1, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_shield, // 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 + 2*FRACUNIT, // speed + 8*FRACUNIT, // radius + 14*FRACUNIT, // height + 0, // display offset + 100, // mass + 62*FRACUNIT, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags + S_NULL // raisestate + }, + + { // MT_SNEAKERS_ICON + -1, // doomednum + S_SNEAKERS_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -6761,9 +7297,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_INVCICO + { // MT_INVULN_ICON -1, // doomednum - S_PINV2, // spawnstate + S_INVULN_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -6788,9 +7324,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_1UPICO + { // MT_1UP_ICON -1, // doomednum - S_PRUP2, // spawnstate + S_1UP_ICON1, // spawnstate 1, // spawnhealth S_PLAY_ICON1, // seestate sfx_None, // seesound @@ -6815,172 +7351,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_YSHIELDICO + { // MT_EGGMAN_ICON -1, // doomednum - S_YLTV2, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_shield, // 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 - 2*FRACUNIT, // speed - 8*FRACUNIT, // radius - 14*FRACUNIT, // height - 0, // display offset - 100, // mass - 62*FRACUNIT, // damage - sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags - S_NULL // raisestate - }, - - { // MT_BSHIELDICO - -1, // doomednum - S_BLTV3, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_shield, // 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 - 2*FRACUNIT, // speed - 8*FRACUNIT, // radius - 14*FRACUNIT, // height - 0, // display offset - 100, // mass - 62*FRACUNIT, // damage - sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags - S_NULL // raisestate - }, - - { // MT_KSHIELDICO - -1, // doomednum - S_BKTV3, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_shield, // 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 - 2*FRACUNIT, // speed - 8*FRACUNIT, // radius - 14*FRACUNIT, // height - 0, // display offset - 100, // mass - 62*FRACUNIT, // damage - sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags - S_NULL // raisestate - }, - - { // MT_WSHIELDICO - -1, // doomednum - S_WHTV3, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_shield, // 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 - 2*FRACUNIT, // speed - 8*FRACUNIT, // radius - 14*FRACUNIT, // height - 0, // display offset - 100, // mass - 62*FRACUNIT, // damage - sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags - S_NULL // raisestate - }, - - { // MT_GSHIELDICO - -1, // doomednum - S_GRTV2, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_shield, // 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 - 2*FRACUNIT, // speed - 8*FRACUNIT, // radius - 14*FRACUNIT, // height - 0, // display offset - 100, // mass - 62*FRACUNIT, // damage - sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags - S_NULL // raisestate - }, - - - { // MT_PITYSHIELDICO - -1, // doomednum - S_PITV3, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_shield, // 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 - 2*FRACUNIT, // speed - 8*FRACUNIT, // radius - 14*FRACUNIT, // height - 0, // display offset - 100, // mass - 62*FRACUNIT, // damage - sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags - S_NULL // raisestate - }, - - { // MT_EGGMANICO - -1, // doomednum - S_EGGTV3, // spawnstate + S_EGGMAN_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -7005,9 +7378,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_MIXUPICO + { // MT_MIXUP_ICON -1, // doomednum - S_MIXUPBOX3, // spawnstate + S_MIXUP_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -7032,9 +7405,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_GRAVITYICO + { // MT_GRAVITY_ICON -1, // doomednum - S_GBTV3, // spawnstate + S_GRAVITY_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -7059,9 +7432,36 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_SCOREICOSMALL + { // MT_RECYCLER_ICON -1, // doomednum - S_SCORETVA3, // spawnstate + S_RECYCLER_ICON1, // 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_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 2*FRACUNIT, // speed + 8*FRACUNIT, // radius + 14*FRACUNIT, // height + 0, // display offset + 100, // mass + 62*FRACUNIT, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags + S_NULL // raisestate + }, + + { // MT_SCORE1K_ICON + -1, // doomednum + S_SCORE1K_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_token, // seesound @@ -7086,9 +7486,9 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_SCOREICOLARGE + { // MT_SCORE10K_ICON -1, // doomednum - S_SCORETVB3, // spawnstate + S_SCORE10K_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_token, // seesound diff --git a/src/info.h b/src/info.h index e313526b9..d031addf5 100644 --- a/src/info.h +++ b/src/info.h @@ -28,6 +28,9 @@ void A_Explode(); void A_Pain(); void A_Fall(); void A_MonitorPop(); +void A_BigMonitorPop(); +void A_BigMonitorRestore(); +void A_BigMonitorSparkle(); void A_Look(); void A_Chase(); void A_FaceStabChase(); @@ -324,27 +327,30 @@ typedef enum sprite SPR_BMNE, // Big floating mine // Monitor Boxes - SPR_SRBX, - SPR_RRBX, - SPR_BRBX, - SPR_SHTV, - SPR_PINV, - SPR_YLTV, - SPR_BLTV, // Force shield - SPR_BKTV, // Bomb shield TV - SPR_WHTV, // Jump shield TV - SPR_GRTV, // Pity shield TV - SPR_ELTV, // Elemental shield TV - SPR_EGGB, // Eggman box - SPR_MIXU, // Player mixing monitor - SPR_RECY, // Recycler (power mixing) monitor - SPR_QUES, // Random monitor - SPR_GBTV, // Gravity boots TV - SPR_PRUP, // 1up - SPR_PTTV, // Score TVs + SPR_MSTV, // MiSc TV sprites + SPR_XLTV, // eXtra Large TV sprites - // Monitor Miscellany - SPR_MTEX, // Exploding monitor + SPR_TRRI, // Red team: 10 RIngs + SPR_TBRI, // Blue team: 10 RIngs + + SPR_TVRI, // 10 RIng + SPR_TVPI, // PIty shield + SPR_TVAT, // ATtraction shield + SPR_TVFO, // FOrce shield + SPR_TVAR, // ARmageddon shield + SPR_TVWW, // WhirlWind shield + SPR_TVEL, // ELemental shield + SPR_TVSS, // Super Sneakers + SPR_TVIV, // InVincibility + SPR_TV1U, // 1Up + SPR_TV1P, // 1uP (textless) + SPR_TVEG, // EGgman + SPR_TVMX, // MiXup + SPR_TVMY, // MYstery + SPR_TVGV, // GraVity boots + SPR_TVRC, // ReCycler + SPR_TV1K, // 1,000 points (1 K) + SPR_TVTK, // 10,000 points (Ten K) // Projectiles SPR_MISL, @@ -1750,170 +1756,171 @@ typedef enum state S_CANNONLAUNCHER2, S_CANNONLAUNCHER3, - // Super Ring Box - S_SUPERRINGBOX, - S_SUPERRINGBOX1, - S_SUPERRINGBOX2, - S_SUPERRINGBOX3, - S_SUPERRINGBOX4, - S_SUPERRINGBOX5, - S_SUPERRINGBOX6, + // Monitor Miscellany + S_BOXSPARKLE1, + S_BOXSPARKLE2, + S_BOXSPARKLE3, - // Red Team Ring Box - S_REDRINGBOX, - S_REDRINGBOX1, + S_BOX_FLICKER, + S_BOX_POP1, + S_BOX_POP2, - // Blue Team Ring Box - S_BLUERINGBOX, - S_BLUERINGBOX1, + S_BIGBOX_FLICKER, + S_BIGBOX_OFF1, + S_BIGBOX_OFF2, + S_BIGBOX_OFF3, + S_BIGBOX_OFF4, + S_BIGBOX_OFF5, + S_BIGBOX_OFF6, + S_BIGBOX_OFF7, - // Super Sneakers Box - S_SHTV, - S_SHTV1, - S_SHTV2, - S_SHTV3, - S_SHTV4, - S_SHTV5, - S_SHTV6, + // Monitor States (one per box) + S_MYSTERY_BOX, + S_RING_BOX, + S_PITY_BOX, + S_ATTRACT_BOX, + S_FORCE_BOX, + S_ARMAGEDDON_BOX, + S_WHIRLWIND_BOX, + S_ELEMENTAL_BOX, + S_SNEAKERS_BOX, + S_INVULN_BOX, + S_1UP_BOX, + S_EGGMAN_BOX, + S_MIXUP_BOX, + S_GRAVITY_BOX, + S_RECYCLER_BOX, + S_SCORE1K_BOX, + S_SCORE10K_BOX, - // Invincibility Box - S_PINV, - S_PINV1, - S_PINV2, - S_PINV3, - S_PINV4, - S_PINV5, - S_PINV6, + // Repeat Monitor States (one per box) + S_MYSTERY_BIGBOX, + S_RING_BIGBOX, + S_PITY_BIGBOX, + S_ATTRACT_BIGBOX, + S_FORCE_BIGBOX, + S_ARMAGEDDON_BIGBOX, + S_WHIRLWIND_BIGBOX, + S_ELEMENTAL_BIGBOX, + S_SNEAKERS_BIGBOX, + S_INVULN_BIGBOX, + S_1UP_BIGBOX, + S_EGGMAN_BIGBOX, + S_MIXUP_BIGBOX, + S_GRAVITY_BIGBOX, + S_RECYCLER_BIGBOX, + S_SCORE1K_BIGBOX, + S_SCORE10K_BIGBOX, - // 1up Box - S_PRUP, - S_PRUP1, - S_PRUP2, - S_PRUP3, - S_PRUP4, - S_PRUP5, - S_PRUP6, + // Team Ring Boxes (these are special) + S_RING_REDBOX1, + S_RING_REDBOX2, + S_REDBOX_POP1, + S_REDBOX_POP2, - // Ring Shield Box - S_YLTV, - S_YLTV1, - S_YLTV2, - S_YLTV3, - S_YLTV4, - S_YLTV5, - S_YLTV6, + S_RING_BLUEBOX1, + S_RING_BLUEBOX2, + S_BLUEBOX_POP1, + S_BLUEBOX_POP2, - // Force Shield Box - S_BLTV1, - S_BLTV2, - S_BLTV3, - S_BLTV4, - S_BLTV5, - S_BLTV6, - S_BLTV7, + // Box Icons -- 5 states each, one for each part of the twirl + S_RING_ICON1, + S_RING_ICON2, + S_RING_ICON3, + S_RING_ICON4, + S_RING_ICON5, - // Bomb Shield Box - S_BKTV1, - S_BKTV2, - S_BKTV3, - S_BKTV4, - S_BKTV5, - S_BKTV6, - S_BKTV7, + S_PITY_ICON1, + S_PITY_ICON2, + S_PITY_ICON3, + S_PITY_ICON4, + S_PITY_ICON5, - // Jump Shield Box - S_WHTV1, - S_WHTV2, - S_WHTV3, - S_WHTV4, - S_WHTV5, - S_WHTV6, - S_WHTV7, + S_ATTRACT_ICON1, + S_ATTRACT_ICON2, + S_ATTRACT_ICON3, + S_ATTRACT_ICON4, + S_ATTRACT_ICON5, - // Water Shield Box - S_GRTV, - S_GRTV1, - S_GRTV2, - S_GRTV3, - S_GRTV4, - S_GRTV5, - S_GRTV6, + S_FORCE_ICON1, + S_FORCE_ICON2, + S_FORCE_ICON3, + S_FORCE_ICON4, + S_FORCE_ICON5, - // Pity Shield Box - S_PITV1, - S_PITV2, - S_PITV3, - S_PITV4, - S_PITV5, - S_PITV6, - S_PITV7, + S_ARMAGEDDON_ICON1, + S_ARMAGEDDON_ICON2, + S_ARMAGEDDON_ICON3, + S_ARMAGEDDON_ICON4, + S_ARMAGEDDON_ICON5, - // Eggman Box - S_EGGTV1, - S_EGGTV2, - S_EGGTV3, - S_EGGTV4, - S_EGGTV5, - S_EGGTV6, - S_EGGTV7, + S_WHIRLWIND_ICON1, + S_WHIRLWIND_ICON2, + S_WHIRLWIND_ICON3, + S_WHIRLWIND_ICON4, + S_WHIRLWIND_ICON5, - // Teleport Box - S_MIXUPBOX1, - S_MIXUPBOX2, - S_MIXUPBOX3, - S_MIXUPBOX4, - S_MIXUPBOX5, - S_MIXUPBOX6, - S_MIXUPBOX7, + S_ELEMENTAL_ICON1, + S_ELEMENTAL_ICON2, + S_ELEMENTAL_ICON3, + S_ELEMENTAL_ICON4, + S_ELEMENTAL_ICON5, - // Recycler Box - S_RECYCLETV1, - S_RECYCLETV2, - S_RECYCLETV3, - S_RECYCLETV4, - S_RECYCLETV5, - S_RECYCLETV6, - S_RECYCLETV7, + S_SNEAKERS_ICON1, + S_SNEAKERS_ICON2, + S_SNEAKERS_ICON3, + S_SNEAKERS_ICON4, + S_SNEAKERS_ICON5, - // Question Box - S_RANDOMBOX1, - S_RANDOMBOX2, - S_RANDOMBOX3, + S_INVULN_ICON1, + S_INVULN_ICON2, + S_INVULN_ICON3, + S_INVULN_ICON4, + S_INVULN_ICON5, - // Gravity Boots Box - S_GBTV1, - S_GBTV2, - S_GBTV3, - S_GBTV4, - S_GBTV5, - S_GBTV6, - S_GBTV7, + S_1UP_ICON1, + S_1UP_ICON2, + S_1UP_ICON3, + S_1UP_ICON4, + S_1UP_ICON5, - // Score boxes - S_SCORETVA1, - S_SCORETVA2, - S_SCORETVA3, - S_SCORETVA4, - S_SCORETVA5, - S_SCORETVA6, - S_SCORETVA7, - S_SCORETVB1, - S_SCORETVB2, - S_SCORETVB3, - S_SCORETVB4, - S_SCORETVB5, - S_SCORETVB6, - S_SCORETVB7, + S_EGGMAN_ICON1, + S_EGGMAN_ICON2, + S_EGGMAN_ICON3, + S_EGGMAN_ICON4, + S_EGGMAN_ICON5, - // Monitor Explosion - S_MONITOREXPLOSION1, - S_MONITOREXPLOSION2, + S_MIXUP_ICON1, + S_MIXUP_ICON2, + S_MIXUP_ICON3, + S_MIXUP_ICON4, + S_MIXUP_ICON5, - S_REDMONITOREXPLOSION1, - S_REDMONITOREXPLOSION2, + S_GRAVITY_ICON1, + S_GRAVITY_ICON2, + S_GRAVITY_ICON3, + S_GRAVITY_ICON4, + S_GRAVITY_ICON5, - S_BLUEMONITOREXPLOSION1, - S_BLUEMONITOREXPLOSION2, + S_RECYCLER_ICON1, + S_RECYCLER_ICON2, + S_RECYCLER_ICON3, + S_RECYCLER_ICON4, + S_RECYCLER_ICON5, + + S_SCORE1K_ICON1, + S_SCORE1K_ICON2, + S_SCORE1K_ICON3, + S_SCORE1K_ICON4, + S_SCORE1K_ICON5, + + S_SCORE10K_ICON1, + S_SCORE10K_ICON2, + S_SCORE10K_ICON3, + S_SCORE10K_ICON4, + S_SCORE10K_ICON5, + + // --- S_ROCKET, @@ -3673,47 +3680,68 @@ typedef enum mobj_type MT_BIGAIRMINE, MT_CANNONLAUNCHER, - // Monitor Boxes - MT_SUPERRINGBOX, - MT_REDRINGBOX, - MT_BLUERINGBOX, - MT_SNEAKERTV, - MT_INV, - MT_PRUP, // 1up Box - MT_YELLOWTV, - MT_BLUETV, - MT_BLACKTV, // Bomb shield TV - MT_WHITETV, // Jump shield TV - MT_GREENTV, - MT_PITYTV, // Pity Shield TV - MT_EGGMANBOX, - MT_MIXUPBOX, - MT_RECYCLETV, - MT_RECYCLEICO, - MT_QUESTIONBOX, - MT_GRAVITYBOX, - MT_SCORETVSMALL, - MT_SCORETVLARGE, - // Monitor miscellany - MT_MONITOREXPLOSION, - MT_REDMONITOREXPLOSION, - MT_BLUEMONITOREXPLOSION, - MT_RINGICO, - MT_SHOESICO, - MT_INVCICO, - MT_1UPICO, - MT_YSHIELDICO, - MT_BSHIELDICO, - MT_KSHIELDICO, - MT_WSHIELDICO, - MT_GSHIELDICO, - MT_PITYSHIELDICO, - MT_EGGMANICO, - MT_MIXUPICO, - MT_GRAVITYICO, - MT_SCOREICOSMALL, - MT_SCOREICOLARGE, + MT_BOXSPARKLE, + + // Monitor boxes -- regular + MT_RING_BOX, + MT_PITY_BOX, + MT_ATTRACT_BOX, + MT_FORCE_BOX, + MT_ARMAGEDDON_BOX, + MT_WHIRLWIND_BOX, + MT_ELEMENTAL_BOX, + MT_SNEAKERS_BOX, + MT_INVULN_BOX, + MT_1UP_BOX, + MT_EGGMAN_BOX, + MT_MIXUP_BOX, + MT_MYSTERY_BOX, + MT_GRAVITY_BOX, + MT_RECYCLER_BOX, + MT_SCORE1K_BOX, + MT_SCORE10K_BOX, + + // Monitor boxes -- repeating (big) boxes + MT_RING_BIGBOX, + MT_PITY_BIGBOX, + MT_ATTRACT_BIGBOX, + MT_FORCE_BIGBOX, + MT_ARMAGEDDON_BIGBOX, + MT_WHIRLWIND_BIGBOX, + MT_ELEMENTAL_BIGBOX, + MT_SNEAKERS_BIGBOX, + MT_INVULN_BIGBOX, + MT_1UP_BIGBOX, + MT_EGGMAN_BIGBOX, + MT_MIXUP_BIGBOX, + MT_MYSTERY_BIGBOX, + MT_GRAVITY_BIGBOX, + MT_RECYCLER_BIGBOX, + MT_SCORE1K_BIGBOX, + MT_SCORE10K_BIGBOX, + + // Monitor boxes -- special + MT_RING_REDBOX, + MT_RING_BLUEBOX, + + // Monitor icons + MT_RING_ICON, + MT_PITY_ICON, + MT_ATTRACT_ICON, + MT_FORCE_ICON, + MT_ARMAGEDDON_ICON, + MT_WHIRLWIND_ICON, + MT_ELEMENTAL_ICON, + MT_SNEAKERS_ICON, + MT_INVULN_ICON, + MT_1UP_ICON, + MT_EGGMAN_ICON, + MT_MIXUP_ICON, + MT_GRAVITY_ICON, + MT_RECYCLER_ICON, + MT_SCORE1K_ICON, + MT_SCORE10K_ICON, // Projectiles MT_ROCKET, diff --git a/src/p_enemy.c b/src/p_enemy.c index d5da92e38..d050972db 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -818,6 +818,32 @@ static int P_RecycleCompare(const void *p1, const void *p2) } #endif +// Handles random monitor weights via console. +static mobjtype_t P_DoRandomBoxChances(void) +{ + mobjtype_t spawnchance[256]; + INT32 numchoices = 0, i = 0; + +#define QUESTIONBOXCHANCES(type, cvar) \ +for (i = cvar.value; i; --i) spawnchance[numchoices++] = type + QUESTIONBOXCHANCES(MT_RING_ICON, cv_superring); + QUESTIONBOXCHANCES(MT_SNEAKERS_ICON, cv_supersneakers); + QUESTIONBOXCHANCES(MT_INVULN_ICON, cv_invincibility); + QUESTIONBOXCHANCES(MT_WHIRLWIND_ICON, cv_jumpshield); + QUESTIONBOXCHANCES(MT_ELEMENTAL_ICON, cv_watershield); + QUESTIONBOXCHANCES(MT_ATTRACT_ICON, cv_ringshield); + QUESTIONBOXCHANCES(MT_FORCE_ICON, cv_forceshield); + QUESTIONBOXCHANCES(MT_ARMAGEDDON_ICON, cv_bombshield); + QUESTIONBOXCHANCES(MT_1UP_ICON, cv_1up); + QUESTIONBOXCHANCES(MT_EGGMAN_ICON, cv_eggmanbox); + QUESTIONBOXCHANCES(MT_MIXUP_ICON, cv_teleporters); + QUESTIONBOXCHANCES(MT_RECYCLER_ICON, cv_recycler); +#undef QUESTIONBOXCHANCES + + if (numchoices == 0) return MT_NULL; + return spawnchance[P_RandomKey(numchoices)]; +} + // // ACTION ROUTINES // @@ -2515,7 +2541,7 @@ void A_1upThinker(mobj_t *actor) if (closestplayer == -1 || skins[players[closestplayer].skin].sprites[SPR2_LIFE].numframes == 0) { // Closest player not found (no players in game?? may be empty dedicated server!), or does not have correct sprite. - actor->frame = 0; + actor->sprite = SPR_TV1U; if (actor->tracer) { P_RemoveMobj(actor->tracer); actor->tracer = NULL; @@ -2543,139 +2569,194 @@ void A_1upThinker(mobj_t *actor) // void A_MonitorPop(mobj_t *actor) { - mobj_t *remains; - mobjtype_t explode; mobjtype_t item = 0; - mobjtype_t newbox; + mobj_t *newmobj; #ifdef HAVE_BLUA if (LUA_CallAction("A_MonitorPop", actor)) return; #endif - // de-solidify + // Spawn the "pop" explosion. + if (actor->info->deathsound) + S_StartSound(actor, actor->info->deathsound); + P_SpawnMobjFromMobj(actor, 0, 0, actor->height/4, MT_EXPLODE); + + // We're dead now. De-solidify. actor->health = 0; P_UnsetThingPosition(actor); actor->flags &= ~MF_SOLID; actor->flags |= MF_NOCLIP; P_SetThingPosition(actor); - // Monitor explosion - explode = mobjinfo[actor->info->speed].mass; - remains = P_SpawnMobj(actor->x, actor->y, - ((actor->eflags & MFE_VERTICALFLIP) ? (actor->z + 3*(actor->height/4) - FixedMul(mobjinfo[explode].height, actor->scale)) : (actor->z + actor->height/4)), explode); - if (actor->eflags & MFE_VERTICALFLIP) + if (actor->info->damage == MT_UNKNOWN) { - remains->eflags |= MFE_VERTICALFLIP; - remains->flags2 |= MF2_OBJECTFLIP; - } - remains->destscale = actor->destscale; - P_SetScale(remains, actor->scale); + // MT_UNKNOWN is random. Because it's unknown to us... get it? + item = P_DoRandomBoxChances(); - remains = P_SpawnMobj(actor->x, actor->y, - ((actor->eflags & MFE_VERTICALFLIP) ? (actor->z + actor->height - FixedMul(mobjinfo[actor->info->speed].height, actor->scale)) : actor->z), - actor->info->speed); - remains->type = actor->type; // Transfer type information - P_UnsetThingPosition(remains); - if (sector_list) - { - P_DelSeclist(sector_list); - sector_list = NULL; - } - P_SetThingPosition(remains); - remains->destscale = actor->destscale; - P_SetScale(remains, actor->scale); - remains->flags = actor->flags; // Transfer flags - remains->flags2 = actor->flags2; // Transfer flags2 - remains->fuse = actor->fuse; // Transfer respawn timer - remains->threshold = 68; - remains->skin = NULL; - - P_SetTarget(&tmthing, remains); - - if (actor->info->deathsound) - S_StartSound(remains, actor->info->deathsound); - - switch (actor->type) - { - case MT_QUESTIONBOX: // Random! + if (item == MT_NULL) { - mobjtype_t spawnchance[256]; - INT32 numchoices = 0, i = 0; - -#define QUESTIONBOXCHANCES(type, cvar) \ -for (i = cvar.value; i; --i) spawnchance[numchoices++] = type - - QUESTIONBOXCHANCES(MT_SUPERRINGBOX, cv_superring); - QUESTIONBOXCHANCES(MT_SNEAKERTV, cv_supersneakers); - QUESTIONBOXCHANCES(MT_INV, cv_invincibility); - QUESTIONBOXCHANCES(MT_WHITETV, cv_jumpshield); - QUESTIONBOXCHANCES(MT_GREENTV, cv_watershield); - QUESTIONBOXCHANCES(MT_YELLOWTV, cv_ringshield); - QUESTIONBOXCHANCES(MT_BLUETV, cv_forceshield); - QUESTIONBOXCHANCES(MT_BLACKTV, cv_bombshield); - QUESTIONBOXCHANCES(MT_PRUP, cv_1up); - QUESTIONBOXCHANCES(MT_EGGMANBOX, cv_eggmanbox); - QUESTIONBOXCHANCES(MT_MIXUPBOX, cv_teleporters); - QUESTIONBOXCHANCES(MT_RECYCLETV, cv_recycler); - -#undef QUESTIONBOXCHANCES - - if (numchoices == 0) - { - CONS_Alert(CONS_WARNING, M_GetText("All monitors turned off.\n")); - return; - } - - newbox = spawnchance[P_RandomKey(numchoices)]; - item = mobjinfo[newbox].damage; - - remains->flags &= ~MF_AMBUSH; - break; - } - default: - item = actor->info->damage; - break; - } - - if (item != 0) - { - mobj_t *newmobj; - - if (actor->eflags & MFE_VERTICALFLIP) - { - newmobj = P_SpawnMobj(actor->x, actor->y, actor->z + actor->height - FixedMul(13*FRACUNIT + mobjinfo[item].height, actor->scale), item); - newmobj->eflags |= MFE_VERTICALFLIP; - } - else - newmobj = P_SpawnMobj(actor->x, actor->y, actor->z + FixedMul(13*FRACUNIT, actor->scale), item); - - newmobj->destscale = actor->destscale; - P_SetScale(newmobj, actor->scale); - P_SetTarget(&newmobj->target, actor->target); // Transfer target - if (item == MT_1UPICO && newmobj->target->player) - { - if (actor->tracer) // Remove the old lives icon. - P_RemoveMobj(actor->tracer); - - if (!newmobj->target->skin || ((skin_t *)newmobj->target->skin)->sprites[SPR2_LIFE].numframes == 0) - newmobj->frame -= 2; // No lives icon for this player, use the default. - else - { // Spawn the lives icon. - remains = P_SpawnMobj(newmobj->x, newmobj->y, newmobj->z, MT_OVERLAY); - P_SetTarget(&remains->target, newmobj); - P_SetTarget(&newmobj->tracer, remains); - - remains->color = newmobj->target->player->mo->color; - remains->skin = &skins[newmobj->target->player->skin]; - P_SetMobjState(remains, newmobj->info->seestate); - } + CONS_Alert(CONS_WARNING, M_GetText("All monitors turned off.\n")); + return; } } else - CONS_Debug(DBG_GAMELOGIC, "Powerup item not defined in 'damage' field for A_MonitorPop\n"); + item = actor->info->damage; - P_RemoveMobj(actor); + if (item == 0) + { + CONS_Debug(DBG_GAMELOGIC, "Powerup item not defined in 'damage' field for A_MonitorPop\n"); + return; + } + + newmobj = P_SpawnMobjFromMobj(actor, 0, 0, 13*FRACUNIT, item); + P_SetTarget(&newmobj->target, actor->target); // Transfer target + + if (item == MT_1UP_ICON) + { + if (actor->tracer) // Remove the old lives icon. + P_RemoveMobj(actor->tracer); + + if (!newmobj->target + || !newmobj->target->player + || !newmobj->target->skin + || ((skin_t *)newmobj->target->skin)->sprites[SPR2_LIFE].numframes == 0) + newmobj->sprite = SPR_TV1U; // No lives icon for this player, use the default. + else + { // Spawn the lives icon. + mobj_t *livesico = P_SpawnMobjFromMobj(newmobj, 0, 0, 0, MT_OVERLAY); + P_SetTarget(&livesico->target, newmobj); + P_SetTarget(&newmobj->tracer, livesico); + + livesico->color = newmobj->target->player->mo->color; + livesico->skin = &skins[newmobj->target->player->skin]; + P_SetMobjState(livesico, newmobj->info->seestate); + } + } +} + +// Function: A_BigMonitorPop +// +// Description: Used by repeating monitors when they turn off. They don't really pop, but, you know... +// +// var1 = unused +// var2 = unused +// +void A_BigMonitorPop(mobj_t *actor) +{ + mobjtype_t item = 0; + mobj_t *newmobj; + +#ifdef HAVE_BLUA + if (LUA_CallAction("A_BigMonitorPop", actor)) + return; +#endif + + // Don't spawn the "pop" explosion, because the monitor isn't broken. + if (actor->info->deathsound) + S_StartSound(actor, actor->info->deathsound); + //P_SpawnMobjFromMobj(actor, 0, 0, actor.height/4, MT_EXPLODE); + + // Remove our flags for a bit. + // Players can now stand on top of us. + P_UnsetThingPosition(actor); + actor->flags &= ~(MF_MONITOR|MF_SHOOTABLE); + actor->flags2 |= MF2_STANDONME; + P_SetThingPosition(actor); + + // Don't count this box in statistics. Sorry. + if (actor->target && actor->target->player) + --actor->target->player->numboxes; + actor->fuse = 0; // Don't let the monitor code screw us up. + + if (actor->info->damage == MT_UNKNOWN) + { + // MT_UNKNOWN is random. Because it's unknown to us... get it? + item = P_DoRandomBoxChances(); + + if (item == MT_NULL) + { + CONS_Alert(CONS_WARNING, M_GetText("All monitors turned off.\n")); + return; + } + } + else + item = actor->info->damage; + + if (item == 0) + { + CONS_Debug(DBG_GAMELOGIC, "Powerup item not defined in 'damage' field for A_BigMonitorPop\n"); + return; + } + + // Note: the icon spawns 1 fracunit higher + newmobj = P_SpawnMobjFromMobj(actor, 0, 0, 14*FRACUNIT, item); + P_SetTarget(&newmobj->target, actor->target); // Transfer target + + if (item == MT_1UP_ICON) + { + if (actor->tracer) // Remove the old lives icon. + P_RemoveMobj(actor->tracer); + + if (!newmobj->target + || !newmobj->target->player + || !newmobj->target->skin + || ((skin_t *)newmobj->target->skin)->sprites[SPR2_LIFE].numframes == 0) + newmobj->sprite = SPR_TV1U; // No lives icon for this player, use the default. + else + { // Spawn the lives icon. + mobj_t *livesico = P_SpawnMobjFromMobj(newmobj, 0, 0, 0, MT_OVERLAY); + P_SetTarget(&livesico->target, newmobj); + P_SetTarget(&newmobj->tracer, livesico); + + livesico->color = newmobj->target->player->mo->color; + livesico->skin = &skins[newmobj->target->player->skin]; + P_SetMobjState(livesico, newmobj->info->seestate); + } + } +} + +// Function: A_BigMonitorRestore +// +// Description: A repeating monitor is coming back to life. Reset monitor flags, etc. +// +// var1 = unused +// var2 = unused +// +void A_BigMonitorRestore(mobj_t *actor) +{ +#ifdef HAVE_BLUA + if (LUA_CallAction("A_BigMonitorRestore", actor)) + return; +#endif + + actor->flags |= MF_MONITOR|MF_SHOOTABLE; + actor->flags2 &= ~MF2_STANDONME; + actor->health = 1; // Just in case. +} + +// Function: A_BigMonitorSparkle +// +// Description: Spawns the little sparkly effect around big monitors. Looks pretty, doesn't it? +// +// var1 = unused +// var2 = unused +// +void A_BigMonitorSparkle(mobj_t *actor) +{ + fixed_t i, ngangle, xofs, yofs; + +#ifdef HAVE_BLUA + if (LUA_CallAction("A_BigMonitorSparkle", actor)) + return; +#endif + + ngangle = FixedAngle(((leveltime * 21) % 360) << FRACBITS); + xofs = FINESINE((ngangle>>ANGLETOFINESHIFT) & FINEMASK) * (actor->radius>>FRACBITS); + yofs = FINECOSINE((ngangle>>ANGLETOFINESHIFT) & FINEMASK) * (actor->radius>>FRACBITS); + + for (i = FRACUNIT*2; i <= FRACUNIT*3; i += FRACUNIT/2) + P_SetObjectMomZ(P_SpawnMobjFromMobj(actor, xofs, yofs, 0, MT_BOXSPARKLE), i, false); } // Function: A_Explode @@ -3160,8 +3241,8 @@ void A_ExtraLife(mobj_t *actor) player = actor->target->player; - if (actor->type == MT_1UPICO && !actor->tracer) - actor->frame -= 2; // No lives icon for this player, use the default. + if (actor->type == MT_1UP_ICON && !actor->tracer) + actor->sprite = SPR_TV1U; // No lives icon for this player, use the default. if (ultimatemode) //I don't THINK so! { diff --git a/src/p_inter.c b/src/p_inter.c index f9dc3c342..9634e0744 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1568,8 +1568,7 @@ static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *sour } else switch (source->type) { - case MT_EGGMANICO: - case MT_EGGMANBOX: + case MT_EGGMAN_ICON: str = M_GetText("%s was %s by Eggman's nefarious TV magic.\n"); break; case MT_SPIKE: @@ -2766,10 +2765,10 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if (!force) { // Special case for team ring boxes - if (target->type == MT_REDRINGBOX && !(source->player->ctfteam == 1)) + if (target->type == MT_RING_REDBOX && !(source->player->ctfteam == 1)) return false; - if (target->type == MT_BLUERINGBOX && !(source->player->ctfteam == 2)) + if (target->type == MT_RING_BLUEBOX && !(source->player->ctfteam == 2)) return false; } diff --git a/src/p_local.h b/src/p_local.h index 498bf0828..2f00b1d0b 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -238,6 +238,8 @@ boolean P_InsideANonSolidFFloor(mobj_t *mobj, ffloor_t *rover); boolean P_CheckDeathPitCollide(mobj_t *mo); boolean P_CheckSolidLava(mobj_t *mo, ffloor_t *rover); +mobj_t *P_SpawnMobjFromMobj(mobj_t *mobj, fixed_t xofs, fixed_t yofs, fixed_t zofs, mobjtype_t type); + mobj_t *P_SpawnMissile(mobj_t *source, mobj_t *dest, mobjtype_t type); mobj_t *P_SpawnXYZMissile(mobj_t *source, mobj_t *dest, mobjtype_t type, fixed_t x, fixed_t y, fixed_t z); mobj_t *P_SpawnPointMissile(mobj_t *source, fixed_t xa, fixed_t ya, fixed_t za, mobjtype_t type, fixed_t x, fixed_t y, fixed_t z); diff --git a/src/p_map.c b/src/p_map.c index 214048fb3..faa3d44c9 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -955,7 +955,7 @@ static boolean PIT_CheckThing(mobj_t *thing) // Monitors are not treated as solid to players who are jumping, spinning or gliding, // unless it's a CTF team monitor and you're on the wrong team else if (thing->flags & MF_MONITOR && tmthing->player && tmthing->player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING) - && !((thing->type == MT_REDRINGBOX && tmthing->player->ctfteam != 1) || (thing->type == MT_BLUERINGBOX && tmthing->player->ctfteam != 2))) + && !((thing->type == MT_RING_REDBOX && tmthing->player->ctfteam != 1) || (thing->type == MT_RING_BLUEBOX && tmthing->player->ctfteam != 2))) ; // z checking at last // Treat noclip things as non-solid! diff --git a/src/p_mobj.c b/src/p_mobj.c index 915c742e8..86ddee029 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -7258,9 +7258,60 @@ void P_MobjThinker(mobj_t *mobj) mobj_t *flagmo, *newmobj; #ifdef HAVE_BLUA - if (!LUAh_MobjFuse(mobj) && !P_MobjWasRemoved(mobj)) + if (LUAh_MobjFuse(mobj) || P_MobjWasRemoved(mobj)) + ; + else #endif - switch (mobj->type) + if (mobj->info->flags & MF_MONITOR) + { + // Special case for ALL monitors. + // If a box's speed is nonzero, it's allowed to respawn as a WRM/SRM. + if (mobj->info->speed != 0 && (mobj->flags & MF_AMBUSH || mobj->flags2 & MF2_STRONGBOX)) + { + mobjtype_t spawnchance[64]; + INT32 numchoices = 0, i = 0; + +// This define should make it a lot easier to organize and change monitor weights +#define SETMONITORCHANCES(type, strongboxamt, weakboxamt) \ +for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) spawnchance[numchoices++] = type + + // Type SRM WRM + SETMONITORCHANCES(MT_SNEAKERS_BOX, 0, 10); // Super Sneakers + SETMONITORCHANCES(MT_INVULN_BOX, 2, 0); // Invincibility + SETMONITORCHANCES(MT_WHIRLWIND_BOX, 3, 8); // Whirlwind Shield + SETMONITORCHANCES(MT_ELEMENTAL_BOX, 3, 8); // Elemental Shield + SETMONITORCHANCES(MT_ATTRACT_BOX, 2, 0); // Attraction Shield + SETMONITORCHANCES(MT_FORCE_BOX, 3, 3); // Force Shield + SETMONITORCHANCES(MT_ARMAGEDDON_BOX, 2, 0); // Armageddon Shield + SETMONITORCHANCES(MT_MIXUP_BOX, 0, 1); // Teleporters + SETMONITORCHANCES(MT_RECYCLER_BOX, 0, 1); // Recycler + SETMONITORCHANCES(MT_1UP_BOX, 1, 1); // 1-Up + // ======================================= + // Total 16 32 + +#undef SETMONITORCHANCES + + i = P_RandomKey(numchoices); // Gotta love those random numbers! + newmobj = P_SpawnMobj(mobj->x, mobj->y, mobj->z, spawnchance[i]); + + // If the monitor respawns randomly, transfer the flag. + if (mobj->flags & MF_AMBUSH) + newmobj->flags |= MF_AMBUSH; + + // Transfer flags2 (strongbox, objectflip) + newmobj->flags2 = mobj->flags2; + } + else + { + newmobj = P_SpawnMobj(mobj->x, mobj->y, mobj->z, mobj->type); + + // Transfer flags2 (strongbox, objectflip) + newmobj->flags2 = mobj->flags2; + } + P_RemoveMobj(mobj); // make sure they disappear + return; + } + else switch (mobj->type) { // gargoyle and snowman handled in P_PushableThinker, not here case MT_THROWNGRENADE: @@ -7317,68 +7368,6 @@ void P_MobjThinker(mobj_t *mobj) } P_RemoveMobj(mobj); return; - case MT_YELLOWTV: // Ring shield box - case MT_BLUETV: // Force shield box - case MT_GREENTV: // Water shield box - case MT_BLACKTV: // Bomb shield box - case MT_WHITETV: // Jump shield box - case MT_SNEAKERTV: // Super Sneaker box - case MT_SUPERRINGBOX: // 10-Ring box - case MT_REDRINGBOX: // Red Team 10-Ring box - case MT_BLUERINGBOX: // Blue Team 10-Ring box - case MT_INV: // Invincibility box - case MT_MIXUPBOX: // Teleporter Mixup box - case MT_RECYCLETV: // Recycler box - case MT_SCORETVSMALL: - case MT_SCORETVLARGE: - case MT_PRUP: // 1up! - case MT_EGGMANBOX: // Eggman box - case MT_GRAVITYBOX: // Gravity box - case MT_QUESTIONBOX: - if ((mobj->flags & MF_AMBUSH || mobj->flags2 & MF2_STRONGBOX) && mobj->type != MT_QUESTIONBOX) - { - mobjtype_t spawnchance[64]; - INT32 numchoices = 0, i = 0; - -// This define should make it a lot easier to organize and change monitor weights -#define SETMONITORCHANCES(type, strongboxamt, weakboxamt) \ -for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) spawnchance[numchoices++] = type - - // Type SRM WRM - SETMONITORCHANCES(MT_SNEAKERTV, 0, 10); // Super Sneakers - SETMONITORCHANCES(MT_INV, 2, 0); // Invincibility - SETMONITORCHANCES(MT_WHITETV, 3, 8); // Whirlwind Shield - SETMONITORCHANCES(MT_GREENTV, 3, 8); // Elemental Shield - SETMONITORCHANCES(MT_YELLOWTV, 2, 0); // Attraction Shield - SETMONITORCHANCES(MT_BLUETV, 3, 3); // Force Shield - SETMONITORCHANCES(MT_BLACKTV, 2, 0); // Armageddon Shield - SETMONITORCHANCES(MT_MIXUPBOX, 0, 1); // Teleporters - SETMONITORCHANCES(MT_RECYCLETV, 0, 1); // Recycler - SETMONITORCHANCES(MT_PRUP, 1, 1); // 1-Up - // ====================================== - // Total 16 32 - -#undef SETMONITORCHANCES - - i = P_RandomKey(numchoices); // Gotta love those random numbers! - newmobj = P_SpawnMobj(mobj->x, mobj->y, mobj->z, spawnchance[i]); - - // If the monitor respawns randomly, transfer the flag. - if (mobj->flags & MF_AMBUSH) - newmobj->flags |= MF_AMBUSH; - - // Transfer flags2 (strongbox, objectflip) - newmobj->flags2 = mobj->flags2; - } - else - { - newmobj = P_SpawnMobj(mobj->x, mobj->y, mobj->z, mobj->type); - - // Transfer flags2 (strongbox, objectflip) - newmobj->flags2 = mobj->flags2; - } - P_RemoveMobj(mobj); // make sure they disappear - return; case MT_METALSONIC_BATTLE: break; // don't remove case MT_SPIKE: @@ -7395,6 +7384,7 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s default: P_SetMobjState(mobj, mobj->info->xdeathstate); // will remove the mobj if S_NULL. break; + // Looking for monitors? They moved to a special condition above. } if (P_MobjWasRemoved(mobj)) return; @@ -8805,9 +8795,9 @@ void P_SpawnMapThing(mapthing_t *mthing) if ((mobjinfo[i].flags & MF_MONITOR) && cv_competitionboxes.value) // not Normal { if (cv_competitionboxes.value == 1) // Random - i = MT_QUESTIONBOX; + i = MT_MYSTERY_BOX; else if (cv_competitionboxes.value == 2) // Teleports - i = MT_MIXUPBOX; + i = MT_MIXUP_BOX; else if (cv_competitionboxes.value == 3) // None return; // Don't spawn! } @@ -8819,12 +8809,12 @@ void P_SpawnMapThing(mapthing_t *mthing) if ((mobjinfo[i].flags & MF_MONITOR) && cv_matchboxes.value) // not Normal { if (cv_matchboxes.value == 1) // Random - i = MT_QUESTIONBOX; + i = MT_MYSTERY_BOX; else if (cv_matchboxes.value == 3) // Don't spawn return; else // cv_matchboxes.value == 2, Non-Random { - if (i == MT_QUESTIONBOX) + if (i == MT_MYSTERY_BOX) return; // don't spawn in Non-Random mthing->options &= ~(MTF_AMBUSH|MTF_OBJECTSPECIAL); // no random respawning! @@ -8836,8 +8826,8 @@ void P_SpawnMapThing(mapthing_t *mthing) { if (i == MT_BLUETEAMRING || i == MT_REDTEAMRING) i = MT_RING; - else if (i == MT_BLUERINGBOX || i == MT_REDRINGBOX) - i = MT_SUPERRINGBOX; + else if (i == MT_RING_BLUEBOX || i == MT_RING_REDBOX) + i = MT_RING_BOX; else if (i == MT_BLUEFLAG || i == MT_REDFLAG) return; // No flags in non-CTF modes! } @@ -8864,23 +8854,27 @@ void P_SpawnMapThing(mapthing_t *mthing) return; /// \todo // 1UPs -->> Score TVs - else if (i == MT_PRUP) // 1UP + else if (i == MT_1UP_BOX) // 1UP { // Either or, doesn't matter which. if (mthing->options & (MTF_AMBUSH|MTF_OBJECTSPECIAL)) - i = MT_SCORETVLARGE; // 10,000 + i = MT_SCORE10K_BOX; // 10,000 else - i = MT_SCORETVSMALL; // 1,000 + i = MT_SCORE1K_BOX; // 1,000 } } if (ultimatemode) { - if (i == MT_PITYTV || i == MT_GREENTV || i == MT_YELLOWTV || i == MT_BLUETV || i == MT_BLACKTV || i == MT_WHITETV) + if (i == MT_PITY_BOX || i == MT_ELEMENTAL_BOX || i == MT_ATTRACT_BOX + || i == MT_FORCE_BOX || i == MT_ARMAGEDDON_BOX || i == MT_WHIRLWIND_BOX) return; // No shields in Ultimate mode - if (i == MT_SUPERRINGBOX && !G_IsSpecialStage(gamemap)) + if (i == MT_RING_BOX && !G_IsSpecialStage(gamemap)) return; // No rings in Ultimate mode (except special stages) + + // Don't include the BIGBOXes (repeating monitors) here please. + // They're likely facets of the level's design and therefore required to progress. } if (i == MT_EMMY && (gametype != GT_COOP || ultimatemode || tokenbits == 30 || tokenlist & (1 << tokenbits++))) @@ -9306,8 +9300,10 @@ ML_NOCLIMB : Direction not controllable } //count 10 ring boxes into the number of rings equation too. - if (i == MT_SUPERRINGBOX) + if (i == MT_RING_BOX) nummaprings += 10; + if (i == MT_RING_BIGBOX) // Theoretically infinite + nummaprings += 10000; if (i == MT_BIGTUMBLEWEED || i == MT_LITTLETUMBLEWEED) { @@ -9385,16 +9381,11 @@ ML_NOCLIMB : Direction not controllable mobj->flags2 |= MF2_STANDONME; } - if (mobj->flags & MF_MONITOR) + if ((mobj->flags & MF_MONITOR) && mobj->info->speed != 0) { // flag for strong/weak random boxes - if (mthing->type == mobjinfo[MT_SUPERRINGBOX].doomednum || mthing->type == mobjinfo[MT_PRUP].doomednum || - mthing->type == mobjinfo[MT_SNEAKERTV].doomednum || mthing->type == mobjinfo[MT_INV].doomednum || - mthing->type == mobjinfo[MT_WHITETV].doomednum || mthing->type == mobjinfo[MT_GREENTV].doomednum || - mthing->type == mobjinfo[MT_YELLOWTV].doomednum || mthing->type == mobjinfo[MT_BLUETV].doomednum || - mthing->type == mobjinfo[MT_BLACKTV].doomednum || mthing->type == mobjinfo[MT_PITYTV].doomednum || - mthing->type == mobjinfo[MT_RECYCLETV].doomednum || mthing->type == mobjinfo[MT_MIXUPBOX].doomednum) - mobj->flags |= MF_AMBUSH; + // any monitor with nonzero speed is allowed to respawn like this + mobj->flags |= MF_AMBUSH; } else if (mthing->type != mobjinfo[MT_AXIS].doomednum && @@ -9407,14 +9398,12 @@ ML_NOCLIMB : Direction not controllable if (mthing->options & MTF_OBJECTSPECIAL) { - // flag for strong/weak random boxes - if (mthing->type == mobjinfo[MT_SUPERRINGBOX].doomednum || mthing->type == mobjinfo[MT_PRUP].doomednum || - mthing->type == mobjinfo[MT_SNEAKERTV].doomednum || mthing->type == mobjinfo[MT_INV].doomednum || - mthing->type == mobjinfo[MT_WHITETV].doomednum || mthing->type == mobjinfo[MT_GREENTV].doomednum || - mthing->type == mobjinfo[MT_YELLOWTV].doomednum || mthing->type == mobjinfo[MT_BLUETV].doomednum || - mthing->type == mobjinfo[MT_BLACKTV].doomednum || mthing->type == mobjinfo[MT_PITYTV].doomednum || - mthing->type == mobjinfo[MT_RECYCLETV].doomednum || mthing->type == mobjinfo[MT_MIXUPBOX].doomednum) - mobj->flags2 |= MF2_STRONGBOX; + if ((mobj->flags & MF_MONITOR) && mobj->info->speed != 0) + { + // flag for strong/weak random boxes + // any monitor with nonzero speed is allowed to respawn like this + mobj->flags2 |= MF2_STRONGBOX; + } // Requires you to be in bonus time to activate if (mobj->flags & MF_NIGHTSITEM) @@ -10411,3 +10400,35 @@ void P_FlashPal(player_t *pl, UINT16 type, UINT16 duration) pl->flashcount = duration; pl->flashpal = type; } + +// +// P_SpawnMobjFromMobj +// Spawns an object with offsets relative to the position of another object. +// Scale, gravity flip, etc. is taken into account automatically. +// +mobj_t *P_SpawnMobjFromMobj(mobj_t *mobj, fixed_t xofs, fixed_t yofs, fixed_t zofs, mobjtype_t type) +{ + mobj_t *newmobj; + + xofs = FixedMul(xofs, mobj->scale); + yofs = FixedMul(yofs, mobj->scale); + zofs = FixedMul(zofs, mobj->scale); + + newmobj = P_SpawnMobj(mobj->x + xofs, mobj->y + yofs, mobj->z + zofs, type); + if (!newmobj) + return NULL; + + if (mobj->eflags & MFE_VERTICALFLIP) + { + fixed_t elementheight = FixedMul(newmobj->info->height, mobj->scale); + + newmobj->eflags |= MFE_VERTICALFLIP; + newmobj->flags2 |= MF2_OBJECTFLIP; + newmobj->z = mobj->z + mobj->height - zofs - elementheight; + } + + newmobj->destscale = mobj->destscale; + P_SetScale(newmobj, mobj->scale); + return newmobj; +} + diff --git a/src/p_user.c b/src/p_user.c index 8854d8d64..d7ff8c27a 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8651,7 +8651,7 @@ void P_DoPityCheck(player_t *player) if ((player->pity >= 3 || player->pity < 0) && player->powers[pw_shield] == SH_NONE) { if (player->pity > 0) - S_StartSound(player->mo, mobjinfo[MT_PITYSHIELDICO].seesound); + S_StartSound(player->mo, mobjinfo[MT_PITY_ICON].seesound); player->pity = 0; player->powers[pw_shield] = SH_PITY; diff --git a/src/sounds.c b/src/sounds.c index 1ec86e7bc..50bf6f29a 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1220,6 +1220,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"lvpass", false, 96, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"mindig", false, 8, 64, -1, NULL, 0, -1, -1, LUMPERROR}, {"mixup", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"monton", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"pogo" , false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"pop" , false, 78, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"rail1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, diff --git a/src/sounds.h b/src/sounds.h index c5851a346..8c2659ddb 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -1308,6 +1308,7 @@ typedef enum sfx_lvpass, sfx_mindig, sfx_mixup, + sfx_monton, sfx_pogo, sfx_pop, sfx_rail1, From 98f652aca6e0019c5c490fe45177d2eb28eb0ceb Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 31 Dec 2015 15:29:08 -0800 Subject: [PATCH 023/808] Big monitors are "Gold Monitors" now. The useless ones have been removed, too, and they should always spawn as what they should regardless of settings. By the way, graphics are at https://dl.dropboxusercontent.com/u/3518218/22/monitorgfx.wad --- src/dehacked.c | 76 +++++------ src/info.c | 350 +++++++++---------------------------------------- src/info.h | 76 +++++------ src/p_enemy.c | 20 +-- src/p_mobj.c | 31 +++-- 5 files changed, 148 insertions(+), 405 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index d0f582385..0aa577e3d 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1628,9 +1628,9 @@ static actionpointer_t actionpointers[] = {{A_Pain}, "A_PAIN"}, {{A_Fall}, "A_FALL"}, {{A_MonitorPop}, "A_MONITORPOP"}, - {{A_BigMonitorPop}, "A_BIGMONITORPOP"}, - {{A_BigMonitorRestore}, "A_BIGMONITORRESTORE"}, - {{A_BigMonitorSparkle}, "A_BIGMONITORSPARKLE"}, + {{A_GoldMonitorPop}, "A_GOLDMONITORPOP"}, + {{A_GoldMonitorRestore}, "A_GOLDMONITORRESTORE"}, + {{A_GoldMonitorSparkle}, "A_GOLDMONITORSPARKLE"}, {{A_Look}, "A_LOOK"}, {{A_Chase}, "A_CHASE"}, {{A_FaceStabChase}, "A_FACESTABCHASE"}, @@ -4867,14 +4867,14 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_BOX_POP1", "S_BOX_POP2", - "S_BIGBOX_FLICKER", - "S_BIGBOX_OFF1", - "S_BIGBOX_OFF2", - "S_BIGBOX_OFF3", - "S_BIGBOX_OFF4", - "S_BIGBOX_OFF5", - "S_BIGBOX_OFF6", - "S_BIGBOX_OFF7", + "S_GOLDBOX_FLICKER", + "S_GOLDBOX_OFF1", + "S_GOLDBOX_OFF2", + "S_GOLDBOX_OFF3", + "S_GOLDBOX_OFF4", + "S_GOLDBOX_OFF5", + "S_GOLDBOX_OFF6", + "S_GOLDBOX_OFF7", // Monitor States (one per box) "S_MYSTERY_BOX", @@ -4895,24 +4895,16 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_SCORE1K_BOX", "S_SCORE10K_BOX", - // Repeat Monitor States (one per box) - "S_MYSTERY_BIGBOX", - "S_RING_BIGBOX", - "S_PITY_BIGBOX", - "S_ATTRACT_BIGBOX", - "S_FORCE_BIGBOX", - "S_ARMAGEDDON_BIGBOX", - "S_WHIRLWIND_BIGBOX", - "S_ELEMENTAL_BIGBOX", - "S_SNEAKERS_BIGBOX", - "S_INVULN_BIGBOX", - "S_1UP_BIGBOX", - "S_EGGMAN_BIGBOX", - "S_MIXUP_BIGBOX", - "S_GRAVITY_BIGBOX", - "S_RECYCLER_BIGBOX", - "S_SCORE1K_BIGBOX", - "S_SCORE10K_BIGBOX", + // Gold Repeat Monitor States (one per box) + "S_PITY_GOLDBOX", + "S_ATTRACT_GOLDBOX", + "S_FORCE_GOLDBOX", + "S_ARMAGEDDON_GOLDBOX", + "S_WHIRLWIND_GOLDBOX", + "S_ELEMENTAL_GOLDBOX", + "S_SNEAKERS_GOLDBOX", + "S_INVULN_GOLDBOX", + "S_GRAVITY_GOLDBOX", // Team Ring Boxes (these are special) "S_RING_REDBOX1", @@ -6785,23 +6777,15 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_SCORE10K_BOX", // Monitor boxes -- repeating (big) boxes - "MT_RING_BIGBOX", - "MT_PITY_BIGBOX", - "MT_ATTRACT_BIGBOX", - "MT_FORCE_BIGBOX", - "MT_ARMAGEDDON_BIGBOX", - "MT_WHIRLWIND_BIGBOX", - "MT_ELEMENTAL_BIGBOX", - "MT_SNEAKERS_BIGBOX", - "MT_INVULN_BIGBOX", - "MT_1UP_BIGBOX", - "MT_EGGMAN_BIGBOX", - "MT_MIXUP_BIGBOX", - "MT_MYSTERY_BIGBOX", - "MT_GRAVITY_BIGBOX", - "MT_RECYCLER_BIGBOX", - "MT_SCORE1K_BIGBOX", - "MT_SCORE10K_BIGBOX", + "MT_PITY_GOLDBOX", + "MT_ATTRACT_GOLDBOX", + "MT_FORCE_GOLDBOX", + "MT_ARMAGEDDON_GOLDBOX", + "MT_WHIRLWIND_GOLDBOX", + "MT_ELEMENTAL_GOLDBOX", + "MT_SNEAKERS_GOLDBOX", + "MT_INVULN_GOLDBOX", + "MT_GRAVITY_GOLDBOX", // Monitor boxes -- special "MT_RING_REDBOX", diff --git a/src/info.c b/src/info.c index d00ecc5dc..af5126f3a 100644 --- a/src/info.c +++ b/src/info.c @@ -1248,14 +1248,14 @@ state_t states[NUMSTATES] = {SPR_MSTV, 0, 4, {A_MonitorPop}, 0, 0, S_BOX_POP2}, // S_BOX_POP1 {SPR_MSTV, 1, -1, {NULL}, 0, 0, S_NULL}, // S_BOX_POP2 - {SPR_XLTV, 0, 1, {NULL}, 0, 0, S_SPAWNSTATE}, // S_BIGBOX_FLICKER - {SPR_XLTV, 1, 89, {A_BigMonitorPop}, 0, 0, S_BIGBOX_OFF2}, // S_BIGBOX_OFF1 - {SPR_XLTV, 2, 4, {A_PlayAttackSound}, 0, 0, S_BIGBOX_OFF3}, // S_BIGBOX_OFF2 - {SPR_XLTV, 3, 4, {NULL}, 0, 0, S_BIGBOX_OFF4}, // S_BIGBOX_OFF3 - {SPR_XLTV, 4, 4, {NULL}, 0, 0, S_BIGBOX_OFF5}, // S_BIGBOX_OFF4 - {SPR_XLTV, 5, 2, {NULL}, 0, 0, S_BIGBOX_OFF6}, // S_BIGBOX_OFF5 - {SPR_XLTV, 6, 2, {NULL}, 0, 0, S_BIGBOX_OFF7}, // S_BIGBOX_OFF6 - {SPR_XLTV, 6, 0, {A_BigMonitorRestore}, 0, 0, S_SPAWNSTATE}, // S_BIGBOX_OFF7 + {SPR_XLTV, 0, 1, {NULL}, 0, 0, S_SPAWNSTATE}, // S_GOLDBOX_FLICKER + {SPR_XLTV, 1, 89, {A_GoldMonitorPop}, 0, 0, S_GOLDBOX_OFF2}, // S_GOLDBOX_OFF1 + {SPR_XLTV, 2, 4, {A_PlayAttackSound}, 0, 0, S_GOLDBOX_OFF3}, // S_GOLDBOX_OFF2 + {SPR_XLTV, 3, 4, {NULL}, 0, 0, S_GOLDBOX_OFF4}, // S_GOLDBOX_OFF3 + {SPR_XLTV, 4, 4, {NULL}, 0, 0, S_GOLDBOX_OFF5}, // S_GOLDBOX_OFF4 + {SPR_XLTV, 5, 2, {NULL}, 0, 0, S_GOLDBOX_OFF6}, // S_GOLDBOX_OFF5 + {SPR_XLTV, 6, 2, {NULL}, 0, 0, S_GOLDBOX_OFF7}, // S_GOLDBOX_OFF6 + {SPR_XLTV, 6, 0, {A_GoldMonitorRestore}, 0, 0, S_SPAWNSTATE}, // S_GOLDBOX_OFF7 // Monitor States (one per box) {SPR_TVMY, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_MYSTERY_BOX @@ -1276,24 +1276,16 @@ state_t states[NUMSTATES] = {SPR_TV1K, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_SCORE1K_BOX {SPR_TVTK, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_SCORE10K_BOX - // Repeat Monitor States (one per box) - {SPR_TVMY, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_MYSTERY_BIGBOX - {SPR_TVRI, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_RING_BIGBOX - {SPR_TVPI, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_PITY_BIGBOX - {SPR_TVAT, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_ATTRACT_BIGBOX - {SPR_TVFO, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_FORCE_BIGBOX - {SPR_TVAR, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_ARMAGEDDON_BIGBOX - {SPR_TVWW, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_WHIRLWIND_BIGBOX - {SPR_TVEL, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_ELEMENTAL_BIGBOX - {SPR_TVSS, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_SNEAKERS_BIGBOX - {SPR_TVIV, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_INVULN_BIGBOX - {SPR_TV1P, 1, 2, {A_DualAction}, S_MYSTERY_BIGBOX, S_1UP_BOX, S_BIGBOX_FLICKER}, // S_1UP_BIGBOX - {SPR_TVEG, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_EGGMAN_BIGBOX - {SPR_TVMX, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_MIXUP_BIGBOX - {SPR_TVGV, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_GRAVITY_BIGBOX - {SPR_TVRC, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_RECYCLER_BIGBOX - {SPR_TV1K, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_SCORE1K_BIGBOX - {SPR_TVTK, 1, 2, {A_BigMonitorSparkle}, 0, 0, S_BIGBOX_FLICKER}, // S_SCORE10K_BIGBOX + // Gold Repeat Monitor States (one per box) + {SPR_TVPI, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_PITY_GOLDBOX + {SPR_TVAT, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_ATTRACT_GOLDBOX + {SPR_TVFO, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_FORCE_GOLDBOX + {SPR_TVAR, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_ARMAGEDDON_GOLDBOX + {SPR_TVWW, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_WHIRLWIND_GOLDBOX + {SPR_TVEL, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_ELEMENTAL_GOLDBOX + {SPR_TVSS, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_SNEAKERS_GOLDBOX + {SPR_TVIV, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_INVULN_GOLDBOX + {SPR_TVGV, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_GRAVITY_GOLDBOX // Team Ring Boxes (these are special) {SPR_TRRI, 0, 2, {NULL}, 0, 0, S_RING_REDBOX2}, // S_RING_REDBOX1 @@ -6568,47 +6560,20 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_RING_BIGBOX - 430, // doomednum - S_RING_BIGBOX, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_monton, // attacksound - S_RING_BIGBOX, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_BIGBOX_OFF1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - 0, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_RING_ICON, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - { // MT_PITY_BIGBOX + { // MT_PITY_GOLDBOX 431, // doomednum - S_PITY_BIGBOX, // spawnstate + S_PITY_GOLDBOX, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound 8, // reactiontime sfx_monton, // attacksound - S_PITY_BIGBOX, // painstate + S_PITY_GOLDBOX, // painstate 0, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_BIGBOX_OFF1, // deathstate + S_GOLDBOX_OFF1, // deathstate S_NULL, // xdeathstate sfx_pop, // deathsound 0, // speed @@ -6618,24 +6583,24 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_PITY_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, - { // MT_ATTRACT_BIGBOX + { // MT_ATTRACT_GOLDBOX 432, // doomednum - S_ATTRACT_BIGBOX, // spawnstate + S_ATTRACT_GOLDBOX, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound 8, // reactiontime sfx_monton, // attacksound - S_ATTRACT_BIGBOX, // painstate + S_ATTRACT_GOLDBOX, // painstate 0, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_BIGBOX_OFF1, // deathstate + S_GOLDBOX_OFF1, // deathstate S_NULL, // xdeathstate sfx_pop, // deathsound 0, // speed @@ -6645,24 +6610,24 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_ATTRACT_ICON,// damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, - { // MT_FORCE_BIGBOX + { // MT_FORCE_GOLDBOX 433, // doomednum - S_FORCE_BIGBOX, // spawnstate + S_FORCE_GOLDBOX, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound 8, // reactiontime sfx_monton, // attacksound - S_FORCE_BIGBOX, // painstate + S_FORCE_GOLDBOX, // painstate 0, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_BIGBOX_OFF1, // deathstate + S_GOLDBOX_OFF1, // deathstate S_NULL, // xdeathstate sfx_pop, // deathsound 0, // speed @@ -6672,24 +6637,24 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_FORCE_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, - { // MT_ARMAGEDDON_BIGBOX + { // MT_ARMAGEDDON_GOLDBOX 434, // doomednum - S_ARMAGEDDON_BIGBOX, // spawnstate + S_ARMAGEDDON_GOLDBOX, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound 8, // reactiontime sfx_monton, // attacksound - S_ARMAGEDDON_BIGBOX, // painstate + S_ARMAGEDDON_GOLDBOX, // painstate 0, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_BIGBOX_OFF1, // deathstate + S_GOLDBOX_OFF1, // deathstate S_NULL, // xdeathstate sfx_pop, // deathsound 0, // speed @@ -6699,24 +6664,24 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_ARMAGEDDON_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, - { // MT_WHIRLWIND_BIGBOX + { // MT_WHIRLWIND_GOLDBOX 435, // doomednum - S_WHIRLWIND_BIGBOX, // spawnstate + S_WHIRLWIND_GOLDBOX, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound 8, // reactiontime sfx_monton, // attacksound - S_WHIRLWIND_BIGBOX, // painstate + S_WHIRLWIND_GOLDBOX, // painstate 0, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_BIGBOX_OFF1, // deathstate + S_GOLDBOX_OFF1, // deathstate S_NULL, // xdeathstate sfx_pop, // deathsound 0, // speed @@ -6726,24 +6691,24 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_WHIRLWIND_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, - { // MT_ELEMENTAL_BIGBOX + { // MT_ELEMENTAL_GOLDBOX 436, // doomednum - S_ELEMENTAL_BIGBOX, // spawnstate + S_ELEMENTAL_GOLDBOX, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound 8, // reactiontime sfx_monton, // attacksound - S_ELEMENTAL_BIGBOX, // painstate + S_ELEMENTAL_GOLDBOX, // painstate 0, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_BIGBOX_OFF1, // deathstate + S_GOLDBOX_OFF1, // deathstate S_NULL, // xdeathstate sfx_pop, // deathsound 0, // speed @@ -6753,24 +6718,24 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_ELEMENTAL_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, - { // MT_SNEAKERS_BIGBOX + { // MT_SNEAKERS_GOLDBOX 437, // doomednum - S_SNEAKERS_BIGBOX, // spawnstate + S_SNEAKERS_GOLDBOX, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound 8, // reactiontime sfx_monton, // attacksound - S_SNEAKERS_BIGBOX, // painstate + S_SNEAKERS_GOLDBOX, // painstate 0, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_BIGBOX_OFF1, // deathstate + S_GOLDBOX_OFF1, // deathstate S_NULL, // xdeathstate sfx_pop, // deathsound 0, // speed @@ -6780,24 +6745,24 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_SNEAKERS_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, - { // MT_INVULN_BIGBOX + { // MT_INVULN_GOLDBOX 438, // doomednum - S_INVULN_BIGBOX, // spawnstate + S_INVULN_GOLDBOX, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound 8, // reactiontime sfx_monton, // attacksound - S_INVULN_BIGBOX, // painstate + S_INVULN_GOLDBOX, // painstate 0, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_BIGBOX_OFF1, // deathstate + S_GOLDBOX_OFF1, // deathstate S_NULL, // xdeathstate sfx_pop, // deathsound 0, // speed @@ -6807,132 +6772,24 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_INVULN_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, - { // MT_1UP_BIGBOX - 439, // doomednum - S_1UP_BIGBOX, // spawnstate - 1, // spawnhealth - S_PLAY_BOX1, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_monton, // attacksound - S_1UP_BIGBOX, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_BIGBOX_OFF1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - 0, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_1UP_ICON, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - { // MT_EGGMAN_BIGBOX - 440, // doomednum - S_EGGMAN_BIGBOX, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_monton, // attacksound - S_EGGMAN_BIGBOX, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_BIGBOX_OFF1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - 0, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_EGGMAN_ICON, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - { // MT_MIXUP_BIGBOX - 441, // doomednum - S_MIXUP_BIGBOX, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_monton, // attacksound - S_MIXUP_BIGBOX, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_BIGBOX_OFF1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - 0, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_MIXUP_ICON, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - { // MT_MYSTERY_BIGBOX - 442, // doomednum - S_MYSTERY_BIGBOX, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_monton, // attacksound - S_MYSTERY_BIGBOX, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_BIGBOX_OFF1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - 0, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_UNKNOWN, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - { // MT_GRAVITY_BIGBOX + { // MT_GRAVITY_GOLDBOX 443, // doomednum - S_GRAVITY_BIGBOX, // spawnstate + S_GRAVITY_GOLDBOX, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound 8, // reactiontime sfx_monton, // attacksound - S_GRAVITY_BIGBOX, // painstate + S_GRAVITY_GOLDBOX, // painstate 0, // painchance sfx_None, // painsound S_NULL, // meleestate S_NULL, // missilestate - S_BIGBOX_OFF1, // deathstate + S_GOLDBOX_OFF1, // deathstate S_NULL, // xdeathstate sfx_pop, // deathsound 0, // speed @@ -6942,88 +6799,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass MT_GRAVITY_ICON, // damage sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - { // MT_RECYCLER_BIGBOX - 446, // doomednum - S_RECYCLER_BIGBOX, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_monton, // attacksound - S_RECYCLER_BIGBOX, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_BIGBOX_OFF1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - 0, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_RECYCLER_ICON, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - { // MT_SCORE1K_BIGBOX - 448, // doomednum - S_SCORE1K_BIGBOX, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_monton, // attacksound - S_SCORE1K_BIGBOX, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_BIGBOX_OFF1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - 0, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_SCORE1K_ICON, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags - S_NULL // raisestate - }, - - { // MT_SCORE10K_BIGBOX - 449, // doomednum - S_SCORE10K_BIGBOX, // spawnstate - 1, // spawnhealth - S_NULL, // seestate - sfx_None, // seesound - 8, // reactiontime - sfx_monton, // attacksound - S_SCORE10K_BIGBOX, // painstate - 0, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_BIGBOX_OFF1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - 0, // speed - 16*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - MT_SCORE10K_ICON, // damage - sfx_None, // activesound - MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags S_NULL // raisestate }, diff --git a/src/info.h b/src/info.h index d031addf5..d68bf5abb 100644 --- a/src/info.h +++ b/src/info.h @@ -28,9 +28,9 @@ void A_Explode(); void A_Pain(); void A_Fall(); void A_MonitorPop(); -void A_BigMonitorPop(); -void A_BigMonitorRestore(); -void A_BigMonitorSparkle(); +void A_GoldMonitorPop(); +void A_GoldMonitorRestore(); +void A_GoldMonitorSparkle(); void A_Look(); void A_Chase(); void A_FaceStabChase(); @@ -1765,14 +1765,14 @@ typedef enum state S_BOX_POP1, S_BOX_POP2, - S_BIGBOX_FLICKER, - S_BIGBOX_OFF1, - S_BIGBOX_OFF2, - S_BIGBOX_OFF3, - S_BIGBOX_OFF4, - S_BIGBOX_OFF5, - S_BIGBOX_OFF6, - S_BIGBOX_OFF7, + S_GOLDBOX_FLICKER, + S_GOLDBOX_OFF1, + S_GOLDBOX_OFF2, + S_GOLDBOX_OFF3, + S_GOLDBOX_OFF4, + S_GOLDBOX_OFF5, + S_GOLDBOX_OFF6, + S_GOLDBOX_OFF7, // Monitor States (one per box) S_MYSTERY_BOX, @@ -1793,24 +1793,16 @@ typedef enum state S_SCORE1K_BOX, S_SCORE10K_BOX, - // Repeat Monitor States (one per box) - S_MYSTERY_BIGBOX, - S_RING_BIGBOX, - S_PITY_BIGBOX, - S_ATTRACT_BIGBOX, - S_FORCE_BIGBOX, - S_ARMAGEDDON_BIGBOX, - S_WHIRLWIND_BIGBOX, - S_ELEMENTAL_BIGBOX, - S_SNEAKERS_BIGBOX, - S_INVULN_BIGBOX, - S_1UP_BIGBOX, - S_EGGMAN_BIGBOX, - S_MIXUP_BIGBOX, - S_GRAVITY_BIGBOX, - S_RECYCLER_BIGBOX, - S_SCORE1K_BIGBOX, - S_SCORE10K_BIGBOX, + // Gold Repeat Monitor States (one per box) + S_PITY_GOLDBOX, + S_ATTRACT_GOLDBOX, + S_FORCE_GOLDBOX, + S_ARMAGEDDON_GOLDBOX, + S_WHIRLWIND_GOLDBOX, + S_ELEMENTAL_GOLDBOX, + S_SNEAKERS_GOLDBOX, + S_INVULN_GOLDBOX, + S_GRAVITY_GOLDBOX, // Team Ring Boxes (these are special) S_RING_REDBOX1, @@ -3703,23 +3695,15 @@ typedef enum mobj_type MT_SCORE10K_BOX, // Monitor boxes -- repeating (big) boxes - MT_RING_BIGBOX, - MT_PITY_BIGBOX, - MT_ATTRACT_BIGBOX, - MT_FORCE_BIGBOX, - MT_ARMAGEDDON_BIGBOX, - MT_WHIRLWIND_BIGBOX, - MT_ELEMENTAL_BIGBOX, - MT_SNEAKERS_BIGBOX, - MT_INVULN_BIGBOX, - MT_1UP_BIGBOX, - MT_EGGMAN_BIGBOX, - MT_MIXUP_BIGBOX, - MT_MYSTERY_BIGBOX, - MT_GRAVITY_BIGBOX, - MT_RECYCLER_BIGBOX, - MT_SCORE1K_BIGBOX, - MT_SCORE10K_BIGBOX, + MT_PITY_GOLDBOX, + MT_ATTRACT_GOLDBOX, + MT_FORCE_GOLDBOX, + MT_ARMAGEDDON_GOLDBOX, + MT_WHIRLWIND_GOLDBOX, + MT_ELEMENTAL_GOLDBOX, + MT_SNEAKERS_GOLDBOX, + MT_INVULN_GOLDBOX, + MT_GRAVITY_GOLDBOX, // Monitor boxes -- special MT_RING_REDBOX, diff --git a/src/p_enemy.c b/src/p_enemy.c index d050972db..4555695c9 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -2635,20 +2635,20 @@ void A_MonitorPop(mobj_t *actor) } } -// Function: A_BigMonitorPop +// Function: A_GoldMonitorPop // // Description: Used by repeating monitors when they turn off. They don't really pop, but, you know... // // var1 = unused // var2 = unused // -void A_BigMonitorPop(mobj_t *actor) +void A_GoldMonitorPop(mobj_t *actor) { mobjtype_t item = 0; mobj_t *newmobj; #ifdef HAVE_BLUA - if (LUA_CallAction("A_BigMonitorPop", actor)) + if (LUA_CallAction("A_GoldMonitorPop", actor)) return; #endif @@ -2685,7 +2685,7 @@ void A_BigMonitorPop(mobj_t *actor) if (item == 0) { - CONS_Debug(DBG_GAMELOGIC, "Powerup item not defined in 'damage' field for A_BigMonitorPop\n"); + CONS_Debug(DBG_GAMELOGIC, "Powerup item not defined in 'damage' field for A_GoldMonitorPop\n"); return; } @@ -2716,17 +2716,17 @@ void A_BigMonitorPop(mobj_t *actor) } } -// Function: A_BigMonitorRestore +// Function: A_GoldMonitorRestore // // Description: A repeating monitor is coming back to life. Reset monitor flags, etc. // // var1 = unused // var2 = unused // -void A_BigMonitorRestore(mobj_t *actor) +void A_GoldMonitorRestore(mobj_t *actor) { #ifdef HAVE_BLUA - if (LUA_CallAction("A_BigMonitorRestore", actor)) + if (LUA_CallAction("A_GoldMonitorRestore", actor)) return; #endif @@ -2735,19 +2735,19 @@ void A_BigMonitorRestore(mobj_t *actor) actor->health = 1; // Just in case. } -// Function: A_BigMonitorSparkle +// Function: A_GoldMonitorSparkle // // Description: Spawns the little sparkly effect around big monitors. Looks pretty, doesn't it? // // var1 = unused // var2 = unused // -void A_BigMonitorSparkle(mobj_t *actor) +void A_GoldMonitorSparkle(mobj_t *actor) { fixed_t i, ngangle, xofs, yofs; #ifdef HAVE_BLUA - if (LUA_CallAction("A_BigMonitorSparkle", actor)) + if (LUA_CallAction("A_GoldMonitorSparkle", actor)) return; #endif diff --git a/src/p_mobj.c b/src/p_mobj.c index 86ddee029..f5d5ecf56 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8789,36 +8789,37 @@ void P_SpawnMapThing(mapthing_t *mthing) if ((mobjinfo[i].flags & MF_ENEMY) || (mobjinfo[i].flags & MF_BOSS)) return; - // Set powerup boxes to user settings for competition. - if (gametype == GT_COMPETITION) + // Altering monitor spawns via cvars + // If MF_GRENADEBOUNCE is set in the monitor's info, + // skip this step. (Used for gold monitors) + // Yeah, this is a dirty hack. + if ((mobjinfo[i].flags & (MF_MONITOR|MF_GRENADEBOUNCE)) == MF_MONITOR) { - if ((mobjinfo[i].flags & MF_MONITOR) && cv_competitionboxes.value) // not Normal + if (gametype == GT_COMPETITION) { + // Set powerup boxes to user settings for competition. if (cv_competitionboxes.value == 1) // Random i = MT_MYSTERY_BOX; else if (cv_competitionboxes.value == 2) // Teleports i = MT_MIXUP_BOX; else if (cv_competitionboxes.value == 3) // None return; // Don't spawn! + // default case: normal } - } - - // Set powerup boxes to user settings for other netplay modes - else if (gametype != GT_COOP) - { - if ((mobjinfo[i].flags & MF_MONITOR) && cv_matchboxes.value) // not Normal + // Set powerup boxes to user settings for other netplay modes + else if (gametype != GT_COOP) { if (cv_matchboxes.value == 1) // Random i = MT_MYSTERY_BOX; - else if (cv_matchboxes.value == 3) // Don't spawn - return; - else // cv_matchboxes.value == 2, Non-Random + else if (cv_matchboxes.value == 2) // Non-Random { if (i == MT_MYSTERY_BOX) return; // don't spawn in Non-Random - mthing->options &= ~(MTF_AMBUSH|MTF_OBJECTSPECIAL); // no random respawning! } + else if (cv_matchboxes.value == 3) // Don't spawn + return; + // default case: normal } } @@ -8873,7 +8874,7 @@ void P_SpawnMapThing(mapthing_t *mthing) if (i == MT_RING_BOX && !G_IsSpecialStage(gamemap)) return; // No rings in Ultimate mode (except special stages) - // Don't include the BIGBOXes (repeating monitors) here please. + // Don't include the gold repeating boxes here please. // They're likely facets of the level's design and therefore required to progress. } @@ -9302,8 +9303,6 @@ ML_NOCLIMB : Direction not controllable //count 10 ring boxes into the number of rings equation too. if (i == MT_RING_BOX) nummaprings += 10; - if (i == MT_RING_BIGBOX) // Theoretically infinite - nummaprings += 10000; if (i == MT_BIGTUMBLEWEED || i == MT_LITTLETUMBLEWEED) { From 1f7e135ce587e68b29da7a8dcf3e2ce7b350911c Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Sun, 3 Jan 2016 19:11:27 -0800 Subject: [PATCH 024/808] Gold boxes are supposed to be 4 fracunits taller. To match their taller sprite. --- src/info.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/info.c b/src/info.c index af5126f3a..97a505399 100644 --- a/src/info.c +++ b/src/info.c @@ -6578,7 +6578,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_pop, // deathsound 0, // speed 16*FRACUNIT, // radius - 32*FRACUNIT, // height + 36*FRACUNIT, // height 0, // display offset 100, // mass MT_PITY_ICON, // damage @@ -6605,7 +6605,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_pop, // deathsound 0, // speed 16*FRACUNIT, // radius - 32*FRACUNIT, // height + 36*FRACUNIT, // height 0, // display offset 100, // mass MT_ATTRACT_ICON,// damage @@ -6632,7 +6632,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_pop, // deathsound 0, // speed 16*FRACUNIT, // radius - 32*FRACUNIT, // height + 36*FRACUNIT, // height 0, // display offset 100, // mass MT_FORCE_ICON, // damage @@ -6659,7 +6659,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_pop, // deathsound 0, // speed 16*FRACUNIT, // radius - 32*FRACUNIT, // height + 36*FRACUNIT, // height 0, // display offset 100, // mass MT_ARMAGEDDON_ICON, // damage @@ -6686,7 +6686,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_pop, // deathsound 0, // speed 16*FRACUNIT, // radius - 32*FRACUNIT, // height + 36*FRACUNIT, // height 0, // display offset 100, // mass MT_WHIRLWIND_ICON, // damage @@ -6713,7 +6713,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_pop, // deathsound 0, // speed 16*FRACUNIT, // radius - 32*FRACUNIT, // height + 36*FRACUNIT, // height 0, // display offset 100, // mass MT_ELEMENTAL_ICON, // damage @@ -6740,7 +6740,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_pop, // deathsound 0, // speed 16*FRACUNIT, // radius - 32*FRACUNIT, // height + 36*FRACUNIT, // height 0, // display offset 100, // mass MT_SNEAKERS_ICON, // damage @@ -6767,7 +6767,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_pop, // deathsound 0, // speed 16*FRACUNIT, // radius - 32*FRACUNIT, // height + 36*FRACUNIT, // height 0, // display offset 100, // mass MT_INVULN_ICON, // damage @@ -6794,7 +6794,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_pop, // deathsound 0, // speed 16*FRACUNIT, // radius - 32*FRACUNIT, // height + 36*FRACUNIT, // height 0, // display offset 100, // mass MT_GRAVITY_ICON, // damage From c1340b6e6cbad04cc14b466475801415e3c9f64c Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Wed, 6 Jan 2016 03:07:08 -0800 Subject: [PATCH 025/808] Most minor 1up icon bug fixed. 1up icons were spawning their overlays off sync with each other so the face icon was showing up during static. Now they don't. (They'd do this in 2.1 too if you have a custom WAD added that doesn't have an overlay sprite, and you use it in multiplayer alongside a character that does.) --- src/info.c | 6 +++--- src/p_enemy.c | 26 +++++++++++++++++++++----- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/info.c b/src/info.c index 97a505399..0d7a8b998 100644 --- a/src/info.c +++ b/src/info.c @@ -1268,7 +1268,7 @@ state_t states[NUMSTATES] = {SPR_TVEL, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_ELEMENTAL_BOX {SPR_TVSS, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_SNEAKERS_BOX {SPR_TVIV, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_INVULN_BOX - {SPR_TV1P, 0, 2, {A_1upThinker}, 0, 0, S_BOX_FLICKER}, // S_1UP_BOX + {SPR_TV1U, 0, 2, {A_1upThinker}, 0, 0, S_BOX_FLICKER}, // S_1UP_BOX {SPR_TVEG, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_EGGMAN_BOX {SPR_TVMX, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_MIXUP_BOX {SPR_TVGV, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_GRAVITY_BOX @@ -1353,11 +1353,11 @@ state_t states[NUMSTATES] = {SPR_TVIV, 5, 4, {NULL}, 0, 0, S_INVULN_ICON5}, // S_INVULN_ICON4 {SPR_TVIV, 2, 18, {A_Invincibility}, 0, 0, S_NULL}, // S_INVULN_ICON5 - {SPR_TV1P, 2, 4, {NULL}, 0, 0, S_1UP_ICON2}, // S_1UP_ICON1 + {SPR_TV1U, 2, 4, {NULL}, 0, 0, S_1UP_ICON2}, // S_1UP_ICON1 {SPR_TV1U, 3, 4, {NULL}, 0, 0, S_1UP_ICON3}, // S_1UP_ICON2 {SPR_TV1U, 4, 4, {NULL}, 0, 0, S_1UP_ICON4}, // S_1UP_ICON3 {SPR_TV1U, 5, 4, {NULL}, 0, 0, S_1UP_ICON5}, // S_1UP_ICON4 - {SPR_TV1P, 2, 18, {A_ExtraLife}, 0, 0, S_NULL}, // S_1UP_ICON5 + {SPR_TV1U, 2, 18, {A_ExtraLife}, 0, 0, S_NULL}, // S_1UP_ICON5 {SPR_TVEG, 2, 4, {NULL}, 0, 0, S_EGGMAN_ICON2}, // S_EGGMAN_ICON1 {SPR_TVEG, 3, 4, {NULL}, 0, 0, S_EGGMAN_ICON3}, // S_EGGMAN_ICON2 diff --git a/src/p_enemy.c b/src/p_enemy.c index ce957243c..7903e40cc 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -2541,7 +2541,6 @@ void A_1upThinker(mobj_t *actor) if (closestplayer == -1 || skins[players[closestplayer].skin].sprites[SPR2_LIFE].numframes == 0) { // Closest player not found (no players in game?? may be empty dedicated server!), or does not have correct sprite. - actor->sprite = SPR_TV1U; if (actor->tracer) { P_RemoveMobj(actor->tracer); actor->tracer = NULL; @@ -2549,11 +2548,19 @@ void A_1upThinker(mobj_t *actor) return; } + // We're using the overlay, so use the overlay 1up box (no text) + actor->sprite = SPR_TV1P; + if (!actor->tracer) { P_SetTarget(&actor->tracer, P_SpawnMobj(actor->x, actor->y, actor->z, MT_OVERLAY)); P_SetTarget(&actor->tracer->target, actor); P_SetMobjState(actor->tracer, actor->info->seestate); + + // The overlay is going to be one tic early turning off and on + // because it's going to get its thinker run the frame we spawned it. + // So make it take one tic longer if it just spawned. + ++actor->tracer->tics; } actor->tracer->color = players[closestplayer].mo->color; @@ -2621,7 +2628,7 @@ void A_MonitorPop(mobj_t *actor) || !newmobj->target->player || !newmobj->target->skin || ((skin_t *)newmobj->target->skin)->sprites[SPR2_LIFE].numframes == 0) - newmobj->sprite = SPR_TV1U; // No lives icon for this player, use the default. + {} // No lives icon for this player, use the default. else { // Spawn the lives icon. mobj_t *livesico = P_SpawnMobjFromMobj(newmobj, 0, 0, 0, MT_OVERLAY); @@ -2631,6 +2638,9 @@ void A_MonitorPop(mobj_t *actor) livesico->color = newmobj->target->player->mo->color; livesico->skin = &skins[newmobj->target->player->skin]; P_SetMobjState(livesico, newmobj->info->seestate); + + // We're using the overlay, so use the overlay 1up sprite (no text) + newmobj->sprite = SPR_TV1P; } } } @@ -2702,7 +2712,7 @@ void A_GoldMonitorPop(mobj_t *actor) || !newmobj->target->player || !newmobj->target->skin || ((skin_t *)newmobj->target->skin)->sprites[SPR2_LIFE].numframes == 0) - newmobj->sprite = SPR_TV1U; // No lives icon for this player, use the default. + {} // No lives icon for this player, use the default. else { // Spawn the lives icon. mobj_t *livesico = P_SpawnMobjFromMobj(newmobj, 0, 0, 0, MT_OVERLAY); @@ -2712,6 +2722,9 @@ void A_GoldMonitorPop(mobj_t *actor) livesico->color = newmobj->target->player->mo->color; livesico->skin = &skins[newmobj->target->player->skin]; P_SetMobjState(livesico, newmobj->info->seestate); + + // We're using the overlay, so use the overlay 1up sprite (no text) + newmobj->sprite = SPR_TV1P; } } } @@ -3241,8 +3254,11 @@ void A_ExtraLife(mobj_t *actor) player = actor->target->player; - if (actor->type == MT_1UP_ICON && !actor->tracer) - actor->sprite = SPR_TV1U; // No lives icon for this player, use the default. + if (actor->type == MT_1UP_ICON && actor->tracer) + { + // We're using the overlay, so use the overlay 1up sprite (no text) + actor->sprite = SPR_TV1P; + } if (ultimatemode) //I don't THINK so! { From 025ca413a2a01a8ec7c104748c2f510e350aa457 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 7 Jan 2016 19:48:20 -0800 Subject: [PATCH 026/808] The concept of "music slots" doesn't exist anymore. Use whatever names you want for your music. So long as you prefix the lumps with O_ or D_, it doesn't matter anymore. DISCLAIMER: Linedef type 413 (change music) and Lua scripting is not tested. --- src/d_netcmd.c | 47 +- src/dehacked.c | 97 ++-- src/doomstat.h | 22 +- src/f_finale.c | 22 +- src/g_game.c | 17 +- src/lua_baselib.c | 7 +- src/lua_maplib.c | 8 +- src/m_menu.c | 16 +- src/p_enemy.c | 8 +- src/p_inter.c | 4 +- src/p_saveg.c | 2 +- src/p_setup.c | 31 +- src/p_spec.c | 17 +- src/p_user.c | 26 +- src/s_sound.c | 562 ++++++++++----------- src/s_sound.h | 16 +- src/sdl/mixer_sound.c | 1 + src/sounds.c | 1061 ---------------------------------------- src/sounds.h | 1086 ----------------------------------------- src/y_inter.c | 8 +- 20 files changed, 431 insertions(+), 2627 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 557715064..85b7ece67 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1854,10 +1854,10 @@ static void Got_Pause(UINT8 **cp, INT32 playernum) if (paused) { if (!menuactive || netgame) - S_PauseSound(); + S_PauseAudio(); } else - S_ResumeSound(); + S_ResumeAudio(); } } @@ -3757,46 +3757,53 @@ static void Command_Displayplayer_f(void) static void Command_Tunes_f(void) { const char *tunearg; - UINT16 tune, track = 0; + UINT16 tunenum, track = 0; const size_t argc = COM_Argc(); if (argc < 2) //tunes slot ... { - CONS_Printf("tunes :\n"); + CONS_Printf("tunes :\n"); CONS_Printf(M_GetText("Play a music slot at a set speed (\"1\" being normal speed).\n")); CONS_Printf(M_GetText("If the format supports multiple songs, you can specify which one to play.\n")); - CONS_Printf(M_GetText("The current tune is: %d\nThe current track is: %d\n"), - (mapmusic & MUSIC_SONGMASK), ((mapmusic & MUSIC_TRACKMASK) >> MUSIC_TRACKSHIFT)); + CONS_Printf(M_GetText("The current tune is: %s\nThe current track is: %d\n"), + mapmusname, (mapmusflags & MUSIC_TRACKMASK)); return; } tunearg = COM_Argv(1); - tune = (UINT16)atoi(tunearg); + tunenum = (UINT16)atoi(tunearg); track = 0; - if (!strcasecmp(tunearg, "default")) + if (!strcasecmp(tunearg, "none")) { - tune = mapheaderinfo[gamemap-1]->musicslot; - track = mapheaderinfo[gamemap-1]->musicslottrack; + S_StopMusic(); + return; } - else if (toupper(tunearg[0]) >= 'A' && toupper(tunearg[0]) <= 'Z') - tune = (UINT16)M_MapNumber(tunearg[0], tunearg[1]); - - if (tune >= NUMMUSIC) + else if (!strcasecmp(tunearg, "default")) { - CONS_Alert(CONS_NOTICE, M_GetText("Valid slots are 1 to %d, or 0 to stop music\n"), NUMMUSIC - 1); + tunearg = mapheaderinfo[gamemap-1]->musname; + track = mapheaderinfo[gamemap-1]->mustrack; + } + else if (tunearg[3] == 0 && toupper(tunearg[0]) >= 'A' && toupper(tunearg[0]) <= 'Z') + tunenum = (UINT16)M_MapNumber(tunearg[0], tunearg[1]); + + if (tunenum && tunenum >= 1036) + { + CONS_Alert(CONS_NOTICE, M_GetText("Valid music slots are 1 to 1035.\n")); return; } if (argc > 3) track = (UINT16)atoi(COM_Argv(3))-1; - mapmusic = tune | (track << MUSIC_TRACKSHIFT); - - if (tune == mus_None) - S_StopMusic(); + if (tunenum) + snprintf(mapmusname, 7, "%sM", G_BuildMapName(tunenum)); else - S_ChangeMusic(mapmusic, true); + strncpy(mapmusname, tunearg, 7); + mapmusname[6] = 0; + mapmusflags = (track & MUSIC_TRACKMASK); + + S_ChangeMusic(mapmusname, mapmusflags, true); if (argc > 2) { diff --git a/src/dehacked.c b/src/dehacked.c index 795157264..a9a04fecb 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -65,7 +65,6 @@ static mobjtype_t get_mobjtype(const char *word); static statenum_t get_state(const char *word); static spritenum_t get_sprite(const char *word); static sfxenum_t get_sfx(const char *word); -static UINT16 get_mus(const char *word); static hudnum_t get_huditem(const char *word); #ifndef HAVE_BLUA static powertype_t get_power(const char *word); @@ -1164,19 +1163,34 @@ static void readlevelheader(MYFILE *f, INT32 num) mapheaderinfo[num-1]->typeoflevel = tol; } } - else if (fastcmp(word, "MUSICSLOT")) + else if (fastcmp(word, "MUSIC")) { + if (fastcmp(word2, "NONE")) + mapheaderinfo[num-1]->musname[0] = 0; // becomes empty string + else + { + deh_strlcpy(mapheaderinfo[num-1]->musname, word2, + sizeof(mapheaderinfo[num-1]->musname), va("Level header %d: music", num)); + } + } + else if (fastcmp(word, "MUSICSLOT")) + { // Backwards compatibility? // Convert to map number if (word2[0] >= 'A' && word2[0] <= 'Z' && word2[2] == '\0') i = M_MapNumber(word2[0], word2[1]); - if (i) // it's just a number - mapheaderinfo[num-1]->musicslot = (UINT16)i; - else // No? Okay, now we'll get technical. - mapheaderinfo[num-1]->musicslot = get_mus(word2); // accepts all of O_CHRSEL, mus_chrsel, or just plain ChrSel + if (!i) + mapheaderinfo[num-1]->musname[0] = 0; // becomes empty string + else if (i > 1035) + deh_warning("Level header %d: musicslot out of range (0 - 1035)\n", num); + else // it's just a number + { + snprintf(mapheaderinfo[num-1]->musname, 7, va("%sM", G_BuildMapName(i))); + mapheaderinfo[num-1]->musname[6] = 0; + } } - else if (fastcmp(word, "MUSICSLOTTRACK")) - mapheaderinfo[num-1]->musicslottrack = ((UINT16)i - 1); + else if (fastcmp(word, "MUSICTRACK")) + mapheaderinfo[num-1]->mustrack = ((UINT16)i - 1); else if (fastcmp(word, "FORCECHARACTER")) { strlcpy(mapheaderinfo[num-1]->forcecharacter, word2, SKINNAMESIZE+1); @@ -1443,10 +1457,16 @@ static void readcutscenescene(MYFILE *f, INT32 num, INT32 scenenum) else deh_warning("CutSceneScene %d: unknown word '%s'", num, word); } - else if (fastcmp(word, "MUSICSLOT")) + else if (fastcmp(word, "MUSIC")) { - DEH_WriteUndoline(word, va("%u", cutscenes[num]->scene[scenenum].musicslot), UNDO_NONE); - cutscenes[num]->scene[scenenum].musicslot = get_mus(word2); // accepts all of O_MAP01M, mus_map01m, or just plain MAP01M + DEH_WriteUndoline(word, cutscenes[num]->scene[scenenum].musswitch, UNDO_NONE); + strncpy(cutscenes[num]->scene[scenenum].musswitch, word2, 7); + cutscenes[num]->scene[scenenum].musswitch[6] = 0; + } + else if (fastcmp(word, "MUSICTRACK")) + { + DEH_WriteUndoline(word, va("%u", cutscenes[num]->scene[scenenum].musswitchflags), UNDO_NONE); + cutscenes[num]->scene[scenenum].musswitchflags = ((UINT16)i) & MUSIC_TRACKMASK; } else if (fastcmp(word, "MUSICLOOP")) { @@ -7958,22 +7978,6 @@ static sfxenum_t get_sfx(const char *word) return sfx_None; } -static UINT16 get_mus(const char *word) -{ // Returns the value of SFX_ enumerations - UINT16 i; - if (*word >= '0' && *word <= '9') - return atoi(word); - if (fastncmp("MUS_",word,4)) - word += 4; // take off the MUS_ - else if (fastncmp("O_",word,2) || fastncmp("D_",word,2)) - word += 2; // take off the O_ or D_ - for (i = 0; i < NUMMUSIC; i++) - if (S_music[i].name && fasticmp(word, S_music[i].name)) - return i; - deh_warning("Couldn't find music named 'MUS_%s'",word); - return mus_None; -} - static hudnum_t get_huditem(const char *word) { // Returns the value of HUD_ enumerations hudnum_t i; @@ -8172,11 +8176,6 @@ static fixed_t find_const(const char **rword) free(word); return r; } - else if (fastncmp("MUS_",word,4) || fastncmp("O_",word,2)) { - r = get_mus(word); - free(word); - return r; - } else if (fastncmp("PW_",word,3)) { r = get_power(word); free(word); @@ -8567,33 +8566,6 @@ static inline int lib_getenum(lua_State *L) if (mathlib) return luaL_error(L, "sfx '%s' could not be found.\n", word); return 0; } - else if (!mathlib && fastncmp("mus_",word,4)) { - p = word+4; - for (i = 0; i < NUMMUSIC; i++) - if (S_music[i].name && fastcmp(p, S_music[i].name)) { - lua_pushinteger(L, i); - return 1; - } - return 0; - } - else if (mathlib && fastncmp("MUS_",word,4)) { // SOCs are ALL CAPS! - p = word+4; - for (i = 0; i < NUMMUSIC; i++) - if (S_music[i].name && fasticmp(p, S_music[i].name)) { - lua_pushinteger(L, i); - return 1; - } - return luaL_error(L, "music '%s' could not be found.\n", word); - } - else if (mathlib && (fastncmp("O_",word,2) || fastncmp("D_",word,2))) { - p = word+2; - for (i = 0; i < NUMMUSIC; i++) - if (S_music[i].name && fasticmp(p, S_music[i].name)) { - lua_pushinteger(L, i); - return 1; - } - return luaL_error(L, "music '%s' could not be found.\n", word); - } else if (!mathlib && fastncmp("pw_",word,3)) { p = word+3; for (i = 0; i < NUMPOWERS; i++) @@ -8745,8 +8717,11 @@ static inline int lib_getenum(lua_State *L) } else if (fastcmp(word,"globallevelskynum")) { lua_pushinteger(L, globallevelskynum); return 1; - } else if (fastcmp(word,"mapmusic")) { - lua_pushinteger(L, mapmusic); + } else if (fastcmp(word,"mapmusname")) { + lua_pushstring(L, mapmusname); + return 1; + } else if (fastcmp(word,"mapmusflags")) { + lua_pushinteger(L, mapmusflags); return 1; } else if (fastcmp(word,"server")) { if ((!multiplayer || !netgame) && !playeringame[serverplayer]) diff --git a/src/doomstat.h b/src/doomstat.h index 44cf6feaa..ffdbcaecd 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -31,15 +31,11 @@ // Selected by user. extern INT16 gamemap; - -// ----------------xxxxxxxxxxxxxxxx = music slot -// -xxxxxxxxxxxxxxx---------------- = track slot -// x------------------------------- = reset music bit -extern UINT32 mapmusic; -#define MUSIC_TRACKSHIFT 16 -#define MUSIC_SONGMASK 0x0000FFFF -#define MUSIC_TRACKMASK 0x7FFF0000 -#define MUSIC_RELOADRESET 0x80000000 +extern char mapmusname[7]; +extern UINT16 mapmusflags; +#define MUSIC_TRACKMASK 0x0FFF // ----************ +#define MUSIC_RELOADRESET 0x8000 // *--------------- +// Use other bits if necessary. extern INT16 maptol; extern UINT8 globalweather; @@ -146,11 +142,13 @@ typedef struct UINT16 xcoord[8]; UINT16 ycoord[8]; UINT16 picduration[8]; - UINT16 musicslot; UINT8 musicloop; UINT16 textxpos; UINT16 textypos; + char musswitch[7]; + UINT16 musswitchflags; + UINT8 fadecolor; // Color number for fade, 0 means don't do the first fade UINT8 fadeinid; // ID of the first fade, to a color -- ignored if fadecolor is 0 UINT8 fadeoutid; // ID of the second fade, to the new screen @@ -218,8 +216,8 @@ typedef struct UINT8 actnum; ///< Act number or 0 for none. UINT16 typeoflevel; ///< Combination of typeoflevel flags. INT16 nextlevel; ///< Map number of next level, or 1100-1102 to end. - UINT16 musicslot; ///< Music slot number to play. 0 for no music. - UINT16 musicslottrack; ///< Subsong to play. Only really relevant for music modules and specific formats supported by GME. 0 to ignore. + char musname[7]; ///< Music track to play. "" for no music. + UINT16 mustrack; ///< Subsong to play. Only really relevant for music modules and specific formats supported by GME. 0 to ignore. char forcecharacter[17]; ///< (SKINNAMESIZE+1) Skin to switch to or "" to disable. UINT8 weather; ///< 0 = sunny day, 1 = storm, 2 = snow, 3 = rain, 4 = blank, 5 = thunder w/o rain, 6 = rain w/o lightning, 7 = heat wave. INT16 skynum; ///< Sky number to use. diff --git a/src/f_finale.c b/src/f_finale.c index a85fd11cb..efe39f294 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -559,7 +559,7 @@ static void F_IntroDrawScene(void) if (finalecount < 4) S_StopMusic(); if (finalecount == 4) - S_ChangeMusic(mus_stjr, false); + S_ChangeMusicInternal("stjr", false); x = (BASEVIDWIDTH<scene[scenenum].xcoord[picnum]; picypos = cutscenes[cutnum]->scene[scenenum].ycoord[picnum]; - if (cutscenes[cutnum]->scene[scenenum].musicslot != 0) - S_ChangeMusic(cutscenes[cutnum]->scene[scenenum].musicslot, cutscenes[cutnum]->scene[scenenum].musicloop); + if (cutscenes[cutnum]->scene[scenenum].musswitch[0]) + S_ChangeMusic(cutscenes[cutnum]->scene[scenenum].musswitch, + cutscenes[cutnum]->scene[scenenum].musswitchflags, + cutscenes[cutnum]->scene[scenenum].musicloop); // Fade to the next dofadenow = true; @@ -1774,8 +1776,10 @@ void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean reset animtimer = cutscenes[cutnum]->scene[0].picduration[0]; // Picture duration stoptimer = 0; - if (cutscenes[cutnum]->scene[scenenum].musicslot != 0) - S_ChangeMusic(cutscenes[cutnum]->scene[scenenum].musicslot, cutscenes[cutnum]->scene[scenenum].musicloop); + if (cutscenes[cutnum]->scene[0].musswitch[0]) + S_ChangeMusic(cutscenes[cutnum]->scene[0].musswitch, + cutscenes[cutnum]->scene[0].musswitchflags, + cutscenes[cutnum]->scene[0].musicloop); else S_StopMusic(); } diff --git a/src/g_game.c b/src/g_game.c index 643ec8c93..76d6035f5 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -69,8 +69,10 @@ static void G_DoStartContinue(void); static void G_DoContinued(void); static void G_DoWorldDone(void); +char mapmusname[7]; // Music name +UINT16 mapmusflags; // Track and reset bit + INT16 gamemap = 1; -UINT32 mapmusic; // music, track, and reset bit INT16 maptol; UINT8 globalweather = 0; INT32 curWeather = PRECIP_NONE; @@ -2185,12 +2187,13 @@ void G_PlayerReborn(INT32 player) if (p-players == consoleplayer) { - if (mapmusic & MUSIC_RELOADRESET) // TODO: Might not need this here + if (mapmusflags & MUSIC_RELOADRESET) { - mapmusic = mapheaderinfo[gamemap-1]->musicslot - | (mapheaderinfo[gamemap-1]->musicslottrack << MUSIC_TRACKSHIFT); + strncpy(mapmusname, mapheaderinfo[gamemap-1]->musname, 7); + mapmusname[6] = 0; + mapmusflags = mapheaderinfo[gamemap-1]->mustrack & MUSIC_TRACKMASK; } - S_ChangeMusic(mapmusic, true); + S_ChangeMusic(mapmusname, mapmusflags, true); } if (gametype == GT_COOP) @@ -3524,7 +3527,7 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean if (paused) { paused = false; - S_ResumeSound(); + S_ResumeAudio(); } if (netgame || multiplayer) // Nice try, haxor. @@ -3598,7 +3601,7 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean globalweather = mapheaderinfo[gamemap-1]->weather; // Don't carry over custom music change to another map. - mapmusic |= MUSIC_RELOADRESET; + mapmusflags |= MUSIC_RELOADRESET; ultimatemode = pultmode; playerdeadview = false; diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 4be103106..a7ab28949 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1640,9 +1640,10 @@ static int lib_sStopSound(lua_State *L) static int lib_sChangeMusic(lua_State *L) { - UINT32 music_num = (UINT32)luaL_checkinteger(L, 1); + const char *music_name = luaL_checkstring(L, 1); boolean looping = (boolean)lua_opttrueboolean(L, 2); player_t *player = NULL; + UINT16 music_flags = 0; NOHUD if (!lua_isnone(L, 3) && lua_isuserdata(L, 3)) { @@ -1650,8 +1651,10 @@ static int lib_sChangeMusic(lua_State *L) if (!player) return LUA_ErrInvalid(L, "player_t"); } + music_flags = (UINT16)luaL_optinteger(L, 4, 0); + if (!player || P_IsLocalPlayer(player)) - S_ChangeMusic(music_num, looping); + S_ChangeMusic(music_name, music_flags, looping); return 0; } diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 0a12478ca..1da0c0c1c 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -1171,10 +1171,10 @@ static int mapheaderinfo_get(lua_State *L) lua_pushinteger(L, header->typeoflevel); else if (fastcmp(field,"nextlevel")) lua_pushinteger(L, header->nextlevel); - else if (fastcmp(field,"musicslot")) - lua_pushinteger(L, header->musicslot); - else if (fastcmp(field,"musicslottrack")) - lua_pushinteger(L, header->musicslottrack); + else if (fastcmp(field,"musname")) + lua_pushlstring(L, header->musname, 6); + else if (fastcmp(field,"mustrack")) + lua_pushinteger(L, header->mustrack); else if (fastcmp(field,"forcecharacter")) lua_pushlstring(L, header->forcecharacter, 16); else if (fastcmp(field,"weather")) diff --git a/src/m_menu.c b/src/m_menu.c index 9901055e3..4ef719205 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -4748,7 +4748,7 @@ static void M_SetupChoosePlayer(INT32 choice) if (Playing() == false) { S_StopMusic(); - S_ChangeMusic(mus_chrsel, true); + S_ChangeMusicInternal("chrsel", true); } SP_PlayerDef.prevMenu = currentMenu; @@ -5199,7 +5199,7 @@ void M_DrawTimeAttackMenu(void) lumpnum_t lumpnum; char beststr[40]; - S_ChangeMusic(mus_racent, true); // Eww, but needed for when user hits escape during demo playback + S_ChangeMusicInternal("racent", true); // Eww, but needed for when user hits escape during demo playback V_DrawPatchFill(W_CachePatchName("SRB2BACK", PU_CACHE)); @@ -5362,7 +5362,7 @@ static void M_TimeAttack(INT32 choice) itemOn = tastart; // "Start" is selected. G_SetGamestate(GS_TIMEATTACK); - S_ChangeMusic(mus_racent, true); + S_ChangeMusicInternal("racent", true); } // Drawing function for Nights Attack @@ -5372,7 +5372,7 @@ void M_DrawNightsAttackMenu(void) lumpnum_t lumpnum; char beststr[40]; - S_ChangeMusic(mus_racent, true); // Eww, but needed for when user hits escape during demo playback + S_ChangeMusicInternal("racent", true); // Eww, but needed for when user hits escape during demo playback V_DrawPatchFill(W_CachePatchName("SRB2BACK", PU_CACHE)); @@ -5495,7 +5495,7 @@ static void M_NightsAttack(INT32 choice) itemOn = nastart; // "Start" is selected. G_SetGamestate(GS_TIMEATTACK); - S_ChangeMusic(mus_racent, true); + S_ChangeMusicInternal("racent", true); } // Player has selected the "START" from the nights attack screen @@ -5729,7 +5729,7 @@ static void M_ModeAttackEndGame(INT32 choice) itemOn = currentMenu->lastOn; G_SetGamestate(GS_TIMEATTACK); modeattacking = ATTACKING_NONE; - S_ChangeMusic(mus_racent, true); + S_ChangeMusicInternal("racent", true); // Update replay availability. CV_AddValue(&cv_nextmap, 1); CV_AddValue(&cv_nextmap, -1); @@ -6935,7 +6935,7 @@ static void M_ToggleDigital(void) if (nodigimusic) return; S_Init(cv_soundvolume.value, cv_digmusicvolume.value, cv_midimusicvolume.value); S_StopMusic(); - S_ChangeMusic(mus_lclear, false); + S_ChangeMusicInternal("lclear", false); M_StartMessage(M_GetText("Digital Music Enabled\n"), NULL, MM_NOTHING); } else @@ -6962,7 +6962,7 @@ static void M_ToggleMIDI(void) I_InitMIDIMusic(); if (nomidimusic) return; S_Init(cv_soundvolume.value, cv_digmusicvolume.value, cv_midimusicvolume.value); - S_ChangeMusic(mus_lclear, false); + S_ChangeMusicInternal("lclear", false); M_StartMessage(M_GetText("MIDI Music Enabled\n"), NULL, MM_NOTHING); } else diff --git a/src/p_enemy.c b/src/p_enemy.c index 09274b5a8..177acf862 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3063,12 +3063,8 @@ void A_Invincibility(mobj_t *actor) { S_StopMusic(); if (mariomode) - { - S_ChangeMusic(mus_minvnc, false); G_GhostAddColor(GHC_INVINCIBLE); - } - else - S_ChangeMusic(mus_invinc, false); + S_ChangeMusicInternal((mariomode) ? "minvnc" : "invinc", false); } } @@ -3104,7 +3100,7 @@ void A_SuperSneakers(mobj_t *actor) else { S_StopMusic(); - S_ChangeMusic(mus_shoes, false); + S_ChangeMusicInternal("shoes", false); } } } diff --git a/src/p_inter.c b/src/p_inter.c index f9dc3c342..d23585605 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1966,7 +1966,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget if (P_IsLocalPlayer(target->player) && target->player == &players[consoleplayer]) { S_StopMusic(); // Stop the Music! Tails 03-14-2000 - S_ChangeMusic(mus_gmover, false); // Yousa dead now, Okieday? Tails 03-14-2000 + S_ChangeMusicInternal("gmover", false); // Yousa dead now, Okieday? Tails 03-14-2000 } } } @@ -2363,7 +2363,7 @@ static inline void P_NiGHTSDamage(mobj_t *target, mobj_t *source) && player->nightstime < 10*TICRATE) { //S_StartSound(NULL, sfx_timeup); // that creepy "out of time" music from NiGHTS. Dummied out, as some on the dev team thought it wasn't Sonic-y enough (Mystic, notably). Uncomment to restore. -SH - S_ChangeMusic(mus_drown,false); + S_ChangeMusicInternal("drown",false); } } } diff --git a/src/p_saveg.c b/src/p_saveg.c index 07e7b3564..a36f9c6f7 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -3203,7 +3203,7 @@ static inline boolean P_NetUnArchiveMisc(void) // tell the sound code to reset the music since we're skipping what // normally sets this flag - mapmusic |= MUSIC_RELOADRESET; + mapmusflags |= MUSIC_RELOADRESET; G_SetGamestate(READINT16(save_p)); diff --git a/src/p_setup.c b/src/p_setup.c index 3491669c7..3a51d90b3 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -180,10 +180,11 @@ static void P_ClearSingleMapHeaderInfo(INT16 i) mapheaderinfo[num]->typeoflevel = 0; DEH_WriteUndoline("NEXTLEVEL", va("%d", mapheaderinfo[num]->nextlevel), UNDO_NONE); mapheaderinfo[num]->nextlevel = (INT16)(i + 1); - DEH_WriteUndoline("MUSICSLOT", va("%d", mapheaderinfo[num]->musicslot), UNDO_NONE); - mapheaderinfo[num]->musicslot = mus_map01m + num; - DEH_WriteUndoline("MUSICSLOTTRACK", va("%d", mapheaderinfo[num]->musicslottrack), UNDO_NONE); - mapheaderinfo[num]->musicslottrack = 0; + DEH_WriteUndoline("MUSIC", mapheaderinfo[num]->musname, UNDO_NONE); + snprintf(mapheaderinfo[num]->musname, 7, va("%sM", G_BuildMapName(i))); + mapheaderinfo[num]->musname[6] = 0; + DEH_WriteUndoline("MUSICTRACK", va("%d", mapheaderinfo[num]->mustrack), UNDO_NONE); + mapheaderinfo[num]->mustrack = 0; DEH_WriteUndoline("FORCECHARACTER", va("%d", mapheaderinfo[num]->forcecharacter), UNDO_NONE); mapheaderinfo[num]->forcecharacter[0] = '\0'; DEH_WriteUndoline("WEATHER", va("%d", mapheaderinfo[num]->weather), UNDO_NONE); @@ -1439,6 +1440,21 @@ static void P_LoadSideDefs2(lumpnum_t lumpnum) #endif case 413: // Change music + { + char process[8+1]; + + sd->toptexture = sd->midtexture = sd->bottomtexture = 0; + if (msd->bottomtexture[0] != '-' || msd->bottomtexture[1] != '\0') + { + M_Memcpy(process,msd->bottomtexture,8); + process[8] = '\0'; + sd->bottomtexture = get_number(process)-1; + } + M_Memcpy(process,msd->toptexture,8); + sd->text = Z_Malloc(strlen(process)+1, PU_LEVEL, NULL); + M_Memcpy(sd->text, process, strlen(process)+1); + break; + } case 414: // Play SFX { sd->toptexture = sd->midtexture = sd->bottomtexture = 0; @@ -1449,13 +1465,6 @@ static void P_LoadSideDefs2(lumpnum_t lumpnum) process[8] = '\0'; sd->toptexture = get_number(process); } - if (sd->special == 413 && (msd->bottomtexture[0] != '-' || msd->bottomtexture[1] != '\0')) - { - char process[8+1]; - M_Memcpy(process,msd->bottomtexture,8); - process[8] = '\0'; - sd->bottomtexture = get_number(process)-1; - } break; } diff --git a/src/p_spec.c b/src/p_spec.c index 0d786c695..beeb2e5a7 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2390,20 +2390,19 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) // console player only unless NOCLIMB is set if ((line->flags & ML_NOCLIMB) || (mo && mo->player && P_IsLocalPlayer(mo->player))) { - UINT16 musicnum = (UINT16)sides[line->sidenum[0]].toptexture; //P_AproxDistance(line->dx, line->dy)>>FRACBITS; UINT16 tracknum = (UINT16)sides[line->sidenum[0]].bottomtexture; - mapmusic = musicnum | (tracknum << MUSIC_TRACKSHIFT); - if (!(line->flags & ML_BLOCKMONSTERS)) - mapmusic |= MUSIC_RELOADRESET; + strncpy(mapmusname, line->text, 7); + mapmusname[6] = 0; - if (musicnum >= NUMMUSIC || musicnum == mus_None) - S_StopMusic(); - else - S_ChangeMusic(mapmusic, !(line->flags & ML_EFFECT4)); + mapmusflags = tracknum & MUSIC_TRACKMASK; + if (!(line->flags & ML_BLOCKMONSTERS)) + mapmusflags |= MUSIC_RELOADRESET; + + S_ChangeMusic(mapmusname, mapmusflags, !(line->flags & ML_EFFECT4)); // Except, you can use the ML_BLOCKMONSTERS flag to change this behavior. - // if (mapmusic & MUSIC_RELOADRESET) then it will reset the music in G_PlayerReborn. + // if (mapmusflags & MUSIC_RELOADRESET) then it will reset the music in G_PlayerReborn. } break; diff --git a/src/p_user.c b/src/p_user.c index 51318f674..f91e7937d 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -965,7 +965,7 @@ void P_DoSuperTransformation(player_t *player, boolean giverings) if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOSSMUSIC) && P_IsLocalPlayer(player)) { S_StopMusic(); - S_ChangeMusic(mus_supers, true); + S_ChangeMusicInternal("supers", true); } S_StartSound(NULL, sfx_supert); //let all players hear it -mattw_cfi @@ -1101,7 +1101,7 @@ void P_PlayLivesJingle(player_t *player) if (player) player->powers[pw_extralife] = extralifetics + 1; S_StopMusic(); // otherwise it won't restart if this is done twice in a row - S_ChangeMusic(mus_xtlife, false); + S_ChangeMusicInternal("xtlife", false); } } @@ -1119,21 +1119,21 @@ void P_RestoreMusic(player_t *player) return; S_SpeedMusic(1.0f); if (player->powers[pw_super] && !(mapheaderinfo[gamemap-1]->levelflags & LF_NOSSMUSIC)) - S_ChangeMusic(mus_supers, true); + S_ChangeMusicInternal("supers", true); else if (player->powers[pw_invulnerability] > 1) - S_ChangeMusic((mariomode) ? mus_minvnc : mus_invinc, false); + S_ChangeMusicInternal((mariomode) ? "minvnc" : "invinc", false); else if (player->powers[pw_sneakers] > 1 && !player->powers[pw_super]) { if (mapheaderinfo[gamemap-1]->levelflags & LF_SPEEDMUSIC) { S_SpeedMusic(1.4f); - S_ChangeMusic(mapmusic, true); + S_ChangeMusic(mapmusname, mapmusflags, true); } else - S_ChangeMusic(mus_shoes, true); + S_ChangeMusicInternal("shoes", true); } else - S_ChangeMusic(mapmusic, true); + S_ChangeMusic(mapmusname, mapmusflags, true); } // @@ -2041,13 +2041,13 @@ static void P_CheckUnderwaterAndSpaceTimer(player_t *player) else if (player->powers[pw_underwater] == 1) { if ((netgame || multiplayer) && P_IsLocalPlayer(player)) - S_ChangeMusic(mapmusic, true); + S_ChangeMusic(mapmusname, mapmusflags, true); P_DamageMobj(player->mo, NULL, NULL, 1, DMG_DROWNED); } else if (player->powers[pw_spacetime] == 1) { if ((netgame || multiplayer) && P_IsLocalPlayer(player)) - S_ChangeMusic(mapmusic, true); + S_ChangeMusic(mapmusname, mapmusflags, true); P_DamageMobj(player->mo, NULL, NULL, 1, DMG_SPACEDROWN); } @@ -2081,7 +2081,7 @@ static void P_CheckUnderwaterAndSpaceTimer(player_t *player) && player == &players[consoleplayer]) { S_StopMusic(); - S_ChangeMusic(mus_drown, false); + S_ChangeMusicInternal("drown", false); } if (player->powers[pw_underwater] == 25*TICRATE + 1) @@ -5617,7 +5617,7 @@ static void P_NiGHTSMovement(player_t *player) } else if (P_IsLocalPlayer(player) && player->nightstime == 10*TICRATE) // S_StartSound(NULL, sfx_timeup); // that creepy "out of time" music from NiGHTS. Dummied out, as some on the dev team thought it wasn't Sonic-y enough (Mystic, notably). Uncomment to restore. -SH - S_ChangeMusic(mus_drown,false); + S_ChangeMusicInternal("drown",false); if (player->mo->z < player->mo->floorz) @@ -7760,7 +7760,7 @@ static void P_DeathThink(player_t *player) // Return to level music if (netgame && player->deadtimer == gameovertics && P_IsLocalPlayer(player)) - S_ChangeMusic(mapmusic, true); + S_ChangeMusic(mapmusname, mapmusflags, true); } if (!player->mo) @@ -8746,7 +8746,7 @@ void P_PlayerThink(player_t *player) if (countdown == 11*TICRATE - 1) { if (P_IsLocalPlayer(player)) - S_ChangeMusic(mus_drown, false); + S_ChangeMusicInternal("drown", false); } // If you've hit the countdown and you haven't made diff --git a/src/s_sound.c b/src/s_sound.c index 14a8cc425..1e5f79aa0 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -141,14 +141,6 @@ typedef struct static channel_t *channels = NULL; static INT32 numofchannels = 0; -// whether songs are mus_paused -static boolean mus_paused = 0; - -// music currently being played -musicinfo_t *mus_playing = 0; - -static INT32 nextcleanup; - // // Internals. // @@ -307,47 +299,6 @@ static void SetChannelsNum(void) channels[i].sfxinfo = 0; } -// -// Initializes sound stuff, including volume -// Sets channels, SFX and music volume, -// allocates channel buffer, sets S_sfx lookup. -// -void S_Init(INT32 sfxVolume, INT32 digMusicVolume, INT32 midiMusicVolume) -{ - INT32 i; - - if (dedicated) - return; - - S_SetSfxVolume(sfxVolume); - S_SetDigMusicVolume(digMusicVolume); - S_SetMIDIMusicVolume(midiMusicVolume); - - SetChannelsNum(); - - // no sounds are playing, and they are not mus_paused - mus_paused = 0; - - // Note that sounds have not been cached (yet). - for (i = 1; i < NUMSFX; i++) - { - S_sfx[i].usefulness = -1; // for I_GetSfx() - S_sfx[i].lumpnum = LUMPERROR; - } - - // precache sounds if requested by cmdline, or precachesound var true - if (!nosound && (M_CheckParm("-precachesound") || precachesound.value)) - { - // Initialize external data (all sounds) at start, keep static. - CONS_Printf(M_GetText("Loading sounds... ")); - - for (i = 1; i < NUMSFX; i++) - if (S_sfx[i].name) - S_sfx[i].data = I_GetSfx(&S_sfx[i]); - - CONS_Printf(M_GetText(" pre-cached all sound data\n")); - } -} // Retrieve the lump number of sfx // @@ -371,12 +322,6 @@ lumpnum_t S_GetSfxLumpNum(sfxinfo_t *sfx) return W_GetNumForName("dsthok"); } -// -// Per level startup code. -// Kills playing sounds at start of level, -// determines music if any, changes music. -// - // Stop all sounds, load level info, THEN start sounds. void S_StopSounds(void) { @@ -442,22 +387,6 @@ void S_StopSoundByNum(sfxenum_t sfxnum) } } -void S_Start(void) -{ - if (mapmusic & MUSIC_RELOADRESET) - { - mapmusic = mapheaderinfo[gamemap-1]->musicslot - | (mapheaderinfo[gamemap-1]->musicslottrack << MUSIC_TRACKSHIFT); - } - - mus_paused = 0; - - if (cv_resetmusic.value) - S_StopMusic(); - S_ChangeMusic(mapmusic, true); - nextcleanup = 15; -} - void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume) { INT32 sep, pitch, priority, cnum; @@ -745,43 +674,6 @@ void S_StopSound(void *origin) } } -// -// Stop and resume music, during game PAUSE. -// -void S_PauseSound(void) -{ - if (!nodigimusic) - I_PauseSong(0); - - if (mus_playing && !mus_paused) - { - I_PauseSong(mus_playing->handle); - mus_paused = true; - } - - // pause cd music -#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL) - I_PauseCD(); -#else - I_StopCD(); -#endif -} - -void S_ResumeSound(void) -{ - if (!nodigimusic) - I_ResumeSong(0); - else - if (mus_playing && mus_paused) - { - I_ResumeSong(mus_playing->handle); - mus_paused = false; - } - - // resume cd music - I_ResumeCD(); -} - // // Updates music & sounds // @@ -883,38 +775,6 @@ void S_UpdateSounds(void) } } - // Clean up unused data. -#if 0 - { - static tic_t nextcleanup = 0; - size_t i; - sfxinfo_t *sfx; - - if (!gametic) nextcleanup = 0; - if (gametic > nextcleanup) - { - for (i = 1; i < NUMSFX; i++) - { - if (S_sfx[i].usefulness == 0) - { - S_sfx[i].usefulness--; - - // don't forget to unlock it !!! - // __dmpi_unlock_.... - //Z_ChangeTag(S_sfx[i].data, PU_CACHE); - I_FreeSfx(S_sfx+i); - //S_sfx[i].data = 0; - - CONS_Debug(DBG_GAMELOGIC, "flushed sfx %.6s\n", S_sfx[i].name); - } - } - nextcleanup = gametic + 15; - } - } -#endif - - // FIXTHIS: nextcleanup is probably unused - for (cnum = 0; cnum < numofchannels; cnum++) { c = &channels[cnum]; @@ -984,37 +844,6 @@ void S_UpdateSounds(void) I_UpdateSound(); } -void S_SetDigMusicVolume(INT32 volume) -{ - if (volume < 0 || volume > 31) - CONS_Alert(CONS_WARNING, "musicvolume should be between 0-31\n"); - - CV_SetValue(&cv_digmusicvolume, volume&31); - actualdigmusicvolume = cv_digmusicvolume.value; //check for change of var - -#ifdef DJGPPDOS - I_SetDigMusicVolume(31); // Trick for buggy dos drivers. Win32 doesn't need this. -#endif - - if (!nodigimusic) - I_SetDigMusicVolume(volume&31); -} - -void S_SetMIDIMusicVolume(INT32 volume) -{ - if (volume < 0 || volume > 31) - CONS_Alert(CONS_WARNING, "musicvolume should be between 0-31\n"); - - CV_SetValue(&cv_midimusicvolume, volume&0x1f); - actualmidimusicvolume = cv_midimusicvolume.value; //check for change of var - -#ifdef DJGPPDOS - I_SetMIDIMusicVolume(31); // Trick for buggy dos drivers. Win32 doesn't need this. -#endif - - I_SetMIDIMusicVolume(volume&0x1f); -} - void S_SetSfxVolume(INT32 volume) { if (volume < 0 || volume > 31) @@ -1031,137 +860,6 @@ void S_SetSfxVolume(INT32 volume) #endif } -static boolean S_MIDIMusic(musicinfo_t *music, boolean looping) -{ - if (nomidimusic) - return true; // no error - - if (music_disabled) - return true; // no error - - // get lumpnum if neccessary - if (!music->lumpnum) - { - if (W_CheckNumForName(va("d_%s", music->name)) == LUMPERROR) - return false; - music->lumpnum = W_GetNumForName(va("d_%s", music->name)); - } - - // load & register it - music->data = W_CacheLumpNum(music->lumpnum, PU_MUSIC); -#if defined (macintosh) && !defined (HAVE_SDL) - music->handle = I_RegisterSong(music_num); -#else - music->handle = I_RegisterSong(music->data, W_LumpLength(music->lumpnum)); -#endif - -#ifdef MUSSERV - if (msg_id != -1) - { - struct musmsg msg_buffer; - - msg_buffer.msg_type = 6; - memset(msg_buffer.msg_text, 0, sizeof (msg_buffer.msg_text)); - sprintf(msg_buffer.msg_text, "d_%s", music->name); - msgsnd(msg_id, (struct msgbuf*)&msg_buffer, sizeof (msg_buffer.msg_text), IPC_NOWAIT); - } -#endif - - // play it - if (!I_PlaySong(music->handle, looping)) - return false; - - mus_playing = music; - return true; -} - -static boolean S_DigMusic(musicinfo_t *music, boolean looping) -{ - if (nodigimusic) - return false; // try midi - - if (digital_disabled) - return false; // try midi - - if (!I_StartDigSong(music->name, looping)) - return false; - - mus_playing = music; - return true; -} - -void S_ChangeMusic(UINT32 mslotnum, boolean looping) -{ - musicinfo_t *music; - musicenum_t music_num = (signed)(mslotnum & MUSIC_SONGMASK); - INT32 track_num = (mslotnum & MUSIC_TRACKMASK) >> MUSIC_TRACKSHIFT; - -#if defined (DC) || defined (_WIN32_WCE) || defined (PSP) || defined(GP2X) - S_ClearSfx(); -#endif - - if (nomidimusic && nodigimusic) - return; - - if (music_disabled && digital_disabled) - return; - - // No Music - if (music_num == mus_None) - { - S_StopMusic(); - return; - } - - if (music_num >= NUMMUSIC) - { - CONS_Alert(CONS_ERROR, "Bad music number %d\n", music_num); - return; - } - else - music = &S_music[music_num]; - - if (mus_playing != music) - { - S_StopMusic(); // shutdown old music - if (!S_DigMusic(music, looping) && !S_MIDIMusic(music, looping)) - { - CONS_Alert(CONS_ERROR, M_GetText("Music lump %.6s not found!\n"), music->name); - return; - } - } - I_SetSongTrack(track_num); -} - -boolean S_SpeedMusic(float speed) -{ - return I_SetSongSpeed(speed); -} - -void S_StopMusic(void) -{ - if (!mus_playing) - return; - - if (mus_paused) - I_ResumeSong(mus_playing->handle); - - if (!nodigimusic) - I_StopDigSong(); - - S_SpeedMusic(1.0f); - I_StopSong(mus_playing->handle); - I_UnRegisterSong(mus_playing->handle); - -#ifndef HAVE_SDL //SDL uses RWOPS - Z_ChangeTag(mus_playing->data, PU_CACHE); -#endif - - mus_playing->data = NULL; - mus_playing = NULL; - -} - void S_ClearSfx(void) { #ifndef DJGPPDOS @@ -1452,3 +1150,263 @@ void S_StartSoundName(void *mo, const char *soundname) S_StartSound(mo, soundnum); } + +/// ------------------------ +/// Music +/// ------------------------ + +#define music_playing (music_name[0]) // String is empty if no music is playing + +static char music_name[7]; // up to 6-character name +static lumpnum_t music_lumpnum; // lump number of music (used??) +static void *music_data; // music raw data +static INT32 music_handle; // once registered, the handle for the music + +static boolean mus_paused = 0; // whether songs are mus_paused + +static boolean S_MIDIMusic(const char *mname, boolean looping) +{ + lumpnum_t mlumpnum; + void *mdata; + INT32 mhandle; + + if (nomidimusic || music_disabled) + return false; // didn't search. + + if (W_CheckNumForName(va("d_%s", mname)) == LUMPERROR) + return false; + mlumpnum = W_GetNumForName(va("d_%s", mname)); + + // load & register it + mdata = W_CacheLumpNum(mlumpnum, PU_MUSIC); + mhandle = I_RegisterSong(mdata, W_LumpLength(mlumpnum)); + +#ifdef MUSSERV + if (msg_id != -1) + { + struct musmsg msg_buffer; + + msg_buffer.msg_type = 6; + memset(msg_buffer.msg_text, 0, sizeof (msg_buffer.msg_text)); + sprintf(msg_buffer.msg_text, "d_%s", mname); + msgsnd(msg_id, (struct msgbuf*)&msg_buffer, sizeof (msg_buffer.msg_text), IPC_NOWAIT); + } +#endif + + // play it + if (!I_PlaySong(mhandle, looping)) + return false; + + strncpy(music_name, mname, 7); + music_name[6] = 0; + music_lumpnum = mlumpnum; + music_data = mdata; + music_handle = mhandle; + return true; +} + +static boolean S_DigMusic(const char *mname, boolean looping) +{ + if (nodigimusic || digital_disabled) + return false; // try midi + + if (!I_StartDigSong(mname, looping)) + return false; + + strncpy(music_name, mname, 7); + music_name[6] = 0; + music_lumpnum = LUMPERROR; + music_data = NULL; + music_handle = 0; + return true; +} + +void S_ChangeMusic(const char *mmusic, UINT16 mflags, boolean looping) +{ +#if defined (DC) || defined (_WIN32_WCE) || defined (PSP) || defined(GP2X) + S_ClearSfx(); +#endif + + if ((nomidimusic || music_disabled) && (nodigimusic || digital_disabled)) + return; + + // No Music (empty string) + if (mmusic[0] == 0) + { + S_StopMusic(); + return; + } + + if (strncmp(music_name, mmusic, 6)) + { + S_StopMusic(); // shutdown old music + if (!S_DigMusic(mmusic, looping) && !S_MIDIMusic(mmusic, looping)) + { + CONS_Alert(CONS_ERROR, M_GetText("Music lump %.6s not found!\n"), mmusic); + return; + } + } + I_SetSongTrack(mflags & MUSIC_TRACKMASK); +} + +boolean S_SpeedMusic(float speed) +{ + return I_SetSongSpeed(speed); +} + +void S_StopMusic(void) +{ + if (!music_playing) + return; + + if (mus_paused) + I_ResumeSong(music_handle); + + if (!nodigimusic) + I_StopDigSong(); + + S_SpeedMusic(1.0f); + I_StopSong(music_handle); + I_UnRegisterSong(music_handle); + +#ifndef HAVE_SDL //SDL uses RWOPS + Z_ChangeTag(music_data, PU_CACHE); +#endif + + music_data = NULL; + music_name[0] = 0; +} + +void S_SetDigMusicVolume(INT32 volume) +{ + if (volume < 0 || volume > 31) + CONS_Alert(CONS_WARNING, "musicvolume should be between 0-31\n"); + + CV_SetValue(&cv_digmusicvolume, volume&31); + actualdigmusicvolume = cv_digmusicvolume.value; //check for change of var + +#ifdef DJGPPDOS + I_SetDigMusicVolume(31); // Trick for buggy dos drivers. Win32 doesn't need this. +#endif + if (!nodigimusic) + I_SetDigMusicVolume(volume&31); +} + +void S_SetMIDIMusicVolume(INT32 volume) +{ + if (volume < 0 || volume > 31) + CONS_Alert(CONS_WARNING, "musicvolume should be between 0-31\n"); + + CV_SetValue(&cv_midimusicvolume, volume&0x1f); + actualmidimusicvolume = cv_midimusicvolume.value; //check for change of var + +#ifdef DJGPPDOS + I_SetMIDIMusicVolume(31); // Trick for buggy dos drivers. Win32 doesn't need this. +#endif + I_SetMIDIMusicVolume(volume&0x1f); +} + +/// ------------------------ +/// Init & Others +/// ------------------------ + +// +// Initializes sound stuff, including volume +// Sets channels, SFX and music volume, +// allocates channel buffer, sets S_sfx lookup. +// +void S_Init(INT32 sfxVolume, INT32 digMusicVolume, INT32 midiMusicVolume) +{ + INT32 i; + + if (dedicated) + return; + + S_SetSfxVolume(sfxVolume); + S_SetDigMusicVolume(digMusicVolume); + S_SetMIDIMusicVolume(midiMusicVolume); + + SetChannelsNum(); + + // no sounds are playing, and they are not mus_paused + mus_paused = 0; + + // Note that sounds have not been cached (yet). + for (i = 1; i < NUMSFX; i++) + { + S_sfx[i].usefulness = -1; // for I_GetSfx() + S_sfx[i].lumpnum = LUMPERROR; + } + + // precache sounds if requested by cmdline, or precachesound var true + if (!nosound && (M_CheckParm("-precachesound") || precachesound.value)) + { + // Initialize external data (all sounds) at start, keep static. + CONS_Printf(M_GetText("Loading sounds... ")); + + for (i = 1; i < NUMSFX; i++) + if (S_sfx[i].name) + S_sfx[i].data = I_GetSfx(&S_sfx[i]); + + CONS_Printf(M_GetText(" pre-cached all sound data\n")); + } +} + + +// +// Per level startup code. +// Kills playing sounds at start of level, +// determines music if any, changes music. +// +void S_Start(void) +{ + if (mapmusflags & MUSIC_RELOADRESET) + { + strncpy(mapmusname, mapheaderinfo[gamemap-1]->musname, 7); + mapmusname[6] = 0; + mapmusflags = (mapheaderinfo[gamemap-1]->mustrack & MUSIC_TRACKMASK); + } + + mus_paused = 0; + + if (cv_resetmusic.value) + S_StopMusic(); + S_ChangeMusic(mapmusname, mapmusflags, true); +} + +// +// Stop and resume music, during game PAUSE. +// +void S_PauseAudio(void) +{ + if (!nodigimusic) + I_PauseSong(0); + + if (music_playing && !mus_paused) + { + I_PauseSong(music_handle); + mus_paused = true; + } + + // pause cd music +#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL) + I_PauseCD(); +#else + I_StopCD(); +#endif +} + +void S_ResumeAudio(void) +{ + if (!nodigimusic) + I_ResumeSong(0); + else + if (music_playing && mus_paused) + { + I_ResumeSong(music_handle); + mus_paused = false; + } + + // resume cd music + I_ResumeCD(); +} diff --git a/src/s_sound.h b/src/s_sound.h index 6589ca598..12787536b 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -48,9 +48,6 @@ typedef enum extern consvar_t play_mode; #endif -//in case you're wondering why: I need to define this as extern so P_RestoreMusic can get to it so we don't do stupid song/speed changes -extern musicinfo_t *mus_playing; - typedef enum { SF_TOTALLYSINGLE = 1, // Only play one of these sounds at a time...GLOBALLY @@ -100,11 +97,12 @@ void S_StartSoundAtVolume(const void *origin, sfxenum_t sound_id, INT32 volume); // Stop sound for thing at void S_StopSound(void *origin); -// Start music using from sounds.h, and set whether looping -// note: music slot is first 16 bits for songnum, -// next 15 bits for tracknum (gme, other formats with more than one track) +// Start music track, arbitrary, given its name, and set whether looping +// note: music flags 12 bits for tracknum (gme, other formats with more than one track) +// 13-15 aren't used yet // and the last bit we ignore (internal game flag for resetting music on reload) -void S_ChangeMusic(UINT32 mslotnum, boolean looping); +#define S_ChangeMusicInternal(a,b) S_ChangeMusic(a,0,b) +void S_ChangeMusic(const char *mmusic, UINT16 mflags, boolean looping); // Set Speed of Music boolean S_SpeedMusic(float speed); @@ -113,8 +111,8 @@ boolean S_SpeedMusic(float speed); void S_StopMusic(void); // Stop and resume music, during game PAUSE. -void S_PauseSound(void); -void S_ResumeSound(void); +void S_PauseAudio(void); +void S_ResumeAudio(void); // // Updates music & sounds diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 71969209c..2ce546153 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -374,6 +374,7 @@ void I_FreeSfx(sfxinfo_t *sfx) if (sfx->data) Mix_FreeChunk(sfx->data); sfx->data = NULL; + sfx->lumpnum = LUMPERROR; } INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) diff --git a/src/sounds.c b/src/sounds.c index 1ec86e7bc..97bdf23ec 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -20,1067 +20,6 @@ #include "w_wad.h" #include "lua_script.h" -// -// Information about all the music -// - -musicinfo_t S_music[NUMMUSIC] = -{ - {NULL, 0, NULL, -1}, - {"map01m", 0, NULL, -1}, - {"map02m", 0, NULL, -1}, - {"map03m", 0, NULL, -1}, - {"map04m", 0, NULL, -1}, - {"map05m", 0, NULL, -1}, - {"map06m", 0, NULL, -1}, - {"map07m", 0, NULL, -1}, - {"map08m", 0, NULL, -1}, - {"map09m", 0, NULL, -1}, - {"map10m", 0, NULL, -1}, - {"map11m", 0, NULL, -1}, - {"map12m", 0, NULL, -1}, - {"map13m", 0, NULL, -1}, - {"map14m", 0, NULL, -1}, - {"map15m", 0, NULL, -1}, - {"map16m", 0, NULL, -1}, - {"map17m", 0, NULL, -1}, - {"map18m", 0, NULL, -1}, - {"map19m", 0, NULL, -1}, - {"map20m", 0, NULL, -1}, - {"map21m", 0, NULL, -1}, - {"map22m", 0, NULL, -1}, - {"map23m", 0, NULL, -1}, - {"map24m", 0, NULL, -1}, - {"map25m", 0, NULL, -1}, - {"map26m", 0, NULL, -1}, - {"map27m", 0, NULL, -1}, - {"map28m", 0, NULL, -1}, - {"map29m", 0, NULL, -1}, - {"map30m", 0, NULL, -1}, - {"map31m", 0, NULL, -1}, - {"map32m", 0, NULL, -1}, - {"map33m", 0, NULL, -1}, - {"map34m", 0, NULL, -1}, - {"map35m", 0, NULL, -1}, - {"map36m", 0, NULL, -1}, - {"map37m", 0, NULL, -1}, - {"map38m", 0, NULL, -1}, - {"map39m", 0, NULL, -1}, - {"map40m", 0, NULL, -1}, - {"map41m", 0, NULL, -1}, - {"map42m", 0, NULL, -1}, - {"map43m", 0, NULL, -1}, - {"map44m", 0, NULL, -1}, - {"map45m", 0, NULL, -1}, - {"map46m", 0, NULL, -1}, - {"map47m", 0, NULL, -1}, - {"map48m", 0, NULL, -1}, - {"map49m", 0, NULL, -1}, - {"map50m", 0, NULL, -1}, - {"map51m", 0, NULL, -1}, - {"map52m", 0, NULL, -1}, - {"map53m", 0, NULL, -1}, - {"map54m", 0, NULL, -1}, - {"map55m", 0, NULL, -1}, - {"map56m", 0, NULL, -1}, - {"map57m", 0, NULL, -1}, - {"map58m", 0, NULL, -1}, - {"map59m", 0, NULL, -1}, - {"map60m", 0, NULL, -1}, - {"map61m", 0, NULL, -1}, - {"map62m", 0, NULL, -1}, - {"map63m", 0, NULL, -1}, - {"map64m", 0, NULL, -1}, - {"map65m", 0, NULL, -1}, - {"map66m", 0, NULL, -1}, - {"map67m", 0, NULL, -1}, - {"map68m", 0, NULL, -1}, - {"map69m", 0, NULL, -1}, - {"map70m", 0, NULL, -1}, - {"map71m", 0, NULL, -1}, - {"map72m", 0, NULL, -1}, - {"map73m", 0, NULL, -1}, - {"map74m", 0, NULL, -1}, - {"map75m", 0, NULL, -1}, - {"map76m", 0, NULL, -1}, - {"map77m", 0, NULL, -1}, - {"map78m", 0, NULL, -1}, - {"map79m", 0, NULL, -1}, - {"map80m", 0, NULL, -1}, - {"map81m", 0, NULL, -1}, - {"map82m", 0, NULL, -1}, - {"map83m", 0, NULL, -1}, - {"map84m", 0, NULL, -1}, - {"map85m", 0, NULL, -1}, - {"map86m", 0, NULL, -1}, - {"map87m", 0, NULL, -1}, - {"map88m", 0, NULL, -1}, - {"map89m", 0, NULL, -1}, - {"map90m", 0, NULL, -1}, - {"map91m", 0, NULL, -1}, - {"map92m", 0, NULL, -1}, - {"map93m", 0, NULL, -1}, - {"map94m", 0, NULL, -1}, - {"map95m", 0, NULL, -1}, - {"map96m", 0, NULL, -1}, - {"map97m", 0, NULL, -1}, - {"map98m", 0, NULL, -1}, - {"map99m", 0, NULL, -1}, - {"mapa0m", 0, NULL, -1}, - {"mapa1m", 0, NULL, -1}, - {"mapa2m", 0, NULL, -1}, - {"mapa3m", 0, NULL, -1}, - {"mapa4m", 0, NULL, -1}, - {"mapa5m", 0, NULL, -1}, - {"mapa6m", 0, NULL, -1}, - {"mapa7m", 0, NULL, -1}, - {"mapa8m", 0, NULL, -1}, - {"mapa9m", 0, NULL, -1}, - {"mapaam", 0, NULL, -1}, - {"mapabm", 0, NULL, -1}, - {"mapacm", 0, NULL, -1}, - {"mapadm", 0, NULL, -1}, - {"mapaem", 0, NULL, -1}, - {"mapafm", 0, NULL, -1}, - {"mapagm", 0, NULL, -1}, - {"mapahm", 0, NULL, -1}, - {"mapaim", 0, NULL, -1}, - {"mapajm", 0, NULL, -1}, - {"mapakm", 0, NULL, -1}, - {"mapalm", 0, NULL, -1}, - {"mapamm", 0, NULL, -1}, - {"mapanm", 0, NULL, -1}, - {"mapaom", 0, NULL, -1}, - {"mapapm", 0, NULL, -1}, - {"mapaqm", 0, NULL, -1}, - {"maparm", 0, NULL, -1}, - {"mapasm", 0, NULL, -1}, - {"mapatm", 0, NULL, -1}, - {"mapaum", 0, NULL, -1}, - {"mapavm", 0, NULL, -1}, - {"mapawm", 0, NULL, -1}, - {"mapaxm", 0, NULL, -1}, - {"mapaym", 0, NULL, -1}, - {"mapazm", 0, NULL, -1}, - {"mapb0m", 0, NULL, -1}, - {"mapb1m", 0, NULL, -1}, - {"mapb2m", 0, NULL, -1}, - {"mapb3m", 0, NULL, -1}, - {"mapb4m", 0, NULL, -1}, - {"mapb5m", 0, NULL, -1}, - {"mapb6m", 0, NULL, -1}, - {"mapb7m", 0, NULL, -1}, - {"mapb8m", 0, NULL, -1}, - {"mapb9m", 0, NULL, -1}, - {"mapbam", 0, NULL, -1}, - {"mapbbm", 0, NULL, -1}, - {"mapbcm", 0, NULL, -1}, - {"mapbdm", 0, NULL, -1}, - {"mapbem", 0, NULL, -1}, - {"mapbfm", 0, NULL, -1}, - {"mapbgm", 0, NULL, -1}, - {"mapbhm", 0, NULL, -1}, - {"mapbim", 0, NULL, -1}, - {"mapbjm", 0, NULL, -1}, - {"mapbkm", 0, NULL, -1}, - {"mapblm", 0, NULL, -1}, - {"mapbmm", 0, NULL, -1}, - {"mapbnm", 0, NULL, -1}, - {"mapbom", 0, NULL, -1}, - {"mapbpm", 0, NULL, -1}, - {"mapbqm", 0, NULL, -1}, - {"mapbrm", 0, NULL, -1}, - {"mapbsm", 0, NULL, -1}, - {"mapbtm", 0, NULL, -1}, - {"mapbum", 0, NULL, -1}, - {"mapbvm", 0, NULL, -1}, - {"mapbwm", 0, NULL, -1}, - {"mapbxm", 0, NULL, -1}, - {"mapbym", 0, NULL, -1}, - {"mapbzm", 0, NULL, -1}, - {"mapc0m", 0, NULL, -1}, - {"mapc1m", 0, NULL, -1}, - {"mapc2m", 0, NULL, -1}, - {"mapc3m", 0, NULL, -1}, - {"mapc4m", 0, NULL, -1}, - {"mapc5m", 0, NULL, -1}, - {"mapc6m", 0, NULL, -1}, - {"mapc7m", 0, NULL, -1}, - {"mapc8m", 0, NULL, -1}, - {"mapc9m", 0, NULL, -1}, - {"mapcam", 0, NULL, -1}, - {"mapcbm", 0, NULL, -1}, - {"mapccm", 0, NULL, -1}, - {"mapcdm", 0, NULL, -1}, - {"mapcem", 0, NULL, -1}, - {"mapcfm", 0, NULL, -1}, - {"mapcgm", 0, NULL, -1}, - {"mapchm", 0, NULL, -1}, - {"mapcim", 0, NULL, -1}, - {"mapcjm", 0, NULL, -1}, - {"mapckm", 0, NULL, -1}, - {"mapclm", 0, NULL, -1}, - {"mapcmm", 0, NULL, -1}, - {"mapcnm", 0, NULL, -1}, - {"mapcom", 0, NULL, -1}, - {"mapcpm", 0, NULL, -1}, - {"mapcqm", 0, NULL, -1}, - {"mapcrm", 0, NULL, -1}, - {"mapcsm", 0, NULL, -1}, - {"mapctm", 0, NULL, -1}, - {"mapcum", 0, NULL, -1}, - {"mapcvm", 0, NULL, -1}, - {"mapcwm", 0, NULL, -1}, - {"mapcxm", 0, NULL, -1}, - {"mapcym", 0, NULL, -1}, - {"mapczm", 0, NULL, -1}, - {"mapd0m", 0, NULL, -1}, - {"mapd1m", 0, NULL, -1}, - {"mapd2m", 0, NULL, -1}, - {"mapd3m", 0, NULL, -1}, - {"mapd4m", 0, NULL, -1}, - {"mapd5m", 0, NULL, -1}, - {"mapd6m", 0, NULL, -1}, - {"mapd7m", 0, NULL, -1}, - {"mapd8m", 0, NULL, -1}, - {"mapd9m", 0, NULL, -1}, - {"mapdam", 0, NULL, -1}, - {"mapdbm", 0, NULL, -1}, - {"mapdcm", 0, NULL, -1}, - {"mapddm", 0, NULL, -1}, - {"mapdem", 0, NULL, -1}, - {"mapdfm", 0, NULL, -1}, - {"mapdgm", 0, NULL, -1}, - {"mapdhm", 0, NULL, -1}, - {"mapdim", 0, NULL, -1}, - {"mapdjm", 0, NULL, -1}, - {"mapdkm", 0, NULL, -1}, - {"mapdlm", 0, NULL, -1}, - {"mapdmm", 0, NULL, -1}, - {"mapdnm", 0, NULL, -1}, - {"mapdom", 0, NULL, -1}, - {"mapdpm", 0, NULL, -1}, - {"mapdqm", 0, NULL, -1}, - {"mapdrm", 0, NULL, -1}, - {"mapdsm", 0, NULL, -1}, - {"mapdtm", 0, NULL, -1}, - {"mapdum", 0, NULL, -1}, - {"mapdvm", 0, NULL, -1}, - {"mapdwm", 0, NULL, -1}, - {"mapdxm", 0, NULL, -1}, - {"mapdym", 0, NULL, -1}, - {"mapdzm", 0, NULL, -1}, - {"mape0m", 0, NULL, -1}, - {"mape1m", 0, NULL, -1}, - {"mape2m", 0, NULL, -1}, - {"mape3m", 0, NULL, -1}, - {"mape4m", 0, NULL, -1}, - {"mape5m", 0, NULL, -1}, - {"mape6m", 0, NULL, -1}, - {"mape7m", 0, NULL, -1}, - {"mape8m", 0, NULL, -1}, - {"mape9m", 0, NULL, -1}, - {"mapeam", 0, NULL, -1}, - {"mapebm", 0, NULL, -1}, - {"mapecm", 0, NULL, -1}, - {"mapedm", 0, NULL, -1}, - {"mapeem", 0, NULL, -1}, - {"mapefm", 0, NULL, -1}, - {"mapegm", 0, NULL, -1}, - {"mapehm", 0, NULL, -1}, - {"mapeim", 0, NULL, -1}, - {"mapejm", 0, NULL, -1}, - {"mapekm", 0, NULL, -1}, - {"mapelm", 0, NULL, -1}, - {"mapemm", 0, NULL, -1}, - {"mapenm", 0, NULL, -1}, - {"mapeom", 0, NULL, -1}, - {"mapepm", 0, NULL, -1}, - {"mapeqm", 0, NULL, -1}, - {"maperm", 0, NULL, -1}, - {"mapesm", 0, NULL, -1}, - {"mapetm", 0, NULL, -1}, - {"mapeum", 0, NULL, -1}, - {"mapevm", 0, NULL, -1}, - {"mapewm", 0, NULL, -1}, - {"mapexm", 0, NULL, -1}, - {"mapeym", 0, NULL, -1}, - {"mapezm", 0, NULL, -1}, - {"mapf0m", 0, NULL, -1}, - {"mapf1m", 0, NULL, -1}, - {"mapf2m", 0, NULL, -1}, - {"mapf3m", 0, NULL, -1}, - {"mapf4m", 0, NULL, -1}, - {"mapf5m", 0, NULL, -1}, - {"mapf6m", 0, NULL, -1}, - {"mapf7m", 0, NULL, -1}, - {"mapf8m", 0, NULL, -1}, - {"mapf9m", 0, NULL, -1}, - {"mapfam", 0, NULL, -1}, - {"mapfbm", 0, NULL, -1}, - {"mapfcm", 0, NULL, -1}, - {"mapfdm", 0, NULL, -1}, - {"mapfem", 0, NULL, -1}, - {"mapffm", 0, NULL, -1}, - {"mapfgm", 0, NULL, -1}, - {"mapfhm", 0, NULL, -1}, - {"mapfim", 0, NULL, -1}, - {"mapfjm", 0, NULL, -1}, - {"mapfkm", 0, NULL, -1}, - {"mapflm", 0, NULL, -1}, - {"mapfmm", 0, NULL, -1}, - {"mapfnm", 0, NULL, -1}, - {"mapfom", 0, NULL, -1}, - {"mapfpm", 0, NULL, -1}, - {"mapfqm", 0, NULL, -1}, - {"mapfrm", 0, NULL, -1}, - {"mapfsm", 0, NULL, -1}, - {"mapftm", 0, NULL, -1}, - {"mapfum", 0, NULL, -1}, - {"mapfvm", 0, NULL, -1}, - {"mapfwm", 0, NULL, -1}, - {"mapfxm", 0, NULL, -1}, - {"mapfym", 0, NULL, -1}, - {"mapfzm", 0, NULL, -1}, - {"mapg0m", 0, NULL, -1}, - {"mapg1m", 0, NULL, -1}, - {"mapg2m", 0, NULL, -1}, - {"mapg3m", 0, NULL, -1}, - {"mapg4m", 0, NULL, -1}, - {"mapg5m", 0, NULL, -1}, - {"mapg6m", 0, NULL, -1}, - {"mapg7m", 0, NULL, -1}, - {"mapg8m", 0, NULL, -1}, - {"mapg9m", 0, NULL, -1}, - {"mapgam", 0, NULL, -1}, - {"mapgbm", 0, NULL, -1}, - {"mapgcm", 0, NULL, -1}, - {"mapgdm", 0, NULL, -1}, - {"mapgem", 0, NULL, -1}, - {"mapgfm", 0, NULL, -1}, - {"mapggm", 0, NULL, -1}, - {"mapghm", 0, NULL, -1}, - {"mapgim", 0, NULL, -1}, - {"mapgjm", 0, NULL, -1}, - {"mapgkm", 0, NULL, -1}, - {"mapglm", 0, NULL, -1}, - {"mapgmm", 0, NULL, -1}, - {"mapgnm", 0, NULL, -1}, - {"mapgom", 0, NULL, -1}, - {"mapgpm", 0, NULL, -1}, - {"mapgqm", 0, NULL, -1}, - {"mapgrm", 0, NULL, -1}, - {"mapgsm", 0, NULL, -1}, - {"mapgtm", 0, NULL, -1}, - {"mapgum", 0, NULL, -1}, - {"mapgvm", 0, NULL, -1}, - {"mapgwm", 0, NULL, -1}, - {"mapgxm", 0, NULL, -1}, - {"mapgym", 0, NULL, -1}, - {"mapgzm", 0, NULL, -1}, - {"maph0m", 0, NULL, -1}, - {"maph1m", 0, NULL, -1}, - {"maph2m", 0, NULL, -1}, - {"maph3m", 0, NULL, -1}, - {"maph4m", 0, NULL, -1}, - {"maph5m", 0, NULL, -1}, - {"maph6m", 0, NULL, -1}, - {"maph7m", 0, NULL, -1}, - {"maph8m", 0, NULL, -1}, - {"maph9m", 0, NULL, -1}, - {"mapham", 0, NULL, -1}, - {"maphbm", 0, NULL, -1}, - {"maphcm", 0, NULL, -1}, - {"maphdm", 0, NULL, -1}, - {"maphem", 0, NULL, -1}, - {"maphfm", 0, NULL, -1}, - {"maphgm", 0, NULL, -1}, - {"maphhm", 0, NULL, -1}, - {"maphim", 0, NULL, -1}, - {"maphjm", 0, NULL, -1}, - {"maphkm", 0, NULL, -1}, - {"maphlm", 0, NULL, -1}, - {"maphmm", 0, NULL, -1}, - {"maphnm", 0, NULL, -1}, - {"maphom", 0, NULL, -1}, - {"maphpm", 0, NULL, -1}, - {"maphqm", 0, NULL, -1}, - {"maphrm", 0, NULL, -1}, - {"maphsm", 0, NULL, -1}, - {"maphtm", 0, NULL, -1}, - {"maphum", 0, NULL, -1}, - {"maphvm", 0, NULL, -1}, - {"maphwm", 0, NULL, -1}, - {"maphxm", 0, NULL, -1}, - {"maphym", 0, NULL, -1}, - {"maphzm", 0, NULL, -1}, - {"mapi0m", 0, NULL, -1}, - {"mapi1m", 0, NULL, -1}, - {"mapi2m", 0, NULL, -1}, - {"mapi3m", 0, NULL, -1}, - {"mapi4m", 0, NULL, -1}, - {"mapi5m", 0, NULL, -1}, - {"mapi6m", 0, NULL, -1}, - {"mapi7m", 0, NULL, -1}, - {"mapi8m", 0, NULL, -1}, - {"mapi9m", 0, NULL, -1}, - {"mapiam", 0, NULL, -1}, - {"mapibm", 0, NULL, -1}, - {"mapicm", 0, NULL, -1}, - {"mapidm", 0, NULL, -1}, - {"mapiem", 0, NULL, -1}, - {"mapifm", 0, NULL, -1}, - {"mapigm", 0, NULL, -1}, - {"mapihm", 0, NULL, -1}, - {"mapiim", 0, NULL, -1}, - {"mapijm", 0, NULL, -1}, - {"mapikm", 0, NULL, -1}, - {"mapilm", 0, NULL, -1}, - {"mapimm", 0, NULL, -1}, - {"mapinm", 0, NULL, -1}, - {"mapiom", 0, NULL, -1}, - {"mapipm", 0, NULL, -1}, - {"mapiqm", 0, NULL, -1}, - {"mapirm", 0, NULL, -1}, - {"mapism", 0, NULL, -1}, - {"mapitm", 0, NULL, -1}, - {"mapium", 0, NULL, -1}, - {"mapivm", 0, NULL, -1}, - {"mapiwm", 0, NULL, -1}, - {"mapixm", 0, NULL, -1}, - {"mapiym", 0, NULL, -1}, - {"mapizm", 0, NULL, -1}, - {"mapj0m", 0, NULL, -1}, - {"mapj1m", 0, NULL, -1}, - {"mapj2m", 0, NULL, -1}, - {"mapj3m", 0, NULL, -1}, - {"mapj4m", 0, NULL, -1}, - {"mapj5m", 0, NULL, -1}, - {"mapj6m", 0, NULL, -1}, - {"mapj7m", 0, NULL, -1}, - {"mapj8m", 0, NULL, -1}, - {"mapj9m", 0, NULL, -1}, - {"mapjam", 0, NULL, -1}, - {"mapjbm", 0, NULL, -1}, - {"mapjcm", 0, NULL, -1}, - {"mapjdm", 0, NULL, -1}, - {"mapjem", 0, NULL, -1}, - {"mapjfm", 0, NULL, -1}, - {"mapjgm", 0, NULL, -1}, - {"mapjhm", 0, NULL, -1}, - {"mapjim", 0, NULL, -1}, - {"mapjjm", 0, NULL, -1}, - {"mapjkm", 0, NULL, -1}, - {"mapjlm", 0, NULL, -1}, - {"mapjmm", 0, NULL, -1}, - {"mapjnm", 0, NULL, -1}, - {"mapjom", 0, NULL, -1}, - {"mapjpm", 0, NULL, -1}, - {"mapjqm", 0, NULL, -1}, - {"mapjrm", 0, NULL, -1}, - {"mapjsm", 0, NULL, -1}, - {"mapjtm", 0, NULL, -1}, - {"mapjum", 0, NULL, -1}, - {"mapjvm", 0, NULL, -1}, - {"mapjwm", 0, NULL, -1}, - {"mapjxm", 0, NULL, -1}, - {"mapjym", 0, NULL, -1}, - {"mapjzm", 0, NULL, -1}, - {"mapk0m", 0, NULL, -1}, - {"mapk1m", 0, NULL, -1}, - {"mapk2m", 0, NULL, -1}, - {"mapk3m", 0, NULL, -1}, - {"mapk4m", 0, NULL, -1}, - {"mapk5m", 0, NULL, -1}, - {"mapk6m", 0, NULL, -1}, - {"mapk7m", 0, NULL, -1}, - {"mapk8m", 0, NULL, -1}, - {"mapk9m", 0, NULL, -1}, - {"mapkam", 0, NULL, -1}, - {"mapkbm", 0, NULL, -1}, - {"mapkcm", 0, NULL, -1}, - {"mapkdm", 0, NULL, -1}, - {"mapkem", 0, NULL, -1}, - {"mapkfm", 0, NULL, -1}, - {"mapkgm", 0, NULL, -1}, - {"mapkhm", 0, NULL, -1}, - {"mapkim", 0, NULL, -1}, - {"mapkjm", 0, NULL, -1}, - {"mapkkm", 0, NULL, -1}, - {"mapklm", 0, NULL, -1}, - {"mapkmm", 0, NULL, -1}, - {"mapknm", 0, NULL, -1}, - {"mapkom", 0, NULL, -1}, - {"mapkpm", 0, NULL, -1}, - {"mapkqm", 0, NULL, -1}, - {"mapkrm", 0, NULL, -1}, - {"mapksm", 0, NULL, -1}, - {"mapktm", 0, NULL, -1}, - {"mapkum", 0, NULL, -1}, - {"mapkvm", 0, NULL, -1}, - {"mapkwm", 0, NULL, -1}, - {"mapkxm", 0, NULL, -1}, - {"mapkym", 0, NULL, -1}, - {"mapkzm", 0, NULL, -1}, - {"mapl0m", 0, NULL, -1}, - {"mapl1m", 0, NULL, -1}, - {"mapl2m", 0, NULL, -1}, - {"mapl3m", 0, NULL, -1}, - {"mapl4m", 0, NULL, -1}, - {"mapl5m", 0, NULL, -1}, - {"mapl6m", 0, NULL, -1}, - {"mapl7m", 0, NULL, -1}, - {"mapl8m", 0, NULL, -1}, - {"mapl9m", 0, NULL, -1}, - {"maplam", 0, NULL, -1}, - {"maplbm", 0, NULL, -1}, - {"maplcm", 0, NULL, -1}, - {"mapldm", 0, NULL, -1}, - {"maplem", 0, NULL, -1}, - {"maplfm", 0, NULL, -1}, - {"maplgm", 0, NULL, -1}, - {"maplhm", 0, NULL, -1}, - {"maplim", 0, NULL, -1}, - {"mapljm", 0, NULL, -1}, - {"maplkm", 0, NULL, -1}, - {"mapllm", 0, NULL, -1}, - {"maplmm", 0, NULL, -1}, - {"maplnm", 0, NULL, -1}, - {"maplom", 0, NULL, -1}, - {"maplpm", 0, NULL, -1}, - {"maplqm", 0, NULL, -1}, - {"maplrm", 0, NULL, -1}, - {"maplsm", 0, NULL, -1}, - {"mapltm", 0, NULL, -1}, - {"maplum", 0, NULL, -1}, - {"maplvm", 0, NULL, -1}, - {"maplwm", 0, NULL, -1}, - {"maplxm", 0, NULL, -1}, - {"maplym", 0, NULL, -1}, - {"maplzm", 0, NULL, -1}, - {"mapm0m", 0, NULL, -1}, - {"mapm1m", 0, NULL, -1}, - {"mapm2m", 0, NULL, -1}, - {"mapm3m", 0, NULL, -1}, - {"mapm4m", 0, NULL, -1}, - {"mapm5m", 0, NULL, -1}, - {"mapm6m", 0, NULL, -1}, - {"mapm7m", 0, NULL, -1}, - {"mapm8m", 0, NULL, -1}, - {"mapm9m", 0, NULL, -1}, - {"mapmam", 0, NULL, -1}, - {"mapmbm", 0, NULL, -1}, - {"mapmcm", 0, NULL, -1}, - {"mapmdm", 0, NULL, -1}, - {"mapmem", 0, NULL, -1}, - {"mapmfm", 0, NULL, -1}, - {"mapmgm", 0, NULL, -1}, - {"mapmhm", 0, NULL, -1}, - {"mapmim", 0, NULL, -1}, - {"mapmjm", 0, NULL, -1}, - {"mapmkm", 0, NULL, -1}, - {"mapmlm", 0, NULL, -1}, - {"mapmmm", 0, NULL, -1}, - {"mapmnm", 0, NULL, -1}, - {"mapmom", 0, NULL, -1}, - {"mapmpm", 0, NULL, -1}, - {"mapmqm", 0, NULL, -1}, - {"mapmrm", 0, NULL, -1}, - {"mapmsm", 0, NULL, -1}, - {"mapmtm", 0, NULL, -1}, - {"mapmum", 0, NULL, -1}, - {"mapmvm", 0, NULL, -1}, - {"mapmwm", 0, NULL, -1}, - {"mapmxm", 0, NULL, -1}, - {"mapmym", 0, NULL, -1}, - {"mapmzm", 0, NULL, -1}, - {"mapn0m", 0, NULL, -1}, - {"mapn1m", 0, NULL, -1}, - {"mapn2m", 0, NULL, -1}, - {"mapn3m", 0, NULL, -1}, - {"mapn4m", 0, NULL, -1}, - {"mapn5m", 0, NULL, -1}, - {"mapn6m", 0, NULL, -1}, - {"mapn7m", 0, NULL, -1}, - {"mapn8m", 0, NULL, -1}, - {"mapn9m", 0, NULL, -1}, - {"mapnam", 0, NULL, -1}, - {"mapnbm", 0, NULL, -1}, - {"mapncm", 0, NULL, -1}, - {"mapndm", 0, NULL, -1}, - {"mapnem", 0, NULL, -1}, - {"mapnfm", 0, NULL, -1}, - {"mapngm", 0, NULL, -1}, - {"mapnhm", 0, NULL, -1}, - {"mapnim", 0, NULL, -1}, - {"mapnjm", 0, NULL, -1}, - {"mapnkm", 0, NULL, -1}, - {"mapnlm", 0, NULL, -1}, - {"mapnmm", 0, NULL, -1}, - {"mapnnm", 0, NULL, -1}, - {"mapnom", 0, NULL, -1}, - {"mapnpm", 0, NULL, -1}, - {"mapnqm", 0, NULL, -1}, - {"mapnrm", 0, NULL, -1}, - {"mapnsm", 0, NULL, -1}, - {"mapntm", 0, NULL, -1}, - {"mapnum", 0, NULL, -1}, - {"mapnvm", 0, NULL, -1}, - {"mapnwm", 0, NULL, -1}, - {"mapnxm", 0, NULL, -1}, - {"mapnym", 0, NULL, -1}, - {"mapnzm", 0, NULL, -1}, - {"mapo0m", 0, NULL, -1}, - {"mapo1m", 0, NULL, -1}, - {"mapo2m", 0, NULL, -1}, - {"mapo3m", 0, NULL, -1}, - {"mapo4m", 0, NULL, -1}, - {"mapo5m", 0, NULL, -1}, - {"mapo6m", 0, NULL, -1}, - {"mapo7m", 0, NULL, -1}, - {"mapo8m", 0, NULL, -1}, - {"mapo9m", 0, NULL, -1}, - {"mapoam", 0, NULL, -1}, - {"mapobm", 0, NULL, -1}, - {"mapocm", 0, NULL, -1}, - {"mapodm", 0, NULL, -1}, - {"mapoem", 0, NULL, -1}, - {"mapofm", 0, NULL, -1}, - {"mapogm", 0, NULL, -1}, - {"mapohm", 0, NULL, -1}, - {"mapoim", 0, NULL, -1}, - {"mapojm", 0, NULL, -1}, - {"mapokm", 0, NULL, -1}, - {"mapolm", 0, NULL, -1}, - {"mapomm", 0, NULL, -1}, - {"maponm", 0, NULL, -1}, - {"mapoom", 0, NULL, -1}, - {"mapopm", 0, NULL, -1}, - {"mapoqm", 0, NULL, -1}, - {"maporm", 0, NULL, -1}, - {"maposm", 0, NULL, -1}, - {"mapotm", 0, NULL, -1}, - {"mapoum", 0, NULL, -1}, - {"mapovm", 0, NULL, -1}, - {"mapowm", 0, NULL, -1}, - {"mapoxm", 0, NULL, -1}, - {"mapoym", 0, NULL, -1}, - {"mapozm", 0, NULL, -1}, - {"mapp0m", 0, NULL, -1}, - {"mapp1m", 0, NULL, -1}, - {"mapp2m", 0, NULL, -1}, - {"mapp3m", 0, NULL, -1}, - {"mapp4m", 0, NULL, -1}, - {"mapp5m", 0, NULL, -1}, - {"mapp6m", 0, NULL, -1}, - {"mapp7m", 0, NULL, -1}, - {"mapp8m", 0, NULL, -1}, - {"mapp9m", 0, NULL, -1}, - {"mappam", 0, NULL, -1}, - {"mappbm", 0, NULL, -1}, - {"mappcm", 0, NULL, -1}, - {"mappdm", 0, NULL, -1}, - {"mappem", 0, NULL, -1}, - {"mappfm", 0, NULL, -1}, - {"mappgm", 0, NULL, -1}, - {"mapphm", 0, NULL, -1}, - {"mappim", 0, NULL, -1}, - {"mappjm", 0, NULL, -1}, - {"mappkm", 0, NULL, -1}, - {"mapplm", 0, NULL, -1}, - {"mappmm", 0, NULL, -1}, - {"mappnm", 0, NULL, -1}, - {"mappom", 0, NULL, -1}, - {"mapppm", 0, NULL, -1}, - {"mappqm", 0, NULL, -1}, - {"mapprm", 0, NULL, -1}, - {"mappsm", 0, NULL, -1}, - {"mapptm", 0, NULL, -1}, - {"mappum", 0, NULL, -1}, - {"mappvm", 0, NULL, -1}, - {"mappwm", 0, NULL, -1}, - {"mappxm", 0, NULL, -1}, - {"mappym", 0, NULL, -1}, - {"mappzm", 0, NULL, -1}, - {"mapq0m", 0, NULL, -1}, - {"mapq1m", 0, NULL, -1}, - {"mapq2m", 0, NULL, -1}, - {"mapq3m", 0, NULL, -1}, - {"mapq4m", 0, NULL, -1}, - {"mapq5m", 0, NULL, -1}, - {"mapq6m", 0, NULL, -1}, - {"mapq7m", 0, NULL, -1}, - {"mapq8m", 0, NULL, -1}, - {"mapq9m", 0, NULL, -1}, - {"mapqam", 0, NULL, -1}, - {"mapqbm", 0, NULL, -1}, - {"mapqcm", 0, NULL, -1}, - {"mapqdm", 0, NULL, -1}, - {"mapqem", 0, NULL, -1}, - {"mapqfm", 0, NULL, -1}, - {"mapqgm", 0, NULL, -1}, - {"mapqhm", 0, NULL, -1}, - {"mapqim", 0, NULL, -1}, - {"mapqjm", 0, NULL, -1}, - {"mapqkm", 0, NULL, -1}, - {"mapqlm", 0, NULL, -1}, - {"mapqmm", 0, NULL, -1}, - {"mapqnm", 0, NULL, -1}, - {"mapqom", 0, NULL, -1}, - {"mapqpm", 0, NULL, -1}, - {"mapqqm", 0, NULL, -1}, - {"mapqrm", 0, NULL, -1}, - {"mapqsm", 0, NULL, -1}, - {"mapqtm", 0, NULL, -1}, - {"mapqum", 0, NULL, -1}, - {"mapqvm", 0, NULL, -1}, - {"mapqwm", 0, NULL, -1}, - {"mapqxm", 0, NULL, -1}, - {"mapqym", 0, NULL, -1}, - {"mapqzm", 0, NULL, -1}, - {"mapr0m", 0, NULL, -1}, - {"mapr1m", 0, NULL, -1}, - {"mapr2m", 0, NULL, -1}, - {"mapr3m", 0, NULL, -1}, - {"mapr4m", 0, NULL, -1}, - {"mapr5m", 0, NULL, -1}, - {"mapr6m", 0, NULL, -1}, - {"mapr7m", 0, NULL, -1}, - {"mapr8m", 0, NULL, -1}, - {"mapr9m", 0, NULL, -1}, - {"mapram", 0, NULL, -1}, - {"maprbm", 0, NULL, -1}, - {"maprcm", 0, NULL, -1}, - {"maprdm", 0, NULL, -1}, - {"maprem", 0, NULL, -1}, - {"maprfm", 0, NULL, -1}, - {"maprgm", 0, NULL, -1}, - {"maprhm", 0, NULL, -1}, - {"maprim", 0, NULL, -1}, - {"maprjm", 0, NULL, -1}, - {"maprkm", 0, NULL, -1}, - {"maprlm", 0, NULL, -1}, - {"maprmm", 0, NULL, -1}, - {"maprnm", 0, NULL, -1}, - {"maprom", 0, NULL, -1}, - {"maprpm", 0, NULL, -1}, - {"maprqm", 0, NULL, -1}, - {"maprrm", 0, NULL, -1}, - {"maprsm", 0, NULL, -1}, - {"maprtm", 0, NULL, -1}, - {"maprum", 0, NULL, -1}, - {"maprvm", 0, NULL, -1}, - {"maprwm", 0, NULL, -1}, - {"maprxm", 0, NULL, -1}, - {"maprym", 0, NULL, -1}, - {"maprzm", 0, NULL, -1}, - {"maps0m", 0, NULL, -1}, - {"maps1m", 0, NULL, -1}, - {"maps2m", 0, NULL, -1}, - {"maps3m", 0, NULL, -1}, - {"maps4m", 0, NULL, -1}, - {"maps5m", 0, NULL, -1}, - {"maps6m", 0, NULL, -1}, - {"maps7m", 0, NULL, -1}, - {"maps8m", 0, NULL, -1}, - {"maps9m", 0, NULL, -1}, - {"mapsam", 0, NULL, -1}, - {"mapsbm", 0, NULL, -1}, - {"mapscm", 0, NULL, -1}, - {"mapsdm", 0, NULL, -1}, - {"mapsem", 0, NULL, -1}, - {"mapsfm", 0, NULL, -1}, - {"mapsgm", 0, NULL, -1}, - {"mapshm", 0, NULL, -1}, - {"mapsim", 0, NULL, -1}, - {"mapsjm", 0, NULL, -1}, - {"mapskm", 0, NULL, -1}, - {"mapslm", 0, NULL, -1}, - {"mapsmm", 0, NULL, -1}, - {"mapsnm", 0, NULL, -1}, - {"mapsom", 0, NULL, -1}, - {"mapspm", 0, NULL, -1}, - {"mapsqm", 0, NULL, -1}, - {"mapsrm", 0, NULL, -1}, - {"mapssm", 0, NULL, -1}, - {"mapstm", 0, NULL, -1}, - {"mapsum", 0, NULL, -1}, - {"mapsvm", 0, NULL, -1}, - {"mapswm", 0, NULL, -1}, - {"mapsxm", 0, NULL, -1}, - {"mapsym", 0, NULL, -1}, - {"mapszm", 0, NULL, -1}, - {"mapt0m", 0, NULL, -1}, - {"mapt1m", 0, NULL, -1}, - {"mapt2m", 0, NULL, -1}, - {"mapt3m", 0, NULL, -1}, - {"mapt4m", 0, NULL, -1}, - {"mapt5m", 0, NULL, -1}, - {"mapt6m", 0, NULL, -1}, - {"mapt7m", 0, NULL, -1}, - {"mapt8m", 0, NULL, -1}, - {"mapt9m", 0, NULL, -1}, - {"maptam", 0, NULL, -1}, - {"maptbm", 0, NULL, -1}, - {"maptcm", 0, NULL, -1}, - {"maptdm", 0, NULL, -1}, - {"maptem", 0, NULL, -1}, - {"maptfm", 0, NULL, -1}, - {"maptgm", 0, NULL, -1}, - {"mapthm", 0, NULL, -1}, - {"maptim", 0, NULL, -1}, - {"maptjm", 0, NULL, -1}, - {"maptkm", 0, NULL, -1}, - {"maptlm", 0, NULL, -1}, - {"maptmm", 0, NULL, -1}, - {"maptnm", 0, NULL, -1}, - {"maptom", 0, NULL, -1}, - {"maptpm", 0, NULL, -1}, - {"maptqm", 0, NULL, -1}, - {"maptrm", 0, NULL, -1}, - {"maptsm", 0, NULL, -1}, - {"mapttm", 0, NULL, -1}, - {"maptum", 0, NULL, -1}, - {"maptvm", 0, NULL, -1}, - {"maptwm", 0, NULL, -1}, - {"maptxm", 0, NULL, -1}, - {"maptym", 0, NULL, -1}, - {"maptzm", 0, NULL, -1}, - {"mapu0m", 0, NULL, -1}, - {"mapu1m", 0, NULL, -1}, - {"mapu2m", 0, NULL, -1}, - {"mapu3m", 0, NULL, -1}, - {"mapu4m", 0, NULL, -1}, - {"mapu5m", 0, NULL, -1}, - {"mapu6m", 0, NULL, -1}, - {"mapu7m", 0, NULL, -1}, - {"mapu8m", 0, NULL, -1}, - {"mapu9m", 0, NULL, -1}, - {"mapuam", 0, NULL, -1}, - {"mapubm", 0, NULL, -1}, - {"mapucm", 0, NULL, -1}, - {"mapudm", 0, NULL, -1}, - {"mapuem", 0, NULL, -1}, - {"mapufm", 0, NULL, -1}, - {"mapugm", 0, NULL, -1}, - {"mapuhm", 0, NULL, -1}, - {"mapuim", 0, NULL, -1}, - {"mapujm", 0, NULL, -1}, - {"mapukm", 0, NULL, -1}, - {"mapulm", 0, NULL, -1}, - {"mapumm", 0, NULL, -1}, - {"mapunm", 0, NULL, -1}, - {"mapuom", 0, NULL, -1}, - {"mapupm", 0, NULL, -1}, - {"mapuqm", 0, NULL, -1}, - {"mapurm", 0, NULL, -1}, - {"mapusm", 0, NULL, -1}, - {"maputm", 0, NULL, -1}, - {"mapuum", 0, NULL, -1}, - {"mapuvm", 0, NULL, -1}, - {"mapuwm", 0, NULL, -1}, - {"mapuxm", 0, NULL, -1}, - {"mapuym", 0, NULL, -1}, - {"mapuzm", 0, NULL, -1}, - {"mapv0m", 0, NULL, -1}, - {"mapv1m", 0, NULL, -1}, - {"mapv2m", 0, NULL, -1}, - {"mapv3m", 0, NULL, -1}, - {"mapv4m", 0, NULL, -1}, - {"mapv5m", 0, NULL, -1}, - {"mapv6m", 0, NULL, -1}, - {"mapv7m", 0, NULL, -1}, - {"mapv8m", 0, NULL, -1}, - {"mapv9m", 0, NULL, -1}, - {"mapvam", 0, NULL, -1}, - {"mapvbm", 0, NULL, -1}, - {"mapvcm", 0, NULL, -1}, - {"mapvdm", 0, NULL, -1}, - {"mapvem", 0, NULL, -1}, - {"mapvfm", 0, NULL, -1}, - {"mapvgm", 0, NULL, -1}, - {"mapvhm", 0, NULL, -1}, - {"mapvim", 0, NULL, -1}, - {"mapvjm", 0, NULL, -1}, - {"mapvkm", 0, NULL, -1}, - {"mapvlm", 0, NULL, -1}, - {"mapvmm", 0, NULL, -1}, - {"mapvnm", 0, NULL, -1}, - {"mapvom", 0, NULL, -1}, - {"mapvpm", 0, NULL, -1}, - {"mapvqm", 0, NULL, -1}, - {"mapvrm", 0, NULL, -1}, - {"mapvsm", 0, NULL, -1}, - {"mapvtm", 0, NULL, -1}, - {"mapvum", 0, NULL, -1}, - {"mapvvm", 0, NULL, -1}, - {"mapvwm", 0, NULL, -1}, - {"mapvxm", 0, NULL, -1}, - {"mapvym", 0, NULL, -1}, - {"mapvzm", 0, NULL, -1}, - {"mapw0m", 0, NULL, -1}, - {"mapw1m", 0, NULL, -1}, - {"mapw2m", 0, NULL, -1}, - {"mapw3m", 0, NULL, -1}, - {"mapw4m", 0, NULL, -1}, - {"mapw5m", 0, NULL, -1}, - {"mapw6m", 0, NULL, -1}, - {"mapw7m", 0, NULL, -1}, - {"mapw8m", 0, NULL, -1}, - {"mapw9m", 0, NULL, -1}, - {"mapwam", 0, NULL, -1}, - {"mapwbm", 0, NULL, -1}, - {"mapwcm", 0, NULL, -1}, - {"mapwdm", 0, NULL, -1}, - {"mapwem", 0, NULL, -1}, - {"mapwfm", 0, NULL, -1}, - {"mapwgm", 0, NULL, -1}, - {"mapwhm", 0, NULL, -1}, - {"mapwim", 0, NULL, -1}, - {"mapwjm", 0, NULL, -1}, - {"mapwkm", 0, NULL, -1}, - {"mapwlm", 0, NULL, -1}, - {"mapwmm", 0, NULL, -1}, - {"mapwnm", 0, NULL, -1}, - {"mapwom", 0, NULL, -1}, - {"mapwpm", 0, NULL, -1}, - {"mapwqm", 0, NULL, -1}, - {"mapwrm", 0, NULL, -1}, - {"mapwsm", 0, NULL, -1}, - {"mapwtm", 0, NULL, -1}, - {"mapwum", 0, NULL, -1}, - {"mapwvm", 0, NULL, -1}, - {"mapwwm", 0, NULL, -1}, - {"mapwxm", 0, NULL, -1}, - {"mapwym", 0, NULL, -1}, - {"mapwzm", 0, NULL, -1}, - {"mapx0m", 0, NULL, -1}, - {"mapx1m", 0, NULL, -1}, - {"mapx2m", 0, NULL, -1}, - {"mapx3m", 0, NULL, -1}, - {"mapx4m", 0, NULL, -1}, - {"mapx5m", 0, NULL, -1}, - {"mapx6m", 0, NULL, -1}, - {"mapx7m", 0, NULL, -1}, - {"mapx8m", 0, NULL, -1}, - {"mapx9m", 0, NULL, -1}, - {"mapxam", 0, NULL, -1}, - {"mapxbm", 0, NULL, -1}, - {"mapxcm", 0, NULL, -1}, - {"mapxdm", 0, NULL, -1}, - {"mapxem", 0, NULL, -1}, - {"mapxfm", 0, NULL, -1}, - {"mapxgm", 0, NULL, -1}, - {"mapxhm", 0, NULL, -1}, - {"mapxim", 0, NULL, -1}, - {"mapxjm", 0, NULL, -1}, - {"mapxkm", 0, NULL, -1}, - {"mapxlm", 0, NULL, -1}, - {"mapxmm", 0, NULL, -1}, - {"mapxnm", 0, NULL, -1}, - {"mapxom", 0, NULL, -1}, - {"mapxpm", 0, NULL, -1}, - {"mapxqm", 0, NULL, -1}, - {"mapxrm", 0, NULL, -1}, - {"mapxsm", 0, NULL, -1}, - {"mapxtm", 0, NULL, -1}, - {"mapxum", 0, NULL, -1}, - {"mapxvm", 0, NULL, -1}, - {"mapxwm", 0, NULL, -1}, - {"mapxxm", 0, NULL, -1}, - {"mapxym", 0, NULL, -1}, - {"mapxzm", 0, NULL, -1}, - {"mapy0m", 0, NULL, -1}, - {"mapy1m", 0, NULL, -1}, - {"mapy2m", 0, NULL, -1}, - {"mapy3m", 0, NULL, -1}, - {"mapy4m", 0, NULL, -1}, - {"mapy5m", 0, NULL, -1}, - {"mapy6m", 0, NULL, -1}, - {"mapy7m", 0, NULL, -1}, - {"mapy8m", 0, NULL, -1}, - {"mapy9m", 0, NULL, -1}, - {"mapyam", 0, NULL, -1}, - {"mapybm", 0, NULL, -1}, - {"mapycm", 0, NULL, -1}, - {"mapydm", 0, NULL, -1}, - {"mapyem", 0, NULL, -1}, - {"mapyfm", 0, NULL, -1}, - {"mapygm", 0, NULL, -1}, - {"mapyhm", 0, NULL, -1}, - {"mapyim", 0, NULL, -1}, - {"mapyjm", 0, NULL, -1}, - {"mapykm", 0, NULL, -1}, - {"mapylm", 0, NULL, -1}, - {"mapymm", 0, NULL, -1}, - {"mapynm", 0, NULL, -1}, - {"mapyom", 0, NULL, -1}, - {"mapypm", 0, NULL, -1}, - {"mapyqm", 0, NULL, -1}, - {"mapyrm", 0, NULL, -1}, - {"mapysm", 0, NULL, -1}, - {"mapytm", 0, NULL, -1}, - {"mapyum", 0, NULL, -1}, - {"mapyvm", 0, NULL, -1}, - {"mapywm", 0, NULL, -1}, - {"mapyxm", 0, NULL, -1}, - {"mapyym", 0, NULL, -1}, - {"mapyzm", 0, NULL, -1}, - {"mapz0m", 0, NULL, -1}, - {"mapz1m", 0, NULL, -1}, - {"mapz2m", 0, NULL, -1}, - {"mapz3m", 0, NULL, -1}, - {"mapz4m", 0, NULL, -1}, - {"mapz5m", 0, NULL, -1}, - {"mapz6m", 0, NULL, -1}, - {"mapz7m", 0, NULL, -1}, - {"mapz8m", 0, NULL, -1}, - {"mapz9m", 0, NULL, -1}, - {"mapzam", 0, NULL, -1}, - {"mapzbm", 0, NULL, -1}, - {"mapzcm", 0, NULL, -1}, - {"mapzdm", 0, NULL, -1}, - {"mapzem", 0, NULL, -1}, - {"mapzfm", 0, NULL, -1}, - {"mapzgm", 0, NULL, -1}, - {"mapzhm", 0, NULL, -1}, - {"mapzim", 0, NULL, -1}, - {"mapzjm", 0, NULL, -1}, - {"mapzkm", 0, NULL, -1}, - {"mapzlm", 0, NULL, -1}, - {"mapzmm", 0, NULL, -1}, - {"mapznm", 0, NULL, -1}, - {"mapzom", 0, NULL, -1}, - {"mapzpm", 0, NULL, -1}, - {"mapzqm", 0, NULL, -1}, - {"mapzrm", 0, NULL, -1}, - {"mapzsm", 0, NULL, -1}, - {"mapztm", 0, NULL, -1}, - {"mapzum", 0, NULL, -1}, - {"mapzvm", 0, NULL, -1}, - {"mapzwm", 0, NULL, -1}, - {"mapzxm", 0, NULL, -1}, - {"mapzym", 0, NULL, -1}, - {"mapzzm", 0, NULL, -1}, - - {"titles", 0, NULL, -1}, // Title screen - {"read_m", 0, NULL, -1}, // Intro - {"lclear", 0, NULL, -1}, // Level clear - {"invinc", 0, NULL, -1}, // Invincibility - {"shoes", 0, NULL, -1}, // Super sneakers - {"minvnc", 0, NULL, -1}, // Mario invincibility - {"drown", 0, NULL, -1}, // Drowning - {"gmover", 0, NULL, -1}, // Game over - {"xtlife", 0, NULL, -1}, // Extra life - {"contsc", 0, NULL, -1}, // Continue screen - {"supers", 0, NULL, -1}, // Super Sonic - {"chrsel", 0, NULL, -1}, // Character select - {"credit", 0, NULL, -1}, // Credits - {"racent", 0, NULL, -1}, // Race Results - {"stjr", 0, NULL, -1}, // Sonic Team Jr. Presents -}; - - // // Information about all the sfx // diff --git a/src/sounds.h b/src/sounds.h index c5851a346..4388d02cf 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -86,1095 +86,9 @@ struct sfxinfo_struct lumpnum_t lumpnum; }; -// -// MusicInfo struct. -// -typedef struct -{ - // up to 6-character name - const char *name; - - // lump number of music - lumpnum_t lumpnum; - - // music data - void *data; - - // music handle once registered - INT32 handle; -} musicinfo_t; - // the complete set of sound effects extern sfxinfo_t S_sfx[]; -// the complete set of music -extern musicinfo_t S_music[]; - -// -// Identifiers for all music in game. -// - -// Music list (don't edit this comment!) -typedef enum -{ - mus_None, - mus_map01m, - mus_map02m, - mus_map03m, - mus_map04m, - mus_map05m, - mus_map06m, - mus_map07m, - mus_map08m, - mus_map09m, - mus_map10m, - mus_map11m, - mus_map12m, - mus_map13m, - mus_map14m, - mus_map15m, - mus_map16m, - mus_map17m, - mus_map18m, - mus_map19m, - mus_map20m, - mus_map21m, - mus_map22m, - mus_map23m, - mus_map24m, - mus_map25m, - mus_map26m, - mus_map27m, - mus_map28m, - mus_map29m, - mus_map30m, - mus_map31m, - mus_map32m, - mus_map33m, - mus_map34m, - mus_map35m, - mus_map36m, - mus_map37m, - mus_map38m, - mus_map39m, - mus_map40m, - mus_map41m, - mus_map42m, - mus_map43m, - mus_map44m, - mus_map45m, - mus_map46m, - mus_map47m, - mus_map48m, - mus_map49m, - mus_map50m, - mus_map51m, - mus_map52m, - mus_map53m, - mus_map54m, - mus_map55m, - mus_map56m, - mus_map57m, - mus_map58m, - mus_map59m, - mus_map60m, - mus_map61m, - mus_map62m, - mus_map63m, - mus_map64m, - mus_map65m, - mus_map66m, - mus_map67m, - mus_map68m, - mus_map69m, - mus_map70m, - mus_map71m, - mus_map72m, - mus_map73m, - mus_map74m, - mus_map75m, - mus_map76m, - mus_map77m, - mus_map78m, - mus_map79m, - mus_map80m, - mus_map81m, - mus_map82m, - mus_map83m, - mus_map84m, - mus_map85m, - mus_map86m, - mus_map87m, - mus_map88m, - mus_map89m, - mus_map90m, - mus_map91m, - mus_map92m, - mus_map93m, - mus_map94m, - mus_map95m, - mus_map96m, - mus_map97m, - mus_map98m, - mus_map99m, - mus_mapa0m, - mus_mapa1m, - mus_mapa2m, - mus_mapa3m, - mus_mapa4m, - mus_mapa5m, - mus_mapa6m, - mus_mapa7m, - mus_mapa8m, - mus_mapa9m, - mus_mapaam, - mus_mapabm, - mus_mapacm, - mus_mapadm, - mus_mapaem, - mus_mapafm, - mus_mapagm, - mus_mapahm, - mus_mapaim, - mus_mapajm, - mus_mapakm, - mus_mapalm, - mus_mapamm, - mus_mapanm, - mus_mapaom, - mus_mapapm, - mus_mapaqm, - mus_maparm, - mus_mapasm, - mus_mapatm, - mus_mapaum, - mus_mapavm, - mus_mapawm, - mus_mapaxm, - mus_mapaym, - mus_mapazm, - mus_mapb0m, - mus_mapb1m, - mus_mapb2m, - mus_mapb3m, - mus_mapb4m, - mus_mapb5m, - mus_mapb6m, - mus_mapb7m, - mus_mapb8m, - mus_mapb9m, - mus_mapbam, - mus_mapbbm, - mus_mapbcm, - mus_mapbdm, - mus_mapbem, - mus_mapbfm, - mus_mapbgm, - mus_mapbhm, - mus_mapbim, - mus_mapbjm, - mus_mapbkm, - mus_mapblm, - mus_mapbmm, - mus_mapbnm, - mus_mapbom, - mus_mapbpm, - mus_mapbqm, - mus_mapbrm, - mus_mapbsm, - mus_mapbtm, - mus_mapbum, - mus_mapbvm, - mus_mapbwm, - mus_mapbxm, - mus_mapbym, - mus_mapbzm, - mus_mapc0m, - mus_mapc1m, - mus_mapc2m, - mus_mapc3m, - mus_mapc4m, - mus_mapc5m, - mus_mapc6m, - mus_mapc7m, - mus_mapc8m, - mus_mapc9m, - mus_mapcam, - mus_mapcbm, - mus_mapccm, - mus_mapcdm, - mus_mapcem, - mus_mapcfm, - mus_mapcgm, - mus_mapchm, - mus_mapcim, - mus_mapcjm, - mus_mapckm, - mus_mapclm, - mus_mapcmm, - mus_mapcnm, - mus_mapcom, - mus_mapcpm, - mus_mapcqm, - mus_mapcrm, - mus_mapcsm, - mus_mapctm, - mus_mapcum, - mus_mapcvm, - mus_mapcwm, - mus_mapcxm, - mus_mapcym, - mus_mapczm, - mus_mapd0m, - mus_mapd1m, - mus_mapd2m, - mus_mapd3m, - mus_mapd4m, - mus_mapd5m, - mus_mapd6m, - mus_mapd7m, - mus_mapd8m, - mus_mapd9m, - mus_mapdam, - mus_mapdbm, - mus_mapdcm, - mus_mapddm, - mus_mapdem, - mus_mapdfm, - mus_mapdgm, - mus_mapdhm, - mus_mapdim, - mus_mapdjm, - mus_mapdkm, - mus_mapdlm, - mus_mapdmm, - mus_mapdnm, - mus_mapdom, - mus_mapdpm, - mus_mapdqm, - mus_mapdrm, - mus_mapdsm, - mus_mapdtm, - mus_mapdum, - mus_mapdvm, - mus_mapdwm, - mus_mapdxm, - mus_mapdym, - mus_mapdzm, - mus_mape0m, - mus_mape1m, - mus_mape2m, - mus_mape3m, - mus_mape4m, - mus_mape5m, - mus_mape6m, - mus_mape7m, - mus_mape8m, - mus_mape9m, - mus_mapeam, - mus_mapebm, - mus_mapecm, - mus_mapedm, - mus_mapeem, - mus_mapefm, - mus_mapegm, - mus_mapehm, - mus_mapeim, - mus_mapejm, - mus_mapekm, - mus_mapelm, - mus_mapemm, - mus_mapenm, - mus_mapeom, - mus_mapepm, - mus_mapeqm, - mus_maperm, - mus_mapesm, - mus_mapetm, - mus_mapeum, - mus_mapevm, - mus_mapewm, - mus_mapexm, - mus_mapeym, - mus_mapezm, - mus_mapf0m, - mus_mapf1m, - mus_mapf2m, - mus_mapf3m, - mus_mapf4m, - mus_mapf5m, - mus_mapf6m, - mus_mapf7m, - mus_mapf8m, - mus_mapf9m, - mus_mapfam, - mus_mapfbm, - mus_mapfcm, - mus_mapfdm, - mus_mapfem, - mus_mapffm, - mus_mapfgm, - mus_mapfhm, - mus_mapfim, - mus_mapfjm, - mus_mapfkm, - mus_mapflm, - mus_mapfmm, - mus_mapfnm, - mus_mapfom, - mus_mapfpm, - mus_mapfqm, - mus_mapfrm, - mus_mapfsm, - mus_mapftm, - mus_mapfum, - mus_mapfvm, - mus_mapfwm, - mus_mapfxm, - mus_mapfym, - mus_mapfzm, - mus_mapg0m, - mus_mapg1m, - mus_mapg2m, - mus_mapg3m, - mus_mapg4m, - mus_mapg5m, - mus_mapg6m, - mus_mapg7m, - mus_mapg8m, - mus_mapg9m, - mus_mapgam, - mus_mapgbm, - mus_mapgcm, - mus_mapgdm, - mus_mapgem, - mus_mapgfm, - mus_mapggm, - mus_mapghm, - mus_mapgim, - mus_mapgjm, - mus_mapgkm, - mus_mapglm, - mus_mapgmm, - mus_mapgnm, - mus_mapgom, - mus_mapgpm, - mus_mapgqm, - mus_mapgrm, - mus_mapgsm, - mus_mapgtm, - mus_mapgum, - mus_mapgvm, - mus_mapgwm, - mus_mapgxm, - mus_mapgym, - mus_mapgzm, - mus_maph0m, - mus_maph1m, - mus_maph2m, - mus_maph3m, - mus_maph4m, - mus_maph5m, - mus_maph6m, - mus_maph7m, - mus_maph8m, - mus_maph9m, - mus_mapham, - mus_maphbm, - mus_maphcm, - mus_maphdm, - mus_maphem, - mus_maphfm, - mus_maphgm, - mus_maphhm, - mus_maphim, - mus_maphjm, - mus_maphkm, - mus_maphlm, - mus_maphmm, - mus_maphnm, - mus_maphom, - mus_maphpm, - mus_maphqm, - mus_maphrm, - mus_maphsm, - mus_maphtm, - mus_maphum, - mus_maphvm, - mus_maphwm, - mus_maphxm, - mus_maphym, - mus_maphzm, - mus_mapi0m, - mus_mapi1m, - mus_mapi2m, - mus_mapi3m, - mus_mapi4m, - mus_mapi5m, - mus_mapi6m, - mus_mapi7m, - mus_mapi8m, - mus_mapi9m, - mus_mapiam, - mus_mapibm, - mus_mapicm, - mus_mapidm, - mus_mapiem, - mus_mapifm, - mus_mapigm, - mus_mapihm, - mus_mapiim, - mus_mapijm, - mus_mapikm, - mus_mapilm, - mus_mapimm, - mus_mapinm, - mus_mapiom, - mus_mapipm, - mus_mapiqm, - mus_mapirm, - mus_mapism, - mus_mapitm, - mus_mapium, - mus_mapivm, - mus_mapiwm, - mus_mapixm, - mus_mapiym, - mus_mapizm, - mus_mapj0m, - mus_mapj1m, - mus_mapj2m, - mus_mapj3m, - mus_mapj4m, - mus_mapj5m, - mus_mapj6m, - mus_mapj7m, - mus_mapj8m, - mus_mapj9m, - mus_mapjam, - mus_mapjbm, - mus_mapjcm, - mus_mapjdm, - mus_mapjem, - mus_mapjfm, - mus_mapjgm, - mus_mapjhm, - mus_mapjim, - mus_mapjjm, - mus_mapjkm, - mus_mapjlm, - mus_mapjmm, - mus_mapjnm, - mus_mapjom, - mus_mapjpm, - mus_mapjqm, - mus_mapjrm, - mus_mapjsm, - mus_mapjtm, - mus_mapjum, - mus_mapjvm, - mus_mapjwm, - mus_mapjxm, - mus_mapjym, - mus_mapjzm, - mus_mapk0m, - mus_mapk1m, - mus_mapk2m, - mus_mapk3m, - mus_mapk4m, - mus_mapk5m, - mus_mapk6m, - mus_mapk7m, - mus_mapk8m, - mus_mapk9m, - mus_mapkam, - mus_mapkbm, - mus_mapkcm, - mus_mapkdm, - mus_mapkem, - mus_mapkfm, - mus_mapkgm, - mus_mapkhm, - mus_mapkim, - mus_mapkjm, - mus_mapkkm, - mus_mapklm, - mus_mapkmm, - mus_mapknm, - mus_mapkom, - mus_mapkpm, - mus_mapkqm, - mus_mapkrm, - mus_mapksm, - mus_mapktm, - mus_mapkum, - mus_mapkvm, - mus_mapkwm, - mus_mapkxm, - mus_mapkym, - mus_mapkzm, - mus_mapl0m, - mus_mapl1m, - mus_mapl2m, - mus_mapl3m, - mus_mapl4m, - mus_mapl5m, - mus_mapl6m, - mus_mapl7m, - mus_mapl8m, - mus_mapl9m, - mus_maplam, - mus_maplbm, - mus_maplcm, - mus_mapldm, - mus_maplem, - mus_maplfm, - mus_maplgm, - mus_maplhm, - mus_maplim, - mus_mapljm, - mus_maplkm, - mus_mapllm, - mus_maplmm, - mus_maplnm, - mus_maplom, - mus_maplpm, - mus_maplqm, - mus_maplrm, - mus_maplsm, - mus_mapltm, - mus_maplum, - mus_maplvm, - mus_maplwm, - mus_maplxm, - mus_maplym, - mus_maplzm, - mus_mapm0m, - mus_mapm1m, - mus_mapm2m, - mus_mapm3m, - mus_mapm4m, - mus_mapm5m, - mus_mapm6m, - mus_mapm7m, - mus_mapm8m, - mus_mapm9m, - mus_mapmam, - mus_mapmbm, - mus_mapmcm, - mus_mapmdm, - mus_mapmem, - mus_mapmfm, - mus_mapmgm, - mus_mapmhm, - mus_mapmim, - mus_mapmjm, - mus_mapmkm, - mus_mapmlm, - mus_mapmmm, - mus_mapmnm, - mus_mapmom, - mus_mapmpm, - mus_mapmqm, - mus_mapmrm, - mus_mapmsm, - mus_mapmtm, - mus_mapmum, - mus_mapmvm, - mus_mapmwm, - mus_mapmxm, - mus_mapmym, - mus_mapmzm, - mus_mapn0m, - mus_mapn1m, - mus_mapn2m, - mus_mapn3m, - mus_mapn4m, - mus_mapn5m, - mus_mapn6m, - mus_mapn7m, - mus_mapn8m, - mus_mapn9m, - mus_mapnam, - mus_mapnbm, - mus_mapncm, - mus_mapndm, - mus_mapnem, - mus_mapnfm, - mus_mapngm, - mus_mapnhm, - mus_mapnim, - mus_mapnjm, - mus_mapnkm, - mus_mapnlm, - mus_mapnmm, - mus_mapnnm, - mus_mapnom, - mus_mapnpm, - mus_mapnqm, - mus_mapnrm, - mus_mapnsm, - mus_mapntm, - mus_mapnum, - mus_mapnvm, - mus_mapnwm, - mus_mapnxm, - mus_mapnym, - mus_mapnzm, - mus_mapo0m, - mus_mapo1m, - mus_mapo2m, - mus_mapo3m, - mus_mapo4m, - mus_mapo5m, - mus_mapo6m, - mus_mapo7m, - mus_mapo8m, - mus_mapo9m, - mus_mapoam, - mus_mapobm, - mus_mapocm, - mus_mapodm, - mus_mapoem, - mus_mapofm, - mus_mapogm, - mus_mapohm, - mus_mapoim, - mus_mapojm, - mus_mapokm, - mus_mapolm, - mus_mapomm, - mus_maponm, - mus_mapoom, - mus_mapopm, - mus_mapoqm, - mus_maporm, - mus_maposm, - mus_mapotm, - mus_mapoum, - mus_mapovm, - mus_mapowm, - mus_mapoxm, - mus_mapoym, - mus_mapozm, - mus_mapp0m, - mus_mapp1m, - mus_mapp2m, - mus_mapp3m, - mus_mapp4m, - mus_mapp5m, - mus_mapp6m, - mus_mapp7m, - mus_mapp8m, - mus_mapp9m, - mus_mappam, - mus_mappbm, - mus_mappcm, - mus_mappdm, - mus_mappem, - mus_mappfm, - mus_mappgm, - mus_mapphm, - mus_mappim, - mus_mappjm, - mus_mappkm, - mus_mapplm, - mus_mappmm, - mus_mappnm, - mus_mappom, - mus_mapppm, - mus_mappqm, - mus_mapprm, - mus_mappsm, - mus_mapptm, - mus_mappum, - mus_mappvm, - mus_mappwm, - mus_mappxm, - mus_mappym, - mus_mappzm, - mus_mapq0m, - mus_mapq1m, - mus_mapq2m, - mus_mapq3m, - mus_mapq4m, - mus_mapq5m, - mus_mapq6m, - mus_mapq7m, - mus_mapq8m, - mus_mapq9m, - mus_mapqam, - mus_mapqbm, - mus_mapqcm, - mus_mapqdm, - mus_mapqem, - mus_mapqfm, - mus_mapqgm, - mus_mapqhm, - mus_mapqim, - mus_mapqjm, - mus_mapqkm, - mus_mapqlm, - mus_mapqmm, - mus_mapqnm, - mus_mapqom, - mus_mapqpm, - mus_mapqqm, - mus_mapqrm, - mus_mapqsm, - mus_mapqtm, - mus_mapqum, - mus_mapqvm, - mus_mapqwm, - mus_mapqxm, - mus_mapqym, - mus_mapqzm, - mus_mapr0m, - mus_mapr1m, - mus_mapr2m, - mus_mapr3m, - mus_mapr4m, - mus_mapr5m, - mus_mapr6m, - mus_mapr7m, - mus_mapr8m, - mus_mapr9m, - mus_mapram, - mus_maprbm, - mus_maprcm, - mus_maprdm, - mus_maprem, - mus_maprfm, - mus_maprgm, - mus_maprhm, - mus_maprim, - mus_maprjm, - mus_maprkm, - mus_maprlm, - mus_maprmm, - mus_maprnm, - mus_maprom, - mus_maprpm, - mus_maprqm, - mus_maprrm, - mus_maprsm, - mus_maprtm, - mus_maprum, - mus_maprvm, - mus_maprwm, - mus_maprxm, - mus_maprym, - mus_maprzm, - mus_maps0m, - mus_maps1m, - mus_maps2m, - mus_maps3m, - mus_maps4m, - mus_maps5m, - mus_maps6m, - mus_maps7m, - mus_maps8m, - mus_maps9m, - mus_mapsam, - mus_mapsbm, - mus_mapscm, - mus_mapsdm, - mus_mapsem, - mus_mapsfm, - mus_mapsgm, - mus_mapshm, - mus_mapsim, - mus_mapsjm, - mus_mapskm, - mus_mapslm, - mus_mapsmm, - mus_mapsnm, - mus_mapsom, - mus_mapspm, - mus_mapsqm, - mus_mapsrm, - mus_mapssm, - mus_mapstm, - mus_mapsum, - mus_mapsvm, - mus_mapswm, - mus_mapsxm, - mus_mapsym, - mus_mapszm, - mus_mapt0m, - mus_mapt1m, - mus_mapt2m, - mus_mapt3m, - mus_mapt4m, - mus_mapt5m, - mus_mapt6m, - mus_mapt7m, - mus_mapt8m, - mus_mapt9m, - mus_maptam, - mus_maptbm, - mus_maptcm, - mus_maptdm, - mus_maptem, - mus_maptfm, - mus_maptgm, - mus_mapthm, - mus_maptim, - mus_maptjm, - mus_maptkm, - mus_maptlm, - mus_maptmm, - mus_maptnm, - mus_maptom, - mus_maptpm, - mus_maptqm, - mus_maptrm, - mus_maptsm, - mus_mapttm, - mus_maptum, - mus_maptvm, - mus_maptwm, - mus_maptxm, - mus_maptym, - mus_maptzm, - mus_mapu0m, - mus_mapu1m, - mus_mapu2m, - mus_mapu3m, - mus_mapu4m, - mus_mapu5m, - mus_mapu6m, - mus_mapu7m, - mus_mapu8m, - mus_mapu9m, - mus_mapuam, - mus_mapubm, - mus_mapucm, - mus_mapudm, - mus_mapuem, - mus_mapufm, - mus_mapugm, - mus_mapuhm, - mus_mapuim, - mus_mapujm, - mus_mapukm, - mus_mapulm, - mus_mapumm, - mus_mapunm, - mus_mapuom, - mus_mapupm, - mus_mapuqm, - mus_mapurm, - mus_mapusm, - mus_maputm, - mus_mapuum, - mus_mapuvm, - mus_mapuwm, - mus_mapuxm, - mus_mapuym, - mus_mapuzm, - mus_mapv0m, - mus_mapv1m, - mus_mapv2m, - mus_mapv3m, - mus_mapv4m, - mus_mapv5m, - mus_mapv6m, - mus_mapv7m, - mus_mapv8m, - mus_mapv9m, - mus_mapvam, - mus_mapvbm, - mus_mapvcm, - mus_mapvdm, - mus_mapvem, - mus_mapvfm, - mus_mapvgm, - mus_mapvhm, - mus_mapvim, - mus_mapvjm, - mus_mapvkm, - mus_mapvlm, - mus_mapvmm, - mus_mapvnm, - mus_mapvom, - mus_mapvpm, - mus_mapvqm, - mus_mapvrm, - mus_mapvsm, - mus_mapvtm, - mus_mapvum, - mus_mapvvm, - mus_mapvwm, - mus_mapvxm, - mus_mapvym, - mus_mapvzm, - mus_mapw0m, - mus_mapw1m, - mus_mapw2m, - mus_mapw3m, - mus_mapw4m, - mus_mapw5m, - mus_mapw6m, - mus_mapw7m, - mus_mapw8m, - mus_mapw9m, - mus_mapwam, - mus_mapwbm, - mus_mapwcm, - mus_mapwdm, - mus_mapwem, - mus_mapwfm, - mus_mapwgm, - mus_mapwhm, - mus_mapwim, - mus_mapwjm, - mus_mapwkm, - mus_mapwlm, - mus_mapwmm, - mus_mapwnm, - mus_mapwom, - mus_mapwpm, - mus_mapwqm, - mus_mapwrm, - mus_mapwsm, - mus_mapwtm, - mus_mapwum, - mus_mapwvm, - mus_mapwwm, - mus_mapwxm, - mus_mapwym, - mus_mapwzm, - mus_mapx0m, - mus_mapx1m, - mus_mapx2m, - mus_mapx3m, - mus_mapx4m, - mus_mapx5m, - mus_mapx6m, - mus_mapx7m, - mus_mapx8m, - mus_mapx9m, - mus_mapxam, - mus_mapxbm, - mus_mapxcm, - mus_mapxdm, - mus_mapxem, - mus_mapxfm, - mus_mapxgm, - mus_mapxhm, - mus_mapxim, - mus_mapxjm, - mus_mapxkm, - mus_mapxlm, - mus_mapxmm, - mus_mapxnm, - mus_mapxom, - mus_mapxpm, - mus_mapxqm, - mus_mapxrm, - mus_mapxsm, - mus_mapxtm, - mus_mapxum, - mus_mapxvm, - mus_mapxwm, - mus_mapxxm, - mus_mapxym, - mus_mapxzm, - mus_mapy0m, - mus_mapy1m, - mus_mapy2m, - mus_mapy3m, - mus_mapy4m, - mus_mapy5m, - mus_mapy6m, - mus_mapy7m, - mus_mapy8m, - mus_mapy9m, - mus_mapyam, - mus_mapybm, - mus_mapycm, - mus_mapydm, - mus_mapyem, - mus_mapyfm, - mus_mapygm, - mus_mapyhm, - mus_mapyim, - mus_mapyjm, - mus_mapykm, - mus_mapylm, - mus_mapymm, - mus_mapynm, - mus_mapyom, - mus_mapypm, - mus_mapyqm, - mus_mapyrm, - mus_mapysm, - mus_mapytm, - mus_mapyum, - mus_mapyvm, - mus_mapywm, - mus_mapyxm, - mus_mapyym, - mus_mapyzm, - mus_mapz0m, - mus_mapz1m, - mus_mapz2m, - mus_mapz3m, - mus_mapz4m, - mus_mapz5m, - mus_mapz6m, - mus_mapz7m, - mus_mapz8m, - mus_mapz9m, - mus_mapzam, - mus_mapzbm, - mus_mapzcm, - mus_mapzdm, - mus_mapzem, - mus_mapzfm, - mus_mapzgm, - mus_mapzhm, - mus_mapzim, - mus_mapzjm, - mus_mapzkm, - mus_mapzlm, - mus_mapzmm, - mus_mapznm, - mus_mapzom, - mus_mapzpm, - mus_mapzqm, - mus_mapzrm, - mus_mapzsm, - mus_mapztm, - mus_mapzum, - mus_mapzvm, - mus_mapzwm, - mus_mapzxm, - mus_mapzym, - mus_mapzzm, - - mus_titles, // title screen - mus_read_m, // intro - mus_lclear, // level clear - mus_invinc, // invincibility - mus_shoes, // super sneakers - mus_minvnc, // Mario invincibility - mus_drown, // drowning - mus_gmover, // game over - mus_xtlife, // extra life - mus_contsc, // continue screen - mus_supers, // Super Sonic - mus_chrsel, // character select - mus_credit, // credits - mus_racent, // Race Results - mus_stjr, // Sonic Team Jr. Presents - - NUMMUSIC -} musicenum_t; -// Note: song number should be a UINT16, as mapmusic only uses 16 bits for music slot number. -// (the rest is track number and an internal reload flag) - // // Identifiers for all sfx in game. // diff --git a/src/y_inter.c b/src/y_inter.c index 2f2edf7ca..104c1004d 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -632,7 +632,7 @@ void Y_Ticker(void) boolean anybonuses = false; if (!intertic) // first time only - S_ChangeMusic(mus_lclear, false); // don't loop it + S_ChangeMusicInternal("lclear", false); // don't loop it if (intertic < TICRATE) // one second pause before tally begins return; @@ -693,7 +693,7 @@ void Y_Ticker(void) if (!intertic) // first time only { - S_ChangeMusic(mus_lclear, false); // don't loop it + S_ChangeMusicInternal("lclear", false); // don't loop it tallydonetic = 0; } @@ -754,7 +754,7 @@ void Y_Ticker(void) else if (intertype == int_match || intertype == int_ctf || intertype == int_teammatch) // match { if (!intertic) // first time only - S_ChangeMusic(mus_racent, true); // loop it + S_ChangeMusicInternal("racent", true); // loop it // If a player has left or joined, recalculate scores. if (data.match.numplayers != D_NumPlayers()) @@ -763,7 +763,7 @@ void Y_Ticker(void) else if (intertype == int_race || intertype == int_classicrace) // race { if (!intertic) // first time only - S_ChangeMusic(mus_racent, true); // loop it + S_ChangeMusicInternal("racent", true); // loop it // Don't bother recalcing for race. It doesn't make as much sense. } From 1e4c2f8aad3d2d48eb408f400fde8e259b40fe18 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 7 Jan 2016 20:41:58 -0800 Subject: [PATCH 027/808] Fixed LD413 --- src/p_setup.c | 12 ++++++++++-- src/p_spec.c | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index 3a51d90b3..000a3a65c 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -1451,8 +1451,16 @@ static void P_LoadSideDefs2(lumpnum_t lumpnum) sd->bottomtexture = get_number(process)-1; } M_Memcpy(process,msd->toptexture,8); - sd->text = Z_Malloc(strlen(process)+1, PU_LEVEL, NULL); - M_Memcpy(sd->text, process, strlen(process)+1); + process[8] = '\0'; + sd->text = Z_Malloc(7, PU_LEVEL, NULL); + + // If they type in O_ or D_ and their music name, just shrug, + // then copy the rest instead. + if ((process[0] == 'O' || process[0] == 'D') && process[7]) + M_Memcpy(sd->text, process+2, 6); + else // Assume it's a proper music name. + M_Memcpy(sd->text, process, 6); + sd->text[6] = 0; break; } case 414: // Play SFX diff --git a/src/p_spec.c b/src/p_spec.c index beeb2e5a7..d59f76780 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2392,7 +2392,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) { UINT16 tracknum = (UINT16)sides[line->sidenum[0]].bottomtexture; - strncpy(mapmusname, line->text, 7); + strncpy(mapmusname, sides[line->sidenum[0]].text, 7); mapmusname[6] = 0; mapmusflags = tracknum & MUSIC_TRACKMASK; From e1f9a012297d5220dcdd9395265467621a170e32 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 7 Jan 2016 23:48:19 -0800 Subject: [PATCH 028/808] Fix crash on game clear (No, game, you can't allocate a map header for the credits, why were you doing that before and how did it not break anything??) --- src/g_game.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index 76d6035f5..f6d7adee3 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2877,7 +2877,8 @@ static void G_DoCompleted(void) // We are committed to this map now. // We may as well allocate its header if it doesn't exist - if(!mapheaderinfo[nextmap]) + // (That is, if it's a real map) + if (nextmap < NUMMAPS && !mapheaderinfo[nextmap]) P_AllocMapHeader(nextmap); if (skipstats) From a4d05350f711db76676e9b48c36d88bd7dbec274 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Fri, 8 Jan 2016 03:23:05 -0800 Subject: [PATCH 029/808] Fixed some oddities with TUNES. --- src/d_netcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 85b7ece67..0836170fc 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3784,7 +3784,7 @@ static void Command_Tunes_f(void) tunearg = mapheaderinfo[gamemap-1]->musname; track = mapheaderinfo[gamemap-1]->mustrack; } - else if (tunearg[3] == 0 && toupper(tunearg[0]) >= 'A' && toupper(tunearg[0]) <= 'Z') + else if (!tunearg[2] && toupper(tunearg[0]) >= 'A' && toupper(tunearg[0]) <= 'Z') tunenum = (UINT16)M_MapNumber(tunearg[0], tunearg[1]); if (tunenum && tunenum >= 1036) From 577afbc6937586b6cd73c3ca857124434facd66d Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 4 Feb 2016 01:17:27 -0800 Subject: [PATCH 030/808] All internal music changes use new lump names ... that all start with _ for reasons specified in the music topic --- src/f_finale.c | 10 +++++----- src/m_menu.c | 16 ++++++++-------- src/p_enemy.c | 4 ++-- src/p_inter.c | 4 ++-- src/p_user.c | 16 ++++++++-------- src/y_inter.c | 8 ++++---- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index efe39f294..864e55265 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -559,7 +559,7 @@ static void F_IntroDrawScene(void) if (finalecount < 4) S_StopMusic(); if (finalecount == 4) - S_ChangeMusicInternal("stjr", false); + S_ChangeMusicInternal("_stjr", false); x = (BASEVIDWIDTH<lastOn; G_SetGamestate(GS_TIMEATTACK); modeattacking = ATTACKING_NONE; - S_ChangeMusicInternal("racent", true); + S_ChangeMusicInternal("_inter", true); // Update replay availability. CV_AddValue(&cv_nextmap, 1); CV_AddValue(&cv_nextmap, -1); @@ -6938,7 +6938,7 @@ static void M_ToggleDigital(void) if (nodigimusic) return; S_Init(cv_soundvolume.value, cv_digmusicvolume.value, cv_midimusicvolume.value); S_StopMusic(); - S_ChangeMusicInternal("lclear", false); + S_ChangeMusicInternal("_clear", false); M_StartMessage(M_GetText("Digital Music Enabled\n"), NULL, MM_NOTHING); } else @@ -6965,7 +6965,7 @@ static void M_ToggleMIDI(void) I_InitMIDIMusic(); if (nomidimusic) return; S_Init(cv_soundvolume.value, cv_digmusicvolume.value, cv_midimusicvolume.value); - S_ChangeMusicInternal("lclear", false); + S_ChangeMusicInternal("_clear", false); M_StartMessage(M_GetText("MIDI Music Enabled\n"), NULL, MM_NOTHING); } else diff --git a/src/p_enemy.c b/src/p_enemy.c index 177acf862..cd5069435 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3064,7 +3064,7 @@ void A_Invincibility(mobj_t *actor) S_StopMusic(); if (mariomode) G_GhostAddColor(GHC_INVINCIBLE); - S_ChangeMusicInternal((mariomode) ? "minvnc" : "invinc", false); + S_ChangeMusicInternal((mariomode) ? "_minv" : "_inv", false); } } @@ -3100,7 +3100,7 @@ void A_SuperSneakers(mobj_t *actor) else { S_StopMusic(); - S_ChangeMusicInternal("shoes", false); + S_ChangeMusicInternal("_shoes", false); } } } diff --git a/src/p_inter.c b/src/p_inter.c index 669eacbdc..c42a5eee7 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2081,7 +2081,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget if (P_IsLocalPlayer(target->player) && target->player == &players[consoleplayer]) { S_StopMusic(); // Stop the Music! Tails 03-14-2000 - S_ChangeMusicInternal("gmover", false); // Yousa dead now, Okieday? Tails 03-14-2000 + S_ChangeMusicInternal("_gover", false); // Yousa dead now, Okieday? Tails 03-14-2000 } } } @@ -2478,7 +2478,7 @@ static inline void P_NiGHTSDamage(mobj_t *target, mobj_t *source) && player->nightstime < 10*TICRATE) { //S_StartSound(NULL, sfx_timeup); // that creepy "out of time" music from NiGHTS. Dummied out, as some on the dev team thought it wasn't Sonic-y enough (Mystic, notably). Uncomment to restore. -SH - S_ChangeMusicInternal("drown",false); + S_ChangeMusicInternal("_drown",false); } } } diff --git a/src/p_user.c b/src/p_user.c index a01262e5c..c09695a6c 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -965,7 +965,7 @@ void P_DoSuperTransformation(player_t *player, boolean giverings) if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOSSMUSIC) && P_IsLocalPlayer(player)) { S_StopMusic(); - S_ChangeMusicInternal("supers", true); + S_ChangeMusicInternal("_super", true); } S_StartSound(NULL, sfx_supert); //let all players hear it -mattw_cfi @@ -1101,7 +1101,7 @@ void P_PlayLivesJingle(player_t *player) if (player) player->powers[pw_extralife] = extralifetics + 1; S_StopMusic(); // otherwise it won't restart if this is done twice in a row - S_ChangeMusicInternal("xtlife", false); + S_ChangeMusicInternal("_1up", false); } } @@ -1119,9 +1119,9 @@ void P_RestoreMusic(player_t *player) return; S_SpeedMusic(1.0f); if (player->powers[pw_super] && !(mapheaderinfo[gamemap-1]->levelflags & LF_NOSSMUSIC)) - S_ChangeMusicInternal("supers", true); + S_ChangeMusicInternal("_1up", true); else if (player->powers[pw_invulnerability] > 1) - S_ChangeMusicInternal((mariomode) ? "minvnc" : "invinc", false); + S_ChangeMusicInternal((mariomode) ? "_minv" : "_inv", false); else if (player->powers[pw_sneakers] > 1 && !player->powers[pw_super]) { if (mapheaderinfo[gamemap-1]->levelflags & LF_SPEEDMUSIC) @@ -1130,7 +1130,7 @@ void P_RestoreMusic(player_t *player) S_ChangeMusic(mapmusname, mapmusflags, true); } else - S_ChangeMusicInternal("shoes", true); + S_ChangeMusicInternal("_shoes", true); } else S_ChangeMusic(mapmusname, mapmusflags, true); @@ -2081,7 +2081,7 @@ static void P_CheckUnderwaterAndSpaceTimer(player_t *player) && player == &players[consoleplayer]) { S_StopMusic(); - S_ChangeMusicInternal("drown", false); + S_ChangeMusicInternal("_drown", false); } if (player->powers[pw_underwater] == 25*TICRATE + 1) @@ -5618,7 +5618,7 @@ static void P_NiGHTSMovement(player_t *player) } else if (P_IsLocalPlayer(player) && player->nightstime == 10*TICRATE) // S_StartSound(NULL, sfx_timeup); // that creepy "out of time" music from NiGHTS. Dummied out, as some on the dev team thought it wasn't Sonic-y enough (Mystic, notably). Uncomment to restore. -SH - S_ChangeMusicInternal("drown",false); + S_ChangeMusicInternal("_drown",false); if (player->mo->z < player->mo->floorz) @@ -8747,7 +8747,7 @@ void P_PlayerThink(player_t *player) if (countdown == 11*TICRATE - 1) { if (P_IsLocalPlayer(player)) - S_ChangeMusicInternal("drown", false); + S_ChangeMusicInternal("_drown", false); } // If you've hit the countdown and you haven't made diff --git a/src/y_inter.c b/src/y_inter.c index 104c1004d..b0b0e087b 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -632,7 +632,7 @@ void Y_Ticker(void) boolean anybonuses = false; if (!intertic) // first time only - S_ChangeMusicInternal("lclear", false); // don't loop it + S_ChangeMusicInternal("_clear", false); // don't loop it if (intertic < TICRATE) // one second pause before tally begins return; @@ -693,7 +693,7 @@ void Y_Ticker(void) if (!intertic) // first time only { - S_ChangeMusicInternal("lclear", false); // don't loop it + S_ChangeMusicInternal("_clear", false); // don't loop it tallydonetic = 0; } @@ -754,7 +754,7 @@ void Y_Ticker(void) else if (intertype == int_match || intertype == int_ctf || intertype == int_teammatch) // match { if (!intertic) // first time only - S_ChangeMusicInternal("racent", true); // loop it + S_ChangeMusicInternal("_inter", true); // loop it // If a player has left or joined, recalculate scores. if (data.match.numplayers != D_NumPlayers()) @@ -763,7 +763,7 @@ void Y_Ticker(void) else if (intertype == int_race || intertype == int_classicrace) // race { if (!intertic) // first time only - S_ChangeMusicInternal("racent", true); // loop it + S_ChangeMusicInternal("_inter", true); // loop it // Don't bother recalcing for race. It doesn't make as much sense. } From 42fb7ed5aa697a13a62be64fe609da581d07993d Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 4 Feb 2016 02:37:40 -0800 Subject: [PATCH 031/808] clearly I don't care about Super forms much :v --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index c09695a6c..96788798b 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1119,7 +1119,7 @@ void P_RestoreMusic(player_t *player) return; S_SpeedMusic(1.0f); if (player->powers[pw_super] && !(mapheaderinfo[gamemap-1]->levelflags & LF_NOSSMUSIC)) - S_ChangeMusicInternal("_1up", true); + S_ChangeMusicInternal("_super", true); else if (player->powers[pw_invulnerability] > 1) S_ChangeMusicInternal((mariomode) ? "_minv" : "_inv", false); else if (player->powers[pw_sneakers] > 1 && !player->powers[pw_super]) From 63a9c66317c263124567234897ed6240b5e34f9e Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 4 Feb 2016 17:27:55 -0800 Subject: [PATCH 032/808] Just a few more changes to TUNES, nothing special --- src/d_netcmd.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index e6a9f74a9..68245408a 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3766,11 +3766,12 @@ static void Command_Tunes_f(void) if (argc < 2) //tunes slot ... { - CONS_Printf("tunes :\n"); - CONS_Printf(M_GetText("Play a music slot at a set speed (\"1\" being normal speed).\n")); - CONS_Printf(M_GetText("If the format supports multiple songs, you can specify which one to play.\n")); - CONS_Printf(M_GetText("The current tune is: %s\nThe current track is: %d\n"), - mapmusname, (mapmusflags & MUSIC_TRACKMASK)); + CONS_Printf("tunes [track] [speed] / <-show> / <-default> / <-none>:\n"); + CONS_Printf(M_GetText("Play an arbitrary music lump. If a map number is used, 'MAP##M' is played.\n")); + CONS_Printf(M_GetText("If the format supports multiple songs, you can specify which one to play.\n\n")); + CONS_Printf(M_GetText("* With \"-show\", shows the currently playing tune and track.\n")); + CONS_Printf(M_GetText("* With \"-default\", returns to the default music for the map.\n")); + CONS_Printf(M_GetText("* With \"-none\", any music playing will be stopped.\n")); return; } @@ -3778,12 +3779,18 @@ static void Command_Tunes_f(void) tunenum = (UINT16)atoi(tunearg); track = 0; - if (!strcasecmp(tunearg, "none")) + if (!strcasecmp(tunearg, "-show")) + { + CONS_Printf(M_GetText("The current tune is: %s [track %d]\n"), + mapmusname, (mapmusflags & MUSIC_TRACKMASK)); + return; + } + if (!strcasecmp(tunearg, "-none")) { S_StopMusic(); return; } - else if (!strcasecmp(tunearg, "default")) + else if (!strcasecmp(tunearg, "-default")) { tunearg = mapheaderinfo[gamemap-1]->musname; track = mapheaderinfo[gamemap-1]->mustrack; @@ -3796,9 +3803,11 @@ static void Command_Tunes_f(void) CONS_Alert(CONS_NOTICE, M_GetText("Valid music slots are 1 to 1035.\n")); return; } + if (!tunenum && strlen(tunearg) > 6) // This is automatic -- just show the error just in case + CONS_Alert(CONS_NOTICE, M_GetText("Music name too long - truncated to six characters.\n")); - if (argc > 3) - track = (UINT16)atoi(COM_Argv(3))-1; + if (argc > 2) + track = (UINT16)atoi(COM_Argv(2))-1; if (tunenum) snprintf(mapmusname, 7, "%sM", G_BuildMapName(tunenum)); @@ -3809,9 +3818,9 @@ static void Command_Tunes_f(void) S_ChangeMusic(mapmusname, mapmusflags, true); - if (argc > 2) + if (argc > 3) { - float speed = (float)atof(COM_Argv(2)); + float speed = (float)atof(COM_Argv(3)); if (speed > 0.0f) S_SpeedMusic(speed); } From 8c23168061b76635ed87952b6d63f800995cbf7c Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 3 Mar 2016 22:12:31 -0800 Subject: [PATCH 033/808] Remove stray comment from merge --- src/dehacked.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dehacked.c b/src/dehacked.c index 298179e9f..a02c68010 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1178,7 +1178,7 @@ static void readlevelheader(MYFILE *f, INT32 num) } #ifdef MUSICSLOT_COMPATIBILITY else if (fastcmp(word, "MUSICSLOT")) - { // Backwards compatibility? + { i = get_mus(word2, true); if (i && i <= 1035) snprintf(mapheaderinfo[num-1]->musname, 7, "%sM", G_BuildMapName(i)); From 1ee01063e318db04bdb47d6d6dedd7cb5db196bc Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Wed, 9 Mar 2016 02:54:09 -0800 Subject: [PATCH 034/808] All SRB1 objects, states, and sprites removed. --- src/dehacked.c | 80 ------- src/hardware/hw_light.c | 17 -- src/info.c | 498 +--------------------------------------- src/info.h | 97 -------- src/m_cond.c | 9 +- 5 files changed, 4 insertions(+), 697 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 6747f2c59..4413968f6 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6056,70 +6056,6 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_ROCKCRUMBLEO", "S_ROCKCRUMBLEP", - "S_SRB1_CRAWLA1", - "S_SRB1_CRAWLA2", - "S_SRB1_CRAWLA3", - "S_SRB1_CRAWLA4", - - "S_SRB1_BAT1", - "S_SRB1_BAT2", - "S_SRB1_BAT3", - "S_SRB1_BAT4", - - "S_SRB1_ROBOFISH1", - "S_SRB1_ROBOFISH2", - "S_SRB1_ROBOFISH3", - - "S_SRB1_VOLCANOGUY1", - "S_SRB1_VOLCANOGUY2", - - "S_SRB1_HOPPY1", - "S_SRB1_HOPPY2", - - "S_SRB1_HOPPYWATER1", - "S_SRB1_HOPPYWATER2", - - "S_SRB1_HOPPYSKYLAB1", - - "S_SRB1_MMZFLYING1", - "S_SRB1_MMZFLYING2", - "S_SRB1_MMZFLYING3", - "S_SRB1_MMZFLYING4", - "S_SRB1_MMZFLYING5", - - "S_SRB1_UFO1", - "S_SRB1_UFO2", - - "S_SRB1_GRAYBOT1", - "S_SRB1_GRAYBOT2", - "S_SRB1_GRAYBOT3", - "S_SRB1_GRAYBOT4", - "S_SRB1_GRAYBOT5", - "S_SRB1_GRAYBOT6", - - "S_SRB1_ROBOTOPOLIS1", - "S_SRB1_ROBOTOPOLIS2", - - "S_SRB1_RBZBUZZ1", - "S_SRB1_RBZBUZZ2", - - "S_SRB1_RBZSPIKES1", - "S_SRB1_RBZSPIKES2", - - "S_SRB1_METALSONIC1", - "S_SRB1_METALSONIC2", - "S_SRB1_METALSONIC3", - - "S_SRB1_GOLDBOT1", - "S_SRB1_GOLDBOT2", - "S_SRB1_GOLDBOT3", - "S_SRB1_GOLDBOT4", - "S_SRB1_GOLDBOT5", - "S_SRB1_GOLDBOT6", - - "S_SRB1_GENREX1", - "S_SRB1_GENREX2", - #ifdef SEENAMES "S_NAMECHECK", #endif @@ -6613,22 +6549,6 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_ROCKCRUMBLE15", "MT_ROCKCRUMBLE16", - "MT_SRB1_CRAWLA", - "MT_SRB1_BAT", - "MT_SRB1_ROBOFISH", - "MT_SRB1_VOLCANOGUY", - "MT_SRB1_HOPPY", - "MT_SRB1_HOPPYWATER", - "MT_SRB1_HOPPYSKYLAB", - "MT_SRB1_MMZFLYING", - "MT_SRB1_UFO", - "MT_SRB1_GRAYBOT", - "MT_SRB1_ROBOTOPOLIS", - "MT_SRB1_RBZBUZZ", - "MT_SRB1_RBZSPIKES", - "MT_SRB1_METALSONIC", - "MT_SRB1_GOLDBOT", - "MT_SRB1_GENREX", #ifdef SEENAMES "MT_NAMECHECK", #endif diff --git a/src/hardware/hw_light.c b/src/hardware/hw_light.c index fb369387f..3db164b76 100644 --- a/src/hardware/hw_light.c +++ b/src/hardware/hw_light.c @@ -480,23 +480,6 @@ light_t *t_lspr[NUMSPRITES] = &lspr[NOLIGHT], // SPR_GWLG &lspr[NOLIGHT], // SPR_GWLR - // SRB1 Sprites - &lspr[NOLIGHT], // SPR_SRBA - &lspr[NOLIGHT], // SPR_SRBB - &lspr[NOLIGHT], // SPR_SRBC - &lspr[NOLIGHT], // SPR_SRBD - &lspr[NOLIGHT], // SPR_SRBE - &lspr[NOLIGHT], // SPR_SRBF - &lspr[NOLIGHT], // SPR_SRBG - &lspr[NOLIGHT], // SPR_SRBH - &lspr[NOLIGHT], // SPR_SRBI - &lspr[NOLIGHT], // SPR_SRBJ - &lspr[NOLIGHT], // SPR_SRBK - &lspr[NOLIGHT], // SPR_SRBL - &lspr[NOLIGHT], // SPR_SRBM - &lspr[NOLIGHT], // SPR_SRBN - &lspr[NOLIGHT], // SPR_SRBO - // Free slots &lspr[NOLIGHT], &lspr[NOLIGHT], diff --git a/src/info.c b/src/info.c index 04746848b..b78f2a14e 100644 --- a/src/info.c +++ b/src/info.c @@ -52,8 +52,7 @@ char sprnames[NUMSPRITES + 1][5] = "NSPK","NBMP","HOOP","NSCR","NPRU","CAPS","SUPT","SPRK","BOM1","BOM2", "BOM3","BOM4","ROIA","ROIB","ROIC","ROID","ROIE","ROIF","ROIG","ROIH", "ROII","ROIJ","ROIK","ROIL","ROIM","ROIN","ROIO","ROIP","BBAL","GWLG", - "GWLR","SRBA","SRBB","SRBC","SRBD","SRBE","SRBF","SRBG","SRBH","SRBI", - "SRBJ","SRBK","SRBL","SRBM","SRBN","SRBO", + "GWLR", }; char spr2names[NUMPLAYERSPRITES][5] = @@ -2462,69 +2461,6 @@ state_t states[NUMSTATES] = {SPR_ROIO, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEO}, // S_ROCKCRUMBLEO {SPR_ROIP, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEP}, // S_ROCKCRUMBLEP - {SPR_SRBA, 0, 5, {A_Look}, 0, 0, S_SRB1_CRAWLA1}, // S_SRB1_CRAWLA1 - {SPR_SRBA, 0, 3, {A_Chase}, 0, 0, S_SRB1_CRAWLA3}, // S_SRB1_CRAWLA2 - {SPR_SRBA, 1, 3, {A_Chase}, 0, 0, S_SRB1_CRAWLA4}, // S_SRB1_CRAWLA3 - {SPR_SRBA, 2, 3, {A_Chase}, 0, 0, S_SRB1_CRAWLA2}, // S_SRB1_CRAWLA4 - - {SPR_SRBB, 0, 2, {A_Look}, 0, 0, S_SRB1_BAT2}, // S_SRB1_BAT1 - {SPR_SRBB, 1, 2, {A_Look}, 0, 0, S_SRB1_BAT1}, // S_SRB1_BAT2 - {SPR_SRBB, 0, 2, {A_BuzzFly}, 0, 0, S_SRB1_BAT4}, // S_SRB1_BAT3 - {SPR_SRBB, 1, 2, {A_BuzzFly}, 0, 0, S_SRB1_BAT3}, // S_SRB1_BAT4 - - {SPR_SRBC, 0, 2, {A_Look}, 0, 0, S_SRB1_ROBOFISH1}, // S_SRB1_ROBOFISH1 - {SPR_SRBC, 1, 2, {A_BuzzFly}, 0, 0, S_SRB1_ROBOFISH3}, // S_SRB1_ROBOFISH2 - {SPR_SRBC, 0, 2, {A_BuzzFly}, 0, 0, S_SRB1_ROBOFISH2}, // S_SRB1_ROBOFISH3 - - {SPR_SRBD, 0, 2, {A_Look}, 0, 0, S_SRB1_VOLCANOGUY1}, // S_SRB1_VOLCANOGUY1 - {SPR_SRBD, 0, 2, {A_BuzzFly}, 0, 0, S_SRB1_VOLCANOGUY2}, // S_SRB1_VOLCANOGUY2 - - {SPR_SRBE, 0, 2, {A_BunnyHop}, 7, 2, S_SRB1_HOPPY2}, // S_SRB1_HOPPY1 - {SPR_SRBE, 1, 2, {A_BunnyHop}, 7, -2, S_SRB1_HOPPY1}, // S_SRB1_HOPPY2 - - {SPR_SRBE, 0, 2, {A_BunnyHop}, 4, 2, S_SRB1_HOPPYWATER2}, // S_SRB1_HOPPYWATER1 - {SPR_SRBE, 1, 2, {A_BunnyHop}, 4, -2, S_SRB1_HOPPYWATER1}, // S_SRB1_HOPPYWATER2 - - {SPR_SRBF, 0, 2, {A_BunnyHop}, 7, 0, S_SRB1_HOPPYSKYLAB1}, // S_SRB1_HOPPYSKYLAB1 - - {SPR_SRBG, 0, 16, {A_MoveAbsolute}, 0, 5, S_SRB1_MMZFLYING2}, // S_SRB1_MMZFLYING1 - {SPR_SRBG, 0, 16, {A_MoveAbsolute}, 180, 5, S_SRB1_MMZFLYING3}, // S_SRB1_MMZFLYING2 - {SPR_SRBG, 0, 1, {A_MoveAbsolute}, 0, 5, S_SRB1_MMZFLYING4}, // S_SRB1_MMZFLYING3 - {SPR_SRBG, 0, 7, {A_MoveAbsolute}, 0, 5, S_SRB1_MMZFLYING5}, // S_SRB1_MMZFLYING4 - {SPR_SRBG, 0, 8, {A_MoveAbsolute}, 180, 5, S_SRB1_MMZFLYING1}, // S_SRB1_MMZFLYING5 - - {SPR_SRBH, 0, 16, {A_MoveAbsolute}, 180, 5, S_SRB1_UFO2}, // S_SRB1_UFO1 - {SPR_SRBH, 0, 16, {A_MoveAbsolute}, 0, 5, S_SRB1_UFO1}, // S_SRB1_UFO2 - - {SPR_SRBI, 0, 4, {A_MoveAbsolute}, 0, 7, S_SRB1_GRAYBOT2}, // S_SRB1_GRAYBOT1 - {SPR_SRBI, 1, 4, {A_MoveAbsolute}, 0, 7, S_SRB1_GRAYBOT3}, // S_SRB1_GRAYBOT2 - {SPR_SRBI, 0, 4, {A_MoveAbsolute}, 0, 7, S_SRB1_GRAYBOT4}, // S_SRB1_GRAYBOT3 - {SPR_SRBI, 1, 4, {A_MoveAbsolute}, 180, 7, S_SRB1_GRAYBOT5}, // S_SRB1_GRAYBOT4 - {SPR_SRBI, 0, 4, {A_MoveAbsolute}, 180, 7, S_SRB1_GRAYBOT6}, // S_SRB1_GRAYBOT5 - {SPR_SRBI, 1, 4, {A_MoveAbsolute}, 180, 7, S_SRB1_GRAYBOT1}, // S_SRB1_GRAYBOT6 - - {SPR_SRBJ, 0, 8, {A_MoveAbsolute}, 0, 5, S_SRB1_ROBOTOPOLIS2}, // S_SRB1_ROBOTOPOLIS1 - {SPR_SRBJ, 1, 8, {A_MoveAbsolute}, 0, -5, S_SRB1_ROBOTOPOLIS1}, // S_SRB1_ROBOTOPOLIS2 - - {SPR_SRBK, 0, 8, {A_MoveAbsolute}, 0, 5, S_SRB1_RBZBUZZ2}, // S_SRB1_RBZBUZZ1 - {SPR_SRBK, 1, 8, {A_MoveAbsolute}, 0, -5, S_SRB1_RBZBUZZ1}, // S_SRB1_RBZBUZZ2 - - {SPR_SRBL, 0, 35, {A_ZThrust}, 4, (1<<16)+1, S_SRB1_RBZSPIKES2}, // S_SRB1_RBZSPIKES1 - {SPR_SRBL, 0, 35, {A_ZThrust}, -4, (1<<16)+1, S_SRB1_RBZSPIKES1}, // S_SRB1_RBZSPIKES2 - - {SPR_SRBM, 0, 4, {NULL}, 0, 0, S_SRB1_METALSONIC2}, // S_SRB1_METALSONIC1 - {SPR_SRBM, 1, 4, {NULL}, 0, 0, S_SRB1_METALSONIC3}, // S_SRB1_METALSONIC2 - {SPR_SRBM, 2, 4, {NULL}, 0, 0, S_SRB1_METALSONIC1}, // S_SRB1_METALSONIC3 - - {SPR_SRBN, 0, 2, {A_MoveAbsolute}, 0, 7, S_SRB1_GOLDBOT2}, // S_SRB1_GOLDBOT1 - {SPR_SRBN, 1, 2, {A_MoveAbsolute}, 0, 7, S_SRB1_GOLDBOT3}, // S_SRB1_GOLDBOT2 - {SPR_SRBN, 0, 2, {A_MoveAbsolute}, 0, 7, S_SRB1_GOLDBOT4}, // S_SRB1_GOLDBOT3 - {SPR_SRBN, 1, 2, {A_MoveAbsolute}, 180, 7, S_SRB1_GOLDBOT5}, // S_SRB1_GOLDBOT4 - {SPR_SRBN, 0, 2, {A_MoveAbsolute}, 180, 7, S_SRB1_GOLDBOT6}, // S_SRB1_GOLDBOT5 - {SPR_SRBN, 1, 2, {A_MoveAbsolute}, 180, 7, S_SRB1_GOLDBOT1}, // S_SRB1_GOLDBOT6 - - {SPR_SRBO, 0, 2, {A_Look}, 0, 0, S_SRB1_GENREX1}, // S_SRB1_GENREX1 - {SPR_SRBO, 0, 2, {A_BuzzFly}, 0, 0, S_SRB1_GENREX2}, // S_SRB1_GENREX2 #ifdef SEENAMES {SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK #endif @@ -13347,438 +13283,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_SRB1_CRAWLA - 4000, // doomednum - S_SRB1_CRAWLA1, // spawnstate - 1, // spawnhealth - S_SRB1_CRAWLA2, // seestate - sfx_None, // seesound - 32, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 200, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_XPLD1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - 3, // speed - 20*FRACUNIT, // radius - 40*FRACUNIT, // height - 0, // display offset - 100, // mass - 0, // damage - sfx_None, // activesound - MF_SPECIAL|MF_SHOOTABLE|MF_ENEMY, // flags - S_NULL // raisestate - }, - - { // MT_SRB1_BAT - 4001, // doomednum - S_SRB1_BAT1, // spawnstate - 1, // spawnhealth - S_SRB1_BAT3, // seestate - sfx_None, // seesound - 2, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 3072, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_XPLD1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - 4*FRACUNIT, // speed - 17*FRACUNIT, // radius - 40*FRACUNIT, // height - 0, // display offset - 100, // mass - 0, // damage - sfx_None, // activesound - MF_SPECIAL|MF_SHOOTABLE|MF_ENEMY|MF_NOGRAVITY|MF_SLIDEME, // flags - S_NULL // raisestate - }, - - { // MT_SRB1_ROBOFISH - 4002, // doomednum - S_SRB1_ROBOFISH1, // spawnstate - 1, // spawnhealth - S_SRB1_ROBOFISH2, // seestate - sfx_None, // seesound - 2, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 3072, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_XPLD1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - 4*FRACUNIT, // speed - 22*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - 0, // damage - sfx_None, // activesound - MF_SPECIAL|MF_SHOOTABLE|MF_ENEMY|MF_NOGRAVITY|MF_SLIDEME, // flags - S_NULL // raisestate - }, - - { // MT_SRB1_VOLCANOGUY - 4003, // doomednum - S_SRB1_VOLCANOGUY1, // spawnstate - 1, // spawnhealth - S_SRB1_VOLCANOGUY2, // seestate - sfx_None, // seesound - 2, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 3072, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_XPLD1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - 4*FRACUNIT, // speed - 20*FRACUNIT, // radius - 40*FRACUNIT, // height - 0, // display offset - 100, // mass - 0, // damage - sfx_None, // activesound - MF_SPECIAL|MF_SHOOTABLE|MF_ENEMY|MF_NOGRAVITY|MF_SLIDEME, // flags - S_NULL // raisestate - }, - - { // MT_SRB1_HOPPY - 4004, // doomednum - S_SRB1_HOPPY1, // spawnstate - 1, // spawnhealth - S_SRB1_HOPPY1, // seestate - sfx_None, // seesound - 2, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 3072, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_XPLD1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - FRACUNIT, // speed - 20*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - 0, // damage - sfx_None, // activesound - MF_SPECIAL|MF_SHOOTABLE|MF_ENEMY, // flags - S_NULL // raisestate - }, - - { // MT_SRB1_HOPPYWATER - 4005, // doomednum - S_SRB1_HOPPYWATER1, // spawnstate - 1, // spawnhealth - S_SRB1_HOPPYWATER1, // seestate - sfx_None, // seesound - 2, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 3072, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_XPLD1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - FRACUNIT, // speed - 20*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - 0, // damage - sfx_None, // activesound - MF_SPECIAL|MF_SHOOTABLE|MF_ENEMY, // flags - S_NULL // raisestate - }, - - { // MT_SRB1_HOPPYSKYLAB - 4006, // doomednum - S_SRB1_HOPPYSKYLAB1, // spawnstate - 1, // spawnhealth - S_SRB1_HOPPYSKYLAB1, // seestate - sfx_None, // seesound - 2, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 3072, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_XPLD1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - FRACUNIT, // speed - 10*FRACUNIT, // radius - 34*FRACUNIT, // height - 0, // display offset - 100, // mass - 0, // damage - sfx_None, // activesound - MF_SPECIAL|MF_SHOOTABLE|MF_ENEMY, // flags - S_NULL // raisestate - }, - - { // MT_SRB1_MMZFLYING - 4007, // doomednum - S_SRB1_MMZFLYING1, // spawnstate - 1, // spawnhealth - S_SRB1_MMZFLYING1, // seestate - sfx_None, // seesound - 32, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 200, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_XPLD1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - FRACUNIT, // speed - 24*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - 0, // damage - sfx_None, // activesound - MF_SPECIAL|MF_SHOOTABLE|MF_ENEMY|MF_NOGRAVITY|MF_FLOAT, // flags - S_NULL // raisestate - }, - - { // MT_SRB1_UFO - 4008, // doomednum - S_SRB1_UFO1, // spawnstate - 1, // spawnhealth - S_SRB1_UFO1, // seestate - sfx_None, // seesound - 32, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 200, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_XPLD1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - 3, // speed - 24*FRACUNIT, // radius - 32*FRACUNIT, // height - 0, // display offset - 100, // mass - 0, // damage - sfx_None, // activesound - MF_SPECIAL|MF_SHOOTABLE|MF_ENEMY|MF_NOGRAVITY|MF_FLOAT|MF_SPAWNCEILING, // flags - S_NULL // raisestate - }, - - { // MT_SRB1_GRAYBOT - 4009, // doomednum - S_SRB1_GRAYBOT1,// spawnstate - 1, // spawnhealth - S_SRB1_GRAYBOT1,// seestate - sfx_None, // seesound - 32, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 200, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_XPLD1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - 3, // speed - 21*FRACUNIT, // radius - 69*FRACUNIT, // height - 0, // display offset - 100, // mass - 0, // damage - sfx_None, // activesound - MF_SPECIAL|MF_SHOOTABLE|MF_ENEMY|MF_NOGRAVITY|MF_FLOAT, // flags - S_NULL // raisestate - }, - - { // MT_SRB1_ROBOTOPOLIS - 4010, // doomednum - S_SRB1_ROBOTOPOLIS1, // spawnstate - 1, // spawnhealth - S_SRB1_ROBOTOPOLIS1, // seestate - sfx_None, // seesound - 32, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 200, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_XPLD1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - 3, // speed - 36*FRACUNIT, // radius - 62*FRACUNIT, // height - 0, // display offset - 100, // mass - 0, // damage - sfx_None, // activesound - MF_SPECIAL|MF_SHOOTABLE|MF_ENEMY|MF_NOGRAVITY|MF_FLOAT, // flags - S_NULL // raisestate - }, - - { // MT_SRB1_RBZBUZZ - 4011, // doomednum - S_SRB1_RBZBUZZ1,// spawnstate - 1, // spawnhealth - S_SRB1_RBZBUZZ1,// seestate - sfx_None, // seesound - 32, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 200, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_XPLD1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - 3, // speed - 44*FRACUNIT, // radius - 45*FRACUNIT, // height - 0, // display offset - 100, // mass - 0, // damage - sfx_None, // activesound - MF_SPECIAL|MF_SHOOTABLE|MF_ENEMY|MF_NOGRAVITY|MF_FLOAT, // flags - S_NULL // raisestate - }, - - { // MT_SRB1_RBZSPIKES - 4012, // doomednum - S_SRB1_RBZSPIKES1, // spawnstate - 1, // spawnhealth - S_SRB1_RBZSPIKES1, // seestate - sfx_None, // seesound - 32, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 200, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_XPLD1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - 3, // speed - 10*FRACUNIT, // radius - 53*FRACUNIT, // height - 0, // display offset - 100, // mass - 0, // damage - sfx_None, // activesound - MF_SPECIAL|MF_SOLID|MF_ENEMY|MF_NOGRAVITY|MF_FLOAT, // flags - S_NULL // raisestate - }, - - { // MT_SRB1_METALSONIC - 4013, // doomednum - S_SRB1_METALSONIC1, // 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 - 21*FRACUNIT, // speed - 16*FRACUNIT, // radius - 40*FRACUNIT, // height - 0, // display offset - 100, // mass - 1, // damage - sfx_None, // activesound - MF_SLIDEME|MF_SOLID|MF_PUSHABLE, // flags - S_NULL // raisestate - }, - - { // MT_SRB1_GOLDBOT - 4014, // doomednum - S_SRB1_GOLDBOT1,// spawnstate - 1, // spawnhealth - S_SRB1_GOLDBOT1,// seestate - sfx_None, // seesound - 32, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 200, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_XPLD1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - 3, // speed - 21*FRACUNIT, // radius - 69*FRACUNIT, // height - 0, // display offset - 100, // mass - 0, // damage - sfx_None, // activesound - MF_SPECIAL|MF_SHOOTABLE|MF_ENEMY|MF_NOGRAVITY|MF_FLOAT, // flags - S_NULL // raisestate - }, - - { // MT_SRB1_GENREX - 4015, // doomednum - S_SRB1_GENREX1, // spawnstate - 1, // spawnhealth - S_SRB1_GENREX2, // seestate - sfx_None, // seesound - 2, // reactiontime - sfx_None, // attacksound - S_NULL, // painstate - 3072, // painchance - sfx_None, // painsound - S_NULL, // meleestate - S_NULL, // missilestate - S_XPLD1, // deathstate - S_NULL, // xdeathstate - sfx_pop, // deathsound - 4*FRACUNIT, // speed - 17*FRACUNIT, // radius - 40*FRACUNIT, // height - 0, // display offset - 100, // mass - 0, // damage - sfx_None, // activesound - MF_SPECIAL|MF_SHOOTABLE|MF_ENEMY|MF_NOGRAVITY|MF_SLIDEME, // flags - S_NULL // raisestate - }, - #ifdef SEENAMES { // MT_NAMECHECK -1, // doomednum diff --git a/src/info.h b/src/info.h index 13580a81c..dafa7282d 100644 --- a/src/info.h +++ b/src/info.h @@ -553,23 +553,6 @@ typedef enum sprite SPR_GWLG, SPR_GWLR, - // SRB1 Sprites - SPR_SRBA, - SPR_SRBB, - SPR_SRBC, - SPR_SRBD, - SPR_SRBE, - SPR_SRBF, - SPR_SRBG, - SPR_SRBH, - SPR_SRBI, - SPR_SRBJ, - SPR_SRBK, - SPR_SRBL, - SPR_SRBM, - SPR_SRBN, - SPR_SRBO, - SPR_FIRSTFREESLOT, SPR_LASTFREESLOT = SPR_FIRSTFREESLOT + NUMSPRITEFREESLOTS - 1, NUMSPRITES @@ -2907,70 +2890,6 @@ typedef enum state S_ROCKCRUMBLEO, S_ROCKCRUMBLEP, - S_SRB1_CRAWLA1, - S_SRB1_CRAWLA2, - S_SRB1_CRAWLA3, - S_SRB1_CRAWLA4, - - S_SRB1_BAT1, - S_SRB1_BAT2, - S_SRB1_BAT3, - S_SRB1_BAT4, - - S_SRB1_ROBOFISH1, - S_SRB1_ROBOFISH2, - S_SRB1_ROBOFISH3, - - S_SRB1_VOLCANOGUY1, - S_SRB1_VOLCANOGUY2, - - S_SRB1_HOPPY1, - S_SRB1_HOPPY2, - - S_SRB1_HOPPYWATER1, - S_SRB1_HOPPYWATER2, - - S_SRB1_HOPPYSKYLAB1, - - S_SRB1_MMZFLYING1, - S_SRB1_MMZFLYING2, - S_SRB1_MMZFLYING3, - S_SRB1_MMZFLYING4, - S_SRB1_MMZFLYING5, - - S_SRB1_UFO1, - S_SRB1_UFO2, - - S_SRB1_GRAYBOT1, - S_SRB1_GRAYBOT2, - S_SRB1_GRAYBOT3, - S_SRB1_GRAYBOT4, - S_SRB1_GRAYBOT5, - S_SRB1_GRAYBOT6, - - S_SRB1_ROBOTOPOLIS1, - S_SRB1_ROBOTOPOLIS2, - - S_SRB1_RBZBUZZ1, - S_SRB1_RBZBUZZ2, - - S_SRB1_RBZSPIKES1, - S_SRB1_RBZSPIKES2, - - S_SRB1_METALSONIC1, - S_SRB1_METALSONIC2, - S_SRB1_METALSONIC3, - - S_SRB1_GOLDBOT1, - S_SRB1_GOLDBOT2, - S_SRB1_GOLDBOT3, - S_SRB1_GOLDBOT4, - S_SRB1_GOLDBOT5, - S_SRB1_GOLDBOT6, - - S_SRB1_GENREX1, - S_SRB1_GENREX2, - #ifdef SEENAMES S_NAMECHECK, #endif @@ -3482,22 +3401,6 @@ typedef enum mobj_type MT_ROCKCRUMBLE15, MT_ROCKCRUMBLE16, - MT_SRB1_CRAWLA, - MT_SRB1_BAT, - MT_SRB1_ROBOFISH, - MT_SRB1_VOLCANOGUY, - MT_SRB1_HOPPY, - MT_SRB1_HOPPYWATER, - MT_SRB1_HOPPYSKYLAB, - MT_SRB1_MMZFLYING, - MT_SRB1_UFO, - MT_SRB1_GRAYBOT, - MT_SRB1_ROBOTOPOLIS, - MT_SRB1_RBZBUZZ, - MT_SRB1_RBZSPIKES, - MT_SRB1_METALSONIC, - MT_SRB1_GOLDBOT, - MT_SRB1_GENREX, #ifdef SEENAMES MT_NAMECHECK, #endif diff --git a/src/m_cond.c b/src/m_cond.c index 7ef192f7b..63df35cf2 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -565,7 +565,7 @@ extraemblem_t extraemblems[MAXEXTRAEMBLEMS] = {"Game Complete", "Complete 1P Mode", 10, 'X', SKINCOLOR_BLUE, 0}, {"All Emeralds", "Complete 1P Mode with all Emeralds", 11, 'V', SKINCOLOR_GREY, 0}, {"Perfect Bonus", "Perfect Bonus on a non-secret stage", 30, 'P', SKINCOLOR_GOLD, 0}, - {"SRB1 Remake", "Complete SRB1 Remake", 21, 'O', SKINCOLOR_RUST, 0}, + {"PLACEHOLDER", "PLACEHOLDER", 0, 'O', SKINCOLOR_RUST, 0}, {"NiGHTS Mastery", "Show your mastery of NiGHTS!", 22, 'W', SKINCOLOR_TEAL, 0}, }; @@ -586,9 +586,9 @@ unlockable_t unlockables[MAXUNLOCKABLES] = /* 08 */ {"BONUS LEVELS", "", 100, 0, SECRET_HEADER, 0, true, true, 0}, - /* 09 */ {"SRB1 Remake", "Collect 20 Emblems", 130, 40, SECRET_WARP, 101, false, false, 0}, + /* 09 */ {"PLACEHOLDER", "PLACEHOLDER", 0, 0, SECRET_NONE, 0, true, true, 0}, /* 10 */ {"Mario Koopa Blast", "Collect 60 Emblems", 110, 42, SECRET_WARP, 30, false, false, 0}, - /* 11 */ {"SRB1 Level Select", "Complete SRB1 Remake", 140, 21, SECRET_LEVELSELECT, 2, false, true, 0}, + /* 11 */ {"PLACEHOLDER", "PLACEHOLDER", 0, 0, SECRET_NONE, 0, true, true, 0}, /* 12 */ {"Spring Hill Zone", "Collect 100 Emblems", 0, 44, SECRET_NONE, 0, false, false, 0}, /* 13 */ {"Black Hole", "A Rank in all Special Stages", 0, 50, SECRET_NONE, 0, false, true, 0}, @@ -624,9 +624,6 @@ void M_SetupDefaultConditionSets(void) // -- 20: Beat AGZ M_AddRawCondition(20, 1, UC_MAPBEATEN, 40, 0, 0); - // -- 21: Beat SRB1 Remake - M_AddRawCondition(21, 1, UC_MAPBEATEN, 132, 0, 0); - // -- 22: Beat Black Hole M_AddRawCondition(22, 1, UC_MAPBEATEN, 57, 0, 0); From a749d79aa5c0ba68abe99b91bacca2b2e1aa19a6 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 13 Mar 2016 20:53:10 +0000 Subject: [PATCH 035/808] Fix up S_ChangeMusic usage from merge so things can compile again --- src/p_inter.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 2a6c0bd21..bc1857c20 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -250,11 +250,11 @@ void P_DoMatchSuper(player_t *player) S_StopMusic(); if (mariomode) { - S_ChangeMusic(mus_minvnc, false); + S_ChangeMusicInternal("minvnc", false); G_GhostAddColor(GHC_INVINCIBLE); } else - S_ChangeMusic(mus_invinc, false); + S_ChangeMusicInternal("invinc", false); } // Also steal 50 points from every enemy, sealing your victory. @@ -275,11 +275,11 @@ void P_DoMatchSuper(player_t *player) S_StopMusic(); if (mariomode) { - S_ChangeMusic(mus_minvnc, false); + S_ChangeMusicInternal("minvnc", false); G_GhostAddColor(GHC_INVINCIBLE); } else - S_ChangeMusic(mus_invinc, false); + S_ChangeMusicInternal("invinc", false); } } } From d31fd95d7574d8cc50caa597e8ac45bbf8e75b95 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 7 Apr 2016 22:02:52 +0100 Subject: [PATCH 036/808] Armageddon & Sparkles confusion is no more, DMG_NUKE exists to sort that out now --- src/p_inter.c | 2 +- src/p_local.h | 3 ++- src/p_user.c | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index bc1857c20..14667d21f 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1586,7 +1586,7 @@ static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *sour else switch (inflictor->type) { case MT_PLAYER: - if ((inflictor->player->powers[pw_shield] & SH_NOSTACK) == SH_BOMB) + if (damagetype == DMG_NUKE) // SH_BOMB, armageddon shield str = M_GetText("%s%s's armageddon blast %s %s.\n"); else if (inflictor->player->powers[pw_invulnerability]) str = M_GetText("%s%s's invincibility aura %s %s.\n"); diff --git a/src/p_local.h b/src/p_local.h index 583f115ef..717f66d69 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -376,7 +376,8 @@ typedef struct BasicFF_s #define DMG_FIRE 2 #define DMG_ELECTRIC 3 #define DMG_SPIKE 4 -//#define DMG_SPECIALSTAGE 5 +#define DMG_NUKE 5 // bomb shield +//#define DMG_SPECIALSTAGE 6 //// Death types - cannot be combined with damage types #define DMG_INSTAKILL 0x80 #define DMG_DROWNED 0x80+1 diff --git a/src/p_user.c b/src/p_user.c index 4f9bca55e..4cf75ef33 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7440,12 +7440,12 @@ void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius) mo->flags |= MF_SPECIAL|MF_SHOOTABLE; if (mo->type == MT_EGGGUARD && mo->tracer) //nuke Egg Guard's shield! - P_KillMobj(mo->tracer, inflictor, source, 0); + P_KillMobj(mo->tracer, inflictor, source, DMG_NUKE); if (mo->flags & MF_BOSS || mo->type == MT_PLAYER) //don't OHKO bosses nor players! - P_DamageMobj(mo, inflictor, source, 1, 0); + P_DamageMobj(mo, inflictor, source, 1, DMG_NUKE); else - P_DamageMobj(mo, inflictor, source, 1000, 0); + P_DamageMobj(mo, inflictor, source, 1000, DMG_NUKE); } } From c239a71ffe395c3bab79b8418279c3433e6b6adb Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 25 May 2016 16:34:09 +0100 Subject: [PATCH 037/808] Add P_PointOnLineSide to Lua --- src/lua_baselib.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 1bacf9102..e083530a9 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -205,6 +205,16 @@ static int lib_pClosestPointOnLine(lua_State *L) return 2; } +static int lib_pPointOnLineSide(lua_State *L) +{ + fixed_t x = luaL_checkfixed(L, 1); + fixed_t y = luaL_checkfixed(L, 2); + line_t *line = *((line_t **)luaL_checkudata(L, 3, META_LINE)); + //HUDSAFE + lua_pushinteger(L, P_PointOnLineSide(x, y, line)); + return 1; +} + // P_ENEMY ///////////// @@ -1981,6 +1991,7 @@ static luaL_Reg lib[] = { // p_maputil {"P_AproxDistance",lib_pAproxDistance}, {"P_ClosestPointOnLine",lib_pClosestPointOnLine}, + {"P_PointOnLineSide",lib_pPointOnLineSide}, // p_enemy {"P_CheckMeleeRange", lib_pCheckMeleeRange}, From 8211e89aec537ff6179330a30c42f31a36ecee9e Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 25 May 2016 17:15:44 +0100 Subject: [PATCH 038/808] Add seg_t to Lua, may be of use to Nev3r (and possibly others, I guess) segs[i] is the segs table, "for seg in segs.iterate" iterates through segs, you know the drill by now I hope --- src/lua_libs.h | 1 + src/lua_maplib.c | 147 +++++++++++++++++++++++++++++++++++++++++++++++ src/lua_script.c | 16 ++++++ 3 files changed, 164 insertions(+) diff --git a/src/lua_libs.h b/src/lua_libs.h index 931cf62d0..6c9524dea 100644 --- a/src/lua_libs.h +++ b/src/lua_libs.h @@ -38,6 +38,7 @@ extern lua_State *gL; #define META_SUBSECTOR "SUBSECTOR_T*" #define META_SECTOR "SECTOR_T*" #define META_FFLOOR "FFLOOR_T*" +#define META_SEG "SEG_T*" #define META_MAPHEADER "MAPHEADER_T*" #define META_CVAR "CONSVAR_T*" diff --git a/src/lua_maplib.c b/src/lua_maplib.c index c512bf3c5..28561f34e 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -185,6 +185,32 @@ static const char *const ffloor_opt[] = { "alpha", NULL}; +enum seg_e { + seg_valid = 0, + seg_v1, + seg_v2, + seg_side, + seg_offset, + seg_angle, + seg_sidedef, + seg_linedef, + seg_frontsector, + seg_backsector, +}; + +static const char *const seg_opt[] = { + "valid", + "v1", + "v2", + "side", + "offset", + "angle", + "sidedef", + "linedef", + "frontsector", + "backsector", + NULL}; + static const char *const array_opt[] ={"iterate",NULL}; static const char *const valid_opt[] ={"valid",NULL}; @@ -818,6 +844,63 @@ static int vertex_num(lua_State *L) return 1; } +static int seg_get(lua_State *L) +{ + seg_t *seg = *((seg_t **)luaL_checkudata(L, 1, META_SEG)); + enum seg_e field = luaL_checkoption(L, 2, seg_opt[0], seg_opt); + + if (!seg) + { + if (field == seg_valid) { + lua_pushboolean(L, 0); + return 1; + } + return luaL_error(L, "accessed seg_t doesn't exist anymore."); + } + + switch(field) + { + case seg_valid: // valid + lua_pushboolean(L, 1); + return 1; + case seg_v1: + LUA_PushUserdata(L, seg->v1, META_VERTEX); + return 1; + case seg_v2: + LUA_PushUserdata(L, seg->v2, META_VERTEX); + return 1; + case seg_side: + lua_pushinteger(L, seg->side); + return 1; + case seg_offset: + lua_pushfixed(L, seg->offset); + return 1; + case seg_angle: + lua_pushangle(L, seg->angle); + return 1; + case seg_sidedef: + LUA_PushUserdata(L, seg->sidedef, META_SIDE); + return 1; + case seg_linedef: + LUA_PushUserdata(L, seg->linedef, META_LINE); + return 1; + case seg_frontsector: + LUA_PushUserdata(L, seg->frontsector, META_SECTOR); + return 1; + case seg_backsector: + LUA_PushUserdata(L, seg->backsector, META_SECTOR); + return 1; + } + return 0; +} + +static int seg_num(lua_State *L) +{ + seg_t *seg = *((seg_t **)luaL_checkudata(L, 1, META_SEG)); + lua_pushinteger(L, seg-segs); + return 1; +} + static int lib_iterateSectors(lua_State *L) { size_t i = 0; @@ -1048,6 +1131,52 @@ static int lib_numvertexes(lua_State *L) return 1; } +static int lib_iterateSegs(lua_State *L) +{ + size_t i = 0; + if (lua_gettop(L) < 2) + return luaL_error(L, "Don't call segs.iterate() directly, use it as 'for seg in segs.iterate do end'."); + lua_settop(L, 2); + lua_remove(L, 1); // state is unused. + if (!lua_isnil(L, 1)) + i = (size_t)(*((seg_t **)luaL_checkudata(L, 1, META_SEG)) - segs)+1; + if (i < numsegs) + { + LUA_PushUserdata(L, &segs[i], META_SEG); + return 1; + } + return 0; +} + +static int lib_getSeg(lua_State *L) +{ + int field; + lua_settop(L, 2); + lua_remove(L, 1); // dummy userdata table is unused. + if (lua_isnumber(L, 1)) + { + size_t i = lua_tointeger(L, 1); + if (i >= numsegs) + return 0; + LUA_PushUserdata(L, &segs[i], META_SEG); + return 1; + } + field = luaL_checkoption(L, 1, NULL, array_opt); + switch(field) + { + case 0: // iterate + lua_pushcfunction(L, lib_iterateSegs); + return 1; + } + return 0; +} + +static int lib_numsegs(lua_State *L) +{ + lua_pushinteger(L, numsegs); + return 1; +} + static int ffloor_get(lua_State *L) { ffloor_t *ffloor = *((ffloor_t **)luaL_checkudata(L, 1, META_FFLOOR)); @@ -1367,6 +1496,14 @@ int LUA_MapLib(lua_State *L) lua_setfield(L, -2, "__newindex"); lua_pop(L, 1); + luaL_newmetatable(L, META_SEG); + lua_pushcfunction(L, seg_get); + lua_setfield(L, -2, "__index"); + + lua_pushcfunction(L, seg_num); + lua_setfield(L, -2, "__len"); + lua_pop(L, 1); + luaL_newmetatable(L, META_MAPHEADER); lua_pushcfunction(L, mapheaderinfo_get); lua_setfield(L, -2, "__index"); @@ -1425,6 +1562,16 @@ int LUA_MapLib(lua_State *L) lua_setmetatable(L, -2); lua_setglobal(L, "vertexes"); + lua_newuserdata(L, 0); + lua_createtable(L, 0, 2); + lua_pushcfunction(L, lib_getSeg); + lua_setfield(L, -2, "__index"); + + lua_pushcfunction(L, lib_numsegs); + lua_setfield(L, -2, "__len"); + lua_setmetatable(L, -2); + lua_setglobal(L, "segs"); + lua_newuserdata(L, 0); lua_createtable(L, 0, 2); lua_pushcfunction(L, lib_getMapheaderinfo); diff --git a/src/lua_script.c b/src/lua_script.c index acb306827..621b7dfe4 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -455,6 +455,7 @@ enum ARCH_SIDE, ARCH_SUBSECTOR, ARCH_SECTOR, + ARCH_SEG, ARCH_MAPHEADER, ARCH_TEND=0xFF, @@ -474,6 +475,7 @@ static const struct { {META_SIDE, ARCH_SIDE}, {META_SUBSECTOR,ARCH_SUBSECTOR}, {META_SECTOR, ARCH_SECTOR}, + {META_SEG, ARCH_SEG}, {META_MAPHEADER, ARCH_MAPHEADER}, {NULL, ARCH_NULL} }; @@ -664,6 +666,17 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex) } break; } + case ARCH_SEG: + { + seg_t *seg = *((seg_t **)lua_touserdata(gL, myindex)); + if (!seg) + WRITEUINT8(save_p, ARCH_NULL); + else { + WRITEUINT8(save_p, ARCH_SEG); + WRITEUINT16(save_p, seg - segs); + } + break; + } case ARCH_MAPHEADER: { mapheader_t *header = *((mapheader_t **)lua_touserdata(gL, myindex)); @@ -842,6 +855,9 @@ static UINT8 UnArchiveValue(int TABLESINDEX) case ARCH_SECTOR: LUA_PushUserdata(gL, §ors[READUINT16(save_p)], META_SECTOR); break; + case ARCH_SEG: + LUA_PushUserdata(gL, &segs[READUINT16(save_p)], META_SEG); + break; case ARCH_MAPHEADER: LUA_PushUserdata(gL, §ors[READUINT16(save_p)], META_MAPHEADER); break; From 7a1b3096532f61f9aed2ad5215ae40c760a792d1 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 29 May 2016 20:47:08 +0100 Subject: [PATCH 039/808] Making Linedef type 7 less awful. More details (and test file) in merge request. --- src/p_spec.c | 46 +++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index 3ca697295..270f3dfa9 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -5561,46 +5561,42 @@ void P_SpawnSpecials(INT32 fromnetsave) #endif case 7: // Flat alignment - if (lines[i].flags & ML_EFFECT4) // Align angle + if ((lines[i].flags & (ML_EFFECT1|ML_NOCLIMB)) != (ML_EFFECT1|ML_NOCLIMB)) // If you can do something... { - if (!(lines[i].flags & ML_EFFECT5)) // Align floor unless ALLTRIGGER flag is set - { - for (s = -1; (s = P_FindSectorFromLineTag(lines + i, s)) >= 0 ;) - sectors[s].spawn_flrpic_angle = sectors[s].floorpic_angle = R_PointToAngle2(lines[i].v1->x, lines[i].v1->y, lines[i].v2->x, lines[i].v2->y); - } + line_t line = lines[i]; + angle_t flatangle = 0; + if (!(line.flags & ML_EFFECT2)) // Change flat angles unless EFFECT2 flag is set + flatangle = R_PointToAngle2(line.v1->x, line.v1->y, line.v2->x, line.v2->y); - if (!(lines[i].flags & ML_BOUNCY)) // Align ceiling unless BOUNCY flag is set + for (s = -1; (s = P_FindSectorFromLineTag(lines + i, s)) >= 0 ;) { - for (s = -1; (s = P_FindSectorFromLineTag(lines + i, s)) >= 0 ;) - sectors[s].spawn_ceilpic_angle = sectors[s].ceilingpic_angle = R_PointToAngle2(lines[i].v1->x, lines[i].v1->y, lines[i].v2->x, lines[i].v2->y); - } - } - else // Do offsets - { - if (!(lines[i].flags & ML_BLOCKMONSTERS)) // Align floor unless BLOCKMONSTERS flag is set - { - for (s = -1; (s = P_FindSectorFromLineTag(lines + i, s)) >= 0 ;) + if (!(line.flags & ML_EFFECT1)) // Change floor flat unless EFFECT1 flag is set { - sectors[s].floor_xoffs += lines[i].dx; - sectors[s].floor_yoffs += lines[i].dy; + sectors[s].spawn_flrpic_angle = sectors[s].floorpic_angle = flatangle; + sectors[s].floor_xoffs += sides[line.sidenum[0]].textureoffset; + sectors[s].floor_yoffs += sides[line.sidenum[0]].rowoffset; // saved for netgames sectors[s].spawn_flr_xoffs = sectors[s].floor_xoffs; sectors[s].spawn_flr_yoffs = sectors[s].floor_yoffs; } - } - - if (!(lines[i].flags & ML_NOCLIMB)) // Align ceiling unless NOCLIMB flag is set - { - for (s = -1; (s = P_FindSectorFromLineTag(lines + i, s)) >= 0 ;) + + if (!(line.flags & ML_NOCLIMB)) // Change ceiling flat unless NOCLIMB flag is set { - sectors[s].ceiling_xoffs += lines[i].dx; - sectors[s].ceiling_yoffs += lines[i].dy; + sectors[s].spawn_ceilpic_angle = sectors[s].ceilingpic_angle = flatangle; + sectors[s].ceiling_xoffs += sides[line.sidenum[0]].textureoffset; + sectors[s].ceiling_yoffs += sides[line.sidenum[0]].rowoffset; // saved for netgames sectors[s].spawn_ceil_xoffs = sectors[s].ceiling_xoffs; sectors[s].spawn_ceil_yoffs = sectors[s].ceiling_yoffs; } } } + else // Otherwise, print a helpful warning. Can I do no less? + { + CONS_Alert(CONS_WARNING, + M_GetText("Flat alignment linedef with tag %d doesn't have anything to do.\nConsider changing the linedef's flag configuration or removing it entirely.\n"), + lines[i].tag); + } break; case 8: // Sector Parameters From a8248fb6c9855b79e0dda1918df86614144ad92e Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 30 May 2016 22:44:23 +0100 Subject: [PATCH 040/808] Added new functionality, reorganised functionality from last commit, cursed a lot. Again, more info in merge request. --- src/p_spec.c | 80 +++++++++++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 36 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index 270f3dfa9..4f027f8d6 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -51,6 +51,9 @@ mobj_t *skyboxmo[2]; // Amount (dx, dy) vector linedef is shifted right to get scroll amount #define SCROLL_SHIFT 5 +// This must be updated whenever we up the max flat size - quicker to assume rather than figuring out the sqrt of the specific flat's filesize. +#define MAXFLATSIZE (2048<x, line.v1->y, line.v2->x, line.v2->y); - + angle_t flatangle = InvAngle(R_PointToAngle2(lines[i].v1->x, lines[i].v1->y, lines[i].v2->x, lines[i].v2->y)); + fixed_t xoffs; + fixed_t yoffs; + + if (lines[i].flags & ML_NOKNUX) // Set offset through x and y texture offsets if NOKNUX flag is set + { + xoffs = sides[lines[i].sidenum[0]].textureoffset; + yoffs = sides[lines[i].sidenum[0]].rowoffset; + } + else // Otherwise, set calculated offsets such that line's v1 is the apparent origin + { + fixed_t cosinecomponent = FINECOSINE(flatangle>>ANGLETOFINESHIFT); + fixed_t sinecomponent = FINESINE(flatangle>>ANGLETOFINESHIFT); + xoffs = (-FixedMul(lines[i].v1->x, cosinecomponent) % MAXFLATSIZE) + (FixedMul(lines[i].v1->y, sinecomponent) % MAXFLATSIZE); // No danger of overflow thanks to the strategically placed modulo operations. + yoffs = (FixedMul(lines[i].v1->x, sinecomponent) % MAXFLATSIZE) + (FixedMul(lines[i].v1->y, cosinecomponent) % MAXFLATSIZE); // Ditto. + } + for (s = -1; (s = P_FindSectorFromLineTag(lines + i, s)) >= 0 ;) { - if (!(line.flags & ML_EFFECT1)) // Change floor flat unless EFFECT1 flag is set + if (!(lines[i].flags & ML_NOSONIC)) // Modify floor flat alignment unless NOSONIC flag is set { sectors[s].spawn_flrpic_angle = sectors[s].floorpic_angle = flatangle; - sectors[s].floor_xoffs += sides[line.sidenum[0]].textureoffset; - sectors[s].floor_yoffs += sides[line.sidenum[0]].rowoffset; + sectors[s].floor_xoffs += xoffs; + sectors[s].floor_yoffs += yoffs; // saved for netgames sectors[s].spawn_flr_xoffs = sectors[s].floor_xoffs; sectors[s].spawn_flr_yoffs = sectors[s].floor_yoffs; } - if (!(line.flags & ML_NOCLIMB)) // Change ceiling flat unless NOCLIMB flag is set + if (!(lines[i].flags & ML_NOTAILS)) // Modify ceiling flat alignment unless NOTAILS flag is set { sectors[s].spawn_ceilpic_angle = sectors[s].ceilingpic_angle = flatangle; - sectors[s].ceiling_xoffs += sides[line.sidenum[0]].textureoffset; - sectors[s].ceiling_yoffs += sides[line.sidenum[0]].rowoffset; + sectors[s].ceiling_xoffs += xoffs; + sectors[s].ceiling_yoffs += yoffs; // saved for netgames sectors[s].spawn_ceil_xoffs = sectors[s].ceiling_xoffs; sectors[s].spawn_ceil_yoffs = sectors[s].ceiling_yoffs; @@ -5592,11 +5602,9 @@ void P_SpawnSpecials(INT32 fromnetsave) } } else // Otherwise, print a helpful warning. Can I do no less? - { CONS_Alert(CONS_WARNING, - M_GetText("Flat alignment linedef with tag %d doesn't have anything to do.\nConsider changing the linedef's flag configuration or removing it entirely.\n"), + M_GetText("Flat alignment linedef (tag %d) doesn't have anything to do.\nConsider changing the linedef's flag configuration or removing it entirely.\n"), lines[i].tag); - } break; case 8: // Sector Parameters From 577f9e8801dd820f2f0af586fefc65a5b3bce22f Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 2 Jun 2016 22:46:27 +0100 Subject: [PATCH 041/808] Going beyond the scope of the branch: *Friction linedef effect is now - 1) controlled by x offset instead of length - offset of -100 is maximum iciness, offset of +483(!!!) is the maximum sludginess BUT things are scaled such that +100 is about the maximum sludginess any reasonable human being would want in a level, 0 is ORIG_FRICTION) 2) not reliant on a sector special to function (can be applied solely by tag to in-map sectors or solid FOF control sectors) --- src/p_spec.c | 37 +++++++++++++------------------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index 4f027f8d6..4812b39c3 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3650,9 +3650,9 @@ DoneSection2: // Process Section 3 switch (special) { - case 1: // Ice/Sludge + case 1: // N/A (formerly Ice/Sludge) case 2: // Wind/Current - case 3: // Ice/Sludge and Wind/Current + case 3: // N/A (formerly Ice/Sludge and Wind/Current) case 4: // Conveyor Belt break; @@ -6949,22 +6949,10 @@ void T_Friction(friction_t *f) sec = sectors + f->affectee; - // Make sure the sector type hasn't changed + // Get FOF control sector if (f->roverfriction) - { referrer = sectors + f->referrer; - if (!(GETSECSPECIAL(referrer->special, 3) == 1 - || GETSECSPECIAL(referrer->special, 3) == 3)) - return; - } - else - { - if (!(GETSECSPECIAL(sec->special, 3) == 1 - || GETSECSPECIAL(sec->special, 3) == 3)) - return; - } - // Assign the friction value to players on the floor, non-floating, // and clipped. Normally the object's friction value is kept at // ORIG_FRICTION and this thinker changes it for icy or muddy floors. @@ -7017,15 +7005,18 @@ static void P_SpawnFriction(void) size_t i; line_t *l = lines; register INT32 s; - fixed_t length; // line length controls magnitude + fixed_t strength; // frontside texture offset controls magnitude fixed_t friction; // friction value to be applied during movement INT32 movefactor; // applied to each player move to simulate inertia for (i = 0; i < numlines; i++, l++) if (l->special == 540) { - length = P_AproxDistance(l->dx, l->dy)>>FRACBITS; - friction = (0x1EB8*length)/0x80 + 0xD000; + strength = sides[l->sidenum[0]].textureoffset>>FRACBITS; + if (strength > 0) // sludge + strength = strength*2; // otherwise, the maximum sludginess value is +967... + + friction = ORIG_FRICTION - (0x1EB8*strength)/0x80; // ORIG_FRICTION is 0xE800 if (friction > FRACUNIT) friction = FRACUNIT; @@ -7036,9 +7027,9 @@ static void P_SpawnFriction(void) // the move distance is multiplied by 'friction/0x10000', so a // higher friction value actually means 'less friction'. - if (friction > ORIG_FRICTION) // ice + if (friction < ORIG_FRICTION) // ice movefactor = ((0x10092 - friction)*(0x70))/0x158; - else + else // sludge movefactor = ((friction - 0xDB34)*(0xA))/0x80; // killough 8/28/98: prevent odd situations @@ -7293,12 +7284,10 @@ void T_Pusher(pusher_t *p) { referrer = §ors[p->referrer]; - if (!(GETSECSPECIAL(referrer->special, 3) == 2 - || GETSECSPECIAL(referrer->special, 3) == 3)) + if (GETSECSPECIAL(referrer->special, 3) != 2) return; } - else if (!(GETSECSPECIAL(sec->special, 3) == 2 - || GETSECSPECIAL(sec->special, 3) == 3)) + else if (GETSECSPECIAL(sec->special, 3) != 2) return; // For constant pushers (wind/current) there are 3 situations: From fc0d6e5195ef60d95a7595c4d8a4249ed96f51ef Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 2 Jun 2016 23:30:50 +0100 Subject: [PATCH 042/808] Movefactor removed from Friction thinker. Smaller memory footprint, less processing, and no more potential corrupting of what some objects use as a memory dumping ground. --- src/p_spec.c | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index 4812b39c3..e75ef3597 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -109,7 +109,7 @@ static void P_AddFloatThinker(sector_t *sec, INT32 tag, line_t *sourceline); //static void P_AddBridgeThinker(line_t *sourceline, sector_t *sec); static void P_AddFakeFloorsByLine(size_t line, ffloortype_e ffloorflags, thinkerlist_t *secthinkers); static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec); -static void Add_Friction(INT32 friction, INT32 movefactor, INT32 affectee, INT32 referrer); +static void Add_Friction(INT32 friction, INT32 affectee, INT32 referrer); static void P_AddSpikeThinker(sector_t *sec, INT32 referrer); @@ -4879,7 +4879,7 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f f = (friction_t *)th; if (f->affectee == (INT32)sec2num) - Add_Friction(f->friction, f->movefactor, (INT32)(sec-sectors), f->affectee); + Add_Friction(f->friction, (INT32)(sec-sectors), f->affectee); } // Should this FOF have wind/current/pusher? else if(th->function.acp1 == (actionf_p1)T_Pusher) @@ -6911,18 +6911,16 @@ void T_Disappear(disappear_t *d) /** Adds friction thinker. * * \param friction Friction value, 0xe800 is normal. - * \param movefactor Inertia factor. * \param affectee Target sector. * \param roverfriction FOF or not * \sa T_Friction, P_SpawnFriction */ -static void Add_Friction(INT32 friction, INT32 movefactor, INT32 affectee, INT32 referrer) +static void Add_Friction(INT32 friction, INT32 affectee, INT32 referrer) { friction_t *f = Z_Calloc(sizeof *f, PU_LEVSPEC, NULL); f->thinker.function.acp1 = (actionf_p1)T_Friction; f->friction = friction; - f->movefactor = movefactor; f->affectee = affectee; if (referrer != -1) @@ -6980,17 +6978,11 @@ void T_Friction(friction_t *f) if ((thing->friction == ORIG_FRICTION) // normal friction? || (f->friction < thing->friction)) - { thing->friction = f->friction; - thing->movefactor = f->movefactor; - } } else if (P_GetSpecialBottomZ(thing, sec, sec) == thing->floorz && (thing->friction == ORIG_FRICTION // normal friction? || f->friction < thing->friction)) - { thing->friction = f->friction; - thing->movefactor = f->movefactor; - } } node = node->m_snext; } @@ -7007,7 +6999,6 @@ static void P_SpawnFriction(void) register INT32 s; fixed_t strength; // frontside texture offset controls magnitude fixed_t friction; // friction value to be applied during movement - INT32 movefactor; // applied to each player move to simulate inertia for (i = 0; i < numlines; i++, l++) if (l->special == 540) @@ -7016,6 +7007,9 @@ static void P_SpawnFriction(void) if (strength > 0) // sludge strength = strength*2; // otherwise, the maximum sludginess value is +967... + // The following might seem odd. At the time of movement, + // the move distance is multiplied by 'friction/0x10000', so a + // higher friction value actually means 'less friction'. friction = ORIG_FRICTION - (0x1EB8*strength)/0x80; // ORIG_FRICTION is 0xE800 if (friction > FRACUNIT) @@ -7023,21 +7017,8 @@ static void P_SpawnFriction(void) if (friction < 0) friction = 0; - // The following check might seem odd. At the time of movement, - // the move distance is multiplied by 'friction/0x10000', so a - // higher friction value actually means 'less friction'. - - if (friction < ORIG_FRICTION) // ice - movefactor = ((0x10092 - friction)*(0x70))/0x158; - else // sludge - movefactor = ((friction - 0xDB34)*(0xA))/0x80; - - // killough 8/28/98: prevent odd situations - if (movefactor < 32) - movefactor = 32; - for (s = -1; (s = P_FindSectorFromLineTag(l, s)) >= 0 ;) - Add_Friction(friction, movefactor, s, -1); + Add_Friction(friction, s, -1); } } From 55bb716c1e7886d84c19552a628aeb9105699198 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 3 Jun 2016 01:30:07 +0100 Subject: [PATCH 043/808] On FuriousFox's request: All waypoint sequences now use linedef frontside texture offset for speed and row offset for sequence, ending what is a very long reign of clusterfuck. --- src/p_spec.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index e75ef3597..6d874186f 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3890,8 +3890,14 @@ DoneSection2: } // Grab speed and sequence values - speed = abs(lines[lineindex].dx)/8; - sequence = abs(lines[lineindex].dy)>>FRACBITS; + speed = abs(sides[lines[lineindex].sidenum[0]].textureoffset)/8; + sequence = abs(sides[lines[lineindex].sidenum[0]].rowoffset)>>FRACBITS; + + if (speed == 0) + { + CONS_Debug(DBG_GAMELOGIC, "ERROR: Waypoint sequence %d at zero speed.\n", sequence); + break; + } // scan the thinkers // to find the first waypoint @@ -3963,8 +3969,14 @@ DoneSection2: } // Grab speed and sequence values - speed = -(abs(lines[lineindex].dx)/8); // Negative means reverse - sequence = abs(lines[lineindex].dy)>>FRACBITS; + speed = -abs(sides[lines[lineindex].sidenum[0]].textureoffset)/8; // Negative means reverse + sequence = abs(sides[lines[lineindex].sidenum[0]].rowoffset)>>FRACBITS; + + if (speed == 0) + { + CONS_Debug(DBG_GAMELOGIC, "ERROR: Waypoint sequence %d at zero speed.\n", sequence); + break; + } // scan the thinkers // to find the last waypoint @@ -4101,8 +4113,14 @@ DoneSection2: } // Grab speed and sequence values - speed = abs(lines[lineindex].dx)/8; - sequence = abs(lines[lineindex].dy)>>FRACBITS; + speed = abs(sides[lines[lineindex].sidenum[0]].textureoffset)/8; + sequence = abs(sides[lines[lineindex].sidenum[0]].rowoffset)>>FRACBITS; + + if (speed == 0) + { + CONS_Debug(DBG_GAMELOGIC, "ERROR: Waypoint sequence %d at zero speed.\n", sequence); + break; + } // Find the closest waypoint // Find the preceding waypoint From 27f825f41b93cfada1378e23bea9b54cf8af0fc6 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 3 Jun 2016 02:23:27 +0100 Subject: [PATCH 044/808] Dedicated laser blocks flash less awfully now. --- src/p_spec.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index 6d874186f..d82f2b2a4 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -5271,7 +5271,7 @@ static inline void P_AddCameraScanner(sector_t *sourcesec, sector_t *actionsecto elevator->distance = FixedInt(AngleFixed(angle)); } -static const ffloortype_e laserflags = FF_EXISTS|FF_RENDERALL|FF_NOSHADE|FF_EXTRA|FF_CUTEXTRA; +static const ffloortype_e laserflags = FF_EXISTS|FF_RENDERALL|FF_NOSHADE|FF_EXTRA|FF_CUTEXTRA|FF_TRANSLUCENT; /** Flashes a laser block. * @@ -5292,9 +5292,11 @@ void T_LaserFlash(laserthink_t *flash) return; if (leveltime & 1) - ffloor->flags |= FF_RENDERALL; + //ffloor->flags |= FF_RENDERALL; + ffloor->alpha = 0xC0; else - ffloor->flags &= ~FF_RENDERALL; + //ffloor->flags &= ~FF_RENDERALL; + ffloor->alpha = 0x60; sourcesec = ffloor->master->frontsector; // Less to type! From 083350cab202f254ed47c08e0707d593d7bf22f1 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 2 Jun 2016 21:24:45 -0400 Subject: [PATCH 045/808] whitespace cleanup --- src/p_spec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index d82f2b2a4..ddad3cde3 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -5584,7 +5584,7 @@ void P_SpawnSpecials(INT32 fromnetsave) angle_t flatangle = InvAngle(R_PointToAngle2(lines[i].v1->x, lines[i].v1->y, lines[i].v2->x, lines[i].v2->y)); fixed_t xoffs; fixed_t yoffs; - + if (lines[i].flags & ML_NOKNUX) // Set offset through x and y texture offsets if NOKNUX flag is set { xoffs = sides[lines[i].sidenum[0]].textureoffset; @@ -5597,7 +5597,7 @@ void P_SpawnSpecials(INT32 fromnetsave) xoffs = (-FixedMul(lines[i].v1->x, cosinecomponent) % MAXFLATSIZE) + (FixedMul(lines[i].v1->y, sinecomponent) % MAXFLATSIZE); // No danger of overflow thanks to the strategically placed modulo operations. yoffs = (FixedMul(lines[i].v1->x, sinecomponent) % MAXFLATSIZE) + (FixedMul(lines[i].v1->y, cosinecomponent) % MAXFLATSIZE); // Ditto. } - + for (s = -1; (s = P_FindSectorFromLineTag(lines + i, s)) >= 0 ;) { if (!(lines[i].flags & ML_NOSONIC)) // Modify floor flat alignment unless NOSONIC flag is set @@ -5609,7 +5609,7 @@ void P_SpawnSpecials(INT32 fromnetsave) sectors[s].spawn_flr_xoffs = sectors[s].floor_xoffs; sectors[s].spawn_flr_yoffs = sectors[s].floor_yoffs; } - + if (!(lines[i].flags & ML_NOTAILS)) // Modify ceiling flat alignment unless NOTAILS flag is set { sectors[s].spawn_ceilpic_angle = sectors[s].ceilingpic_angle = flatangle; From 5a0432816b47dc43cd37aa16a8aceb119ed30dbf Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 3 Jun 2016 15:44:21 +0100 Subject: [PATCH 046/808] Forgot to make this change; now the friction thinker is DEFINITELY using less memory. --- src/p_spec.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/p_spec.h b/src/p_spec.h index a8f9ac492..b90764f61 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -386,7 +386,6 @@ typedef struct { thinker_t thinker; ///< Thinker structure for friction. INT32 friction; ///< Friction value, 0xe800 = normal. - INT32 movefactor; ///< Inertia factor when adding to momentum. INT32 affectee; ///< Number of affected sector. INT32 referrer; ///< If roverfriction == true, then this will contain the sector # of the control sector where the effect was applied. UINT8 roverfriction; ///< flag for whether friction originated from a FOF or not From 1e6b213d6c3d2a7f83c0381f09f341b008e49647 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 3 Jun 2016 17:26:50 +0100 Subject: [PATCH 047/808] Okay, this is way beyond the scope of the branch... but low-friction surfaces (ice, oil, etc) now: * Actively impede your acceleration * Make your animation speeds faster whenever you're moving (to give off that Looney Tunes effect) The former change is something that was present in the few low-friction circumstances in the classics, and makes low-friction surfaces more of an active challenge. The latter change is just something I did for fun to more clearly communicate that things are different with the physics here. High friction surfaces DO NOT involve any of this, since it ended up basically cheesing their existing gameplay. --- src/p_mobj.c | 7 +++---- src/p_spec.c | 8 ++++++++ src/p_user.c | 15 ++++++++++++++- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 9e061950f..ec418fb93 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -285,7 +285,8 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) // Adjust the player's animation speed to match their velocity. if (!(disableSpeedAdjust || player->charflags & SF_NOSPEEDADJUST)) { - fixed_t speed = FixedDiv(player->speed, mobj->scale); + fixed_t speed = FixedDiv(player->speed, FixedMul(mobj->scale, player->mo->movefactor)); + if (player->panim == PA_ROLL) { if (speed > 16<friction = FRACUNIT - 0x100; - mo->movefactor = ((0x10092 - mo->friction)*(0x70))/0x158; } else mo->friction = ORIG_FRICTION; @@ -2658,7 +2658,6 @@ static boolean P_ZMovement(mobj_t *mo) // Stolen from P_SpawnFriction mo->friction = FRACUNIT - 0x100; - mo->movefactor = ((0x10092 - mo->friction)*(0x70))/0x158; } else if (mo->type == MT_FALLINGROCK) { @@ -7799,7 +7798,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) mobj->friction = ORIG_FRICTION; - mobj->movefactor = ORIG_FRICTION_FACTOR; + mobj->movefactor = ORIG_FRICTION; // All mobjs are created at 100% scale. mobj->scale = FRACUNIT; diff --git a/src/p_spec.c b/src/p_spec.c index ddad3cde3..d2ac5b6a9 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -6998,11 +6998,19 @@ void T_Friction(friction_t *f) if ((thing->friction == ORIG_FRICTION) // normal friction? || (f->friction < thing->friction)) + { thing->friction = f->friction; + if (thing->player) + thing->movefactor = f->friction; + } } else if (P_GetSpecialBottomZ(thing, sec, sec) == thing->floorz && (thing->friction == ORIG_FRICTION // normal friction? || f->friction < thing->friction)) + { thing->friction = f->friction; + if (thing->player) + thing->movefactor = f->friction; + } } node = node->m_snext; } diff --git a/src/p_user.c b/src/p_user.c index 02e3308d0..6aebbe642 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4673,6 +4673,9 @@ static void P_3dMovement(player_t *player) acceleration = player->accelstart + (FixedDiv(player->speed, player->mo->scale)>>FRACBITS) * player->acceleration; } + // Friction-scaled acceleration... + acceleration = FixedMul(acceleration<mo->movefactor)>>FRACBITS; + // Forward movement if (player->climbing) { @@ -6327,7 +6330,8 @@ static void P_SkidStuff(player_t *player) // If your push angle is more than this close to a full 180 degrees, trigger a skid. if (dang > ANGLE_157h) { - player->skidtime = TICRATE/2; + //player->skidtime = TICRATE/2; + player->skidtime = (FixedDiv(35<<(FRACBITS-1), FixedSqrt(player->mo->movefactor)))>>FRACBITS; S_StartSound(player->mo, sfx_skid); if (player->panim != PA_WALK) P_SetPlayerMobjState(player->mo, S_PLAY_WALK); @@ -6364,6 +6368,14 @@ static void P_MovePlayer(player_t *player) cmd = &player->cmd; runspd = FixedMul(player->runspeed, player->mo->scale); + // Let's have some movement speed fun on low-friction surfaces, JUST for players... (high friction surfaces shouldn't have any adjustment, since the acceleration in this game is super high and that ends up cheesing high-friction surfaces.) + player->mo->movefactor = FixedDiv(ORIG_FRICTION, player->mo->movefactor); + if (player->mo->movefactor < FRACUNIT) + player->mo->movefactor = 8*player->mo->movefactor - 7*FRACUNIT; + else + player->mo->movefactor = FRACUNIT; + runspd = FixedMul(runspd, player->mo->movefactor); + // Control relinquishing stuff! if (player->powers[pw_ingoop]) player->pflags |= PF_FULLSTASIS; @@ -6535,6 +6547,7 @@ static void P_MovePlayer(player_t *player) if (!player->mo->momx && !player->mo->momy && !player->mo->momz && player->panim == PA_WALK) P_SetPlayerMobjState(player->mo, S_PLAY_STND); + player->mo->movefactor = ORIG_FRICTION; // We're not going to do any more with this, so let's change it back for the next frame. ////////////////// //GAMEPLAY STUFF// From 52dd1c62c24649d9c68b4b95164cc339d463cf63 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 3 Jun 2016 18:01:24 +0100 Subject: [PATCH 048/808] Duplicated constant removal. --- src/p_mobj.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index ec418fb93..514952975 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1590,7 +1590,6 @@ void P_CheckGravity(mobj_t *mo, boolean affect) } #define STOPSPEED (FRACUNIT) -#define FRICTION (ORIG_FRICTION) // 0.90625 // // P_SceneryXYFriction @@ -1647,7 +1646,7 @@ static void P_XYFriction(mobj_t *mo, fixed_t oldx, fixed_t oldy) // spinning friction if (player->pflags & PF_SPINNING && (player->rmomx || player->rmomy) && !(player->pflags & PF_STARTDASH)) { - const fixed_t ns = FixedDiv(549*FRICTION,500*FRACUNIT); + const fixed_t ns = FixedDiv(549*ORIG_FRICTION,500*FRACUNIT); mo->momx = FixedMul(mo->momx, ns); mo->momy = FixedMul(mo->momy, ns); } From 6f291d667e0366285d992e599b7746654f7fbdeb Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 4 Jun 2016 18:59:24 +0100 Subject: [PATCH 049/808] Bustable blocks revamped. I'm on a roll! Linedef type 14 (Bustable block parameter) * Applied to one of the linedefs of any FOF's control sector * Concatenation of frontside textures is MT_ object type to spawn, defaults to MT_ROCKCRUMBLE1 if not present * Sound played when being busted is object type's activesound * Frontside x offset is spacing (in fracunits) of spawned particles, defaults to 32<sourceline; - if (SearchMarioNode(block->sector->touching_thinglist)) - sides[masterline->sidenum[0]].midtexture = sides[masterline->sidenum[0]].bottomtexture; - else - sides[masterline->sidenum[0]].midtexture = sides[masterline->sidenum[0]].toptexture; + if (!(masterline->flags & ML_NOCLIMB)) // Don't change the textures of a brick block, just a question block + { + if (SearchMarioNode(block->sector->touching_thinglist)) + sides[masterline->sidenum[0]].midtexture = sides[masterline->sidenum[0]].bottomtexture; + else + sides[masterline->sidenum[0]].midtexture = sides[masterline->sidenum[0]].toptexture; + } } // This is the Thwomp's 'brain'. It looks around for players nearby, and if @@ -2878,17 +2881,35 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) fixed_t leftx, rightx; fixed_t topy, bottomy; fixed_t topz; + fixed_t widthfactor, heightfactor; fixed_t a, b, c; mobjtype_t type = MT_ROCKCRUMBLE1; + fixed_t spacing = (32<master->frontsector->special, 3) >= 8) - type = MT_ROCKCRUMBLE1+(GETSECSPECIAL(rover->master->frontsector->special, 3)-7); +#define controlsec rover->master->frontsector + + for (i = 0; i < controlsec->linecount; i++) + { + if (controlsec->lines[i]->special == 14) // If we can use bustable block parameters, we will. + { + if (sides[controlsec->lines[i]->sidenum[0]].toptexture) + type = (mobjtype_t)sides[controlsec->lines[i]->sidenum[0]].toptexture; // Set as object type in p_setup.c... + if (sides[controlsec->lines[i]->sidenum[0]].textureoffset) + spacing = sides[controlsec->lines[i]->sidenum[0]].textureoffset; + if (sides[controlsec->lines[i]->sidenum[0]].rowoffset) + lifetime = (sides[controlsec->lines[i]->sidenum[0]].rowoffset>>FRACBITS); + flags = controlsec->lines[i]->flags; + break; // If someone has multiple parameter linedefs per control sector, TOUGH. + } + } + +#undef controlsec // soundorg z height never gets set normally, so MEH. sec->soundorg.z = sec->floorheight; - S_StartSound(&sec->soundorg, sfx_crumbl); + S_StartSound(&sec->soundorg, mobjinfo[type].activesound); // Find the outermost vertexes in the subsector for (i = 0; i < sec->linecount; i++) @@ -2907,23 +2928,32 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) bottommostvertex = i; } - leftx = sec->lines[leftmostvertex]->v1->x+(16<lines[leftmostvertex]->v1->x+(spacing>>1); rightx = sec->lines[rightmostvertex]->v1->x; - topy = sec->lines[topmostvertex]->v1->y-(16<lines[topmostvertex]->v1->y-(spacing>>1); bottomy = sec->lines[bottommostvertex]->v1->y; - topz = *rover->topheight-(16<topheight-(spacing>>1); - for (a = leftx; a < rightx; a += (32<>3; + heightfactor = (topz - *rover->bottomheight)>>2; + + for (a = leftx; a < rightx; a += spacing) { - for (b = topy; b > bottomy; b -= (32< bottomy; b -= spacing) { if (R_PointInSubsector(a, b)->sector == sec) { mobj_t *spawned = NULL; - for (c = topz; c > *rover->bottomheight; c -= (32< *rover->bottomheight; c -= spacing) { spawned = P_SpawnMobj(a, b, c, type); - spawned->fuse = 3*TICRATE; + if (flags & ML_EFFECT1) + { + P_InstaThrust(spawned, R_PointToAngle2(sec->soundorg.x, sec->soundorg.y, a, b), FixedDiv(P_AproxDistance(a - sec->soundorg.x, b - sec->soundorg.y), widthfactor)); + P_SetObjectMomZ(spawned, FixedDiv((c - *rover->bottomheight), heightfactor), false); + } + if (lifetime != -1) + spawned->fuse = lifetime; } } } diff --git a/src/p_mobj.c b/src/p_mobj.c index 514952975..80cbcb486 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3068,8 +3068,13 @@ nightsdone: if (rover->flags & FF_MARIO && !(mo->eflags & MFE_VERTICALFLIP) // if you were flipped, your head isn't actually hitting your ceilingz is it? && *rover->bottomheight == mo->ceilingz) // The player's head hit the bottom! + { // DO THE MARIO! - EV_MarioBlock(rover->master->frontsector, node->m_sector, *rover->topheight, mo); + if (rover->master->flags & ML_NOCLIMB) // Brick block! + EV_CrumbleChain(node->m_sector, rover); + else // Question block! + EV_MarioBlock(rover->master->frontsector, node->m_sector, *rover->topheight, mo); + } } } // Ugly ugly billions of braces! Argh! } diff --git a/src/p_setup.c b/src/p_setup.c index b36bf0b80..659c45ed8 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -1476,6 +1476,7 @@ static void P_LoadSideDefs2(lumpnum_t lumpnum) break; } + case 14: // Bustable block parameter case 425: // Calls P_SetMobjState on calling mobj case 434: // Custom Power case 442: // Calls P_SetMobjState on mobjs of a given type in the tagged sectors diff --git a/src/p_spec.c b/src/p_spec.c index d2ac5b6a9..0112d02a7 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3712,7 +3712,7 @@ DoneSection2: } break; - case 7: // Bustable block sprite parameter + case 7: // N/A (formerly bustable block sprite parameters) case 8: case 9: case 10: From 58d0d2d5e9c208108010a80414845c0ea47a5241 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 4 Jun 2016 19:39:15 +0100 Subject: [PATCH 050/808] Completely forgot P_FindSpecialLineFromTag was a thing. Now Linedef type 14 doesn't need to be in the same sector, but requires a tag... --- src/p_floor.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/p_floor.c b/src/p_floor.c index 18126f263..d86b567df 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -2890,18 +2890,18 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) #define controlsec rover->master->frontsector - for (i = 0; i < controlsec->linecount; i++) + if (controlsec->tag != 0) { - if (controlsec->lines[i]->special == 14) // If we can use bustable block parameters, we will. + size_t tagline = P_FindSpecialLineFromTag(14, controlsec->tag, -1); + if (tagline != -1) { - if (sides[controlsec->lines[i]->sidenum[0]].toptexture) - type = (mobjtype_t)sides[controlsec->lines[i]->sidenum[0]].toptexture; // Set as object type in p_setup.c... - if (sides[controlsec->lines[i]->sidenum[0]].textureoffset) - spacing = sides[controlsec->lines[i]->sidenum[0]].textureoffset; - if (sides[controlsec->lines[i]->sidenum[0]].rowoffset) - lifetime = (sides[controlsec->lines[i]->sidenum[0]].rowoffset>>FRACBITS); - flags = controlsec->lines[i]->flags; - break; // If someone has multiple parameter linedefs per control sector, TOUGH. + if (sides[lines[tagline].sidenum[0]].toptexture) + type = (mobjtype_t)sides[lines[tagline].sidenum[0]].toptexture; // Set as object type in p_setup.c... + if (sides[lines[tagline].sidenum[0]].textureoffset) + spacing = sides[lines[tagline].sidenum[0]].textureoffset; + if (sides[lines[tagline].sidenum[0]].rowoffset) + lifetime = (sides[lines[tagline].sidenum[0]].rowoffset>>FRACBITS); + flags = lines[tagline].flags; } } From 7c7a8413c9ee6b6c29cc59297d5073d96c1a803f Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 4 Jun 2016 20:02:11 +0100 Subject: [PATCH 051/808] Instead of hacking the existing Question Block thinker to ignore the object, let's just... not give the Brick Block a thinker in the first place. --- src/p_floor.c | 11 ++++------- src/p_spec.c | 3 ++- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/p_floor.c b/src/p_floor.c index d86b567df..0656458eb 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -1797,13 +1797,10 @@ static mobj_t *SearchMarioNode(msecnode_t *node) void T_MarioBlockChecker(levelspecthink_t *block) { line_t *masterline = block->sourceline; - if (!(masterline->flags & ML_NOCLIMB)) // Don't change the textures of a brick block, just a question block - { - if (SearchMarioNode(block->sector->touching_thinglist)) - sides[masterline->sidenum[0]].midtexture = sides[masterline->sidenum[0]].bottomtexture; - else - sides[masterline->sidenum[0]].midtexture = sides[masterline->sidenum[0]].toptexture; - } + if (SearchMarioNode(block->sector->touching_thinglist)) + sides[masterline->sidenum[0]].midtexture = sides[masterline->sidenum[0]].bottomtexture; + else + sides[masterline->sidenum[0]].midtexture = sides[masterline->sidenum[0]].toptexture; } // This is the Thwomp's 'brain'. It looks around for players nearby, and if diff --git a/src/p_spec.c b/src/p_spec.c index 0112d02a7..a4a069dd2 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4933,7 +4933,8 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f if ((flags & FF_MARIO)) { - P_AddBlockThinker(sec2, master); + if (!(master->flags & ML_NOCLIMB)) // Don't change the textures of a brick block, just a question block + P_AddBlockThinker(sec2, master); CheckForMarioBlocks = true; } From b688f5763b89a50bc1b80aae402b5f9052d5b009 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 4 Jun 2016 21:19:52 +0100 Subject: [PATCH 052/808] Particle randomisation added to bustable blocks. --- src/p_floor.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/p_floor.c b/src/p_floor.c index 0656458eb..c39a7b5b6 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -13,6 +13,7 @@ #include "doomdef.h" #include "doomstat.h" +#include "m_random.h" #include "p_local.h" #include "r_state.h" #include "s_sound.h" @@ -2944,6 +2945,12 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) for (c = topz; c > *rover->bottomheight; c -= spacing) { spawned = P_SpawnMobj(a, b, c, type); + + if (spawned->frame & FF_ANIMATE) + spawned->frame += P_RandomKey(spawned->state->var2); + + spawned->angle += P_RandomKey(36)*ANG1; // irrelevant for default objects but might make sense for some custom ones + if (flags & ML_EFFECT1) { P_InstaThrust(spawned, R_PointToAngle2(sec->soundorg.x, sec->soundorg.y, a, b), FixedDiv(P_AproxDistance(a - sec->soundorg.x, b - sec->soundorg.y), widthfactor)); From 7a3a293c96bdfd1f83cab89da4c649ea9c9e665b Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 4 Jun 2016 21:23:15 +0100 Subject: [PATCH 053/808] Woops, forgot the 0. Now it takes advantage of the full range. --- src/p_floor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_floor.c b/src/p_floor.c index c39a7b5b6..cde657a18 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -2949,7 +2949,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) if (spawned->frame & FF_ANIMATE) spawned->frame += P_RandomKey(spawned->state->var2); - spawned->angle += P_RandomKey(36)*ANG1; // irrelevant for default objects but might make sense for some custom ones + spawned->angle += P_RandomKey(36)*ANG10; // irrelevant for default objects but might make sense for some custom ones if (flags & ML_EFFECT1) { From 36da2e198d1116674d65fdf31f857ea65a008984 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 4 Jun 2016 22:08:51 +0100 Subject: [PATCH 054/808] At least this one wasn't my fault ( :P ) --- src/p_floor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_floor.c b/src/p_floor.c index cde657a18..01ae011ed 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -2947,7 +2947,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) spawned = P_SpawnMobj(a, b, c, type); if (spawned->frame & FF_ANIMATE) - spawned->frame += P_RandomKey(spawned->state->var2); + spawned->frame += P_RandomKey(spawned->state->var1); spawned->angle += P_RandomKey(36)*ANG10; // irrelevant for default objects but might make sense for some custom ones From bdbfa178e6f95b678ead5416fb38248a35c4d02b Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 4 Jun 2016 23:06:26 +0100 Subject: [PATCH 055/808] Compilation fixes. (Silly .o files sticking around...) --- src/p_floor.c | 13 +++++++++---- src/p_saveg.c | 2 -- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/p_floor.c b/src/p_floor.c index 01ae011ed..48d62f6f2 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -2890,7 +2890,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) if (controlsec->tag != 0) { - size_t tagline = P_FindSpecialLineFromTag(14, controlsec->tag, -1); + INT32 tagline = P_FindSpecialLineFromTag(14, controlsec->tag, -1); if (tagline != -1) { if (sides[lines[tagline].sidenum[0]].toptexture) @@ -2898,7 +2898,12 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) if (sides[lines[tagline].sidenum[0]].textureoffset) spacing = sides[lines[tagline].sidenum[0]].textureoffset; if (sides[lines[tagline].sidenum[0]].rowoffset) - lifetime = (sides[lines[tagline].sidenum[0]].rowoffset>>FRACBITS); + { + if (sides[lines[tagline].sidenum[0]].rowoffset>>FRACBITS == -1) + lifetime = (sides[lines[tagline].sidenum[0]].rowoffset>>FRACBITS); + else + lifetime = 0; + } flags = lines[tagline].flags; } } @@ -2956,8 +2961,8 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) P_InstaThrust(spawned, R_PointToAngle2(sec->soundorg.x, sec->soundorg.y, a, b), FixedDiv(P_AproxDistance(a - sec->soundorg.x, b - sec->soundorg.y), widthfactor)); P_SetObjectMomZ(spawned, FixedDiv((c - *rover->bottomheight), heightfactor), false); } - if (lifetime != -1) - spawned->fuse = lifetime; + + spawned->fuse = lifetime; } } } diff --git a/src/p_saveg.c b/src/p_saveg.c index 48f283bd3..c99e15cfb 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -1434,7 +1434,6 @@ static inline void SaveFrictionThinker(const thinker_t *th, const UINT8 type) const friction_t *ht = (const void *)th; WRITEUINT8(save_p, type); WRITEINT32(save_p, ht->friction); - WRITEINT32(save_p, ht->movefactor); WRITEINT32(save_p, ht->affectee); WRITEINT32(save_p, ht->referrer); WRITEUINT8(save_p, ht->roverfriction); @@ -2369,7 +2368,6 @@ static inline void LoadFrictionThinker(actionf_p1 thinker) friction_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL); ht->thinker.function.acp1 = thinker; ht->friction = READINT32(save_p); - ht->movefactor = READINT32(save_p); ht->affectee = READINT32(save_p); ht->referrer = READINT32(save_p); ht->roverfriction = READUINT8(save_p); From 482c1ce66556f4d7bea0b1f4b9b666e0bbd6a76e Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 5 Jun 2016 00:23:20 +0100 Subject: [PATCH 056/808] Speed pads are now nicer. Linedef type 4 now works as follows. * Frontside x offset is dash speed. * Effect 4 flag doesn't center the player. (same as before) * Effect 5 flag sends them off in rolling frames. (as a result there is only one speed pad sector type now, not two) * Frontside upper texture is sound to play on launch, defaults to sfx_spdpad when not given --- src/p_setup.c | 4 +++- src/p_spec.c | 46 +++++++++++++++++++++++++++++----------------- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index 659c45ed8..cfcc7d405 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -1463,6 +1463,8 @@ static void P_LoadSideDefs2(lumpnum_t lumpnum) sd->text[6] = 0; break; } + + case 4: // Speed pad parameters case 414: // Play SFX { sd->toptexture = sd->midtexture = sd->bottomtexture = 0; @@ -1476,7 +1478,7 @@ static void P_LoadSideDefs2(lumpnum_t lumpnum) break; } - case 14: // Bustable block parameter + case 14: // Bustable block parameters case 425: // Calls P_SetMobjState on calling mobj case 434: // Custom Power case 442: // Calls P_SetMobjState on mobjs of a given type in the tagged sectors diff --git a/src/p_spec.c b/src/p_spec.c index a4a069dd2..1536b3c46 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2415,7 +2415,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) { fixed_t sfxnum; - sfxnum = sides[line->sidenum[0]].toptexture; //P_AproxDistance(line->dx, line->dy)>>FRACBITS; + sfxnum = sides[line->sidenum[0]].toptexture; if (line->tag != 0 && line->flags & ML_EFFECT5) { @@ -3650,14 +3650,13 @@ DoneSection2: // Process Section 3 switch (special) { - case 1: // N/A (formerly Ice/Sludge) + case 1: // Unused case 2: // Wind/Current - case 3: // N/A (formerly Ice/Sludge and Wind/Current) + case 3: // Unused case 4: // Conveyor Belt break; - case 5: // Speed pad w/o spin - case 6: // Speed pad w/ spin + case 5: // Speed pad if (player->powers[pw_flashing] != 0 && player->powers[pw_flashing] < TICRATE/2) break; @@ -3669,7 +3668,13 @@ DoneSection2: fixed_t linespeed; lineangle = R_PointToAngle2(lines[i].v1->x, lines[i].v1->y, lines[i].v2->x, lines[i].v2->y); - linespeed = P_AproxDistance(lines[i].v2->x-lines[i].v1->x, lines[i].v2->y-lines[i].v1->y); + linespeed = sides[lines[i].sidenum[0]].textureoffset; + + if (linespeed == 0) + { + CONS_Debug(DBG_GAMELOGIC, "ERROR: Speed pad (tag %d) at zero speed.\n", sector->tag); + break; + } player->mo->angle = lineangle; @@ -3699,7 +3704,7 @@ DoneSection2: P_InstaThrust(player->mo, player->mo->angle, linespeed); - if (GETSECSPECIAL(sector->special, 3) == 6 && (player->charability2 == CA2_SPINDASH)) + if ((lines[i].flags & ML_EFFECT5) && (player->charability2 == CA2_SPINDASH)) // Roll! { if (!(player->pflags & PF_SPINNING)) player->pflags |= PF_SPINNING; @@ -3708,19 +3713,26 @@ DoneSection2: } player->powers[pw_flashing] = TICRATE/3; - S_StartSound(player->mo, sfx_spdpad); + + fixed_t sfxnum = sides[lines[i].sidenum[0]].toptexture; + + if (!sfxnum) + sfxnum = sfx_spdpad; + + S_StartSound(player->mo, sfxnum); } break; - case 7: // N/A (formerly bustable block sprite parameters) - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: + case 6: // Unused + case 7: // Unused + case 8: // Unused + case 9: // Unused + case 10: // Unused + case 11: // Unused + case 12: // Unused + case 13: // Unused + case 14: // Unused + case 15: // Unused break; } From 94e4d3ddbf9396d95d0a79a265cd8b920b14c2cc Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 5 Jun 2016 01:26:02 +0100 Subject: [PATCH 057/808] Good eye, MI. --- src/p_floor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_floor.c b/src/p_floor.c index 48d62f6f2..9c6580970 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -2899,7 +2899,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) spacing = sides[lines[tagline].sidenum[0]].textureoffset; if (sides[lines[tagline].sidenum[0]].rowoffset) { - if (sides[lines[tagline].sidenum[0]].rowoffset>>FRACBITS == -1) + if (sides[lines[tagline].sidenum[0]].rowoffset>>FRACBITS != -1) lifetime = (sides[lines[tagline].sidenum[0]].rowoffset>>FRACBITS); else lifetime = 0; From 76a3c1687c9dbbd614b132324c54e269750baf3c Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 5 Jun 2016 02:20:26 +0100 Subject: [PATCH 058/808] Noticed an assymetry in the Zoom Tube code. I assume the forward-going zoom tube's cancelling of gliding and climbing solved some bug, so I'm mirroring it for the backwards version. --- src/p_spec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/p_spec.c b/src/p_spec.c index 1536b3c46..118e319ed 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4027,6 +4027,8 @@ DoneSection2: player->speed = speed; player->pflags |= PF_SPINNING; player->pflags &= ~PF_JUMPED; + player->pflags &= ~PF_GLIDING; + player->climbing = 0; if (player->mo->state-states != S_PLAY_SPIN) { From 2ffc06c0bc9eb3f5d3604d15bf076678fd3b69cd Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 6 Jun 2016 00:00:31 +0100 Subject: [PATCH 059/808] Fan particle generators now suck less! For the object... * Tag via its angle field * Number of objects to spawn per tic around it via its z field, if zero then just spawn at center * Is flipped if given MTF_OBJECTFLIP. Now there's a linedef type 15! * Tag is tag of object(s!) * Object type set via concatenation of frontside textures, MT_PARTICLE is default * The length of the linedef is the radius the particle is spawned out (zeroed if z field is 0) * Frontside x offset is speed upwards * Frontside y offset is number of degrees to turn each tic (zeroed if z field is 0) * Frontside floor and ceiling heights are the heights in which the particle is bound through some fun mathematics and/or BDSM Of course, not every story has a happy ending. * A_ParticleSpawn no longer accepts objects via its var1 because of how specialised it's gotten. Considering it can be set via abuse of actor->cvmem, I don't consider this an issue. Maybe you might disagree. --- src/p_enemy.c | 48 +++++++++++++++++-------------- src/p_mobj.c | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/p_setup.c | 1 + 3 files changed, 106 insertions(+), 22 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 4e11dc494..fc46f697a 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3359,41 +3359,45 @@ void A_ScoreRise(mobj_t *actor) // Function: A_ParticleSpawn // -// Description: Spawns a particle at a specified interval +// Description: Hyper-specialised function for spawning a particle for MT_PARTICLEGEN. // -// var1 = type (if 0, defaults to MT_PARTICLE) +// var1 = unused // var2 = unused // void A_ParticleSpawn(mobj_t *actor) { - INT32 locvar1 = var1; - fixed_t speed; - mobjtype_t type; + INT32 i = 0; mobj_t *spawn; #ifdef HAVE_BLUA if (LUA_CallAction("A_ParticleSpawn", actor)) return; #endif - if (!actor->spawnpoint) - { - P_RemoveMobj(actor); + if (!actor->health) return; + + if ((actor->lastlook) && (actor->cvmem)) + { + for (i = 0; i < actor->lastlook; i++) + { + spawn = P_SpawnMobj(actor->x + FixedMul(actor->friction, FINECOSINE(actor->angle>>ANGLETOFINESHIFT)), + actor->y + FixedMul(actor->friction, FINESINE(actor->angle>>ANGLETOFINESHIFT)), + actor->z, + (mobjtype_t)actor->cvmem); + P_SetScale(spawn, actor->scale); + spawn->momz = actor->movefactor; + spawn->destscale = spawn->scale/100; + spawn->scalespeed = spawn->scale/actor->health; + spawn->tics = (tic_t)actor->health; + spawn->flags2 |= (actor->flags2 & MF2_OBJECTFLIP); + spawn->angle += P_RandomKey(36)*ANG10; // irrelevant for default objects but might make sense for some custom ones + if (spawn->frame & FF_ANIMATE) + spawn->frame += P_RandomKey(spawn->state->var1); + + actor->angle += actor->movedir; + } + actor->angle += (angle_t)actor->movecount; } - - if (locvar1) - type = (mobjtype_t)locvar1; - else - type = MT_PARTICLE; - - speed = FixedMul((actor->spawnpoint->angle >> 12)<scale); - - spawn = P_SpawnMobj(actor->x, actor->y, actor->z, type); - P_SetScale(spawn, actor->scale); - spawn->momz = speed; - spawn->destscale = FixedDiv(spawn->scale<scalespeed = FixedDiv(((actor->spawnpoint->angle >> 8) & 63) << FRACBITS, 100<tics = actor->spawnpoint->extrainfo + 1; } // Function: A_BunnyHop diff --git a/src/p_mobj.c b/src/p_mobj.c index 3e87130b0..df136edd6 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9303,6 +9303,85 @@ ML_NOCLIMB : Direction not controllable } break; } + case MT_PARTICLEGEN: + { + fixed_t radius, speed, bottomheight, topheight; + INT32 type, numdivisions, time, anglespeed; + angle_t angledivision; + size_t line; + const size_t mthingi = (size_t)(mthing - mapthings); + + for (line = 0; line < numlines; line++) + { + if (lines[line].special == 15 && lines[line].tag == mthing->angle) + break; + } + + if (line == numlines) + { + CONS_Debug(DBG_GAMELOGIC, "Particle generator (mapthing #%s) needs tagged to a #15 parameter line (trying to find tag %d).\n", sizeu1(mthingi), mthing->angle); + return; + } + + if (sides[lines[line].sidenum[0]].toptexture) + type = sides[lines[line].sidenum[0]].toptexture; // Set as object type in p_setup.c... + else + type = (INT32)MT_PARTICLE; + + speed = abs(sides[lines[line].sidenum[0]].textureoffset); + bottomheight = lines[line].frontsector->floorheight; + topheight = lines[line].frontsector->ceilingheight - mobjinfo[(mobjtype_t)type].height; + + numdivisions = (mthing->options >> ZSHIFT); + + if (numdivisions) + { + radius = R_PointToDist2(lines[line].v1->x, lines[line].v1->y, lines[line].v2->x, lines[line].v2->y); + anglespeed = (sides[lines[line].sidenum[0]].rowoffset >> FRACBITS) % 360; + angledivision = 360/numdivisions; + } + else + { + numdivisions = 1; // Simple trick to make A_ParticleSpawn simpler. + radius = 0; + anglespeed = 0; + angledivision = 0; + } + + if ((speed) && (topheight > bottomheight)) + time = (INT32)(FixedDiv((topheight - bottomheight), speed) >> FRACBITS); + else + time = 1; // There's no reasonable way to set it, so just show the object for one tic and move on. + + if (mthing->options & MTF_OBJECTFLIP) + { + mobj->z = topheight; + speed *= -1; + } + else + mobj->z = bottomheight; + + CONS_Debug(DBG_GAMELOGIC, "Particle Generator (mapthing #%s):\n" + "Radius is %d\n" + "Speed is %d\n" + "Anglespeed is %d\n" + "Numdivisions is %d\n" + "Angledivision is %d\n" + "Time is %d\n" + "Type is %d\n", + sizeu1(mthingi), radius, speed, anglespeed, numdivisions, angledivision, time, type); + + mobj->angle = 0; + mobj->movefactor = speed; + mobj->lastlook = numdivisions; + mobj->movedir = angledivision*ANG1; + mobj->movecount = anglespeed*ANG1; + mobj->health = time; + mobj->friction = radius; + mobj->cvmem = type; + + break; + } case MT_ROCKSPAWNER: mobj->threshold = mthing->angle; mobj->movecount = mthing->extrainfo; diff --git a/src/p_setup.c b/src/p_setup.c index cfcc7d405..50df019ef 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -1479,6 +1479,7 @@ static void P_LoadSideDefs2(lumpnum_t lumpnum) } case 14: // Bustable block parameters + case 15: // Fan particle spawner parameters case 425: // Calls P_SetMobjState on calling mobj case 434: // Custom Power case 442: // Calls P_SetMobjState on mobjs of a given type in the tagged sectors From 4b385eb7ebf1a404688e96e979f4546464ad03bd Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 6 Jun 2016 00:36:47 +0100 Subject: [PATCH 060/808] Forgot to take scale into account consistently. --- src/p_enemy.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index fc46f697a..75a6b4e15 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3380,12 +3380,13 @@ void A_ParticleSpawn(mobj_t *actor) { for (i = 0; i < actor->lastlook; i++) { - spawn = P_SpawnMobj(actor->x + FixedMul(actor->friction, FINECOSINE(actor->angle>>ANGLETOFINESHIFT)), - actor->y + FixedMul(actor->friction, FINESINE(actor->angle>>ANGLETOFINESHIFT)), + spawn = P_SpawnMobj( + actor->x + FixedMul(FixedMul(actor->friction, actor->scale), FINECOSINE(actor->angle>>ANGLETOFINESHIFT)), + actor->y + FixedMul(FixedMul(actor->friction, actor->scale), FINESINE(actor->angle>>ANGLETOFINESHIFT)), actor->z, (mobjtype_t)actor->cvmem); P_SetScale(spawn, actor->scale); - spawn->momz = actor->movefactor; + spawn->momz = FixedMul(actor->movefactor, spawn->scale); spawn->destscale = spawn->scale/100; spawn->scalespeed = spawn->scale/actor->health; spawn->tics = (tic_t)actor->health; From 316cb9c24f55b6041846958511049261742b36c0 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 6 Jun 2016 02:17:48 +0100 Subject: [PATCH 061/808] cvmem -> threshold, on MI's reccomendation (I NEVER SLEEP) --- src/p_enemy.c | 4 ++-- src/p_mobj.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 75a6b4e15..ed05b43d9 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3376,7 +3376,7 @@ void A_ParticleSpawn(mobj_t *actor) if (!actor->health) return; - if ((actor->lastlook) && (actor->cvmem)) + if ((actor->lastlook) && (actor->threshold)) { for (i = 0; i < actor->lastlook; i++) { @@ -3384,7 +3384,7 @@ void A_ParticleSpawn(mobj_t *actor) actor->x + FixedMul(FixedMul(actor->friction, actor->scale), FINECOSINE(actor->angle>>ANGLETOFINESHIFT)), actor->y + FixedMul(FixedMul(actor->friction, actor->scale), FINESINE(actor->angle>>ANGLETOFINESHIFT)), actor->z, - (mobjtype_t)actor->cvmem); + (mobjtype_t)actor->threshold); P_SetScale(spawn, actor->scale); spawn->momz = FixedMul(actor->movefactor, spawn->scale); spawn->destscale = spawn->scale/100; diff --git a/src/p_mobj.c b/src/p_mobj.c index df136edd6..6e7e0ad20 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9378,7 +9378,7 @@ ML_NOCLIMB : Direction not controllable mobj->movecount = anglespeed*ANG1; mobj->health = time; mobj->friction = radius; - mobj->cvmem = type; + mobj->threshold = type; break; } From 356dd0323447abb61aa2d1d7c506deb2ee25ae5a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 6 Jun 2016 18:30:58 +0100 Subject: [PATCH 062/808] Mario block improvements. (I JUST CAN'T STOP) * Only change texture when stationary or moving down, for additional fidelity to source material. This has zero overhead, and actually might REDUCE lag in some circumstances... my nitpickiness wins again. * Apply ML_EFFECT1 to it to make it invisible and intangible (removing (FF_SOLID|FF_RENDERALL|FF_CUTLEVEL) from it) from every side except the bottom. Becomes visible and tangible when it's hit once. Might fuck over players in mp, but really our Mario blocks are so high in the air (and we'd need to update Pipe Towers to take advantage anyways) that they're super unlikely to get a kill this way * Checks for the Brick Block have been switched over to the presence of FF_SHATTERBOTTOM instead of checking for the source linedef's flags every time. --- src/p_floor.c | 33 ++++++++++++++++---------- src/p_mobj.c | 19 +++++++++------ src/p_spec.c | 64 +++++++++++++++++++++++---------------------------- src/p_spec.h | 2 +- 4 files changed, 63 insertions(+), 55 deletions(-) diff --git a/src/p_floor.c b/src/p_floor.c index 9c6580970..0e7f52376 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -1132,7 +1132,10 @@ void T_MarioBlock(levelspecthink_t *block) ); if (block->sector->ceilingheight >= block->ceilingwasheight + 32*FRACUNIT) // Go back down now.. + { block->direction = -block->direction; + block->sector->floorspeed = 0; + } else if (block->sector->ceilingheight <= block->ceilingwasheight) { block->sector->ceilingheight = block->ceilingwasheight; @@ -1140,8 +1143,6 @@ void T_MarioBlock(levelspecthink_t *block) P_RemoveThinker(&block->thinker); block->sector->floordata = NULL; block->sector->ceilingdata = NULL; - block->sector->floorspeed = 0; - block->sector->ceilspeed = 0; } for (i = -1; (i = P_FindSectorFromTag((INT16)block->vars[0], i)) >= 0 ;) @@ -1797,6 +1798,8 @@ static mobj_t *SearchMarioNode(msecnode_t *node) void T_MarioBlockChecker(levelspecthink_t *block) { + if (block->sector->floorspeed) // Don't update the textures when the block's being bumped upwards. + return; line_t *masterline = block->sourceline; if (SearchMarioNode(block->sector->touching_thinglist)) sides[masterline->sidenum[0]].midtexture = sides[masterline->sidenum[0]].bottomtexture; @@ -3122,8 +3125,10 @@ INT32 EV_StartCrumble(sector_t *sec, ffloor_t *rover, boolean floating, return 1; } -INT32 EV_MarioBlock(sector_t *sec, sector_t *roversector, fixed_t topheight, mobj_t *puncher) +INT32 EV_MarioBlock(ffloor_t *rover, sector_t *sector, mobj_t *puncher) { + sector_t *roversec = rover->master->frontsector; + fixed_t topheight = *rover->topheight; levelspecthink_t *block; mobj_t *thing; fixed_t oldx = 0, oldy = 0, oldz = 0; @@ -3131,11 +3136,14 @@ INT32 EV_MarioBlock(sector_t *sec, sector_t *roversector, fixed_t topheight, mob I_Assert(puncher != NULL); I_Assert(puncher->player != NULL); - if (sec->floordata || sec->ceilingdata) + if (roversec->floordata || roversec->ceilingdata) return 0; + if (!(rover->flags & FF_SOLID)) + rover->flags |= (FF_SOLID|FF_RENDERALL|FF_CUTLEVEL); + // Find an item to pop out! - thing = SearchMarioNode(sec->touching_thinglist); + thing = SearchMarioNode(roversec->touching_thinglist); // Found something! if (thing) @@ -3145,13 +3153,14 @@ INT32 EV_MarioBlock(sector_t *sec, sector_t *roversector, fixed_t topheight, mob block = Z_Calloc(sizeof (*block), PU_LEVSPEC, NULL); P_AddThinker(&block->thinker); - sec->floordata = block; - sec->ceilingdata = block; + roversec->floordata = block; + roversec->ceilingdata = block; block->thinker.function.acp1 = (actionf_p1)T_MarioBlock; // Set up the fields - block->sector = sec; - block->vars[0] = roversector->tag; // actionsector + roversec->floorspeed = 1; // Flag to prevent side changing. + block->sector = roversec; + block->vars[0] = sector->tag; // actionsector block->vars[1] = 4*FRACUNIT; // speed block->vars[2] = 1; // Up // direction block->vars[3] = block->sector->floorheight; // floorwasheight @@ -3167,8 +3176,8 @@ INT32 EV_MarioBlock(sector_t *sec, sector_t *roversector, fixed_t topheight, mob } P_UnsetThingPosition(thing); - thing->x = roversector->soundorg.x; - thing->y = roversector->soundorg.y; + thing->x = sector->soundorg.x; + thing->y = sector->soundorg.y; thing->z = topheight; thing->momz = FixedMul(6*FRACUNIT, thing->scale); P_SetThingPosition(thing); @@ -3185,7 +3194,7 @@ INT32 EV_MarioBlock(sector_t *sec, sector_t *roversector, fixed_t topheight, mob { if (thing->type == MT_EMMY && thing->spawnpoint && (thing->spawnpoint->options & MTF_OBJECTSPECIAL)) { - mobj_t *tokenobj = P_SpawnMobj(roversector->soundorg.x, roversector->soundorg.y, topheight, MT_TOKEN); + mobj_t *tokenobj = P_SpawnMobj(sector->soundorg.x, sector->soundorg.y, topheight, MT_TOKEN); P_SetTarget(&thing->tracer, tokenobj); P_SetTarget(&tokenobj->target, thing); P_SetMobjState(tokenobj, mobjinfo[MT_TOKEN].seestate); diff --git a/src/p_mobj.c b/src/p_mobj.c index 6e7e0ad20..f1d164930 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2154,14 +2154,16 @@ static void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motyp topheight = P_GetFOFTopZ(mo, sector, rover, mo->x, mo->y, NULL); bottomheight = P_GetFOFBottomZ(mo, sector, rover, mo->x, mo->y, NULL); - if (mo->player && (P_CheckSolidLava(mo, rover) || P_CanRunOnWater(mo->player, rover))) // only the player should be affected + if (mo->player && (P_CheckSolidLava(mo, rover) || P_CanRunOnWater(mo->player, rover))) // only the player should stand on lava or run on water ; else if (motype != 0 && rover->flags & FF_SWIMMABLE) // "scenery" only continue; else if (rover->flags & FF_QUICKSAND) // quicksand ; - else if (!((rover->flags & FF_BLOCKPLAYER && mo->player) // solid to players? - || (rover->flags & FF_BLOCKOTHERS && !mo->player))) // solid to others? + else if (!( // if it's not either of the following... + (rover->flags & (FF_BLOCKPLAYER|FF_MARIO) && mo->player) // ...solid to players? (mario blocks are always solid from beneath to players) + || (rover->flags & FF_BLOCKOTHERS && !mo->player) // ...solid to others? + )) // ...don't take it into account. continue; if (rover->flags & FF_QUICKSAND) { @@ -2186,13 +2188,16 @@ static void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motyp delta1 = mo->z - (bottomheight + ((topheight - bottomheight)/2)); delta2 = thingtop - (bottomheight + ((topheight - bottomheight)/2)); + if (topheight > mo->floorz && abs(delta1) < abs(delta2) - && !(rover->flags & FF_REVERSEPLATFORM)) + && !(rover->flags & FF_REVERSEPLATFORM) + && (rover->flags & FF_SOLID)) // Non-FF_SOLID Mario blocks are only solid from bottom { mo->floorz = topheight; } if (bottomheight < mo->ceilingz && abs(delta1) >= abs(delta2) - && !(rover->flags & FF_PLATFORM)) + && !(rover->flags & FF_PLATFORM) + && ((mo->momz > 0) || ((rover->flags & FF_SOLID) && !(rover->flags & FF_REVERSEPLATFORM)))) // Only clip for FOFs that are intangible from the top if you're coming from below { mo->ceilingz = bottomheight; } @@ -3070,10 +3075,10 @@ nightsdone: && *rover->bottomheight == mo->ceilingz) // The player's head hit the bottom! { // DO THE MARIO! - if (rover->master->flags & ML_NOCLIMB) // Brick block! + if (rover->flags & FF_SHATTERBOTTOM) // Brick block! EV_CrumbleChain(node->m_sector, rover); else // Question block! - EV_MarioBlock(rover->master->frontsector, node->m_sector, *rover->topheight, mo); + EV_MarioBlock(rover, node->m_sector, mo); } } } // Ugly ugly billions of braces! Argh! diff --git a/src/p_spec.c b/src/p_spec.c index 493a692e2..7d77a66ed 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -5793,11 +5793,8 @@ void P_SpawnSpecials(INT32 fromnetsave) // Draw the 'insides' of the block too if (lines[i].flags & ML_NOCLIMB) { - ffloorflags |= FF_CUTLEVEL; - ffloorflags |= FF_BOTHPLANES; - ffloorflags |= FF_ALLSIDES; - ffloorflags &= ~FF_EXTRA; - ffloorflags &= ~FF_CUTEXTRA; + ffloorflags |= FF_CUTLEVEL|FF_BOTHPLANES|FF_ALLSIDES; + ffloorflags &= ~(FF_EXTRA|FF_CUTEXTRA); } P_AddFakeFloorsByLine(i, ffloorflags, secthinkers); @@ -5904,11 +5901,8 @@ void P_SpawnSpecials(INT32 fromnetsave) // Draw the 'insides' of the block too if (lines[i].flags & ML_EFFECT2) { - ffloorflags |= FF_CUTLEVEL; - ffloorflags |= FF_BOTHPLANES; - ffloorflags |= FF_ALLSIDES; - ffloorflags &= ~FF_EXTRA; - ffloorflags &= ~FF_CUTEXTRA; + ffloorflags |= FF_CUTLEVEL|FF_BOTHPLANES|FF_ALLSIDES; + ffloorflags &= ~(FF_EXTRA|FF_CUTEXTRA); } P_AddFakeFloorsByLine(i, ffloorflags, secthinkers); @@ -5922,11 +5916,8 @@ void P_SpawnSpecials(INT32 fromnetsave) // Draw the 'insides' of the block too if (lines[i].flags & ML_EFFECT2) { - ffloorflags |= FF_CUTLEVEL; - ffloorflags |= FF_BOTHPLANES; - ffloorflags |= FF_ALLSIDES; - ffloorflags &= ~FF_EXTRA; - ffloorflags &= ~FF_CUTEXTRA; + ffloorflags |= FF_CUTLEVEL|FF_BOTHPLANES|FF_ALLSIDES; + ffloorflags &= ~(FF_EXTRA|FF_CUTEXTRA); } P_AddFakeFloorsByLine(i, ffloorflags, secthinkers); @@ -5950,11 +5941,8 @@ void P_SpawnSpecials(INT32 fromnetsave) // Draw the 'insides' of the block too if (lines[i].flags & ML_EFFECT2) { - ffloorflags |= FF_CUTLEVEL; - ffloorflags |= FF_BOTHPLANES; - ffloorflags |= FF_ALLSIDES; - ffloorflags &= ~FF_EXTRA; - ffloorflags &= ~FF_CUTEXTRA; + ffloorflags |= FF_CUTLEVEL|FF_BOTHPLANES|FF_ALLSIDES; + ffloorflags &= ~(FF_EXTRA|FF_CUTEXTRA); } P_AddFakeFloorsByLine(i, ffloorflags, secthinkers); @@ -5968,11 +5956,8 @@ void P_SpawnSpecials(INT32 fromnetsave) // Draw the 'insides' of the block too if (lines[i].flags & ML_EFFECT2) { - ffloorflags |= FF_CUTLEVEL; - ffloorflags |= FF_BOTHPLANES; - ffloorflags |= FF_ALLSIDES; - ffloorflags &= ~FF_EXTRA; - ffloorflags &= ~FF_CUTEXTRA; + ffloorflags |= FF_CUTLEVEL|FF_BOTHPLANES|FF_ALLSIDES; + ffloorflags &= ~(FF_EXTRA|FF_CUTEXTRA); } P_AddFakeFloorsByLine(i, ffloorflags, secthinkers); @@ -6150,7 +6135,13 @@ void P_SpawnSpecials(INT32 fromnetsave) break; case 250: // Mario Block - P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL|FF_MARIO, secthinkers); + ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_CUTLEVEL|FF_MARIO; + if (lines[i].flags & ML_NOCLIMB) + ffloorflags |= FF_SHATTERBOTTOM; + if (lines[i].flags & ML_EFFECT1) + ffloorflags &= ~(FF_SOLID|FF_RENDERALL|FF_CUTLEVEL); + + P_AddFakeFloorsByLine(i, ffloorflags, secthinkers); break; case 251: // A THWOMP! @@ -6164,10 +6155,11 @@ void P_SpawnSpecials(INT32 fromnetsave) break; case 252: // Shatter block (breaks when touched) + ffloorflags = FF_EXISTS|FF_RENDERALL|FF_BUSTUP|FF_SHATTER; if (lines[i].flags & ML_NOCLIMB) - P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_BUSTUP|FF_SHATTER|FF_SHATTERBOTTOM, secthinkers); - else - P_AddFakeFloorsByLine(i, FF_EXISTS|FF_RENDERALL|FF_BUSTUP|FF_SHATTER, secthinkers); + ffloorflags |= FF_SOLID|FF_SHATTERBOTTOM; + + P_AddFakeFloorsByLine(i, ffloorflags, secthinkers); break; case 253: // Translucent shatter block (see 76) @@ -6175,10 +6167,11 @@ void P_SpawnSpecials(INT32 fromnetsave) break; case 254: // Bustable block + ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_BUSTUP; if (lines[i].flags & ML_NOCLIMB) - P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_BUSTUP|FF_ONLYKNUX, secthinkers); - else - P_AddFakeFloorsByLine(i, FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_BUSTUP, secthinkers); + ffloorflags |= FF_ONLYKNUX; + + P_AddFakeFloorsByLine(i, ffloorflags, secthinkers); break; case 255: // Spin bust block (breaks when jumped or spun downwards onto) @@ -6190,10 +6183,11 @@ void P_SpawnSpecials(INT32 fromnetsave) break; case 257: // Quicksand + ffloorflags = FF_EXISTS|FF_QUICKSAND|FF_RENDERALL|FF_ALLSIDES|FF_CUTSPRITES; if (lines[i].flags & ML_EFFECT5) - P_AddFakeFloorsByLine(i, FF_EXISTS|FF_QUICKSAND|FF_RENDERALL|FF_ALLSIDES|FF_CUTSPRITES|FF_RIPPLE, secthinkers); - else - P_AddFakeFloorsByLine(i, FF_EXISTS|FF_QUICKSAND|FF_RENDERALL|FF_ALLSIDES|FF_CUTSPRITES, secthinkers); + ffloorflags |= FF_RIPPLE; + + P_AddFakeFloorsByLine(i, ffloorflags, secthinkers); break; case 258: // Laser block diff --git a/src/p_spec.h b/src/p_spec.h index b90764f61..b38500288 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -323,7 +323,7 @@ INT32 EV_StartCrumble(sector_t *sector, ffloor_t *rover, INT32 EV_DoContinuousFall(sector_t *sec, sector_t *pbacksector, fixed_t spd, boolean backwards); -INT32 EV_MarioBlock(sector_t *sector, sector_t *roversector, fixed_t topheight, mobj_t *puncher); +INT32 EV_MarioBlock(ffloor_t *rover, sector_t *sector, mobj_t *puncher); void T_MoveFloor(floormove_t *movefloor); From 8e2212bb48fe91b7899c1e3c70b0f9c1937ef07b Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 6 Jun 2016 19:02:08 +0100 Subject: [PATCH 063/808] One more Mario block change. If FOF linedef has backside: * If there's items in it set the FOF's floor and ceiling flats to that of the backside sector's ceiling * Otherwise, set them to that of the backside sector's floor. Otherwise, the flats do not change. This allows for SMW style blocks which are much darker when empty then full on all sides. --- src/p_floor.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/p_floor.c b/src/p_floor.c index 0e7f52376..4ddba60bc 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -1802,9 +1802,21 @@ void T_MarioBlockChecker(levelspecthink_t *block) return; line_t *masterline = block->sourceline; if (SearchMarioNode(block->sector->touching_thinglist)) - sides[masterline->sidenum[0]].midtexture = sides[masterline->sidenum[0]].bottomtexture; + { + sides[masterline->sidenum[0]].midtexture = sides[masterline->sidenum[0]].bottomtexture; // Update textures + if (masterline->sidenum[1]) + { + sides[masterline->sidenum[0]].sector->ceilingpic = sides[masterline->sidenum[0]].sector->floorpic = sides[masterline->sidenum[1]].sector->ceilingpic; // Update flats to be backside's ceiling if there's a back sector, otherwise leave them alone + } + } else + { sides[masterline->sidenum[0]].midtexture = sides[masterline->sidenum[0]].toptexture; + if (masterline->sidenum[1]) + { + sides[masterline->sidenum[0]].sector->ceilingpic = sides[masterline->sidenum[0]].sector->floorpic = sides[masterline->sidenum[1]].sector->floorpic; // Update flats to be backside's floor if there's a back sector, otherwise leave them alone + } + } } // This is the Thwomp's 'brain'. It looks around for players nearby, and if From 7f3f46860b9c948b5f30043b12dcdd4063c8c834 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 6 Jun 2016 20:57:50 +0100 Subject: [PATCH 064/808] Forward-port of the fix to the backwards port. --- src/p_mobj.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index f1d164930..b86185ee4 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2191,13 +2191,14 @@ static void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motyp if (topheight > mo->floorz && abs(delta1) < abs(delta2) && !(rover->flags & FF_REVERSEPLATFORM) - && (rover->flags & FF_SOLID)) // Non-FF_SOLID Mario blocks are only solid from bottom + && (rover->flags & FF_SOLID) // Non-FF_SOLID Mario blocks are only solid from bottom + && ((P_MobjFlip(mo)*mo->momz < 0) || (!(rover->flags & FF_PLATFORM)))) // In reverse gravity, only clip for FOFs that are intangible from their bottom (the "top" you're falling through) if you're coming from above ("below" in your frame of reference) { mo->floorz = topheight; } if (bottomheight < mo->ceilingz && abs(delta1) >= abs(delta2) && !(rover->flags & FF_PLATFORM) - && ((mo->momz > 0) || ((rover->flags & FF_SOLID) && !(rover->flags & FF_REVERSEPLATFORM)))) // Only clip for FOFs that are intangible from the top if you're coming from below + && ((P_MobjFlip(mo)*mo->momz > 0) || ((rover->flags & FF_SOLID) && !(rover->flags & FF_REVERSEPLATFORM)))) // Only clip for FOFs that are intangible from the top if you're coming from below { mo->ceilingz = bottomheight; } From ba2fe378fbd27333430a15faef7a2ad0d0ce277f Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 6 Jun 2016 21:03:24 +0100 Subject: [PATCH 065/808] woops #2 --- src/p_mobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index b86185ee4..70b96f4bc 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2192,7 +2192,7 @@ static void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motyp if (topheight > mo->floorz && abs(delta1) < abs(delta2) && !(rover->flags & FF_REVERSEPLATFORM) && (rover->flags & FF_SOLID) // Non-FF_SOLID Mario blocks are only solid from bottom - && ((P_MobjFlip(mo)*mo->momz < 0) || (!(rover->flags & FF_PLATFORM)))) // In reverse gravity, only clip for FOFs that are intangible from their bottom (the "top" you're falling through) if you're coming from above ("below" in your frame of reference) + && ((P_MobjFlip(mo)*mo->momz > 0) || (!(rover->flags & FF_PLATFORM)))) // In reverse gravity, only clip for FOFs that are intangible from their bottom (the "top" you're falling through) if you're coming from above ("below" in your frame of reference) { mo->floorz = topheight; } From 3b2ab4da1dd42ece14dd24b2aab199efcb3d8020 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 21 Jun 2016 22:04:58 +0100 Subject: [PATCH 066/808] added linedef type 446, for making FOFs remotely fall down --- src/p_spec.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/p_spec.c b/src/p_spec.c index 36df3de36..d391ac04c 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3079,6 +3079,51 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) } break; + case 446: // Make block fall remotely (acts like FF_CRUMBLE) + { + INT16 sectag = (INT16)(sides[line->sidenum[0]].textureoffset>>FRACBITS); + INT16 foftag = (INT16)(sides[line->sidenum[0]].rowoffset>>FRACBITS); + sector_t *sec; // Sector that the FOF is visible in + ffloor_t *rover; // FOF that we are going to make fall down + player_t *player = NULL; // player that caused FOF to fall + boolean respawn = true; // should the fallen FOF respawn? + + if (mo) // NULL check + player = mo->player; + + if (line->flags & ML_NOCLIMB) // don't respawn! + respawn = false; + + for (secnum = -1; (secnum = P_FindSectorFromTag(sectag, secnum)) >= 0 ;) + { + sec = sectors + secnum; + + if (!sec->ffloors) + { + CONS_Debug(DBG_GAMELOGIC, "Line type 446 Executor: Target sector #%d has no FOFs.\n", secnum); + return; + } + + for (rover = sec->ffloors; rover; rover = rover->next) + { + if (rover->master->frontsector->tag == foftag) + break; + } + + if (!rover) + { + CONS_Debug(DBG_GAMELOGIC, "Line type 446 Executor: Can't find a FOF control sector with tag %d\n", foftag); + return; + } + + if (line->flags & ML_BLOCKMONSTERS) // FOF flags determine respawn ability instead? + respawn = !(rover->flags & FF_NORETURN) ^ !!(line->flags & ML_NOCLIMB); // no climb inverts + + EV_StartCrumble(rover->master->frontsector, rover, (rover->flags & FF_FLOATBOB), player, rover->alpha, respawn); + } + } + break; + case 450: // Execute Linedef Executor - for recursion P_LinedefExecute(line->tag, mo, NULL); break; From 88a805b3313e6a47afa4423889254095c4091e04 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 24 Jun 2016 19:17:35 +0100 Subject: [PATCH 067/808] Using colormap[n] on colormap userdata from v.getColormap (e.g. colormap[0] or colormap[255]) now gives you the palette color replacing that index --- src/lua_hudlib.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 31549afa7..86784293e 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -223,7 +223,12 @@ static int hudinfo_num(lua_State *L) static int colormap_get(lua_State *L) { - return luaL_error(L, "colormap is not a struct."); + const UINT8 *colormap = *((UINT8 **)luaL_checkudata(L, 1, META_COLORMAP)); + UINT32 i = luaL_checkinteger(L, 2); + if (i >= 256) + return luaL_error(L, "colormap index %d out of range (0 - %d)", i, 255); + lua_pushinteger(L, colormap[i]); + return 1; } static int patch_get(lua_State *L) From c775cdc5ebc7a290806661a4e77b21e48f010aec Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 1 Jul 2016 20:27:09 +0100 Subject: [PATCH 068/808] Added EV_StartCrumble to Lua --- src/lua_baselib.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 1bacf9102..4aeab7ad4 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1533,6 +1533,33 @@ static int lib_evCrumbleChain(lua_State *L) return 0; } +static int lib_evStartCrumble(lua_State *L) +{ + sector_t *sec = *((sector_t **)luaL_checkudata(L, 1, META_SECTOR)); + ffloor_t *rover = *((ffloor_t **)luaL_checkudata(L, 2, META_FFLOOR)); + boolean floating = lua_optboolean(L, 3); + player_t *player = NULL; + fixed_t origalpha; + boolean crumblereturn = lua_optboolean(L, 6); + NOHUD + if (!sec) + return LUA_ErrInvalid(L, "sector_t"); + if (!rover) + return LUA_ErrInvalid(L, "ffloor_t"); + if (!lua_isnone(L, 4) && lua_isuserdata(L, 4)) + { + player = *((player_t **)luaL_checkudata(L, 4, META_PLAYER)); + if (!player) + return LUA_ErrInvalid(L, "player_t"); + } + if (!lua_isnone(L,5)) + origalpha = luaL_checkfixed(L, 5); + else + origalpha = rover->alpha; + lua_pushboolean(L, EV_StartCrumble(sec, rover, floating, player, origalpha, crumblereturn) != 0); + return 0; +} + // R_DEFS //////////// @@ -2096,6 +2123,7 @@ static luaL_Reg lib[] = { {"P_SetSkyboxMobj",lib_pSetSkyboxMobj}, {"P_StartQuake",lib_pStartQuake}, {"EV_CrumbleChain",lib_evCrumbleChain}, + {"EV_StartCrumble",lib_evStartCrumble}, // r_defs {"R_PointToAngle",lib_rPointToAngle}, From 4c723d05ac49692ee839ea7f95b3fd6e088e9d3a Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 8 Jul 2016 20:05:54 +0100 Subject: [PATCH 069/808] Added node_t and nodes[] to Lua Still some issues with node.bbox, but the rest seems to work --- src/lua_libs.h | 5 + src/lua_maplib.c | 238 +++++++++++++++++++++++++++++++++++++++++++++++ src/lua_script.c | 16 ++++ 3 files changed, 259 insertions(+) diff --git a/src/lua_libs.h b/src/lua_libs.h index 6c9524dea..8cca20086 100644 --- a/src/lua_libs.h +++ b/src/lua_libs.h @@ -39,12 +39,17 @@ extern lua_State *gL; #define META_SECTOR "SECTOR_T*" #define META_FFLOOR "FFLOOR_T*" #define META_SEG "SEG_T*" +#define META_NODE "NODE_T*" #define META_MAPHEADER "MAPHEADER_T*" #define META_CVAR "CONSVAR_T*" #define META_SECTORLINES "SECTOR_T*LINES" #define META_SIDENUM "LINE_T*SIDENUM" +#define META_NODEBBOX "NODE_T*BBOX" +#define META_NODECHILDREN "NODE_T*CHILDREN" + +#define META_BBOX "BOUNDING_BOX" #define META_HUDINFO "HUDINFO_T*" #define META_PATCH "PATCH_T*" diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 28561f34e..d9fdc1274 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -211,6 +211,26 @@ static const char *const seg_opt[] = { "backsector", NULL}; +enum node_e { + node_valid = 0, + node_x, + node_y, + node_dx, + node_dy, + node_bbox, + node_children, +}; + +static const char *const node_opt[] = { + "valid", + "x", + "y", + "dx", + "dy", + "bbox", + "children", + NULL}; + static const char *const array_opt[] ={"iterate",NULL}; static const char *const valid_opt[] ={"valid",NULL}; @@ -901,6 +921,145 @@ static int seg_num(lua_State *L) return 1; } +static int node_get(lua_State *L) +{ + node_t *node = *((node_t **)luaL_checkudata(L, 1, META_NODE)); + enum node_e field = luaL_checkoption(L, 2, node_opt[0], node_opt); + + if (!node) + { + if (field == node_valid) { + lua_pushboolean(L, 0); + return 1; + } + return luaL_error(L, "accessed node_t doesn't exist anymore."); + } + + switch(field) + { + case node_valid: // valid + lua_pushboolean(L, 1); + return 1; + case node_x: + lua_pushfixed(L, node->x); + return 1; + case node_y: + lua_pushfixed(L, node->y); + return 1; + case node_dx: + lua_pushfixed(L, node->x); + return 1; + case node_dy: + lua_pushfixed(L, node->x); + return 1; + case node_bbox: + LUA_PushUserdata(L, node->bbox, META_NODEBBOX); + return 1; + case node_children: + LUA_PushUserdata(L, node->children, META_NODECHILDREN); + return 1; + } + return 0; +} + +static int node_num(lua_State *L) +{ + node_t *node = *((node_t **)luaL_checkudata(L, 1, META_NODE)); + lua_pushinteger(L, node-nodes); + return 1; +} + +// node.bbox[i][j]: i = 0 or 1, j = 0 1 2 or 3 +// NOTE: 2D arrays are NOT double pointers, +// the second bbox will be directly after the first in memory (hence the way the bbox is pushed here) +// this function handles the [i] part, bbox_get handles the [j] part +static int nodebbox_get(lua_State *L) +{ + fixed_t *bbox = *((fixed_t **)luaL_checkudata(L, 1, META_NODEBBOX)); + int i; + lua_settop(L, 2); + if (!lua_isnumber(L, 2)) + { + int field = luaL_checkoption(L, 2, NULL, valid_opt); + if (!bbox) + { + if (field == 0) { + lua_pushboolean(L, 0); + return 1; + } + return luaL_error(L, "accessed node_t doesn't exist anymore."); + } else if (field == 0) { + lua_pushboolean(L, 1); + return 1; + } + } + + i = lua_tointeger(L, 2); + if (i < 0 || i > 1) + return 0; + LUA_PushUserdata(L, bbox + i*4*sizeof(fixed_t), META_BBOX); + return 1; +} + +// node.children[i]: i = 0 or 1 +static int nodechildren_get(lua_State *L) +{ + UINT16 *children = *((UINT16 **)luaL_checkudata(L, 1, META_NODECHILDREN)); + int i; + lua_settop(L, 2); + if (!lua_isnumber(L, 2)) + { + int field = luaL_checkoption(L, 2, NULL, valid_opt); + if (!children) + { + if (field == 0) { + lua_pushboolean(L, 0); + return 1; + } + return luaL_error(L, "accessed node_t doesn't exist anymore."); + } else if (field == 0) { + lua_pushboolean(L, 1); + return 1; + } + } + + i = lua_tointeger(L, 2); + if (i < 0 || i > 1) + return 0; + lua_pushinteger(L, children[i]); + return 1; +} + +// bounding box (aka fixed_t array with four elements) +// NOTE: may be useful for polyobjects or other things later +static int bbox_get(lua_State *L) +{ + fixed_t *bbox = *((fixed_t **)luaL_checkudata(L, 1, META_BBOX)); + int i; + lua_settop(L, 2); + if (!lua_isnumber(L, 2)) + { + int field = luaL_checkoption(L, 2, NULL, valid_opt); + if (!bbox) + { + if (field == 0) { + lua_pushboolean(L, 0); + return 1; + } + return luaL_error(L, "accessed node_t doesn't exist anymore."); + } else if (field == 0) { + lua_pushboolean(L, 1); + return 1; + } + } + + i = lua_tointeger(L, 2); + if (i < 0 || i > 3) + return 0; + lua_pushinteger(L, bbox[i]); + return 1; +} + static int lib_iterateSectors(lua_State *L) { size_t i = 0; @@ -1177,6 +1336,52 @@ static int lib_numsegs(lua_State *L) return 1; } +static int lib_iterateNodes(lua_State *L) +{ + size_t i = 0; + if (lua_gettop(L) < 2) + return luaL_error(L, "Don't call nodes.iterate() directly, use it as 'for node in nodes.iterate do end'."); + lua_settop(L, 2); + lua_remove(L, 1); // state is unused. + if (!lua_isnil(L, 1)) + i = (size_t)(*((node_t **)luaL_checkudata(L, 1, META_NODE)) - nodes)+1; + if (i < numsegs) + { + LUA_PushUserdata(L, &nodes[i], META_NODE); + return 1; + } + return 0; +} + +static int lib_getNode(lua_State *L) +{ + int field; + lua_settop(L, 2); + lua_remove(L, 1); // dummy userdata table is unused. + if (lua_isnumber(L, 1)) + { + size_t i = lua_tointeger(L, 1); + if (i >= numnodes) + return 0; + LUA_PushUserdata(L, &nodes[i], META_NODE); + return 1; + } + field = luaL_checkoption(L, 1, NULL, array_opt); + switch(field) + { + case 0: // iterate + lua_pushcfunction(L, lib_iterateNodes); + return 1; + } + return 0; +} + +static int lib_numnodes(lua_State *L) +{ + lua_pushinteger(L, numnodes); + return 1; +} + static int ffloor_get(lua_State *L) { ffloor_t *ffloor = *((ffloor_t **)luaL_checkudata(L, 1, META_FFLOOR)); @@ -1504,6 +1709,29 @@ int LUA_MapLib(lua_State *L) lua_setfield(L, -2, "__len"); lua_pop(L, 1); + luaL_newmetatable(L, META_NODE); + lua_pushcfunction(L, node_get); + lua_setfield(L, -2, "__index"); + + lua_pushcfunction(L, node_num); + lua_setfield(L, -2, "__len"); + lua_pop(L, 1); + + luaL_newmetatable(L, META_NODEBBOX); + lua_pushcfunction(L, nodebbox_get); + lua_setfield(L, -2, "__index"); + lua_pop(L, 1); + + luaL_newmetatable(L, META_NODECHILDREN); + lua_pushcfunction(L, nodechildren_get); + lua_setfield(L, -2, "__index"); + lua_pop(L, 1); + + luaL_newmetatable(L, META_BBOX); + lua_pushcfunction(L, bbox_get); + lua_setfield(L, -2, "__index"); + lua_pop(L, 1); + luaL_newmetatable(L, META_MAPHEADER); lua_pushcfunction(L, mapheaderinfo_get); lua_setfield(L, -2, "__index"); @@ -1572,6 +1800,16 @@ int LUA_MapLib(lua_State *L) lua_setmetatable(L, -2); lua_setglobal(L, "segs"); + lua_newuserdata(L, 0); + lua_createtable(L, 0, 2); + lua_pushcfunction(L, lib_getNode); + lua_setfield(L, -2, "__index"); + + lua_pushcfunction(L, lib_numnodes); + lua_setfield(L, -2, "__len"); + lua_setmetatable(L, -2); + lua_setglobal(L, "nodes"); + lua_newuserdata(L, 0); lua_createtable(L, 0, 2); lua_pushcfunction(L, lib_getMapheaderinfo); diff --git a/src/lua_script.c b/src/lua_script.c index 621b7dfe4..6274baa73 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -456,6 +456,7 @@ enum ARCH_SUBSECTOR, ARCH_SECTOR, ARCH_SEG, + ARCH_NODE, ARCH_MAPHEADER, ARCH_TEND=0xFF, @@ -476,6 +477,7 @@ static const struct { {META_SUBSECTOR,ARCH_SUBSECTOR}, {META_SECTOR, ARCH_SECTOR}, {META_SEG, ARCH_SEG}, + {META_NODE, ARCH_NODE}, {META_MAPHEADER, ARCH_MAPHEADER}, {NULL, ARCH_NULL} }; @@ -677,6 +679,17 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex) } break; } + case ARCH_NODE: + { + node_t *node = *((node_t **)lua_touserdata(gL, myindex)); + if (!node) + WRITEUINT8(save_p, ARCH_NULL); + else { + WRITEUINT8(save_p, ARCH_NODE); + WRITEUINT16(save_p, node - nodes); + } + break; + } case ARCH_MAPHEADER: { mapheader_t *header = *((mapheader_t **)lua_touserdata(gL, myindex)); @@ -858,6 +871,9 @@ static UINT8 UnArchiveValue(int TABLESINDEX) case ARCH_SEG: LUA_PushUserdata(gL, &segs[READUINT16(save_p)], META_SEG); break; + case ARCH_NODE: + LUA_PushUserdata(gL, &nodes[READUINT16(save_p)], META_NODE); + break; case ARCH_MAPHEADER: LUA_PushUserdata(gL, §ors[READUINT16(save_p)], META_MAPHEADER); break; From f2b3640c6ab42d771d3561dde640f245c92df29d Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 8 Jul 2016 20:43:02 +0100 Subject: [PATCH 070/808] Make sure seg/node arrays are invalidated in LUA_InvalidateLevel (I'll fix sector.lines and ffloors and other things I missed in the public repo) --- src/lua_script.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lua_script.c b/src/lua_script.c index 6274baa73..9d1eb8918 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -416,6 +416,14 @@ void LUA_InvalidateLevel(void) LUA_InvalidateUserdata(&sides[i]); for (i = 0; i < numvertexes; i++) LUA_InvalidateUserdata(&vertexes[i]); + for (i = 0; i < numsegs; i++) + LUA_InvalidateUserdata(&segs[i]); + for (i = 0; i < numnodes; i++) + { + LUA_InvalidateUserdata(&nodes[i]); + LUA_InvalidateUserdata(nodes[i].bbox); + LUA_InvalidateUserdata(nodes[i].children); + } } void LUA_InvalidateMapthings(void) From f8dd9b64abfa69a4af52bfe3923204b07b68f2c7 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 8 Jul 2016 21:55:17 +0100 Subject: [PATCH 071/808] Elemental shield ability now coded. REQUIRES NEW PATCH.DTA FROM THE FTP. - Press spin in midair to stomp directly downwards (losing horizontal momentum), creating a flickering fireball around you. - No bouncing on enemies, item boxes, etc - just go straight through. - Hurts other players on touch whilst you're stomping. - Spawns a bunch of flames around you when you hit the ground. Also: - Electric shield's ability now uses different sounds, because I'm picky. --- src/dehacked.c | 14 ++++++- src/info.c | 75 +++++++++++++++++++++++++--------- src/info.h | 15 ++++++- src/lua_baselib.c | 3 +- src/p_inter.c | 12 ++++-- src/p_local.h | 2 +- src/p_map.c | 8 ++-- src/p_mobj.c | 22 ++++++++++ src/p_user.c | 100 ++++++++++++++++++++++++++++++++-------------- 9 files changed, 191 insertions(+), 60 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index f5d3b55cb..1afa5f0cf 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -4782,7 +4782,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_SPIKEBALL7", "S_SPIKEBALL8", - // Fire Shield's Spawn + // Elemental Shield's Spawn + "S_SPINFIRE0", "S_SPINFIRE1", "S_SPINFIRE2", "S_SPINFIRE3", @@ -4790,6 +4791,15 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_SPINFIRE5", "S_SPINFIRE6", + // Elemental Shield's FLYING Spawn + "S_AIRSPINFIRE_FLY1", + "S_AIRSPINFIRE_FLY2", + "S_AIRSPINFIRE_FLY3", + "S_AIRSPINFIRE_FLY4", + "S_AIRSPINFIRE_FLY5", + "S_AIRSPINFIRE_FLY6", + "S_AIRSPINFIRE_DIE", + // Spikes "S_SPIKE1", "S_SPIKE2", @@ -5399,6 +5409,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_ELEMF6", "S_ELEMF7", "S_ELEMF8", + "S_ELEMF9", + "S_ELEMF10", "S_PITY1", "S_PITY2", diff --git a/src/info.c b/src/info.c index 5e6528c01..f946e72e8 100644 --- a/src/info.c +++ b/src/info.c @@ -1123,13 +1123,23 @@ state_t states[NUMSTATES] = {SPR_SPIK, 6, 1, {A_RotateSpikeBall}, 0, 0, S_SPIKEBALL8}, // S_SPIKEBALL7 {SPR_SPIK, 7, 1, {A_RotateSpikeBall}, 0, 0, S_SPIKEBALL1}, // S_SPIKEBALL8 - // Red Shield's Spawn - {SPR_SFLM, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_SPINFIRE2}, // S_SPINFIRE1 - {SPR_SFLM, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_SPINFIRE3}, // S_SPINFIRE2 - {SPR_SFLM, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_SPINFIRE4}, // S_SPINFIRE3 - {SPR_SFLM, FF_FULLBRIGHT|3, 2, {NULL}, 0, 0, S_SPINFIRE5}, // S_SPINFIRE4 - {SPR_SFLM, FF_FULLBRIGHT|4, 2, {NULL}, 0, 0, S_SPINFIRE6}, // S_SPINFIRE5 - {SPR_SFLM, FF_FULLBRIGHT|5, 2, {NULL}, 0, 0, S_SPINFIRE1}, // S_SPINFIRE6 + // Elemental Shield's Spawn + {SPR_SFLM, FF_FULLBRIGHT|5, 2, {A_SetFuse}, 6*TICRATE, 0, S_SPINFIRE1}, // S_SPINFIRE0 + {SPR_SFLM, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_SPINFIRE2}, // S_SPINFIRE1 + {SPR_SFLM, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_SPINFIRE3}, // S_SPINFIRE2 + {SPR_SFLM, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_SPINFIRE4}, // S_SPINFIRE3 + {SPR_SFLM, FF_FULLBRIGHT|3, 2, {NULL}, 0, 0, S_SPINFIRE5}, // S_SPINFIRE4 + {SPR_SFLM, FF_FULLBRIGHT|4, 2, {NULL}, 0, 0, S_SPINFIRE6}, // S_SPINFIRE5 + {SPR_SFLM, FF_FULLBRIGHT|5, 2, {NULL}, 0, 0, S_SPINFIRE1}, // S_SPINFIRE6 + + // Elemental Shield's FLYING Spawn + {SPR_SFLM, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY2}, //S_AIRSPINFIRE_FLY1, + {SPR_SFLM, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY3}, //S_AIRSPINFIRE_FLY2, + {SPR_SFLM, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY4}, //S_AIRSPINFIRE_FLY3, + {SPR_SFLM, FF_FULLBRIGHT|3, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY5}, //S_AIRSPINFIRE_FLY4, + {SPR_SFLM, FF_FULLBRIGHT|4, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY6}, //S_AIRSPINFIRE_FLY5, + {SPR_SFLM, FF_FULLBRIGHT|5, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY1}, //S_AIRSPINFIRE_FLY6, + {SPR_SFLM, FF_FULLBRIGHT, 0, {A_SpawnObjectRelative}, 0, MT_SPINFIRE, S_NULL}, //S_AIRSPINFIRE_DIE, // Floor Spike {SPR_USPK, 0,-1, {A_SpikeRetract}, 1, 0, S_SPIKE2}, // S_SPIKE1 -- Fully extended @@ -1742,14 +1752,16 @@ state_t states[NUMSTATES] = {SPR_ELEM, FF_TRANS50|10, 4, {NULL}, 0, 0, S_ELEM12}, // S_ELEM11 {SPR_ELEM, FF_TRANS50|11, 4, {NULL}, 0, 0, S_ELEM1 }, // S_ELEM12 - {SPR_ELEM, FF_FULLBRIGHT|12, 3, {NULL}, 0, 0, S_ELEMF2}, // S_ELEMF1 - {SPR_ELEM, FF_FULLBRIGHT|13, 3, {NULL}, 0, 0, S_ELEMF3}, // S_ELEMF2 - {SPR_ELEM, FF_FULLBRIGHT|14, 3, {NULL}, 0, 0, S_ELEMF4}, // S_ELEMF3 - {SPR_ELEM, FF_FULLBRIGHT|15, 3, {NULL}, 0, 0, S_ELEMF5}, // S_ELEMF4 - {SPR_ELEM, FF_FULLBRIGHT|16, 3, {NULL}, 0, 0, S_ELEMF6}, // S_ELEMF5 - {SPR_ELEM, FF_FULLBRIGHT|17, 3, {NULL}, 0, 0, S_ELEMF7}, // S_ELEMF6 - {SPR_ELEM, FF_FULLBRIGHT|18, 3, {NULL}, 0, 0, S_ELEMF8}, // S_ELEMF7 - {SPR_ELEM, FF_FULLBRIGHT|19, 3, {NULL}, 0, 0, S_ELEMF1}, // S_ELEMF8 + {SPR_ELEM, FF_FULLBRIGHT|12, 3, {NULL}, 0, 0, S_ELEMF2 }, // S_ELEMF1 + {SPR_ELEM, FF_FULLBRIGHT|13, 3, {NULL}, 0, 0, S_ELEMF3 }, // S_ELEMF2 + {SPR_ELEM, FF_FULLBRIGHT|14, 3, {NULL}, 0, 0, S_ELEMF4 }, // S_ELEMF3 + {SPR_ELEM, FF_FULLBRIGHT|15, 3, {NULL}, 0, 0, S_ELEMF5 }, // S_ELEMF4 + {SPR_ELEM, FF_FULLBRIGHT|16, 3, {NULL}, 0, 0, S_ELEMF6 }, // S_ELEMF5 + {SPR_ELEM, FF_FULLBRIGHT|17, 3, {NULL}, 0, 0, S_ELEMF7 }, // S_ELEMF6 + {SPR_ELEM, FF_FULLBRIGHT|18, 3, {NULL}, 0, 0, S_ELEMF8 }, // S_ELEMF7 + {SPR_ELEM, FF_FULLBRIGHT|19, 3, {NULL}, 0, 0, S_ELEMF1 }, // S_ELEMF8 + {SPR_ELEM, FF_FULLBRIGHT|20, 1, {NULL}, 0, 0, S_ELEMF10}, // S_ELEMF9 + {SPR_NULL, 0, 1, {NULL}, 0, 0, S_ELEMF1 }, // S_ELEMF10 {SPR_PITY, FF_TRANS20 , 1, {NULL}, 0, 0, S_PITY2 }, // S_PITY1 {SPR_PITY, FF_TRANS20|1, 1, {NULL}, 0, 0, S_PITY3 }, // S_PITY2 @@ -5392,7 +5404,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_SPINFIRE -1, // doomednum - S_SPINFIRE1, // spawnstate + S_SPINFIRE0, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -5413,7 +5425,34 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_MISSILE|MF_NOGRAVITY|MF_FIRE, // flags + MF_NOBLOCKMAP|MF_MISSILE|MF_NOGRAVITY|MF_FIRE|MF_RUNSPAWNFUNC, // flags + S_NULL // raisestate + }, + + { // MT_AIRSPINFIRE + -1, // doomednum + S_AIRSPINFIRE_FLY1, // 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_AIRSPINFIRE_DIE, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 10*FRACUNIT, // speed + 8*FRACUNIT, // radius + 14*FRACUNIT, // height + 0, // display offset + 100, // mass + 1, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_MISSILE|MF_FIRE, // flags S_NULL // raisestate }, @@ -9833,7 +9872,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // seesound 0, // reactiontime sfx_None, // attacksound - S_NULL, // painstate + S_ELEMF9, // painstate SKINCOLOR_NONE, // painchance sfx_None, // painsound S_NULL, // meleestate diff --git a/src/info.h b/src/info.h index f49a56baa..8a56ef77e 100644 --- a/src/info.h +++ b/src/info.h @@ -1633,7 +1633,8 @@ typedef enum state S_SPIKEBALL7, S_SPIKEBALL8, - // Fire Shield's Spawn + // Elemental Shield's Spawn + S_SPINFIRE0, S_SPINFIRE1, S_SPINFIRE2, S_SPINFIRE3, @@ -1641,6 +1642,15 @@ typedef enum state S_SPINFIRE5, S_SPINFIRE6, + // Elemental Shield's FLYING Spawn + S_AIRSPINFIRE_FLY1, + S_AIRSPINFIRE_FLY2, + S_AIRSPINFIRE_FLY3, + S_AIRSPINFIRE_FLY4, + S_AIRSPINFIRE_FLY5, + S_AIRSPINFIRE_FLY6, + S_AIRSPINFIRE_DIE, + // Spikes S_SPIKE1, S_SPIKE2, @@ -2250,6 +2260,8 @@ typedef enum state S_ELEMF6, S_ELEMF7, S_ELEMF8, + S_ELEMF9, + S_ELEMF10, S_PITY1, S_PITY2, @@ -3131,6 +3143,7 @@ typedef enum mobj_type MT_SPIKEBALL, // Spike Ball MT_SPECIALSPIKEBALL, MT_SPINFIRE, + MT_AIRSPINFIRE, // Elemental flame flying through the air MT_SPIKE, MT_STARPOST, MT_BIGMINE, diff --git a/src/lua_baselib.c b/src/lua_baselib.c index b478a8cf6..8846e2403 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -780,10 +780,11 @@ static int lib_pBlackOw(lua_State *L) static int lib_pElementalFireTrail(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + boolean cropcircle = lua_opttrueboolean(L, 2); NOHUD if (!player) return LUA_ErrInvalid(L, "player_t"); - P_ElementalFireTrail(player); + P_ElementalFireTrail(player, cropcircle); return 0; } diff --git a/src/p_inter.c b/src/p_inter.c index 9d6230cb2..c2e8561a2 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -237,6 +237,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) { player_t *player; INT32 i; + boolean elementalpierce; if (objectplacing) return; @@ -291,6 +292,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; #endif + elementalpierce = (((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) && (player->pflags & PF_SHIELDABILITY)); + if (special->flags & MF_BOSS) { if (special->type == MT_BLACKEGGMAN) @@ -301,9 +304,10 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING)) || (player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING)) - || player->powers[pw_invulnerability] || player->powers[pw_super]) // Do you possess the ability to subdue the object? + || player->powers[pw_invulnerability] || player->powers[pw_super] + || elementalpierce) // Do you possess the ability to subdue the object? { - if (P_MobjFlip(toucher)*toucher->momz < 0) + if ((P_MobjFlip(toucher)*toucher->momz < 0) && !elementalpierce) toucher->momz = -toucher->momz; toucher->momx = -toucher->momx; toucher->momy = -toucher->momy; @@ -330,7 +334,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) /////ENEMIES!!////////////////////////////////////////// //////////////////////////////////////////////////////// if (special->type == MT_GSNAPPER && !(((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING)) - || player->powers[pw_invulnerability] || player->powers[pw_super]) + || player->powers[pw_invulnerability] || player->powers[pw_super] || elementalpierce) && toucher->z < special->z + special->height && toucher->z + toucher->height > special->z) { // Can only hit snapper from above @@ -346,7 +350,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) || (player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING)) || player->powers[pw_invulnerability] || player->powers[pw_super]) // Do you possess the ability to subdue the object? { - if (P_MobjFlip(toucher)*toucher->momz < 0) + if ((P_MobjFlip(toucher)*toucher->momz < 0) && !elementalpierce) toucher->momz = -toucher->momz; P_DamageMobj(special, toucher, toucher, 1, 0); diff --git a/src/p_local.h b/src/p_local.h index 0f21b317e..26369d899 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -151,7 +151,7 @@ boolean P_AutoPause(void); void P_DoJumpShield(player_t *player); void P_BlackOw(player_t *player); -void P_ElementalFireTrail(player_t *player); +void P_ElementalFireTrail(player_t *player, boolean cropcircle); void P_DoPityCheck(player_t *player); void P_PlayerThink(player_t *player); diff --git a/src/p_map.c b/src/p_map.c index af7c4667e..468b46ea3 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -855,10 +855,10 @@ static boolean PIT_CheckThing(mobj_t *thing) { if (G_RingSlingerGametype() && (!G_GametypeHasTeams() || tmthing->player->ctfteam != thing->player->ctfteam)) { - if ((tmthing->player->powers[pw_invulnerability] || tmthing->player->powers[pw_super]) + if ((tmthing->player->powers[pw_invulnerability] || tmthing->player->powers[pw_super] || (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) && (tmthing->player->pflags & PF_SHIELDABILITY))) && !thing->player->powers[pw_super]) P_DamageMobj(thing, tmthing, tmthing, 1, 0); - else if ((thing->player->powers[pw_invulnerability] || thing->player->powers[pw_super]) + else if ((thing->player->powers[pw_invulnerability] || thing->player->powers[pw_super] || (((thing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) && (thing->player->pflags & PF_SHIELDABILITY))) && !tmthing->player->powers[pw_super]) P_DamageMobj(tmthing, thing, thing, 1, 0); } @@ -942,11 +942,13 @@ static boolean PIT_CheckThing(mobj_t *thing) { SINT8 flipval = P_MobjFlip(thing); // Save this value in case monitor gets removed. fixed_t *momz = &tmthing->momz; // tmthing gets changed by P_DamageMobj, so we need a new pointer?! X_x;; + boolean elementalpierce = (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) && (tmthing->player->pflags & PF_SHIELDABILITY)); P_DamageMobj(thing, tmthing, tmthing, 1, 0); // break the monitor // Going down? Then bounce back up. if ((P_MobjWasRemoved(thing) // Monitor was removed || !thing->health) // or otherwise popped - && (flipval*(*momz) < 0)) // monitor is on the floor and you're going down, or on the ceiling and you're going up + && (flipval*(*momz) < 0) // monitor is on the floor and you're going down, or on the ceiling and you're going up + && !elementalpierce) // you're not piercing through the monitor... *momz = -*momz; // Therefore, you should be thrust in the opposite direction, vertically. return false; } diff --git a/src/p_mobj.c b/src/p_mobj.c index 9b9fdea24..ab8071904 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2980,7 +2980,19 @@ static void P_PlayerZMovement(mobj_t *mo) if (!(mo->player->pflags & PF_GLIDING)) mo->player->pflags &= ~PF_JUMPED; + + if (((mo->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) && (mo->player->pflags & PF_SHIELDABILITY)) // Elemental pierce attack. + { + if (mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER)) // play a blunt sound + S_StartSound(mo, sfx_s3k4c); + else // create a fire pattern on the ground + { + S_StartSound(mo, sfx_s3k47); + P_ElementalFireTrail(mo->player, true); + } + } mo->player->pflags &= ~(PF_THOKKED|PF_SHIELDABILITY); + //mo->player->pflags &= ~PF_GLIDING; mo->player->jumping = 0; mo->player->secondjump = 0; @@ -6456,6 +6468,16 @@ void P_MobjThinker(mobj_t *mobj) } else P_AddOverlay(mobj); + if ((mobj->target->type == MT_GREENORB) + && (mobj->target->target) + && (mobj->target->target->player) + && ((mobj->target->target->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) + && (mobj->target->target->player->pflags & PF_SHIELDABILITY) + && (mobj->state->nextstate < mobj->target->info->painstate)) // Special casing for elemental shield piercing attack. + { + P_SetMobjState(mobj, mobj->target->info->painstate); + mobj->tics++; + } break; case MT_BLACKORB: case MT_WHITEORB: diff --git a/src/p_user.c b/src/p_user.c index 84eea16a0..e1a44cfd0 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1347,6 +1347,8 @@ void P_SpawnShieldOrb(player_t *player) I_Error("P_SpawnShieldOrb: player->mo is NULL!\n"); #endif + player->pflags &= ~PF_SHIELDABILITY; // Prevent edge cases when switching shields. + if (player->powers[pw_shield] & SH_FORCE) orbtype = MT_BLUEORB; else switch (player->powers[pw_shield] & SH_NOSTACK) @@ -6198,7 +6200,7 @@ void P_BlackOw(player_t *player) player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK; } -void P_ElementalFireTrail(player_t *player) +void P_ElementalFireTrail(player_t *player, boolean cropcircle) { fixed_t newx; fixed_t newy; @@ -6216,40 +6218,61 @@ void P_ElementalFireTrail(player_t *player) else ground = player->mo->floorz; - travelangle = R_PointToAngle2(0, 0, player->rmomx, player->rmomy); - - for (i = 0; i < 2; i++) + if (cropcircle) { - newx = player->mo->x + P_ReturnThrustX(player->mo, travelangle + ((i&1) ? -1 : 1)*ANGLE_135, FixedMul(24*FRACUNIT, player->mo->scale)); - newy = player->mo->y + P_ReturnThrustY(player->mo, travelangle + ((i&1) ? -1 : 1)*ANGLE_135, FixedMul(24*FRACUNIT, player->mo->scale)); -#ifdef ESLOPE - if (player->mo->standingslope) + travelangle = player->mo->angle + P_RandomRange(-ANGLE_45, ANGLE_45); +#define numangles 8 + for (i = 0; i < 8; i++) { - ground = P_GetZAt(player->mo->standingslope, newx, newy); - if (player->mo->eflags & MFE_VERTICALFLIP) - ground -= FixedMul(mobjinfo[MT_SPINFIRE].height, player->mo->scale); + flame = P_SpawnMobj(player->mo->x, player->mo->y, ground, MT_AIRSPINFIRE); + P_SetTarget(&flame->target, player->mo); + flame->angle = travelangle + i*(ANGLE_MAX/numangles); + flame->destscale = player->mo->scale; + P_SetScale(flame, player->mo->scale); + flame->eflags = (flame->eflags & ~MFE_VERTICALFLIP)|(player->mo->eflags & MFE_VERTICALFLIP); + P_InstaThrust(flame, flame->angle, FixedMul(3*FRACUNIT, flame->scale)); + P_SetObjectMomZ(flame, 3*FRACUNIT, false); } -#endif - flame = P_SpawnMobj(newx, newy, ground, MT_SPINFIRE); - P_SetTarget(&flame->target, player->mo); - flame->angle = travelangle; - flame->fuse = TICRATE*6; - flame->destscale = player->mo->scale; - P_SetScale(flame, player->mo->scale); - flame->eflags = (flame->eflags & ~MFE_VERTICALFLIP)|(player->mo->eflags & MFE_VERTICALFLIP); - - flame->momx = 8; - P_XYMovement(flame); - if (P_MobjWasRemoved(flame)) - continue; - - if (player->mo->eflags & MFE_VERTICALFLIP) +#undef numangles + } + else + { + travelangle = R_PointToAngle2(0, 0, player->rmomx, player->rmomy); + for (i = 0; i < 2; i++) { - if (flame->z + flame->height < flame->ceilingz) + + newx = player->mo->x + P_ReturnThrustX(player->mo, (travelangle + ((i&1) ? -1 : 1)*ANGLE_135), FixedMul(24*FRACUNIT, player->mo->scale)); + newy = player->mo->y + P_ReturnThrustY(player->mo, (travelangle + ((i&1) ? -1 : 1)*ANGLE_135), FixedMul(24*FRACUNIT, player->mo->scale)); + +#ifdef ESLOPE + if (player->mo->standingslope) + { + ground = P_GetZAt(player->mo->standingslope, newx, newy); + if (player->mo->eflags & MFE_VERTICALFLIP) + ground -= FixedMul(mobjinfo[MT_SPINFIRE].height, player->mo->scale); + } +#endif + flame = P_SpawnMobj(newx, newy, ground, MT_SPINFIRE); + P_SetTarget(&flame->target, player->mo); + flame->angle = travelangle; + // flame->fuse = TICRATE*6; // now done in spawnstate + flame->destscale = player->mo->scale; + P_SetScale(flame, player->mo->scale); + flame->eflags = (flame->eflags & ~MFE_VERTICALFLIP)|(player->mo->eflags & MFE_VERTICALFLIP); + + flame->momx = 8; + P_XYMovement(flame); + if (P_MobjWasRemoved(flame)) + continue; + + if (player->mo->eflags & MFE_VERTICALFLIP) + { + if (flame->z + flame->height < flame->ceilingz) + P_RemoveMobj(flame); + } + else if (flame->z > flame->floorz) P_RemoveMobj(flame); } - else if (flame->z > flame->floorz) - P_RemoveMobj(flame); } } @@ -6789,7 +6812,7 @@ static void P_MovePlayer(player_t *player) if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL && (player->pflags & PF_SPINNING) && player->speed > FixedMul(4<mo->scale) && onground && (leveltime & 1) && !(player->mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER))) - P_ElementalFireTrail(player); + P_ElementalFireTrail(player, false); P_DoSpinDash(player, cmd); @@ -6897,9 +6920,24 @@ static void P_MovePlayer(player_t *player) { player->pflags |= PF_THOKKED|PF_SHIELDABILITY; player->homing = 2; - S_StartSound(player->mo, sfx_spdpad); if (P_LookForEnemies(player, false) && player->mo->tracer) + { + S_StartSound(player->mo, sfx_s3k40); player->homing = 3*TICRATE; + } + else + S_StartSound(player->mo, sfx_s3k41); + } + } + // Elemental shield activation + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) + { + if (!(player->pflags & PF_THOKKED)) + { + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + S_StartSound(player->mo, sfx_s3k43); + player->mo->momx = player->mo->momy = 0; + P_SetObjectMomZ(player->mo, -24*FRACUNIT, false); } } } From ec85357643952742365bd661ff25c6684a088fa7 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 8 Jul 2016 22:05:13 +0100 Subject: [PATCH 072/808] Didn't properly use the #defined numangles constant. --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index e1a44cfd0..5579178d1 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6222,7 +6222,7 @@ void P_ElementalFireTrail(player_t *player, boolean cropcircle) { travelangle = player->mo->angle + P_RandomRange(-ANGLE_45, ANGLE_45); #define numangles 8 - for (i = 0; i < 8; i++) + for (i = 0; i < numangles; i++) { flame = P_SpawnMobj(player->mo->x, player->mo->y, ground, MT_AIRSPINFIRE); P_SetTarget(&flame->target, player->mo); From 940a58b5cad6e40c714e46527746fdf9d0ce2661 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 8 Jul 2016 22:52:49 +0100 Subject: [PATCH 073/808] Shouldn't be true by default, WOOPS --- src/lua_baselib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 8846e2403..d34e319cb 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -780,7 +780,7 @@ static int lib_pBlackOw(lua_State *L) static int lib_pElementalFireTrail(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); - boolean cropcircle = lua_opttrueboolean(L, 2); + boolean cropcircle = lua_optboolean(L, 2); NOHUD if (!player) return LUA_ErrInvalid(L, "player_t"); From 0fefd86d1e0874dbe16b03da3515b82a9236a294 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 8 Jul 2016 22:56:17 +0100 Subject: [PATCH 074/808] More generic name for P_ElementalFireTrail upon MI's request --- src/lua_baselib.c | 6 +++--- src/p_local.h | 2 +- src/p_mobj.c | 2 +- src/p_user.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index d34e319cb..745c9dcd3 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -777,14 +777,14 @@ static int lib_pBlackOw(lua_State *L) return 0; } -static int lib_pElementalFireTrail(lua_State *L) +static int lib_pElementalFire(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); boolean cropcircle = lua_optboolean(L, 2); NOHUD if (!player) return LUA_ErrInvalid(L, "player_t"); - P_ElementalFireTrail(player, cropcircle); + P_ElementalFire(player, cropcircle); return 0; } @@ -2038,7 +2038,7 @@ static luaL_Reg lib[] = { {"P_ResetScore",lib_pResetScore}, {"P_DoJumpShield",lib_pDoJumpShield}, {"P_BlackOw",lib_pBlackOw}, - {"P_ElementalFireTrail",lib_pElementalFireTrail}, + {"P_ElementalFire",lib_pElementalFire}, {"P_DoPlayerExit",lib_pDoPlayerExit}, {"P_InstaThrust",lib_pInstaThrust}, {"P_ReturnThrustX",lib_pReturnThrustX}, diff --git a/src/p_local.h b/src/p_local.h index 26369d899..05d1a4823 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -151,7 +151,7 @@ boolean P_AutoPause(void); void P_DoJumpShield(player_t *player); void P_BlackOw(player_t *player); -void P_ElementalFireTrail(player_t *player, boolean cropcircle); +void P_ElementalFire(player_t *player, boolean cropcircle); void P_DoPityCheck(player_t *player); void P_PlayerThink(player_t *player); diff --git a/src/p_mobj.c b/src/p_mobj.c index ab8071904..13dd15d21 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2988,7 +2988,7 @@ static void P_PlayerZMovement(mobj_t *mo) else // create a fire pattern on the ground { S_StartSound(mo, sfx_s3k47); - P_ElementalFireTrail(mo->player, true); + P_ElementalFire(mo->player, true); } } mo->player->pflags &= ~(PF_THOKKED|PF_SHIELDABILITY); diff --git a/src/p_user.c b/src/p_user.c index 5579178d1..75c70135a 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6200,7 +6200,7 @@ void P_BlackOw(player_t *player) player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK; } -void P_ElementalFireTrail(player_t *player, boolean cropcircle) +void P_ElementalFire(player_t *player, boolean cropcircle) { fixed_t newx; fixed_t newy; @@ -6812,7 +6812,7 @@ static void P_MovePlayer(player_t *player) if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL && (player->pflags & PF_SPINNING) && player->speed > FixedMul(4<mo->scale) && onground && (leveltime & 1) && !(player->mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER))) - P_ElementalFireTrail(player, false); + P_ElementalFire(player, false); P_DoSpinDash(player, cmd); From 61304dd833e4c8bdb33298a644bb4a760822d6b0 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 8 Jul 2016 22:58:09 +0100 Subject: [PATCH 075/808] Added NF_SUBSECTOR to dehacked.c lists --- src/dehacked.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dehacked.c b/src/dehacked.c index 75235e054..5dd9c532c 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7270,6 +7270,9 @@ struct { {"FF_COLORMAPONLY",FF_COLORMAPONLY}, ///< Only copy the colormap, not the lightlevel {"FF_GOOWATER",FF_GOOWATER}, ///< Used with ::FF_SWIMMABLE. Makes thick bouncey goop. + // Node flags + {"NF_SUBSECTOR",NF_SUBSECTOR}, // Indicate a leaf. + // Angles {"ANG1",ANG1}, {"ANG2",ANG2}, From 26f34d10381b883a1d2fefb145c51b4eeaa446f4 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 9 Jul 2016 17:36:24 +0100 Subject: [PATCH 076/808] Compiling fixes. --- src/p_floor.c | 2 +- src/p_spec.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/p_floor.c b/src/p_floor.c index 4ddba60bc..62e89be6f 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -1798,9 +1798,9 @@ static mobj_t *SearchMarioNode(msecnode_t *node) void T_MarioBlockChecker(levelspecthink_t *block) { + line_t *masterline = block->sourceline; if (block->sector->floorspeed) // Don't update the textures when the block's being bumped upwards. return; - line_t *masterline = block->sourceline; if (SearchMarioNode(block->sector->touching_thinglist)) { sides[masterline->sidenum[0]].midtexture = sides[masterline->sidenum[0]].bottomtexture; // Update textures diff --git a/src/p_spec.c b/src/p_spec.c index 7d77a66ed..c6972c5eb 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3676,6 +3676,7 @@ DoneSection2: { angle_t lineangle; fixed_t linespeed; + fixed_t sfxnum; lineangle = R_PointToAngle2(lines[i].v1->x, lines[i].v1->y, lines[i].v2->x, lines[i].v2->y); linespeed = sides[lines[i].sidenum[0]].textureoffset; @@ -3724,7 +3725,7 @@ DoneSection2: player->powers[pw_flashing] = TICRATE/3; - fixed_t sfxnum = sides[lines[i].sidenum[0]].toptexture; + sfxnum = sides[lines[i].sidenum[0]].toptexture; if (!sfxnum) sfxnum = sfx_spdpad; From c8a2eaf8a6387aa9ab0f7e927afc7b13561c5435 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 10 Jul 2016 17:35:05 +0100 Subject: [PATCH 077/808] Make sure to invalidate sector.lines and all ffloors for the previous map's sectors as well (yes, I changed my mind about doing it in public repo, probably too much hassle if we want 2.1.16 out soon) --- src/lua_script.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lua_script.c b/src/lua_script.c index 9d1eb8918..5f2aab088 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -395,6 +395,7 @@ void LUA_InvalidateLevel(void) { thinker_t *th; size_t i; + ffloor_t *rover = NULL; if (!gL) return; @@ -406,7 +407,15 @@ void LUA_InvalidateLevel(void) for (i = 0; i < numsubsectors; i++) LUA_InvalidateUserdata(&subsectors[i]); for (i = 0; i < numsectors; i++) + { LUA_InvalidateUserdata(§ors[i]); + LUA_InvalidateUserdata(sectors[i].lines); + if (sectors[i].ffloors) + { + for (rover = sectors[i].ffloors; rover; rover = rover->next) + LUA_InvalidateUserdata(rover); + } + } for (i = 0; i < numlines; i++) { LUA_InvalidateUserdata(&lines[i]); From 3fba690d0a34da125e3c7a1f16b4284087595ef9 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 10 Jul 2016 17:58:54 +0100 Subject: [PATCH 078/808] Allow $$$.sav to archive and read ffloor_t userdata Lua extvars Oh, and P_GetFFloorByID is now a thing, to assist with the above. Also added a suitable description for P_GetFFloorBySec --- src/lua_script.c | 37 +++++++++++++++++++++++++++++++++++++ src/p_spec.c | 29 +++++++++++++++++++++++++++++ src/p_spec.h | 2 ++ 3 files changed, 68 insertions(+) diff --git a/src/lua_script.c b/src/lua_script.c index 5f2aab088..158b1bc4b 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -474,6 +474,7 @@ enum ARCH_SECTOR, ARCH_SEG, ARCH_NODE, + ARCH_FFLOOR, ARCH_MAPHEADER, ARCH_TEND=0xFF, @@ -495,6 +496,7 @@ static const struct { {META_SECTOR, ARCH_SECTOR}, {META_SEG, ARCH_SEG}, {META_NODE, ARCH_NODE}, + {META_FFLOOR, ARCH_FFLOOR}, {META_MAPHEADER, ARCH_MAPHEADER}, {NULL, ARCH_NULL} }; @@ -707,6 +709,32 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex) } break; } + case ARCH_FFLOOR: + { + ffloor_t *rover = *((ffloor_t **)lua_touserdata(gL, myindex)); + if (!rover) + WRITEUINT8(save_p, ARCH_NULL); + else { + ffloor_t *r2 = NULL; + UINT16 i = 0; + // search for id + for (r2 = rover->target->ffloors; r2; r2 = r2->next); + { + if (r2 == rover) + break; + i++; + } + if (!r2) + WRITEUINT8(save_p, ARCH_NULL); + else + { + WRITEUINT8(save_p, ARCH_FFLOOR); + WRITEUINT16(save_p, rover->target - sectors); + WRITEUINT16(save_p, i); + } + } + break; + } case ARCH_MAPHEADER: { mapheader_t *header = *((mapheader_t **)lua_touserdata(gL, myindex)); @@ -891,6 +919,15 @@ static UINT8 UnArchiveValue(int TABLESINDEX) case ARCH_NODE: LUA_PushUserdata(gL, &nodes[READUINT16(save_p)], META_NODE); break; + case ARCH_FFLOOR: + { + sector_t *sector = §ors[READUINT16(save_p)]; + UINT16 id = READUINT16(save_p); + ffloor_t *rover = P_GetFFloorByID(sector, id); + if (rover) + LUA_PushUserdata(gL, rover, META_FFLOOR); + break; + } case ARCH_MAPHEADER: LUA_PushUserdata(gL, §ors[READUINT16(save_p)], META_MAPHEADER); break; diff --git a/src/p_spec.c b/src/p_spec.c index 3ca697295..51c2d03d8 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4708,6 +4708,13 @@ void P_UpdateSpecials(void) } } +/** Gets a 3Dfloor by control sector. + * + * \param sec Target sector. + * \param sec2 Control sector. + * \return Pointer to found 3Dfloor, or NULL. + * \sa P_GetFFloorByID + */ static inline ffloor_t *P_GetFFloorBySec(sector_t *sec, sector_t *sec2) { ffloor_t *rover; @@ -4720,6 +4727,28 @@ static inline ffloor_t *P_GetFFloorBySec(sector_t *sec, sector_t *sec2) return NULL; } +/** Gets a 3Dfloor by ID number. + * + * \param sec Target sector. + * \param id ID of 3Dfloor in target sector. Can be a number from 0 to sec->numattached-1. + * \return Pointer to found 3Dfloor, or NULL. + * \sa P_GetFFloorBySec + */ +ffloor_t *P_GetFFloorByID(sector_t *sec, UINT16 id) +{ + ffloor_t *rover; + UINT16 i = 0; + + if (!sec->ffloors) + return NULL; + if (id >= sec->numattached) + return NULL; // ID out of range + for (rover = sec->ffloors; rover; rover = rover->next) + if (i++ == id) + return rover; + return NULL; +} + /** Adds a newly formed 3Dfloor structure to a sector's ffloors list. * * \param sec Target sector. diff --git a/src/p_spec.h b/src/p_spec.h index a8f9ac492..23e4cfdf9 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -64,6 +64,8 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller void P_LinedefExecute(INT16 tag, mobj_t *actor, sector_t *caller); void P_ChangeSectorTag(UINT32 sector, INT16 newtag); +ffloor_t *P_GetFFloorByID(sector_t *sec, UINT16 id); + // // P_LIGHTS // From 35d89a4fbfb1002199cefe22ce177e31be703c98 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 20 Jul 2016 21:21:14 +0100 Subject: [PATCH 079/808] add DMG_* constants to dehacked.c lists --- src/dehacked.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/dehacked.c b/src/dehacked.c index 75235e054..023a872cf 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7165,6 +7165,22 @@ struct { {"PAL_MIXUP",PAL_MIXUP}, {"PAL_RECYCLE",PAL_RECYCLE}, {"PAL_NUKE",PAL_NUKE}, + // for P_DamageMobj + //// Damage types + {"DMG_WATER",DMG_WATER}, + {"DMG_FIRE",DMG_FIRE}, + {"DMG_ELECTRIC",DMG_ELECTRIC}, + {"DMG_SPIKE",DMG_SPIKE}, + {"DMG_NUKE",DMG_NUKE}, + //// Death types + {"DMG_INSTAKILL",DMG_INSTAKILL}, + {"DMG_DROWNED",DMG_DROWNED}, + {"DMG_SPACEDROWN",DMG_SPACEDROWN}, + {"DMG_DEATHPIT",DMG_DEATHPIT}, + {"DMG_CRUSHED",DMG_CRUSHED}, + {"DMG_SPECTATOR",DMG_SPECTATOR}, + //// Masks + {"DMG_DEATHMASK",DMG_DEATHMASK}, // Gametypes, for use with global var "gametype" {"GT_COOP",GT_COOP}, From ea65e9e54f40c43914f5a4bc0a29da2c5ae55cd8 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 20 Jul 2016 22:02:02 +0100 Subject: [PATCH 080/808] Add "damagetype" argument to functions for Lua hooks ShouldDamage, MobjDamage, MobjDeath and HurtMsg --- src/lua_hook.h | 8 ++++---- src/lua_hooklib.c | 52 +++++++++++++++++++++++++++-------------------- src/p_inter.c | 18 ++++++++-------- 3 files changed, 43 insertions(+), 35 deletions(-) diff --git a/src/lua_hook.h b/src/lua_hook.h index 804d99e12..d2ce0d826 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -62,9 +62,9 @@ boolean LUAh_TouchSpecial(mobj_t *special, mobj_t *toucher); // Hook for P_Touch #define LUAh_MobjFuse(mo) LUAh_MobjHook(mo, hook_MobjFuse) // Hook for mobj->fuse == 0 by mobj type #define LUAh_MobjThinker(mo) LUAh_MobjHook(mo, hook_MobjThinker) // Hook for P_MobjThinker or P_SceneryThinker by mobj type #define LUAh_BossThinker(mo) LUAh_MobjHook(mo, hook_BossThinker) // Hook for P_GenericBossThinker by mobj type -UINT8 LUAh_ShouldDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage); // Hook for P_DamageMobj by mobj type (Should mobj take damage?) -boolean LUAh_MobjDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage); // Hook for P_DamageMobj by mobj type (Mobj actually takes damage!) -boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source); // Hook for P_KillMobj by mobj type +UINT8 LUAh_ShouldDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype); // Hook for P_DamageMobj by mobj type (Should mobj take damage?) +boolean LUAh_MobjDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype); // Hook for P_DamageMobj by mobj type (Mobj actually takes damage!) +boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damagetype); // Hook for P_KillMobj by mobj type #define LUAh_BossDeath(mo) LUAh_MobjHook(mo, hook_BossDeath) // Hook for A_BossDeath by mobj type #define LUAh_MobjRemoved(mo) LUAh_MobjHook(mo, hook_MobjRemoved) // Hook for P_RemoveMobj by mobj type #define LUAh_JumpSpecial(player) LUAh_PlayerHook(player, hook_JumpSpecial) // Hook for P_DoJumpStuff (Any-jumping) @@ -75,7 +75,7 @@ boolean LUAh_BotTiccmd(player_t *bot, ticcmd_t *cmd); // Hook for B_BuildTiccmd boolean LUAh_BotAI(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd); // Hook for B_BuildTailsTiccmd by skin name boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector); // Hook for linedef executors boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg); // Hook for chat messages -boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source); // Hook for hurt messages +boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source, UINT8 damagetype); // Hook for hurt messages #define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for G_SpawnPlayer #endif diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 1b9652571..e95b75eda 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -412,7 +412,7 @@ boolean LUAh_TouchSpecial(mobj_t *special, mobj_t *toucher) } // Hook for P_DamageMobj by mobj type (Should mobj take damage?) -UINT8 LUAh_ShouldDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage) +UINT8 LUAh_ShouldDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype) { hook_p hookp; UINT8 shouldDamage = 0; // 0 = default, 1 = force yes, 2 = force no. @@ -431,14 +431,16 @@ UINT8 LUAh_ShouldDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 LUA_PushUserdata(gL, inflictor, META_MOBJ); LUA_PushUserdata(gL, source, META_MOBJ); lua_pushinteger(gL, damage); + lua_pushinteger(gL, damagetype); } lua_pushfstring(gL, FMT_HOOKID, hookp->id); lua_gettable(gL, LUA_REGISTRYINDEX); - lua_pushvalue(gL, -5); - lua_pushvalue(gL, -5); - lua_pushvalue(gL, -5); - lua_pushvalue(gL, -5); - if (lua_pcall(gL, 4, 1, 0)) { + lua_pushvalue(gL, -6); + lua_pushvalue(gL, -6); + lua_pushvalue(gL, -6); + lua_pushvalue(gL, -6); + lua_pushvalue(gL, -6); + if (lua_pcall(gL, 5, 1, 0)) { if (!hookp->error || cv_debug & DBG_LUA) CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1)); lua_pop(gL, 1); @@ -460,7 +462,7 @@ UINT8 LUAh_ShouldDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 } // Hook for P_DamageMobj by mobj type (Mobj actually takes damage!) -boolean LUAh_MobjDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage) +boolean LUAh_MobjDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage, UINT8 damagetype) { hook_p hookp; boolean hooked = false; @@ -479,14 +481,16 @@ boolean LUAh_MobjDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 LUA_PushUserdata(gL, inflictor, META_MOBJ); LUA_PushUserdata(gL, source, META_MOBJ); lua_pushinteger(gL, damage); + lua_pushinteger(gL, damagetype); } lua_pushfstring(gL, FMT_HOOKID, hookp->id); lua_gettable(gL, LUA_REGISTRYINDEX); - lua_pushvalue(gL, -5); - lua_pushvalue(gL, -5); - lua_pushvalue(gL, -5); - lua_pushvalue(gL, -5); - if (lua_pcall(gL, 4, 1, 0)) { + lua_pushvalue(gL, -6); + lua_pushvalue(gL, -6); + lua_pushvalue(gL, -6); + lua_pushvalue(gL, -6); + lua_pushvalue(gL, -6); + if (lua_pcall(gL, 5, 1, 0)) { if (!hookp->error || cv_debug & DBG_LUA) CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1)); lua_pop(gL, 1); @@ -503,7 +507,7 @@ boolean LUAh_MobjDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 } // Hook for P_KillMobj by mobj type -boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source) +boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damagetype) { hook_p hookp; boolean hooked = false; @@ -521,13 +525,15 @@ boolean LUAh_MobjDeath(mobj_t *target, mobj_t *inflictor, mobj_t *source) LUA_PushUserdata(gL, target, META_MOBJ); LUA_PushUserdata(gL, inflictor, META_MOBJ); LUA_PushUserdata(gL, source, META_MOBJ); + lua_pushinteger(gL, damagetype); } lua_pushfstring(gL, FMT_HOOKID, hookp->id); lua_gettable(gL, LUA_REGISTRYINDEX); - lua_pushvalue(gL, -4); - lua_pushvalue(gL, -4); - lua_pushvalue(gL, -4); - if (lua_pcall(gL, 3, 1, 0)) { + lua_pushvalue(gL, -5); + lua_pushvalue(gL, -5); + lua_pushvalue(gL, -5); + lua_pushvalue(gL, -5); + if (lua_pcall(gL, 4, 1, 0)) { if (!hookp->error || cv_debug & DBG_LUA) CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1)); lua_pop(gL, 1); @@ -729,7 +735,7 @@ boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg) } // Hook for hurt messages -boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source) +boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source, UINT8 damagetype) { hook_p hookp; boolean hooked = false; @@ -747,13 +753,15 @@ boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source) LUA_PushUserdata(gL, player, META_PLAYER); LUA_PushUserdata(gL, inflictor, META_MOBJ); LUA_PushUserdata(gL, source, META_MOBJ); + lua_pushinteger(gL, damagetype); } lua_pushfstring(gL, FMT_HOOKID, hookp->id); lua_gettable(gL, LUA_REGISTRYINDEX); - lua_pushvalue(gL, -4); - lua_pushvalue(gL, -4); - lua_pushvalue(gL, -4); - if (lua_pcall(gL, 3, 1, 0)) { + lua_pushvalue(gL, -5); + lua_pushvalue(gL, -5); + lua_pushvalue(gL, -5); + lua_pushvalue(gL, -5); + if (lua_pcall(gL, 4, 1, 0)) { if (!hookp->error || cv_debug & DBG_LUA) CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1)); lua_pop(gL, 1); diff --git a/src/p_inter.c b/src/p_inter.c index 4a6a4445f..dee2aa824 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1565,7 +1565,7 @@ static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *sour return; // Presumably it's obvious what's happening in splitscreen. #ifdef HAVE_BLUA - if (LUAh_HurtMsg(player, inflictor, source)) + if (LUAh_HurtMsg(player, inflictor, source, damagetype)) return; #endif @@ -2037,7 +2037,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget target->health = 0; // This makes it easy to check if something's dead elsewhere. #ifdef HAVE_BLUA - if (LUAh_MobjDeath(target, inflictor, source) || P_MobjWasRemoved(target)) + if (LUAh_MobjDeath(target, inflictor, source, damagetype) || P_MobjWasRemoved(target)) return; #endif @@ -2917,7 +2917,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da // Everything above here can't be forced. if (!metalrecording) { - UINT8 shouldForce = LUAh_ShouldDamage(target, inflictor, source, damage); + UINT8 shouldForce = LUAh_ShouldDamage(target, inflictor, source, damage, damagetype); if (P_MobjWasRemoved(target)) return (shouldForce == 1); // mobj was removed if (shouldForce == 1) @@ -2960,7 +2960,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da return false; #ifdef HAVE_BLUA - if (LUAh_MobjDamage(target, inflictor, source, damage) || P_MobjWasRemoved(target)) + if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype) || P_MobjWasRemoved(target)) return true; #endif @@ -2988,7 +2988,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da return false; #ifdef HAVE_BLUA - if (LUAh_MobjDamage(target, inflictor, source, damage) || P_MobjWasRemoved(target)) + if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype) || P_MobjWasRemoved(target)) return true; #endif @@ -2998,7 +2998,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da #ifdef HAVE_BLUA else if (target->flags & MF_ENEMY) { - if (LUAh_MobjDamage(target, inflictor, source, damage) || P_MobjWasRemoved(target)) + if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype) || P_MobjWasRemoved(target)) return true; } #endif @@ -3046,7 +3046,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da return false; // Don't run eachother over in special stages and team games and such } #ifdef HAVE_BLUA - if (LUAh_MobjDamage(target, inflictor, source, damage)) + if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype)) return true; #endif P_NiGHTSDamage(target, source); // -5s :( @@ -3108,7 +3108,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da && player->powers[pw_super])) { #ifdef HAVE_BLUA - if (!LUAh_MobjDamage(target, inflictor, source, damage)) + if (!LUAh_MobjDamage(target, inflictor, source, damage, damagetype)) #endif P_SuperDamage(player, inflictor, source, damage); return true; @@ -3117,7 +3117,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da return false; } #ifdef HAVE_BLUA - else if (LUAh_MobjDamage(target, inflictor, source, damage)) + else if (LUAh_MobjDamage(target, inflictor, source, damage, damagetype)) return true; #endif else if (player->powers[pw_shield] || player->bot) //If One-Hit Shield From ad03bb52786fbfe1661976a3bd75bc29ae61d77d Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 23 Jul 2016 18:25:51 +0100 Subject: [PATCH 081/808] Force Shield's air ability is now the Drop Dash (thanks, Sonic Mania, for making me like the momentum redirection idea by recontextualising it to collision with the ground only!) * Press spin in midair to make the shield flash solid repeatedly and make a number of ding noises. * When the player with a flashing, dinging shield hits the ground, they are sent off in spinning form at the maximum of 2*abs(momz) VS the 3D hypotenuse of momx, momy, and momz. --- src/p_mobj.c | 43 +++++++++++++++++++++++++++++++++++-------- src/p_user.c | 9 +++++++++ 2 files changed, 44 insertions(+), 8 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 13dd15d21..fd4583891 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2981,14 +2981,25 @@ static void P_PlayerZMovement(mobj_t *mo) if (!(mo->player->pflags & PF_GLIDING)) mo->player->pflags &= ~PF_JUMPED; - if (((mo->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) && (mo->player->pflags & PF_SHIELDABILITY)) // Elemental pierce attack. + if (mo->player->pflags & PF_SHIELDABILITY) { - if (mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER)) // play a blunt sound - S_StartSound(mo, sfx_s3k4c); - else // create a fire pattern on the ground + if ((mo->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) // Elemental shield's stomp attack. { - S_StartSound(mo, sfx_s3k47); - P_ElementalFire(mo->player, true); + if (mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER)) // play a blunt sound + S_StartSound(mo, sfx_s3k4c); + else // create a fire pattern on the ground + { + S_StartSound(mo, sfx_s3k47); + P_ElementalFire(mo->player, true); + } + } + if ((mo->player->powers[pw_shield] & SH_FORCE) == SH_FORCE) // Force Shield's drop dash. + { + fixed_t magnitude = max(FixedHypot((FixedHypot(mo->momx, mo->momy)), mo->momz), abs(mo->momz)*2); // vertical momentum is amplified here, since otherwise this was kind of weak. + P_InstaThrust(mo, mo->angle, magnitude); + S_StartSound(mo, sfx_zoom); + mo->player->pflags |= PF_SPINNING; + P_SetPlayerMobjState(mo, S_PLAY_SPIN); } } mo->player->pflags &= ~(PF_THOKKED|PF_SHIELDABILITY); @@ -6482,7 +6493,6 @@ void P_MobjThinker(mobj_t *mobj) case MT_BLACKORB: case MT_WHITEORB: case MT_GREENORB: - case MT_BLUEORB: case MT_PITYORB: if (!P_AddShield(mobj)) return; @@ -6490,9 +6500,26 @@ void P_MobjThinker(mobj_t *mobj) case MT_YELLOWORB: if (!P_AddShield(mobj)) return; - if (mobj->target->player->homing) + if ((mobj->target) + && (mobj->target->player) + && (mobj->target->player->homing)) P_SetMobjState(mobj, mobj->info->painstate); break; + case MT_BLUEORB: + if (!P_AddShield(mobj)) + return; + if ((mobj->target) + && (mobj->target->player) + && (mobj->target->player->pflags & PF_SHIELDABILITY)) + { + mobj->frame &= ~FF_TRANSMASK; + if (!(leveltime & 15)) + { + S_StopSound(mobj->target); + S_StartSound(mobj->target, sfx_ding); + } + } + break; case MT_WATERDROP: P_SceneryCheckWater(mobj); if ((mobj->z <= mobj->floorz || mobj->z <= mobj->watertop) diff --git a/src/p_user.c b/src/p_user.c index 75c70135a..2d957aec3 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6940,6 +6940,15 @@ static void P_MovePlayer(player_t *player) P_SetObjectMomZ(player->mo, -24*FRACUNIT, false); } } + // Force shield activation + if ((player->powers[pw_shield] & SH_FORCE) == SH_FORCE) + { + if (!(player->pflags & PF_THOKKED)) + { + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + S_StartSound(player->mo, sfx_ding); + } + } } // Super Sonic move if (player->skin == 0 && player->powers[pw_super] && player->speed > FixedMul(5<mo->scale) From d0bb7293bd73c8a0ea4653fad3fb2ed2e6768a11 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 23 Jul 2016 21:01:40 +0100 Subject: [PATCH 082/808] Maximum Drop Dash speed of 75*FRACUNIT. --- src/p_mobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index fd4583891..86ff3259a 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2995,7 +2995,7 @@ static void P_PlayerZMovement(mobj_t *mo) } if ((mo->player->powers[pw_shield] & SH_FORCE) == SH_FORCE) // Force Shield's drop dash. { - fixed_t magnitude = max(FixedHypot((FixedHypot(mo->momx, mo->momy)), mo->momz), abs(mo->momz)*2); // vertical momentum is amplified here, since otherwise this was kind of weak. + fixed_t magnitude = min(max(FixedHypot((FixedHypot(mo->momx, mo->momy)), mo->momz), abs(mo->momz)*2), 75<angle, magnitude); S_StartSound(mo, sfx_zoom); mo->player->pflags |= PF_SPINNING; From 436dfbb24f6eb41586641f90f3c4a355c480c6a3 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 23 Jul 2016 21:37:32 +0100 Subject: [PATCH 083/808] Crashed in THZ1 when testing going down the long section at the end, EIP blames this line, wasn't really necessary in the first place... fair enough. --- src/p_mobj.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 86ff3259a..138455604 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6515,7 +6515,6 @@ void P_MobjThinker(mobj_t *mobj) mobj->frame &= ~FF_TRANSMASK; if (!(leveltime & 15)) { - S_StopSound(mobj->target); S_StartSound(mobj->target, sfx_ding); } } From fe5b8c58afb65c8545dfafce6d0109935f2af442 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 31 Jul 2016 20:51:39 +0100 Subject: [PATCH 084/808] Add basic support for animated sky textures --- src/hardware/hw_main.c | 6 +++--- src/r_plane.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index a83960177..e3d9bc218 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5325,7 +5325,7 @@ static void HWR_DrawSkyBackground(player_t *player) // 0--1 (void)player; - HWR_GetTexture(skytexture); + HWR_GetTexture(texturetranslation[skytexture]); //Hurdler: the sky is the only texture who need 4.0f instead of 1.0 // because it's called just after clearing the screen @@ -5345,7 +5345,7 @@ static void HWR_DrawSkyBackground(player_t *player) angle = (dup_viewangle + gr_xtoviewangle[0]); - dimensionmultiply = ((float)textures[skytexture]->width/256.0f); + dimensionmultiply = ((float)textures[texturetranslation[skytexture]]->width/256.0f); v[0].sow = v[3].sow = ((float) angle / ((ANGLE_90-1)*dimensionmultiply)); v[2].sow = v[1].sow = (-1.0f/dimensionmultiply)+((float) angle / ((ANGLE_90-1)*dimensionmultiply)); @@ -5354,7 +5354,7 @@ static void HWR_DrawSkyBackground(player_t *player) angle = aimingangle; aspectratio = (float)vid.width/(float)vid.height; - dimensionmultiply = ((float)textures[skytexture]->height/(128.0f*aspectratio)); + dimensionmultiply = ((float)textures[texturetranslation[skytexture]]->height/(128.0f*aspectratio)); angleturn = (((float)ANGLE_45-1.0f)*aspectratio)*dimensionmultiply; // Middle of the sky should always be at angle 0 diff --git a/src/r_plane.c b/src/r_plane.c index 19007d88f..ad30f4247 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -711,7 +711,7 @@ void R_DrawPlanes(void) angle = (pl->viewangle + xtoviewangle[x])>>ANGLETOSKYSHIFT; dc_x = x; dc_source = - R_GetColumn(skytexture, + R_GetColumn(texturetranslation[skytexture], angle); wallcolfunc(); } From f465de8f8c965a8a237662c51ad9b0f47faf3ccd Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 1 Aug 2016 21:07:01 +0100 Subject: [PATCH 085/808] Nev3r's vertical sky distortion --- src/r_plane.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/r_plane.c b/src/r_plane.c index 19007d88f..1474474b9 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -709,6 +709,7 @@ void R_DrawPlanes(void) if (dc_yl <= dc_yh) { angle = (pl->viewangle + xtoviewangle[x])>>ANGLETOSKYSHIFT; + dc_iscale = FixedMul(skyscale, FINECOSINE(xtoviewangle[x]>>ANGLETOFINESHIFT)); dc_x = x; dc_source = R_GetColumn(skytexture, From e3ab77ef2158f3d07e109826daf879bbbcc56dbf Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 4 Aug 2016 18:54:29 +0100 Subject: [PATCH 086/808] node.bbox now works with the format node.bbox(child, bboxcoord) child can be 0 or 1 (or "right" and "left", alternatively) bbox coord can be 0,1,2 or 3 (or "top", "bottom", "left" and "right", alternatively) Also added some support for bbox userdata taking "top" "bottom" "left" "right" fields. Not that there's any use for non-node bbox userdata just yet... --- src/lua_maplib.c | 106 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 95 insertions(+), 11 deletions(-) diff --git a/src/lua_maplib.c b/src/lua_maplib.c index d9fdc1274..0aea4acf7 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -231,6 +231,34 @@ static const char *const node_opt[] = { "children", NULL}; +enum nodechild_e { + nodechild_valid = 0, + nodechild_right, + nodechild_left, +}; + +static const char *const nodechild_opt[] = { + "valid", + "right", + "left", + NULL}; + +enum bbox_e { + bbox_valid = 0, + bbox_top, + bbox_bottom, + bbox_left, + bbox_right, +}; + +static const char *const bbox_opt[] = { + "valid", + "top", + "bottom", + "left", + "right", + NULL}; + static const char *const array_opt[] ={"iterate",NULL}; static const char *const valid_opt[] ={"valid",NULL}; @@ -968,7 +996,7 @@ static int node_num(lua_State *L) lua_pushinteger(L, node-nodes); return 1; } - +/* // node.bbox[i][j]: i = 0 or 1, j = 0 1 2 or 3 // NOTE: 2D arrays are NOT double pointers, // the second bbox will be directly after the first in memory (hence the way the bbox is pushed here) @@ -1000,6 +1028,52 @@ static int nodebbox_get(lua_State *L) LUA_PushUserdata(L, bbox + i*4*sizeof(fixed_t), META_BBOX); return 1; } +*/ +static int nodebbox_call(lua_State *L) +{ + fixed_t *bbox = *((fixed_t **)luaL_checkudata(L, 1, META_NODEBBOX)); + int i, j; + int n = lua_gettop(L); + + if (!bbox) + return luaL_error(L, "accessed node bbox doesn't exist anymore."); + if (n < 3) + return luaL_error(L, "arguments 2 and/or 3 not given (expected node.bbox(child, coord))"); + // get child + if (!lua_isnumber(L, 2)) { + enum nodechild_e field = luaL_checkoption(L, 2, nodechild_opt[0], nodechild_opt); + switch (field) { + case nodechild_right: i = 0; break; + case nodechild_left: i = 1; break; + default: + return luaL_error(L, "invalid node child \"%s\".", lua_tostring(L, 2)); + } + } + else { + i = lua_tointeger(L, 2); + if (i < 0 || i > 1) + return 0; + } + // get bbox coord + if (!lua_isnumber(L, 3)) { + enum bbox_e field = luaL_checkoption(L, 3, bbox_opt[0], bbox_opt); + switch (field) { + case bbox_top: j = BOXTOP; break; + case bbox_bottom: j = BOXBOTTOM; break; + case bbox_left: j = BOXLEFT; break; + case bbox_right: j = BOXRIGHT; break; + default: + return luaL_error(L, "invalid bbox coordinate \"%s\".", lua_tostring(L, 3)); + } + } + else { + j = lua_tointeger(L, 3); + if (j < 0 || j > 3) + return 0; + } + lua_pushinteger(L, bbox[i*4 + j]); + return 1; +} // node.children[i]: i = 0 or 1 static int nodechildren_get(lua_State *L) @@ -1039,23 +1113,31 @@ static int bbox_get(lua_State *L) lua_settop(L, 2); if (!lua_isnumber(L, 2)) { - int field = luaL_checkoption(L, 2, NULL, valid_opt); + enum bbox_e field = luaL_checkoption(L, 2, bbox_opt[0], bbox_opt); if (!bbox) { - if (field == 0) { + if (field == bbox_valid) { lua_pushboolean(L, 0); return 1; } - return luaL_error(L, "accessed node_t doesn't exist anymore."); - } else if (field == 0) { + return luaL_error(L, "accessed bbox doesn't exist anymore."); + } else if (field == bbox_valid) { lua_pushboolean(L, 1); return 1; } + else switch (field) { + case bbox_top: i = BOXTOP; break; + case bbox_bottom: i = BOXBOTTOM; break; + case bbox_left: i = BOXLEFT; break; + case bbox_right: i = BOXRIGHT; break; + default: return 0; + } + } + else { + i = lua_tointeger(L, 2); + if (i < 0 || i > 3) + return 0; } - - i = lua_tointeger(L, 2); - if (i < 0 || i > 3) - return 0; lua_pushinteger(L, bbox[i]); return 1; } @@ -1718,8 +1800,10 @@ int LUA_MapLib(lua_State *L) lua_pop(L, 1); luaL_newmetatable(L, META_NODEBBOX); - lua_pushcfunction(L, nodebbox_get); - lua_setfield(L, -2, "__index"); + //lua_pushcfunction(L, nodebbox_get); + //lua_setfield(L, -2, "__index"); + lua_pushcfunction(L, nodebbox_call); + lua_setfield(L, -2, "__call"); lua_pop(L, 1); luaL_newmetatable(L, META_NODECHILDREN); From ebb1fd14701bcfff2b19fe0106e25626388064d0 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 4 Aug 2016 19:20:34 +0100 Subject: [PATCH 087/808] node.children now also takes "right" and "left" as fields, as alternatives to integers 0 and 1 in other words node.children[0] == node.children.right and node.children[1] == node.children.left --- src/lua_maplib.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 0aea4acf7..2679e4ba9 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -1083,23 +1083,28 @@ static int nodechildren_get(lua_State *L) lua_settop(L, 2); if (!lua_isnumber(L, 2)) { - int field = luaL_checkoption(L, 2, NULL, valid_opt); + enum nodechild_e field = luaL_checkoption(L, 2, nodechild_opt[0], nodechild_opt); if (!children) { - if (field == 0) { + if (field == nodechild_valid) { lua_pushboolean(L, 0); return 1; } return luaL_error(L, "accessed node_t doesn't exist anymore."); - } else if (field == 0) { + } else if (field == nodechild_valid) { lua_pushboolean(L, 1); return 1; + } else switch (field) { + case nodechild_right: i = 0; break; + case nodechild_left: i = 1; break; + default: return 0; } } - - i = lua_tointeger(L, 2); - if (i < 0 || i > 1) - return 0; + else { + i = lua_tointeger(L, 2); + if (i < 0 || i > 1) + return 0; + } lua_pushinteger(L, children[i]); return 1; } @@ -1124,8 +1129,7 @@ static int bbox_get(lua_State *L) } else if (field == bbox_valid) { lua_pushboolean(L, 1); return 1; - } - else switch (field) { + } else switch (field) { case bbox_top: i = BOXTOP; break; case bbox_bottom: i = BOXBOTTOM; break; case bbox_left: i = BOXLEFT; break; From aa93f8a25c84404044712fc8b5deca7d1e31e554 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 10 Aug 2016 00:05:46 +0100 Subject: [PATCH 088/808] Refactored the movefactor changes that made the player go Looney Tunes style on ice. --- src/p_mobj.c | 2 +- src/p_saveg.c | 2 ++ src/p_spec.c | 20 ++++++++++++++------ src/p_spec.h | 1 + src/p_user.c | 7 +------ 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 70b96f4bc..28f24b921 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -7808,7 +7808,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) mobj->friction = ORIG_FRICTION; - mobj->movefactor = ORIG_FRICTION; + mobj->movefactor = FRACUNIT; // All mobjs are created at 100% scale. mobj->scale = FRACUNIT; diff --git a/src/p_saveg.c b/src/p_saveg.c index c99e15cfb..48f283bd3 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -1434,6 +1434,7 @@ static inline void SaveFrictionThinker(const thinker_t *th, const UINT8 type) const friction_t *ht = (const void *)th; WRITEUINT8(save_p, type); WRITEINT32(save_p, ht->friction); + WRITEINT32(save_p, ht->movefactor); WRITEINT32(save_p, ht->affectee); WRITEINT32(save_p, ht->referrer); WRITEUINT8(save_p, ht->roverfriction); @@ -2368,6 +2369,7 @@ static inline void LoadFrictionThinker(actionf_p1 thinker) friction_t *ht = Z_Malloc(sizeof (*ht), PU_LEVSPEC, NULL); ht->thinker.function.acp1 = thinker; ht->friction = READINT32(save_p); + ht->movefactor = READINT32(save_p); ht->affectee = READINT32(save_p); ht->referrer = READINT32(save_p); ht->roverfriction = READUINT8(save_p); diff --git a/src/p_spec.c b/src/p_spec.c index c6972c5eb..09228b7d8 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -109,7 +109,7 @@ static void P_AddFloatThinker(sector_t *sec, INT32 tag, line_t *sourceline); //static void P_AddBridgeThinker(line_t *sourceline, sector_t *sec); static void P_AddFakeFloorsByLine(size_t line, ffloortype_e ffloorflags, thinkerlist_t *secthinkers); static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec); -static void Add_Friction(INT32 friction, INT32 affectee, INT32 referrer); +static void Add_Friction(INT32 friction, INT32 movefactor, INT32 affectee, INT32 referrer); static void P_AddSpikeThinker(sector_t *sec, INT32 referrer); @@ -4932,7 +4932,7 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f f = (friction_t *)th; if (f->affectee == (INT32)sec2num) - Add_Friction(f->friction, (INT32)(sec-sectors), f->affectee); + Add_Friction(f->friction, f->movefactor, (INT32)(sec-sectors), f->affectee); } // Should this FOF have wind/current/pusher? else if(th->function.acp1 == (actionf_p1)T_Pusher) @@ -6978,12 +6978,13 @@ void T_Disappear(disappear_t *d) * \param roverfriction FOF or not * \sa T_Friction, P_SpawnFriction */ -static void Add_Friction(INT32 friction, INT32 affectee, INT32 referrer) +static void Add_Friction(INT32 friction, INT32 movefactor, INT32 affectee, INT32 referrer) { friction_t *f = Z_Calloc(sizeof *f, PU_LEVSPEC, NULL); f->thinker.function.acp1 = (actionf_p1)T_Friction; f->friction = friction; + f->movefactor = movefactor; f->affectee = affectee; if (referrer != -1) @@ -7044,7 +7045,7 @@ void T_Friction(friction_t *f) { thing->friction = f->friction; if (thing->player) - thing->movefactor = f->friction; + thing->movefactor = f->movefactor; } } else if (P_GetSpecialBottomZ(thing, sec, sec) == thing->floorz && (thing->friction == ORIG_FRICTION // normal friction? @@ -7052,7 +7053,7 @@ void T_Friction(friction_t *f) { thing->friction = f->friction; if (thing->player) - thing->movefactor = f->friction; + thing->movefactor = f->movefactor; } } node = node->m_snext; @@ -7070,6 +7071,7 @@ static void P_SpawnFriction(void) register INT32 s; fixed_t strength; // frontside texture offset controls magnitude fixed_t friction; // friction value to be applied during movement + INT32 movefactor; // applied to each player move to simulate inertia for (i = 0; i < numlines; i++, l++) if (l->special == 540) @@ -7088,8 +7090,14 @@ static void P_SpawnFriction(void) if (friction < 0) friction = 0; + movefactor = FixedDiv(ORIG_FRICTION, friction); + if (movefactor < FRACUNIT) + movefactor = 8*movefactor - 7*FRACUNIT; + else + movefactor = FRACUNIT; + for (s = -1; (s = P_FindSectorFromLineTag(l, s)) >= 0 ;) - Add_Friction(friction, s, -1); + Add_Friction(friction, movefactor, s, -1); } } diff --git a/src/p_spec.h b/src/p_spec.h index b38500288..c7e7af0b3 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -386,6 +386,7 @@ typedef struct { thinker_t thinker; ///< Thinker structure for friction. INT32 friction; ///< Friction value, 0xe800 = normal. + INT32 movefactor; ///< Inertia factor when adding to momentum, FRACUNIT = normal. INT32 affectee; ///< Number of affected sector. INT32 referrer; ///< If roverfriction == true, then this will contain the sector # of the control sector where the effect was applied. UINT8 roverfriction; ///< flag for whether friction originated from a FOF or not diff --git a/src/p_user.c b/src/p_user.c index 6aebbe642..c61f7d06f 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6369,11 +6369,6 @@ static void P_MovePlayer(player_t *player) runspd = FixedMul(player->runspeed, player->mo->scale); // Let's have some movement speed fun on low-friction surfaces, JUST for players... (high friction surfaces shouldn't have any adjustment, since the acceleration in this game is super high and that ends up cheesing high-friction surfaces.) - player->mo->movefactor = FixedDiv(ORIG_FRICTION, player->mo->movefactor); - if (player->mo->movefactor < FRACUNIT) - player->mo->movefactor = 8*player->mo->movefactor - 7*FRACUNIT; - else - player->mo->movefactor = FRACUNIT; runspd = FixedMul(runspd, player->mo->movefactor); // Control relinquishing stuff! @@ -6547,7 +6542,7 @@ static void P_MovePlayer(player_t *player) if (!player->mo->momx && !player->mo->momy && !player->mo->momz && player->panim == PA_WALK) P_SetPlayerMobjState(player->mo, S_PLAY_STND); - player->mo->movefactor = ORIG_FRICTION; // We're not going to do any more with this, so let's change it back for the next frame. + player->mo->movefactor = FRACUNIT; // We're not going to do any more with this, so let's change it back for the next frame. ////////////////// //GAMEPLAY STUFF// From 7b5fbad6a7c6795338e5d5f4c32b164a6b96f3e6 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 10 Aug 2016 00:31:16 +0100 Subject: [PATCH 089/808] Changes to match the new default value and to make player acceleration perfectly match what it was previously. --- src/p_saveg.c | 4 ++-- src/p_user.c | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/p_saveg.c b/src/p_saveg.c index 964e8b774..55dc9fbc6 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -1087,7 +1087,7 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) diff |= MD_TRACER; if (mobj->friction != ORIG_FRICTION) diff |= MD_FRICTION; - if (mobj->movefactor != ORIG_FRICTION_FACTOR) + if (mobj->movefactor != FRACUNIT) diff |= MD_MOVEFACTOR; if (mobj->fuse) diff |= MD_FUSE; @@ -2073,7 +2073,7 @@ static void LoadMobjThinker(actionf_p1 thinker) if (diff & MD_MOVEFACTOR) mobj->movefactor = READFIXED(save_p); else - mobj->movefactor = ORIG_FRICTION_FACTOR; + mobj->movefactor = FRACUNIT; if (diff & MD_FUSE) mobj->fuse = READINT32(save_p); if (diff & MD_WATERTOP) diff --git a/src/p_user.c b/src/p_user.c index 12da63e5f..ac95bf572 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4634,8 +4634,8 @@ static void P_3dMovement(player_t *player) acceleration = player->accelstart + (FixedDiv(player->speed, player->mo->scale)>>FRACBITS) * player->acceleration; } - // Friction-scaled acceleration... - acceleration = FixedMul(acceleration<mo->movefactor)>>FRACBITS; + if (player->mo->movefactor != FRACUNIT) // Friction-scaled acceleration... + acceleration = FixedMul(acceleration<mo->movefactor)>>FRACBITS; // Forward movement if (player->climbing) @@ -6291,8 +6291,7 @@ static void P_SkidStuff(player_t *player) // If your push angle is more than this close to a full 180 degrees, trigger a skid. if (dang > ANGLE_157h) { - //player->skidtime = TICRATE/2; - player->skidtime = (FixedDiv(35<<(FRACBITS-1), FixedSqrt(player->mo->movefactor)))>>FRACBITS; + player->skidtime = (player->mo->movefactor == FRACUNIT) ? TICRATE/2 : (FixedDiv(35<<(FRACBITS-1), FixedSqrt(player->mo->movefactor)))>>FRACBITS; S_StartSound(player->mo, sfx_skid); if (player->panim != PA_WALK) P_SetPlayerMobjState(player->mo, S_PLAY_WALK); From 76e53ee3b675c9ff8b5819a685d0cfa8c82140af Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 15 Aug 2016 20:54:05 +0100 Subject: [PATCH 090/808] this is shitty and glitchy but it compiles remove all the places where i've set vis->scalestep to anything other than 0 to see something that LOOKS okay, but doesn't fulfil exactly what i want (that being a sprite that looks exactly like a midtexture) --- src/r_things.c | 30 ++++++++++++++++++++++++++---- src/r_things.h | 1 + 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index 108589493..44cb81132 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -913,6 +913,9 @@ static void R_DrawVisSprite(vissprite_t *vis) for (dc_x = vis->x1; dc_x <= vis->x2; dc_x++, frac += vis->xiscale) { #ifdef RANGECHECK + sprtopscreen = (centeryfrac - FixedMul(dc_texturemid, spryscale)); + dc_iscale = 0xffffffffu / (unsigned)spryscale; + texturecolumn = frac>>FRACBITS; if (texturecolumn < 0 || texturecolumn >= SHORT(patch->width)) @@ -925,6 +928,7 @@ static void R_DrawVisSprite(vissprite_t *vis) R_DrawFlippedMaskedColumn(column, patch->height); else R_DrawMaskedColumn(column); + spryscale += vis->scalestep; } colfunc = basecolfunc; @@ -1109,6 +1113,7 @@ static void R_ProjectSprite(mobj_t *thing) angle_t ang; fixed_t iscale; + fixed_t scalestep = 0; // toast '16 //SoM: 3/17/2000 fixed_t gz, gzt; @@ -1116,6 +1121,8 @@ static void R_ProjectSprite(mobj_t *thing) INT32 light = 0; fixed_t this_scale = thing->scale; + fixed_t ang_scale = FRACUNIT; + // transform the origin point tr_x = thing->x - viewx; tr_y = thing->y - viewy; @@ -1186,6 +1193,15 @@ static void R_ProjectSprite(mobj_t *thing) I_Error("R_ProjectSprite: sprframes NULL for sprite %d\n", thing->sprite); #endif + if (1) //(sprframe->rotate != SRF_SINGLE || flatsprite) + ang = R_PointToAngle (thing->x, thing->y) - thing->angle; + + if (1) //(flatsprite) + { + ang_scale = abs(FINESINE(ang>>ANGLETOFINESHIFT)); + scalestep = (FINECOSINE(ang>>ANGLETOFINESHIFT)); + } + if (sprframe->rotate == SRF_SINGLE) { // use single rotation for all views @@ -1196,7 +1212,7 @@ static void R_ProjectSprite(mobj_t *thing) else { // choose a different rotation based on player view - ang = R_PointToAngle (thing->x, thing->y) - thing->angle; + //ang = R_PointToAngle (thing->x, thing->y) - thing->angle; if ((sprframe->rotate & SRF_RIGHT) && (ang < ANGLE_180)) // See from right rot = 6; // F7 slot @@ -1217,22 +1233,27 @@ static void R_ProjectSprite(mobj_t *thing) // calculate edges of the shape if (flip) - tx -= FixedMul(spritecachedinfo[lump].width-spritecachedinfo[lump].offset, this_scale); + tx -= FixedMul(spritecachedinfo[lump].width-spritecachedinfo[lump].offset, FixedMul(this_scale, ang_scale)); else - tx -= FixedMul(spritecachedinfo[lump].offset, this_scale); + tx -= FixedMul(spritecachedinfo[lump].offset, FixedMul(this_scale, ang_scale)); x1 = (centerxfrac + FixedMul (tx,xscale)) >>FRACBITS; // off the right side? if (x1 > viewwidth) return; - tx += FixedMul(spritecachedinfo[lump].width, this_scale); + tx += FixedMul(spritecachedinfo[lump].width, FixedMul(this_scale, ang_scale)); x2 = ((centerxfrac + FixedMul (tx,xscale)) >>FRACBITS) - 1; // off the left side if (x2 < 0) return; + if (1) // (flatsprite) + yscale = yscale - (x2 - x1)*scalestep/2; + + xscale = FixedMul(xscale, ang_scale); + // PORTAL SPRITE CLIPPING if (portalrender) { @@ -1323,6 +1344,7 @@ static void R_ProjectSprite(mobj_t *thing) vis->pz = thing->z; vis->pzt = vis->pz + vis->thingheight; vis->texturemid = vis->gzt - viewz; + vis->scalestep = scalestep; vis->mobj = thing; // Easy access! Tails 06-07-2002 diff --git a/src/r_things.h b/src/r_things.h index 7b8b3eb0b..0941082aa 100644 --- a/src/r_things.h +++ b/src/r_things.h @@ -136,6 +136,7 @@ typedef struct vissprite_s fixed_t startfrac; // horizontal position of x1 fixed_t scale; + fixed_t scalestep; // only for flat sprites, 0 otherwise fixed_t xiscale; // negative if flipped fixed_t texturemid; From df9ad4a0e67b18968e1592ce08e1bf8daa81b66e Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 16 Aug 2016 17:15:39 +0100 Subject: [PATCH 091/808] wall-scroll-by-linedef specials now use just linedef dx/dy to determine scrolling direction, rather than the complex system that was in place before If there's any reason to bring the old system back we could make it togglable by one of the linedef flags I suppose. Not that many people would actually use it though, most likely --- src/p_spec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/p_spec.c b/src/p_spec.c index a3d6cecfa..4573a9cd4 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -6719,6 +6719,7 @@ static void Add_Scroller(INT32 type, fixed_t dx, fixed_t dy, INT32 control, INT3 P_AddThinker(&s->thinker); } +#if 0 /** Adds a wall scroller. * Scroll amount is rotated with respect to wall's linedef first, so that * scrolling towards the wall in a perpendicular direction is translated into @@ -6743,6 +6744,7 @@ static void Add_WallScroller(fixed_t dx, fixed_t dy, const line_t *l, INT32 cont y = -FixedDiv(FixedMul(dx, l->dy) - FixedMul(dy, l->dx), d); Add_Scroller(sc_side, x, y, control, *l->sidenum, accel, 0); } +#endif /** Initializes the scrollers. * @@ -6826,7 +6828,7 @@ static void P_SpawnScrollers(void) case 502: for (s = -1; (s = P_FindLineFromLineTag(l, s)) >= 0 ;) if (s != (INT32)i) - Add_WallScroller(dx, dy, lines+s, control, accel); + Add_Scroller(sc_side, dx, dy, control, lines[s].sidenum[0], accel, 0); //Add_WallScroller(dx, dy, lines+s, control, accel); break; case 505: From 27cdef0075ba4b8424092c2bd13caaf61890c716 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 16 Aug 2016 23:17:45 +0100 Subject: [PATCH 092/808] WOOPS, did not mean to leave it in the rangecheck, now it works close to desired some complicated mathemagic leads to something which... seems CLOSE, but not perfectly accurate, so i think i need to tweak it more http://gfycat.com/JovialSpitefulAmericancrayfish for current behaviour --- src/r_things.c | 41 +++++++++++++++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index 44cb81132..5898eb21f 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -913,8 +913,6 @@ static void R_DrawVisSprite(vissprite_t *vis) for (dc_x = vis->x1; dc_x <= vis->x2; dc_x++, frac += vis->xiscale) { #ifdef RANGECHECK - sprtopscreen = (centeryfrac - FixedMul(dc_texturemid, spryscale)); - dc_iscale = 0xffffffffu / (unsigned)spryscale; texturecolumn = frac>>FRACBITS; @@ -924,6 +922,11 @@ static void R_DrawVisSprite(vissprite_t *vis) #else column = (column_t *)((UINT8 *)patch + LONG(patch->columnofs[frac>>FRACBITS])); #endif + if (vis->scalestep) + { + sprtopscreen = (centeryfrac - FixedMul(dc_texturemid, spryscale)); + dc_iscale = FixedMul((0xffffffffu / (unsigned)spryscale), this_scale); + } if (vis->vflip) R_DrawFlippedMaskedColumn(column, patch->height); else @@ -1114,6 +1117,7 @@ static void R_ProjectSprite(mobj_t *thing) angle_t ang; fixed_t iscale; fixed_t scalestep = 0; // toast '16 + fixed_t leftoffset; //SoM: 3/17/2000 fixed_t gz, gzt; @@ -1199,7 +1203,7 @@ static void R_ProjectSprite(mobj_t *thing) if (1) //(flatsprite) { ang_scale = abs(FINESINE(ang>>ANGLETOFINESHIFT)); - scalestep = (FINECOSINE(ang>>ANGLETOFINESHIFT)); + //scalestep = (FINECOSINE(ang>>ANGLETOFINESHIFT)); } if (sprframe->rotate == SRF_SINGLE) @@ -1233,9 +1237,10 @@ static void R_ProjectSprite(mobj_t *thing) // calculate edges of the shape if (flip) - tx -= FixedMul(spritecachedinfo[lump].width-spritecachedinfo[lump].offset, FixedMul(this_scale, ang_scale)); + leftoffset = spritecachedinfo[lump].width-spritecachedinfo[lump].offset; else - tx -= FixedMul(spritecachedinfo[lump].offset, FixedMul(this_scale, ang_scale)); + leftoffset = spritecachedinfo[lump].offset; + tx -= FixedMul(leftoffset, FixedMul(this_scale, ang_scale)); x1 = (centerxfrac + FixedMul (tx,xscale)) >>FRACBITS; // off the right side? @@ -1250,7 +1255,31 @@ static void R_ProjectSprite(mobj_t *thing) return; if (1) // (flatsprite) - yscale = yscale - (x2 - x1)*scalestep/2; + { + fixed_t yscale2; + INT32 range; + + tr_x = thing->x + FixedMul(-leftoffset, FINECOSINE(ang>>ANGLETOFINESHIFT)) - viewx; + tr_y = thing->y + FixedMul(-leftoffset, FINESINE(ang>>ANGLETOFINESHIFT)) - viewy; + gxt = FixedMul(tr_x, viewcos); + gyt = -FixedMul(tr_y, viewsin); + tz = gxt-gyt; + yscale = FixedDiv(projectiony, tz); + + leftoffset += spritecachedinfo[lump].width; + tr_x = thing->x + FixedMul(leftoffset, FINECOSINE(ang>>ANGLETOFINESHIFT)) - viewx; + tr_y = thing->y + FixedMul(leftoffset, FINESINE(ang>>ANGLETOFINESHIFT)) - viewy; + gxt = FixedMul(tr_x, viewcos); + gyt = -FixedMul(tr_y, viewsin); + tz = gxt-gyt; + yscale2 = FixedDiv(projectiony, tz); + + if (x2 > x1) + range = (x2 - x1); + else + range = 1; + scalestep = (yscale2 - yscale)/range; + } xscale = FixedMul(xscale, ang_scale); From a2b26c3bf440e98971dde220a28e6bcf71bf7a5a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 16 Aug 2016 23:25:01 +0100 Subject: [PATCH 093/808] Forgot a border of screen consideration --- src/r_things.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/r_things.c b/src/r_things.c index 5898eb21f..f17b4ec52 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1413,7 +1413,10 @@ static void R_ProjectSprite(mobj_t *thing) } if (vis->x1 > x1) + { vis->startfrac += FixedDiv(vis->xiscale, this_scale)*(vis->x1-x1); + vis->scale += scalestep*(vis->x1 - x1); + } //Fab: lumppat is the lump number of the patch to use, this is different // than lumpid for sprites-in-pwad : the graphics are patched From 10a8682620c547f5b187633e12ea282b2eae76c6 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 16 Aug 2016 23:38:59 +0100 Subject: [PATCH 094/808] resolved issue where the sides had the opposite scales over ANGLE_180. also, i've sussed out WHAT'S going wrong here - the topleft pixel of the sprite will always be rendered at the height on the screen it would be rendered otherwise, which is causing the waving. now to figure out what to change to get that to move appropriately... --- src/r_things.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index f17b4ec52..6cb5bac6a 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1256,6 +1256,7 @@ static void R_ProjectSprite(mobj_t *thing) if (1) // (flatsprite) { + fixed_t yscale1; fixed_t yscale2; INT32 range; @@ -1264,7 +1265,7 @@ static void R_ProjectSprite(mobj_t *thing) gxt = FixedMul(tr_x, viewcos); gyt = -FixedMul(tr_y, viewsin); tz = gxt-gyt; - yscale = FixedDiv(projectiony, tz); + yscale1 = FixedDiv(projectiony, tz); leftoffset += spritecachedinfo[lump].width; tr_x = thing->x + FixedMul(leftoffset, FINECOSINE(ang>>ANGLETOFINESHIFT)) - viewx; @@ -1274,11 +1275,20 @@ static void R_ProjectSprite(mobj_t *thing) tz = gxt-gyt; yscale2 = FixedDiv(projectiony, tz); + if (ang >= ANGLE_180) + { + fixed_t temp = yscale2; + yscale2 = yscale1; + yscale1 = temp; + } + if (x2 > x1) range = (x2 - x1); else range = 1; - scalestep = (yscale2 - yscale)/range; + scalestep = (yscale2 - yscale1)/range; + yscale = yscale1; + //this_scale = FixedMul(this_scale, FixedDiv(yscale, yscale1)); } xscale = FixedMul(xscale, ang_scale); From 84c39c24f90da15fe637c80ae8cce32ef96baac8 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 17 Aug 2016 00:03:09 +0100 Subject: [PATCH 095/808] Renamed leftoffset to offset, to refer to its multifaceted uses. Also, discovered another undesirable bug, but don't understand exactly what's going on so won't describe it here. --- src/r_things.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index 6cb5bac6a..522171d7d 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1117,7 +1117,7 @@ static void R_ProjectSprite(mobj_t *thing) angle_t ang; fixed_t iscale; fixed_t scalestep = 0; // toast '16 - fixed_t leftoffset; + fixed_t offset; //SoM: 3/17/2000 fixed_t gz, gzt; @@ -1237,10 +1237,10 @@ static void R_ProjectSprite(mobj_t *thing) // calculate edges of the shape if (flip) - leftoffset = spritecachedinfo[lump].width-spritecachedinfo[lump].offset; + offset = spritecachedinfo[lump].width-spritecachedinfo[lump].offset; else - leftoffset = spritecachedinfo[lump].offset; - tx -= FixedMul(leftoffset, FixedMul(this_scale, ang_scale)); + offset = spritecachedinfo[lump].offset; + tx -= FixedMul(offset, FixedMul(this_scale, ang_scale)); x1 = (centerxfrac + FixedMul (tx,xscale)) >>FRACBITS; // off the right side? @@ -1260,16 +1260,16 @@ static void R_ProjectSprite(mobj_t *thing) fixed_t yscale2; INT32 range; - tr_x = thing->x + FixedMul(-leftoffset, FINECOSINE(ang>>ANGLETOFINESHIFT)) - viewx; - tr_y = thing->y + FixedMul(-leftoffset, FINESINE(ang>>ANGLETOFINESHIFT)) - viewy; + tr_x = thing->x + FixedMul(-offset, FINECOSINE(ang>>ANGLETOFINESHIFT)) - viewx; + tr_y = thing->y + FixedMul(-offset, FINESINE(ang>>ANGLETOFINESHIFT)) - viewy; gxt = FixedMul(tr_x, viewcos); gyt = -FixedMul(tr_y, viewsin); tz = gxt-gyt; yscale1 = FixedDiv(projectiony, tz); - leftoffset += spritecachedinfo[lump].width; - tr_x = thing->x + FixedMul(leftoffset, FINECOSINE(ang>>ANGLETOFINESHIFT)) - viewx; - tr_y = thing->y + FixedMul(leftoffset, FINESINE(ang>>ANGLETOFINESHIFT)) - viewy; + offset += spritecachedinfo[lump].width; + tr_x = thing->x + FixedMul(offset, FINECOSINE(ang>>ANGLETOFINESHIFT)) - viewx; + tr_y = thing->y + FixedMul(offset, FINESINE(ang>>ANGLETOFINESHIFT)) - viewy; gxt = FixedMul(tr_x, viewcos); gyt = -FixedMul(tr_y, viewsin); tz = gxt-gyt; From 63e58a02f8a5709d061472f7809db6b1788c7c05 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 17 Aug 2016 00:15:23 +0100 Subject: [PATCH 096/808] Fixed the issue mentioned in last commit, but still not the one from before that. Hrm. --- src/r_things.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index 522171d7d..5dec34d1d 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1260,16 +1260,16 @@ static void R_ProjectSprite(mobj_t *thing) fixed_t yscale2; INT32 range; - tr_x = thing->x + FixedMul(-offset, FINECOSINE(ang>>ANGLETOFINESHIFT)) - viewx; - tr_y = thing->y + FixedMul(-offset, FINESINE(ang>>ANGLETOFINESHIFT)) - viewy; + tr_x = thing->x + FixedMul(-offset, FINECOSINE(thing->angle>>ANGLETOFINESHIFT)) - viewx; + tr_y = thing->y + FixedMul(-offset, FINESINE(thing->angle>>ANGLETOFINESHIFT)) - viewy; gxt = FixedMul(tr_x, viewcos); gyt = -FixedMul(tr_y, viewsin); tz = gxt-gyt; yscale1 = FixedDiv(projectiony, tz); offset += spritecachedinfo[lump].width; - tr_x = thing->x + FixedMul(offset, FINECOSINE(ang>>ANGLETOFINESHIFT)) - viewx; - tr_y = thing->y + FixedMul(offset, FINESINE(ang>>ANGLETOFINESHIFT)) - viewy; + tr_x = thing->x + FixedMul(offset, FINECOSINE(thing->angle>>ANGLETOFINESHIFT)) - viewx; + tr_y = thing->y + FixedMul(offset, FINESINE(thing->angle>>ANGLETOFINESHIFT)) - viewy; gxt = FixedMul(tr_x, viewcos); gyt = -FixedMul(tr_y, viewsin); tz = gxt-gyt; From 2244e9162be351030438e1e4203812e6c5936a26 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 17 Aug 2016 19:09:59 +0100 Subject: [PATCH 097/808] Some overflow checks. They're not proper like the other overflow checks, but they remove all the situations I've been able to discover without making stuff unnecessarily disappear. --- src/r_things.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/r_things.c b/src/r_things.c index 5dec34d1d..155e3efdc 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1266,6 +1266,7 @@ static void R_ProjectSprite(mobj_t *thing) gyt = -FixedMul(tr_y, viewsin); tz = gxt-gyt; yscale1 = FixedDiv(projectiony, tz); + if (yscale1 < 64) return; // Fix some funky visuals offset += spritecachedinfo[lump].width; tr_x = thing->x + FixedMul(offset, FINECOSINE(thing->angle>>ANGLETOFINESHIFT)) - viewx; @@ -1274,6 +1275,7 @@ static void R_ProjectSprite(mobj_t *thing) gyt = -FixedMul(tr_y, viewsin); tz = gxt-gyt; yscale2 = FixedDiv(projectiony, tz); + if (yscale2 < 64) return; // Fix some funky visuals if (ang >= ANGLE_180) { @@ -1287,8 +1289,8 @@ static void R_ProjectSprite(mobj_t *thing) else range = 1; scalestep = (yscale2 - yscale1)/range; - yscale = yscale1; //this_scale = FixedMul(this_scale, FixedDiv(yscale, yscale1)); + yscale = yscale1; } xscale = FixedMul(xscale, ang_scale); From 709665945059f9bc733e5ed6358ba71d62fcab80 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 17 Aug 2016 21:11:05 +0100 Subject: [PATCH 098/808] Thanks to MI for helping me notice a scaling issue by code alone --- src/r_things.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_things.c b/src/r_things.c index 155e3efdc..7000dc05b 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -925,7 +925,7 @@ static void R_DrawVisSprite(vissprite_t *vis) if (vis->scalestep) { sprtopscreen = (centeryfrac - FixedMul(dc_texturemid, spryscale)); - dc_iscale = FixedMul((0xffffffffu / (unsigned)spryscale), this_scale); + dc_iscale = FixedDiv((0xffffffffu / (unsigned)spryscale), this_scale); } if (vis->vflip) R_DrawFlippedMaskedColumn(column, patch->height); From 6c559946f0a4af39fda31c743f5349a5fe8738b9 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 17 Aug 2016 21:14:01 +0100 Subject: [PATCH 099/808] ok no i misunderstood what he was getting at --- src/r_things.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/r_things.c b/src/r_things.c index 7000dc05b..e581b124b 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -884,6 +884,7 @@ static void R_DrawVisSprite(vissprite_t *vis) if (!vis->isScaled) { vis->scale = FixedMul(vis->scale, this_scale); + vis->scalestep = FixedMul(vis->scalestep, this_scale); spryscale = vis->scale; dc_iscale = FixedDiv(FRACUNIT, vis->scale); vis->xiscale = FixedDiv(vis->xiscale,this_scale); @@ -925,7 +926,7 @@ static void R_DrawVisSprite(vissprite_t *vis) if (vis->scalestep) { sprtopscreen = (centeryfrac - FixedMul(dc_texturemid, spryscale)); - dc_iscale = FixedDiv((0xffffffffu / (unsigned)spryscale), this_scale); + dc_iscale = (0xffffffffu / (unsigned)spryscale) } if (vis->vflip) R_DrawFlippedMaskedColumn(column, patch->height); From 66a737a7f0839cd729eaec05679b06ecba26081f Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 17 Aug 2016 21:24:53 +0100 Subject: [PATCH 100/808] fuuuuuuuu --- src/r_things.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_things.c b/src/r_things.c index e581b124b..ee441b7d5 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -926,7 +926,7 @@ static void R_DrawVisSprite(vissprite_t *vis) if (vis->scalestep) { sprtopscreen = (centeryfrac - FixedMul(dc_texturemid, spryscale)); - dc_iscale = (0xffffffffu / (unsigned)spryscale) + dc_iscale = (0xffffffffu / (unsigned)spryscale); } if (vis->vflip) R_DrawFlippedMaskedColumn(column, patch->height); From 9231a4653c400a77bfc47ad132bf6841f5b00d15 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 17 Aug 2016 22:19:28 +0100 Subject: [PATCH 101/808] SORTED, THANKS MI http://gfycat.com/SimpleShallowDeviltasmanian now to put this behind some sort of flag and optimise it --- src/r_things.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index ee441b7d5..7892dbb7b 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1238,10 +1238,10 @@ static void R_ProjectSprite(mobj_t *thing) // calculate edges of the shape if (flip) - offset = spritecachedinfo[lump].width-spritecachedinfo[lump].offset; + offset = spritecachedinfo[lump].offset - spritecachedinfo[lump].width; else - offset = spritecachedinfo[lump].offset; - tx -= FixedMul(offset, FixedMul(this_scale, ang_scale)); + offset = -spritecachedinfo[lump].offset; + tx += FixedMul(offset, FixedMul(this_scale, ang_scale)); x1 = (centerxfrac + FixedMul (tx,xscale)) >>FRACBITS; // off the right side? @@ -1257,17 +1257,16 @@ static void R_ProjectSprite(mobj_t *thing) if (1) // (flatsprite) { - fixed_t yscale1; fixed_t yscale2; INT32 range; - tr_x = thing->x + FixedMul(-offset, FINECOSINE(thing->angle>>ANGLETOFINESHIFT)) - viewx; - tr_y = thing->y + FixedMul(-offset, FINESINE(thing->angle>>ANGLETOFINESHIFT)) - viewy; + tr_x = thing->x + FixedMul(offset, FINECOSINE(thing->angle>>ANGLETOFINESHIFT)) - viewx; + tr_y = thing->y + FixedMul(offset, FINESINE(thing->angle>>ANGLETOFINESHIFT)) - viewy; gxt = FixedMul(tr_x, viewcos); gyt = -FixedMul(tr_y, viewsin); tz = gxt-gyt; - yscale1 = FixedDiv(projectiony, tz); - if (yscale1 < 64) return; // Fix some funky visuals + yscale = FixedDiv(projectiony, tz); + if (yscale < 64) return; // Fix some funky visuals offset += spritecachedinfo[lump].width; tr_x = thing->x + FixedMul(offset, FINECOSINE(thing->angle>>ANGLETOFINESHIFT)) - viewx; @@ -1281,17 +1280,15 @@ static void R_ProjectSprite(mobj_t *thing) if (ang >= ANGLE_180) { fixed_t temp = yscale2; - yscale2 = yscale1; - yscale1 = temp; + yscale2 = yscale; + yscale = temp; } if (x2 > x1) range = (x2 - x1); else range = 1; - scalestep = (yscale2 - yscale1)/range; - //this_scale = FixedMul(this_scale, FixedDiv(yscale, yscale1)); - yscale = yscale1; + scalestep = (yscale2 - yscale)/range; } xscale = FixedMul(xscale, ang_scale); From 2d3ebc5e49d63d7427bf155023322b1af9ee5a4c Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 18 Aug 2016 12:40:45 +0100 Subject: [PATCH 102/808] Fixed the last of the odd stretching by: * recognising that the offsets weren't going to be accurate if you just SWAPPED yscale and yscale2 over 180 degrees * taking scale into account consistently also, some optimisations --- src/r_things.c | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index 7892dbb7b..3d84813bb 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1117,8 +1117,9 @@ static void R_ProjectSprite(mobj_t *thing) angle_t ang; fixed_t iscale; - fixed_t scalestep = 0; // toast '16 - fixed_t offset; + fixed_t scalestep; // toast '16 + fixed_t offset, offset2; + boolean flatsprite = true; //(thing->flags2 & MF2_PAPER); //SoM: 3/17/2000 fixed_t gz, gzt; @@ -1198,13 +1199,11 @@ static void R_ProjectSprite(mobj_t *thing) I_Error("R_ProjectSprite: sprframes NULL for sprite %d\n", thing->sprite); #endif - if (1) //(sprframe->rotate != SRF_SINGLE || flatsprite) - ang = R_PointToAngle (thing->x, thing->y) - thing->angle; - - if (1) //(flatsprite) + if (sprframe->rotate != SRF_SINGLE || flatsprite) { - ang_scale = abs(FINESINE(ang>>ANGLETOFINESHIFT)); - //scalestep = (FINECOSINE(ang>>ANGLETOFINESHIFT)); + ang = R_PointToAngle (thing->x, thing->y) - thing->angle; + if (flatsprite) + ang_scale = abs(FINESINE(ang>>ANGLETOFINESHIFT)); } if (sprframe->rotate == SRF_SINGLE) @@ -1241,25 +1240,34 @@ static void R_ProjectSprite(mobj_t *thing) offset = spritecachedinfo[lump].offset - spritecachedinfo[lump].width; else offset = -spritecachedinfo[lump].offset; - tx += FixedMul(offset, FixedMul(this_scale, ang_scale)); + offset = FixedMul(offset, this_scale); + tx += FixedMul(offset, ang_scale); x1 = (centerxfrac + FixedMul (tx,xscale)) >>FRACBITS; // off the right side? if (x1 > viewwidth) return; - tx += FixedMul(spritecachedinfo[lump].width, FixedMul(this_scale, ang_scale)); + offset2 = FixedMul(spritecachedinfo[lump].width, this_scale); + tx += FixedMul(offset2, ang_scale); x2 = ((centerxfrac + FixedMul (tx,xscale)) >>FRACBITS) - 1; // off the left side if (x2 < 0) return; - if (1) // (flatsprite) + if (flatsprite) { fixed_t yscale2; INT32 range; + if (ang >= ANGLE_180) + { + offset *= -1; + offset2 *= -1; + } + offset2 += offset; + tr_x = thing->x + FixedMul(offset, FINECOSINE(thing->angle>>ANGLETOFINESHIFT)) - viewx; tr_y = thing->y + FixedMul(offset, FINESINE(thing->angle>>ANGLETOFINESHIFT)) - viewy; gxt = FixedMul(tr_x, viewcos); @@ -1268,28 +1276,23 @@ static void R_ProjectSprite(mobj_t *thing) yscale = FixedDiv(projectiony, tz); if (yscale < 64) return; // Fix some funky visuals - offset += spritecachedinfo[lump].width; - tr_x = thing->x + FixedMul(offset, FINECOSINE(thing->angle>>ANGLETOFINESHIFT)) - viewx; - tr_y = thing->y + FixedMul(offset, FINESINE(thing->angle>>ANGLETOFINESHIFT)) - viewy; + tr_x = thing->x + FixedMul(offset2, FINECOSINE(thing->angle>>ANGLETOFINESHIFT)) - viewx; + tr_y = thing->y + FixedMul(offset2, FINESINE(thing->angle>>ANGLETOFINESHIFT)) - viewy; gxt = FixedMul(tr_x, viewcos); gyt = -FixedMul(tr_y, viewsin); tz = gxt-gyt; yscale2 = FixedDiv(projectiony, tz); if (yscale2 < 64) return; // Fix some funky visuals - if (ang >= ANGLE_180) - { - fixed_t temp = yscale2; - yscale2 = yscale; - yscale = temp; - } - if (x2 > x1) range = (x2 - x1); else range = 1; + scalestep = (yscale2 - yscale)/range; } + else + scalestep = 0; xscale = FixedMul(xscale, ang_scale); From ce8ae48222594dfc07f3dfc1e30e350d1c91422a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 18 Aug 2016 12:55:04 +0100 Subject: [PATCH 103/808] I think this is as optimised as it's gonna get. Now onto the flag! --- src/r_things.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index 3d84813bb..c8667ca40 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1258,7 +1258,7 @@ static void R_ProjectSprite(mobj_t *thing) if (flatsprite) { - fixed_t yscale2; + fixed_t yscale2, cosmul, sinmul; INT32 range; if (ang >= ANGLE_180) @@ -1266,23 +1266,25 @@ static void R_ProjectSprite(mobj_t *thing) offset *= -1; offset2 *= -1; } - offset2 += offset; - tr_x = thing->x + FixedMul(offset, FINECOSINE(thing->angle>>ANGLETOFINESHIFT)) - viewx; - tr_y = thing->y + FixedMul(offset, FINESINE(thing->angle>>ANGLETOFINESHIFT)) - viewy; + cosmul = FINECOSINE(thing->angle>>ANGLETOFINESHIFT); + sinmul = FINESINE(thing->angle>>ANGLETOFINESHIFT); + + tr_x += FixedMul(offset, cosmul); + tr_y += FixedMul(offset, sinmul); gxt = FixedMul(tr_x, viewcos); gyt = -FixedMul(tr_y, viewsin); tz = gxt-gyt; yscale = FixedDiv(projectiony, tz); if (yscale < 64) return; // Fix some funky visuals - tr_x = thing->x + FixedMul(offset2, FINECOSINE(thing->angle>>ANGLETOFINESHIFT)) - viewx; - tr_y = thing->y + FixedMul(offset2, FINESINE(thing->angle>>ANGLETOFINESHIFT)) - viewy; + tr_x += FixedMul(offset2, cosmul); + tr_y += FixedMul(offset2, sinmul); gxt = FixedMul(tr_x, viewcos); gyt = -FixedMul(tr_y, viewsin); tz = gxt-gyt; yscale2 = FixedDiv(projectiony, tz); - if (yscale2 < 64) return; // Fix some funky visuals + if (yscale2 < 64) return; // ditto if (x2 > x1) range = (x2 - x1); From 430d7cfbd2c35e6aeb2ad46336f12f149afe631f Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 18 Aug 2016 15:45:44 +0100 Subject: [PATCH 104/808] Noticed some sorting issues, so introduced the sortscale struct variable. (SORRY, NO FLAG YET) --- src/r_things.c | 28 ++++++++++++++++------------ src/r_things.h | 2 +- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index c8667ca40..96224fd62 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1027,7 +1027,7 @@ static void R_SplitSprite(vissprite_t *sprite, mobj_t *thing) if (testheight <= sprite->gz) return; - cutfrac = (INT16)((centeryfrac - FixedMul(testheight - viewz, sprite->scale))>>FRACBITS); + cutfrac = (INT16)((centeryfrac - FixedMul(testheight - viewz, sprite->sortscale))>>FRACBITS); if (cutfrac < 0) continue; if (cutfrac > viewheight) @@ -1100,7 +1100,7 @@ static void R_ProjectSprite(mobj_t *thing) fixed_t tr_x, tr_y; fixed_t gxt, gyt; fixed_t tx, tz; - fixed_t xscale, yscale; //added : 02-02-98 : aaargll..if I were a math-guy!!! + fixed_t xscale, yscale, sortscale; //added : 02-02-98 : aaargll..if I were a math-guy!!! INT32 x1, x2; @@ -1152,7 +1152,7 @@ static void R_ProjectSprite(mobj_t *thing) // aspect ratio stuff xscale = FixedDiv(projection, tz); - yscale = FixedDiv(projectiony, tz); + sortscale = FixedDiv(projectiony, tz); // decide which patch to use for sprite relative to player #ifdef RANGECHECK @@ -1294,7 +1294,10 @@ static void R_ProjectSprite(mobj_t *thing) scalestep = (yscale2 - yscale)/range; } else + { + yscale = sortscale; scalestep = 0; + } xscale = FixedMul(xscale, ang_scale); @@ -1379,6 +1382,7 @@ static void R_ProjectSprite(mobj_t *thing) vis->heightsec = heightsec; //SoM: 3/17/2000 vis->mobjflags = thing->flags; vis->scale = yscale; //<sortscale = sortscale; vis->dispoffset = thing->info->dispoffset; // Monster Iestyn: 23/11/15 vis->gx = thing->x; vis->gy = thing->y; @@ -1778,14 +1782,14 @@ void R_SortVisSprites(void) bestscale = bestdispoffset = INT32_MAX; for (ds = unsorted.next; ds != &unsorted; ds = ds->next) { - if (ds->scale < bestscale) + if (ds->sortscale < bestscale) { - bestscale = ds->scale; + bestscale = ds->sortscale; bestdispoffset = ds->dispoffset; best = ds; } // order visprites of same scale by dispoffset, smallest first - else if (ds->scale == bestscale && ds->dispoffset < bestdispoffset) + else if (ds->sortscale == bestscale && ds->dispoffset < bestdispoffset) { bestdispoffset = ds->dispoffset; best = ds; @@ -2039,8 +2043,8 @@ static void R_CreateDrawNodes(void) if (r2->sprite->szt > rover->sz || r2->sprite->sz < rover->szt) continue; - if (r2->sprite->scale > rover->scale - || (r2->sprite->scale == rover->scale && r2->sprite->dispoffset > rover->dispoffset)) + if (r2->sprite->sortscale > rover->scale + || (r2->sprite->sortscale == rover->scale && r2->sprite->dispoffset > rover->dispoffset)) { entry = R_CreateDrawNode(NULL); (entry->prev = r2->prev)->next = entry; @@ -2193,8 +2197,8 @@ void R_ClipSprites(void) scale = ds->scale2; } - if (scale < spr->scale || - (lowscale < spr->scale && + if (scale < spr->sortscale || + (lowscale < spr->sortscale && !R_PointOnSegSide (spr->gx, spr->gy, ds->curline))) { // masked mid texture? @@ -2245,7 +2249,7 @@ void R_ClipSprites(void) fixed_t mh, h; INT32 phs = viewplayer->mo->subsector->sector->heightsec; if ((mh = sectors[spr->heightsec].floorheight) > spr->gz && - (h = centeryfrac - FixedMul(mh -= viewz, spr->scale)) >= 0 && + (h = centeryfrac - FixedMul(mh -= viewz, spr->sortscale)) >= 0 && (h >>= FRACBITS) < viewheight) { if (mh <= 0 || (phs != -1 && viewz > sectors[phs].floorheight)) @@ -2263,7 +2267,7 @@ void R_ClipSprites(void) } if ((mh = sectors[spr->heightsec].ceilingheight) < spr->gzt && - (h = centeryfrac - FixedMul(mh-viewz, spr->scale)) >= 0 && + (h = centeryfrac - FixedMul(mh-viewz, spr->sortscale)) >= 0 && (h >>= FRACBITS) < viewheight) { if (phs != -1 && viewz >= sectors[phs].ceilingheight) diff --git a/src/r_things.h b/src/r_things.h index 0941082aa..360ead433 100644 --- a/src/r_things.h +++ b/src/r_things.h @@ -135,7 +135,7 @@ typedef struct vissprite_s fixed_t pz, pzt; // physical bottom/top for sorting with 3D floors fixed_t startfrac; // horizontal position of x1 - fixed_t scale; + fixed_t scale, sortscale; // sortscale only differs from scale for flat sprites fixed_t scalestep; // only for flat sprites, 0 otherwise fixed_t xiscale; // negative if flipped From 7786ef43e876c6280e2f53c0ce32569bb855c5f6 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 18 Aug 2016 20:09:35 +0100 Subject: [PATCH 105/808] Okay, did a bunch of stuff. Getting ready to create a merge request, but not quite there yet. * MF_AMBUSH is now MF2_AMBUSH, because it's something you turn on in a map editor, not with a SOC definition. * Where MF_AMBUSH was is now MF_PAPER. * MF_PAPER accesses all the stuff I did previously in this branch... * ...as well as turn on paper-thin collision detection between mobjs, which I've gotten working but isn't perfect but it's still good enough for non-solid objects!! --- src/dehacked.c | 3 ++- src/m_cheat.c | 2 +- src/p_enemy.c | 18 +++++++------- src/p_inter.c | 2 +- src/p_map.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/p_mobj.c | 30 ++++++++++------------- src/p_mobj.h | 8 +++---- src/p_user.c | 8 +++---- src/r_things.c | 2 +- 9 files changed, 99 insertions(+), 38 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index f2b906c23..6b189a3ea 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6691,7 +6691,7 @@ static const char *const MOBJFLAG_LIST[] = { "SHOOTABLE", "NOSECTOR", "NOBLOCKMAP", - "AMBUSH", + "PAPER", "PUSHABLE", "BOSS", "SPAWNCEILING", @@ -6748,6 +6748,7 @@ static const char *const MOBJFLAG2_LIST[] = { "BOSSNOTRAP", // No Egg Trap after boss "BOSSFLEE", // Boss is fleeing! "BOSSDEAD", // Boss is dead! (Not necessarily fleeing, if a fleeing point doesn't exist.) + "AMBUSH", // Alternate behaviour typically set by MTF_AMBUSH NULL }; diff --git a/src/m_cheat.c b/src/m_cheat.c index 1c5f835cb..76f4356df 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -1054,7 +1054,7 @@ void OP_NightsObjectplace(player_t *player) if (!OP_HeightOkay(player, false)) return; - if (player->mo->target->flags & MF_AMBUSH) + if (player->mo->target->flags2 & MF2_AMBUSH) angle = (UINT16)player->anotherflyangle; else { diff --git a/src/p_enemy.c b/src/p_enemy.c index 4e11dc494..445acc359 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -2625,7 +2625,7 @@ for (i = cvar.value; i; --i) spawnchance[numchoices++] = type newbox = spawnchance[P_RandomKey(numchoices)]; item = mobjinfo[newbox].damage; - remains->flags &= ~MF_AMBUSH; + remains->flags2 &= ~MF2_AMBUSH; break; } default: @@ -3444,7 +3444,7 @@ void A_BubbleSpawn(mobj_t *actor) } actor->flags2 &= ~MF2_DONTDRAW; - if (!(actor->flags & MF_AMBUSH)) + if (!(actor->flags2 & MF2_AMBUSH)) { // Quick! Look through players! // Don't spawn bubbles unless a player is relatively close by (var2). @@ -3492,7 +3492,7 @@ void A_FanBubbleSpawn(mobj_t *actor) if (!(actor->eflags & MFE_UNDERWATER)) return; - if (!(actor->flags & MF_AMBUSH)) + if (!(actor->flags2 & MF2_AMBUSH)) { // Quick! Look through players! // Don't spawn bubbles unless a player is relatively close by (var2). @@ -4038,7 +4038,7 @@ void A_JetChase(mobj_t *actor) return; #endif - if (actor->flags & MF_AMBUSH) + if (actor->flags2 & MF2_AMBUSH) return; if (actor->z >= actor->waterbottom && actor->watertop > actor->floorz @@ -4931,7 +4931,7 @@ void A_SlingAppear(mobj_t *actor) if (firsttime) { // This is the outermost link in the chain - spawnee->flags |= MF_AMBUSH; + spawnee->flags2 |= MF2_AMBUSH; firsttime = false; } @@ -5916,7 +5916,7 @@ void A_Boss2Chase(mobj_t *actor) { actor->watertop = -actor->watertop; actor->extravalue1 = 18; - if (actor->flags & MF_AMBUSH) + if (actor->flags2 & MF2_AMBUSH) actor->extravalue1 -= (actor->info->spawnhealth - actor->health)*2; actor->extravalue2 = actor->extravalue1; } @@ -5942,7 +5942,7 @@ void A_Boss2Chase(mobj_t *actor) else { // Only speed up if you have the 'Deaf' flag. - if (actor->flags & MF_AMBUSH) + if (actor->flags2 & MF2_AMBUSH) speedvar = actor->health; else speedvar = actor->info->spawnhealth; @@ -6533,7 +6533,7 @@ void A_BuzzFly(mobj_t *actor) if (LUA_CallAction("A_BuzzFly", actor)) return; #endif - if (actor->flags & MF_AMBUSH) + if (actor->flags2 & MF2_AMBUSH) return; if (actor->reactiontime) @@ -6673,7 +6673,7 @@ void A_GuardChase(mobj_t *actor) return; // got a new target // chase towards player - if (--actor->movecount < 0 || !P_Move(actor, (actor->flags & MF_AMBUSH) ? actor->info->speed * 2 : actor->info->speed)) + if (--actor->movecount < 0 || !P_Move(actor, (actor->flags2 & MF2_AMBUSH) ? actor->info->speed * 2 : actor->info->speed)) { P_NewChaseDir(actor); actor->movecount += 5; // Increase tics before change in direction allowed. diff --git a/src/p_inter.c b/src/p_inter.c index b0d8e4aac..237112ea5 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1327,7 +1327,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) case MT_SMALLMACECHAIN: case MT_BIGMACECHAIN: // Is this the last link in the chain? - if (toucher->momz > 0 || !(special->flags & MF_AMBUSH) + if (toucher->momz > 0 || !(special->flags2 & MF2_AMBUSH) || (player->pflags & PF_ITEMHANG) || (player->pflags & PF_MACESPIN)) return; diff --git a/src/p_map.c b/src/p_map.c index 9bcd1b29e..452d8c222 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -498,6 +498,70 @@ static boolean PIT_CheckThing(mobj_t *thing) if (abs(thing->x - tmx) >= blockdist || abs(thing->y - tmy) >= blockdist) return true; // didn't hit it + if (thing->flags & MF_PAPER) + { + fixed_t cosradius, sinradius; + vertex_t v1, v2; // fake vertexes + line_t junk; // fake linedef + + cosradius = FixedMul(thing->radius, FINECOSINE(thing->angle>>ANGLETOFINESHIFT)); + sinradius = FixedMul(thing->radius, FINESINE(thing->angle>>ANGLETOFINESHIFT)); + + v1.x = thing->x - cosradius; + v1.y = thing->y - sinradius; + v2.x = thing->x + cosradius; + v2.y = thing->y + sinradius; + + junk.v1 = &v1; + junk.v2 = &v2; + junk.dx = v2.x - v1.x; + junk.dy = v2.y - v1.y; + + if (tmthing->flags & MF_PAPER) + { + cosradius = FixedMul(tmthing->radius, FINECOSINE(tmthing->angle>>ANGLETOFINESHIFT)); + sinradius = FixedMul(tmthing->radius, FINESINE(tmthing->angle>>ANGLETOFINESHIFT)); + if (P_PointOnLineSide(tmx - cosradius, tmy - sinradius, &junk) + == P_PointOnLineSide(tmx + cosradius, tmy + sinradius, &junk)) + return true; // the line doesn't cross between collider's start or end + } + else + { + if ((P_PointOnLineSide(tmx - tmthing->radius, tmy - tmthing->radius, &junk) + == P_PointOnLineSide(tmx + tmthing->radius, tmy + tmthing->radius, &junk)) + && (P_PointOnLineSide(tmx + tmthing->radius, tmy - tmthing->radius, &junk) + == P_PointOnLineSide(tmx - tmthing->radius, tmy + tmthing->radius, &junk))) + return true; // the line doesn't cross between either pair of opposite corners + } + } + else if (tmthing->flags & MF_PAPER) + { + fixed_t cosradius, sinradius; + vertex_t v1, v2; // fake vertexes + line_t junk; // fake linedef + + cosradius = FixedMul(tmthing->radius, FINECOSINE(tmthing->angle>>ANGLETOFINESHIFT)); + sinradius = FixedMul(tmthing->radius, FINESINE(tmthing->angle>>ANGLETOFINESHIFT)); + + v1.x = tmx - cosradius; + v1.y = tmy - sinradius; + v2.x = tmx + cosradius; + v2.y = tmy + sinradius; + + junk.v1 = &v1; + junk.v2 = &v2; + junk.dx = v2.x - v1.x; + junk.dy = v2.y - v1.y; + + // no need to check whether thing has MF_PAPER, since checked above + + if ((P_PointOnLineSide(thing->x - thing->radius, thing->y - thing->radius, &junk) + == P_PointOnLineSide(thing->x + thing->radius, thing->y + thing->radius, &junk)) + && (P_PointOnLineSide(thing->x + thing->radius, thing->y - thing->radius, &junk) + == P_PointOnLineSide(thing->x - thing->radius, thing->y + thing->radius, &junk))) + return true; // the line doesn't cross between either pair of opposite corners + } + #ifdef HAVE_BLUA { UINT8 shouldCollide = LUAh_MobjCollide(thing, tmthing); // checks hook for thing's type diff --git a/src/p_mobj.c b/src/p_mobj.c index fe09f6c01..50d90834a 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2653,7 +2653,7 @@ static boolean P_ZMovement(mobj_t *mo) && abs(mom.y) < FixedMul(STOPSPEED, mo->scale) && abs(mom.z) < FixedMul(STOPSPEED*3, mo->scale)) { - if (mo->flags & MF_AMBUSH) + if (mo->flags2 & MF2_AMBUSH) { // If deafed, give the tumbleweed another random kick if it runs out of steam. mom.z += P_MobjFlip(mo)*FixedMul(6*FRACUNIT, mo->scale); @@ -6582,7 +6582,7 @@ void P_MobjThinker(mobj_t *mobj) flame->angle = mobj->angle; - if (mobj->flags & MF_AMBUSH) // Wave up and down instead of side-to-side + if (mobj->flags2 & MF2_AMBUSH) // Wave up and down instead of side-to-side flame->momz = mobj->fuse << (FRACBITS-2); else flame->angle += FixedAngle(mobj->fuse*FRACUNIT); @@ -6617,7 +6617,7 @@ void P_MobjThinker(mobj_t *mobj) strength -= ((20*FRACUNIT)/16)*mobj->movedir; // If deaf'd, the object spawns on the ceiling. - if (mobj->flags & MF_AMBUSH) + if (mobj->flags2 & MF2_AMBUSH) { mobj->z = mobj->ceilingz-mobj->height; flame->momz = -strength; @@ -7473,7 +7473,7 @@ void P_MobjThinker(mobj_t *mobj) case MT_EGGMANBOX: // Eggman box case MT_GRAVITYBOX: // Gravity box case MT_QUESTIONBOX: - if ((mobj->flags & MF_AMBUSH || mobj->flags2 & MF2_STRONGBOX) && mobj->type != MT_QUESTIONBOX) + if ((mobj->flags2 & (MF2_AMBUSH|MF2_STRONGBOX)) && mobj->type != MT_QUESTIONBOX) { mobjtype_t spawnchance[64]; INT32 numchoices = 0, i = 0; @@ -7501,11 +7501,7 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s i = P_RandomKey(numchoices); // Gotta love those random numbers! newmobj = P_SpawnMobj(mobj->x, mobj->y, mobj->z, spawnchance[i]); - // If the monitor respawns randomly, transfer the flag. - if (mobj->flags & MF_AMBUSH) - newmobj->flags |= MF_AMBUSH; - - // Transfer flags2 (strongbox, objectflip) + // Transfer flags2 (strongbox, objectflip, ambush) newmobj->flags2 = mobj->flags2; } else @@ -9322,7 +9318,7 @@ ML_NOCLIMB : Direction not controllable if (firsttime) { // This is the outermost link in the chain - spawnee->flags |= MF_AMBUSH; + spawnee->flags2 |= MF2_AMBUSH; firsttime = false; } @@ -9394,7 +9390,7 @@ ML_NOCLIMB : Direction not controllable { // Inverted if uppermost bit is set if (mthing->angle & 16384) - mobj->flags |= MF_AMBUSH; + mobj->flags2 |= MF2_AMBUSH; if (mthing->angle > 0) mobj->radius = (mthing->angle & 16383)*FRACUNIT; @@ -9571,7 +9567,7 @@ ML_NOCLIMB : Direction not controllable mthing->type == mobjinfo[MT_YELLOWTV].doomednum || mthing->type == mobjinfo[MT_BLUETV].doomednum || mthing->type == mobjinfo[MT_BLACKTV].doomednum || mthing->type == mobjinfo[MT_PITYTV].doomednum || mthing->type == mobjinfo[MT_RECYCLETV].doomednum || mthing->type == mobjinfo[MT_MIXUPBOX].doomednum) - mobj->flags |= MF_AMBUSH; + mobj->flags2 |= MF2_AMBUSH; } else if (mthing->type != mobjinfo[MT_AXIS].doomednum && @@ -9579,7 +9575,7 @@ ML_NOCLIMB : Direction not controllable mthing->type != mobjinfo[MT_AXISTRANSFERLINE].doomednum && mthing->type != mobjinfo[MT_NIGHTSBUMPER].doomednum && mthing->type != mobjinfo[MT_STARPOST].doomednum) - mobj->flags |= MF_AMBUSH; + mobj->flags2 |= MF2_AMBUSH; } if (mthing->options & MTF_OBJECTSPECIAL) @@ -9918,7 +9914,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing) P_SetMobjState(mobj, mobj->info->seestate); mobj->angle = FixedAngle(mthing->angle*FRACUNIT); - mobj->flags |= MF_AMBUSH; + mobj->flags2 |= MF2_AMBUSH; mthing->mobj = mobj; } // All manners of rings and coins @@ -9992,7 +9988,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing) } mobj->angle = FixedAngle(mthing->angle*FRACUNIT); - mobj->flags |= MF_AMBUSH; + mobj->flags2 |= MF2_AMBUSH; mthing->mobj = mobj; } // *** @@ -10048,7 +10044,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing) mobj->angle = FixedAngle(mthing->angle*FRACUNIT); if (mthing->options & MTF_AMBUSH) - mobj->flags |= MF_AMBUSH; + mobj->flags2 |= MF2_AMBUSH; } } // Diagonal rings (handles both types) @@ -10106,7 +10102,7 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing) mobj->angle = FixedAngle(mthing->angle*FRACUNIT); if (mthing->options & MTF_AMBUSH) - mobj->flags |= MF_AMBUSH; + mobj->flags2 |= MF2_AMBUSH; } } // Rings of items (all six of them) diff --git a/src/p_mobj.h b/src/p_mobj.h index b6592cb3d..c6738d372 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -107,8 +107,8 @@ typedef enum MF_NOSECTOR = 1<<3, // Don't use the blocklinks (inert but displayable) MF_NOBLOCKMAP = 1<<4, - // Not to be activated by sound, deaf monster. - MF_AMBUSH = 1<<5, + // Paper-thin. Drawn like a midtexture, has a flat collision bound. + MF_PAPER = 1<<5, // You can push this object. It can activate switches and things by pushing it on top. MF_PUSHABLE = 1<<6, // Object is a boss. @@ -151,10 +151,9 @@ typedef enum MF_PAIN = 1<<24, // This mobj will stick to any surface or solid object it touches. MF_STICKY = 1<<25, - // NiGHTS hidden item. Goes to seestate and turns MF_SPECIAL when paralooped. + // NiGHTS hidden item. Goes to seestate and turns MF_SPECIAL when paralooped. MF_NIGHTSITEM = 1<<26, // for chase camera, don't be blocked by things (partial clipping) - // (need comma at end of this for SOC editor) MF_NOCLIPTHING = 1<<27, // Missile bounces like a grenade. MF_GRENADEBOUNCE = 1<<28, @@ -192,6 +191,7 @@ typedef enum MF2_BOSSNOTRAP = 1<<24, // No Egg Trap after boss MF2_BOSSFLEE = 1<<25, // Boss is fleeing! MF2_BOSSDEAD = 1<<26, // Boss is dead! (Not necessarily fleeing, if a fleeing point doesn't exist.) + MF2_AMBUSH = 1<<27, // Alternate behaviour typically set by MTF_AMBUSH // free: to and including 1<<31 } mobjflag2_t; diff --git a/src/p_user.c b/src/p_user.c index d99d86dea..5a591394d 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -629,7 +629,7 @@ static void P_DeNightserizePlayer(player_t *player) if (!(mo2->type == MT_NIGHTSDRONE)) continue; - if (mo2->flags & MF_AMBUSH) + if (mo2->flags2 & MF2_AMBUSH) P_DamageMobj(player->mo, NULL, NULL, 1, DMG_INSTAKILL); break; @@ -4964,7 +4964,7 @@ static void P_NightsTransferPoints(player_t *player, fixed_t xspeed, fixed_t rad boolean transfer1last = false; boolean transfer2last = false; vertex_t vertices[4]; - fixed_t truexspeed = xspeed*(!(player->pflags & PF_TRANSFERTOCLOSEST) && player->mo->target->flags & MF_AMBUSH ? -1 : 1); + fixed_t truexspeed = xspeed*(!(player->pflags & PF_TRANSFERTOCLOSEST) && player->mo->target->flags2 & MF2_AMBUSH ? -1 : 1); // Find next waypoint for (th = thinkercap.next; th != &thinkercap; th = th->next) @@ -5629,7 +5629,7 @@ static void P_NiGHTSMovement(player_t *player) // The 'ambush' flag says you should rotate // the other way around the axis. - if (player->mo->target->flags & MF_AMBUSH) + if (player->mo->target->flags2 & MF2_AMBUSH) backwardaxis = true; player->angle_pos = R_PointToAngle2(player->mo->target->x, player->mo->target->y, player->mo->x, player->mo->y); @@ -7976,7 +7976,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall } else if (player->mo->target) { - if (player->mo->target->flags & MF_AMBUSH) + if (player->mo->target->flags2 & MF2_AMBUSH) angle = R_PointToAngle2(player->mo->target->x, player->mo->target->y, player->mo->x, player->mo->y); else angle = R_PointToAngle2(player->mo->x, player->mo->y, player->mo->target->x, player->mo->target->y); diff --git a/src/r_things.c b/src/r_things.c index 96224fd62..97c1b5d7b 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1119,7 +1119,7 @@ static void R_ProjectSprite(mobj_t *thing) fixed_t iscale; fixed_t scalestep; // toast '16 fixed_t offset, offset2; - boolean flatsprite = true; //(thing->flags2 & MF2_PAPER); + boolean flatsprite = (thing->flags & MF_PAPER); //SoM: 3/17/2000 fixed_t gz, gzt; From 430a2e07cc09deeb14c1b19b2fab59278bb9d6a1 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 18 Aug 2016 20:55:24 +0100 Subject: [PATCH 106/808] Added linedef collision and fixed the following clipping bug, shown in gfy form. http://gfycat.com/BiodegradableNaturalHadrosaurus --- src/p_map.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 452d8c222..1a79d8d5e 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -498,7 +498,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (abs(thing->x - tmx) >= blockdist || abs(thing->y - tmy) >= blockdist) return true; // didn't hit it - if (thing->flags & MF_PAPER) + if (thing->flags & MF_PAPER) // CAUTION! Very easy to get stuck inside MF_SOLID objects. Giving the player MF_PAPER is a bad idea unless you know what you're doing. { fixed_t cosradius, sinradius; vertex_t v1, v2; // fake vertexes @@ -517,12 +517,16 @@ static boolean PIT_CheckThing(mobj_t *thing) junk.dx = v2.x - v1.x; junk.dy = v2.y - v1.y; - if (tmthing->flags & MF_PAPER) + if (tmthing->flags & MF_PAPER) // more strenuous checking to prevent clipping issues { + INT32 check1, check2, check3, check4; cosradius = FixedMul(tmthing->radius, FINECOSINE(tmthing->angle>>ANGLETOFINESHIFT)); sinradius = FixedMul(tmthing->radius, FINESINE(tmthing->angle>>ANGLETOFINESHIFT)); - if (P_PointOnLineSide(tmx - cosradius, tmy - sinradius, &junk) - == P_PointOnLineSide(tmx + cosradius, tmy + sinradius, &junk)) + check1 = P_PointOnLineSide(tmx - cosradius, tmy - sinradius, &junk); + check2 = P_PointOnLineSide(tmx + cosradius, tmy + sinradius, &junk); + check3 = P_PointOnLineSide(tmx + tmthing->momx - cosradius, tmy + tmthing->momy - sinradius, &junk); + check4 = P_PointOnLineSide(tmx + tmthing->momx + cosradius, tmy + tmthing->momy + sinradius, &junk); + if ((check1 == check2) && (check2 == check3) && (check3 == check4)) return true; // the line doesn't cross between collider's start or end } else @@ -1226,6 +1230,15 @@ static boolean PIT_CheckLine(line_t *ld) if (P_BoxOnLineSide(tmbbox, ld) != -1) return true; + if (tmthing->flags & MF_PAPER) // Caution! Turning whilst up against a wall will get you stuck. You probably shouldn't give the player this flag. + { + fixed_t cosradius = FixedMul(tmthing->radius, FINECOSINE(tmthing->angle>>ANGLETOFINESHIFT)); + fixed_t sinradius = FixedMul(tmthing->radius, FINESINE(tmthing->angle>>ANGLETOFINESHIFT)); + if (P_PointOnLineSide(tmx - cosradius, tmy - sinradius, ld) + == P_PointOnLineSide(tmx + cosradius, tmy + sinradius, ld)) + return true; // the line doesn't cross between collider's start or end + } + // A line has been hit // The moving thing's destination position will cross From ff362534b4592afa277c11e650a43600211ea929 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 18 Aug 2016 22:20:42 +0100 Subject: [PATCH 107/808] An experimental attempt at collision correction, put behind a #define because it's buggy as SHIT. --- src/doomdef.h | 3 +++ src/p_map.c | 21 +++++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index 4428ef617..90c1233d6 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -498,4 +498,7 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// \note You should leave this enabled unless you're working with a future SRB2 version. #define MUSICSLOT_COMPATIBILITY +/// Experimental attempts at preventing MF2_PAPER objects from getting stuck in walls. +//#define PAPER_COLLISIONCORRECTION + #endif // __DOOMDEF__ diff --git a/src/p_map.c b/src/p_map.c index 1a79d8d5e..0488c7b8c 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1232,11 +1232,28 @@ static boolean PIT_CheckLine(line_t *ld) if (tmthing->flags & MF_PAPER) // Caution! Turning whilst up against a wall will get you stuck. You probably shouldn't give the player this flag. { - fixed_t cosradius = FixedMul(tmthing->radius, FINECOSINE(tmthing->angle>>ANGLETOFINESHIFT)); - fixed_t sinradius = FixedMul(tmthing->radius, FINESINE(tmthing->angle>>ANGLETOFINESHIFT)); + fixed_t cosradius, sinradius; + cosradius = FixedMul(tmthing->radius, FINECOSINE(tmthing->angle>>ANGLETOFINESHIFT)); + sinradius = FixedMul(tmthing->radius, FINESINE(tmthing->angle>>ANGLETOFINESHIFT)); if (P_PointOnLineSide(tmx - cosradius, tmy - sinradius, ld) == P_PointOnLineSide(tmx + cosradius, tmy + sinradius, ld)) return true; // the line doesn't cross between collider's start or end +#ifdef PAPER_COLLISIONCORRECTION + { + fixed_t dist; + vertex_t result; + angle_t langle; + P_ClosestPointOnLine(tmx, tmy, ld, &result); + langle = R_PointToAngle2(ld->v1->x, ld->v1->y, ld->v2->x, ld->v2->y); + langle += ANGLE_90*(P_PointOnLineSide(tmx, tmy, ld) ? -1 : 1); + dist = abs(FixedMul(tmthing->radius, FINECOSINE((tmthing->angle - langle)>>ANGLETOFINESHIFT))); + cosradius = FixedMul(dist, FINECOSINE(langle>>ANGLETOFINESHIFT)); + sinradius = FixedMul(dist, FINESINE(langle>>ANGLETOFINESHIFT)); + tmthing->flags |= MF_NOCLIP; + P_TeleportMove(tmthing, result.x + cosradius - tmthing->momx, result.y + sinradius - tmthing->momy, tmthing->z); + tmthing->flags &= ~MF_NOCLIP; + } +#endif } // A line has been hit From 66a845a33a23b11fe2e96a59bc406e0ed1e6eb87 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 18 Aug 2016 22:24:36 +0100 Subject: [PATCH 108/808] silly me --- src/doomdef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doomdef.h b/src/doomdef.h index 90c1233d6..7cf3cff04 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -498,7 +498,7 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// \note You should leave this enabled unless you're working with a future SRB2 version. #define MUSICSLOT_COMPATIBILITY -/// Experimental attempts at preventing MF2_PAPER objects from getting stuck in walls. +/// Experimental attempts at preventing MF_PAPER objects from getting stuck in walls. //#define PAPER_COLLISIONCORRECTION #endif // __DOOMDEF__ From fbff05bd17b8b636a93363f8c2ee5bf147645901 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 19 Aug 2016 12:26:26 +0100 Subject: [PATCH 109/808] Fixed the between-objects sorting problem previously mentioned in the merge request. Now they're sorted by whichever sprite has an end closest to the camera, instead of the middle point previously used. http://i.imgur.com/UyOKX5u.png <-- this common glitch with crawlas given MF_PAPER (THEY'RE NOT GOOD AT TURNING NEAR EDGES) used to show the behind-crawlas in front of the front-crawlas. Unfortunately, I've just discovered this issue (which happens with the old version of the sorting code too): http://i.imgur.com/QNjbATB.png but to be fair these crawlas have gotten stuck inside the edges of this platform, so I'm not sure I can do anything about this without cutting off Sonic's feet when he stands on the ground? shrug --- src/r_things.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index 97c1b5d7b..970c59b3d 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1152,7 +1152,7 @@ static void R_ProjectSprite(mobj_t *thing) // aspect ratio stuff xscale = FixedDiv(projection, tz); - sortscale = FixedDiv(projectiony, tz); + yscale = FixedDiv(projectiony, tz); // decide which patch to use for sprite relative to player #ifdef RANGECHECK @@ -1292,11 +1292,13 @@ static void R_ProjectSprite(mobj_t *thing) range = 1; scalestep = (yscale2 - yscale)/range; + + sortscale = max(yscale, yscale2); } else { - yscale = sortscale; scalestep = 0; + sortscale = yscale; } xscale = FixedMul(xscale, ang_scale); From 552a67200c51872baf981c59eafa9a41e6ebf115 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 19 Aug 2016 15:06:10 +0100 Subject: [PATCH 110/808] A revert of the sorting because it produced better (but not perfect) results for paper and normal mobj interaction. Also, I added more sortscale handling in the places where I forgot it. I probably need some help with the maths here to get this to work nicely. http://gfycat.com/LimpAgedDowitcher --- src/r_things.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index 970c59b3d..4c307ef4c 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1152,7 +1152,7 @@ static void R_ProjectSprite(mobj_t *thing) // aspect ratio stuff xscale = FixedDiv(projection, tz); - yscale = FixedDiv(projectiony, tz); + sortscale = FixedDiv(projectiony, tz); // decide which patch to use for sprite relative to player #ifdef RANGECHECK @@ -1293,12 +1293,13 @@ static void R_ProjectSprite(mobj_t *thing) scalestep = (yscale2 - yscale)/range; - sortscale = max(yscale, yscale2); + //sortscale = yscale + scalestep*((centerxfrac>>FRACBITS) - x1); + //sortscale = max(yscale, yscale2); } else { scalestep = 0; - sortscale = yscale; + yscale = sortscale; } xscale = FixedMul(xscale, ang_scale); @@ -1412,8 +1413,8 @@ static void R_ProjectSprite(mobj_t *thing) vis->xscale = xscale; //SoM: 4/17/2000 vis->sector = thing->subsector->sector; - vis->szt = (INT16)((centeryfrac - FixedMul(vis->gzt - viewz, yscale))>>FRACBITS); - vis->sz = (INT16)((centeryfrac - FixedMul(vis->gz - viewz, yscale))>>FRACBITS); + vis->szt = (INT16)((centeryfrac - FixedMul(vis->gzt - viewz, sortscale))>>FRACBITS); + vis->sz = (INT16)((centeryfrac - FixedMul(vis->gz - viewz, sortscale))>>FRACBITS); vis->cut = SC_NONE; if (thing->subsector->sector->numlights) vis->extra_colormap = thing->subsector->sector->lightlist[light].extra_colormap; @@ -1596,7 +1597,7 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing) // store information in a vissprite vis = R_NewVisSprite(); - vis->scale = yscale; //<scale = vis->sortscale = yscale; //<dispoffset = 0; // Monster Iestyn: 23/11/15 vis->gx = thing->x; vis->gy = thing->y; From 8df146b713e7f44d9cc660eae0b0a1c2e05181f2 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 20 Aug 2016 01:03:35 +0100 Subject: [PATCH 111/808] An additional proper overflow check, and also a little something I forgot earlier. --- src/r_things.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/r_things.c b/src/r_things.c index 4c307ef4c..698e24b0d 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -806,6 +806,13 @@ static void R_DrawVisSprite(vissprite_t *vis) if (overflow_test < 0) overflow_test = -overflow_test; if ((UINT64)overflow_test&0xFFFFFFFF80000000ULL) return; // fixed point mult would overflow + if (vis->scalestep) // handles right edge too + { + overflow_test = (INT64)centeryfrac - (((INT64)vis->texturemid*(vis->scale + (vis->scalestep*(vis->x2 - vis->x1))))>>FRACBITS); + if (overflow_test < 0) overflow_test = -overflow_test; + if ((UINT64)overflow_test&0xFFFFFFFF80000000ULL) return; // ditto + } + colfunc = basecolfunc; // hack: this isn't resetting properly somewhere. dc_colormap = vis->colormap; if ((vis->mobj->flags & MF_BOSS) && (vis->mobj->flags2 & MF2_FRET) && (leveltime & 1)) // Bosses "flash" @@ -1607,6 +1614,7 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing) vis->pz = thing->z; vis->pzt = vis->pz + vis->thingheight; vis->texturemid = vis->gzt - viewz; + vis->scalestep = 0; vis->x1 = x1 < 0 ? 0 : x1; vis->x2 = x2 >= viewwidth ? viewwidth-1 : x2; From 7d5bda709aa0fa93b2c31bb51345c9ac63ad8e66 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 20 Aug 2016 03:02:40 +0100 Subject: [PATCH 112/808] Sorting is fixed! Turns out rover isn't a FOF, it's another sprite. Thanks @RedEnchilada for noticing this oversight!! http://gfycat.com/EsteemedPleasedDuck <-- so great --- src/r_things.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index 698e24b0d..e1527d6af 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1962,7 +1962,7 @@ static void R_CreateDrawNodes(void) for (i = x1; i <= x2; i++) { - if (r2->seg->frontscale[i] > rover->scale) + if (r2->seg->frontscale[i] > rover->sortscale) break; } if (i > x2) @@ -1981,10 +1981,10 @@ static void R_CreateDrawNodes(void) continue; scale = r2->thickseg->scale1 > r2->thickseg->scale2 ? r2->thickseg->scale1 : r2->thickseg->scale2; - if (scale <= rover->scale) + if (scale <= rover->sortscale) continue; scale = r2->thickseg->scale1 + (r2->thickseg->scalestep * (sintersect - r2->thickseg->x1)); - if (scale <= rover->scale) + if (scale <= rover->sortscale) continue; #ifdef ESLOPE @@ -2034,11 +2034,11 @@ static void R_CreateDrawNodes(void) continue; scale = r2->seg->scale1 > r2->seg->scale2 ? r2->seg->scale1 : r2->seg->scale2; - if (scale <= rover->scale) + if (scale <= rover->sortscale) continue; scale = r2->seg->scale1 + (r2->seg->scalestep * (sintersect - r2->seg->x1)); - if (rover->scale < scale) + if (rover->sortscale < scale) { entry = R_CreateDrawNode(NULL); (entry->prev = r2->prev)->next = entry; @@ -2054,8 +2054,8 @@ static void R_CreateDrawNodes(void) if (r2->sprite->szt > rover->sz || r2->sprite->sz < rover->szt) continue; - if (r2->sprite->sortscale > rover->scale - || (r2->sprite->sortscale == rover->scale && r2->sprite->dispoffset > rover->dispoffset)) + if (r2->sprite->sortscale > rover->sortscale + || (r2->sprite->sortscale == rover->sortscale && r2->sprite->dispoffset > rover->dispoffset)) { entry = R_CreateDrawNode(NULL); (entry->prev = r2->prev)->next = entry; From ef6c2510a269daa61b89f6f742d5d42e17c385ae Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 20 Aug 2016 12:18:00 +0100 Subject: [PATCH 113/808] Did a few things to make this better. * Reorganised R_DrawVisSprite to do less needless variable calculation. * Corrected some clipping oversights. * Made a few comments clearer. --- src/r_things.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index e1527d6af..33b834ada 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -817,7 +817,7 @@ static void R_DrawVisSprite(vissprite_t *vis) dc_colormap = vis->colormap; if ((vis->mobj->flags & MF_BOSS) && (vis->mobj->flags2 & MF2_FRET) && (leveltime & 1)) // Bosses "flash" { - // translate green skin to another color + // translate certain pixels to white colfunc = transcolfunc; if (vis->mobj->type == MT_CYBRAKDEMON) dc_translation = R_GetTranslationColormap(TC_ALLWHITE, 0, GTC_CACHE); @@ -873,13 +873,10 @@ static void R_DrawVisSprite(vissprite_t *vis) if (!dc_colormap) dc_colormap = colormaps; - dc_iscale = FixedDiv(FRACUNIT, vis->scale); dc_texturemid = vis->texturemid; dc_texheight = 0; frac = vis->startfrac; - spryscale = vis->scale; - sprtopscreen = centeryfrac - FixedMul(dc_texturemid, spryscale); windowtop = windowbottom = sprbotscreen = INT32_MAX; if (vis->mobj->skin && ((skin_t *)vis->mobj->skin)->flags & SF_HIRES) @@ -892,28 +889,28 @@ static void R_DrawVisSprite(vissprite_t *vis) { vis->scale = FixedMul(vis->scale, this_scale); vis->scalestep = FixedMul(vis->scalestep, this_scale); - spryscale = vis->scale; - dc_iscale = FixedDiv(FRACUNIT, vis->scale); vis->xiscale = FixedDiv(vis->xiscale,this_scale); vis->isScaled = true; } dc_texturemid = FixedDiv(dc_texturemid,this_scale); + } - //Oh lordy, mercy me. Don't freak out if sprites go offscreen! - /*if (vis->xiscale > 0) - frac = FixedDiv(frac, this_scale); - else if (vis->x1 <= 0) - frac = (vis->x1 - vis->x2) * vis->xiscale;*/ + spryscale = vis->scale; + if (!(vis->scalestep)) + { sprtopscreen = centeryfrac - FixedMul(dc_texturemid, spryscale); - //dc_hires = 1; + dc_iscale = FixedDiv(FRACUNIT, vis->scale); } x1 = vis->x1; x2 = vis->x2; if (vis->x1 < 0) + { + spryscale += vis->scalestep*(-vis->x1); vis->x1 = 0; + } if (vis->x2 >= vid.width) vis->x2 = vid.width-1; @@ -1146,7 +1143,7 @@ static void R_ProjectSprite(mobj_t *thing) tz = gxt-gyt; // thing is behind view plane? - if (tz < FixedMul(MINZ, this_scale)) + if (!(flatsprite) && (tz < FixedMul(MINZ, this_scale))) // flatsprite clipping is handled later return; gxt = -FixedMul(tr_x, viewsin); @@ -1265,7 +1262,7 @@ static void R_ProjectSprite(mobj_t *thing) if (flatsprite) { - fixed_t yscale2, cosmul, sinmul; + fixed_t yscale2, cosmul, sinmul, tz2; INT32 range; if (ang >= ANGLE_180) @@ -1289,10 +1286,13 @@ static void R_ProjectSprite(mobj_t *thing) tr_y += FixedMul(offset2, sinmul); gxt = FixedMul(tr_x, viewcos); gyt = -FixedMul(tr_y, viewsin); - tz = gxt-gyt; - yscale2 = FixedDiv(projectiony, tz); + tz2 = gxt-gyt; + yscale2 = FixedDiv(projectiony, tz2); if (yscale2 < 64) return; // ditto + if (max(tz, tz2) < FixedMul(MINZ, this_scale)) // non-flatsprite clipping is handled earlier + return; + if (x2 > x1) range = (x2 - x1); else @@ -1300,8 +1300,9 @@ static void R_ProjectSprite(mobj_t *thing) scalestep = (yscale2 - yscale)/range; - //sortscale = yscale + scalestep*((centerxfrac>>FRACBITS) - x1); - //sortscale = max(yscale, yscale2); + // The following two are alternate sorting methods which might be more applicable in some circumstances. TODO - maybe enable via MF2? + // sortscale = max(yscale, yscale2); + // sortscale = min(yscale, yscale2); } else { From c08e9674be3e9cc504ebbb393761e873eb5ba68a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 20 Aug 2016 15:15:48 +0100 Subject: [PATCH 114/808] As requested by Nev3r and VAda, seperating MF_PAPER into FF_PAPERSPRITE and MF_PAPERCOLLISION. --- src/dehacked.c | 1 + src/doomdef.h | 2 +- src/p_map.c | 10 +++++----- src/p_mobj.h | 4 ++-- src/p_pspr.h | 4 +++- src/r_things.c | 12 ++++++------ 6 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 6b189a3ea..25c28d852 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7045,6 +7045,7 @@ struct { // Frame settings {"FF_FRAMEMASK",FF_FRAMEMASK}, + {"FF_PAPERSPRITE",FF_PAPERSPRITE}, {"FF_ANIMATE",FF_ANIMATE}, {"FF_FULLBRIGHT",FF_FULLBRIGHT}, {"FF_TRANSMASK",FF_TRANSMASK}, diff --git a/src/doomdef.h b/src/doomdef.h index 7cf3cff04..7ca379d99 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -498,7 +498,7 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// \note You should leave this enabled unless you're working with a future SRB2 version. #define MUSICSLOT_COMPATIBILITY -/// Experimental attempts at preventing MF_PAPER objects from getting stuck in walls. +/// Experimental attempts at preventing MF_PAPERCOLLISION objects from getting stuck in walls. //#define PAPER_COLLISIONCORRECTION #endif // __DOOMDEF__ diff --git a/src/p_map.c b/src/p_map.c index 0488c7b8c..5946f56d9 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -498,7 +498,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (abs(thing->x - tmx) >= blockdist || abs(thing->y - tmy) >= blockdist) return true; // didn't hit it - if (thing->flags & MF_PAPER) // CAUTION! Very easy to get stuck inside MF_SOLID objects. Giving the player MF_PAPER is a bad idea unless you know what you're doing. + if (thing->flags & MF_PAPERCOLLISION) // CAUTION! Very easy to get stuck inside MF_SOLID objects. Giving the player MF_PAPERCOLLISION is a bad idea unless you know what you're doing. { fixed_t cosradius, sinradius; vertex_t v1, v2; // fake vertexes @@ -517,7 +517,7 @@ static boolean PIT_CheckThing(mobj_t *thing) junk.dx = v2.x - v1.x; junk.dy = v2.y - v1.y; - if (tmthing->flags & MF_PAPER) // more strenuous checking to prevent clipping issues + if (tmthing->flags & MF_PAPERCOLLISION) // more strenuous checking to prevent clipping issues { INT32 check1, check2, check3, check4; cosradius = FixedMul(tmthing->radius, FINECOSINE(tmthing->angle>>ANGLETOFINESHIFT)); @@ -538,7 +538,7 @@ static boolean PIT_CheckThing(mobj_t *thing) return true; // the line doesn't cross between either pair of opposite corners } } - else if (tmthing->flags & MF_PAPER) + else if (tmthing->flags & MF_PAPERCOLLISION) { fixed_t cosradius, sinradius; vertex_t v1, v2; // fake vertexes @@ -557,7 +557,7 @@ static boolean PIT_CheckThing(mobj_t *thing) junk.dx = v2.x - v1.x; junk.dy = v2.y - v1.y; - // no need to check whether thing has MF_PAPER, since checked above + // no need to check whether thing has MF_PAPERCOLLISION, since checked above if ((P_PointOnLineSide(thing->x - thing->radius, thing->y - thing->radius, &junk) == P_PointOnLineSide(thing->x + thing->radius, thing->y + thing->radius, &junk)) @@ -1230,7 +1230,7 @@ static boolean PIT_CheckLine(line_t *ld) if (P_BoxOnLineSide(tmbbox, ld) != -1) return true; - if (tmthing->flags & MF_PAPER) // Caution! Turning whilst up against a wall will get you stuck. You probably shouldn't give the player this flag. + if (tmthing->flags & MF_PAPERCOLLISION) // Caution! Turning whilst up against a wall will get you stuck. You probably shouldn't give the player this flag. { fixed_t cosradius, sinradius; cosradius = FixedMul(tmthing->radius, FINECOSINE(tmthing->angle>>ANGLETOFINESHIFT)); diff --git a/src/p_mobj.h b/src/p_mobj.h index c6738d372..50af8acc9 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -107,8 +107,8 @@ typedef enum MF_NOSECTOR = 1<<3, // Don't use the blocklinks (inert but displayable) MF_NOBLOCKMAP = 1<<4, - // Paper-thin. Drawn like a midtexture, has a flat collision bound. - MF_PAPER = 1<<5, + // Thin, paper-like collision bound (for visual equivalent, see FF_PAPERSPRITE) + MF_PAPERCOLLISION = 1<<5, // You can push this object. It can activate switches and things by pushing it on top. MF_PUSHABLE = 1<<6, // Object is a boss. diff --git a/src/p_pspr.h b/src/p_pspr.h index 2fb232e73..c0064bc3e 100644 --- a/src/p_pspr.h +++ b/src/p_pspr.h @@ -36,7 +36,9 @@ #endif /// \brief Frame flags: only the frame number -#define FF_FRAMEMASK 0x3fff +#define FF_FRAMEMASK 0x1ff +/// \brief Frame flags: Thin, paper-like sprite (for collision equivalent, see MF_PAPERCOLLISION) +#define FF_PAPERSPRITE 0x800 /// \brief Frame flags: Simple stateless animation #define FF_ANIMATE 0x4000 /// \brief Frame flags: frame always appears full bright diff --git a/src/r_things.c b/src/r_things.c index 33b834ada..763f0cf86 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1123,7 +1123,7 @@ static void R_ProjectSprite(mobj_t *thing) fixed_t iscale; fixed_t scalestep; // toast '16 fixed_t offset, offset2; - boolean flatsprite = (thing->flags & MF_PAPER); + boolean papersprite = (thing->frame & FF_PAPERSPRITE); //SoM: 3/17/2000 fixed_t gz, gzt; @@ -1143,7 +1143,7 @@ static void R_ProjectSprite(mobj_t *thing) tz = gxt-gyt; // thing is behind view plane? - if (!(flatsprite) && (tz < FixedMul(MINZ, this_scale))) // flatsprite clipping is handled later + if (!(papersprite) && (tz < FixedMul(MINZ, this_scale))) // papersprite clipping is handled later return; gxt = -FixedMul(tr_x, viewsin); @@ -1203,10 +1203,10 @@ static void R_ProjectSprite(mobj_t *thing) I_Error("R_ProjectSprite: sprframes NULL for sprite %d\n", thing->sprite); #endif - if (sprframe->rotate != SRF_SINGLE || flatsprite) + if (sprframe->rotate != SRF_SINGLE || papersprite) { ang = R_PointToAngle (thing->x, thing->y) - thing->angle; - if (flatsprite) + if (papersprite) ang_scale = abs(FINESINE(ang>>ANGLETOFINESHIFT)); } @@ -1260,7 +1260,7 @@ static void R_ProjectSprite(mobj_t *thing) if (x2 < 0) return; - if (flatsprite) + if (papersprite) { fixed_t yscale2, cosmul, sinmul, tz2; INT32 range; @@ -1290,7 +1290,7 @@ static void R_ProjectSprite(mobj_t *thing) yscale2 = FixedDiv(projectiony, tz2); if (yscale2 < 64) return; // ditto - if (max(tz, tz2) < FixedMul(MINZ, this_scale)) // non-flatsprite clipping is handled earlier + if (max(tz, tz2) < FixedMul(MINZ, this_scale)) // non-papersprite clipping is handled earlier return; if (x2 > x1) From 79297d0cd7d1dbc9210e1ce651e8956c7171a051 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 20 Aug 2016 17:34:59 +0100 Subject: [PATCH 115/808] Woops. --- src/dehacked.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dehacked.c b/src/dehacked.c index 25c28d852..ae3099c58 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6691,7 +6691,7 @@ static const char *const MOBJFLAG_LIST[] = { "SHOOTABLE", "NOSECTOR", "NOBLOCKMAP", - "PAPER", + "PAPERCOLLISION", "PUSHABLE", "BOSS", "SPAWNCEILING", From f34a28e80e71cd783648d00463dfc9a74ef3508a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 21 Aug 2016 13:55:16 +0100 Subject: [PATCH 116/808] Removed a hack that caused the groundpound spinfire to hurt you if you lost your shield. --- src/dehacked.c | 10 ---------- src/doomdef.h | 2 +- src/info.c | 39 +-------------------------------------- src/info.h | 11 ----------- src/p_mobj.c | 24 ++++++++++++++++++++---- src/p_user.c | 6 ++++-- 6 files changed, 26 insertions(+), 66 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 1afa5f0cf..8fb0e8df7 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -4783,7 +4783,6 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_SPIKEBALL8", // Elemental Shield's Spawn - "S_SPINFIRE0", "S_SPINFIRE1", "S_SPINFIRE2", "S_SPINFIRE3", @@ -4791,15 +4790,6 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_SPINFIRE5", "S_SPINFIRE6", - // Elemental Shield's FLYING Spawn - "S_AIRSPINFIRE_FLY1", - "S_AIRSPINFIRE_FLY2", - "S_AIRSPINFIRE_FLY3", - "S_AIRSPINFIRE_FLY4", - "S_AIRSPINFIRE_FLY5", - "S_AIRSPINFIRE_FLY6", - "S_AIRSPINFIRE_DIE", - // Spikes "S_SPIKE1", "S_SPIKE2", diff --git a/src/doomdef.h b/src/doomdef.h index 70ec8c0d1..77c0a9800 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -158,7 +158,7 @@ extern FILE *logstream; // Does this version require an added patch file? // Comment or uncomment this as necessary. -//#define USE_PATCH_DTA +#define USE_PATCH_DTA // Modification options // If you want to take advantage of the Master Server's ability to force clients to update diff --git a/src/info.c b/src/info.c index f946e72e8..484ab321d 100644 --- a/src/info.c +++ b/src/info.c @@ -1124,7 +1124,6 @@ state_t states[NUMSTATES] = {SPR_SPIK, 7, 1, {A_RotateSpikeBall}, 0, 0, S_SPIKEBALL1}, // S_SPIKEBALL8 // Elemental Shield's Spawn - {SPR_SFLM, FF_FULLBRIGHT|5, 2, {A_SetFuse}, 6*TICRATE, 0, S_SPINFIRE1}, // S_SPINFIRE0 {SPR_SFLM, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_SPINFIRE2}, // S_SPINFIRE1 {SPR_SFLM, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_SPINFIRE3}, // S_SPINFIRE2 {SPR_SFLM, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_SPINFIRE4}, // S_SPINFIRE3 @@ -1132,15 +1131,6 @@ state_t states[NUMSTATES] = {SPR_SFLM, FF_FULLBRIGHT|4, 2, {NULL}, 0, 0, S_SPINFIRE6}, // S_SPINFIRE5 {SPR_SFLM, FF_FULLBRIGHT|5, 2, {NULL}, 0, 0, S_SPINFIRE1}, // S_SPINFIRE6 - // Elemental Shield's FLYING Spawn - {SPR_SFLM, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY2}, //S_AIRSPINFIRE_FLY1, - {SPR_SFLM, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY3}, //S_AIRSPINFIRE_FLY2, - {SPR_SFLM, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY4}, //S_AIRSPINFIRE_FLY3, - {SPR_SFLM, FF_FULLBRIGHT|3, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY5}, //S_AIRSPINFIRE_FLY4, - {SPR_SFLM, FF_FULLBRIGHT|4, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY6}, //S_AIRSPINFIRE_FLY5, - {SPR_SFLM, FF_FULLBRIGHT|5, 2, {NULL}, 0, 0, S_AIRSPINFIRE_FLY1}, //S_AIRSPINFIRE_FLY6, - {SPR_SFLM, FF_FULLBRIGHT, 0, {A_SpawnObjectRelative}, 0, MT_SPINFIRE, S_NULL}, //S_AIRSPINFIRE_DIE, - // Floor Spike {SPR_USPK, 0,-1, {A_SpikeRetract}, 1, 0, S_SPIKE2}, // S_SPIKE1 -- Fully extended {SPR_USPK, 5, 2, {A_Pain}, 0, 0, S_SPIKE3}, // S_SPIKE2 @@ -5404,7 +5394,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = { // MT_SPINFIRE -1, // doomednum - S_SPINFIRE0, // spawnstate + S_SPINFIRE1, // spawnstate 1, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -5429,33 +5419,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_AIRSPINFIRE - -1, // doomednum - S_AIRSPINFIRE_FLY1, // 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_AIRSPINFIRE_DIE, // deathstate - S_NULL, // xdeathstate - sfx_None, // deathsound - 10*FRACUNIT, // speed - 8*FRACUNIT, // radius - 14*FRACUNIT, // height - 0, // display offset - 100, // mass - 1, // damage - sfx_None, // activesound - MF_NOBLOCKMAP|MF_MISSILE|MF_FIRE, // flags - S_NULL // raisestate - }, - { // MT_SPIKE 523, // doomednum S_SPIKE1, // spawnstate diff --git a/src/info.h b/src/info.h index 8a56ef77e..2460f6fbc 100644 --- a/src/info.h +++ b/src/info.h @@ -1634,7 +1634,6 @@ typedef enum state S_SPIKEBALL8, // Elemental Shield's Spawn - S_SPINFIRE0, S_SPINFIRE1, S_SPINFIRE2, S_SPINFIRE3, @@ -1642,15 +1641,6 @@ typedef enum state S_SPINFIRE5, S_SPINFIRE6, - // Elemental Shield's FLYING Spawn - S_AIRSPINFIRE_FLY1, - S_AIRSPINFIRE_FLY2, - S_AIRSPINFIRE_FLY3, - S_AIRSPINFIRE_FLY4, - S_AIRSPINFIRE_FLY5, - S_AIRSPINFIRE_FLY6, - S_AIRSPINFIRE_DIE, - // Spikes S_SPIKE1, S_SPIKE2, @@ -3143,7 +3133,6 @@ typedef enum mobj_type MT_SPIKEBALL, // Spike Ball MT_SPECIALSPIKEBALL, MT_SPINFIRE, - MT_AIRSPINFIRE, // Elemental flame flying through the air MT_SPIKE, MT_STARPOST, MT_BIGMINE, diff --git a/src/p_mobj.c b/src/p_mobj.c index 138455604..5ce06f90b 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2377,6 +2377,19 @@ static boolean P_ZMovement(mobj_t *mo) mo->flags |= MF_NOGRAVITY; } break; + case MT_SPINFIRE: + if (P_CheckDeathPitCollide(mo)) + { + P_RemoveMobj(mo); + return false; + } + if (mo->z <= mo->floorz && mo->momz) + { + mo->flags |= MF_NOGRAVITY; + mo->momx = mo->momy = mo->momz = 0; + mo->z = mo->floorz; + } + break; case MT_GOOP: if (P_CheckDeathPitCollide(mo)) { @@ -7338,10 +7351,13 @@ void P_MobjThinker(mobj_t *mobj) #endif break; case MT_SPINFIRE: - if (mobj->eflags & MFE_VERTICALFLIP) - mobj->z = mobj->ceilingz - mobj->height; - else - mobj->z = mobj->floorz; + if (mobj->flags & MF_NOGRAVITY) + { + if (mobj->eflags & MFE_VERTICALFLIP) + mobj->z = mobj->ceilingz - mobj->height; + else + mobj->z = mobj->floorz; + } // THERE IS NO BREAK HERE ON PURPOSE default: // check mobj against possible water content, before movement code diff --git a/src/p_user.c b/src/p_user.c index 2d957aec3..99eef15ae 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6224,9 +6224,11 @@ void P_ElementalFire(player_t *player, boolean cropcircle) #define numangles 8 for (i = 0; i < numangles; i++) { - flame = P_SpawnMobj(player->mo->x, player->mo->y, ground, MT_AIRSPINFIRE); + flame = P_SpawnMobj(player->mo->x, player->mo->y, ground, MT_SPINFIRE); + flame->flags &= ~MF_NOGRAVITY; P_SetTarget(&flame->target, player->mo); flame->angle = travelangle + i*(ANGLE_MAX/numangles); + flame->fuse = TICRATE*7; // takes about an extra second to hit the ground flame->destscale = player->mo->scale; P_SetScale(flame, player->mo->scale); flame->eflags = (flame->eflags & ~MFE_VERTICALFLIP)|(player->mo->eflags & MFE_VERTICALFLIP); @@ -6255,7 +6257,7 @@ void P_ElementalFire(player_t *player, boolean cropcircle) flame = P_SpawnMobj(newx, newy, ground, MT_SPINFIRE); P_SetTarget(&flame->target, player->mo); flame->angle = travelangle; - // flame->fuse = TICRATE*6; // now done in spawnstate + flame->fuse = TICRATE*6; flame->destscale = player->mo->scale; P_SetScale(flame, player->mo->scale); flame->eflags = (flame->eflags & ~MFE_VERTICALFLIP)|(player->mo->eflags & MFE_VERTICALFLIP); From dc3be7b8a199019ed29c0b0164c89e0d2dde1bfa Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 21 Aug 2016 15:42:09 +0100 Subject: [PATCH 117/808] Removing now-irrelevant whitespace and cleaning up the last of the hack. --- src/info.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/info.c b/src/info.c index 484ab321d..cc635c038 100644 --- a/src/info.c +++ b/src/info.c @@ -1124,12 +1124,12 @@ state_t states[NUMSTATES] = {SPR_SPIK, 7, 1, {A_RotateSpikeBall}, 0, 0, S_SPIKEBALL1}, // S_SPIKEBALL8 // Elemental Shield's Spawn - {SPR_SFLM, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_SPINFIRE2}, // S_SPINFIRE1 - {SPR_SFLM, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_SPINFIRE3}, // S_SPINFIRE2 - {SPR_SFLM, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_SPINFIRE4}, // S_SPINFIRE3 - {SPR_SFLM, FF_FULLBRIGHT|3, 2, {NULL}, 0, 0, S_SPINFIRE5}, // S_SPINFIRE4 - {SPR_SFLM, FF_FULLBRIGHT|4, 2, {NULL}, 0, 0, S_SPINFIRE6}, // S_SPINFIRE5 - {SPR_SFLM, FF_FULLBRIGHT|5, 2, {NULL}, 0, 0, S_SPINFIRE1}, // S_SPINFIRE6 + {SPR_SFLM, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_SPINFIRE2}, // S_SPINFIRE1 + {SPR_SFLM, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_SPINFIRE3}, // S_SPINFIRE2 + {SPR_SFLM, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_SPINFIRE4}, // S_SPINFIRE3 + {SPR_SFLM, FF_FULLBRIGHT|3, 2, {NULL}, 0, 0, S_SPINFIRE5}, // S_SPINFIRE4 + {SPR_SFLM, FF_FULLBRIGHT|4, 2, {NULL}, 0, 0, S_SPINFIRE6}, // S_SPINFIRE5 + {SPR_SFLM, FF_FULLBRIGHT|5, 2, {NULL}, 0, 0, S_SPINFIRE1}, // S_SPINFIRE6 // Floor Spike {SPR_USPK, 0,-1, {A_SpikeRetract}, 1, 0, S_SPIKE2}, // S_SPIKE1 -- Fully extended @@ -5415,7 +5415,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 1, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_MISSILE|MF_NOGRAVITY|MF_FIRE|MF_RUNSPAWNFUNC, // flags + MF_NOBLOCKMAP|MF_MISSILE|MF_NOGRAVITY|MF_FIRE, // flags S_NULL // raisestate }, From ead52294ab62a059c6b5da63e1fcaf747f1299f4 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 21 Aug 2016 21:17:47 +0100 Subject: [PATCH 118/808] THE LINES LIVE AGAIN (initial horizon lines work commit) --- src/r_segs.c | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/r_segs.c b/src/r_segs.c index cb78743b6..6817ab8b8 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -2622,22 +2622,27 @@ void R_StoreWallRange(INT32 start, INT32 stop) worldbottomslope >>= 4; #endif - topstep = -FixedMul (rw_scalestep, worldtop); - topfrac = (centeryfrac>>4) - FixedMul (worldtop, rw_scale); + if (linedef->special == 41) { // HORIZON LINES + topstep = bottomstep = 0; + topfrac = bottomfrac = (centeryfrac>>4); + } else { + topstep = -FixedMul (rw_scalestep, worldtop); + topfrac = (centeryfrac>>4) - FixedMul (worldtop, rw_scale); - bottomstep = -FixedMul (rw_scalestep,worldbottom); - bottomfrac = (centeryfrac>>4) - FixedMul (worldbottom, rw_scale); + bottomstep = -FixedMul (rw_scalestep,worldbottom); + bottomfrac = (centeryfrac>>4) - FixedMul (worldbottom, rw_scale); #ifdef ESLOPE - if (frontsector->c_slope) { - fixed_t topfracend = (centeryfrac>>4) - FixedMul (worldtopslope, ds_p->scale2); - topstep = (topfracend-topfrac)/(range); - } - if (frontsector->f_slope) { - fixed_t bottomfracend = (centeryfrac>>4) - FixedMul (worldbottomslope, ds_p->scale2); - bottomstep = (bottomfracend-bottomfrac)/(range); - } + if (frontsector->c_slope) { + fixed_t topfracend = (centeryfrac>>4) - FixedMul (worldtopslope, ds_p->scale2); + topstep = (topfracend-topfrac)/(range); + } + if (frontsector->f_slope) { + fixed_t bottomfracend = (centeryfrac>>4) - FixedMul (worldbottomslope, ds_p->scale2); + bottomstep = (bottomfracend-bottomfrac)/(range); + } #endif + } dc_numlights = 0; From 41b3b3c5bdfdc9a0b9f001160d18b3e63f4661e1 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 22 Aug 2016 23:42:06 +0100 Subject: [PATCH 119/808] GCC 4.6 and lower fix --- src/r_things.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_things.c b/src/r_things.c index 763f0cf86..c5b47194c 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1119,7 +1119,7 @@ static void R_ProjectSprite(mobj_t *thing) vissprite_t *vis; - angle_t ang; + angle_t ang = 0; fixed_t iscale; fixed_t scalestep; // toast '16 fixed_t offset, offset2; From 74e7433a92b6fa8d33ac8362c7f4f0fc148be423 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 29 Aug 2016 22:42:06 +0100 Subject: [PATCH 120/808] Upper Unpegged on an FOF's control linedef now enables skewing of walls with respect to slopes Skewing direction is decided per in-level wall by the Lower Unpegged flag on in-level linedefs themselves, since they already decide the stuff for FOF wall pegging as it is. That is unless Transfer Line is involved which moves everything to the control sector linedefs instead... --- src/r_segs.c | 73 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 64 insertions(+), 9 deletions(-) diff --git a/src/r_segs.c b/src/r_segs.c index cb78743b6..3e525bf33 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -728,6 +728,12 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) // Render FOF sides kinda like normal sides, with the frac and step and everything // NOTE: INT64 instead of fixed_t because overflow concerns INT64 top_frac, top_step, bottom_frac, bottom_step; + // skew FOF walls with slopes? + boolean slopeskew = false; + fixed_t ffloortextureslide = 0; + INT32 oldx = -1; + fixed_t left_top, left_bottom; // needed here for slope skewing + pslope_t *skewslope = NULL; #endif void (*colfunc_2s) (column_t *); @@ -951,21 +957,68 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) mceilingclip = ds->sprtopclip; dc_texheight = textureheight[texnum]>>FRACBITS; +#ifdef ESLOPE + // calculate both left ends + if (*pfloor->t_slope) + left_top = P_GetZAt(*pfloor->t_slope, ds->leftpos.x, ds->leftpos.y) - viewz; + else + left_top = *pfloor->topheight - viewz; + + if (*pfloor->b_slope) + left_bottom = P_GetZAt(*pfloor->b_slope, ds->leftpos.x, ds->leftpos.y) - viewz; + else + left_bottom = *pfloor->bottomheight - viewz; + dc_texturemid = left_top; + skewslope = *pfloor->t_slope; // skew using top slope by default +#else dc_texturemid = *pfloor->topheight - viewz; +#endif if (newline) { offsetvalue = sides[newline->sidenum[0]].rowoffset; if (newline->flags & ML_DONTPEGBOTTOM) +#ifdef ESLOPE + { + dc_texturemid = left_bottom; + skewslope = *pfloor->b_slope; // skew using bottom slope + } +#else offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; +#endif +#ifdef ESLOPE + if (newline->flags & ML_DONTPEGTOP) + slopeskew = true; +#endif } else { offsetvalue = sides[pfloor->master->sidenum[0]].rowoffset; if (curline->linedef->flags & ML_DONTPEGBOTTOM) +#ifdef ESLOPE + { + dc_texturemid = left_bottom; + skewslope = *pfloor->b_slope; // skew using bottom slope + } +#else offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; +#endif +#ifdef ESLOPE + if (pfloor->master->flags & ML_DONTPEGTOP) // use control linedef's flags + slopeskew = true; +#endif } +#ifdef ESLOPE + if (slopeskew) + { + angle_t lineangle = R_PointToAngle2(curline->v1->x, curline->v1->y, curline->v2->x, curline->v2->y); + + if (skewslope) + ffloortextureslide = FixedMul(skewslope->zdelta, FINECOSINE((lineangle-skewslope->xydirection)>>ANGLETOFINESHIFT)); + } +#endif + dc_texturemid += offsetvalue; //faB: handle case where multipatch texture is drawn on a 2sided wall, multi-patch textures @@ -981,23 +1034,18 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) #ifdef ESLOPE // Set heights according to plane, or slope, whichever { - fixed_t left_top, right_top, left_bottom, right_bottom; + fixed_t right_top, right_bottom; + // calculate right ends now if (*pfloor->t_slope) - { - left_top = P_GetZAt(*pfloor->t_slope, ds->leftpos.x, ds->leftpos.y) - viewz; right_top = P_GetZAt(*pfloor->t_slope, ds->rightpos.x, ds->rightpos.y) - viewz; - } else - left_top = right_top = *pfloor->topheight - viewz; + right_top = *pfloor->topheight - viewz; if (*pfloor->b_slope) - { - left_bottom = P_GetZAt(*pfloor->b_slope, ds->leftpos.x, ds->leftpos.y) - viewz; right_bottom = P_GetZAt(*pfloor->b_slope, ds->rightpos.x, ds->rightpos.y) - viewz; - } else - left_bottom = right_bottom = *pfloor->bottomheight - viewz; + right_bottom = *pfloor->bottomheight - viewz; // using INT64 to avoid 32bit overflow top_frac = (INT64)centeryfrac - (((INT64)left_top * ds->scale1) >> FRACBITS); @@ -1021,6 +1069,13 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) { if (maskedtexturecol[dc_x] != INT16_MAX) { +#ifdef ESLOPE + if (ffloortextureslide) { // skew FOF walls + if (oldx != -1) + dc_texturemid += FixedMul(ffloortextureslide, (maskedtexturecol[oldx]-maskedtexturecol[dc_x])< Date: Mon, 29 Aug 2016 23:21:57 +0100 Subject: [PATCH 121/808] If NOT skewing FOF walls, make sure dc_texturemid reverts to using unsloped FOF topheight/bottomheight rather than actual left side top/bottom heights --- src/r_segs.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/r_segs.c b/src/r_segs.c index 3e525bf33..148d0b8f7 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -968,45 +968,45 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) left_bottom = P_GetZAt(*pfloor->b_slope, ds->leftpos.x, ds->leftpos.y) - viewz; else left_bottom = *pfloor->bottomheight - viewz; - dc_texturemid = left_top; skewslope = *pfloor->t_slope; // skew using top slope by default -#else - dc_texturemid = *pfloor->topheight - viewz; + if (newline && newline->flags & ML_DONTPEGTOP) + slopeskew = true; + else if (pfloor->master->flags & ML_DONTPEGTOP) + slopeskew = true; + + if (slopeskew) + dc_texturemid = left_top; + else #endif + dc_texturemid = *pfloor->topheight - viewz; if (newline) { offsetvalue = sides[newline->sidenum[0]].rowoffset; if (newline->flags & ML_DONTPEGBOTTOM) -#ifdef ESLOPE { - dc_texturemid = left_bottom; - skewslope = *pfloor->b_slope; // skew using bottom slope - } -#else - offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; -#endif #ifdef ESLOPE - if (newline->flags & ML_DONTPEGTOP) - slopeskew = true; + skewslope = *pfloor->b_slope; // skew using bottom slope + if (slopeskew) + dc_texturemid = left_bottom; + else #endif + offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; + } } else { offsetvalue = sides[pfloor->master->sidenum[0]].rowoffset; if (curline->linedef->flags & ML_DONTPEGBOTTOM) -#ifdef ESLOPE { - dc_texturemid = left_bottom; - skewslope = *pfloor->b_slope; // skew using bottom slope - } -#else - offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; -#endif #ifdef ESLOPE - if (pfloor->master->flags & ML_DONTPEGTOP) // use control linedef's flags - slopeskew = true; + skewslope = *pfloor->b_slope; // skew using bottom slope + if (slopeskew) + dc_texturemid = left_bottom; + else #endif + offsetvalue -= *pfloor->topheight - *pfloor->bottomheight; + } } #ifdef ESLOPE From 5e6bf9e340c18b8289385714de193601e9708315 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 29 Aug 2016 23:24:59 +0100 Subject: [PATCH 122/808] probably best if we did this instead actually --- src/r_segs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/r_segs.c b/src/r_segs.c index 148d0b8f7..463325812 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -969,8 +969,11 @@ void R_RenderThickSideRange(drawseg_t *ds, INT32 x1, INT32 x2, ffloor_t *pfloor) else left_bottom = *pfloor->bottomheight - viewz; skewslope = *pfloor->t_slope; // skew using top slope by default - if (newline && newline->flags & ML_DONTPEGTOP) - slopeskew = true; + if (newline) + { + if (newline->flags & ML_DONTPEGTOP) + slopeskew = true; + } else if (pfloor->master->flags & ML_DONTPEGTOP) slopeskew = true; From 7be8c0017efbaf0e7abc83db42e261743ebe0cd0 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 19:20:51 -0400 Subject: [PATCH 123/808] appveyor: let see what version of GCC are here --- appveyor.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index e0ee99c61..f9acf0a2f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -77,9 +77,9 @@ deploy: active_mode: false on: branch: master - appveyor_repo_tag: true + appveyor_repo_tag: false on_finish: -#- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:: -#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) +- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:: +- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) From 038a9f19cb55ac7d0786d9b69c7d2d74c7ebd58f Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 19:49:07 -0400 Subject: [PATCH 124/808] appveyor: let use GCC 4.9.3 from Mingw32 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index f9acf0a2f..33c0f3aab 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,7 +5,7 @@ environment: CC: ccache CCACHE_CC: i686-w64-mingw32-gcc WINDRES: windres - MINGW_SDK: c:\msys64\mingw32 + MINGW_SDK: c:\MinGW CFLAGS: -Wall -W -Werror NASM_ZIP: nasm-2.12.01 NASM_URL: http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/win64/nasm-2.12.01-win64.zip From df6d3de8cabbbe859ee1543b5427256e642a719c Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 19:57:28 -0400 Subject: [PATCH 125/808] appveyor: use mingw32-gcc as compiler --- appveyor.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 33c0f3aab..297ad0556 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,7 @@ os: MinGW environment: CC: ccache - CCACHE_CC: i686-w64-mingw32-gcc + CCACHE_CC: mingw32-gcc WINDRES: windres MINGW_SDK: c:\MinGW CFLAGS: -Wall -W -Werror @@ -75,9 +75,9 @@ deploy: folder: appveyor application: active_mode: false - on: - branch: master - appveyor_repo_tag: false +# on: +# branch: master +# appveyor_repo_tag: true on_finish: From ab322179f59a56144ff9fff3da2deaa363a5299e Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 19:59:15 -0400 Subject: [PATCH 126/808] appveyor: compile with GCC 4.9 warning flags --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 297ad0556..8954257c8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -47,7 +47,7 @@ before_build: - upx -V - ccache -V - ccache -s -- set SRB2_MFLAGS=-C src MINGW=1 WARNINGMODE=1 GCC53=1 CCACHE=1 +- set SRB2_MFLAGS=-C src MINGW=1 WARNINGMODE=1 GCC49=1 CCACHE=1 build_script: - cmd: mingw32-make.exe %SRB2_MFLAGS% %CONFIGURATION%=1 clean From f5ae094e5b7c7e200e3a411b88e14b297a4283a3 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 20:09:45 -0400 Subject: [PATCH 127/808] appveyor: fixup PATH --- appveyor.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 8954257c8..246bf6fd1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -40,8 +40,8 @@ configuration: - DD before_build: -- set Path=%MINGW_SDK%\bin;%Path% -- i686-w64-mingw32-gcc --version +- set PATH=%MINGW_SDK%\bin;%PATH% +- mingw32-gcc --version - mingw32-make --version - nasm -v - upx -V @@ -81,5 +81,5 @@ deploy: on_finish: -- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:: -- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) +#- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:: +#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) From d79804c1191ca022b2d9f140030e426d7bfe6ddd Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 20:14:01 -0400 Subject: [PATCH 128/808] appveyor: call up Mingw GCC directly --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 246bf6fd1..573ef74bd 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,7 @@ os: MinGW environment: CC: ccache - CCACHE_CC: mingw32-gcc + CCACHE_CC: C:\MinGW\bin\mingw32-gcc.exe WINDRES: windres MINGW_SDK: c:\MinGW CFLAGS: -Wall -W -Werror @@ -41,7 +41,7 @@ configuration: before_build: - set PATH=%MINGW_SDK%\bin;%PATH% -- mingw32-gcc --version +- C:\MinGW\bin\mingw32-gcc.exe --version - mingw32-make --version - nasm -v - upx -V From 1afe83250d95c7e2d0774a64e649d72c4e0ce398 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 20:40:00 -0400 Subject: [PATCH 129/808] appveyor: let use CCACHE_PATH --- appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 573ef74bd..61cbff191 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -3,7 +3,8 @@ os: MinGW environment: CC: ccache - CCACHE_CC: C:\MinGW\bin\mingw32-gcc.exe + CCACHE_CC: mingw32-gcc.exe + CCACHE_PATH: C:\MinGW\bin WINDRES: windres MINGW_SDK: c:\MinGW CFLAGS: -Wall -W -Werror From ad9956294c5a2ef3b05bd2768c7381f733c99208 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 20:54:15 -0400 Subject: [PATCH 130/808] appveyor: revert MINGW_SDK --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 61cbff191..94d1fdf5c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,7 +6,7 @@ environment: CCACHE_CC: mingw32-gcc.exe CCACHE_PATH: C:\MinGW\bin WINDRES: windres - MINGW_SDK: c:\MinGW + MINGW_SDK: c:\msys64\mingw32 CFLAGS: -Wall -W -Werror NASM_ZIP: nasm-2.12.01 NASM_URL: http://www.nasm.us/pub/nasm/releasebuilds/2.12.01/win64/nasm-2.12.01-win64.zip From e38329e965abcc0827a756465d6842d5a9cab062 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 21:04:16 -0400 Subject: [PATCH 131/808] appveyor: reenable RDP --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 94d1fdf5c..22187831a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -83,4 +83,4 @@ deploy: on_finish: #- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:: -#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) +- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) From ae4f68088897792bf001348233fa19afdcee7030 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 21:23:28 -0400 Subject: [PATCH 132/808] appveyor: add both Mingw folders into the PATH --- appveyor.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 22187831a..6dcd32014 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,9 +2,7 @@ version: 2.1.16.{branch}-{build} os: MinGW environment: - CC: ccache - CCACHE_CC: mingw32-gcc.exe - CCACHE_PATH: C:\MinGW\bin + CC: mingw32-gcc.exe WINDRES: windres MINGW_SDK: c:\msys64\mingw32 CFLAGS: -Wall -W -Werror @@ -41,8 +39,8 @@ configuration: - DD before_build: -- set PATH=%MINGW_SDK%\bin;%PATH% -- C:\MinGW\bin\mingw32-gcc.exe --version +- set PATH=%MINGW_SDK%\bin;C:\Mingw\bin;%PATH% +- mingw32-gcc.exe --version - mingw32-make --version - nasm -v - upx -V From ad32803370fae55e57a6d5d4b114b203bea45c21 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 6 Sep 2016 21:23:28 -0400 Subject: [PATCH 133/808] appveyor: disable FTP upload and RDP --- appveyor.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 6dcd32014..13ee48f79 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -62,18 +62,18 @@ after_build: test: off -deploy: - - provider: FTP - protocol: ftps - host: - secure: NsLJEPIBvmwCOj8Tg8RoRQ== - username: - secure: ejxi5mvk7oLYu7QtbYojajEPigMy0mokaKhuEVuDZcA= - password: - secure: Hbn6Uy3lT0YZ88yFJ3aW4w== - folder: appveyor - application: - active_mode: false +#deploy: +# - provider: FTP +# protocol: ftps +# host: +# secure: NsLJEPIBvmwCOj8Tg8RoRQ== +# username: +# secure: ejxi5mvk7oLYu7QtbYojajEPigMy0mokaKhuEVuDZcA= +# password: +# secure: Hbn6Uy3lT0YZ88yFJ3aW4w== +# folder: appveyor +# application: +# active_mode: false # on: # branch: master # appveyor_repo_tag: true @@ -81,4 +81,4 @@ deploy: on_finish: #- cmd: echo xfreerdp /u:appveyor /cert-ignore +clipboard /v:: -- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) +#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) From 9f87841936a957c4c7552089654cfdd2bd22cc15 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 8 Sep 2016 22:55:11 +0100 Subject: [PATCH 134/808] Fix bottom of FOF with a pusher special not accounting for slopes --- src/p_spec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_spec.c b/src/p_spec.c index 30b08ebb1..92f62af4d 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -7428,7 +7428,7 @@ void T_Pusher(pusher_t *p) } else { - if (top < thing->z || referrer->floorheight > (thing->z + (thing->height >> 1))) + if (top < thing->z || bottom > (thing->z + (thing->height >> 1))) continue; if (thing->z + thing->height > top) touching = true; From c9aebc6f81837faa09183c10de3f048e4bdb936e Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 9 Sep 2016 17:41:30 -0400 Subject: [PATCH 135/808] libz pkgconfig --- src/Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Makefile b/src/Makefile index ce4b569ee..b83b201e6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -179,6 +179,9 @@ endif ifdef LINUX UNIXCOMMON=1 +ifndef NOGME +HAVE_LIBGME=1 +endif endif ifdef SOLARIS @@ -318,6 +321,13 @@ endif ifdef HAVE_LIBGME OPTS+=-DHAVE_LIBGME +ZLIB_PKGCONFIG?=zlib +ZLIB_CFLAGS?=$(shell $(PKG_CONFIG) $(ZLIB_PKGCONFIG) --cflags) +ZLIB_LDFLAGS?=$(shell $(PKG_CONFIG) $(ZLIB_PKGCONFIG) --libs) + +LIBS+=$(ZLIB_LDFLAGS) +CFLAGS+=$(ZLIB_CFLAGS) + LIBGME_PKGCONFIG?=libgme LIBGME_CFLAGS?=$(shell $(PKG_CONFIG) $(LIBGME_PKGCONFIG) --cflags) LIBGME_LDFLAGS?=$(shell $(PKG_CONFIG) $(LIBGME_PKGCONFIG) --libs) From c977d174166142a47b5aa7a2d32f57a2a5412702 Mon Sep 17 00:00:00 2001 From: ilag11111 Date: Sun, 11 Sep 2016 09:41:18 -0700 Subject: [PATCH 136/808] Prevent truncation when resampling sounds with non-multiples of 11250. --- src/sdl/mixer_sound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 4a46813c1..88bbadd20 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -220,7 +220,7 @@ static Mix_Chunk *ds2chunk(void *stream) break; default: // convert arbitrary hz to 44100. step = 0; - frac = ((UINT32)freq << FRACBITS) / 44100; + frac = ((UINT32)freq << FRACBITS) / 44100 + 1; //Add 1 to counter truncation. while (i < samples) { o = (INT16)(*s+0x80)<<8; // changed signedness and shift up to 16 bits From 2798bd5c163b239eb7dd2eed40944b067eb3bc94 Mon Sep 17 00:00:00 2001 From: ilag11111 Date: Sun, 11 Sep 2016 10:40:49 -0700 Subject: [PATCH 137/808] Ensure demo files will save to srb2home, where SRB2 already looks for them. --- src/g_game.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index f891b0105..9ad8460d2 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -5579,7 +5579,10 @@ boolean G_CheckDemoStatus(void) WRITEUINT8(demo_p, DEMOMARKER); // add the demo end marker md5_buffer((char *)p+16, demo_p - (p+16), p); // make a checksum of everything after the checksum in the file. #endif - saved = FIL_WriteFile(demoname, demobuffer, demo_p - demobuffer); // finally output the file. + + char fulldemoname [128]; + sprintf(fulldemoname, "%s"PATHSEP"%s", srb2home, demoname); + saved = FIL_WriteFile(fulldemoname, demobuffer, demo_p - demobuffer); // finally output the file. free(demobuffer); demorecording = false; From 4abfe1e8f36f654b467f38b23debfcc8c156cbd0 Mon Sep 17 00:00:00 2001 From: ilag11111 Date: Sun, 11 Sep 2016 10:57:14 -0700 Subject: [PATCH 138/808] Fix MinGW/AppVeyor build. --- 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 9ad8460d2..08c6be101 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -5529,6 +5529,7 @@ void G_StopDemo(void) boolean G_CheckDemoStatus(void) { boolean saved; + char fulldemoname[128]; //Demo name with srb2home path if(ghosts) // ... ... ... ghosts = NULL; // :) @@ -5580,7 +5581,6 @@ boolean G_CheckDemoStatus(void) md5_buffer((char *)p+16, demo_p - (p+16), p); // make a checksum of everything after the checksum in the file. #endif - char fulldemoname [128]; sprintf(fulldemoname, "%s"PATHSEP"%s", srb2home, demoname); saved = FIL_WriteFile(fulldemoname, demobuffer, demo_p - demobuffer); // finally output the file. free(demobuffer); From 3b503f133640bde612862ec23310be06f9685a50 Mon Sep 17 00:00:00 2001 From: ilag11111 Date: Sun, 11 Sep 2016 14:59:24 -0700 Subject: [PATCH 139/808] Use function va to avoid having to delcare a new variable. Thanks MonsterIestyn. --- src/g_game.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 08c6be101..84db90132 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -5529,7 +5529,6 @@ void G_StopDemo(void) boolean G_CheckDemoStatus(void) { boolean saved; - char fulldemoname[128]; //Demo name with srb2home path if(ghosts) // ... ... ... ghosts = NULL; // :) @@ -5580,9 +5579,7 @@ boolean G_CheckDemoStatus(void) WRITEUINT8(demo_p, DEMOMARKER); // add the demo end marker md5_buffer((char *)p+16, demo_p - (p+16), p); // make a checksum of everything after the checksum in the file. #endif - - sprintf(fulldemoname, "%s"PATHSEP"%s", srb2home, demoname); - saved = FIL_WriteFile(fulldemoname, demobuffer, demo_p - demobuffer); // finally output the file. + saved = FIL_WriteFile(va(pandf, srb2home, demoname), demobuffer, demo_p - demobuffer); // finally output the file. free(demobuffer); demorecording = false; From db6e7fd985c4d56ffafe070c207d2cd77763f7bb Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 16 Sep 2016 17:09:33 +0100 Subject: [PATCH 140/808] Introducing MF2_LINKDRAW! I put it in this branch because it (ab)uses some structural changes I made for papersprites. * Sets the sortscale of the mobj to that of its tracer. * Basically, Smiles' tails won't clip through shields thanks to this. * http://gfycat.com/GraveGlassEwe * Also has support for chains of MF2_LINKDRAW! --- src/dehacked.c | 1 + src/p_mobj.h | 1 + src/r_things.c | 38 +++++++++++++++++++++++++++++++++++--- src/r_things.h | 4 ++-- 4 files changed, 39 insertions(+), 5 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index ae3099c58..b2290e2ff 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6749,6 +6749,7 @@ static const char *const MOBJFLAG2_LIST[] = { "BOSSFLEE", // Boss is fleeing! "BOSSDEAD", // Boss is dead! (Not necessarily fleeing, if a fleeing point doesn't exist.) "AMBUSH", // Alternate behaviour typically set by MTF_AMBUSH + "LINKDRAW", NULL }; diff --git a/src/p_mobj.h b/src/p_mobj.h index 50af8acc9..69e0e11aa 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -192,6 +192,7 @@ typedef enum MF2_BOSSFLEE = 1<<25, // Boss is fleeing! MF2_BOSSDEAD = 1<<26, // Boss is dead! (Not necessarily fleeing, if a fleeing point doesn't exist.) MF2_AMBUSH = 1<<27, // Alternate behaviour typically set by MTF_AMBUSH + MF2_LINKDRAW = 1<<28, // Draw vissprite of mobj immediately before/after tracer's vissprite (dependent on dispoffset and position) // free: to and including 1<<31 } mobjflag2_t; diff --git a/src/r_things.c b/src/r_things.c index 13d232d78..2360cc23f 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1119,12 +1119,14 @@ static void R_ProjectSprite(mobj_t *thing) vissprite_t *vis; - angle_t ang = 0; + angle_t ang = 0; // compiler complaints fixed_t iscale; - fixed_t scalestep; // toast '16 + fixed_t scalestep; fixed_t offset, offset2; boolean papersprite = (thing->frame & FF_PAPERSPRITE); + INT32 dispoffset = thing->info->dispoffset; + //SoM: 3/17/2000 fixed_t gz, gzt; INT32 heightsec, phs; @@ -1312,6 +1314,36 @@ static void R_ProjectSprite(mobj_t *thing) xscale = FixedMul(xscale, ang_scale); + if ((thing->flags2 & MF2_LINKDRAW) && thing->tracer) // toast 16/09/16 (SYMMETRY) + { + mobj_t *link, *link2; + fixed_t linkscale; + + for (link = thing->tracer; (link->tracer && (link->flags2 & MF2_LINKDRAW)); link = link->tracer) + link->flags2 &= ~MF2_LINKDRAW; // to prevent infinite loops, otherwise would just be a ; + + for (link2 = thing->tracer; (link2->tracer && (link2 != link)); link2 = link2->tracer) + link->flags2 |= MF2_LINKDRAW; // only needed for correction of the above + + if (link->flags2 & MF2_LINKDRAW) + link->flags2 &= ~MF2_LINKDRAW; // let's try and make sure this doesn't happen again... + + tr_x = link->x - viewx; + tr_y = link->y - viewy; + gxt = FixedMul(tr_x, viewcos); + gyt = -FixedMul(tr_y, viewsin); + tz = gxt-gyt; + linkscale = FixedDiv(projectiony, tz); + + if (tz < FixedMul(MINZ, this_scale)) + return; + + if (sortscale < linkscale) + dispoffset *= -1; // if it's physically behind, make sure it's ordered behind (if dispoffset > 0) + + sortscale = linkscale; // now make sure it's linked + } + // PORTAL SPRITE CLIPPING if (portalrender) { @@ -1394,7 +1426,7 @@ static void R_ProjectSprite(mobj_t *thing) vis->mobjflags = thing->flags; vis->scale = yscale; //<sortscale = sortscale; - vis->dispoffset = thing->info->dispoffset; // Monster Iestyn: 23/11/15 + vis->dispoffset = dispoffset; // Monster Iestyn: 23/11/15 vis->gx = thing->x; vis->gy = thing->y; vis->gz = gz; diff --git a/src/r_things.h b/src/r_things.h index 360ead433..01cfc8903 100644 --- a/src/r_things.h +++ b/src/r_things.h @@ -135,8 +135,8 @@ typedef struct vissprite_s fixed_t pz, pzt; // physical bottom/top for sorting with 3D floors fixed_t startfrac; // horizontal position of x1 - fixed_t scale, sortscale; // sortscale only differs from scale for flat sprites - fixed_t scalestep; // only for flat sprites, 0 otherwise + fixed_t scale, sortscale; // sortscale only differs from scale for paper sprites and MF2_LINKDRAW + fixed_t scalestep; // only for paper sprites, 0 otherwise fixed_t xiscale; // negative if flipped fixed_t texturemid; From 54f463ce817e9225e3e07122cefa781c6e0cd3ac Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 16 Sep 2016 17:15:16 +0100 Subject: [PATCH 141/808] Forgot dehacked.c description! --- src/dehacked.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dehacked.c b/src/dehacked.c index b2290e2ff..33cd61fb5 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6749,7 +6749,7 @@ static const char *const MOBJFLAG2_LIST[] = { "BOSSFLEE", // Boss is fleeing! "BOSSDEAD", // Boss is dead! (Not necessarily fleeing, if a fleeing point doesn't exist.) "AMBUSH", // Alternate behaviour typically set by MTF_AMBUSH - "LINKDRAW", + "LINKDRAW", // Draw vissprite of mobj immediately before/after tracer's vissprite (dependent on dispoffset and position) NULL }; From b8345aaf27ab32dd7cee8960143fc63bd666f5c2 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 22 Sep 2016 00:13:34 +0100 Subject: [PATCH 142/808] Solid objects are now no longer selectively intangible on slopes. HOWEVER, since these changes to PIT_CheckThing do raise questions about whether there may be unintended side effects here. As a result, I may remake this for internal only if necessary. --- src/p_map.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index c4616db48..13496bef9 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -985,7 +985,7 @@ static boolean PIT_CheckThing(mobj_t *thing) return true; } - topz = thing->z - FixedMul(FRACUNIT, thing->scale); + topz = thing->z - thing->scale; // block only when jumping not high enough, // (dont climb max. 24units while already in air) @@ -996,7 +996,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (thing->flags & MF_SPRING) ; - else if (topz < tmceilingz && tmthing->z+tmthing->height <= thing->z+thing->height) + else if (topz < tmceilingz && tmthing->z <= thing->z+thing->height) { tmceilingz = topz; #ifdef ESLOPE @@ -1022,7 +1022,7 @@ static boolean PIT_CheckThing(mobj_t *thing) return true; } - topz = thing->z + thing->height + FixedMul(FRACUNIT, thing->scale); + topz = thing->z + thing->height + thing->scale; // block only when jumping not high enough, // (dont climb max. 24units while already in air) @@ -1032,7 +1032,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (thing->flags & MF_SPRING) ; - else if (topz > tmfloorz && tmthing->z >= thing->z) + else if (topz > tmfloorz && tmthing->z+tmthing->height >= thing->z) { tmfloorz = topz; #ifdef ESLOPE From fa16abf7ae8cf0468bb3237047687eefca997e6e Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 22 Sep 2016 11:15:08 +0100 Subject: [PATCH 143/808] Fixed the thing where if you thok into a solid object you spin really fast in the air without moving OR losing your momentum. --- src/p_map.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 13496bef9..a3f34aa8a 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -989,12 +989,18 @@ static boolean PIT_CheckThing(mobj_t *thing) // block only when jumping not high enough, // (dont climb max. 24units while already in air) - // if not in air, let P_TryMove() decide if it's not too high + // since return false doesn't handle momentum properly, + // we lie to P_TryMove() so it's always too high if (tmthing->player && tmthing->z + tmthing->height > topz && tmthing->z + tmthing->height < tmthing->ceilingz) - return false; // block while in air - - if (thing->flags & MF_SPRING) + { + tmceilingz = INT32_MIN; // block while in air +#ifdef ESLOPE + tmceilingslope = NULL; +#endif + tmfloorthing = thing; // needed for side collision + } + else if (thing->flags & MF_SPRING) ; else if (topz < tmceilingz && tmthing->z <= thing->z+thing->height) { @@ -1026,11 +1032,18 @@ static boolean PIT_CheckThing(mobj_t *thing) // block only when jumping not high enough, // (dont climb max. 24units while already in air) - // if not in air, let P_TryMove() decide if it's not too high - if (tmthing->player && tmthing->z < topz && tmthing->z > tmthing->floorz) - return false; // block while in air - - if (thing->flags & MF_SPRING) + // since return false doesn't handle momentum properly, + // we lie to P_TryMove() so it's always too high + if (tmthing->player && tmthing->z < topz + && tmthing->z > tmthing->floorz) + { + tmfloorz = INT32_MAX; // block while in air +#ifdef ESLOPE + tmfloorslope = NULL; +#endif + tmfloorthing = thing; // needed for side collision + } + else if (thing->flags & MF_SPRING) ; else if (topz > tmfloorz && tmthing->z+tmthing->height >= thing->z) { From 0568712a5e3bee3335e5e0f9256c1ad07f78d25a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 22 Sep 2016 12:01:13 +0100 Subject: [PATCH 144/808] Prevent overflow when attempting to calculate the space between floor and ceiling. (I didn't notice any bugs as a result of the previous behvaiour, but you never know.) --- src/p_map.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index a3f34aa8a..8b8c6c07d 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -994,7 +994,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (tmthing->player && tmthing->z + tmthing->height > topz && tmthing->z + tmthing->height < tmthing->ceilingz) { - tmceilingz = INT32_MIN; // block while in air + tmfloorz = tmceilingz = INT32_MIN; // block while in air #ifdef ESLOPE tmceilingslope = NULL; #endif @@ -1037,7 +1037,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (tmthing->player && tmthing->z < topz && tmthing->z > tmthing->floorz) { - tmfloorz = INT32_MAX; // block while in air + tmfloorz = tmceilingz = INT32_MAX; // block while in air #ifdef ESLOPE tmfloorslope = NULL; #endif From 394ed30f4436dd3d9a2a8bd118a60175f350527b Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 22 Sep 2016 21:08:36 +0100 Subject: [PATCH 145/808] Fixed the problem with the reverseplatform_clipping branch that caused springs to fall through platforms, as tested by Wolfs in TD. --- src/p_mobj.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 5e5961d41..82326f04c 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2017,13 +2017,13 @@ static void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motyp delta2 = thingtop - (bottomheight + ((topheight - bottomheight)/2)); if (topheight > mo->floorz && abs(delta1) < abs(delta2) && !(rover->flags & FF_REVERSEPLATFORM) - && ((P_MobjFlip(mo)*mo->momz > 0) || (!(rover->flags & FF_PLATFORM)))) // In reverse gravity, only clip for FOFs that are intangible from their bottom (the "top" you're falling through) if you're coming from above ("below" in your frame of reference) + && ((P_MobjFlip(mo)*mo->momz >= 0) || (!(rover->flags & FF_PLATFORM)))) // In reverse gravity, only clip for FOFs that are intangible from their bottom (the "top" you're falling through) if you're coming from above ("below" in your frame of reference) { mo->floorz = topheight; } if (bottomheight < mo->ceilingz && abs(delta1) >= abs(delta2) && !(rover->flags & FF_PLATFORM) - && ((P_MobjFlip(mo)*mo->momz > 0) || (!(rover->flags & FF_REVERSEPLATFORM)))) // In normal gravity, only clip for FOFs that are intangible from the top if you're coming from below + && ((P_MobjFlip(mo)*mo->momz >= 0) || (!(rover->flags & FF_REVERSEPLATFORM)))) // In normal gravity, only clip for FOFs that are intangible from the top if you're coming from below { mo->ceilingz = bottomheight; } From 8ad72232bea1b1b093fe9a36ca189e1c90db5127 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 22 Sep 2016 21:15:12 +0100 Subject: [PATCH 146/808] Helpful explanatory comments to assauge MI's fears. --- src/p_map.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 8b8c6c07d..6a555953e 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -985,7 +985,7 @@ static boolean PIT_CheckThing(mobj_t *thing) return true; } - topz = thing->z - thing->scale; + topz = thing->z - thing->scale; // FixedMul(FRACUNIT, thing->scale), but thing->scale == FRACUNIT in base scale anyways // block only when jumping not high enough, // (dont climb max. 24units while already in air) @@ -1028,7 +1028,7 @@ static boolean PIT_CheckThing(mobj_t *thing) return true; } - topz = thing->z + thing->height + thing->scale; + topz = thing->z + thing->height + thing->scale; // FixedMul(FRACUNIT, thing->scale), but thing->scale == FRACUNIT in base scale anyways // block only when jumping not high enough, // (dont climb max. 24units while already in air) From 28523760c37aea8ab0b080e8b8d14b52c82e3227 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 24 Sep 2016 14:23:00 +0100 Subject: [PATCH 147/808] FF_VERTICALFLIP, since I've been messing around with sprite stuff. * flips the sprite ala MFE_VERTICALFLIP except you don't need to flip the direction of gravity for the object just to draw upside down * stacks properly with reverse gravity --- src/dehacked.c | 1 + src/hardware/hw_main.c | 9 ++++----- src/hardware/hw_md2.c | 4 ++-- src/p_pspr.h | 2 ++ src/r_things.c | 10 ++++------ 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 33cd61fb5..81246c39e 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7046,6 +7046,7 @@ struct { // Frame settings {"FF_FRAMEMASK",FF_FRAMEMASK}, + {"FF_VERTICALFLIP",FF_VERTICALFLIP}, {"FF_PAPERSPRITE",FF_PAPERSPRITE}, {"FF_ANIMATE",FF_ANIMATE}, {"FF_FULLBRIGHT",FF_FULLBRIGHT}, diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index e69a74558..95968777f 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5040,6 +5040,8 @@ static void HWR_ProjectSprite(mobj_t *thing) size_t lumpoff; unsigned rot; UINT8 flip; + boolean vflip = (!(thing->eflags & MFE_VERTICALFLIP) != !(thing->frame & FF_VERTICALFLIP)); + angle_t ang; INT32 heightsec, phs; @@ -5139,7 +5141,7 @@ static void HWR_ProjectSprite(mobj_t *thing) tx += FIXED_TO_FLOAT(spritecachedinfo[lumpoff].width) * this_scale; x2 = gr_windowcenterx + (tx * gr_centerx / tz); - if (thing->eflags & MFE_VERTICALFLIP) + if (vflip) { gz = FIXED_TO_FLOAT(thing->z+thing->height) - FIXED_TO_FLOAT(spritecachedinfo[lumpoff].topoffset) * this_scale; gzt = gz + FIXED_TO_FLOAT(spritecachedinfo[lumpoff].height) * this_scale; @@ -5216,10 +5218,7 @@ static void HWR_ProjectSprite(mobj_t *thing) //CONS_Debug(DBG_RENDER, "------------------\nH: sprite : %d\nH: frame : %x\nH: type : %d\nH: sname : %s\n\n", // thing->sprite, thing->frame, thing->type, sprnames[thing->sprite]); - if (thing->eflags & MFE_VERTICALFLIP) - vis->vflip = true; - else - vis->vflip = false; + vis->vflip = vflip; vis->precip = false; } diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 6628d1317..7f2864dbc 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -1230,7 +1230,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr) UINT32 durs = spr->mobj->state->tics; UINT32 tics = spr->mobj->tics; md2_frame_t *curr, *next = NULL; - const UINT8 flip = (UINT8)((spr->mobj->eflags & MFE_VERTICALFLIP) == MFE_VERTICALFLIP); + const UINT8 flip = (UINT8)(!(spr->mobj->eflags & MFE_VERTICALFLIP) != !(spr->mobj->frame & FF_VERTICALFLIP)); spritedef_t *sprdef; spriteframe_t *sprframe; float finalscale; @@ -1345,7 +1345,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr) p.x = FIXED_TO_FLOAT(spr->mobj->x); p.y = FIXED_TO_FLOAT(spr->mobj->y)+md2->offset; - if (spr->mobj->eflags & MFE_VERTICALFLIP) + if (flip) p.z = FIXED_TO_FLOAT(spr->mobj->z + spr->mobj->height); else p.z = FIXED_TO_FLOAT(spr->mobj->z); diff --git a/src/p_pspr.h b/src/p_pspr.h index c0064bc3e..82d43f281 100644 --- a/src/p_pspr.h +++ b/src/p_pspr.h @@ -37,6 +37,8 @@ /// \brief Frame flags: only the frame number #define FF_FRAMEMASK 0x1ff +/// \brief Frame flags: Flip sprite vertically (relative to what it should be for its gravity) +#define FF_VERTICALFLIP 0x400 /// \brief Frame flags: Thin, paper-like sprite (for collision equivalent, see MF_PAPERCOLLISION) #define FF_PAPERSPRITE 0x800 /// \brief Frame flags: Simple stateless animation diff --git a/src/r_things.c b/src/r_things.c index 2360cc23f..8a9c43e2c 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1114,6 +1114,7 @@ static void R_ProjectSprite(mobj_t *thing) size_t rot; UINT8 flip; + boolean vflip = (!(thing->eflags & MFE_VERTICALFLIP) != !(thing->frame & FF_VERTICALFLIP)); INT32 lindex; @@ -1123,7 +1124,7 @@ static void R_ProjectSprite(mobj_t *thing) fixed_t iscale; fixed_t scalestep; fixed_t offset, offset2; - boolean papersprite = (thing->frame & FF_PAPERSPRITE); + boolean papersprite = !!(thing->frame & FF_PAPERSPRITE); INT32 dispoffset = thing->info->dispoffset; @@ -1355,7 +1356,7 @@ static void R_ProjectSprite(mobj_t *thing) } //SoM: 3/17/2000: Disregard sprites that are out of view.. - if (thing->eflags & MFE_VERTICALFLIP) + if (vflip) { // When vertical flipped, draw sprites from the top down, at least as far as offsets are concerned. // sprite height - sprite topoffset is the proper inverse of the vertical offset, of course. @@ -1516,10 +1517,7 @@ static void R_ProjectSprite(mobj_t *thing) vis->precip = false; - if (thing->eflags & MFE_VERTICALFLIP) - vis->vflip = true; - else - vis->vflip = false; + vis->vflip = vflip; vis->isScaled = false; From 1d71dfa5a3c482de470baac8b025369336aea9ba Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Sun, 25 Sep 2016 20:55:08 -0700 Subject: [PATCH 148/808] animate icons using FF_ANIMATE (this also means they last one second again, and the powerup is given after 1/2 a second, things which were lost when the flip was added) --- src/dehacked.c | 50 +-------------------- src/info.c | 118 +++++++++++++++---------------------------------- src/info.h | 50 +-------------------- 3 files changed, 37 insertions(+), 181 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 8c6a0639c..c148719c7 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -4900,102 +4900,54 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_BLUEBOX_POP1", "S_BLUEBOX_POP2", - // Box Icons -- 5 states each, one for each part of the twirl + // Box Icons -- 2 states each, animation and action "S_RING_ICON1", "S_RING_ICON2", - "S_RING_ICON3", - "S_RING_ICON4", - "S_RING_ICON5", "S_PITY_ICON1", "S_PITY_ICON2", - "S_PITY_ICON3", - "S_PITY_ICON4", - "S_PITY_ICON5", "S_ATTRACT_ICON1", "S_ATTRACT_ICON2", - "S_ATTRACT_ICON3", - "S_ATTRACT_ICON4", - "S_ATTRACT_ICON5", "S_FORCE_ICON1", "S_FORCE_ICON2", - "S_FORCE_ICON3", - "S_FORCE_ICON4", - "S_FORCE_ICON5", "S_ARMAGEDDON_ICON1", "S_ARMAGEDDON_ICON2", - "S_ARMAGEDDON_ICON3", - "S_ARMAGEDDON_ICON4", - "S_ARMAGEDDON_ICON5", "S_WHIRLWIND_ICON1", "S_WHIRLWIND_ICON2", - "S_WHIRLWIND_ICON3", - "S_WHIRLWIND_ICON4", - "S_WHIRLWIND_ICON5", "S_ELEMENTAL_ICON1", "S_ELEMENTAL_ICON2", - "S_ELEMENTAL_ICON3", - "S_ELEMENTAL_ICON4", - "S_ELEMENTAL_ICON5", "S_SNEAKERS_ICON1", "S_SNEAKERS_ICON2", - "S_SNEAKERS_ICON3", - "S_SNEAKERS_ICON4", - "S_SNEAKERS_ICON5", "S_INVULN_ICON1", "S_INVULN_ICON2", - "S_INVULN_ICON3", - "S_INVULN_ICON4", - "S_INVULN_ICON5", "S_1UP_ICON1", "S_1UP_ICON2", - "S_1UP_ICON3", - "S_1UP_ICON4", - "S_1UP_ICON5", "S_EGGMAN_ICON1", "S_EGGMAN_ICON2", - "S_EGGMAN_ICON3", - "S_EGGMAN_ICON4", - "S_EGGMAN_ICON5", "S_MIXUP_ICON1", "S_MIXUP_ICON2", - "S_MIXUP_ICON3", - "S_MIXUP_ICON4", - "S_MIXUP_ICON5", "S_GRAVITY_ICON1", "S_GRAVITY_ICON2", - "S_GRAVITY_ICON3", - "S_GRAVITY_ICON4", - "S_GRAVITY_ICON5", "S_RECYCLER_ICON1", "S_RECYCLER_ICON2", - "S_RECYCLER_ICON3", - "S_RECYCLER_ICON4", - "S_RECYCLER_ICON5", "S_SCORE1K_ICON1", "S_SCORE1K_ICON2", - "S_SCORE1K_ICON3", - "S_SCORE1K_ICON4", - "S_SCORE1K_ICON5", "S_SCORE10K_ICON1", "S_SCORE10K_ICON2", - "S_SCORE10K_ICON3", - "S_SCORE10K_ICON4", - "S_SCORE10K_ICON5", "S_ROCKET", diff --git a/src/info.c b/src/info.c index bf69b0759..86e51fc9f 100644 --- a/src/info.c +++ b/src/info.c @@ -40,7 +40,7 @@ char sprnames[NUMSPRITES + 1][5] = "RING","TRNG","EMMY","TOKE","RFLG","BFLG","NWNG","EMBM","CEMG","EMER", "FANS","BUBL","SIGN","STEM","SPIK","SFLM","USPK","STPT","BMNE", - + "MSTV","XLTV","TRRI","TBRI","TVRI","TVPI","TVAT","TVFO","TVAR","TVWW", "TVEL","TVSS","TVIV","TV1U","TV1P","TVEG","TVMX","TVMY","TVGV","TVRC", "TV1K","TVTK", @@ -222,7 +222,7 @@ state_t states[NUMSTATES] = {SPR_NULL, 0, 1, {NULL}, 0, 0, S_PLAY_BOX1}, // S_PLAY_BOX2 {SPR_PLAY, SPR2_LIFE, 4, {NULL}, 0, 4, S_PLAY_ICON2}, // S_PLAY_ICON1 {SPR_NULL, 0, 12, {NULL}, 0, 0, S_PLAY_ICON3}, // S_PLAY_ICON2 - {SPR_PLAY, SPR2_LIFE, 18, {NULL}, 0, 4, S_NULL}, // S_PLAY_ICON3 + {SPR_PLAY, SPR2_LIFE, 19, {NULL}, 0, 4, S_NULL}, // S_PLAY_ICON3 // Level end sign (uses player sprite) {SPR_PLAY, SPR2_SIGN, 1, {NULL}, 0, 24, S_PLAY_SIGN}, // S_PLAY_SIGN @@ -1254,102 +1254,54 @@ state_t states[NUMSTATES] = {SPR_TBRI, 1, 4, {A_MonitorPop}, 0, 0, S_BLUEBOX_POP2}, // S_BLUEBOX_POP1 {SPR_TBRI, 2, -1, {NULL}, 0, 0, S_NULL}, // S_BLUEBOX_POP2 - // Box Icons -- 5 states each, one for each part of the twirl - {SPR_TVRI, 2, 4, {NULL}, 0, 0, S_RING_ICON2}, // S_RING_ICON1 - {SPR_TVRI, 3, 4, {NULL}, 0, 0, S_RING_ICON3}, // S_RING_ICON2 - {SPR_TVRI, 4, 4, {NULL}, 0, 0, S_RING_ICON4}, // S_RING_ICON3 - {SPR_TVRI, 5, 4, {NULL}, 0, 0, S_RING_ICON5}, // S_RING_ICON4 - {SPR_TVRI, 2, 18, {A_RingBox}, 0, 0, S_NULL}, // S_RING_ICON5 + // Box Icons -- 2 states each, animation and action + {SPR_TVRI, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_RING_ICON2}, // S_RING_ICON1 + {SPR_TVRI, 2, 17, {A_RingBox}, 0, 0, S_NULL}, // S_RING_ICON2 - {SPR_TVPI, 2, 4, {NULL}, 0, 0, S_PITY_ICON2}, // S_PITY_ICON1 - {SPR_TVPI, 3, 4, {NULL}, 0, 0, S_PITY_ICON3}, // S_PITY_ICON2 - {SPR_TVPI, 4, 4, {NULL}, 0, 0, S_PITY_ICON4}, // S_PITY_ICON3 - {SPR_TVPI, 5, 4, {NULL}, 0, 0, S_PITY_ICON5}, // S_PITY_ICON4 - {SPR_TVPI, 2, 18, {A_PityShield}, 0, 0, S_NULL}, // S_PITY_ICON5 + {SPR_TVPI, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_PITY_ICON2}, // S_PITY_ICON1 + {SPR_TVPI, 2, 17, {A_PityShield}, 0, 0, S_NULL}, // S_PITY_ICON2 - {SPR_TVAT, 2, 4, {NULL}, 0, 0, S_ATTRACT_ICON2}, // S_ATTRACT_ICON1 - {SPR_TVAT, 3, 4, {NULL}, 0, 0, S_ATTRACT_ICON3}, // S_ATTRACT_ICON2 - {SPR_TVAT, 4, 4, {NULL}, 0, 0, S_ATTRACT_ICON4}, // S_ATTRACT_ICON3 - {SPR_TVAT, 5, 4, {NULL}, 0, 0, S_ATTRACT_ICON5}, // S_ATTRACT_ICON4 - {SPR_TVAT, 2, 18, {A_RingShield},0, 0, S_NULL}, // S_ATTRACT_ICON5 + {SPR_TVAT, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_ATTRACT_ICON2}, // S_ATTRACT_ICON1 + {SPR_TVAT, 2, 17, {A_RingShield},0, 0, S_NULL}, // S_ATTRACT_ICON2 - {SPR_TVFO, 2, 4, {NULL}, 0, 0, S_FORCE_ICON2}, // S_FORCE_ICON1 - {SPR_TVFO, 3, 4, {NULL}, 0, 0, S_FORCE_ICON3}, // S_FORCE_ICON2 - {SPR_TVFO, 4, 4, {NULL}, 0, 0, S_FORCE_ICON4}, // S_FORCE_ICON3 - {SPR_TVFO, 5, 4, {NULL}, 0, 0, S_FORCE_ICON5}, // S_FORCE_ICON4 - {SPR_TVFO, 2, 18, {A_ForceShield}, 0, 0, S_NULL}, // S_FORCE_ICON5 + {SPR_TVFO, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_FORCE_ICON2}, // S_FORCE_ICON1 + {SPR_TVFO, 2, 17, {A_ForceShield}, 0, 0, S_NULL}, // S_FORCE_ICON2 - {SPR_TVAR, 2, 4, {NULL}, 0, 0, S_ARMAGEDDON_ICON2}, // S_ARMAGEDDON_ICON1 - {SPR_TVAR, 3, 4, {NULL}, 0, 0, S_ARMAGEDDON_ICON3}, // S_ARMAGEDDON_ICON2 - {SPR_TVAR, 4, 4, {NULL}, 0, 0, S_ARMAGEDDON_ICON4}, // S_ARMAGEDDON_ICON3 - {SPR_TVAR, 5, 4, {NULL}, 0, 0, S_ARMAGEDDON_ICON5}, // S_ARMAGEDDON_ICON4 - {SPR_TVAR, 2, 18, {A_BombShield}, 0, 0, S_NULL}, // S_ARMAGEDDON_ICON5 + {SPR_TVAR, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_ARMAGEDDON_ICON2}, // S_ARMAGEDDON_ICON1 + {SPR_TVAR, 2, 17, {A_BombShield}, 0, 0, S_NULL}, // S_ARMAGEDDON_ICON2 - {SPR_TVWW, 2, 4, {NULL}, 0, 0, S_WHIRLWIND_ICON2}, // S_WHIRLWIND_ICON1 - {SPR_TVWW, 3, 4, {NULL}, 0, 0, S_WHIRLWIND_ICON3}, // S_WHIRLWIND_ICON2 - {SPR_TVWW, 4, 4, {NULL}, 0, 0, S_WHIRLWIND_ICON4}, // S_WHIRLWIND_ICON3 - {SPR_TVWW, 5, 4, {NULL}, 0, 0, S_WHIRLWIND_ICON5}, // S_WHIRLWIND_ICON4 - {SPR_TVWW, 2, 18, {A_JumpShield}, 0, 0, S_NULL}, // S_WHIRLWIND_ICON5 + {SPR_TVWW, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_WHIRLWIND_ICON2}, // S_WHIRLWIND_ICON1 + {SPR_TVWW, 2, 17, {A_JumpShield}, 0, 0, S_NULL}, // S_WHIRLWIND_ICON2 - {SPR_TVEL, 2, 4, {NULL}, 0, 0, S_ELEMENTAL_ICON2}, // S_ELEMENTAL_ICON1 - {SPR_TVEL, 3, 4, {NULL}, 0, 0, S_ELEMENTAL_ICON3}, // S_ELEMENTAL_ICON2 - {SPR_TVEL, 4, 4, {NULL}, 0, 0, S_ELEMENTAL_ICON4}, // S_ELEMENTAL_ICON3 - {SPR_TVEL, 5, 4, {NULL}, 0, 0, S_ELEMENTAL_ICON5}, // S_ELEMENTAL_ICON4 - {SPR_TVEL, 2, 18, {A_WaterShield}, 0, 0, S_NULL}, // S_ELEMENTAL_ICON5 + {SPR_TVEL, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_ELEMENTAL_ICON2}, // S_ELEMENTAL_ICON1 + {SPR_TVEL, 2, 17, {A_WaterShield}, 0, 0, S_NULL}, // S_ELEMENTAL_ICON2 - {SPR_TVSS, 2, 4, {NULL}, 0, 0, S_SNEAKERS_ICON2}, // S_SNEAKERS_ICON1 - {SPR_TVSS, 3, 4, {NULL}, 0, 0, S_SNEAKERS_ICON3}, // S_SNEAKERS_ICON2 - {SPR_TVSS, 4, 4, {NULL}, 0, 0, S_SNEAKERS_ICON4}, // S_SNEAKERS_ICON3 - {SPR_TVSS, 5, 4, {NULL}, 0, 0, S_SNEAKERS_ICON5}, // S_SNEAKERS_ICON4 - {SPR_TVSS, 2, 18, {A_SuperSneakers}, 0, 0, S_NULL}, // S_SNEAKERS_ICON5 + {SPR_TVSS, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_SNEAKERS_ICON2}, // S_SNEAKERS_ICON1 + {SPR_TVSS, 2, 17, {A_SuperSneakers}, 0, 0, S_NULL}, // S_SNEAKERS_ICON2 - {SPR_TVIV, 2, 4, {NULL}, 0, 0, S_INVULN_ICON2}, // S_INVULN_ICON1 - {SPR_TVIV, 3, 4, {NULL}, 0, 0, S_INVULN_ICON3}, // S_INVULN_ICON2 - {SPR_TVIV, 4, 4, {NULL}, 0, 0, S_INVULN_ICON4}, // S_INVULN_ICON3 - {SPR_TVIV, 5, 4, {NULL}, 0, 0, S_INVULN_ICON5}, // S_INVULN_ICON4 - {SPR_TVIV, 2, 18, {A_Invincibility}, 0, 0, S_NULL}, // S_INVULN_ICON5 + {SPR_TVIV, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_INVULN_ICON2}, // S_INVULN_ICON1 + {SPR_TVIV, 2, 17, {A_Invincibility}, 0, 0, S_NULL}, // S_INVULN_ICON2 - {SPR_TV1U, 2, 4, {NULL}, 0, 0, S_1UP_ICON2}, // S_1UP_ICON1 - {SPR_TV1U, 3, 4, {NULL}, 0, 0, S_1UP_ICON3}, // S_1UP_ICON2 - {SPR_TV1U, 4, 4, {NULL}, 0, 0, S_1UP_ICON4}, // S_1UP_ICON3 - {SPR_TV1U, 5, 4, {NULL}, 0, 0, S_1UP_ICON5}, // S_1UP_ICON4 - {SPR_TV1U, 2, 18, {A_ExtraLife}, 0, 0, S_NULL}, // S_1UP_ICON5 + {SPR_TV1U, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_1UP_ICON2}, // S_1UP_ICON1 + {SPR_TV1U, 2, 17, {A_ExtraLife}, 0, 0, S_NULL}, // S_1UP_ICON2 - {SPR_TVEG, 2, 4, {NULL}, 0, 0, S_EGGMAN_ICON2}, // S_EGGMAN_ICON1 - {SPR_TVEG, 3, 4, {NULL}, 0, 0, S_EGGMAN_ICON3}, // S_EGGMAN_ICON2 - {SPR_TVEG, 4, 4, {NULL}, 0, 0, S_EGGMAN_ICON4}, // S_EGGMAN_ICON3 - {SPR_TVEG, 5, 4, {NULL}, 0, 0, S_EGGMAN_ICON5}, // S_EGGMAN_ICON4 - {SPR_TVEG, 2, 18, {A_EggmanBox}, 0, 0, S_NULL}, // S_EGGMAN_ICON5 + {SPR_TVEG, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_EGGMAN_ICON2}, // S_EGGMAN_ICON1 + {SPR_TVEG, 2, 17, {A_EggmanBox}, 0, 0, S_NULL}, // S_EGGMAN_ICON2 - {SPR_TVMX, 2, 4, {NULL}, 0, 0, S_MIXUP_ICON2}, // S_MIXUP_ICON1 - {SPR_TVMX, 3, 4, {NULL}, 0, 0, S_MIXUP_ICON3}, // S_MIXUP_ICON2 - {SPR_TVMX, 4, 4, {NULL}, 0, 0, S_MIXUP_ICON4}, // S_MIXUP_ICON3 - {SPR_TVMX, 5, 4, {NULL}, 0, 0, S_MIXUP_ICON5}, // S_MIXUP_ICON4 - {SPR_TVMX, 2, 18, {A_MixUp}, 0, 0, S_NULL}, // S_MIXUP_ICON5 + {SPR_TVMX, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_MIXUP_ICON2}, // S_MIXUP_ICON1 + {SPR_TVMX, 2, 17, {A_MixUp}, 0, 0, S_NULL}, // S_MIXUP_ICON2 - {SPR_TVGV, 2, 4, {NULL}, 0, 0, S_GRAVITY_ICON2}, // S_GRAVITY_ICON1 - {SPR_TVGV, 3, 4, {NULL}, 0, 0, S_GRAVITY_ICON3}, // S_GRAVITY_ICON2 - {SPR_TVGV, 4, 4, {NULL}, 0, 0, S_GRAVITY_ICON4}, // S_GRAVITY_ICON3 - {SPR_TVGV, 5, 4, {NULL}, 0, 0, S_GRAVITY_ICON5}, // S_GRAVITY_ICON4 - {SPR_TVGV, 2, 18, {A_GravityBox}, 0, 0, S_NULL}, // S_GRAVITY_ICON5 + {SPR_TVGV, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_GRAVITY_ICON2}, // S_GRAVITY_ICON1 + {SPR_TVGV, 2, 17, {A_GravityBox}, 0, 0, S_NULL}, // S_GRAVITY_ICON2 - {SPR_TVRC, 2, 4, {NULL}, 0, 0, S_RECYCLER_ICON2}, // S_RECYCLER_ICON1 - {SPR_TVRC, 3, 4, {NULL}, 0, 0, S_RECYCLER_ICON3}, // S_RECYCLER_ICON2 - {SPR_TVRC, 4, 4, {NULL}, 0, 0, S_RECYCLER_ICON4}, // S_RECYCLER_ICON3 - {SPR_TVRC, 5, 4, {NULL}, 0, 0, S_RECYCLER_ICON5}, // S_RECYCLER_ICON4 - {SPR_TVRC, 2, 18, {A_RecyclePowers}, 0, 0, S_NULL}, // S_RECYCLER_ICON5 + {SPR_TVRC, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_RECYCLER_ICON2}, // S_RECYCLER_ICON1 + {SPR_TVRC, 2, 17, {A_RecyclePowers}, 0, 0, S_NULL}, // S_RECYCLER_ICON2 - {SPR_TV1K, 2, 4, {NULL}, 0, 0, S_SCORE1K_ICON2}, // S_SCORE1K_ICON1 - {SPR_TV1K, 3, 4, {NULL}, 0, 0, S_SCORE1K_ICON3}, // S_SCORE1K_ICON2 - {SPR_TV1K, 4, 4, {NULL}, 0, 0, S_SCORE1K_ICON4}, // S_SCORE1K_ICON3 - {SPR_TV1K, 5, 4, {NULL}, 0, 0, S_SCORE1K_ICON5}, // S_SCORE1K_ICON4 - {SPR_TV1K, 2, 18, {A_AwardScore}, 0, 0, S_NULL}, // S_SCORE1K_ICON5 + {SPR_TV1K, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_SCORE1K_ICON2}, // S_SCORE1K_ICON1 + {SPR_TV1K, 2, 17, {A_AwardScore}, 0, 0, S_NULL}, // S_SCORE1K_ICON2 - {SPR_TVTK, 2, 4, {NULL}, 0, 0, S_SCORE10K_ICON2}, // S_SCORE10K_ICON1 - {SPR_TVTK, 3, 4, {NULL}, 0, 0, S_SCORE10K_ICON3}, // S_SCORE10K_ICON2 - {SPR_TVTK, 4, 4, {NULL}, 0, 0, S_SCORE10K_ICON4}, // S_SCORE10K_ICON3 - {SPR_TVTK, 5, 4, {NULL}, 0, 0, S_SCORE10K_ICON5}, // S_SCORE10K_ICON4 - {SPR_TVTK, 2, 18, {A_AwardScore}, 0, 0, S_NULL}, // S_SCORE10K_ICON5 + {SPR_TVTK, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_SCORE10K_ICON2}, // S_SCORE10K_ICON1 + {SPR_TVTK, 2, 17, {A_AwardScore}, 0, 0, S_NULL}, // S_SCORE10K_ICON2 // --- diff --git a/src/info.h b/src/info.h index 79d4a5495..5f1b8c29b 100644 --- a/src/info.h +++ b/src/info.h @@ -1745,102 +1745,54 @@ typedef enum state S_BLUEBOX_POP1, S_BLUEBOX_POP2, - // Box Icons -- 5 states each, one for each part of the twirl + // Box Icons -- 2 states each, animation and action S_RING_ICON1, S_RING_ICON2, - S_RING_ICON3, - S_RING_ICON4, - S_RING_ICON5, S_PITY_ICON1, S_PITY_ICON2, - S_PITY_ICON3, - S_PITY_ICON4, - S_PITY_ICON5, S_ATTRACT_ICON1, S_ATTRACT_ICON2, - S_ATTRACT_ICON3, - S_ATTRACT_ICON4, - S_ATTRACT_ICON5, S_FORCE_ICON1, S_FORCE_ICON2, - S_FORCE_ICON3, - S_FORCE_ICON4, - S_FORCE_ICON5, S_ARMAGEDDON_ICON1, S_ARMAGEDDON_ICON2, - S_ARMAGEDDON_ICON3, - S_ARMAGEDDON_ICON4, - S_ARMAGEDDON_ICON5, S_WHIRLWIND_ICON1, S_WHIRLWIND_ICON2, - S_WHIRLWIND_ICON3, - S_WHIRLWIND_ICON4, - S_WHIRLWIND_ICON5, S_ELEMENTAL_ICON1, S_ELEMENTAL_ICON2, - S_ELEMENTAL_ICON3, - S_ELEMENTAL_ICON4, - S_ELEMENTAL_ICON5, S_SNEAKERS_ICON1, S_SNEAKERS_ICON2, - S_SNEAKERS_ICON3, - S_SNEAKERS_ICON4, - S_SNEAKERS_ICON5, S_INVULN_ICON1, S_INVULN_ICON2, - S_INVULN_ICON3, - S_INVULN_ICON4, - S_INVULN_ICON5, S_1UP_ICON1, S_1UP_ICON2, - S_1UP_ICON3, - S_1UP_ICON4, - S_1UP_ICON5, S_EGGMAN_ICON1, S_EGGMAN_ICON2, - S_EGGMAN_ICON3, - S_EGGMAN_ICON4, - S_EGGMAN_ICON5, S_MIXUP_ICON1, S_MIXUP_ICON2, - S_MIXUP_ICON3, - S_MIXUP_ICON4, - S_MIXUP_ICON5, S_GRAVITY_ICON1, S_GRAVITY_ICON2, - S_GRAVITY_ICON3, - S_GRAVITY_ICON4, - S_GRAVITY_ICON5, S_RECYCLER_ICON1, S_RECYCLER_ICON2, - S_RECYCLER_ICON3, - S_RECYCLER_ICON4, - S_RECYCLER_ICON5, S_SCORE1K_ICON1, S_SCORE1K_ICON2, - S_SCORE1K_ICON3, - S_SCORE1K_ICON4, - S_SCORE1K_ICON5, S_SCORE10K_ICON1, S_SCORE10K_ICON2, - S_SCORE10K_ICON3, - S_SCORE10K_ICON4, - S_SCORE10K_ICON5, // --- From 5f4f6fdac89e01a330bf821a9ec95dd3c74cc480 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 26 Sep 2016 18:35:13 +0100 Subject: [PATCH 149/808] Public remake of a merge request I shouldn't have put in Internal in the first place. --- src/m_misc.c | 2 ++ src/p_spec.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/m_misc.c b/src/m_misc.c index 457214e33..cfe73d88f 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -1675,6 +1675,7 @@ char *M_GetToken(const char *inputString) || stringToUse[startPos] == '\r' || stringToUse[startPos] == '\n' || stringToUse[startPos] == '\0' + || stringToUse[startPos] == '"' // we're treating this as whitespace because SLADE likes adding it for no good reason || inComment != 0) && startPos < stringLength) { @@ -1742,6 +1743,7 @@ char *M_GetToken(const char *inputString) && stringToUse[endPos] != ',' && stringToUse[endPos] != '{' && stringToUse[endPos] != '}' + && stringToUse[endPos] != '"' // see above && inComment == 0) && endPos < stringLength) { diff --git a/src/p_spec.c b/src/p_spec.c index 30b08ebb1..5dac8d34b 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -509,7 +509,7 @@ void P_ParseAnimationDefintion(SINT8 istexture, INT32 *i) animdefsToken = M_GetToken(NULL); if (animdefsToken == NULL) { - I_Error("Error parsing TEXTURES lump: Unexpected end of file where \"%s\"'s animation speed should be", animdefs[*i].startname); + I_Error("Error parsing ANIMDEFS lump: Unexpected end of file where \"%s\"'s animation speed should be", animdefs[*i].startname); } endPos = NULL; #ifndef AVOID_ERRNO @@ -523,7 +523,7 @@ void P_ParseAnimationDefintion(SINT8 istexture, INT32 *i) #endif || animSpeed < 0) // Number is not positive { - I_Error("Error parsing TEXTURES lump: Expected a positive integer for \"%s\"'s animation speed, got \"%s\"", animdefs[*i].startname, animdefsToken); + I_Error("Error parsing ANIMDEFS lump: Expected a positive integer for \"%s\"'s animation speed, got \"%s\"", animdefs[*i].startname, animdefsToken); } animdefs[*i].speed = animSpeed; Z_Free(animdefsToken); From 8881a413f3c3a652675e4f451ebb849f17a8ac10 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 27 Sep 2016 17:17:23 +0100 Subject: [PATCH 150/808] Fixed that really annoying bug where you disappear when spindashing on top of a FOF whilst wearing a multi-layer shield. (the problem was that MT_OVERLAY's default radius and height were never getting changed from 1*FRACUNIT, and that meant that when you spindashed, the game considered it completely below the surface of the flat you were standing on. Since you're not usually clipped on flats that don't belong to FOFs, we didn't notice this issue sooner.) --- src/p_mobj.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index 5e5961d41..b35b72867 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -5930,6 +5930,8 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) P_UnsetThingPosition(thing); thing->x = thing->target->x; thing->y = thing->target->y; + thing->radius = thing->target->radius; + thing->height = thing->target->height; if (thing->eflags & MFE_VERTICALFLIP) thing->z = thing->target->z + thing->target->height - thing->height + FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT) - FixedMul(2*FRACUNIT, thing->target->scale); else @@ -6048,6 +6050,8 @@ void P_RunOverlays(void) P_UnsetThingPosition(mo); mo->x = destx; mo->y = desty; + mo->radius = mo->target->radius; + mo->height = mo->target->height; if (mo->eflags & MFE_VERTICALFLIP) mo->z = (mo->target->z + mo->target->height - mo->height) - zoffs; else From 9a2dd50e4dee99515d6b1e37ee3085214aa4f2f2 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 27 Sep 2016 19:03:57 +0100 Subject: [PATCH 151/808] ...I should really check what I'm doing more thoroughly, sorry. --- src/p_mobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 0f0a7e570..37b684016 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3223,7 +3223,7 @@ static void P_PlayerZMovement(mobj_t *mo) P_SetPlayerMobjState(mo, S_PLAY_SPIN); } } - mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY/*|PF_GLIDING*/); + mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY/*|PF_GLIDING*/); mo->player->jumping = 0; mo->player->secondjump = 0; mo->player->glidetime = 0; From 99f60544db088c2a5cf5561b74e8ab509ec823d9 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 28 Sep 2016 16:26:29 +0100 Subject: [PATCH 152/808] Fixed various issues arising from collision with exclusively horizontal springs. Of note: * If you hold down your jump button whilst jumping into it, you no longer immediately use your ability. * Characters with CA_DOUBLEJUMP and CA2_MULTIABILITY no longer lose track of their jump count. --- src/p_map.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 765f88a7d..e6d37fa98 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -115,6 +115,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) fixed_t offx, offy; fixed_t vertispeed = spring->info->mass; fixed_t horizspeed = spring->info->damage; + UINT8 jumping, secondjump; if (object->eflags & MFE_SPRUNG) // Object was already sprung this tic return false; @@ -203,25 +204,30 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) } pflags = object->player->pflags & (PF_JUMPED|PF_SPINNING|PF_THOKKED); // I still need these. + jumping = object->player->jumping; + secondjump = object->player->secondjump; P_ResetPlayer(object->player); - if (P_MobjFlip(object)*vertispeed > 0) + if (spring->info->painchance) + { + object->player->pflags |= PF_JUMPED; + P_SetPlayerMobjState(object, S_PLAY_JUMP); + } + else if (P_MobjFlip(object)*vertispeed > 0) P_SetPlayerMobjState(object, S_PLAY_SPRING); else if (P_MobjFlip(object)*vertispeed < 0) P_SetPlayerMobjState(object, S_PLAY_FALL); else // horizontal spring { if (pflags & (PF_JUMPED|PF_SPINNING) && (object->player->panim == PA_ROLL || object->player->panim == PA_JUMP || object->player->panim == PA_FALL)) - object->player->pflags = pflags; + { + object->player->pflags |= pflags; + object->player->jumping = jumping; + object->player->secondjump = secondjump; + } else P_SetPlayerMobjState(object, S_PLAY_WALK); } - - if (spring->info->painchance) - { - object->player->pflags |= PF_JUMPED; - P_SetPlayerMobjState(object, S_PLAY_JUMP); - } } return true; } From 8445a1068e94475037829843a5297251618e4b19 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 28 Sep 2016 16:31:14 +0100 Subject: [PATCH 153/808] attempt --- src/p_map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_map.c b/src/p_map.c index e6d37fa98..4214f32e9 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -216,7 +216,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) else if (P_MobjFlip(object)*vertispeed > 0) P_SetPlayerMobjState(object, S_PLAY_SPRING); else if (P_MobjFlip(object)*vertispeed < 0) - P_SetPlayerMobjState(object, S_PLAY_FALL); + P_SetPlayerMobjState(object, S_PLAY_FALL) else // horizontal spring { if (pflags & (PF_JUMPED|PF_SPINNING) && (object->player->panim == PA_ROLL || object->player->panim == PA_JUMP || object->player->panim == PA_FALL)) From bf7ed0b9e99a843e7333e3efe5371316cf9434ae Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 29 Sep 2016 12:36:20 +0100 Subject: [PATCH 154/808] I call this... the GFZ3 Unfuckening. * GFZ3 Eggmobile's laser won't change its angle when you move left and right anymore. * Changed because its ability to move quickly was extremely punishing for new players (see ProJared's youtube video on the matter). * http://gfycat.com/PassionateUnknownAgama (the twitching on the third laser has been fixed since this was recorded) * GFZ3 Eggmobile will, when too far away from the ground and moving upwards, slow itself down vertically. * This was punishing and annoying for both old and new players alike. * http://gfycat.com/ShabbyAncientEarthworm (old values - the typical settling height is slightly lower now) --- src/p_enemy.c | 16 +++++++++++----- src/p_mobj.c | 11 ++++++++++- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 73ec2a79d..dda12ae7d 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -2092,12 +2092,13 @@ void A_Boss1Laser(mobj_t *actor) if (!(actor->spawnpoint && actor->spawnpoint->options & MTF_AMBUSH)) { point = P_SpawnMobj(x + P_ReturnThrustX(actor, actor->angle, actor->radius), y + P_ReturnThrustY(actor, actor->angle, actor->radius), actor->z - actor->height / 2, MT_EGGMOBILE_TARGET); + point->angle = actor->angle; point->fuse = actor->tics+1; P_SetTarget(&point->target, actor->target); P_SetTarget(&actor->target, point); } } - else if (actor->target && !(actor->spawnpoint && actor->spawnpoint->options & MTF_AMBUSH)) + else if (actor->target && actor->target->type != MT_EGGMOBILE_TARGET && !(actor->spawnpoint && actor->spawnpoint->options & MTF_AMBUSH)) actor->angle = R_PointToAngle2(x, y, actor->target->x, actor->target->y); if (actor->spawnpoint && actor->spawnpoint->options & MTF_AMBUSH) @@ -2148,11 +2149,16 @@ void A_Boss1Laser(mobj_t *actor) // var1: // 0 - accelerative focus with friction // 1 - steady focus with fixed movement speed -// var2 = unused +// anything else - don't move +// var2: +// 0 - don't trace target, just move forwards +// & 1 - change horizontal angle +// & 2 - change vertical angle // void A_FocusTarget(mobj_t *actor) { INT32 locvar1 = var1; + INT32 locvar2 = var2; #ifdef HAVE_BLUA if (LUA_CallAction("A_FocusTarget", actor)) return; @@ -2161,9 +2167,9 @@ void A_FocusTarget(mobj_t *actor) if (actor->target) { fixed_t speed = FixedMul(actor->info->speed, actor->scale); - fixed_t dist = R_PointToDist2(actor->x, actor->y, actor->target->x, actor->target->y); - angle_t vangle = R_PointToAngle2(actor->z , 0, actor->target->z + (actor->target->height>>1), dist); - angle_t hangle = R_PointToAngle2(actor->x, actor->y, actor->target->x, actor->target->y); + fixed_t dist = (locvar2 ? R_PointToDist2(actor->x, actor->y, actor->target->x, actor->target->y) : speed+1); + angle_t hangle = ((locvar2 & 1) ? R_PointToAngle2(actor->x, actor->y, actor->target->x, actor->target->y) : actor->angle); + angle_t vangle = ((locvar2 & 2) ? R_PointToAngle2(actor->z , 0, actor->target->z + (actor->target->height>>1), dist) : ANGLE_90); switch(locvar1) { case 0: diff --git a/src/p_mobj.c b/src/p_mobj.c index db80851f3..e1c45dd72 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4436,7 +4436,16 @@ static void P_Boss1Thinker(mobj_t *mobj) return; } - if (mobj->state != &states[mobj->info->spawnstate] && mobj->health > 0 && mobj->flags & MF_FLOAT && !(mobj->flags2 & MF2_SKULLFLY)) + if (mobj->flags2 & MF2_SKULLFLY) + { + if (P_MobjFlip(mobj)*mobj->momz > 0 + && ((mobj->eflags & MFE_VERTICALFLIP + && (mobj->z+mobj->height) < (mobj->ceilingz-(2*mobj->height))) + || (!(mobj->eflags & MFE_VERTICALFLIP) + && mobj->z > (mobj->floorz+(2*mobj->height))))) + mobj->momz = FixedMul(mobj->momz, 60000); + } + else if (mobj->state != &states[mobj->info->spawnstate] && mobj->health > 0 && mobj->flags & MF_FLOAT) mobj->momz = FixedMul(mobj->momz,7*FRACUNIT/8); if (mobj->state == &states[mobj->info->meleestate] From 7e8f7a59d1d4c6903a162f0907c066c51d6ef787 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 29 Sep 2016 12:42:26 +0100 Subject: [PATCH 155/808] This code never ran anyways, so. --- src/p_enemy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index dda12ae7d..967ad15e7 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -2098,8 +2098,9 @@ void A_Boss1Laser(mobj_t *actor) P_SetTarget(&actor->target, point); } } - else if (actor->target && actor->target->type != MT_EGGMOBILE_TARGET && !(actor->spawnpoint && actor->spawnpoint->options & MTF_AMBUSH)) - actor->angle = R_PointToAngle2(x, y, actor->target->x, actor->target->y); + /* -- the following was relevant when the MT_EGGMOBILE_TARGET was allowed to move left and right from its path + else if (actor->target && !(actor->spawnpoint && actor->spawnpoint->options & MTF_AMBUSH)) + actor->angle = R_PointToAngle2(x, y, actor->target->x, actor->target->y);*/ if (actor->spawnpoint && actor->spawnpoint->options & MTF_AMBUSH) angle = FixedAngle(FixedDiv(actor->tics*160*FRACUNIT, actor->state->tics*FRACUNIT) + 10*FRACUNIT); From c786dbda78f28b634442dceb86d4022c5e598866 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 29 Sep 2016 13:06:07 +0100 Subject: [PATCH 156/808] Improved the way GFZ3 Eggman slows down in the air when MF2_SKULLFLYing. --- src/p_mobj.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index e1c45dd72..b249e6741 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4438,12 +4438,11 @@ static void P_Boss1Thinker(mobj_t *mobj) if (mobj->flags2 & MF2_SKULLFLY) { - if (P_MobjFlip(mobj)*mobj->momz > 0 - && ((mobj->eflags & MFE_VERTICALFLIP - && (mobj->z+mobj->height) < (mobj->ceilingz-(2*mobj->height))) - || (!(mobj->eflags & MFE_VERTICALFLIP) - && mobj->z > (mobj->floorz+(2*mobj->height))))) - mobj->momz = FixedMul(mobj->momz, 60000); + fixed_t dist = (mobj->eflags & MFE_VERTICALFLIP) + ? ((mobj->ceilingz-(2*mobj->height)) - (mobj->z+mobj->height)) + : (mobj->z - (mobj->floorz+(2*mobj->height))); + if (dist > 0 && P_MobjFlip(mobj)*mobj->momz > 0) + mobj->momz = FixedMul(mobj->momz, FRACUNIT - (dist>>12)); } else if (mobj->state != &states[mobj->info->spawnstate] && mobj->health > 0 && mobj->flags & MF_FLOAT) mobj->momz = FixedMul(mobj->momz,7*FRACUNIT/8); From 5a048df3d53e3507129005dd6ff6538c70d7bc64 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 29 Sep 2016 13:07:24 +0100 Subject: [PATCH 157/808] Messed up the indentation royally. --- src/p_mobj.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index b249e6741..f564a1525 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4439,8 +4439,8 @@ static void P_Boss1Thinker(mobj_t *mobj) if (mobj->flags2 & MF2_SKULLFLY) { fixed_t dist = (mobj->eflags & MFE_VERTICALFLIP) - ? ((mobj->ceilingz-(2*mobj->height)) - (mobj->z+mobj->height)) - : (mobj->z - (mobj->floorz+(2*mobj->height))); + ? ((mobj->ceilingz-(2*mobj->height)) - (mobj->z+mobj->height)) + : (mobj->z - (mobj->floorz+(2*mobj->height))); if (dist > 0 && P_MobjFlip(mobj)*mobj->momz > 0) mobj->momz = FixedMul(mobj->momz, FRACUNIT - (dist>>12)); } From bf01e9e5c3772e99b002290ea12e28f2cb2519c0 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 29 Sep 2016 14:23:58 +0100 Subject: [PATCH 158/808] Bustable material updated to: * Take advantage of FF_MIDDLESTARTCHANCE. * Be bound to the space of a slope. --- src/info.c | 32 ++++++++++++++++---------------- src/p_floor.c | 25 ++++++++++++++++--------- 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/src/info.c b/src/info.c index 9d65c8721..ed5de0125 100644 --- a/src/info.c +++ b/src/info.c @@ -2484,22 +2484,22 @@ state_t states[NUMSTATES] = {SPR_NULL, 0, 1, {A_RockSpawn}, 0, 0, S_ROCKSPAWN}, // S_ROCKSPAWN - {SPR_ROIA, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEA}, // S_ROCKCRUMBLEA - {SPR_ROIB, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEB}, // S_ROCKCRUMBLEB - {SPR_ROIC, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEC}, // S_ROCKCRUMBLEC - {SPR_ROID, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLED}, // S_ROCKCRUMBLED - {SPR_ROIE, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEE}, // S_ROCKCRUMBLEE - {SPR_ROIF, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEF}, // S_ROCKCRUMBLEF - {SPR_ROIG, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEG}, // S_ROCKCRUMBLEG - {SPR_ROIH, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEH}, // S_ROCKCRUMBLEH - {SPR_ROII, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEI}, // S_ROCKCRUMBLEI - {SPR_ROIJ, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEJ}, // S_ROCKCRUMBLEJ - {SPR_ROIK, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEK}, // S_ROCKCRUMBLEK - {SPR_ROIL, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEL}, // S_ROCKCRUMBLEL - {SPR_ROIM, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEM}, // S_ROCKCRUMBLEM - {SPR_ROIN, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEN}, // S_ROCKCRUMBLEN - {SPR_ROIO, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEO}, // S_ROCKCRUMBLEO - {SPR_ROIP, FF_ANIMATE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEP}, // S_ROCKCRUMBLEP + {SPR_ROIA, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEA}, // S_ROCKCRUMBLEA + {SPR_ROIB, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEB}, // S_ROCKCRUMBLEB + {SPR_ROIC, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEC}, // S_ROCKCRUMBLEC + {SPR_ROID, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLED}, // S_ROCKCRUMBLED + {SPR_ROIE, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEE}, // S_ROCKCRUMBLEE + {SPR_ROIF, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEF}, // S_ROCKCRUMBLEF + {SPR_ROIG, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEG}, // S_ROCKCRUMBLEG + {SPR_ROIH, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEH}, // S_ROCKCRUMBLEH + {SPR_ROII, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEI}, // S_ROCKCRUMBLEI + {SPR_ROIJ, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEJ}, // S_ROCKCRUMBLEJ + {SPR_ROIK, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEK}, // S_ROCKCRUMBLEK + {SPR_ROIL, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEL}, // S_ROCKCRUMBLEL + {SPR_ROIM, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEM}, // S_ROCKCRUMBLEM + {SPR_ROIN, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEN}, // S_ROCKCRUMBLEN + {SPR_ROIO, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEO}, // S_ROCKCRUMBLEO + {SPR_ROIP, FF_ANIMATE|FF_MIDDLESTARTCHANCE, -1, {NULL}, 4, 2, S_ROCKCRUMBLEP}, // S_ROCKCRUMBLEP {SPR_SRBA, 0, 5, {A_Look}, 0, 0, S_SRB1_CRAWLA1}, // S_SRB1_CRAWLA1 {SPR_SRBA, 0, 3, {A_Chase}, 0, 0, S_SRB1_CRAWLA3}, // S_SRB1_CRAWLA2 diff --git a/src/p_floor.c b/src/p_floor.c index 5a1b9e78d..5ee08beea 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -15,6 +15,7 @@ #include "doomstat.h" #include "m_random.h" #include "p_local.h" +#include "p_slopes.h" #include "r_state.h" #include "s_sound.h" #include "z_zone.h" @@ -2893,7 +2894,7 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) size_t topmostvertex = 0, bottommostvertex = 0; fixed_t leftx, rightx; fixed_t topy, bottomy; - fixed_t topz; + fixed_t topz, bottomz; fixed_t widthfactor, heightfactor; fixed_t a, b, c; mobjtype_t type = MT_ROCKCRUMBLE1; @@ -2950,10 +2951,15 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) rightx = sec->lines[rightmostvertex]->v1->x; topy = sec->lines[topmostvertex]->v1->y-(spacing>>1); bottomy = sec->lines[bottommostvertex]->v1->y; - topz = *rover->topheight-(spacing>>1); - widthfactor = (rightx + topy - leftx - bottomy)>>3; - heightfactor = (topz - *rover->bottomheight)>>2; + topz = *rover->topheight-(spacing>>1); + bottomz = *rover->bottomheight; + + if (flags & ML_EFFECT1) + { + widthfactor = (rightx + topy - leftx - bottomy)>>3; + heightfactor = (topz - *rover->bottomheight)>>2; + } for (a = leftx; a < rightx; a += spacing) { @@ -2962,13 +2968,14 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) if (R_PointInSubsector(a, b)->sector == sec) { mobj_t *spawned = NULL; - for (c = topz; c > *rover->bottomheight; c -= spacing) + if (*rover->t_slope) + topz = P_GetZAt(*rover->t_slope, a, b) - (spacing>>1); + if (*rover->b_slope) + bottomz = P_GetZAt(*rover->b_slope, a, b); + + for (c = topz; c > bottomz; c -= spacing) { spawned = P_SpawnMobj(a, b, c, type); - - if (spawned->frame & FF_ANIMATE) - spawned->frame += P_RandomKey(spawned->state->var1); - spawned->angle += P_RandomKey(36)*ANG10; // irrelevant for default objects but might make sense for some custom ones if (flags & ML_EFFECT1) From 35dda1cd72a17d35ee29ee91e6646b3399da4660 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 29 Sep 2016 20:02:58 +0100 Subject: [PATCH 159/808] Replaced the Force Shield's shitty drop dash I coded with a much more interesting and experimental ability. * The Dodge Dash * Allows you to dash - no control, no falling, no key response - for 2 + (number of extra shield hitpoints) tics. * If you're holding movement keys down, you dash in the direction you're holding - otherwise, you dash directly forward. * You're spinning (spindash spin, not jump spin) until your dash is over, then your momentum is cut down significantly and you end up in falling frames. * It may not necessarily be super useful for Sonic, but it helps the other characters. * http://gfycat.com/BogusFailingFritillarybutterfly * http://gfycat.com/PoliticalIdealisticBallpython (outdated speed, shows any direction) --- src/p_mobj.c | 24 +++--------------------- src/p_user.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 49 insertions(+), 27 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 37b684016..7092e7d81 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3214,14 +3214,6 @@ static void P_PlayerZMovement(mobj_t *mo) P_ElementalFire(mo->player, true); } } - else if ((mo->player->powers[pw_shield] & SH_FORCE) == SH_FORCE) // Force Shield's drop dash. - { - fixed_t magnitude = min(max(FixedHypot((FixedHypot(mo->momx, mo->momy)), mo->momz), abs(mo->momz)*2), 75<angle, magnitude); - S_StartSound(mo, sfx_zoom); - mo->player->pflags |= PF_SPINNING; - P_SetPlayerMobjState(mo, S_PLAY_SPIN); - } } mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY/*|PF_GLIDING*/); mo->player->jumping = 0; @@ -6713,6 +6705,7 @@ void P_MobjThinker(mobj_t *mobj) case MT_BLACKORB: case MT_WHITEORB: case MT_GREENORB: + case MT_BLUEORB: case MT_PITYORB: if (!P_AddShield(mobj)) return; @@ -6723,20 +6716,9 @@ void P_MobjThinker(mobj_t *mobj) if ((mobj->target) && (mobj->target->player) && (mobj->target->player->homing)) - P_SetMobjState(mobj, mobj->info->painstate); - break; - case MT_BLUEORB: - if (!P_AddShield(mobj)) - return; - if ((mobj->target) - && (mobj->target->player) - && (mobj->target->player->pflags & PF_SHIELDABILITY)) { - mobj->frame &= ~FF_TRANSMASK; - if (!(leveltime & 15)) - { - S_StartSound(mobj->target, sfx_ding); - } + P_SetMobjState(mobj, mobj->info->painstate); + mobj->tics++; } break; case MT_WATERDROP: diff --git a/src/p_user.c b/src/p_user.c index 405fa67b6..409ee9b45 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -867,6 +867,15 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor) // Useful when you want to kill everything the player is doing. void P_ResetPlayer(player_t *player) { + if (player->mo + && (player->powers[pw_shield] & SH_FORCE) == SH_FORCE // Dash. + && player->pflags & PF_SHIELDABILITY) + { + P_SetPlayerMobjState(player->mo, S_PLAY_FALL); + player->mo->flags &= ~MF_NOGRAVITY; + player->pflags &= ~PF_FULLSTASIS; + } + player->pflags &= ~(PF_SPINNING|PF_STARTDASH|PF_JUMPED|PF_GLIDING|PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY); player->powers[pw_carry] = CR_NONE; player->jumping = 0; @@ -3835,7 +3844,7 @@ void P_DoJumpShield(player_t *player) player->pflags &= ~PF_JUMPED; player->secondjump = 0; player->jumping = 0; - player->pflags |= PF_THOKKED; + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; player->pflags &= ~PF_SPINNING; P_SetPlayerMobjState(player->mo, S_PLAY_FALL); S_StartSound(player->mo, sfx_wdjump); @@ -6930,8 +6939,21 @@ static void P_MovePlayer(player_t *player) { if (!(player->pflags & PF_THOKKED)) { - player->pflags |= PF_THOKKED|PF_SHIELDABILITY; - S_StartSound(player->mo, sfx_ding); + angle_t dashangle = player->mo->angle; + if (player->cmd.forwardmove || player->cmd.sidemove) + { + dashangle += R_PointToAngle2(0, 0, player->cmd.forwardmove<cmd.sidemove<homing = 2; + if ((player->powers[pw_shield] & SH_NOSTACK) - SH_FORCE) + player->homing++; + S_StartSound(player->mo, sfx_s3k47); + P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); + player->pflags |= PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY; + player->mo->flags |= MF_NOGRAVITY; + P_InstaThrust(player->mo, dashangle, 64*FRACUNIT); + player->mo->momz = 0; } } } @@ -6950,7 +6972,25 @@ static void P_MovePlayer(player_t *player) } // HOMING option. - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT + if ((player->powers[pw_shield] & SH_FORCE) == SH_FORCE // Dash. + && player->pflags & PF_SHIELDABILITY) + { + if (player->homing) + { + player->pflags |= PF_FULLSTASIS; + player->mo->momz = 0; + if (!(player->pflags & PF_SPINNING)) + player->homing = 0; + } + + if (player->homing == 0) + { + P_ResetPlayer(player); + player->mo->momx >>= 3; + player->mo->momy >>= 3; + } + } + else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT // Sonic 3D Blast. && player->pflags & PF_SHIELDABILITY) { if (player->homing && player->mo->tracer) @@ -6969,7 +7009,7 @@ static void P_MovePlayer(player_t *player) if (!(player->pflags & PF_JUMPED)) player->homing = 0; } - else if (player->charability == CA_HOMINGTHOK) + else if (player->charability == CA_HOMINGTHOK) // Sonic Adventure. { // If you've got a target, chase after it! if (player->homing && player->mo->tracer) @@ -9185,7 +9225,7 @@ void P_PlayerThink(player_t *player) player->losstime--; // Flash player after being hit. - if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < flashingtics && (leveltime & 1)) + if ((player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < flashingtics && (leveltime & 1)) || ((player->powers[pw_shield] & SH_FORCE) == SH_FORCE && player->pflags & PF_SHIELDABILITY)) player->mo->flags2 |= MF2_DONTDRAW; else player->mo->flags2 &= ~MF2_DONTDRAW; From accd8bc5bd7f1e58f343b1945155de9e69728be2 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 29 Sep 2016 20:36:08 +0100 Subject: [PATCH 160/808] Minor fixes. Notably - no longer "deletes gravity" when hitting a slope mid-dash. --- src/p_mobj.c | 5 +++++ src/p_user.c | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 7092e7d81..dcc2ff18b 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3214,6 +3214,11 @@ static void P_PlayerZMovement(mobj_t *mo) P_ElementalFire(mo->player, true); } } + else if ((mo->player->powers[pw_shield] & SH_FORCE) == SH_FORCE) // Force shield's dodge dash. + { + mo->flags &= ~MF_NOGRAVITY; + mo->player->pflags &= ~PF_FULLSTASIS; + } } mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY/*|PF_GLIDING*/); mo->player->jumping = 0; diff --git a/src/p_user.c b/src/p_user.c index 409ee9b45..a00c76b79 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6945,9 +6945,7 @@ static void P_MovePlayer(player_t *player) dashangle += R_PointToAngle2(0, 0, player->cmd.forwardmove<cmd.sidemove<homing = 2; - if ((player->powers[pw_shield] & SH_NOSTACK) - SH_FORCE) - player->homing++; + player->homing = 2 + ((player->powers[pw_shield] & SH_NOSTACK) - SH_FORCE); S_StartSound(player->mo, sfx_s3k47); P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); player->pflags |= PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY; From 34d56561e46ab7715fddbf43da86cb50d2567b9a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 29 Sep 2016 20:44:05 +0100 Subject: [PATCH 161/808] Fixed MORE problems with landing on slopes. --- src/p_mobj.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index dcc2ff18b..dcc18587d 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3216,8 +3216,11 @@ static void P_PlayerZMovement(mobj_t *mo) } else if ((mo->player->powers[pw_shield] & SH_FORCE) == SH_FORCE) // Force shield's dodge dash. { + P_SetPlayerMobjState(mo, S_PLAY_WALK); mo->flags &= ~MF_NOGRAVITY; - mo->player->pflags &= ~PF_FULLSTASIS; + mo->player->pflags &= ~(PF_FULLSTASIS|PF_SPINNING); + mo->momx >>= 3; + mo->momy >>= 3; } } mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY/*|PF_GLIDING*/); From 3eb3caacd54432df4140465ebeac94a2374825f0 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 29 Sep 2016 21:25:15 +0100 Subject: [PATCH 162/808] Tweaked the elemental shield's piercing ability. Specifically: * The spinfire ring is now capable of damaging enemies. (god, what a terrible hack this is) * When ground pounding, you now bounce off the floor a little bit to make the ability less spammable. --- src/p_mobj.c | 28 ++++++++++++++++++++-------- src/p_user.c | 2 +- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index dcc18587d..ede8b4b63 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2579,11 +2579,15 @@ static boolean P_ZMovement(mobj_t *mo) P_RemoveMobj(mo); return false; } - if (mo->z <= mo->floorz && mo->momz) + if (mo->momz + && !(mo->flags & MF_NOGRAVITY) + && ((!(mo->eflags & MFE_VERTICALFLIP) && mo->z <= mo->floorz) + || ((mo->eflags & MFE_VERTICALFLIP) && mo->z+mo->height >= mo->ceilingz))) { mo->flags |= MF_NOGRAVITY; - mo->momx = mo->momy = mo->momz = 0; - mo->z = mo->floorz; + mo->momx = 8; // this is a hack which is used to ensure it still behaves as a missile and can damage others + mo->momy = mo->momz = 0; + mo->z = ((mo->eflags & MFE_VERTICALFLIP) ? mo->ceilingz-mo->height : mo->floorz); } break; case MT_GOOP: @@ -3071,6 +3075,8 @@ static void P_PlayerZMovement(mobj_t *mo) if (P_MobjFlip(mo)*mo->momz < 0) // falling { + boolean clipmomz = true; + mo->pmomz = 0; // We're on a new floor, don't keep doing platform movement. // Squat down. Decrease viewheight for a moment after hitting the ground (hard), @@ -3213,6 +3219,9 @@ static void P_PlayerZMovement(mobj_t *mo) S_StartSound(mo, sfx_s3k47); P_ElementalFire(mo->player, true); } + P_SetObjectMomZ(mo, 5*FRACUNIT/2, false); + P_SetPlayerMobjState(mo, S_PLAY_FALL); + clipmomz = false; } else if ((mo->player->powers[pw_shield] & SH_FORCE) == SH_FORCE) // Force shield's dodge dash. { @@ -3234,11 +3243,14 @@ static void P_PlayerZMovement(mobj_t *mo) if (!(mo->player->pflags & PF_SPINNING)) mo->player->pflags &= ~PF_STARTDASH; - if (tmfloorthing && (tmfloorthing->flags & (MF_PUSHABLE|MF_MONITOR) - || tmfloorthing->flags2 & MF2_STANDONME || tmfloorthing->type == MT_PLAYER)) - mo->momz = tmfloorthing->momz; - else if (!tmfloorthing) - mo->momz = 0; + if (clipmomz) + { + if (tmfloorthing && (tmfloorthing->flags & (MF_PUSHABLE|MF_MONITOR) + || tmfloorthing->flags2 & MF2_STANDONME || tmfloorthing->type == MT_PLAYER)) + mo->momz = tmfloorthing->momz; + else if (!tmfloorthing) + mo->momz = 0; + } } else if (tmfloorthing && (tmfloorthing->flags & (MF_PUSHABLE|MF_MONITOR) || tmfloorthing->flags2 & MF2_STANDONME || tmfloorthing->type == MT_PLAYER)) diff --git a/src/p_user.c b/src/p_user.c index a00c76b79..58af55fe5 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6244,7 +6244,7 @@ void P_ElementalFire(player_t *player, boolean cropcircle) P_SetScale(flame, player->mo->scale); flame->eflags = (flame->eflags & ~MFE_VERTICALFLIP)|(player->mo->eflags & MFE_VERTICALFLIP); - flame->momx = 8; + flame->momx = 8; // this is a hack which is used to ensure it still behaves as a missile and can damage others P_XYMovement(flame); if (P_MobjWasRemoved(flame)) continue; From d6a404e1efdd1f187b1d801af32093843712036c Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 00:34:17 +0100 Subject: [PATCH 163/808] * On Mystic's reccomendation - an alternate method which has the direction to shoot off based on the direction you're moving, not the direction you're holding. * When not pressing any direction, you now go backwards by default - to emphasise that this is primarily for defensive, not offensive, purposes. * The camera can now handle the player going backwards without them going completely off-screen. * Fixed some overzealous checks. --- src/p_mobj.c | 2 +- src/p_user.c | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index ede8b4b63..1df1541e9 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3223,7 +3223,7 @@ static void P_PlayerZMovement(mobj_t *mo) P_SetPlayerMobjState(mo, S_PLAY_FALL); clipmomz = false; } - else if ((mo->player->powers[pw_shield] & SH_FORCE) == SH_FORCE) // Force shield's dodge dash. + else if (mo->player->powers[pw_shield] & SH_FORCE) // Force shield's dodge dash. { P_SetPlayerMobjState(mo, S_PLAY_WALK); mo->flags &= ~MF_NOGRAVITY; diff --git a/src/p_user.c b/src/p_user.c index 58af55fe5..369e6112e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -868,7 +868,7 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor) void P_ResetPlayer(player_t *player) { if (player->mo - && (player->powers[pw_shield] & SH_FORCE) == SH_FORCE // Dash. + && player->powers[pw_shield] & SH_FORCE // Dash. && player->pflags & PF_SHIELDABILITY) { P_SetPlayerMobjState(player->mo, S_PLAY_FALL); @@ -6935,17 +6935,22 @@ static void P_MovePlayer(player_t *player) } } // Force shield activation - if ((player->powers[pw_shield] & SH_FORCE) == SH_FORCE) + if (player->powers[pw_shield] & SH_FORCE) { if (!(player->pflags & PF_THOKKED)) { angle_t dashangle = player->mo->angle; - if (player->cmd.forwardmove || player->cmd.sidemove) - { +#if 1 // shadow.wad style redirection - hold down directional keys to set your path, go backwards by default + if (!(player->pflags & PF_ANALOGMODE) && (player->cmd.forwardmove || player->cmd.sidemove)) dashangle += R_PointToAngle2(0, 0, player->cmd.forwardmove<cmd.sidemove<mo->momx || player->mo->momy) + dashangle = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy); +#endif + dashangle += ANGLE_180; P_ResetPlayer(player); - player->homing = 2 + ((player->powers[pw_shield] & SH_NOSTACK) - SH_FORCE); + player->homing = 2 + ((player->powers[pw_shield] & SH_NOSTACK) - SH_FORCE); // might get ridiculous with 256 hitpoints, don't you think? S_StartSound(player->mo, sfx_s3k47); P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); player->pflags |= PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY; @@ -6970,7 +6975,7 @@ static void P_MovePlayer(player_t *player) } // HOMING option. - if ((player->powers[pw_shield] & SH_FORCE) == SH_FORCE // Dash. + if (player->powers[pw_shield] & SH_FORCE // Dash. && player->pflags & PF_SHIELDABILITY) { if (player->homing) @@ -8073,6 +8078,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall camheight = FixedMul(cv_cam2_height.value, FixedMul(player->camerascale, mo->scale)); } + if (player->powers[pw_shield] & SH_FORCE && player->pflags & PF_SHIELDABILITY) + camspeed <<= 1; + #ifdef REDSANALOG if (P_AnalogMove(player) && (player->cmd.buttons & (BT_CAMLEFT|BT_CAMRIGHT)) == (BT_CAMLEFT|BT_CAMRIGHT)) { camstill = true; @@ -9223,7 +9231,7 @@ void P_PlayerThink(player_t *player) player->losstime--; // Flash player after being hit. - if ((player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < flashingtics && (leveltime & 1)) || ((player->powers[pw_shield] & SH_FORCE) == SH_FORCE && player->pflags & PF_SHIELDABILITY)) + if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < flashingtics && (leveltime & 1)) player->mo->flags2 |= MF2_DONTDRAW; else player->mo->flags2 &= ~MF2_DONTDRAW; From 041347bb6a3df5a8ee5a4c21953ad0eb0767572b Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 01:26:23 +0100 Subject: [PATCH 164/808] eslopeless compiling fix --- src/p_floor.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/p_floor.c b/src/p_floor.c index 5ee08beea..921d11b6c 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -15,7 +15,9 @@ #include "doomstat.h" #include "m_random.h" #include "p_local.h" +#ifdef ESLOPE #include "p_slopes.h" +#endif #include "r_state.h" #include "s_sound.h" #include "z_zone.h" @@ -2968,10 +2970,12 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover) if (R_PointInSubsector(a, b)->sector == sec) { mobj_t *spawned = NULL; +#ifdef ESLOPE if (*rover->t_slope) topz = P_GetZAt(*rover->t_slope, a, b) - (spacing>>1); if (*rover->b_slope) bottomz = P_GetZAt(*rover->b_slope, a, b); +#endif for (c = topz; c > bottomz; c -= spacing) { From 92da1413945ec69a35af8c4152a837877da48b81 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 29 Sep 2016 17:27:33 -0700 Subject: [PATCH 165/808] Yes, that stupid off-by-one due to spawning objects in the middle of thinkers being run still applies. --- src/info.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/info.c b/src/info.c index 86e51fc9f..d48ecfa79 100644 --- a/src/info.c +++ b/src/info.c @@ -222,7 +222,7 @@ state_t states[NUMSTATES] = {SPR_NULL, 0, 1, {NULL}, 0, 0, S_PLAY_BOX1}, // S_PLAY_BOX2 {SPR_PLAY, SPR2_LIFE, 4, {NULL}, 0, 4, S_PLAY_ICON2}, // S_PLAY_ICON1 {SPR_NULL, 0, 12, {NULL}, 0, 0, S_PLAY_ICON3}, // S_PLAY_ICON2 - {SPR_PLAY, SPR2_LIFE, 19, {NULL}, 0, 4, S_NULL}, // S_PLAY_ICON3 + {SPR_PLAY, SPR2_LIFE, 20, {NULL}, 0, 4, S_NULL}, // S_PLAY_ICON3 // Level end sign (uses player sprite) {SPR_PLAY, SPR2_SIGN, 1, {NULL}, 0, 24, S_PLAY_SIGN}, // S_PLAY_SIGN @@ -1256,52 +1256,52 @@ state_t states[NUMSTATES] = // Box Icons -- 2 states each, animation and action {SPR_TVRI, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_RING_ICON2}, // S_RING_ICON1 - {SPR_TVRI, 2, 17, {A_RingBox}, 0, 0, S_NULL}, // S_RING_ICON2 + {SPR_TVRI, 2, 18, {A_RingBox}, 0, 0, S_NULL}, // S_RING_ICON2 {SPR_TVPI, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_PITY_ICON2}, // S_PITY_ICON1 - {SPR_TVPI, 2, 17, {A_PityShield}, 0, 0, S_NULL}, // S_PITY_ICON2 + {SPR_TVPI, 2, 18, {A_PityShield}, 0, 0, S_NULL}, // S_PITY_ICON2 {SPR_TVAT, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_ATTRACT_ICON2}, // S_ATTRACT_ICON1 - {SPR_TVAT, 2, 17, {A_RingShield},0, 0, S_NULL}, // S_ATTRACT_ICON2 + {SPR_TVAT, 2, 18, {A_RingShield},0, 0, S_NULL}, // S_ATTRACT_ICON2 {SPR_TVFO, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_FORCE_ICON2}, // S_FORCE_ICON1 - {SPR_TVFO, 2, 17, {A_ForceShield}, 0, 0, S_NULL}, // S_FORCE_ICON2 + {SPR_TVFO, 2, 18, {A_ForceShield}, 0, 0, S_NULL}, // S_FORCE_ICON2 {SPR_TVAR, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_ARMAGEDDON_ICON2}, // S_ARMAGEDDON_ICON1 - {SPR_TVAR, 2, 17, {A_BombShield}, 0, 0, S_NULL}, // S_ARMAGEDDON_ICON2 + {SPR_TVAR, 2, 18, {A_BombShield}, 0, 0, S_NULL}, // S_ARMAGEDDON_ICON2 {SPR_TVWW, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_WHIRLWIND_ICON2}, // S_WHIRLWIND_ICON1 - {SPR_TVWW, 2, 17, {A_JumpShield}, 0, 0, S_NULL}, // S_WHIRLWIND_ICON2 + {SPR_TVWW, 2, 18, {A_JumpShield}, 0, 0, S_NULL}, // S_WHIRLWIND_ICON2 {SPR_TVEL, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_ELEMENTAL_ICON2}, // S_ELEMENTAL_ICON1 - {SPR_TVEL, 2, 17, {A_WaterShield}, 0, 0, S_NULL}, // S_ELEMENTAL_ICON2 + {SPR_TVEL, 2, 18, {A_WaterShield}, 0, 0, S_NULL}, // S_ELEMENTAL_ICON2 {SPR_TVSS, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_SNEAKERS_ICON2}, // S_SNEAKERS_ICON1 - {SPR_TVSS, 2, 17, {A_SuperSneakers}, 0, 0, S_NULL}, // S_SNEAKERS_ICON2 + {SPR_TVSS, 2, 18, {A_SuperSneakers}, 0, 0, S_NULL}, // S_SNEAKERS_ICON2 {SPR_TVIV, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_INVULN_ICON2}, // S_INVULN_ICON1 - {SPR_TVIV, 2, 17, {A_Invincibility}, 0, 0, S_NULL}, // S_INVULN_ICON2 + {SPR_TVIV, 2, 18, {A_Invincibility}, 0, 0, S_NULL}, // S_INVULN_ICON2 {SPR_TV1U, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_1UP_ICON2}, // S_1UP_ICON1 - {SPR_TV1U, 2, 17, {A_ExtraLife}, 0, 0, S_NULL}, // S_1UP_ICON2 + {SPR_TV1U, 2, 18, {A_ExtraLife}, 0, 0, S_NULL}, // S_1UP_ICON2 {SPR_TVEG, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_EGGMAN_ICON2}, // S_EGGMAN_ICON1 - {SPR_TVEG, 2, 17, {A_EggmanBox}, 0, 0, S_NULL}, // S_EGGMAN_ICON2 + {SPR_TVEG, 2, 18, {A_EggmanBox}, 0, 0, S_NULL}, // S_EGGMAN_ICON2 {SPR_TVMX, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_MIXUP_ICON2}, // S_MIXUP_ICON1 - {SPR_TVMX, 2, 17, {A_MixUp}, 0, 0, S_NULL}, // S_MIXUP_ICON2 + {SPR_TVMX, 2, 18, {A_MixUp}, 0, 0, S_NULL}, // S_MIXUP_ICON2 {SPR_TVGV, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_GRAVITY_ICON2}, // S_GRAVITY_ICON1 - {SPR_TVGV, 2, 17, {A_GravityBox}, 0, 0, S_NULL}, // S_GRAVITY_ICON2 + {SPR_TVGV, 2, 18, {A_GravityBox}, 0, 0, S_NULL}, // S_GRAVITY_ICON2 {SPR_TVRC, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_RECYCLER_ICON2}, // S_RECYCLER_ICON1 - {SPR_TVRC, 2, 17, {A_RecyclePowers}, 0, 0, S_NULL}, // S_RECYCLER_ICON2 + {SPR_TVRC, 2, 18, {A_RecyclePowers}, 0, 0, S_NULL}, // S_RECYCLER_ICON2 {SPR_TV1K, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_SCORE1K_ICON2}, // S_SCORE1K_ICON1 - {SPR_TV1K, 2, 17, {A_AwardScore}, 0, 0, S_NULL}, // S_SCORE1K_ICON2 + {SPR_TV1K, 2, 18, {A_AwardScore}, 0, 0, S_NULL}, // S_SCORE1K_ICON2 {SPR_TVTK, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_SCORE10K_ICON2}, // S_SCORE10K_ICON1 - {SPR_TVTK, 2, 17, {A_AwardScore}, 0, 0, S_NULL}, // S_SCORE10K_ICON2 + {SPR_TVTK, 2, 18, {A_AwardScore}, 0, 0, S_NULL}, // S_SCORE10K_ICON2 // --- From ae542e616a869a237b3bac156c02462b08552910 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 29 Sep 2016 19:24:05 -0700 Subject: [PATCH 166/808] Fixed sprite conflict BS Also added the eggman goldbox back --- src/info.c | 397 ++++++++++++++++++++++++++++++++++++++++++++++++----- src/info.h | 2 + 2 files changed, 363 insertions(+), 36 deletions(-) diff --git a/src/info.c b/src/info.c index 1817483f5..884217611 100644 --- a/src/info.c +++ b/src/info.c @@ -25,63 +25,360 @@ #endif // Hey, moron! If you change this table, don't forget about the sprite enum in info.h and the sprite lights in hw_light.c! +// For the sake of constant merge conflicts, let's spread this out char sprnames[NUMSPRITES + 1][5] = { - "NULL","UNKN","THOK","PLAY", + "NULL", // invisible object + "UNKN", - "POSS","SPOS","FISH","BUZZ","RBUZ","JETB","JETW","JETG","CCOM","DETN", - "SKIM","TRET","TURR","SHRP","JJAW","SNLR","VLTR","PNTY","ARCH","CBFS", - "SPSH","ESHI","GSNP","MNUS","SSHL","UNID","BBUZ", + "THOK", // Thok! mobj + "PLAY", - "JETF","EGGM","EGGN","TNKA","TNKB","SPNK","GOOP","EGGO","PRPL","FAKE", - "EGGP","EFIR","EGGQ","EGGR","BRAK","BGOO","BMSL","EGGT","RCKT","ELEC", - "TARG","NPLM","MNPL","METL","MSCF","MSCB", + // Enemies + "POSS", + "SPOS", + "FISH", // Greenflower Fish + "BUZZ", // Buzz (Gold) + "RBUZ", // Buzz (Red) + "JETB", // Jetty-Syn Bomber + "JETW", // Jetty-Syn Water Bomber + "JETG", // Jetty-Syn Gunner + "CCOM", // Crawla Commander + "DETN", // Deton + "SKIM", // Skim mine dropper + "TRET", + "TURR", // Pop-Up Turret + "SHRP", // Sharp + "JJAW", // Jet Jaw + "SNLR", // Snailer + "VLTR", // Vulture + "PNTY", // Pointy + "ARCH", // Robo-Hood + "CBFS", // CastleBot FaceStabber (Egg Knight?) + "SPSH", // Egg Guard + "ESHI", // Egg Shield for Egg Guard + "GSNP", // Green Snapper + "MNUS", // Minus + "SSHL", // Spring Shell + "UNID", // Unidus + "BBUZ", // AquaBuzz, for Azure Temple - "RING","TRNG","EMMY","TOKE","RFLG","BFLG","NWNG","EMBM","CEMG","EMER", + // Generic Boss Items + "JETF", // Boss jet fumes - "FANS","BBLS","SIGN","STEM","SPIK","SFLM","USPK","STPT","BMNE", + // Boss 1 (Greenflower) + "EGGM", - "MSTV","XLTV","TRRI","TBRI","TVRI","TVPI","TVAT","TVFO","TVAR","TVWW", - "TVEL","TVSS","TVIV","TV1U","TV1P","TVEG","TVMX","TVMY","TVGV","TVRC", - "TV1K","TVTK", + // Boss 2 (Techno Hill) + "EGGN", // Boss 2 + "TNKA", // Boss 2 Tank 1 + "TNKB", // Boss 2 Tank 2 + "SPNK", // Boss 2 Spigot + "GOOP", // Boss 2 Goop - "MISL","TORP","ENRG","MINE","JBUL","TRLS","CBLL","AROW","CFIR", + // Boss 3 (Deep Sea) + "EGGO", // Boss 3 + "PRPL", // Boss 3 Propeller + "FAKE", // Boss 3 Fakemobile - "FWR1","FWR2","FWR3","FWR4","BUS1","BUS2","THZP","ALRM","GARG","SEWE", - "DRIP","CRL1","CRL2","CRL3","BCRY","CHAN","FLAM","ESTA","SMCH","BMCH", - "SMCE","BMCE","BTBL","STBL","CACT","FLME","DFLM","XMS1","XMS2","XMS3", - "BSZ1","BSZ2","BSZ3","BSZ4","BSZ5","BSZ6","BSZ7","BSZ8","STLG","DBAL", - "RCRY", + // Boss 4 (Castle Eggman) + "EGGP", + "EFIR", // Boss 4 jet flame - "ARMA","ARMF","ARMB","WIND","MAGN","ELEM","FORC","PITY","IVSP","SSPK", - "GOAL", + // Boss 5 (Arid Canyon) + "EGGQ", - "BIRD","BUNY","MOUS","CHIC","COWZ","RBRD", + // Boss 6 (Red Volcano) + "EGGR", - "SPRY","SPRR","SPRB","YSPR","RSPR","SSWY","SSWR","SSWB", + // Boss 7 (Dark City) + "BRAK", + "BGOO", // Goop + "BMSL", - "RAIN","SNO1","SPLH","SPLA","SMOK","BUBL","WZAP","TFOG","SEED","PRTL", + // Boss 8 (Egg Rock) + "EGGT", - "SCOR","DRWN","TTAG","GFLG", + // Cy-Brak-Demon; uses "BRAK" as well, but has some extras + "RCKT", // Rockets! + "ELEC", // Electricity! + "TARG", // Targeting reticules! + "NPLM", // Big napalm bombs! + "MNPL", // Mini napalm bombs! - "RRNG","RNGB","RNGR","RNGI","RNGA","RNGE","RNGS","RNGG","PIKB","PIKR", - "PIKA","PIKE","PIKS","PIKG","TAUT","TGRE","TSCR", + // Metal Sonic + "METL", + "MSCF", + "MSCB", - "COIN","CPRK","GOOM","BGOM","FFWR","FBLL","SHLL","PUMA","HAMM","KOOP", - "BFLM","MAXE","MUS1","MUS2","TOAD","NDRN", + // Collectible Items + "RING", + "TRNG", // Team Rings + "EMMY", // emerald test + "TOKE", // Special Stage Token + "RFLG", // Red CTF Flag + "BFLG", // Blue CTF Flag + "NWNG", // NiGHTS Wing collectable item. + "EMBM", // Emblem + "CEMG", // Chaos Emeralds + "EMER", // Emerald Hunt - "SUPE","SUPZ","NDRL","NSPK","NBMP","HOOP","NSCR","NPRU","CAPS","SUPT", - "SPRK", + // Interactive Objects + "FANS", + "BBLS", // water bubble source + "SIGN", // Level end sign + "STEM", // Steam riser + "SPIK", // Spike Ball + "SFLM", // Spin fire + "USPK", // Floor spike + "STPT", // Starpost + "BMNE", // Big floating mine - "BOM1","BOM2","BOM3","BOM4", + // Monitor Boxes + "MSTV", // MiSc TV sprites + "XLTV", // eXtra Large TV sprites - "ROIA","ROIB","ROIC","ROID","ROIE","ROIF","ROIG","ROIH","ROII","ROIJ", - "ROIK","ROIL","ROIM","ROIN","ROIO","ROIP", + "TRRI", // Red team: 10 RIngs + "TBRI", // Blue team: 10 RIngs - "BBAL","GWLG","GWLR", + "TVRI", // 10 RIng + "TVPI", // PIty shield + "TVAT", // ATtraction shield + "TVFO", // FOrce shield + "TVAR", // ARmageddon shield + "TVWW", // WhirlWind shield + "TVEL", // ELemental shield + "TVSS", // Super Sneakers + "TVIV", // InVincibility + "TV1U", // 1Up + "TV1P", // 1uP (textless) + "TVEG", // EGgman + "TVMX", // MiXup + "TVMY", // MYstery + "TVGV", // GraVity boots + "TVRC", // ReCycler + "TV1K", // 1,000 points (1 K) + "TVTK", // 10,000 points (Ten K) - "SRBA","SRBB","SRBC","SRBD","SRBE","SRBF","SRBG","SRBH","SRBI","SRBJ", - "SRBK","SRBL","SRBM","SRBN","SRBO", + // Projectiles + "MISL", + "TORP", // Torpedo + "ENRG", // Energy ball + "MINE", // Skim mine + "JBUL", // Jetty-Syn Bullet + "TRLS", + "CBLL", // Cannonball + "AROW", // Arrow + "CFIR", // Colored fire of various sorts + + // Greenflower Scenery + "FWR1", + "FWR2", // GFZ Sunflower + "FWR3", // GFZ budding flower + "FWR4", + "BUS1", // GFZ Bush w/ berries + "BUS2", // GFZ Bush w/o berries + + // Techno Hill Scenery + "THZP", // Techno Hill Zone Plant + "ALRM", // THZ2 Alarm + + // Deep Sea Scenery + "GARG", // Deep Sea Gargoyle + "SEWE", // Deep Sea Seaweed + "DRIP", // Dripping water + "CRL1", // Coral 1 + "CRL2", // Coral 2 + "CRL3", // Coral 3 + "BCRY", // Blue Crystal + + // Castle Eggman Scenery + "CHAN", // CEZ Chain + "FLAM", // Flame + "ESTA", // Eggman esta una estatua! + "SMCH", // Small Mace Chain + "BMCH", // Big Mace Chain + "SMCE", // Small Mace + "BMCE", // Big Mace + + // Arid Canyon Scenery + "BTBL", // Big tumbleweed + "STBL", // Small tumbleweed + "CACT", // Cacti sprites + + // Red Volcano Scenery + "FLME", // Flame jet + "DFLM", // Blade's flame + + // Dark City Scenery + + // Egg Rock Scenery + + // Christmas Scenery + "XMS1", + "XMS2", + "XMS3", + + // Botanic Serenity Scenery + "BSZ1", // Tall flowers + "BSZ2", // Medium flowers + "BSZ3", // Small flowers + "BSZ4", // Tulip + "BSZ5", // Cluster of Tulips + "BSZ6", // Bush + "BSZ7", // Vine + "BSZ8", // Misc things + + // Misc Scenery + "STLG", // Stalagmites + "DBAL", // Disco + "RCRY", // ATZ Red Crystal (Target) + + // Powerup Indicators + "ARMA", // Armageddon Shield Orb + "ARMF", // Armageddon Shield Ring, Front + "ARMB", // Armageddon Shield Ring, Back + "WIND", // Whirlwind Shield Orb + "MAGN", // Attract Shield Orb + "ELEM", // Elemental Shield Orb and Fire + "FORC", // Force Shield Orb + "PITY", // Pity Shield Orb + "IVSP", // invincibility sparkles + "SSPK", // Super Sonic Spark + + "GOAL", // Special Stage goal (here because lol NiGHTS) + + // Freed Animals + "BIRD", // Birdie freed! + "BUNY", // Bunny freed! + "MOUS", // Mouse + "CHIC", // Chicken + "COWZ", // Cow + "RBRD", // Red Birdie in Bubble + + // Springs + "SPRY", // yellow spring + "SPRR", // red spring + "SPRB", // Blue springs + "YSPR", // Yellow Diagonal Spring + "RSPR", // Red Diagonal Spring + "SSWY", // Yellow Side Spring + "SSWR", // Red Side Spring + "SSWB", // Blue Side Spring + + // Environmental Effects + "RAIN", // Rain + "SNO1", // Snowflake + "SPLH", // Water Splish + "SPLA", // Water Splash + "SMOK", + "BUBL", // Bubble + "WZAP", + "TFOG", // Teleport Fog + "SEED", // Sonic CD flower seed + "PRTL", // Particle (for fans, etc.) + + // Game Indicators + "SCOR", // Score logo + "DRWN", // Drowning Timer + "TTAG", // Tag Sign + "GFLG", // Got Flag sign + + // Ring Weapons + "RRNG", // Red Ring + "RNGB", // Bounce Ring + "RNGR", // Rail Ring + "RNGI", // Infinity Ring + "RNGA", // Automatic Ring + "RNGE", // Explosion Ring + "RNGS", // Scatter Ring + "RNGG", // Grenade Ring + + "PIKB", // Bounce Ring Pickup + "PIKR", // Rail Ring Pickup + "PIKA", // Automatic Ring Pickup + "PIKE", // Explosion Ring Pickup + "PIKS", // Scatter Ring Pickup + "PIKG", // Grenade Ring Pickup + + "TAUT", // Thrown Automatic Ring + "TGRE", // Thrown Grenade Ring + "TSCR", // Thrown Scatter Ring + + // Mario-specific stuff + "COIN", + "CPRK", + "GOOM", + "BGOM", + "FFWR", + "FBLL", + "SHLL", + "PUMA", + "HAMM", + "KOOP", + "BFLM", + "MAXE", + "MUS1", + "MUS2", + "TOAD", + + // NiGHTS Stuff + "NDRN", // NiGHTS drone + "NSPK", // NiGHTS sparkle + "NBMP", // NiGHTS Bumper + "HOOP", // NiGHTS hoop sprite + "NSCR", // NiGHTS score sprite + "NPRU", // Nights Powerups + "CAPS", // Capsule thingy for NiGHTS + + // Debris + "SPRK", // spark + "BOM1", // Robot Explosion + "BOM2", // Boss Explosion 1 + "BOM3", // Boss Explosion 2 + "BOM4", // Underwater Explosion + + // Crumbly rocks + "ROIA", + "ROIB", + "ROIC", + "ROID", + "ROIE", + "ROIF", + "ROIG", + "ROIH", + "ROII", + "ROIJ", + "ROIK", + "ROIL", + "ROIM", + "ROIN", + "ROIO", + "ROIP", + + // Blue Spheres + "BBAL", + + // Gravity Well Objects + "GWLG", + "GWLR", + + // SRB1 Sprites + "SRBA", + "SRBB", + "SRBC", + "SRBD", + "SRBE", + "SRBF", + "SRBG", + "SRBH", + "SRBI", + "SRBJ", + "SRBK", + "SRBL", + "SRBM", + "SRBN", + "SRBO", }; char spr2names[NUMPLAYERSPRITES][5] = @@ -1336,6 +1633,7 @@ state_t states[NUMSTATES] = {SPR_TVEL, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_ELEMENTAL_GOLDBOX {SPR_TVSS, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_SNEAKERS_GOLDBOX {SPR_TVIV, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_INVULN_GOLDBOX + {SPR_TVEG, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_EGGMAN_GOLDBOX {SPR_TVGV, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_GRAVITY_GOLDBOX // Team Ring Boxes (these are special) @@ -6344,6 +6642,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_EGGMAN_GOLDBOX + 440, // doomednum + S_EGGMAN_GOLDBOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_monton, // attacksound + S_EGGMAN_GOLDBOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_GOLDBOX_OFF1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 36*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_EGGMAN_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags + S_NULL // raisestate + }, + { // MT_GRAVITY_GOLDBOX 443, // doomednum S_GRAVITY_GOLDBOX, // spawnstate diff --git a/src/info.h b/src/info.h index df4883435..8f9e473aa 100644 --- a/src/info.h +++ b/src/info.h @@ -1824,6 +1824,7 @@ typedef enum state S_ELEMENTAL_GOLDBOX, S_SNEAKERS_GOLDBOX, S_INVULN_GOLDBOX, + S_EGGMAN_GOLDBOX, S_GRAVITY_GOLDBOX, // Team Ring Boxes (these are special) @@ -3164,6 +3165,7 @@ typedef enum mobj_type MT_ELEMENTAL_GOLDBOX, MT_SNEAKERS_GOLDBOX, MT_INVULN_GOLDBOX, + MT_EGGMAN_GOLDBOX, MT_GRAVITY_GOLDBOX, // Monitor boxes -- special From 074cc9b96520999ae808a14c0688ab07e202a41f Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 29 Sep 2016 19:32:21 -0700 Subject: [PATCH 167/808] Dehacked, as usual --- src/dehacked.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dehacked.c b/src/dehacked.c index 4d73ea41b..43391cde3 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -4918,6 +4918,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_ELEMENTAL_GOLDBOX", "S_SNEAKERS_GOLDBOX", "S_INVULN_GOLDBOX", + "S_EGGMAN_GOLDBOX", "S_GRAVITY_GOLDBOX", // Team Ring Boxes (these are special) @@ -6237,6 +6238,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_ELEMENTAL_GOLDBOX", "MT_SNEAKERS_GOLDBOX", "MT_INVULN_GOLDBOX", + "MT_EGGMAN_GOLDBOX", "MT_GRAVITY_GOLDBOX", // Monitor boxes -- special From afb22b968be2ed311aed7f7e99a5a09a6cfb22ab Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Fri, 30 Sep 2016 03:20:57 -0700 Subject: [PATCH 168/808] FF_GLOBALANIM for synced animations and a few other frame flag changes --- src/dehacked.c | 4 ++- src/info.c | 68 +++++++++++++++++++++++++------------------------- src/p_mobj.c | 49 ++++++++++++++++++++++++++++-------- src/p_pspr.h | 22 ++++++++++------ 4 files changed, 90 insertions(+), 53 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 43391cde3..2bf4012bd 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6974,8 +6974,10 @@ struct { // Frame settings {"FF_FRAMEMASK",FF_FRAMEMASK}, {"FF_SPR2ENDSTATE",FF_SPR2ENDSTATE}, - {"FF_MIDDLESTARTCHANCE",FF_MIDDLESTARTCHANCE}, + {"FF_SPR2MIDSTART",FF_SPR2MIDSTART}, {"FF_ANIMATE",FF_ANIMATE}, + {"FF_RANDOMANIM",FF_RANDOMANIM}, + {"FF_GLOBALANIM",FF_GLOBALANIM}, {"FF_FULLBRIGHT",FF_FULLBRIGHT}, {"FF_TRANSMASK",FF_TRANSMASK}, {"FF_TRANSSHIFT",FF_TRANSSHIFT}, diff --git a/src/info.c b/src/info.c index 884217611..c73a5798f 100644 --- a/src/info.c +++ b/src/info.c @@ -474,8 +474,8 @@ enum playersprite free_spr2 = SPR2_FIRSTFREESLOT; state_t states[NUMSTATES] = { // frame is masked through FF_FRAMEMASK - // FF_ANIMATE (0x4000) makes simple state animations (var1 #frames, var2 tic delay) - // FF_FULLBRIGHT (0x8000) activates the fullbright colormap + // FF_ANIMATE makes simple state animations (var1 #frames, var2 tic delay) + // FF_FULLBRIGHT activates the fullbright colormap // use FF_TRANS10 - FF_TRANS90 for easy translucency // (or tr_trans10<frame & FF_ANIMATE)) + return; + if (st->var1 == 0 || st->var2 == 0) + { + mobj->frame &= ~FF_ANIMATE; + return; // Crash/stupidity prevention + } + + mobj->anim_duration = (UINT16)st->var2; + + if (st->frame & FF_GLOBALANIM) + { + // Attempt to account for the pre-ticker for objects spawned on load + if (!leveltime) return; + + mobj->anim_duration -= (leveltime + 2) % st->var2; // Duration synced to timer + mobj->frame += ((leveltime + 2) / st->var2) % (st->var1 + 1); // Frame synced to timer (duration taken into account) + } + else if (st->frame & FF_RANDOMANIM) + { + mobj->frame += P_RandomKey(st->var1 + 1); // Random starting frame + mobj->anim_duration -= P_RandomKey(st->var2); // Random duration for first frame + } +} + // // P_CycleStateAnimation // @@ -588,7 +618,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) } else if (mobj->sprite2 != spr2) { - if ((st->frame & FF_MIDDLESTARTCHANCE) && numframes && P_RandomChance(FRACUNIT/2)) + if ((st->frame & FF_SPR2MIDSTART) && numframes && P_RandomChance(FRACUNIT/2)) frame = numframes/2; else frame = 0; @@ -621,8 +651,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) { mobj->sprite = st->sprite; mobj->frame = st->frame; - if ((st->frame & (FF_ANIMATE|FF_MIDDLESTARTCHANCE)) == (FF_ANIMATE|FF_MIDDLESTARTCHANCE)) - mobj->frame += P_RandomKey(st->var1+1); + P_SetupStateAnimation(mobj, st); } // Modified handling. @@ -689,7 +718,6 @@ boolean P_SetMobjState(mobj_t *mobj, statenum_t state) st = &states[state]; mobj->state = st; mobj->tics = st->tics; - mobj->anim_duration = (UINT16)st->var2; // only used if FF_ANIMATE is set // Player animations if (st->sprite == SPR_PLAY) @@ -714,7 +742,7 @@ boolean P_SetMobjState(mobj_t *mobj, statenum_t state) } else if (mobj->sprite2 != spr2) { - if ((st->frame & FF_MIDDLESTARTCHANCE) && numframes && P_RandomChance(FRACUNIT/2)) + if ((st->frame & FF_SPR2MIDSTART) && numframes && P_RandomChance(FRACUNIT/2)) frame = numframes/2; else frame = 0; @@ -736,8 +764,7 @@ boolean P_SetMobjState(mobj_t *mobj, statenum_t state) { mobj->sprite = st->sprite; mobj->frame = st->frame; - if ((st->frame & (FF_ANIMATE|FF_MIDDLESTARTCHANCE)) == (FF_ANIMATE|FF_MIDDLESTARTCHANCE)) - mobj->frame += P_RandomKey(st->var1+1); + P_SetupStateAnimation(mobj, st); } // Modified handling. @@ -792,7 +819,7 @@ boolean P_SetMobjStateNF(mobj_t *mobj, statenum_t state) mobj->tics = st->tics; mobj->sprite = st->sprite; mobj->frame = st->frame; - mobj->anim_duration = (UINT16)st->var2; // only used if FF_ANIMATE is set + P_SetupStateAnimation(mobj, st); return true; } @@ -811,7 +838,7 @@ static boolean P_SetPrecipMobjState(precipmobj_t *mobj, statenum_t state) mobj->tics = st->tics; mobj->sprite = st->sprite; mobj->frame = st->frame; - mobj->anim_duration = (UINT16)st->var2; // only used if FF_ANIMATE is set + P_SetupStateAnimation((mobj_t*)mobj, st); return true; } @@ -8009,7 +8036,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) mobj->tics = st->tics; mobj->sprite = st->sprite; mobj->frame = st->frame; // FF_FRAMEMASK for frame, and other bits.. - mobj->anim_duration = (UINT16)st->var2; // only used if FF_ANIMATE is set + P_SetupStateAnimation(mobj, st); mobj->friction = ORIG_FRICTION; @@ -8235,7 +8262,7 @@ static precipmobj_t *P_SpawnPrecipMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype mobj->tics = st->tics; mobj->sprite = st->sprite; mobj->frame = st->frame; // FF_FRAMEMASK for frame, and other bits.. - mobj->anim_duration = (UINT16)st->var2; // only used if FF_ANIMATE is set + P_SetupStateAnimation((mobj_t*)mobj, st); // set subsector and/or block links P_SetPrecipitationThingPosition(mobj); diff --git a/src/p_pspr.h b/src/p_pspr.h index 9420796ff..85489ecc7 100644 --- a/src/p_pspr.h +++ b/src/p_pspr.h @@ -37,14 +37,12 @@ /// \brief Frame flags: only the frame number - 0 to 511 (Frames from 0 to 63, Sprite2 number uses full range) #define FF_FRAMEMASK 0x1ff -/// \brief Frame flags: A change of state at the end of Sprite2 animation + +/// \brief Frame flags - SPR2: A change of state at the end of Sprite2 animation #define FF_SPR2ENDSTATE 0x1000 -/// \brief Frame flags: 50% of starting in middle of animation (Sprite2 and FF_ANIMATE) -#define FF_MIDDLESTARTCHANCE 0x2000 -/// \brief Frame flags: Simple stateless animation -#define FF_ANIMATE 0x4000 -/// \brief Frame flags: frame always appears full bright -#define FF_FULLBRIGHT 0x8000 +/// \brief Frame flags - SPR2: 50% of starting in middle of Sprite2 animation +#define FF_SPR2MIDSTART 0x2000 + /// \brief Frame flags: 0 = no trans(opaque), 1-15 = transl. table #define FF_TRANSMASK 0xf0000 /// \brief shift for FF_TRANSMASK @@ -60,6 +58,16 @@ #define FF_TRANS80 (tr_trans80< Date: Fri, 30 Sep 2016 12:15:22 +0100 Subject: [PATCH 169/808] Tweaks to some sections of the code that recognise what shields the player has. Specifically: * introducing the new friend, SH_FORCEHP (which is used as a bitmask to get the extra hitpoints of a force-shield user) * P_DamageMobj now considers the unimplemented shield constants as well as the implemented ones. --- src/d_player.h | 1 + src/p_inter.c | 14 +++++++++++--- src/p_mobj.c | 4 ++-- src/p_user.c | 4 ++-- src/st_stuff.c | 2 +- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index e80ac387c..c24990eb5 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -196,6 +196,7 @@ typedef enum SH_FIREFLOWER = 0x100, // The force shield uses the lower 8 bits to count how many hits are left. SH_FORCE = 0x200, + SH_FORCEHP = 0xFF, // to be used as a bitmask only SH_STACK = SH_FIREFLOWER, SH_NOSTACK = ~SH_STACK diff --git a/src/p_inter.c b/src/p_inter.c index ece8f25e1..c6f7bb310 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2972,20 +2972,28 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if (!(target->player->pflags & (PF_NIGHTSMODE|PF_NIGHTSFALL)) && (maptol & TOL_NIGHTS)) return false; +#define shieldtype (player->powers[pw_shield] & SH_NOSTACK) switch (damagetype) { case DMG_WATER: + if (shieldtype == SH_BUBBLEWRAP + || shieldtype == SH_ELEMENTAL) + return false; // Invincible to water damage + break; case DMG_FIRE: - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) - return false; // Invincible to water/fire damage + if (shieldtype == SH_FLAMEAURA + || shieldtype == SH_ELEMENTAL) + return false; // Invincible to fire damage break; case DMG_ELECTRIC: - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT) + if (shieldtype == SH_ATTRACT + || shieldtype == SH_THUNDERCOIN) return false; // Invincible to electric damage break; default: break; } +#undef shieldtype } if (player->pflags & PF_NIGHTSMODE) // NiGHTS damage handling diff --git a/src/p_mobj.c b/src/p_mobj.c index 1df1541e9..e40fce499 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6326,9 +6326,9 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) return false; } - if (shield == SH_FORCE && thing->movecount != (thing->target->player->powers[pw_shield] & 0xFF)) + if (shield == SH_FORCE && thing->movecount != (thing->target->player->powers[pw_shield] & SH_FORCEHP)) { - thing->movecount = (thing->target->player->powers[pw_shield] & 0xFF); + thing->movecount = (thing->target->player->powers[pw_shield] & SH_FORCEHP); if (thing->movecount < 1) { if (thing->info->painstate) diff --git a/src/p_user.c b/src/p_user.c index 369e6112e..ca6bb9632 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1392,7 +1392,7 @@ void P_SpawnShieldOrb(player_t *player) if (player->powers[pw_shield] & SH_FORCE) { //Copy and pasted from P_ShieldLook in p_mobj.c - shieldobj->movecount = (player->powers[pw_shield] & 0xFF); + shieldobj->movecount = (player->powers[pw_shield] & SH_FORCEHP); if (shieldobj->movecount < 1) { if (shieldobj->info->painstate) @@ -6950,7 +6950,7 @@ static void P_MovePlayer(player_t *player) #endif dashangle += ANGLE_180; P_ResetPlayer(player); - player->homing = 2 + ((player->powers[pw_shield] & SH_NOSTACK) - SH_FORCE); // might get ridiculous with 256 hitpoints, don't you think? + player->homing = 2 + (player->powers[pw_shield] & SH_FORCEHP); // might get ridiculous with 256 hitpoints, don't you think? S_StartSound(player->mo, sfx_s3k47); P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); player->pflags |= PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY; diff --git a/src/st_stuff.c b/src/st_stuff.c index 43d2bd176..8f36d5128 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -800,7 +800,7 @@ static void ST_drawFirstPersonHUD(void) // Graue 06-18-2004: no V_NOSCALESTART, no SCX, no SCY, snap to right if (player->powers[pw_shield] & SH_FORCE) { - if ((player->powers[pw_shield] & 0xFF) > 0 || leveltime & 1) + if ((player->powers[pw_shield] & SH_FORCEHP) > 0 || leveltime & 1) p = forceshield; } else switch (player->powers[pw_shield] & SH_NOSTACK) From 64e8c8581ec379adf402df121f0729050b0f2fe0 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Fri, 30 Sep 2016 05:04:08 -0700 Subject: [PATCH 170/808] add missing prototypes --- src/p_enemy.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/p_enemy.c b/src/p_enemy.c index 3b598fb8b..d43942d88 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -86,6 +86,9 @@ void A_Scream(mobj_t *actor); void A_Pain(mobj_t *actor); void A_1upThinker(mobj_t *actor); void A_MonitorPop(mobj_t *actor); +void A_GoldMonitorPop(mobj_t *actor); +void A_GoldMonitorRestore(mobj_t *actor); +void A_GoldMonitorSparkle(mobj_t *actor); void A_Explode(mobj_t *actor); void A_BossDeath(mobj_t *actor); void A_CustomPower(mobj_t *actor); From f1fb276e5ac9f91efdd65a7db245aaad83780ca8 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 13:48:33 +0100 Subject: [PATCH 171/808] Fixed a bug where using your shield ability just before your shield changed got you stuck in whatever state it left you. To do that, P_SwitchShield was born! Don't use with Force. --- src/p_enemy.c | 37 +++++++++++++++---------------------- src/p_local.h | 1 + src/p_user.c | 24 ++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 22 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 4c4fa5857..bbdc22116 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3058,11 +3058,7 @@ void A_JumpShield(mobj_t *actor) player = actor->target->player; - if ((player->powers[pw_shield] & SH_NOSTACK) != SH_JUMP) - { - player->powers[pw_shield] = SH_JUMP|(player->powers[pw_shield] & SH_STACK); - P_SpawnShieldOrb(player); - } + P_SwitchShield(player, SH_JUMP); S_StartSound(player->mo, actor->info->seesound); } @@ -3090,11 +3086,7 @@ void A_RingShield(mobj_t *actor) player = actor->target->player; - if ((player->powers[pw_shield] & SH_NOSTACK) != SH_ATTRACT) - { - player->powers[pw_shield] = SH_ATTRACT|(player->powers[pw_shield] & SH_STACK); - P_SpawnShieldOrb(player); - } + P_SwitchShield(player, SH_ATTRACT); S_StartSound(player->mo, actor->info->seesound); } @@ -3296,8 +3288,8 @@ void A_BombShield(mobj_t *actor) P_BlackOw(player); // Now we know for certain that we don't have a bomb shield, so add one. :3 - player->powers[pw_shield] = SH_BOMB|(player->powers[pw_shield] & SH_STACK); - P_SpawnShieldOrb(player); + P_SwitchShield(player, SH_BOMB); + S_StartSound(player->mo, actor->info->seesound); } @@ -3324,11 +3316,7 @@ void A_WaterShield(mobj_t *actor) player = actor->target->player; - if ((player->powers[pw_shield] & SH_NOSTACK) != SH_ELEMENTAL) - { - player->powers[pw_shield] = SH_ELEMENTAL|(player->powers[pw_shield] & SH_STACK); - P_SpawnShieldOrb(player); - } + P_SwitchShield(player, SH_ELEMENTAL); if (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1) P_RestoreMusic(player); @@ -3366,8 +3354,17 @@ void A_ForceShield(mobj_t *actor) player = actor->target->player; + //can't use P_SwitchShield(player, SH_FORCE) - special case + if (!(player->powers[pw_shield] & SH_FORCE)) { + // Just in case. + if (player->pflags & PF_SHIELDABILITY) + { + player->pflags &= ~PF_SHIELDABILITY; + player->homing = 0; + } + player->powers[pw_shield] = SH_FORCE|(player->powers[pw_shield] & SH_STACK)|0x01; P_SpawnShieldOrb(player); } @@ -3404,11 +3401,7 @@ void A_PityShield(mobj_t *actor) player = actor->target->player; - if ((player->powers[pw_shield] & SH_NOSTACK) != SH_PITY) - { - player->powers[pw_shield] = SH_PITY+(player->powers[pw_shield] & SH_STACK); - P_SpawnShieldOrb(player); - } + P_SwitchShield(player, SH_PITY); S_StartSound(player->mo, actor->info->seesound); } diff --git a/src/p_local.h b/src/p_local.h index 3541a3fb0..e64a8dd43 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -142,6 +142,7 @@ boolean P_InQuicksand(mobj_t *mo); void P_SetObjectMomZ(mobj_t *mo, fixed_t value, boolean relative); void P_RestoreMusic(player_t *player); void P_SpawnShieldOrb(player_t *player); +void P_SwitchShield(player_t *player, UINT16 shieldtype); mobj_t *P_SpawnGhostMobj(mobj_t *mobj); void P_GivePlayerRings(player_t *player, INT32 num_rings); void P_GivePlayerLives(player_t *player, INT32 numlives); diff --git a/src/p_user.c b/src/p_user.c index 3f7610add..47e59c211 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1403,6 +1403,30 @@ void P_SpawnShieldOrb(player_t *player) } } +void P_SwitchShield(player_t *player, UINT16 shieldtype) +{ + if ((player->powers[pw_shield] & SH_NOSTACK) != shieldtype) + { + // Just in case. + if (player->pflags & PF_SHIELDABILITY) + { + player->pflags &= ~PF_SPINNING|PF_SHIELDABILITY; // They'll still have PF_THOKKED... + player->homing = 0; + if (player->powers[pw_shield] & SH_FORCE) // Dash. + { + P_SetPlayerMobjState(player->mo, S_PLAY_FALL); + player->mo->flags &= ~MF_NOGRAVITY; + player->pflags &= ~PF_FULLSTASIS; + player->mo->momx >>= 3; + player->mo->momy >>= 3; + } + } + + player->powers[pw_shield] = shieldtype|(player->powers[pw_shield] & SH_STACK); + P_SpawnShieldOrb(player); + } +} + // // P_SpawnGhostMobj // From cbe703478cc484357f84d7a6dfff2384cd6ec559 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 13:56:19 +0100 Subject: [PATCH 172/808] Fixed another bug where you were able to use the whirlwind shield ability after using the force shield's dodge dash. --- src/p_user.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 47e59c211..2deeaf029 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -867,6 +867,8 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor) // Useful when you want to kill everything the player is doing. void P_ResetPlayer(player_t *player) { + pflags_t removelist = (PF_SPINNING|PF_STARTDASH|PF_JUMPED|PF_GLIDING|PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY); + if (player->mo && player->powers[pw_shield] & SH_FORCE // Dash. && player->pflags & PF_SHIELDABILITY) @@ -874,9 +876,10 @@ void P_ResetPlayer(player_t *player) P_SetPlayerMobjState(player->mo, S_PLAY_FALL); player->mo->flags &= ~MF_NOGRAVITY; player->pflags &= ~PF_FULLSTASIS; + removelist &= ~PF_THOKKED; } - player->pflags &= ~(PF_SPINNING|PF_STARTDASH|PF_JUMPED|PF_GLIDING|PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY); + player->pflags &= ~removelist; player->powers[pw_carry] = CR_NONE; player->jumping = 0; player->secondjump = 0; From dc57a34213cb8eb6d63778e1092e93943fb99d92 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 14:06:53 +0100 Subject: [PATCH 173/808] Revert "Fixed another bug where you were able to use the whirlwind shield ability after using the force shield's dodge dash." This reverts commit cbe703478cc484357f84d7a6dfff2384cd6ec559. --- src/p_user.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 2deeaf029..47e59c211 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -867,8 +867,6 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor) // Useful when you want to kill everything the player is doing. void P_ResetPlayer(player_t *player) { - pflags_t removelist = (PF_SPINNING|PF_STARTDASH|PF_JUMPED|PF_GLIDING|PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY); - if (player->mo && player->powers[pw_shield] & SH_FORCE // Dash. && player->pflags & PF_SHIELDABILITY) @@ -876,10 +874,9 @@ void P_ResetPlayer(player_t *player) P_SetPlayerMobjState(player->mo, S_PLAY_FALL); player->mo->flags &= ~MF_NOGRAVITY; player->pflags &= ~PF_FULLSTASIS; - removelist &= ~PF_THOKKED; } - player->pflags &= ~removelist; + player->pflags &= ~(PF_SPINNING|PF_STARTDASH|PF_JUMPED|PF_GLIDING|PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY); player->powers[pw_carry] = CR_NONE; player->jumping = 0; player->secondjump = 0; From 4f79157a50404fc0ad4ca5b6738963fc56bdb6ba Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 14:12:26 +0100 Subject: [PATCH 174/808] Fixed that bug the wrong way, THIS is a much better solution for what I wanted to tweak. --- src/p_user.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/p_user.c b/src/p_user.c index 47e59c211..280b0d489 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7013,6 +7013,7 @@ static void P_MovePlayer(player_t *player) if (player->homing == 0) { P_ResetPlayer(player); + player->pflags |= PF_THOKKED; // silly silly player->mo->momx >>= 3; player->mo->momy >>= 3; } From aa4fca0339252d60cc9d22d54caf9e6ceb74a482 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 14:18:13 +0100 Subject: [PATCH 175/808] Added description to P_SwitchShield. --- src/p_user.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index 280b0d489..4ff39a181 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1403,6 +1403,15 @@ void P_SpawnShieldOrb(player_t *player) } } +// +// P_SwitchShield +// +// Handles the possibility of switching +// between shields thoroughly, then +// adds the desired one. +// +// Not for use if shieldtype would be SH_FORCE. +// void P_SwitchShield(player_t *player, UINT16 shieldtype) { if ((player->powers[pw_shield] & SH_NOSTACK) != shieldtype) From a694ebc348eea2f8bae33ce42d0827c9ce916530 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 14:33:15 +0100 Subject: [PATCH 176/808] Fixed issue where holding spin when going into a non-horizontal spring would use your whirlwind shield ability immediately. --- src/p_user.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 4ff39a181..3659b1e92 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3952,7 +3952,8 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) else if (onground || player->climbing || (player->mo->tracer && player->powers[pw_carry])) {} else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_JUMP - && !(player->pflags & PF_JUMPED)) + && !(player->pflags & PF_JUMPED) + && !(player->pflags & PF_USEDOWN)) P_DoJumpShield(player); else if (!(player->pflags & PF_SLIDING) && ((gametype != GT_CTF) || (!player->gotflag))) { From f6fc99b06dce94e3064cff6c97fd8ab71da299e1 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 14:38:56 +0100 Subject: [PATCH 177/808] How did this disappear? --- src/p_map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_map.c b/src/p_map.c index 8a55bcc1d..b404473d3 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -216,7 +216,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) else if (P_MobjFlip(object)*vertispeed > 0) P_SetPlayerMobjState(object, S_PLAY_SPRING); else if (P_MobjFlip(object)*vertispeed < 0) - P_SetPlayerMobjState(object, S_PLAY_FALL) + P_SetPlayerMobjState(object, S_PLAY_FALL); else // horizontal spring { if (pflags & (PF_JUMPED|PF_SPINNING) && (object->player->panim == PA_ROLL || object->player->panim == PA_JUMP || object->player->panim == PA_FALL)) From cdaab7ec9f527f79c3c07d6cdd8ed887295a0333 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 16:00:34 +0100 Subject: [PATCH 178/808] * Upped speed of info.c's red and yellow horizontal springs * Turn off friction for the one tic after touching a spring --- src/info.c | 4 ++-- src/p_mobj.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/info.c b/src/info.c index 884217611..bbda94afc 100644 --- a/src/info.c +++ b/src/info.c @@ -5610,7 +5610,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 32*FRACUNIT, // height 0, // display offset 0, // mass - 16*FRACUNIT, // damage + 36*FRACUNIT, // damage sfx_None, // activesound MF_SOLID|MF_SPRING|MF_NOGRAVITY, // flags S_YHORIZ2 // raisestate @@ -5637,7 +5637,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 32*FRACUNIT, // height 0, // display offset 0, // mass - 64*FRACUNIT, // damage + 72*FRACUNIT, // damage sfx_None, // activesound MF_SOLID|MF_SPRING|MF_NOGRAVITY, // flags S_RHORIZ2 // raisestate diff --git a/src/p_mobj.c b/src/p_mobj.c index 6f655c15a..988cb2f0e 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1858,7 +1858,7 @@ static void P_XYFriction(mobj_t *mo, fixed_t oldx, fixed_t oldy) mo->momx = player->cmomx; mo->momy = player->cmomy; } - else + else if (!(mo->eflags & MFE_SPRUNG)) { if (oldx == mo->x && oldy == mo->y) // didn't go anywhere { From cad54ee4a9ec01767e23c9a2725037ccb40f3db8 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 16:45:50 +0100 Subject: [PATCH 179/808] SERIOUS Objectplace improvement. * Object number up/down is now assigned to ringslinger weapon next/prev. SO much nicer to use, especially since most people have that stuff bound to the scroll wheel. --- src/m_cheat.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/m_cheat.c b/src/m_cheat.c index 1c5f835cb..1c1b8c6aa 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -1165,23 +1165,17 @@ void OP_ObjectplaceMovement(player_t *player) if (player->pflags & PF_ATTACKDOWN) { // Are ANY objectplace buttons pressed? If no, remove flag. - if (!(cmd->buttons & (BT_ATTACK|BT_TOSSFLAG|BT_CAMRIGHT|BT_CAMLEFT))) + if (!(cmd->buttons & (BT_ATTACK|BT_TOSSFLAG))) player->pflags &= ~PF_ATTACKDOWN; // Do nothing. return; } - if (cmd->buttons & BT_CAMLEFT) - { + if (cmd->buttons & BT_WEAPONPREV) OP_CycleThings(-1); - player->pflags |= PF_ATTACKDOWN; - } - else if (cmd->buttons & BT_CAMRIGHT) - { + else if (cmd->buttons & BT_WEAPONNEXT) OP_CycleThings(1); - player->pflags |= PF_ATTACKDOWN; - } // Place an object and add it to the maplist if (cmd->buttons & BT_ATTACK) @@ -1264,7 +1258,7 @@ void Command_ObjectPlace_f(void) HU_DoCEcho(va(M_GetText( "\\\\\\\\\\\\\\\\\\\\\\\\\x82" " Objectplace Controls: \x80\\\\" - "Camera L/R: Cycle mapthings\\" + "Weapon L/R: Cycle mapthings\\" " Jump: Float up \\" " Spin: Float down \\" " Fire Ring: Place object \\"))); From a2560c52173d9df8d720d46b79cb09daefc3bde9 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 19:40:30 +0100 Subject: [PATCH 180/808] Some tweaks to the devmode overlay. * Plays nicely with showfps on - see http://imgur.com/a/7GzDM for the various cases. * Add PF_THOKKED to the flags in devmode DBG_DETAILED (as "TH"). --- src/screen.c | 5 +++-- src/st_stuff.c | 34 +++++++++++++++++++++------------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/screen.c b/src/screen.c index 376586c5d..2e4f4256b 100644 --- a/src/screen.c +++ b/src/screen.c @@ -411,6 +411,7 @@ void SCR_DisplayTicRate(void) tic_t ontic = I_GetTime(); tic_t totaltics = 0; INT32 ticcntcolor = 0; + INT32 offs = (cv_debug ? 8 : 0); for (i = lasttic + 1; i < TICRATE+lasttic && i < ontic; ++i) fpsgraph[i % TICRATE] = false; @@ -424,9 +425,9 @@ void SCR_DisplayTicRate(void) if (totaltics <= TICRATE/2) ticcntcolor = V_REDMAP; else if (totaltics == TICRATE) ticcntcolor = V_GREENMAP; - V_DrawString(vid.width-(24*vid.dupx), vid.height-(16*vid.dupy), + V_DrawString(vid.width-(24*vid.dupx), vid.height-((16-offs)*vid.dupy), V_YELLOWMAP|V_NOSCALESTART, "FPS"); - V_DrawString(vid.width-(40*vid.dupx), vid.height-( 8*vid.dupy), + V_DrawString(vid.width-((40+(4*offs))*vid.dupx), vid.height-(8*vid.dupy), ticcntcolor|V_NOSCALESTART, va("%02d/%02u", totaltics, TICRATE)); lasttic = ontic; diff --git a/src/st_stuff.c b/src/st_stuff.c index 43d2bd176..d45e005ba 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -546,19 +546,26 @@ static void ST_DrawNightsOverlayNum(INT32 x /* right border */, INT32 y, INT32 a static void ST_drawDebugInfo(void) { INT32 height = 192; + INT32 dist = 8; - if (!stplyr->mo) + if (!(stplyr->mo && cv_debug)) return; + if (cv_ticrate.value) + { + height -= 12; + dist >>= 1; + } + if (cv_debug & DBG_BASIC) { const fixed_t d = AngleFixed(stplyr->mo->angle); - V_DrawRightAlignedString(320, 168, V_MONOSPACE, va("X: %6d", stplyr->mo->x>>FRACBITS)); - V_DrawRightAlignedString(320, 176, V_MONOSPACE, va("Y: %6d", stplyr->mo->y>>FRACBITS)); - V_DrawRightAlignedString(320, 184, V_MONOSPACE, va("Z: %6d", stplyr->mo->z>>FRACBITS)); - V_DrawRightAlignedString(320, 192, V_MONOSPACE, va("A: %6d", FixedInt(d))); + V_DrawRightAlignedString(320, height - 24, V_MONOSPACE, va("X: %6d", stplyr->mo->x>>FRACBITS)); + V_DrawRightAlignedString(320, height - 16, V_MONOSPACE, va("Y: %6d", stplyr->mo->y>>FRACBITS)); + V_DrawRightAlignedString(320, height - 8, V_MONOSPACE, va("Z: %6d", stplyr->mo->z>>FRACBITS)); + V_DrawRightAlignedString(320, height, V_MONOSPACE, va("A: %6d", FixedInt(d))); - height = 152; + height -= (32+dist); } if (cv_debug & DBG_DETAILED) @@ -569,11 +576,12 @@ static void ST_drawDebugInfo(void) V_DrawRightAlignedString(320, height - 80, V_MONOSPACE, va("AIR: %4d, %3d", stplyr->powers[pw_underwater], stplyr->powers[pw_spacetime])); // Flags - V_DrawRightAlignedString(304-64, height - 72, V_MONOSPACE, "Flags:"); - V_DrawString(304-60, height - 72, (stplyr->jumping) ? V_GREENMAP : V_REDMAP, "JM"); - V_DrawString(304-40, height - 72, (stplyr->pflags & PF_JUMPED) ? V_GREENMAP : V_REDMAP, "JD"); - V_DrawString(304-20, height - 72, (stplyr->pflags & PF_SPINNING) ? V_GREENMAP : V_REDMAP, "SP"); - V_DrawString(304, height - 72, (stplyr->pflags & PF_STARTDASH) ? V_GREENMAP : V_REDMAP, "ST"); + V_DrawRightAlignedString(304-84, height - 72, V_MONOSPACE, "Flags:"); + V_DrawString(304-80, height - 72, (stplyr->jumping) ? V_GREENMAP : V_REDMAP, "JM"); + V_DrawString(304-60, height - 72, (stplyr->pflags & PF_JUMPED) ? V_GREENMAP : V_REDMAP, "JD"); + V_DrawString(304-40, height - 72, (stplyr->pflags & PF_SPINNING) ? V_GREENMAP : V_REDMAP, "SP"); + V_DrawString(304-20, height - 72, (stplyr->pflags & PF_STARTDASH) ? V_GREENMAP : V_REDMAP, "ST"); + V_DrawString(304, height - 72, (stplyr->pflags & PF_THOKKED) ? V_GREENMAP : V_REDMAP, "TH"); V_DrawRightAlignedString(320, height - 64, V_MONOSPACE, va("CEILZ: %6d", stplyr->mo->ceilingz>>FRACBITS)); V_DrawRightAlignedString(320, height - 56, V_MONOSPACE, va("FLOORZ: %6d", stplyr->mo->floorz>>FRACBITS)); @@ -587,7 +595,7 @@ static void ST_drawDebugInfo(void) V_DrawRightAlignedString(320, height - 8, V_MONOSPACE, va("MOMZ: %6d", stplyr->mo->momz>>FRACBITS)); V_DrawRightAlignedString(320, height, V_MONOSPACE, va("SPEED: %6d", stplyr->speed>>FRACBITS)); - height -= 120; + height -= (112+dist); } if (cv_debug & DBG_RANDOMIZER) // randomizer testing @@ -600,7 +608,7 @@ static void ST_drawDebugInfo(void) V_DrawRightAlignedString(320, height - 8, V_MONOSPACE, va("Seed: %08x", P_GetRandSeed())); V_DrawRightAlignedString(320, height, V_MONOSPACE, va("== : .%04d", peekres)); - height -= 32; + height -= (24+dist); } if (cv_debug & DBG_MEMORY) From 0d3ee9a109e3968dd1eb5bd71758ab5c2edaa338 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 20:14:23 +0100 Subject: [PATCH 181/808] Weapon rings are limited in how fast they can scroll, so I guess it's okay if objectplace is too - and makes it less awkward for people who do just use normal keys for weapon up/down for some reason. --- src/m_cheat.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/m_cheat.c b/src/m_cheat.c index 1c1b8c6aa..4c44d4b89 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -1165,7 +1165,7 @@ void OP_ObjectplaceMovement(player_t *player) if (player->pflags & PF_ATTACKDOWN) { // Are ANY objectplace buttons pressed? If no, remove flag. - if (!(cmd->buttons & (BT_ATTACK|BT_TOSSFLAG))) + if (!(cmd->buttons & (BT_ATTACK|BT_TOSSFLAG|BT_WEAPONNEXT|BT_WEAPONPREV))) player->pflags &= ~PF_ATTACKDOWN; // Do nothing. @@ -1173,9 +1173,16 @@ void OP_ObjectplaceMovement(player_t *player) } if (cmd->buttons & BT_WEAPONPREV) + { OP_CycleThings(-1); - else if (cmd->buttons & BT_WEAPONNEXT) + player->pflags |= PF_ATTACKDOWN; + } + + if (cmd->buttons & BT_WEAPONNEXT) + { OP_CycleThings(1); + player->pflags |= PF_ATTACKDOWN; + } // Place an object and add it to the maplist if (cmd->buttons & BT_ATTACK) From eb310cc9c7feaf06f69e991e630d8857129a536b Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 20:44:51 +0100 Subject: [PATCH 182/808] On MI's reccomendation, swapped FPS and %d/35's position so that only the description "FPS" moves. http://imgur.com/a/rQogE --- src/screen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/screen.c b/src/screen.c index 2e4f4256b..d00155785 100644 --- a/src/screen.c +++ b/src/screen.c @@ -425,9 +425,9 @@ void SCR_DisplayTicRate(void) if (totaltics <= TICRATE/2) ticcntcolor = V_REDMAP; else if (totaltics == TICRATE) ticcntcolor = V_GREENMAP; - V_DrawString(vid.width-(24*vid.dupx), vid.height-((16-offs)*vid.dupy), + V_DrawString(vid.width-((24+(6*offs))*vid.dupx), vid.height-((16-offs)*vid.dupy), V_YELLOWMAP|V_NOSCALESTART, "FPS"); - V_DrawString(vid.width-((40+(4*offs))*vid.dupx), vid.height-(8*vid.dupy), + V_DrawString(vid.width-(40*vid.dupx), vid.height-(8*vid.dupy), ticcntcolor|V_NOSCALESTART, va("%02d/%02u", totaltics, TICRATE)); lasttic = ontic; From d318db3496c11ea75b62ce8b88b3e06d7ea2ee42 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 21:11:12 +0100 Subject: [PATCH 183/808] Minor offset adjustments. --- src/st_stuff.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index d45e005ba..67c3752b1 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -573,14 +573,14 @@ static void ST_drawDebugInfo(void) V_DrawRightAlignedString(320, height - 104, V_MONOSPACE, va("SHIELD: %5x", stplyr->powers[pw_shield])); V_DrawRightAlignedString(320, height - 96, V_MONOSPACE, va("SCALE: %5d%%", (stplyr->mo->scale*100)/FRACUNIT)); V_DrawRightAlignedString(320, height - 88, V_MONOSPACE, va("DASH: %3d/%3d", stplyr->dashspeed>>FRACBITS, stplyr->maxdash>>FRACBITS)); - V_DrawRightAlignedString(320, height - 80, V_MONOSPACE, va("AIR: %4d, %3d", stplyr->powers[pw_underwater], stplyr->powers[pw_spacetime])); + V_DrawRightAlignedString(320, height - 80, V_MONOSPACE, va("AIR:%4d, %3d", stplyr->powers[pw_underwater], stplyr->powers[pw_spacetime])); // Flags - V_DrawRightAlignedString(304-84, height - 72, V_MONOSPACE, "Flags:"); - V_DrawString(304-80, height - 72, (stplyr->jumping) ? V_GREENMAP : V_REDMAP, "JM"); - V_DrawString(304-60, height - 72, (stplyr->pflags & PF_JUMPED) ? V_GREENMAP : V_REDMAP, "JD"); - V_DrawString(304-40, height - 72, (stplyr->pflags & PF_SPINNING) ? V_GREENMAP : V_REDMAP, "SP"); - V_DrawString(304-20, height - 72, (stplyr->pflags & PF_STARTDASH) ? V_GREENMAP : V_REDMAP, "ST"); + V_DrawRightAlignedString(304-74, height - 72, V_MONOSPACE, "Flags:"); + V_DrawString(304-72, height - 72, (stplyr->jumping) ? V_GREENMAP : V_REDMAP, "JM"); + V_DrawString(304-54, height - 72, (stplyr->pflags & PF_JUMPED) ? V_GREENMAP : V_REDMAP, "JD"); + V_DrawString(304-36, height - 72, (stplyr->pflags & PF_SPINNING) ? V_GREENMAP : V_REDMAP, "SP"); + V_DrawString(304-18, height - 72, (stplyr->pflags & PF_STARTDASH) ? V_GREENMAP : V_REDMAP, "ST"); V_DrawString(304, height - 72, (stplyr->pflags & PF_THOKKED) ? V_GREENMAP : V_REDMAP, "TH"); V_DrawRightAlignedString(320, height - 64, V_MONOSPACE, va("CEILZ: %6d", stplyr->mo->ceilingz>>FRACBITS)); From 490cf0183ad8791649c3683312309767d76e6b57 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 30 Sep 2016 21:47:34 +0100 Subject: [PATCH 184/808] Fixed some mistaken assumptions I made about the devmode overlay, and replaced "Flags" with "PF" to 1) make it clearer what type of flags they are and 2) use less horiontal space --- src/st_stuff.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 67c3752b1..626145847 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -573,10 +573,10 @@ static void ST_drawDebugInfo(void) V_DrawRightAlignedString(320, height - 104, V_MONOSPACE, va("SHIELD: %5x", stplyr->powers[pw_shield])); V_DrawRightAlignedString(320, height - 96, V_MONOSPACE, va("SCALE: %5d%%", (stplyr->mo->scale*100)/FRACUNIT)); V_DrawRightAlignedString(320, height - 88, V_MONOSPACE, va("DASH: %3d/%3d", stplyr->dashspeed>>FRACBITS, stplyr->maxdash>>FRACBITS)); - V_DrawRightAlignedString(320, height - 80, V_MONOSPACE, va("AIR:%4d, %3d", stplyr->powers[pw_underwater], stplyr->powers[pw_spacetime])); + V_DrawRightAlignedString(320, height - 80, V_MONOSPACE, va("AIR: %4d, %3d", stplyr->powers[pw_underwater], stplyr->powers[pw_spacetime])); // Flags - V_DrawRightAlignedString(304-74, height - 72, V_MONOSPACE, "Flags:"); + V_DrawRightAlignedString(304-74, height - 72, V_MONOSPACE, "PF:"); V_DrawString(304-72, height - 72, (stplyr->jumping) ? V_GREENMAP : V_REDMAP, "JM"); V_DrawString(304-54, height - 72, (stplyr->pflags & PF_JUMPED) ? V_GREENMAP : V_REDMAP, "JD"); V_DrawString(304-36, height - 72, (stplyr->pflags & PF_SPINNING) ? V_GREENMAP : V_REDMAP, "SP"); @@ -613,7 +613,7 @@ static void ST_drawDebugInfo(void) if (cv_debug & DBG_MEMORY) { - V_DrawRightAlignedString(320, height, V_MONOSPACE, va("Heap used: %7sKB", sizeu1(Z_TagsUsage(0, INT32_MAX)>>10))); + V_DrawRightAlignedString(320, height, V_MONOSPACE, va("Heap: %7sKB", sizeu1(Z_TagsUsage(0, INT32_MAX)>>10))); } } From 664cfa2a9d8fd9da9fba94aa44521a5cabcf8c27 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 2 Oct 2016 18:17:23 +0100 Subject: [PATCH 185/808] Disabled MF2_LINKDRAW's ability to work in chains because it required modifying flags2 to prevent infinite loops, and that isn't network safe at all. --- src/r_things.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/r_things.c b/src/r_things.c index fb4499c44..e8aa2956f 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1319,8 +1319,9 @@ static void R_ProjectSprite(mobj_t *thing) if ((thing->flags2 & MF2_LINKDRAW) && thing->tracer) // toast 16/09/16 (SYMMETRY) { - mobj_t *link, *link2; fixed_t linkscale; +#if 0 // support for chains of linkdraw - probably not network safe to modify mobjs during rendering + mobj_t *link, *link2; for (link = thing->tracer; (link->tracer && (link->flags2 & MF2_LINKDRAW)); link = link->tracer) link->flags2 &= ~MF2_LINKDRAW; // to prevent infinite loops, otherwise would just be a ; @@ -1333,6 +1334,10 @@ static void R_ProjectSprite(mobj_t *thing) tr_x = link->x - viewx; tr_y = link->y - viewy; +#else + tr_x = thing->tracer->x - viewx; + tr_y = thing->tracer->y - viewy; +#endif gxt = FixedMul(tr_x, viewcos); gyt = -FixedMul(tr_y, viewsin); tz = gxt-gyt; From 482f60e5bc073e4e9663374f5465ab0d077f095c Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Mon, 3 Oct 2016 00:51:18 -0700 Subject: [PATCH 186/808] warning: suggest parentheses around arithmetic in operand of '|' --- src/p_mobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index cac1c2ccc..fb648c1d5 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -7596,7 +7596,7 @@ void P_MobjThinker(mobj_t *mobj) { // Special case for ALL monitors. // If a box's speed is nonzero, it's allowed to respawn as a WRM/SRM. - if (mobj->info->speed != 0 && (mobj->flags2 & MF2_AMBUSH|MF2_STRONGBOX)) + if (mobj->info->speed != 0 && (mobj->flags2 & (MF2_AMBUSH|MF2_STRONGBOX))) { mobjtype_t spawnchance[64]; INT32 numchoices = 0, i = 0; From c558900c6153e7cfc422e176f3c36e1220762d41 Mon Sep 17 00:00:00 2001 From: Nevur Date: Fri, 7 Oct 2016 18:56:10 +0200 Subject: [PATCH 187/808] Deleted the Add_WallScroller function entirely from code. Removed commented out instance using the function. --- src/p_spec.c | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index 4573a9cd4..178980333 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -6719,33 +6719,6 @@ static void Add_Scroller(INT32 type, fixed_t dx, fixed_t dy, INT32 control, INT3 P_AddThinker(&s->thinker); } -#if 0 -/** Adds a wall scroller. - * Scroll amount is rotated with respect to wall's linedef first, so that - * scrolling towards the wall in a perpendicular direction is translated into - * vertical motion, while scrolling along the wall in a parallel direction is - * translated into horizontal motion. - * - * \param dx x speed of scrolling or its acceleration. - * \param dy y speed of scrolling or its acceleration. - * \param l Line whose front side will scroll. - * \param control Sector whose heights control this scroller's effect - * remotely, or -1 if there is no control sector. - * \param accel Nonzero for an accelerative effect. - * \sa Add_Scroller, P_SpawnScrollers - */ -static void Add_WallScroller(fixed_t dx, fixed_t dy, const line_t *l, INT32 control, INT32 accel) -{ - fixed_t x = abs(l->dx), y = abs(l->dy), d; - if (y > x) - d = x, x = y, y = d; - d = FixedDiv(x, FINESINE((tantoangle[FixedDiv(y, x) >> DBITS] + ANGLE_90) >> ANGLETOFINESHIFT)); - x = -FixedDiv(FixedMul(dy, l->dy) + FixedMul(dx, l->dx), d); - y = -FixedDiv(FixedMul(dx, l->dy) - FixedMul(dy, l->dx), d); - Add_Scroller(sc_side, x, y, control, *l->sidenum, accel, 0); -} -#endif - /** Initializes the scrollers. * * \todo Get rid of all the magic numbers. @@ -6828,7 +6801,7 @@ static void P_SpawnScrollers(void) case 502: for (s = -1; (s = P_FindLineFromLineTag(l, s)) >= 0 ;) if (s != (INT32)i) - Add_Scroller(sc_side, dx, dy, control, lines[s].sidenum[0], accel, 0); //Add_WallScroller(dx, dy, lines+s, control, accel); + Add_Scroller(sc_side, dx, dy, control, lines[s].sidenum[0], accel, 0); break; case 505: From 1c23a84aa531b02a1f62b6ea65f1896e249d904a Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 9 Oct 2016 20:55:04 +0100 Subject: [PATCH 188/808] set floorcenterz/ceilingcenterz for all of R_Subsector to use, not just FOF planes --- src/r_bsp.c | 47 ++++++++++++++++++++--------------------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/src/r_bsp.c b/src/r_bsp.c index 69aa7be29..11159db3e 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -859,6 +859,7 @@ static void R_Subsector(size_t num) static sector_t tempsec; // Deep water hack extracolormap_t *floorcolormap; extracolormap_t *ceilingcolormap; + fixed_t floorcenterz, ceilingcenterz; #ifdef RANGECHECK if (num >= numsubsectors) @@ -879,6 +880,18 @@ static void R_Subsector(size_t num) floorcolormap = ceilingcolormap = frontsector->extra_colormap; + floorcenterz = +#ifdef ESLOPE + frontsector->f_slope ? P_GetZAt(frontsector->f_slope, frontsector->soundorg.x, frontsector->soundorg.y) : +#endif + frontsector->floorheight; + + ceilingcenterz = +#ifdef ESLOPE + frontsector->c_slope ? P_GetZAt(frontsector->c_slope, frontsector->soundorg.x, frontsector->soundorg.y) : +#endif + frontsector->ceilingheight; + // Check and prep all 3D floors. Set the sector floor/ceiling light levels and colormaps. if (frontsector->ffloors) { @@ -891,19 +904,11 @@ static void R_Subsector(size_t num) sub->sector->moved = frontsector->moved = false; } - light = R_GetPlaneLight(frontsector, -#ifdef ESLOPE - frontsector->f_slope ? P_GetZAt(frontsector->f_slope, frontsector->soundorg.x, frontsector->soundorg.y) : -#endif - frontsector->floorheight, false); + light = R_GetPlaneLight(frontsector, floorcenterz, false); if (frontsector->floorlightsec == -1) floorlightlevel = *frontsector->lightlist[light].lightlevel; floorcolormap = frontsector->lightlist[light].extra_colormap; - light = R_GetPlaneLight(frontsector, -#ifdef ESLOPE - frontsector->c_slope ? P_GetZAt(frontsector->c_slope, frontsector->soundorg.x, frontsector->soundorg.y) : -#endif - frontsector->ceilingheight, false); + light = R_GetPlaneLight(frontsector, ceilingcenterz, false); if (frontsector->ceilinglightsec == -1) ceilinglightlevel = *frontsector->lightlist[light].lightlevel; ceilingcolormap = frontsector->lightlist[light].extra_colormap; @@ -956,7 +961,7 @@ static void R_Subsector(size_t num) if (frontsector->ffloors) { ffloor_t *rover; - fixed_t heightcheck, planecenterz, floorcenterz, ceilingcenterz; + fixed_t heightcheck, planecenterz; for (rover = frontsector->ffloors; rover && numffloors < MAXFFLOORS; rover = rover->next) { @@ -975,18 +980,6 @@ static void R_Subsector(size_t num) ffloor[numffloors].plane = NULL; ffloor[numffloors].polyobj = NULL; - floorcenterz = -#ifdef ESLOPE - frontsector->f_slope ? P_GetZAt(frontsector->f_slope, frontsector->soundorg.x, frontsector->soundorg.y) : -#endif - frontsector->floorheight; - - ceilingcenterz = -#ifdef ESLOPE - frontsector->c_slope ? P_GetZAt(frontsector->c_slope, frontsector->soundorg.x, frontsector->soundorg.y) : -#endif - frontsector->ceilingheight; - heightcheck = #ifdef ESLOPE *rover->b_slope ? P_GetZAt(*rover->b_slope, viewx, viewy) : @@ -1093,8 +1086,8 @@ static void R_Subsector(size_t num) polysec = po->lines[0]->backsector; ffloor[numffloors].plane = NULL; - if (polysec->floorheight <= frontsector->ceilingheight - && polysec->floorheight >= frontsector->floorheight + if (polysec->floorheight <= ceilingcenterz + && polysec->floorheight >= floorcenterz && (viewz < polysec->floorheight)) { fixed_t xoff, yoff; @@ -1139,8 +1132,8 @@ static void R_Subsector(size_t num) ffloor[numffloors].plane = NULL; - if (polysec->ceilingheight >= frontsector->floorheight - && polysec->ceilingheight <= frontsector->ceilingheight + if (polysec->ceilingheight >= floorcenterz + && polysec->ceilingheight <= ceilingcenterz && (viewz > polysec->ceilingheight)) { fixed_t xoff, yoff; From b66925e467ca6cebbaa78fd21eb3e96898d2c8d2 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 9 Oct 2016 21:48:25 +0100 Subject: [PATCH 189/808] R_FindPlane now has a polyobj argument, R_DrawPlanes now skips polyobj planes, like it does with FOF planes --- src/r_bsp.c | 20 ++++++++++++++++++-- src/r_plane.c | 13 +++++++++++-- src/r_plane.h | 3 +++ 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/r_bsp.c b/src/r_bsp.c index 11159db3e..2562cff66 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -925,6 +925,9 @@ static void R_Subsector(size_t num) { floorplane = R_FindPlane(frontsector->floorheight, frontsector->floorpic, floorlightlevel, frontsector->floor_xoffs, frontsector->floor_yoffs, frontsector->floorpic_angle, floorcolormap, NULL +#ifdef POLYOBJECTS_PLANES + , NULL +#endif #ifdef ESLOPE , frontsector->f_slope #endif @@ -944,6 +947,9 @@ static void R_Subsector(size_t num) ceilingplane = R_FindPlane(frontsector->ceilingheight, frontsector->ceilingpic, ceilinglightlevel, frontsector->ceiling_xoffs, frontsector->ceiling_yoffs, frontsector->ceilingpic_angle, ceilingcolormap, NULL +#ifdef POLYOBJECTS_PLANES + , NULL +#endif #ifdef ESLOPE , frontsector->c_slope #endif @@ -1002,6 +1008,9 @@ static void R_Subsector(size_t num) ffloor[numffloors].plane = R_FindPlane(*rover->bottomheight, *rover->bottompic, *frontsector->lightlist[light].lightlevel, *rover->bottomxoffs, *rover->bottomyoffs, *rover->bottomangle, frontsector->lightlist[light].extra_colormap, rover +#ifdef POLYOBJECTS_PLANES + , NULL +#endif #ifdef ESLOPE , *rover->b_slope #endif @@ -1045,6 +1054,9 @@ static void R_Subsector(size_t num) ffloor[numffloors].plane = R_FindPlane(*rover->topheight, *rover->toppic, *frontsector->lightlist[light].lightlevel, *rover->topxoffs, *rover->topyoffs, *rover->topangle, frontsector->lightlist[light].extra_colormap, rover +#ifdef POLYOBJECTS_PLANES + , NULL +#endif #ifdef ESLOPE , *rover->t_slope #endif @@ -1111,11 +1123,13 @@ static void R_Subsector(size_t num) polysec->floorpic_angle-po->angle, NULL, NULL +#ifdef POLYOBJECTS_PLANES + , po +#endif #ifdef ESLOPE , NULL // will ffloors be slopable eventually? #endif ); - //ffloor[numffloors].plane->polyobj = po; ffloor[numffloors].height = polysec->floorheight; ffloor[numffloors].polyobj = po; @@ -1155,11 +1169,13 @@ static void R_Subsector(size_t num) ffloor[numffloors].plane = R_FindPlane(polysec->ceilingheight, polysec->ceilingpic, polysec->lightlevel, xoff, yoff, polysec->ceilingpic_angle-po->angle, NULL, NULL +#ifdef POLYOBJECTS_PLANES + , po +#endif #ifdef ESLOPE , NULL // will ffloors be slopable eventually? #endif ); - //ffloor[numffloors].plane->polyobj = po; ffloor[numffloors].polyobj = po; ffloor[numffloors].height = polysec->ceilingheight; diff --git a/src/r_plane.c b/src/r_plane.c index 19007d88f..b7b9eaff3 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -431,6 +431,9 @@ static visplane_t *new_visplane(unsigned hash) visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, fixed_t xoff, fixed_t yoff, angle_t plangle, extracolormap_t *planecolormap, ffloor_t *pfloor +#ifdef POLYOBJECTS_PLANES + , polyobj_t *polyobj +#endif #ifdef ESLOPE , pslope_t *slope #endif @@ -470,6 +473,8 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, #ifdef POLYOBJECTS_PLANES if (check->polyobj && pfloor) continue; + if (polyobj != check->polyobj) + continue; #endif if (height == check->height && picnum == check->picnum && lightlevel == check->lightlevel @@ -504,7 +509,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, check->viewangle = viewangle; check->plangle = plangle; #ifdef POLYOBJECTS_PLANES - check->polyobj = NULL; + check->polyobj = polyobj; #endif #ifdef ESLOPE check->slope = slope; @@ -719,7 +724,11 @@ void R_DrawPlanes(void) continue; } - if (pl->ffloor != NULL) + if (pl->ffloor != NULL +#ifdef POLYOBJECTS_PLANES + || pl->polyobj != NULL +#endif + ) continue; R_DrawSinglePlane(pl); diff --git a/src/r_plane.h b/src/r_plane.h index ec1940716..16c8c12a4 100644 --- a/src/r_plane.h +++ b/src/r_plane.h @@ -97,6 +97,9 @@ void R_MakeSpans(INT32 x, INT32 t1, INT32 b1, INT32 t2, INT32 b2); void R_DrawPlanes(void); visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, fixed_t xoff, fixed_t yoff, angle_t plangle, extracolormap_t *planecolormap, ffloor_t *ffloor +#ifdef POLYOBJECTS_PLANES + , polyobj_t *polyobj +#endif #ifdef ESLOPE , pslope_t *slope #endif From ff0b1d1dface10ab11357eee5a0a1fe66ad23403 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 11 Oct 2016 22:35:46 +0100 Subject: [PATCH 190/808] Split polyobj plane drawnode-creating code from ds->maskedtexturecol code, and add plane bounds checking --- src/r_things.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index 22551a02d..ed1ddeab9 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1699,21 +1699,25 @@ static void R_CreateDrawNodes(void) entry->ffloor = ds->thicksides[i]; } } +#ifdef POLYOBJECTS_PLANES + // Check for a polyobject plane, but only if this is a front line + if (ds->curline->polyseg && ds->curline->polyseg->visplane && !ds->curline->side) { + plane = ds->curline->polyseg->visplane; + R_PlaneBounds(plane); + + if (plane->low < con_clipviewtop || plane->high > vid.height || plane->high > plane->low) + ; + else { + // Put it in! + entry = R_CreateDrawNode(&nodehead); + entry->plane = plane; + entry->seg = ds; + } + ds->curline->polyseg->visplane = NULL; + } +#endif if (ds->maskedtexturecol) { -#ifdef POLYOBJECTS_PLANES - // Check for a polyobject plane, but only if this is a front line - if (ds->curline->polyseg && ds->curline->polyseg->visplane && !ds->curline->side) { - // Put it in! - - entry = R_CreateDrawNode(&nodehead); - entry->plane = ds->curline->polyseg->visplane; - entry->seg = ds; - ds->curline->polyseg->visplane->polyobj = ds->curline->polyseg; - ds->curline->polyseg->visplane = NULL; - } -#endif - entry = R_CreateDrawNode(&nodehead); entry->seg = ds; } From 64a1fa54219c9fa2e2fa61fb2b2b68e4fe67f6ce Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 11 Oct 2016 23:35:31 +0100 Subject: [PATCH 191/808] Players are half height in Mario mode when they don't have any shields, the Mario mode pity shield is invisible, and Mario mode players immediately get a pity shield when they lose any other type of shield. So basically that's a Red Mushroom, right? https://gfycat.com/ThoughtfulAcademicChrysalis --- src/d_player.h | 10 +++++----- src/p_enemy.c | 28 ++++++++++++++++------------ src/p_inter.c | 5 ++++- src/p_local.h | 8 +++++--- src/p_user.c | 6 ++++-- src/r_things.c | 13 ++++++++++++- 6 files changed, 46 insertions(+), 24 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index c24990eb5..91520293d 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -192,12 +192,12 @@ typedef enum SH_FLAMEAURA, // Pity shield: the world's most basic shield ever, given to players who suck at Match SH_PITY, - // The fireflower is special, it combines with other shields. - SH_FIREFLOWER = 0x100, - // The force shield uses the lower 8 bits to count how many hits are left. - SH_FORCE = 0x200, + // The force shield uses the lower 8 bits to count how many extra hits are left. + SH_FORCE = 0x100, SH_FORCEHP = 0xFF, // to be used as a bitmask only - + // The fireflower is special... + SH_FIREFLOWER = 0x200, + // ...it can combine with other shields. SH_STACK = SH_FIREFLOWER, SH_NOSTACK = ~SH_STACK } shieldtype_t; // pw_shield diff --git a/src/p_enemy.c b/src/p_enemy.c index 5ab83b4a8..80372ce5f 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3058,9 +3058,9 @@ void A_JumpShield(mobj_t *actor) player = actor->target->player; - P_SwitchShield(player, SH_JUMP); - S_StartSound(player->mo, actor->info->seesound); + + P_SwitchShield(player, SH_JUMP); } // Function: A_RingShield @@ -3086,9 +3086,9 @@ void A_RingShield(mobj_t *actor) player = actor->target->player; - P_SwitchShield(player, SH_ATTRACT); - S_StartSound(player->mo, actor->info->seesound); + + P_SwitchShield(player, SH_ATTRACT); } // Function: A_RingBox @@ -3287,10 +3287,10 @@ void A_BombShield(mobj_t *actor) if ((player->powers[pw_shield] & SH_NOSTACK) == SH_BOMB) P_BlackOw(player); + S_StartSound(player->mo, actor->info->seesound); + // Now we know for certain that we don't have a bomb shield, so add one. :3 P_SwitchShield(player, SH_BOMB); - - S_StartSound(player->mo, actor->info->seesound); } // Function: A_WaterShield @@ -3316,6 +3316,8 @@ void A_WaterShield(mobj_t *actor) player = actor->target->player; + S_StartSound(player->mo, actor->info->seesound); + P_SwitchShield(player, SH_ELEMENTAL); if (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1) @@ -3328,7 +3330,6 @@ void A_WaterShield(mobj_t *actor) player->powers[pw_spacetime] = 0; P_RestoreMusic(player); } - S_StartSound(player->mo, actor->info->seesound); } // Function: A_ForceShield @@ -3354,6 +3355,8 @@ void A_ForceShield(mobj_t *actor) player = actor->target->player; + S_StartSound(player->mo, actor->info->seesound); + //can't use P_SwitchShield(player, SH_FORCE) - special case if (!(player->powers[pw_shield] & SH_FORCE)) @@ -3370,8 +3373,6 @@ void A_ForceShield(mobj_t *actor) } else player->powers[pw_shield] = SH_FORCE|(player->powers[pw_shield] & SH_STACK)|0x01; - - S_StartSound(player->mo, actor->info->seesound); } // Function: A_PityShield @@ -3401,9 +3402,11 @@ void A_PityShield(mobj_t *actor) player = actor->target->player; - P_SwitchShield(player, SH_PITY); - S_StartSound(player->mo, actor->info->seesound); + + if (player->powers[pw_shield] && mariomode) return; + + P_SwitchShield(player, SH_PITY); } @@ -3429,9 +3432,10 @@ void A_GravityBox(mobj_t *actor) } player = actor->target->player; - player->powers[pw_gravityboots] = (UINT16)(actor->info->reactiontime + 1); S_StartSound(player, actor->info->activesound); + + player->powers[pw_gravityboots] = (UINT16)(actor->info->reactiontime + 1); } // Function: A_ScoreRise diff --git a/src/p_inter.c b/src/p_inter.c index 992141fb0..8ae97b831 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2735,9 +2735,10 @@ static inline void P_SuperDamage(player_t *player, mobj_t *inflictor, mobj_t *so void P_RemoveShield(player_t *player) { + boolean willbetallmario = (mariomode && ((player->powers[pw_shield] & SH_NOSTACK) != SH_PITY)); if (player->powers[pw_shield] & SH_FORCE) { // Multi-hit - if ((player->powers[pw_shield] & 0xFF) == 0) + if ((player->powers[pw_shield] & SH_FORCEHP) == 0) player->powers[pw_shield] &= ~SH_FORCE; else player->powers[pw_shield]--; @@ -2759,6 +2760,8 @@ void P_RemoveShield(player_t *player) } else player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK; + if (willbetallmario && !player->powers[pw_shield]) + player->powers[pw_shield] |= SH_PITY; } static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage) diff --git a/src/p_local.h b/src/p_local.h index e64a8dd43..09848aa51 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -59,11 +59,13 @@ #define AIMINGTOSLOPE(aiming) FINESINE((aiming>>ANGLETOFINESHIFT) & FINEMASK) -#define mariomode (maptol & TOL_MARIO) #define twodlevel (maptol & TOL_2D) -#define P_GetPlayerHeight(player) FixedMul(player->height, player->mo->scale) -#define P_GetPlayerSpinHeight(player) FixedMul(player->spinheight, player->mo->scale) +#define mariomode (maptol & TOL_MARIO) +#define shortmario(player) ((player && mariomode && !player->powers[pw_shield]) ? 1 : 0) + +#define P_GetPlayerHeight(player) (FixedMul(player->height, player->mo->scale) >> shortmario(player)) +#define P_GetPlayerSpinHeight(player) (FixedMul(player->spinheight, player->mo->scale) >> shortmario(player)) // // P_TICK diff --git a/src/p_user.c b/src/p_user.c index 177b8a2a7..2f076f59b 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1367,6 +1367,8 @@ void P_SpawnShieldOrb(player_t *player) P_RemoveMobj(shieldobj); //kill the old one(s) } + if (orbtype == MT_PITYORB && mariomode) return; + shieldobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, orbtype); P_SetTarget(&shieldobj->target, player->mo); shieldobj->color = (UINT8)shieldobj->info->painchance; @@ -8102,7 +8104,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall camstill = cv_cam_still.value; camrotate = cv_cam_rotate.value; camdist = FixedMul(cv_cam_dist.value, FixedMul(player->camerascale, mo->scale)); - camheight = FixedMul(cv_cam_height.value, FixedMul(player->camerascale, mo->scale)); + camheight = FixedMul(cv_cam_height.value, FixedMul(player->camerascale >> shortmario(player), mo->scale)); } else // Camera 2 { @@ -8110,7 +8112,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall camstill = cv_cam2_still.value; camrotate = cv_cam2_rotate.value; camdist = FixedMul(cv_cam2_dist.value, FixedMul(player->camerascale, mo->scale)); - camheight = FixedMul(cv_cam2_height.value, FixedMul(player->camerascale, mo->scale)); + camheight = FixedMul(cv_cam2_height.value, FixedMul(player->camerascale >> shortmario(player), mo->scale)); } if (player->powers[pw_shield] & SH_FORCE && player->pflags & PF_SHIELDABILITY) diff --git a/src/r_things.c b/src/r_things.c index e8aa2956f..18ec1570c 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1128,6 +1128,8 @@ static void R_ProjectSprite(mobj_t *thing) fixed_t offset, offset2; boolean papersprite = !!(thing->frame & FF_PAPERSPRITE); + fixed_t shortmarioshift = shortmario(thing->player); + INT32 dispoffset = thing->info->dispoffset; //SoM: 3/17/2000 @@ -1317,6 +1319,12 @@ static void R_ProjectSprite(mobj_t *thing) xscale = FixedMul(xscale, ang_scale); + if (shortmarioshift) + { + yscale >>= shortmarioshift; + this_scale /= 2; + } + if ((thing->flags2 & MF2_LINKDRAW) && thing->tracer) // toast 16/09/16 (SYMMETRY) { fixed_t linkscale; @@ -1377,6 +1385,9 @@ static void R_ProjectSprite(mobj_t *thing) gz = gzt - FixedMul(spritecachedinfo[lump].height, this_scale); } + if (shortmarioshift) + this_scale *= 2; + if (thing->subsector->sector->cullheight) { if (R_DoCulling(thing->subsector->sector->cullheight, viewsector->cullheight, viewz, gz, gzt)) @@ -1442,7 +1453,7 @@ static void R_ProjectSprite(mobj_t *thing) vis->thingheight = thing->height; vis->pz = thing->z; vis->pzt = vis->pz + vis->thingheight; - vis->texturemid = vis->gzt - viewz; + vis->texturemid = (vis->gzt - viewz) << shortmarioshift; vis->scalestep = scalestep; vis->mobj = thing; // Easy access! Tails 06-07-2002 From a842d96a48c6f979d6c89027ffb38c4474f7e299 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 11 Oct 2016 23:35:31 +0100 Subject: [PATCH 192/808] Forgot to commit this change when moving everything over to shortmarioshifts. --- src/r_things.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index 18ec1570c..13688740d 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1322,7 +1322,7 @@ static void R_ProjectSprite(mobj_t *thing) if (shortmarioshift) { yscale >>= shortmarioshift; - this_scale /= 2; + this_scale >>= shortmarioshift; } if ((thing->flags2 & MF2_LINKDRAW) && thing->tracer) // toast 16/09/16 (SYMMETRY) @@ -1386,7 +1386,7 @@ static void R_ProjectSprite(mobj_t *thing) } if (shortmarioshift) - this_scale *= 2; + this_scale <<= shortmarioshift; if (thing->subsector->sector->cullheight) { From d4f0afa0d1689d91dccc1a85552ac73613c3d034 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 12 Oct 2016 17:55:07 +0100 Subject: [PATCH 193/808] A Heckloada Mario Stuff https://gfycat.com/MasculineSatisfiedAfricanwilddog and https://gfycat.com/PastCompetentGypsymoth describe this all in varying states of completion --- src/d_player.h | 1 + src/p_enemy.c | 6 +++ src/p_inter.c | 27 ++++++++-- src/p_local.h | 2 + src/p_mobj.c | 43 +++++++++++++++- src/p_user.c | 130 +++++++++++++++++++++++++++---------------------- src/r_things.c | 14 +++--- 7 files changed, 154 insertions(+), 69 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 91520293d..1fa101e12 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -227,6 +227,7 @@ typedef enum pw_underwater, // underwater timer pw_spacetime, // In space, no one can hear you spin! pw_extralife, // Extra Life timer + pw_marioflashing, // Getting/losing powerup pw_super, // Are you super? pw_gravityboots, // gravity boots diff --git a/src/p_enemy.c b/src/p_enemy.c index 80372ce5f..104e53f1e 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3359,6 +3359,12 @@ void A_ForceShield(mobj_t *actor) //can't use P_SwitchShield(player, SH_FORCE) - special case + if (mariomode && player->mo) + { + player->mo->movecount = player->powers[pw_shield]; + player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + } + if (!(player->powers[pw_shield] & SH_FORCE)) { // Just in case. diff --git a/src/p_inter.c b/src/p_inter.c index 8ae97b831..9c8885411 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -142,7 +142,7 @@ boolean P_CanPickupItem(player_t *player, boolean weapon) if (player->bot && weapon) return false; - if (player->powers[pw_flashing] > (flashingtics/4)*3 && player->powers[pw_flashing] <= flashingtics) + if (player->powers[pw_flashing] > (flashingtics/4)*3 && player->powers[pw_flashing] < UINT16_MAX) return false; return true; @@ -1138,6 +1138,13 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) case MT_FIREFLOWER: if (player->bot) return; + if (mariomode) + { + toucher->movecount = player->powers[pw_shield]; + player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_PITY) + player->powers[pw_shield] &= SH_NOSTACK; + } player->powers[pw_shield] |= SH_FIREFLOWER; toucher->color = SKINCOLOR_WHITE; G_GhostAddColor(GHC_FIREFLOWER); @@ -1204,6 +1211,15 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) S_StartSound(toucher, special->info->painsound); + if (mariomode && !player->powers[pw_shield]) + { + S_StartSound(toucher, sfx_mario3); + player->mo->movecount = player->powers[pw_shield]; + player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + player->powers[pw_shield] = SH_PITY; + P_SpawnShieldOrb(player); + } + if (!(netgame && circuitmap && player != &players[consoleplayer])) P_SetMobjState(special, special->info->painstate); return; @@ -1997,6 +2013,9 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget } target->flags2 &= ~MF2_DONTDRAW; + + if (mariomode) + target->player->powers[pw_marioflashing] = MARIOFLASHINGTICS; } // if killed by a player @@ -2773,7 +2792,9 @@ static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2); - if (source && (source->type == MT_SPIKE || (source->type == MT_NULL && source->threshold == 43))) // spikes + if (mariomode) + S_StartSound(player->mo, sfx_mario8); + else if (source && (source->type == MT_SPIKE || (source->type == MT_NULL && source->threshold == 43))) // spikes S_StartSound(player->mo, sfx_spkdth); else S_StartSound (player->mo, sfx_shldls); // Ba-Dum! Shield loss. @@ -3134,7 +3155,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da else { player->health -= damage; // mirror mobj health here - target->player->powers[pw_flashing] = flashingtics; + //target->player->powers[pw_flashing] = flashingtics; if (damage > 0) // don't spill emeralds/ammo/panels for shield damage P_PlayerRingBurst(player, damage); } diff --git a/src/p_local.h b/src/p_local.h index 09848aa51..041a2150d 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -64,6 +64,8 @@ #define mariomode (maptol & TOL_MARIO) #define shortmario(player) ((player && mariomode && !player->powers[pw_shield]) ? 1 : 0) +#define MARIOFLASHINGTICS 19 + #define P_GetPlayerHeight(player) (FixedMul(player->height, player->mo->scale) >> shortmario(player)) #define P_GetPlayerSpinHeight(player) (FixedMul(player->spinheight, player->mo->scale) >> shortmario(player)) diff --git a/src/p_mobj.c b/src/p_mobj.c index 1ae64bc60..95403995b 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4061,6 +4061,40 @@ static void P_PlayerMobjThinker(mobj_t *mobj) I_Assert(mobj->player != NULL); I_Assert(!P_MobjWasRemoved(mobj)); + if (mobj->player->powers[pw_marioflashing]) + { + if (!mobj->player->powers[pw_nocontrol]++) + mobj->player->powers[pw_nocontrol]++; + + if (!(mobj->player->powers[pw_marioflashing] % 4)) + { + UINT16 shieldswitch = mobj->player->powers[pw_shield]; + mobj->player->powers[pw_shield] = mobj->movecount; + mobj->movecount = shieldswitch; + if ((mobj->player->powers[pw_shield] & SH_FIREFLOWER) != (mobj->movecount & SH_FIREFLOWER)) + { + if (mobj->player->powers[pw_shield] & SH_FIREFLOWER) + { + mobj->color = SKINCOLOR_WHITE; + G_GhostAddColor(GHC_FIREFLOWER); + } + else + { + mobj->color = mobj->player->skincolor; + G_GhostAddColor(GHC_NORMAL); + } + } + if (mobj->player->powers[pw_shield] & SH_NOSTACK && (mobj->player->powers[pw_shield] & SH_NOSTACK) != (mobj->movecount & SH_NOSTACK)) + P_SpawnShieldOrb(mobj->player); + } + + mobj->player->powers[pw_marioflashing]--; + if (mobj->player->powers[pw_flashing] && mobj->player->powers[pw_flashing] < UINT16_MAX && mobj->player->powers[pw_flashing] > flashingtics) + if (--(mobj->player->powers[pw_flashing]) == flashingtics) + mobj->player->powers[pw_flashing]--; + return; + } + P_MobjCheckWater(mobj); #ifdef ESLOPE @@ -6380,9 +6414,9 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) thing->x = thing->target->x; thing->y = thing->target->y; if (thing->eflags & MFE_VERTICALFLIP) - thing->z = thing->target->z + thing->target->height - thing->height + FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT) - FixedMul(2*FRACUNIT, thing->target->scale); + thing->z = thing->target->z + ((thing->target->height - thing->height + FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT)) << shortmario(thing->target->player)) - FixedMul(2*FRACUNIT, thing->target->scale); else - thing->z = thing->target->z - FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT) + FixedMul(2*FRACUNIT, thing->target->scale); + thing->z = thing->target->z - ((FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT)) << shortmario(thing->target->player)) + FixedMul(2*FRACUNIT, thing->target->scale); P_SetThingPosition(thing); P_CheckPosition(thing, thing->x, thing->y); @@ -7091,6 +7125,11 @@ void P_MobjThinker(mobj_t *mobj) break; case MT_PLAYER: /// \todo Have the player's dead body completely finish its animation even if they've already respawned. + if (mobj->player && mobj->player->powers[pw_marioflashing]) + { + mobj->player->powers[pw_marioflashing]--; + return; // don't do any momz + } if (!(mobj->flags2 & MF2_DONTDRAW)) { if (!mobj->fuse) diff --git a/src/p_user.c b/src/p_user.c index 2f076f59b..1589d308a 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -790,59 +790,65 @@ boolean P_PlayerInPain(player_t *player) // void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor) { - angle_t ang; - fixed_t fallbackspeed; - - if (player->mo->eflags & MFE_VERTICALFLIP) - player->mo->z--; - else - player->mo->z++; - - if (player->mo->eflags & MFE_UNDERWATER) - P_SetObjectMomZ(player->mo, FixedDiv(10511*FRACUNIT,2600*FRACUNIT), false); - else - P_SetObjectMomZ(player->mo, FixedDiv(69*FRACUNIT,10*FRACUNIT), false); - - if (inflictor) - { - ang = R_PointToAngle2(inflictor->x-inflictor->momx, inflictor->y - inflictor->momy, player->mo->x - player->mo->momx, player->mo->y - player->mo->momy); - - // explosion and rail rings send you farther back, making it more difficult - // to recover - if ((inflictor->flags2 & MF2_SCATTER) && source) - { - fixed_t dist = P_AproxDistance(P_AproxDistance(source->x-player->mo->x, source->y-player->mo->y), source->z-player->mo->z); - - dist = FixedMul(128*FRACUNIT, inflictor->scale) - dist/4; - - if (dist < FixedMul(4*FRACUNIT, inflictor->scale)) - dist = FixedMul(4*FRACUNIT, inflictor->scale); - - fallbackspeed = dist; - } - else if (inflictor->flags2 & MF2_EXPLOSION) - { - if (inflictor->flags2 & MF2_RAILRING) - fallbackspeed = FixedMul(38*FRACUNIT, inflictor->scale); // 7x - else - fallbackspeed = FixedMul(30*FRACUNIT, inflictor->scale); // 5x - } - else if (inflictor->flags2 & MF2_RAILRING) - fallbackspeed = FixedMul(45*FRACUNIT, inflictor->scale); // 4x - else - fallbackspeed = FixedMul(4*FRACUNIT, inflictor->scale); // the usual amount of force - } - else - { - ang = R_PointToAngle2(player->mo->momx, player->mo->momy, 0, 0); - fallbackspeed = FixedMul(4*FRACUNIT, player->mo->scale); - } - - P_InstaThrust(player->mo, ang, fallbackspeed); - if (player->powers[pw_carry] == CR_ROPEHANG) P_SetTarget(&player->mo->tracer, NULL); + if (!mariomode) + { + angle_t ang; + fixed_t fallbackspeed; + + P_ResetPlayer(player); + P_SetPlayerMobjState(player->mo, player->mo->info->painstate); + + if (player->mo->eflags & MFE_VERTICALFLIP) + player->mo->z--; + else + player->mo->z++; + + if (player->mo->eflags & MFE_UNDERWATER) + P_SetObjectMomZ(player->mo, FixedDiv(10511*FRACUNIT,2600*FRACUNIT), false); + else + P_SetObjectMomZ(player->mo, FixedDiv(69*FRACUNIT,10*FRACUNIT), false); + + if (inflictor) + { + ang = R_PointToAngle2(inflictor->x-inflictor->momx, inflictor->y - inflictor->momy, player->mo->x - player->mo->momx, player->mo->y - player->mo->momy); + + // explosion and rail rings send you farther back, making it more difficult + // to recover + if ((inflictor->flags2 & MF2_SCATTER) && source) + { + fixed_t dist = P_AproxDistance(P_AproxDistance(source->x-player->mo->x, source->y-player->mo->y), source->z-player->mo->z); + + dist = FixedMul(128*FRACUNIT, inflictor->scale) - dist/4; + + if (dist < FixedMul(4*FRACUNIT, inflictor->scale)) + dist = FixedMul(4*FRACUNIT, inflictor->scale); + + fallbackspeed = dist; + } + else if (inflictor->flags2 & MF2_EXPLOSION) + { + if (inflictor->flags2 & MF2_RAILRING) + fallbackspeed = FixedMul(38*FRACUNIT, inflictor->scale); // 7x + else + fallbackspeed = FixedMul(30*FRACUNIT, inflictor->scale); // 5x + } + else if (inflictor->flags2 & MF2_RAILRING) + fallbackspeed = FixedMul(45*FRACUNIT, inflictor->scale); // 4x + else + fallbackspeed = FixedMul(4*FRACUNIT, inflictor->scale); // the usual amount of force + } + else + { + ang = R_PointToAngle2(player->mo->momx, player->mo->momy, 0, 0); + fallbackspeed = FixedMul(4*FRACUNIT, player->mo->scale); + } + + P_InstaThrust(player->mo, ang, fallbackspeed); + } + // Point penalty for hitting a hazard during tag. // Discourages players from intentionally hurting themselves to avoid being tagged. if (gametype == GT_TAG && (!(player->pflags & PF_TAGGED) && !(player->pflags & PF_TAGIT))) @@ -853,9 +859,13 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor) player->score = 0; } - P_ResetPlayer(player); - P_SetPlayerMobjState(player->mo, player->mo->info->painstate); player->powers[pw_flashing] = flashingtics; + if (mariomode) + { + player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + player->powers[pw_flashing] += MARIOFLASHINGTICS; + player->mo->movecount = player->powers[pw_shield]; + } if (player->timeshit != UINT8_MAX) ++player->timeshit; @@ -1416,6 +1426,12 @@ void P_SpawnShieldOrb(player_t *player) // void P_SwitchShield(player_t *player, UINT16 shieldtype) { + if (mariomode && player->mo) + { + player->mo->movecount = player->powers[pw_shield]; + player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + player->powers[pw_nocontrol] += MARIOFLASHINGTICS; + } if ((player->powers[pw_shield] & SH_NOSTACK) != shieldtype) { // Just in case. @@ -8104,7 +8120,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall camstill = cv_cam_still.value; camrotate = cv_cam_rotate.value; camdist = FixedMul(cv_cam_dist.value, FixedMul(player->camerascale, mo->scale)); - camheight = FixedMul(cv_cam_height.value, FixedMul(player->camerascale >> shortmario(player), mo->scale)); + camheight = FixedMul(cv_cam_height.value, FixedMul(player->camerascale, mo->scale)); } else // Camera 2 { @@ -8112,7 +8128,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall camstill = cv_cam2_still.value; camrotate = cv_cam2_rotate.value; camdist = FixedMul(cv_cam2_dist.value, FixedMul(player->camerascale, mo->scale)); - camheight = FixedMul(cv_cam2_height.value, FixedMul(player->camerascale >> shortmario(player), mo->scale)); + camheight = FixedMul(cv_cam2_height.value, FixedMul(player->camerascale, mo->scale)); } if (player->powers[pw_shield] & SH_FORCE && player->pflags & PF_SHIELDABILITY) @@ -8532,9 +8548,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall dist = FixedHypot(f1, f2); if (mo->eflags & MFE_VERTICALFLIP) - angle = R_PointToAngle2(0, thiscam->z + thiscam->height, dist, mo->z + mo->height - P_GetPlayerHeight(player)); + angle = R_PointToAngle2(0, thiscam->z + thiscam->height, dist, mo->z + mo->height - (P_GetPlayerHeight(player) << shortmario(player))); else - angle = R_PointToAngle2(0, thiscam->z, dist, mo->z + P_GetPlayerHeight(player)); + angle = R_PointToAngle2(0, thiscam->z, dist, mo->z + (P_GetPlayerHeight(player) << shortmario(player))); if (player->playerstate != PST_DEAD) angle += (focusaiming < ANGLE_180 ? focusaiming/2 : InvAngle(InvAngle(focusaiming)/2)); // overcomplicated version of '((signed)focusaiming)/2;' @@ -9268,7 +9284,7 @@ void P_PlayerThink(player_t *player) player->losstime--; // Flash player after being hit. - if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < flashingtics && (leveltime & 1)) + if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < flashingtics && (leveltime & 1) && !player->powers[pw_marioflashing]) player->mo->flags2 |= MF2_DONTDRAW; else player->mo->flags2 &= ~MF2_DONTDRAW; diff --git a/src/r_things.c b/src/r_things.c index 13688740d..823dda3ac 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1319,12 +1319,6 @@ static void R_ProjectSprite(mobj_t *thing) xscale = FixedMul(xscale, ang_scale); - if (shortmarioshift) - { - yscale >>= shortmarioshift; - this_scale >>= shortmarioshift; - } - if ((thing->flags2 & MF2_LINKDRAW) && thing->tracer) // toast 16/09/16 (SYMMETRY) { fixed_t linkscale; @@ -1370,6 +1364,12 @@ static void R_ProjectSprite(mobj_t *thing) return; } + if (shortmarioshift) // squish mario + { + yscale >>= shortmarioshift; + this_scale >>= shortmarioshift; + } + //SoM: 3/17/2000: Disregard sprites that are out of view.. if (vflip) { @@ -1385,7 +1385,7 @@ static void R_ProjectSprite(mobj_t *thing) gz = gzt - FixedMul(spritecachedinfo[lump].height, this_scale); } - if (shortmarioshift) + if (shortmarioshift) // unsquish the x component this_scale <<= shortmarioshift; if (thing->subsector->sector->cullheight) From 71b7db4e0dfc017b6407a71ba73abd21983e2d09 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 12 Oct 2016 22:06:12 +0100 Subject: [PATCH 194/808] Refinements to flashing. --- src/p_local.h | 2 +- src/p_mobj.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/p_local.h b/src/p_local.h index 041a2150d..b1c9366c5 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -64,7 +64,7 @@ #define mariomode (maptol & TOL_MARIO) #define shortmario(player) ((player && mariomode && !player->powers[pw_shield]) ? 1 : 0) -#define MARIOFLASHINGTICS 19 +#define MARIOFLASHINGTICS 21 #define P_GetPlayerHeight(player) (FixedMul(player->height, player->mo->scale) >> shortmario(player)) #define P_GetPlayerSpinHeight(player) (FixedMul(player->spinheight, player->mo->scale) >> shortmario(player)) diff --git a/src/p_mobj.c b/src/p_mobj.c index 95403995b..de544362c 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4066,7 +4066,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj) if (!mobj->player->powers[pw_nocontrol]++) mobj->player->powers[pw_nocontrol]++; - if (!(mobj->player->powers[pw_marioflashing] % 4)) + if (!((--mobj->player->powers[pw_marioflashing] - 1) % 5)) { UINT16 shieldswitch = mobj->player->powers[pw_shield]; mobj->player->powers[pw_shield] = mobj->movecount; @@ -4088,7 +4088,6 @@ static void P_PlayerMobjThinker(mobj_t *mobj) P_SpawnShieldOrb(mobj->player); } - mobj->player->powers[pw_marioflashing]--; if (mobj->player->powers[pw_flashing] && mobj->player->powers[pw_flashing] < UINT16_MAX && mobj->player->powers[pw_flashing] > flashingtics) if (--(mobj->player->powers[pw_flashing]) == flashingtics) mobj->player->powers[pw_flashing]--; From dff9209bd2260a29bece503235764095b8cd7a3e Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 12 Oct 2016 22:06:40 +0100 Subject: [PATCH 195/808] A fix for the thing where you can get stuck inside a Mario block that has a monitor in it. --- src/p_floor.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/p_floor.c b/src/p_floor.c index 8f51698cc..220b87572 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -1782,8 +1782,8 @@ static mobj_t *SearchMarioNode(msecnode_t *node) break; } // Ignore popped monitors, too. - if (node->m_thing->flags & MF_MONITOR - && node->m_thing->threshold == 68) + if (node->m_thing->health == 0 // this only really applies for monitors + || (!(node->m_thing->flags & MF_MONITOR) && (mobjinfo[node->m_thing->type].flags & MF_MONITOR))) // gold monitor support continue; // Okay, we found something valid. if (!thing // take either the first thing @@ -3156,15 +3156,15 @@ INT32 EV_MarioBlock(sector_t *sec, sector_t *roversector, fixed_t topheight, mob S_StartSound(puncher, sfx_mario9); // Puncher is "close enough" } - if (itsamonitor) + if (itsamonitor && thing) { - P_UnsetThingPosition(tmthing); - tmthing->x = oldx; - tmthing->y = oldy; - tmthing->z = oldz; - tmthing->momx = 1; - tmthing->momy = 1; - P_SetThingPosition(tmthing); + P_UnsetThingPosition(thing); + thing->x = oldx; + thing->y = oldy; + thing->z = oldz; + thing->momx = 1; + thing->momy = 1; + P_SetThingPosition(thing); } } else From a36912baef77220d62c88cbfd114c993ff594765 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 12 Oct 2016 23:47:18 +0100 Subject: [PATCH 196/808] In Mario mode... * shields give you 1000 points * redundant shields don't make you puase * checkpoints give you 2000 points * falling down a deathpit is just falling, not bouncing --- src/info.c | 2 +- src/p_enemy.c | 55 +++++++++++++++++++++------------ src/p_inter.c | 85 +++++++++++++++++++++++++++++++++------------------ src/p_local.h | 4 +-- src/p_mobj.c | 2 +- src/p_user.c | 21 ++++++++++--- 6 files changed, 111 insertions(+), 58 deletions(-) diff --git a/src/info.c b/src/info.c index f7ff3f13d..c27a606fb 100644 --- a/src/info.c +++ b/src/info.c @@ -12236,7 +12236,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // missilestate S_NULL, // deathstate S_NULL, // xdeathstate - sfx_mario3, // deathsound + sfx_None, // deathsound 0, // speed 16*FRACUNIT, // radius 32*FRACUNIT, // height diff --git a/src/p_enemy.c b/src/p_enemy.c index 104e53f1e..dccc6a8ea 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3058,9 +3058,10 @@ void A_JumpShield(mobj_t *actor) player = actor->target->player; - S_StartSound(player->mo, actor->info->seesound); - - P_SwitchShield(player, SH_JUMP); + if (P_SwitchShield(player, SH_JUMP)) + S_StartSound(player->mo, actor->info->seesound); + else if (mariomode) + S_StartSound(player->mo, sfx_itemup); } // Function: A_RingShield @@ -3086,9 +3087,10 @@ void A_RingShield(mobj_t *actor) player = actor->target->player; - S_StartSound(player->mo, actor->info->seesound); - - P_SwitchShield(player, SH_ATTRACT); + if (P_SwitchShield(player, SH_ATTRACT)) + S_StartSound(player->mo, actor->info->seesound); + else if (mariomode) + S_StartSound(player->mo, sfx_itemup); } // Function: A_RingBox @@ -3287,10 +3289,9 @@ void A_BombShield(mobj_t *actor) if ((player->powers[pw_shield] & SH_NOSTACK) == SH_BOMB) P_BlackOw(player); - S_StartSound(player->mo, actor->info->seesound); - // Now we know for certain that we don't have a bomb shield, so add one. :3 - P_SwitchShield(player, SH_BOMB); + P_SwitchShield(player, SH_BOMB); // will never return false, so no need for sound test + S_StartSound(player->mo, actor->info->seesound); } // Function: A_WaterShield @@ -3316,9 +3317,10 @@ void A_WaterShield(mobj_t *actor) player = actor->target->player; - S_StartSound(player->mo, actor->info->seesound); - - P_SwitchShield(player, SH_ELEMENTAL); + if (P_SwitchShield(player, SH_ELEMENTAL)) + S_StartSound(player->mo, actor->info->seesound); + else if (mariomode) + S_StartSound(player->mo, sfx_itemup); if (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1) P_RestoreMusic(player); @@ -3355,18 +3357,23 @@ void A_ForceShield(mobj_t *actor) player = actor->target->player; - S_StartSound(player->mo, actor->info->seesound); - //can't use P_SwitchShield(player, SH_FORCE) - special case - if (mariomode && player->mo) + if (mariomode) { - player->mo->movecount = player->powers[pw_shield]; - player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + mobj_t *scoremobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + (player->mo->height / 2), MT_SCORE); + P_SetMobjState(scoremobj, mobjinfo[MT_SCORE].spawnstate+3); // 1000 + P_AddPlayerScore(player, 1000); } if (!(player->powers[pw_shield] & SH_FORCE)) { + if (mariomode) + { + player->mo->movecount = player->powers[pw_shield]; + player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + } + // Just in case. if (player->pflags & PF_SHIELDABILITY) { @@ -3376,9 +3383,14 @@ void A_ForceShield(mobj_t *actor) player->powers[pw_shield] = SH_FORCE|(player->powers[pw_shield] & SH_STACK)|0x01; P_SpawnShieldOrb(player); + S_StartSound(player->mo, actor->info->seesound); } else + { player->powers[pw_shield] = SH_FORCE|(player->powers[pw_shield] & SH_STACK)|0x01; + if (mariomode) + S_StartSound(player->mo, sfx_itemup); + } } // Function: A_PityShield @@ -3408,11 +3420,14 @@ void A_PityShield(mobj_t *actor) player = actor->target->player; - S_StartSound(player->mo, actor->info->seesound); - - if (player->powers[pw_shield] && mariomode) return; + if (player->powers[pw_shield] && mariomode) + { + S_StartSound(player->mo, sfx_itemup); + return; + } P_SwitchShield(player, SH_PITY); + S_StartSound(player->mo, actor->info->seesound); } diff --git a/src/p_inter.c b/src/p_inter.c index 9c8885411..05f8b3d4e 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1138,6 +1138,20 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) case MT_FIREFLOWER: if (player->bot) return; + { + mobj_t *scoremobj = P_SpawnMobj(toucher->x, toucher->y, toucher->z + (toucher->height / 2), MT_SCORE); + P_SetMobjState(scoremobj, mobjinfo[MT_SCORE].spawnstate+3); // 1000 + P_AddPlayerScore(player, 1000); + } + + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER) + { + S_StartSound(toucher, sfx_itemup); + break; + } + else + S_StartSound(toucher, sfx_mario3); + if (mariomode) { toucher->movecount = player->powers[pw_shield]; @@ -1145,9 +1159,10 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if ((player->powers[pw_shield] & SH_NOSTACK) == SH_PITY) player->powers[pw_shield] &= SH_NOSTACK; } - player->powers[pw_shield] |= SH_FIREFLOWER; + player->powers[pw_shield] |= SH_FIREFLOWER; //= (player->powers[pw_shield] & SH_NOSTACK)|SH_FIREFLOWER; -- perfect implementation, not worth it whilst we only have one stack power toucher->color = SKINCOLOR_WHITE; G_GhostAddColor(GHC_FIREFLOWER); + break; // *************** // @@ -1211,13 +1226,18 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) S_StartSound(toucher, special->info->painsound); - if (mariomode && !player->powers[pw_shield]) + if (mariomode) { - S_StartSound(toucher, sfx_mario3); - player->mo->movecount = player->powers[pw_shield]; - player->powers[pw_marioflashing] = MARIOFLASHINGTICS; - player->powers[pw_shield] = SH_PITY; - P_SpawnShieldOrb(player); + mobj_t *scoremobj = P_SpawnMobj(toucher->x, toucher->y, toucher->z + (toucher->height / 2), MT_SCORE); + P_SetMobjState(scoremobj, mobjinfo[MT_SCORE].spawnstate+7); // 2000 + P_AddPlayerScore(player, 2000); + if (!player->powers[pw_shield]) + { + S_StartSound(toucher, sfx_mario3); + player->mo->movecount = player->powers[pw_shield]; + player->powers[pw_shield] = SH_PITY; + P_SpawnShieldOrb(player); + } } if (!(netgame && circuitmap && player != &players[consoleplayer])) @@ -2013,9 +2033,6 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget } target->flags2 &= ~MF2_DONTDRAW; - - if (mariomode) - target->player->powers[pw_marioflashing] = MARIOFLASHINGTICS; } // if killed by a player @@ -2281,24 +2298,32 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget break; case MT_PLAYER: - target->fuse = TICRATE*3; // timer before mobj disappears from view (even if not an actual player) - target->momx = target->momy = target->momz = 0; - if (damagetype == DMG_DROWNED) // drowned { - target->movedir = damagetype; // we're MOVING the Damage Into anotheR function... Okay, this is a bit of a hack. - if (target->player->charflags & SF_MACHINE) - S_StartSound(target, sfx_fizzle); + boolean mariodeathpit = (mariomode && damagetype == DMG_DEATHPIT); + target->fuse = TICRATE*3; // timer before mobj disappears from view (even if not an actual player) + if (!mariodeathpit) + { + target->player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + target->momx = target->momy = target->momz = 0; + } + if (damagetype == DMG_DROWNED) // drowned + { + target->movedir = damagetype; // we're MOVING the Damage Into anotheR function... Okay, this is a bit of a hack. + if (target->player->charflags & SF_MACHINE) + S_StartSound(target, sfx_fizzle); + else + S_StartSound(target, sfx_drown); + // Don't jump up when drowning + } else - S_StartSound(target, sfx_drown); - // Don't jump up when drowning - } - else - { - P_SetObjectMomZ(target, 14*FRACUNIT, false); - if ((source && source->type == MT_SPIKE) || damagetype == DMG_SPIKE) // Spikes - S_StartSound(target, sfx_spkdth); - else - P_PlayDeathSound(target); + { + if (!mariodeathpit) + P_SetObjectMomZ(target, 14*FRACUNIT, false); + if ((source && source->type == MT_SPIKE) || damagetype == DMG_SPIKE) // Spikes + S_StartSound(target, sfx_spkdth); + else + P_PlayDeathSound(target); + } } break; default: @@ -2656,9 +2681,11 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage) P_PlayerEmeraldBurst(player, false); } - // Get rid of shield - player->powers[pw_shield] = SH_NONE; - player->mo->color = player->skincolor; + if (!mariomode) // Get rid of shield + { + player->powers[pw_shield] = SH_NONE; + player->mo->color = player->skincolor; + } // Get rid of emeralds player->powers[pw_emeralds] = 0; diff --git a/src/p_local.h b/src/p_local.h index b1c9366c5..f10ac2a4d 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -62,7 +62,7 @@ #define twodlevel (maptol & TOL_2D) #define mariomode (maptol & TOL_MARIO) -#define shortmario(player) ((player && mariomode && !player->powers[pw_shield]) ? 1 : 0) +#define shortmario(player) ((player && mariomode && !player->powers[pw_shield] && !objectplacing) ? 1 : 0) #define MARIOFLASHINGTICS 21 @@ -146,7 +146,7 @@ boolean P_InQuicksand(mobj_t *mo); void P_SetObjectMomZ(mobj_t *mo, fixed_t value, boolean relative); void P_RestoreMusic(player_t *player); void P_SpawnShieldOrb(player_t *player); -void P_SwitchShield(player_t *player, UINT16 shieldtype); +boolean P_SwitchShield(player_t *player, UINT16 shieldtype); mobj_t *P_SpawnGhostMobj(mobj_t *mobj); void P_GivePlayerRings(player_t *player, INT32 num_rings); void P_GivePlayerLives(player_t *player, INT32 numlives); diff --git a/src/p_mobj.c b/src/p_mobj.c index de544362c..72b2eaf1d 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3102,7 +3102,7 @@ static void P_PlayerZMovement(mobj_t *mo) if (P_MobjFlip(mo)*mo->momz < 0) // falling { - boolean clipmomz = true; + boolean clipmomz = !(P_CheckDeathPitCollide(mo)); mo->pmomz = 0; // We're on a new floor, don't keep doing platform movement. diff --git a/src/p_user.c b/src/p_user.c index 1589d308a..d81c9e19f 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1424,16 +1424,23 @@ void P_SpawnShieldOrb(player_t *player) // // Not for use if shieldtype would be SH_FORCE. // -void P_SwitchShield(player_t *player, UINT16 shieldtype) +boolean P_SwitchShield(player_t *player, UINT16 shieldtype) { - if (mariomode && player->mo) + if (mariomode) { - player->mo->movecount = player->powers[pw_shield]; - player->powers[pw_marioflashing] = MARIOFLASHINGTICS; - player->powers[pw_nocontrol] += MARIOFLASHINGTICS; + mobj_t *scoremobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + (player->mo->height / 2), MT_SCORE); + P_SetMobjState(scoremobj, mobjinfo[MT_SCORE].spawnstate+3); // 1000 + P_AddPlayerScore(player, 1000); } + if ((player->powers[pw_shield] & SH_NOSTACK) != shieldtype) { + if (mariomode) + { + player->mo->movecount = player->powers[pw_shield]; + player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + } + // Just in case. if (player->pflags & PF_SHIELDABILITY) { @@ -1451,7 +1458,9 @@ void P_SwitchShield(player_t *player, UINT16 shieldtype) player->powers[pw_shield] = shieldtype|(player->powers[pw_shield] & SH_STACK); P_SpawnShieldOrb(player); + return true; } + return false; } // @@ -6232,6 +6241,8 @@ void P_BlackOw(player_t *player) P_NukeEnemies(player->mo, player->mo, 1536*FRACUNIT); // Search for all nearby enemies and nuke their pants off! player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK; + if (mariomode && !player->powers[pw_shield]) + player->powers[pw_shield] = SH_PITY; } void P_ElementalFire(player_t *player, boolean cropcircle) From 4997564d303213ffe25fa9170c26461edbd82519 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 12 Oct 2016 23:55:16 +0100 Subject: [PATCH 197/808] I like this timing more. --- src/p_local.h | 2 +- src/p_mobj.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_local.h b/src/p_local.h index f10ac2a4d..4568fe4d8 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -64,7 +64,7 @@ #define mariomode (maptol & TOL_MARIO) #define shortmario(player) ((player && mariomode && !player->powers[pw_shield] && !objectplacing) ? 1 : 0) -#define MARIOFLASHINGTICS 21 +#define MARIOFLASHINGTICS TICRATE/2 #define P_GetPlayerHeight(player) (FixedMul(player->height, player->mo->scale) >> shortmario(player)) #define P_GetPlayerSpinHeight(player) (FixedMul(player->spinheight, player->mo->scale) >> shortmario(player)) diff --git a/src/p_mobj.c b/src/p_mobj.c index 72b2eaf1d..50a80ebea 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4066,7 +4066,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj) if (!mobj->player->powers[pw_nocontrol]++) mobj->player->powers[pw_nocontrol]++; - if (!((--mobj->player->powers[pw_marioflashing] - 1) % 5)) + if (!(--mobj->player->powers[pw_marioflashing] % 4)) { UINT16 shieldswitch = mobj->player->powers[pw_shield]; mobj->player->powers[pw_shield] = mobj->movecount; From 80300ac476d08d478fc609c80451d4ca99f56480 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 198/808] Fireflower is now on same level as all other shields, as opposed to being an additional stack layer. (MID LECTURE COMMIT STRATS YO) --- src/d_player.h | 7 +++---- src/dehacked.c | 2 +- src/p_enemy.c | 7 +++++++ src/p_inter.c | 20 +++++++++----------- src/p_local.h | 4 ++-- src/p_mobj.c | 19 ++++++------------- src/p_user.c | 24 ++++++++++++++++++------ src/r_things.c | 2 +- 8 files changed, 47 insertions(+), 38 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 1fa101e12..4bdfb9581 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -192,13 +192,12 @@ typedef enum SH_FLAMEAURA, // Pity shield: the world's most basic shield ever, given to players who suck at Match SH_PITY, + // The fireflower used to be stackable with other shields. Not anymore. + SH_FIREFLOWER, // The force shield uses the lower 8 bits to count how many extra hits are left. SH_FORCE = 0x100, SH_FORCEHP = 0xFF, // to be used as a bitmask only - // The fireflower is special... - SH_FIREFLOWER = 0x200, - // ...it can combine with other shields. - SH_STACK = SH_FIREFLOWER, + SH_STACK = 0, //SH_FIREFLOWER, SH_NOSTACK = ~SH_STACK } shieldtype_t; // pw_shield diff --git a/src/dehacked.c b/src/dehacked.c index b6076f872..7e50f1d8d 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7092,8 +7092,8 @@ struct { {"SH_THUNDERCOIN",SH_THUNDERCOIN}, {"SH_FLAMEAURA",SH_FLAMEAURA}, {"SH_PITY",SH_PITY}, + {"SH_FIREFLOWER",SH_FIREFLOWER}, // These ones are special and use the upper bits - {"SH_FIREFLOWER",SH_FIREFLOWER}, // Lower bits are a normal shield stacked on top of the fire flower {"SH_FORCE",SH_FORCE}, // Lower bits are how many hits left, 0 is the last hit // Stack masks {"SH_STACK",SH_STACK}, diff --git a/src/p_enemy.c b/src/p_enemy.c index dccc6a8ea..a519563de 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3381,6 +3381,13 @@ void A_ForceShield(mobj_t *actor) player->homing = 0; } + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER + && !(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) + { + player->mo->color = player->skincolor; + G_GhostAddColor(GHC_NORMAL); + } + player->powers[pw_shield] = SH_FORCE|(player->powers[pw_shield] & SH_STACK)|0x01; P_SpawnShieldOrb(player); S_StartSound(player->mo, actor->info->seesound); diff --git a/src/p_inter.c b/src/p_inter.c index 05f8b3d4e..4d34de374 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1156,12 +1156,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) { toucher->movecount = player->powers[pw_shield]; player->powers[pw_marioflashing] = MARIOFLASHINGTICS; - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_PITY) - player->powers[pw_shield] &= SH_NOSTACK; } - player->powers[pw_shield] |= SH_FIREFLOWER; //= (player->powers[pw_shield] & SH_NOSTACK)|SH_FIREFLOWER; -- perfect implementation, not worth it whilst we only have one stack power - toucher->color = SKINCOLOR_WHITE; - G_GhostAddColor(GHC_FIREFLOWER); + player->powers[pw_shield] = (player->powers[pw_shield] & SH_STACK)|SH_FIREFLOWER; + P_SpawnShieldOrb(player); break; @@ -1235,6 +1232,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) { S_StartSound(toucher, sfx_mario3); player->mo->movecount = player->powers[pw_shield]; + player->powers[pw_marioflashing] = MARIOFLASHINGTICS; player->powers[pw_shield] = SH_PITY; P_SpawnShieldOrb(player); } @@ -2782,6 +2780,7 @@ static inline void P_SuperDamage(player_t *player, mobj_t *inflictor, mobj_t *so void P_RemoveShield(player_t *player) { boolean willbetallmario = (mariomode && ((player->powers[pw_shield] & SH_NOSTACK) != SH_PITY)); + boolean fireflower = ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER); if (player->powers[pw_shield] & SH_FORCE) { // Multi-hit if ((player->powers[pw_shield] & SH_FORCEHP) == 0) @@ -2792,12 +2791,6 @@ void P_RemoveShield(player_t *player) else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_NONE) { // Second layer shields player->powers[pw_shield] = SH_NONE; - // Reset fireflower - if (!player->powers[pw_super]) - { - player->mo->color = player->skincolor; - G_GhostAddColor(GHC_NORMAL); - } } else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_BOMB) // Give them what's coming to them! { @@ -2808,6 +2801,11 @@ void P_RemoveShield(player_t *player) player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK; if (willbetallmario && !player->powers[pw_shield]) player->powers[pw_shield] |= SH_PITY; + if (fireflower && !(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) + { + player->mo->color = player->skincolor; + G_GhostAddColor(GHC_NORMAL); + } } static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage) diff --git a/src/p_local.h b/src/p_local.h index 4568fe4d8..7107432ef 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -62,9 +62,9 @@ #define twodlevel (maptol & TOL_2D) #define mariomode (maptol & TOL_MARIO) -#define shortmario(player) ((player && mariomode && !player->powers[pw_shield] && !objectplacing) ? 1 : 0) +#define shortmario(player) ((player && mariomode && !player->powers[pw_shield]) ? 1 : 0) -#define MARIOFLASHINGTICS TICRATE/2 +#define MARIOFLASHINGTICS 21 #define P_GetPlayerHeight(player) (FixedMul(player->height, player->mo->scale) >> shortmario(player)) #define P_GetPlayerSpinHeight(player) (FixedMul(player->spinheight, player->mo->scale) >> shortmario(player)) diff --git a/src/p_mobj.c b/src/p_mobj.c index 50a80ebea..822f2ef85 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4071,21 +4071,14 @@ static void P_PlayerMobjThinker(mobj_t *mobj) UINT16 shieldswitch = mobj->player->powers[pw_shield]; mobj->player->powers[pw_shield] = mobj->movecount; mobj->movecount = shieldswitch; - if ((mobj->player->powers[pw_shield] & SH_FIREFLOWER) != (mobj->movecount & SH_FIREFLOWER)) - { - if (mobj->player->powers[pw_shield] & SH_FIREFLOWER) - { - mobj->color = SKINCOLOR_WHITE; - G_GhostAddColor(GHC_FIREFLOWER); - } - else - { - mobj->color = mobj->player->skincolor; - G_GhostAddColor(GHC_NORMAL); - } - } if (mobj->player->powers[pw_shield] & SH_NOSTACK && (mobj->player->powers[pw_shield] & SH_NOSTACK) != (mobj->movecount & SH_NOSTACK)) P_SpawnShieldOrb(mobj->player); + if ((mobj->player->powers[pw_shield] & SH_NOSTACK) != SH_FIREFLOWER && (mobj->movecount & SH_NOSTACK) == SH_FIREFLOWER + && !(mobj->player->powers[pw_super] || (mariomode && mobj->player->powers[pw_invulnerability]))) + { + mobj->color = mobj->player->skincolor; + G_GhostAddColor(GHC_NORMAL); + } } if (mobj->player->powers[pw_flashing] && mobj->player->powers[pw_flashing] < UINT16_MAX && mobj->player->powers[pw_flashing] > flashingtics) diff --git a/src/p_user.c b/src/p_user.c index d81c9e19f..ffbff5ed4 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1340,8 +1340,6 @@ void P_SpawnShieldOrb(player_t *player) I_Error("P_SpawnShieldOrb: player->mo is NULL!\n"); #endif - player->pflags &= ~PF_SHIELDABILITY; // Prevent edge cases when switching shields. - if (player->powers[pw_shield] & SH_FORCE) orbtype = MT_BLUEORB; else switch (player->powers[pw_shield] & SH_NOSTACK) @@ -1361,6 +1359,13 @@ void P_SpawnShieldOrb(player_t *player) case SH_PITY: orbtype = MT_PITYORB; break; + case SH_FIREFLOWER: + if (!(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) + { + player->mo->color = SKINCOLOR_WHITE; + G_GhostAddColor(GHC_FIREFLOWER); + } + return; default: return; } @@ -1456,6 +1461,13 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) } } + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER // it's implicit that the new shield isn't a fireflower + && !(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) + { + player->mo->color = player->skincolor; + G_GhostAddColor(GHC_NORMAL); + } + player->powers[pw_shield] = shieldtype|(player->powers[pw_shield] & SH_STACK); P_SpawnShieldOrb(player); return true; @@ -2164,7 +2176,7 @@ static void P_CheckInvincibilityTimer(player_t *player) { if (mariomode) { - if (player->powers[pw_shield] & SH_FIREFLOWER) + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER) { player->mo->color = SKINCOLOR_WHITE; G_GhostAddColor(GHC_FIREFLOWER); @@ -3188,7 +3200,7 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) if (cmd->buttons & BT_ATTACK || cmd->buttons & BT_FIRENORMAL) { - if (!(player->pflags & PF_ATTACKDOWN) && player->powers[pw_shield] & SH_FIREFLOWER && !player->climbing) + if (!(player->pflags & PF_ATTACKDOWN) && (player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER && !player->climbing) { player->pflags |= PF_ATTACKDOWN; P_SpawnPlayerMissile(player->mo, MT_FIREBALL, 0); @@ -3423,7 +3435,7 @@ static void P_DoSuperStuff(player_t *player) P_SpawnShieldOrb(player); // Restore color - if (player->powers[pw_shield] & SH_FIREFLOWER) + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER) { player->mo->color = SKINCOLOR_WHITE; G_GhostAddColor(GHC_FIREFLOWER); @@ -3473,7 +3485,7 @@ static void P_DoSuperStuff(player_t *player) player->powers[pw_super] = 0; // Restore color - if (player->powers[pw_shield] & SH_FIREFLOWER) + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER) { player->mo->color = SKINCOLOR_WHITE; G_GhostAddColor(GHC_FIREFLOWER); diff --git a/src/r_things.c b/src/r_things.c index 823dda3ac..eb1a3cb25 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1128,7 +1128,7 @@ static void R_ProjectSprite(mobj_t *thing) fixed_t offset, offset2; boolean papersprite = !!(thing->frame & FF_PAPERSPRITE); - fixed_t shortmarioshift = shortmario(thing->player); + fixed_t shortmarioshift = (objectplacing ? 0 : shortmario(thing->player)); INT32 dispoffset = thing->info->dispoffset; From a119db3a8581ca22b7fffbe93cb0b6a6c0913db7 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 199/808] Coins are no defense now! (This lecture is boring.) --- src/p_inter.c | 7 ++++++- src/p_user.c | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 4d34de374..a8a826fdf 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -145,6 +145,9 @@ boolean P_CanPickupItem(player_t *player, boolean weapon) if (player->powers[pw_flashing] > (flashingtics/4)*3 && player->powers[pw_flashing] < UINT16_MAX) return false; + if (player->mo && player->mo->health <= 0) + return false; + return true; } @@ -3135,7 +3138,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da P_ShieldDamage(player, inflictor, source, damage); damage = 0; } - else if (player->mo->health > 1) // No shield but have rings. + else if (!mariomode && player->mo->health > 1) // No shield but have rings. { damage = player->mo->health - 1; P_RingDamage(player, inflictor, source, damage, damagetype); @@ -3297,6 +3300,8 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings) // Spill the ammo P_PlayerWeaponAmmoBurst(player); + if (mariomode) return; + for (i = 0; i < num_rings; i++) { INT32 objType = mobjinfo[MT_RING].reactiontime; diff --git a/src/p_user.c b/src/p_user.c index ffbff5ed4..219b82529 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -937,7 +937,7 @@ void P_GivePlayerRings(player_t *player, INT32 num_rings) { INT32 gainlives = 0; - while (player->xtralife < maxXtraLife && player->health > 100 * (player->xtralife+1)) + while ((mariomode || player->xtralife < maxXtraLife) && player->health > 100 * (player->xtralife+1)) { ++gainlives; ++player->xtralife; @@ -949,6 +949,12 @@ void P_GivePlayerRings(player_t *player, INT32 num_rings) P_PlayLivesJingle(player); } } + + if (mariomode && player->health > 100) + { + player->mo->health = 1; + player->health = 1; + } } // From 8f1493e1359a40941a5323d1a7df39a5c7ec20ad Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 200/808] Start big. (He's been on the same powerpoint slide for 30 minutes now.) --- src/g_game.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/g_game.c b/src/g_game.c index 5e45921b7..d90439152 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2196,6 +2196,9 @@ void G_PlayerReborn(INT32 player) p->health = 1; // 0 rings p->panim = PA_IDLE; // standing animation + if (mariomode) + p->powers[pw_shield] = SH_PITY; // start big + if ((netgame || multiplayer) && !p->spectator) p->powers[pw_flashing] = flashingtics-1; // Babysitting deterrent From 5e92ca1a4a613498b2c220d5a6b9c4c2e9da6829 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 201/808] Okay, made the Mushroom a seperate shield instead of a hacked pity shield. This is a lot nicer in general. --- src/d_player.h | 4 +++- src/dehacked.c | 1 + src/g_game.c | 2 +- src/p_enemy.c | 10 +++------- src/p_inter.c | 7 ++----- src/p_user.c | 6 +----- 6 files changed, 11 insertions(+), 19 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 4bdfb9581..8e3f4c904 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -197,7 +197,9 @@ typedef enum // The force shield uses the lower 8 bits to count how many extra hits are left. SH_FORCE = 0x100, SH_FORCEHP = 0xFF, // to be used as a bitmask only - SH_STACK = 0, //SH_FIREFLOWER, + // The mushroom CAN stack with other shields. + SH_MUSHROOM = 0x200, + SH_STACK = SH_MUSHROOM, //|SH_FIREFLOWER, SH_NOSTACK = ~SH_STACK } shieldtype_t; // pw_shield diff --git a/src/dehacked.c b/src/dehacked.c index 7e50f1d8d..3d3a887a7 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7095,6 +7095,7 @@ struct { {"SH_FIREFLOWER",SH_FIREFLOWER}, // These ones are special and use the upper bits {"SH_FORCE",SH_FORCE}, // Lower bits are how many hits left, 0 is the last hit + {"SH_MUSHROOM", SH_MUSHROOM}, // Can stack with other shields // Stack masks {"SH_STACK",SH_STACK}, {"SH_NOSTACK",SH_NOSTACK}, diff --git a/src/g_game.c b/src/g_game.c index d90439152..200a0f45b 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2197,7 +2197,7 @@ void G_PlayerReborn(INT32 player) p->panim = PA_IDLE; // standing animation if (mariomode) - p->powers[pw_shield] = SH_PITY; // start big + p->powers[pw_shield] = SH_MUSHROOM; // start big if ((netgame || multiplayer) && !p->spectator) p->powers[pw_flashing] = flashingtics-1; // Babysitting deterrent diff --git a/src/p_enemy.c b/src/p_enemy.c index a519563de..a2fcd314b 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3427,14 +3427,10 @@ void A_PityShield(mobj_t *actor) player = actor->target->player; - if (player->powers[pw_shield] && mariomode) - { + if (P_SwitchShield(player, SH_PITY)) + S_StartSound(player->mo, actor->info->seesound); + else if (mariomode) S_StartSound(player->mo, sfx_itemup); - return; - } - - P_SwitchShield(player, SH_PITY); - S_StartSound(player->mo, actor->info->seesound); } diff --git a/src/p_inter.c b/src/p_inter.c index a8a826fdf..1baeb6baf 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1160,7 +1160,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) toucher->movecount = player->powers[pw_shield]; player->powers[pw_marioflashing] = MARIOFLASHINGTICS; } - player->powers[pw_shield] = (player->powers[pw_shield] & SH_STACK)|SH_FIREFLOWER; + player->powers[pw_shield] = (mariomode ? SH_MUSHROOM : player->powers[pw_shield] & SH_STACK)|SH_FIREFLOWER; P_SpawnShieldOrb(player); break; @@ -1236,7 +1236,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) S_StartSound(toucher, sfx_mario3); player->mo->movecount = player->powers[pw_shield]; player->powers[pw_marioflashing] = MARIOFLASHINGTICS; - player->powers[pw_shield] = SH_PITY; + player->powers[pw_shield] = SH_MUSHROOM; P_SpawnShieldOrb(player); } } @@ -2782,7 +2782,6 @@ static inline void P_SuperDamage(player_t *player, mobj_t *inflictor, mobj_t *so void P_RemoveShield(player_t *player) { - boolean willbetallmario = (mariomode && ((player->powers[pw_shield] & SH_NOSTACK) != SH_PITY)); boolean fireflower = ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER); if (player->powers[pw_shield] & SH_FORCE) { // Multi-hit @@ -2802,8 +2801,6 @@ void P_RemoveShield(player_t *player) } else player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK; - if (willbetallmario && !player->powers[pw_shield]) - player->powers[pw_shield] |= SH_PITY; if (fireflower && !(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) { player->mo->color = player->skincolor; diff --git a/src/p_user.c b/src/p_user.c index 219b82529..d199c86f7 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1388,8 +1388,6 @@ void P_SpawnShieldOrb(player_t *player) P_RemoveMobj(shieldobj); //kill the old one(s) } - if (orbtype == MT_PITYORB && mariomode) return; - shieldobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, orbtype); P_SetTarget(&shieldobj->target, player->mo); shieldobj->color = (UINT8)shieldobj->info->painchance; @@ -1474,7 +1472,7 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) G_GhostAddColor(GHC_NORMAL); } - player->powers[pw_shield] = shieldtype|(player->powers[pw_shield] & SH_STACK); + player->powers[pw_shield] = shieldtype|(mariomode ? SH_MUSHROOM : player->powers[pw_shield] & SH_STACK); P_SpawnShieldOrb(player); return true; } @@ -6259,8 +6257,6 @@ void P_BlackOw(player_t *player) P_NukeEnemies(player->mo, player->mo, 1536*FRACUNIT); // Search for all nearby enemies and nuke their pants off! player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK; - if (mariomode && !player->powers[pw_shield]) - player->powers[pw_shield] = SH_PITY; } void P_ElementalFire(player_t *player, boolean cropcircle) From 2903180dee45d7d3e0b51f5552e32db110fd8bf7 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 202/808] Treat the loss of the mushroom as a weapon-ring-spilling event in Mario-themed ringslinger, based on comments MI made on IRC about how different mariomode ringslinger would be. --- src/p_inter.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 1baeb6baf..811e32afe 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2677,10 +2677,7 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage) // Burst weapons and emeralds in Match/CTF only if (source && (gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF)) - { P_PlayerRingBurst(player, player->health - 1); - P_PlayerEmeraldBurst(player, false); - } if (!mariomode) // Get rid of shield { @@ -2818,7 +2815,12 @@ static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2); if (mariomode) + { S_StartSound(player->mo, sfx_mario8); + // Burst weapons and emeralds in Match/CTF only + if (!player->powers[pw_shield] && (gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF)) + P_PlayerRingBurst(player, 0); + } else if (source && (source->type == MT_SPIKE || (source->type == MT_NULL && source->threshold == 43))) // spikes S_StartSound(player->mo, sfx_spkdth); else From 91f9770cafa28b9dcc09b36119e10196d507a298 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 203/808] Fixed up the coin-looping. --- src/p_user.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index d199c86f7..7a91f5012 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -950,10 +950,11 @@ void P_GivePlayerRings(player_t *player, INT32 num_rings) } } - if (mariomode && player->health > 100) + if (mariomode && player->health > 100 && !G_RingSlingerGametype() && !G_TagGametype()) { - player->mo->health = 1; - player->health = 1; + player->mo->health = 1 + (player->health - 1) % 100; + player->health = player->mo->health; + player->xtralife = 0; } } From 2d85b146ea3feffc1416669e7d748a72f5fad77c Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 204/808] Messed up the force shield stuff when implementing SH_MUSHROOM. --- src/p_enemy.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index a2fcd314b..6b3793d32 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3368,12 +3368,6 @@ void A_ForceShield(mobj_t *actor) if (!(player->powers[pw_shield] & SH_FORCE)) { - if (mariomode) - { - player->mo->movecount = player->powers[pw_shield]; - player->powers[pw_marioflashing] = MARIOFLASHINGTICS; - } - // Just in case. if (player->pflags & PF_SHIELDABILITY) { @@ -3388,16 +3382,22 @@ void A_ForceShield(mobj_t *actor) G_GhostAddColor(GHC_NORMAL); } - player->powers[pw_shield] = SH_FORCE|(player->powers[pw_shield] & SH_STACK)|0x01; - P_SpawnShieldOrb(player); S_StartSound(player->mo, actor->info->seesound); } - else + else if (mariomode) + S_StartSound(player->mo, sfx_itemup); + + if ((player->powers[pw_shield] & SH_FORCE) && (player->powers[pw_shield] & SH_FORCEHP)) + return; // if you have a force shield with at least 2hp already, let's not go any further. + + if (mariomode) { - player->powers[pw_shield] = SH_FORCE|(player->powers[pw_shield] & SH_STACK)|0x01; - if (mariomode) - S_StartSound(player->mo, sfx_itemup); + player->mo->movecount = player->powers[pw_shield]; + player->powers[pw_marioflashing] = MARIOFLASHINGTICS; } + + player->powers[pw_shield] = SH_FORCE|(mariomode ? SH_MUSHROOM : player->powers[pw_shield] & SH_STACK)|0x01; + P_SpawnShieldOrb(player); } // Function: A_PityShield From 05aefc3edeab94a950597cc9f4901b2623715260 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 205/808] Removed bit of code that'd never run. --- src/p_inter.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 811e32afe..0b2262ab7 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3304,8 +3304,6 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings) for (i = 0; i < num_rings; i++) { INT32 objType = mobjinfo[MT_RING].reactiontime; - if (mariomode) - objType = mobjinfo[MT_COIN].reactiontime; z = player->mo->z; if (player->mo->eflags & MFE_VERTICALFLIP) From 6e47a07a04835e462ead5f84842265292fd301f4 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 206/808] Fixed monitors not making sounds if you had that monitor already and it wasn't mariomode. --- src/p_enemy.c | 12 +++++++----- src/p_user.c | 10 ++++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 6b3793d32..d3434a828 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3060,7 +3060,7 @@ void A_JumpShield(mobj_t *actor) if (P_SwitchShield(player, SH_JUMP)) S_StartSound(player->mo, actor->info->seesound); - else if (mariomode) + else S_StartSound(player->mo, sfx_itemup); } @@ -3089,7 +3089,7 @@ void A_RingShield(mobj_t *actor) if (P_SwitchShield(player, SH_ATTRACT)) S_StartSound(player->mo, actor->info->seesound); - else if (mariomode) + else S_StartSound(player->mo, sfx_itemup); } @@ -3319,7 +3319,7 @@ void A_WaterShield(mobj_t *actor) if (P_SwitchShield(player, SH_ELEMENTAL)) S_StartSound(player->mo, actor->info->seesound); - else if (mariomode) + else S_StartSound(player->mo, sfx_itemup); if (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1) @@ -3384,7 +3384,9 @@ void A_ForceShield(mobj_t *actor) S_StartSound(player->mo, actor->info->seesound); } - else if (mariomode) + else if (!mariomode) + S_StartSound(player->mo, actor->info->seesound); + else S_StartSound(player->mo, sfx_itemup); if ((player->powers[pw_shield] & SH_FORCE) && (player->powers[pw_shield] & SH_FORCEHP)) @@ -3429,7 +3431,7 @@ void A_PityShield(mobj_t *actor) if (P_SwitchShield(player, SH_PITY)) S_StartSound(player->mo, actor->info->seesound); - else if (mariomode) + else S_StartSound(player->mo, sfx_itemup); } diff --git a/src/p_user.c b/src/p_user.c index 7a91f5012..6ae507f0c 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1428,9 +1428,11 @@ void P_SpawnShieldOrb(player_t *player) // // P_SwitchShield // -// Handles the possibility of switching -// between shields thoroughly, then -// adds the desired one. +// Handles the possibility of switching between +// the non-stack layer of shields thoroughly, +// then adds the desired one. +// +// Returns whether to play a normal sound or an itemup. // // Not for use if shieldtype would be SH_FORCE. // @@ -1477,7 +1479,7 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) P_SpawnShieldOrb(player); return true; } - return false; + return (!mariomode); } // From 3aa9d2a1b17ef18552773d9c9c15c5d2d942a0e7 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 207/808] Sonic 3 shields implemented at a basic visual/functional level - no abilities yet. --- src/d_player.h | 8 +- src/dehacked.c | 104 +++++++++- src/hardware/hw_light.c | 6 + src/info.c | 433 ++++++++++++++++++++++++++++++++++++++-- src/info.h | 110 +++++++++- src/p_enemy.c | 90 +++++++++ src/p_floor.c | 15 +- src/p_mobj.c | 17 +- src/p_user.c | 21 +- src/st_stuff.c | 37 ++-- 10 files changed, 779 insertions(+), 62 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 8e3f4c904..77ad34dab 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -186,12 +186,12 @@ typedef enum SH_ATTRACT, SH_ELEMENTAL, SH_BOMB, - // Stupid useless unimplimented Sonic 3 shields - SH_BUBBLEWRAP, - SH_THUNDERCOIN, - SH_FLAMEAURA, // Pity shield: the world's most basic shield ever, given to players who suck at Match SH_PITY, + // Sonic 3 shields + SH_FLAMEAURA, + SH_BUBBLEWRAP, + SH_THUNDERCOIN, // The fireflower used to be stackable with other shields. Not anymore. SH_FIREFLOWER, // The force shield uses the lower 8 bits to count how many extra hits are left. diff --git a/src/dehacked.c b/src/dehacked.c index 3d3a887a7..bd3f8455f 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1687,6 +1687,9 @@ static actionpointer_t actionpointers[] = {{A_WaterShield}, "A_WATERSHIELD"}, {{A_ForceShield}, "A_FORCESHIELD"}, {{A_PityShield}, "A_PITYSHIELD"}, + {{A_FlameShield}, "A_FLAMESHIELD"}, + {{A_BubbleShield}, "A_BUBBLESHIELD"}, + {{A_ThunderShield}, "A_THUNDERSHIELD"}, {{A_GravityBox}, "A_GRAVITYBOX"}, {{A_ScoreRise}, "A_SCORERISE"}, {{A_ParticleSpawn}, "A_PARTICLESPAWN"}, @@ -4908,6 +4911,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_RECYCLER_BOX", "S_SCORE1K_BOX", "S_SCORE10K_BOX", + "S_FLAMEAURA_BOX", + "S_BUBBLEWRAP_BOX", + "S_THUNDERCOIN_BOX", // Gold Repeat Monitor States (one per box) "S_PITY_GOLDBOX", @@ -4920,6 +4926,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_INVULN_GOLDBOX", "S_EGGMAN_GOLDBOX", "S_GRAVITY_GOLDBOX", + "S_FLAMEAURA_GOLDBOX", + "S_BUBBLEWRAP_GOLDBOX", + "S_THUNDERCOIN_GOLDBOX", // Team Ring Boxes (these are special) "S_RING_REDBOX1", @@ -4981,6 +4990,15 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_SCORE10K_ICON1", "S_SCORE10K_ICON2", + "S_FLAMEAURA_ICON1", + "S_FLAMEAURA_ICON2", + + "S_BUBBLEWRAP_ICON1", + "S_BUBBLEWRAP_ICON2", + + "S_THUNDERCOIN_ICON1", + "S_THUNDERCOIN_ICON2", + "S_ROCKET", "S_LASER", @@ -5409,6 +5427,68 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_PITY9", "S_PITY10", + "S_FIRS1", + "S_FIRS2", + "S_FIRS3", + "S_FIRS4", + "S_FIRS5", + "S_FIRS6", + "S_FIRS7", + "S_FIRS8", + "S_FIRS9", + + "S_FIRSB1", + "S_FIRSB2", + "S_FIRSB3", + "S_FIRSB4", + "S_FIRSB5", + "S_FIRSB6", + "S_FIRSB7", + "S_FIRSB8", + "S_FIRSB9", + + "S_BUBS1", + "S_BUBS2", + "S_BUBS3", + "S_BUBS4", + "S_BUBS5", + "S_BUBS6", + "S_BUBS7", + "S_BUBS8", + "S_BUBS9", + + "S_BUBSB1", + "S_BUBSB2", + + "S_ZAPS1", + "S_ZAPS2", + "S_ZAPS3", + "S_ZAPS4", + "S_ZAPS5", + "S_ZAPS6", + "S_ZAPS7", + "S_ZAPS8", + "S_ZAPS9", + "S_ZAPS10", + "S_ZAPS11", + "S_ZAPS12", + "S_ZAPS13", // blank frame + "S_ZAPS14", + "S_ZAPS15", + "S_ZAPS16", + + "S_ZAPSB1", // blank frame + "S_ZAPSB2", + "S_ZAPSB3", + "S_ZAPSB4", + "S_ZAPSB5", + "S_ZAPSB6", + "S_ZAPSB7", + "S_ZAPSB8", + "S_ZAPSB9", + "S_ZAPSB10", + "S_ZAPSB11", // blank frame + // Invincibility Sparkles "S_IVSP", @@ -6231,6 +6311,9 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_RECYCLER_BOX", "MT_SCORE1K_BOX", "MT_SCORE10K_BOX", + "MT_FLAMEAURA_BOX", + "MT_BUBBLEWRAP_BOX", + "MT_THUNDERCOIN_BOX", // Monitor boxes -- repeating (big) boxes "MT_PITY_GOLDBOX", @@ -6243,6 +6326,9 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_INVULN_GOLDBOX", "MT_EGGMAN_GOLDBOX", "MT_GRAVITY_GOLDBOX", + "MT_FLAMEAURA_GOLDBOX", + "MT_BUBBLEWRAP_GOLDBOX", + "MT_THUNDERCOIN_GOLDBOX", // Monitor boxes -- special "MT_RING_REDBOX", @@ -6265,6 +6351,9 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_RECYCLER_ICON", "MT_SCORE1K_ICON", "MT_SCORE10K_ICON", + "MT_FLAMEAURA_ICON", + "MT_BUBBLEWRAP_ICON", + "MT_THUNDERCOIN_ICON", // Projectiles "MT_ROCKET", @@ -6417,12 +6506,15 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_EGGSTATUE2", // Powerup Indicators - "MT_GREENORB", // Elemental shield mobj - "MT_YELLOWORB", // Attract shield mobj - "MT_BLUEORB", // Force shield mobj - "MT_BLACKORB", // Armageddon shield mobj - "MT_WHITEORB", // Whirlwind shield mobj - "MT_PITYORB", // Pity shield mobj + "MT_ELEMENTAL_ORB", // Elemental shield mobj + "MT_ATTRACT_ORB", // Attract shield mobj + "MT_FORCE_ORB", // Force shield mobj + "MT_BOMB_ORB", // Armageddon shield mobj + "MT_JUMP_ORB", // Whirlwind shield mobj + "MT_PITY_ORB", // Pity shield mobj + "MT_FLAMEAURA_ORB", // Flame shield mobj + "MT_BUBBLEWRAP_ORB", // Bubble shield mobj + "MT_THUNDERCOIN_ORB", // Thunder shield mobj "MT_IVSP", // invincibility sparkles "MT_SUPERSPARK", // Super Sonic Spark diff --git a/src/hardware/hw_light.c b/src/hardware/hw_light.c index e79aba735..a73a3462c 100644 --- a/src/hardware/hw_light.c +++ b/src/hardware/hw_light.c @@ -271,6 +271,9 @@ light_t *t_lspr[NUMSPRITES] = &lspr[NOLIGHT], // SPR_TVRC &lspr[NOLIGHT], // SPR_TV1K &lspr[NOLIGHT], // SPR_TVTK + &lspr[NOLIGHT], // SPR_TVFL + &lspr[NOLIGHT], // SPR_TVBB + &lspr[NOLIGHT], // SPR_TVZP // Projectiles &lspr[NOLIGHT], // SPR_MISL @@ -359,6 +362,9 @@ light_t *t_lspr[NUMSPRITES] = &lspr[NOLIGHT], // SPR_ELEM &lspr[NOLIGHT], // SPR_FORC &lspr[NOLIGHT], // SPR_PITY + &lspr[NOLIGHT], // SPR_FIRS + &lspr[NOLIGHT], // SPR_BUBS + &lspr[NOLIGHT], // SPR_ZAPS &lspr[INVINCIBLE_L], // SPR_IVSP &lspr[SUPERSPARK_L], // SPR_SSPK diff --git a/src/info.c b/src/info.c index c27a606fb..85a9589c9 100644 --- a/src/info.c +++ b/src/info.c @@ -159,6 +159,9 @@ char sprnames[NUMSPRITES + 1][5] = "TVRC", // ReCycler "TV1K", // 1,000 points (1 K) "TVTK", // 10,000 points (Ten K) + "TVFL", // FLame shield + "TVBB", // BuBble shield + "TVZP", // Thunder shield (ZaP) // Projectiles "MISL", @@ -243,6 +246,9 @@ char sprnames[NUMSPRITES + 1][5] = "ELEM", // Elemental Shield Orb and Fire "FORC", // Force Shield Orb "PITY", // Pity Shield Orb + "FIRS", // Flame Shield Orb + "BUBS", // Bubble Shield Orb + "ZAPS", // Thunder Shield Orb "IVSP", // invincibility sparkles "SSPK", // Super Sonic Spark @@ -1623,6 +1629,9 @@ state_t states[NUMSTATES] = {SPR_TVRC, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_RECYCLER_BOX {SPR_TV1K, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_SCORE1K_BOX {SPR_TVTK, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_SCORE10K_BOX + {SPR_TVFL, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_FLAMEAURA_BOX + {SPR_TVBB, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_BUBBLEWRAP_BOX + {SPR_TVZP, 0, 2, {NULL}, 0, 0, S_BOX_FLICKER}, // S_THUNDERCOIN_BOX // Gold Repeat Monitor States (one per box) {SPR_TVPI, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_PITY_GOLDBOX @@ -1635,6 +1644,9 @@ state_t states[NUMSTATES] = {SPR_TVIV, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_INVULN_GOLDBOX {SPR_TVEG, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_EGGMAN_GOLDBOX {SPR_TVGV, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_GRAVITY_GOLDBOX + {SPR_TVFL, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_FLAMEAURA_GOLDBOX + {SPR_TVBB, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_BUBBLEWRAP_GOLDBOX + {SPR_TVZP, 1, 2, {A_GoldMonitorSparkle}, 0, 0, S_GOLDBOX_FLICKER}, // S_THUNDERCOIN_GOLDBOX // Team Ring Boxes (these are special) {SPR_TRRI, 0, 2, {NULL}, 0, 0, S_RING_REDBOX2}, // S_RING_REDBOX1 @@ -1696,6 +1708,15 @@ state_t states[NUMSTATES] = {SPR_TVTK, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_SCORE10K_ICON2}, // S_SCORE10K_ICON1 {SPR_TVTK, 2, 18, {A_AwardScore}, 0, 0, S_NULL}, // S_SCORE10K_ICON2 + {SPR_TVFL, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_FLAMEAURA_ICON2}, // S_FLAMEAURA_ICON1 + {SPR_TVFL, 2, 18, {A_FlameShield}, 0, 0, S_NULL}, // S_FLAMEAURA_ICON2 + + {SPR_TVBB, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_BUBBLEWRAP_ICON2}, // S_BUBBLEWRAP_ICON1 + {SPR_TVBB, 2, 18, {A_BubbleShield}, 0, 0, S_NULL}, // S_BUBBLERWAP_ICON2 + + {SPR_TVZP, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_THUNDERCOIN_ICON2}, // S_THUNDERCOIN_ICON1 + {SPR_TVZP, 2, 18, {A_ThunderShield}, 0, 0, S_NULL}, // S_THUNDERCOIN_ICON2 + // --- {SPR_MISL, FF_FULLBRIGHT, 1, {A_SmokeTrailer}, MT_SMOKE, 0, S_ROCKET}, // S_ROCKET @@ -2134,6 +2155,68 @@ state_t states[NUMSTATES] = {SPR_PITY, FF_TRANS20 , 1, {NULL}, 0, 0, S_PITY10}, // S_PITY9 {SPR_PITY, FF_TRANS20|5, 1, {NULL}, 0, 0, S_PITY1 }, // S_PITY10 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40 , 2, {NULL}, 0, 0, S_FIRS2}, // S_FIRS1 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|1, 2, {NULL}, 0, 0, S_FIRS3}, // S_FIRS2 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|2, 2, {NULL}, 0, 0, S_FIRS4}, // S_FIRS3 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|3, 2, {NULL}, 0, 0, S_FIRS5}, // S_FIRS4 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|4, 2, {NULL}, 0, 0, S_FIRS6}, // S_FIRS5 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|5, 2, {NULL}, 0, 0, S_FIRS7}, // S_FIRS6 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|6, 2, {NULL}, 0, 0, S_FIRS8}, // S_FIRS7 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|7, 2, {NULL}, 0, 0, S_FIRS9}, // S_FIRS8 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|8, 2, {NULL}, 0, 0, S_FIRS1}, // S_FIRS9 + + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40| 9, 2, {NULL}, 0, 0, S_FIRSB2}, // S_FIRSB1 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|10, 2, {NULL}, 0, 0, S_FIRSB3}, // S_FIRSB2 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|11, 2, {NULL}, 0, 0, S_FIRSB4}, // S_FIRSB3 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|12, 2, {NULL}, 0, 0, S_FIRSB5}, // S_FIRSB4 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|13, 2, {NULL}, 0, 0, S_FIRSB6}, // S_FIRSB5 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|14, 2, {NULL}, 0, 0, S_FIRSB7}, // S_FIRSB6 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|15, 2, {NULL}, 0, 0, S_FIRSB8}, // S_FIRSB7 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|16, 2, {NULL}, 0, 0, S_FIRSB9}, // S_FIRSB8 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|17, 2, {NULL}, 0, 0, S_FIRSB1}, // S_FIRSB9 + + {SPR_BUBS, FF_TRANS30| 2, 2, {NULL}, 0, 0, S_BUBS2}, // S_BUBS1 + {SPR_BUBS, FF_TRANS30| 3, 2, {NULL}, 0, 0, S_BUBS3}, // S_BUBS2 + {SPR_BUBS, FF_TRANS30| 4, 2, {NULL}, 0, 0, S_BUBS4}, // S_BUBS3 + {SPR_BUBS, FF_TRANS30| 5, 2, {NULL}, 0, 0, S_BUBS5}, // S_BUBS4 + {SPR_BUBS, FF_TRANS30| 6, 2, {NULL}, 0, 0, S_BUBS6}, // S_BUBS5 + {SPR_BUBS, FF_TRANS30| 7, 2, {NULL}, 0, 0, S_BUBS7}, // S_BUBS6 + {SPR_BUBS, FF_TRANS30| 8, 2, {NULL}, 0, 0, S_BUBS8}, // S_BUBS7 + {SPR_BUBS, FF_TRANS30| 9, 2, {NULL}, 0, 0, S_BUBS9}, // S_BUBS8 + {SPR_BUBS, FF_TRANS30|10, 2, {NULL}, 0, 0, S_BUBS1}, // S_BUBS9 + + {SPR_BUBS, FF_TRANS30 , 2, {NULL}, 0, 0, S_BUBSB2}, // S_BUBSB1 + {SPR_BUBS, FF_TRANS30|1, 2, {NULL}, 0, 0, S_BUBSB1}, // S_BUBSB2 + + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20 , 2, {NULL}, 0, 0, S_ZAPS2 }, // S_ZAPS1 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 1, 2, {NULL}, 0, 0, S_ZAPS3 }, // S_ZAPS2 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 2, 2, {NULL}, 0, 0, S_ZAPS4 }, // S_ZAPS3 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 3, 2, {NULL}, 0, 0, S_ZAPS5 }, // S_ZAPS4 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 4, 2, {NULL}, 0, 0, S_ZAPS6 }, // S_ZAPS5 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 5, 2, {NULL}, 0, 0, S_ZAPS7 }, // S_ZAPS6 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 6, 2, {NULL}, 0, 0, S_ZAPS8 }, // S_ZAPS7 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 7, 2, {NULL}, 0, 0, S_ZAPS9 }, // S_ZAPS8 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 8, 2, {NULL}, 0, 0, S_ZAPS10}, // S_ZAPS9 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 9, 2, {NULL}, 0, 0, S_ZAPS11}, // S_ZAPS10 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20|10, 2, {NULL}, 0, 0, S_ZAPS12}, // S_ZAPS11 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20|11, 2, {NULL}, 0, 0, S_ZAPS13}, // S_ZAPS12 + {SPR_NULL, 0, 9*2, {NULL}, 0, 0, S_ZAPS14}, // S_ZAPS13 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 9, 2, {NULL}, 0, 0, S_ZAPS15}, // S_ZAPS14 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20|10, 2, {NULL}, 0, 0, S_ZAPS16}, // S_ZAPS15 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20|11, 2, {NULL}, 0, 0, S_ZAPS1 }, // S_ZAPS16 + + {SPR_NULL, 0, 12*2, {NULL}, 0, 0, S_ZAPSB2 }, // S_ZAPSB1 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 8, 2, {NULL}, 0, 0, S_ZAPSB3 }, // S_ZAPSB2 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 7, 2, {NULL}, 0, 0, S_ZAPSB4 }, // S_ZAPSB3 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 6, 2, {NULL}, 0, 0, S_ZAPSB5 }, // S_ZAPSB4 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 5, 2, {NULL}, 0, 0, S_ZAPSB6 }, // S_ZAPSB5 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 4, 2, {NULL}, 0, 0, S_ZAPSB7 }, // S_ZAPSB6 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 3, 2, {NULL}, 0, 0, S_ZAPSB8 }, // S_ZAPSB7 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 2, 2, {NULL}, 0, 0, S_ZAPSB9 }, // S_ZAPSB8 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 1, 2, {NULL}, 0, 0, S_ZAPSB10}, // S_ZAPSB9 + {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20 , 2, {NULL}, 0, 0, S_ZAPSB11}, // S_ZAPSB10 + {SPR_NULL, 0, 15*2, {NULL}, 0, 0, S_ZAPSB2 }, // S_ZAPSB11 + // Invincibility Sparkles {SPR_IVSP, FF_ANIMATE, 32, {NULL}, 31, 1, S_NULL}, // S_IVSP @@ -6429,6 +6512,87 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_FLAMEAURA_BOX + 420, // doomednum + S_FLAMEAURA_BOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_FLAMEAURA_BOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BOX_POP1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 1, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_FLAMEAURA_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_BUBBLEWRAP_BOX + 421, // doomednum + S_BUBBLEWRAP_BOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_BUBBLEWRAP_BOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BOX_POP1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 1, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_BUBBLEWRAP_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + + { // MT_THUNDERCOIN_BOX + 422, // doomednum + S_THUNDERCOIN_BOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_THUNDERCOIN_BOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_BOX_POP1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 1, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_THUNDERCOIN_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR, // flags + S_NULL // raisestate + }, + { // MT_PITY_GOLDBOX 431, // doomednum S_PITY_GOLDBOX, // spawnstate @@ -6699,6 +6863,87 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_FLAMEAURA_GOLDBOX + 450, // doomednum + S_FLAMEAURA_GOLDBOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_monton, // attacksound + S_FLAMEAURA_GOLDBOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_GOLDBOX_OFF1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 36*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_FLAMEAURA_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags + S_NULL // raisestate + }, + + { // MT_BUBBLEWRAP_GOLDBOX + 451, // doomednum + S_BUBBLEWRAP_GOLDBOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_monton, // attacksound + S_BUBBLEWRAP_GOLDBOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_GOLDBOX_OFF1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 36*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_BUBBLEWRAP_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags + S_NULL // raisestate + }, + + { // MT_THUNDERCOIN_GOLDBOX + 452, // doomednum + S_THUNDERCOIN_GOLDBOX, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_monton, // attacksound + S_THUNDERCOIN_GOLDBOX, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_GOLDBOX_OFF1, // deathstate + S_NULL, // xdeathstate + sfx_pop, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 36*FRACUNIT, // height + 0, // display offset + 100, // mass + MT_THUNDERCOIN_ICON, // damage + sfx_None, // activesound + MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE, // flags + S_NULL // raisestate + }, + { // MT_RING_REDBOX 414, // doomednum S_RING_REDBOX1, // spawnstate @@ -7185,6 +7430,87 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_FLAMEAURA_ICON + -1, // doomednum + S_FLAMEAURA_ICON1, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_shield, // 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 + 2*FRACUNIT, // speed + 8*FRACUNIT, // radius + 14*FRACUNIT, // height + 0, // display offset + 100, // mass + 62*FRACUNIT, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags + S_NULL // raisestate + }, + + { // MT_BUBBLEWRAP_ICON + -1, // doomednum + S_BUBBLEWRAP_ICON1, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_shield, // 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 + 2*FRACUNIT, // speed + 8*FRACUNIT, // radius + 14*FRACUNIT, // height + 0, // display offset + 100, // mass + 62*FRACUNIT, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags + S_NULL // raisestate + }, + + { // MT_THUNDERCOIN_ICON + -1, // doomednum + S_THUNDERCOIN_ICON1, // spawnstate + 1, // spawnhealth + S_NULL, // seestate + sfx_shield, // 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 + 2*FRACUNIT, // speed + 8*FRACUNIT, // radius + 14*FRACUNIT, // height + 0, // display offset + 100, // mass + 62*FRACUNIT, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON, // flags + S_NULL // raisestate + }, + { // MT_ROCKET -1, // doomednum S_ROCKET, // spawnstate @@ -10428,7 +10754,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_GREENORB + { // MT_ELEMENTAL_ORB -1, // doomednum S_ELEM1, // spawnstate 1000, // spawnhealth @@ -10447,7 +10773,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = SH_ELEMENTAL, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height - 1, // display offset + 2, // display offset 16, // mass 0, // damage sfx_None, // activesound @@ -10455,7 +10781,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_YELLOWORB + { // MT_ATTRACT_ORB -1, // doomednum S_MAGN1, // spawnstate 1000, // spawnhealth @@ -10474,7 +10800,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = SH_ATTRACT, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height - 1, // display offset + 2, // display offset 16, // mass 0, // damage sfx_None, // activesound @@ -10482,7 +10808,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_BLUEORB + { // MT_FORCE_ORB -1, // doomednum S_FORC1, // spawnstate 1000, // spawnhealth @@ -10501,7 +10827,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = SH_FORCE, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height - 1, // display offset + 2, // display offset 16, // mass 0, // damage sfx_None, // activesound @@ -10509,7 +10835,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_BLACKORB + { // MT_BOMB_ORB -1, // doomednum S_ARMA1, // spawnstate 1000, // spawnhealth @@ -10528,7 +10854,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = SH_BOMB, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height - 1, // display offset + 2, // display offset 16, // mass 0, // damage sfx_None, // activesound @@ -10536,7 +10862,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_WHITEORB + { // MT_JUMP_ORB -1, // doomednum S_WIND1, // spawnstate 1000, // spawnhealth @@ -10555,7 +10881,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = SH_JUMP, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height - 1, // display offset + 2, // display offset 16, // mass 0, // damage sfx_None, // activesound @@ -10563,7 +10889,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_PITYORB + { // MT_PITY_ORB -1, // doomednum S_PITY1, // spawnstate 1000, // spawnhealth @@ -10582,7 +10908,88 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = SH_PITY, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height - 1, // display offset + 2, // display offset + 16, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags + S_NULL // raisestate + }, + + { // MT_FLAMEAURA_ORB + -1, // doomednum + S_FIRSB1, // spawnstate + 1000, // spawnhealth + S_FIRS1, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + SKINCOLOR_NONE, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + SH_FLAMEAURA, // speed + 64*FRACUNIT, // radius + 64*FRACUNIT, // height + -2, // display offset + 16, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags + S_NULL // raisestate + }, + + { // MT_BUBBLEWRAP_ORB + -1, // doomednum + S_BUBSB1, // spawnstate + 1000, // spawnhealth + S_BUBS1, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + SKINCOLOR_NONE, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + SH_BUBBLEWRAP, // speed + 64*FRACUNIT, // radius + 64*FRACUNIT, // height + -2, // display offset + 16, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags + S_NULL // raisestate + }, + + { // MT_THUNDERCOIN_ORB + -1, // doomednum + S_ZAPSB1, // spawnstate + 1000, // spawnhealth + S_ZAPS1, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + SKINCOLOR_NONE, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + SH_THUNDERCOIN, // speed + 64*FRACUNIT, // radius + 64*FRACUNIT, // height + -2, // display offset 16, // mass 0, // damage sfx_None, // activesound @@ -10609,7 +11016,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 8, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height - 2, // display offset + 3, // display offset 16, // mass 0, // damage sfx_None, // activesound diff --git a/src/info.h b/src/info.h index 16666ed96..638657226 100644 --- a/src/info.h +++ b/src/info.h @@ -56,6 +56,9 @@ void A_BombShield(); // Obtained Bomb Shield void A_WaterShield(); // Obtained Water Shield void A_ForceShield(); // Obtained Force Shield void A_PityShield(); // Obtained Pity Shield. We're... sorry. +void A_FlameShield(); // Obtained Flame Shield +void A_BubbleShield(); // Obtained Bubble Shield +void A_ThunderShield(); // Obtained Thunder Shield void A_GravityBox(); void A_ScoreRise(); // Rise the score logo void A_ParticleSpawn(); @@ -351,6 +354,9 @@ typedef enum sprite SPR_TVRC, // ReCycler SPR_TV1K, // 1,000 points (1 K) SPR_TVTK, // 10,000 points (Ten K) + SPR_TVFL, // FLame shield + SPR_TVBB, // BuBble shield + SPR_TVZP, // Thunder shield (ZaP) // Projectiles SPR_MISL, @@ -435,6 +441,9 @@ typedef enum sprite SPR_ELEM, // Elemental Shield Orb and Fire SPR_FORC, // Force Shield Orb SPR_PITY, // Pity Shield Orb + SPR_FIRS, // Flame Shield Orb + SPR_BUBS, // Bubble Shield Orb + SPR_ZAPS, // Thunder Shield Orb SPR_IVSP, // invincibility sparkles SPR_SSPK, // Super Sonic Spark @@ -1814,6 +1823,9 @@ typedef enum state S_RECYCLER_BOX, S_SCORE1K_BOX, S_SCORE10K_BOX, + S_FLAMEAURA_BOX, + S_BUBBLEWRAP_BOX, + S_THUNDERCOIN_BOX, // Gold Repeat Monitor States (one per box) S_PITY_GOLDBOX, @@ -1826,6 +1838,9 @@ typedef enum state S_INVULN_GOLDBOX, S_EGGMAN_GOLDBOX, S_GRAVITY_GOLDBOX, + S_FLAMEAURA_GOLDBOX, + S_BUBBLEWRAP_GOLDBOX, + S_THUNDERCOIN_GOLDBOX, // Team Ring Boxes (these are special) S_RING_REDBOX1, @@ -1887,6 +1902,15 @@ typedef enum state S_SCORE10K_ICON1, S_SCORE10K_ICON2, + S_FLAMEAURA_ICON1, + S_FLAMEAURA_ICON2, + + S_BUBBLEWRAP_ICON1, + S_BUBBLEWRAP_ICON2, + + S_THUNDERCOIN_ICON1, + S_THUNDERCOIN_ICON2, + // --- S_ROCKET, @@ -2317,6 +2341,68 @@ typedef enum state S_PITY9, S_PITY10, + S_FIRS1, + S_FIRS2, + S_FIRS3, + S_FIRS4, + S_FIRS5, + S_FIRS6, + S_FIRS7, + S_FIRS8, + S_FIRS9, + + S_FIRSB1, + S_FIRSB2, + S_FIRSB3, + S_FIRSB4, + S_FIRSB5, + S_FIRSB6, + S_FIRSB7, + S_FIRSB8, + S_FIRSB9, + + S_BUBS1, + S_BUBS2, + S_BUBS3, + S_BUBS4, + S_BUBS5, + S_BUBS6, + S_BUBS7, + S_BUBS8, + S_BUBS9, + + S_BUBSB1, + S_BUBSB2, + + S_ZAPS1, + S_ZAPS2, + S_ZAPS3, + S_ZAPS4, + S_ZAPS5, + S_ZAPS6, + S_ZAPS7, + S_ZAPS8, + S_ZAPS9, + S_ZAPS10, + S_ZAPS11, + S_ZAPS12, + S_ZAPS13, // blank frame + S_ZAPS14, + S_ZAPS15, + S_ZAPS16, + + S_ZAPSB1, // blank frame + S_ZAPSB2, + S_ZAPSB3, + S_ZAPSB4, + S_ZAPSB5, + S_ZAPSB6, + S_ZAPSB7, + S_ZAPSB8, + S_ZAPSB9, + S_ZAPSB10, + S_ZAPSB11, // blank frame + // Invincibility Sparkles S_IVSP, @@ -3158,6 +3244,9 @@ typedef enum mobj_type MT_RECYCLER_BOX, MT_SCORE1K_BOX, MT_SCORE10K_BOX, + MT_FLAMEAURA_BOX, + MT_BUBBLEWRAP_BOX, + MT_THUNDERCOIN_BOX, // Monitor boxes -- repeating (big) boxes MT_PITY_GOLDBOX, @@ -3170,6 +3259,9 @@ typedef enum mobj_type MT_INVULN_GOLDBOX, MT_EGGMAN_GOLDBOX, MT_GRAVITY_GOLDBOX, + MT_FLAMEAURA_GOLDBOX, + MT_BUBBLEWRAP_GOLDBOX, + MT_THUNDERCOIN_GOLDBOX, // Monitor boxes -- special MT_RING_REDBOX, @@ -3192,6 +3284,9 @@ typedef enum mobj_type MT_RECYCLER_ICON, MT_SCORE1K_ICON, MT_SCORE10K_ICON, + MT_FLAMEAURA_ICON, + MT_BUBBLEWRAP_ICON, + MT_THUNDERCOIN_ICON, // Projectiles MT_ROCKET, @@ -3344,12 +3439,15 @@ typedef enum mobj_type MT_EGGSTATUE2, // Powerup Indicators - MT_GREENORB, // Elemental shield mobj - MT_YELLOWORB, // Attract shield mobj - MT_BLUEORB, // Force shield mobj - MT_BLACKORB, // Armageddon shield mobj - MT_WHITEORB, // Whirlwind shield mobj - MT_PITYORB, // Pity shield mobj + MT_ELEMENTAL_ORB, // Elemental shield mobj + MT_ATTRACT_ORB, // Attract shield mobj + MT_FORCE_ORB, // Force shield mobj + MT_BOMB_ORB, // Armageddon shield mobj + MT_JUMP_ORB, // Whirlwind shield mobj + MT_PITY_ORB, // Pity shield mobj + MT_FLAMEAURA_ORB, // Flame shield mobj + MT_BUBBLEWRAP_ORB, // Bubble shield mobj + MT_THUNDERCOIN_ORB, // Thunder shield mobj MT_IVSP, // invincibility sparkles MT_SUPERSPARK, // Super Sonic Spark diff --git a/src/p_enemy.c b/src/p_enemy.c index d3434a828..7ef87ac44 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -104,6 +104,9 @@ void A_BombShield(mobj_t *actor); void A_WaterShield(mobj_t *actor); void A_ForceShield(mobj_t *actor); void A_PityShield(mobj_t *actor); +void A_FlameShield(mobj_t *actor); +void A_BubbleShield(mobj_t *actor); +void A_ThunderShield(mobj_t *actor); void A_GravityBox(mobj_t *actor); void A_ScoreRise(mobj_t *actor); void A_ParticleSpawn(mobj_t *actor); @@ -3435,6 +3438,93 @@ void A_PityShield(mobj_t *actor) S_StartSound(player->mo, sfx_itemup); } +// Function: A_FlameShield +// +// Description: Awards the player a flame shield. +// +// var1 = unused +// var2 = unused +// +void A_FlameShield(mobj_t *actor) +{ + player_t *player; + +#ifdef HAVE_BLUA + if (LUA_CallAction("A_FlameShield", actor)) + return; +#endif + if (!actor->target || !actor->target->player) + { + CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n"); + return; + } + + player = actor->target->player; + + if (P_SwitchShield(player, SH_FLAMEAURA)) + S_StartSound(player->mo, actor->info->seesound); + else + S_StartSound(player->mo, sfx_itemup); +} + +// Function: A_BubbleShield +// +// Description: Awards the player a bubble shield. +// +// var1 = unused +// var2 = unused +// +void A_BubbleShield(mobj_t *actor) +{ + player_t *player; + +#ifdef HAVE_BLUA + if (LUA_CallAction("A_BubbleShield", actor)) + return; +#endif + if (!actor->target || !actor->target->player) + { + CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n"); + return; + } + + player = actor->target->player; + + if (P_SwitchShield(player, SH_BUBBLEWRAP)) + S_StartSound(player->mo, actor->info->seesound); + else + S_StartSound(player->mo, sfx_itemup); +} + +// Function: A_ThunderShield +// +// Description: Awards the player a thunder shield. +// +// var1 = unused +// var2 = unused +// +void A_ThunderShield(mobj_t *actor) +{ + player_t *player; + +#ifdef HAVE_BLUA + if (LUA_CallAction("A_ThunderShield", actor)) + return; +#endif + if (!actor->target || !actor->target->player) + { + CONS_Debug(DBG_GAMELOGIC, "Powerup has no target.\n"); + return; + } + + player = actor->target->player; + + if (P_SwitchShield(player, SH_THUNDERCOIN)) + S_StartSound(player->mo, actor->info->seesound); + else + S_StartSound(player->mo, sfx_itemup); +} + // Function: A_GravityBox // diff --git a/src/p_floor.c b/src/p_floor.c index 220b87572..3d18cc3bd 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -1748,12 +1748,15 @@ static mobj_t *SearchMarioNode(msecnode_t *node) case MT_GHOST: case MT_OVERLAY: case MT_EMERALDSPAWN: - case MT_GREENORB: - case MT_YELLOWORB: - case MT_BLUEORB: - case MT_BLACKORB: - case MT_WHITEORB: - case MT_PITYORB: + case MT_ELEMENTAL_ORB: + case MT_ATTRACT_ORB: + case MT_FORCE_ORB: + case MT_BOMB_ORB: + case MT_JUMP_ORB: + case MT_PITY_ORB: + case MT_FLAMEAURA_ORB: + case MT_BUBBLEWRAP_ORB: + case MT_THUNDERCOIN_ORB: case MT_IVSP: case MT_SUPERSPARK: case MT_RAIN: diff --git a/src/p_mobj.c b/src/p_mobj.c index 822f2ef85..2cd6b7d77 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6764,7 +6764,7 @@ void P_MobjThinker(mobj_t *mobj) } else P_AddOverlay(mobj); - if ((mobj->target->type == MT_GREENORB) + if ((mobj->target->type == MT_ELEMENTAL_ORB) && (mobj->target->target) && (mobj->target->target->player) && ((mobj->target->target->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) @@ -6775,15 +6775,18 @@ void P_MobjThinker(mobj_t *mobj) mobj->tics++; } break; - case MT_BLACKORB: - case MT_WHITEORB: - case MT_GREENORB: - case MT_BLUEORB: - case MT_PITYORB: + case MT_BOMB_ORB: + case MT_JUMP_ORB: + case MT_ELEMENTAL_ORB: + case MT_FORCE_ORB: + case MT_PITY_ORB: + case MT_FLAMEAURA_ORB: + case MT_BUBBLEWRAP_ORB: + case MT_THUNDERCOIN_ORB: if (!P_AddShield(mobj)) return; break; - case MT_YELLOWORB: + case MT_ATTRACT_ORB: if (!P_AddShield(mobj)) return; if ((mobj->target) diff --git a/src/p_user.c b/src/p_user.c index 6ae507f0c..df28806b6 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1348,23 +1348,32 @@ void P_SpawnShieldOrb(player_t *player) #endif if (player->powers[pw_shield] & SH_FORCE) - orbtype = MT_BLUEORB; + orbtype = MT_FORCE_ORB; else switch (player->powers[pw_shield] & SH_NOSTACK) { case SH_JUMP: - orbtype = MT_WHITEORB; + orbtype = MT_JUMP_ORB; break; case SH_ATTRACT: - orbtype = MT_YELLOWORB; + orbtype = MT_ATTRACT_ORB; break; case SH_ELEMENTAL: - orbtype = MT_GREENORB; + orbtype = MT_ELEMENTAL_ORB; break; case SH_BOMB: - orbtype = MT_BLACKORB; + orbtype = MT_BOMB_ORB; break; case SH_PITY: - orbtype = MT_PITYORB; + orbtype = MT_PITY_ORB; + break; + case SH_FLAMEAURA: + orbtype = MT_FLAMEAURA_ORB; + break; + case SH_BUBBLEWRAP: + orbtype = MT_BUBBLEWRAP_ORB; + break; + case SH_THUNDERCOIN: + orbtype = MT_THUNDERCOIN_ORB; break; case SH_FIREFLOWER: if (!(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) diff --git a/src/st_stuff.c b/src/st_stuff.c index 8f36d5128..08d4204af 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -99,6 +99,9 @@ static patch_t *ringshield; static patch_t *watershield; static patch_t *bombshield; static patch_t *pityshield; +static patch_t *flameshield; +static patch_t *bubbleshield; +static patch_t *thundershield; static patch_t *invincibility; static patch_t *sneakers; static patch_t *gravboots; @@ -288,15 +291,18 @@ void ST_LoadGraphics(void) scatterring = W_CachePatchName("SCATIND", PU_HUDGFX); grenadering = W_CachePatchName("GRENIND", PU_HUDGFX); railring = W_CachePatchName("RAILIND", PU_HUDGFX); - jumpshield = W_CachePatchName("WHTVB0", PU_HUDGFX); - forceshield = W_CachePatchName("BLTVB0", PU_HUDGFX); - ringshield = W_CachePatchName("YLTVB0", PU_HUDGFX); - watershield = W_CachePatchName("ELTVB0", PU_HUDGFX); - bombshield = W_CachePatchName("BKTVB0", PU_HUDGFX); - pityshield = W_CachePatchName("GRTVB0", PU_HUDGFX); - invincibility = W_CachePatchName("PINVB0", PU_HUDGFX); - sneakers = W_CachePatchName("SHTVB0", PU_HUDGFX); - gravboots = W_CachePatchName("GBTVB0", PU_HUDGFX); + jumpshield = W_CachePatchName("TVWWC0", PU_HUDGFX); + forceshield = W_CachePatchName("TVFOC0", PU_HUDGFX); + ringshield = W_CachePatchName("TVATC0", PU_HUDGFX); + watershield = W_CachePatchName("TVELC0", PU_HUDGFX); + bombshield = W_CachePatchName("TVARC0", PU_HUDGFX); + pityshield = W_CachePatchName("TVPIC0", PU_HUDGFX); + flameshield = W_CachePatchName("TVFLC0", PU_HUDGFX); + bubbleshield = W_CachePatchName("TVBBC0", PU_HUDGFX); + thundershield = W_CachePatchName("TVZPC0", PU_HUDGFX); + invincibility = W_CachePatchName("TVIVC0", PU_HUDGFX); + sneakers = W_CachePatchName("TVSSC0", PU_HUDGFX); + gravboots = W_CachePatchName("TVGVC0", PU_HUDGFX); tagico = W_CachePatchName("TAGICO", PU_HUDGFX); rflagico = W_CachePatchName("RFLAGICO", PU_HUDGFX); @@ -805,11 +811,14 @@ static void ST_drawFirstPersonHUD(void) } else switch (player->powers[pw_shield] & SH_NOSTACK) { - case SH_JUMP: p = jumpshield; break; - case SH_ELEMENTAL: p = watershield; break; - case SH_BOMB: p = bombshield; break; - case SH_ATTRACT: p = ringshield; break; - case SH_PITY: p = pityshield; break; + case SH_JUMP: p = jumpshield; break; + case SH_ELEMENTAL: p = watershield; break; + case SH_BOMB: p = bombshield; break; + case SH_ATTRACT: p = ringshield; break; + case SH_PITY: p = pityshield; break; + case SH_FLAMEAURA: p = flameshield; break; + case SH_BUBBLEWRAP: p = bubbleshield; break; + case SH_THUNDERCOIN: p = thundershield; break; default: break; } From aa8a454ea9ed28524907686315ee3ec515f9e011 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 208/808] Turning some shield attributes into flags means that environmental protection and ring-pulling can be more elegantly handled. As a consequence, the S3 shields now have all their passives, and are just waiting on me to give them actives (two of which don't have the necessary sprites for...) --- src/d_player.h | 34 ++++++++++++++++++++++------------ src/dehacked.c | 25 ++++++++++++++++--------- src/p_enemy.c | 10 +++++----- src/p_inter.c | 15 +++++---------- src/p_mobj.c | 11 ++++++++--- src/p_spec.c | 2 +- src/p_user.c | 6 +++--- 7 files changed, 60 insertions(+), 43 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 77ad34dab..a7b19439d 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -181,25 +181,35 @@ typedef enum typedef enum { SH_NONE = 0, - // Standard shields + + // Shield flags + SH_PROTECTFIRE = 0x400, + SH_PROTECTWATER = 0x800, + SH_PROTECTELECTRICITY = 0x1000, + + // Indivisible shields + SH_PITY = 1, SH_JUMP, - SH_ATTRACT, - SH_ELEMENTAL, SH_BOMB, - // Pity shield: the world's most basic shield ever, given to players who suck at Match - SH_PITY, - // Sonic 3 shields - SH_FLAMEAURA, - SH_BUBBLEWRAP, - SH_THUNDERCOIN, - // The fireflower used to be stackable with other shields. Not anymore. SH_FIREFLOWER, + + // normal shields that use flags + SH_ATTRACT = SH_PROTECTELECTRICITY, + SH_ELEMENTAL = SH_PROTECTFIRE|SH_PROTECTWATER, + + // Sonic 3 shields + SH_FLAMEAURA = SH_PROTECTFIRE, + SH_BUBBLEWRAP = SH_PROTECTWATER, + SH_THUNDERCOIN = SH_JUMP|SH_PROTECTELECTRICITY, + // The force shield uses the lower 8 bits to count how many extra hits are left. SH_FORCE = 0x100, SH_FORCEHP = 0xFF, // to be used as a bitmask only - // The mushroom CAN stack with other shields. + + // Mostly for use with Mario mode. SH_MUSHROOM = 0x200, - SH_STACK = SH_MUSHROOM, //|SH_FIREFLOWER, + + SH_STACK = SH_MUSHROOM, // second-layer shields SH_NOSTACK = ~SH_STACK } shieldtype_t; // pw_shield diff --git a/src/dehacked.c b/src/dehacked.c index bd3f8455f..20dce51d4 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7174,21 +7174,28 @@ struct { {"PRECIP_STORM_NOSTRIKES",PRECIP_STORM_NOSTRIKES}, // Shields - // These ones use the lower 8 bits {"SH_NONE",SH_NONE}, + // Shield flags + {"SH_PROTECTFIRE",SH_PROTECTFIRE}, + {"SH_PROTECTWATER",SH_PROTECTWATER}, + {"SH_PROTECTELECTRICITY",SH_PROTECTELECTRICITY}, + // Indivisible shields + {"SH_PITY",SH_PITY}, {"SH_JUMP",SH_JUMP}, + {"SH_BOMB",SH_BOMB}, + {"SH_FIREFLOWER",SH_FIREFLOWER}, + // normal shields that use flags {"SH_ATTRACT",SH_ATTRACT}, {"SH_ELEMENTAL",SH_ELEMENTAL}, - {"SH_BOMB",SH_BOMB}, + // Sonic 3 shields + {"SH_FLAMEAURA",SH_FLAMEAURA}, {"SH_BUBBLEWRAP",SH_BUBBLEWRAP}, {"SH_THUNDERCOIN",SH_THUNDERCOIN}, - {"SH_FLAMEAURA",SH_FLAMEAURA}, - {"SH_PITY",SH_PITY}, - {"SH_FIREFLOWER",SH_FIREFLOWER}, - // These ones are special and use the upper bits - {"SH_FORCE",SH_FORCE}, // Lower bits are how many hits left, 0 is the last hit - {"SH_MUSHROOM", SH_MUSHROOM}, // Can stack with other shields - // Stack masks + // The force shield uses the lower 8 bits to count how many extra hits are left. + {"SH_FORCE",SH_FORCE}, + {"SH_FORCEHP",SH_FORCEHP}, // to be used as a bitmask only + // Mostly for use with Mario mode. + {"SH_MUSHROOM", SH_MUSHROOM}, {"SH_STACK",SH_STACK}, {"SH_NOSTACK",SH_NOSTACK}, diff --git a/src/p_enemy.c b/src/p_enemy.c index 7ef87ac44..6345a89c4 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -741,7 +741,7 @@ static boolean P_LookForShield(mobj_t *actor) (actor->type == MT_BLUETEAMRING && player->ctfteam != 2)) continue; - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT + if ((player->powers[pw_shield] & SH_PROTECTELECTRICITY) && (P_AproxDistance(P_AproxDistance(actor->x-player->mo->x, actor->y-player->mo->y), actor->z-player->mo->z) < FixedMul(RING_DIST, player->mo->scale))) { P_SetTarget(&actor->tracer, player->mo); @@ -3817,7 +3817,7 @@ void A_AttractChase(mobj_t *actor) // Turn flingrings back into regular rings if attracted. if (actor->tracer && actor->tracer->player - && (actor->tracer->player->powers[pw_shield] & SH_NOSTACK) != SH_ATTRACT && actor->info->reactiontime && actor->type != (mobjtype_t)actor->info->reactiontime) + && !(actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRICITY) && actor->info->reactiontime && actor->type != (mobjtype_t)actor->info->reactiontime) { mobj_t *newring; newring = P_SpawnMobj(actor->x, actor->y, actor->z, actor->info->reactiontime); @@ -4022,7 +4022,7 @@ void A_ThrownRing(mobj_t *actor) // A non-homing ring getting attracted by a // magnetic player. If he gets too far away, make // sure to stop the attraction! - if ((!actor->tracer->health) || (actor->tracer->player && (actor->tracer->player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT + if ((!actor->tracer->health) || (actor->tracer->player && (actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRICITY) && P_AproxDistance(P_AproxDistance(actor->tracer->x-actor->x, actor->tracer->y-actor->y), actor->tracer->z-actor->z) > FixedMul(RING_DIST/4, actor->tracer->scale))) { @@ -4030,7 +4030,7 @@ void A_ThrownRing(mobj_t *actor) } if (actor->tracer && (actor->tracer->health) - && (actor->tracer->player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT)// Already found someone to follow. + && (actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRICITY))// Already found someone to follow. { const INT32 temp = actor->threshold; actor->threshold = 32000; @@ -4098,7 +4098,7 @@ void A_ThrownRing(mobj_t *actor) if (!P_CheckSight(actor, player->mo)) continue; // out of sight - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT + if ((player->powers[pw_shield] & SH_PROTECTELECTRICITY) && dist < FixedMul(RING_DIST/4, player->mo->scale)) P_SetTarget(&actor->tracer, player->mo); return; diff --git a/src/p_inter.c b/src/p_inter.c index 0b2262ab7..c5938c90e 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1459,7 +1459,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; case MT_EXTRALARGEBUBBLE: - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) + if (player->powers[pw_shield] & SH_PROTECTWATER) return; if (maptol & TOL_NIGHTS) return; @@ -3022,28 +3022,23 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if (!(target->player->pflags & (PF_NIGHTSMODE|PF_NIGHTSFALL)) && (maptol & TOL_NIGHTS)) return false; -#define shieldtype (player->powers[pw_shield] & SH_NOSTACK) switch (damagetype) { case DMG_WATER: - if (shieldtype == SH_BUBBLEWRAP - || shieldtype == SH_ELEMENTAL) + if (player->powers[pw_shield] & SH_PROTECTWATER) return false; // Invincible to water damage break; case DMG_FIRE: - if (shieldtype == SH_FLAMEAURA - || shieldtype == SH_ELEMENTAL) + if (player->powers[pw_shield] & SH_PROTECTFIRE) return false; // Invincible to fire damage break; case DMG_ELECTRIC: - if (shieldtype == SH_ATTRACT - || shieldtype == SH_THUNDERCOIN) + if (player->powers[pw_shield] & SH_PROTECTELECTRICITY) return false; // Invincible to electric damage break; default: break; } -#undef shieldtype } if (player->pflags & PF_NIGHTSMODE) // NiGHTS damage handling @@ -3067,7 +3062,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if (!force && inflictor && inflictor->flags & MF_FIRE) { - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) + if (player->powers[pw_shield] & SH_PROTECTFIRE) return false; // Invincible to fire objects if (G_PlatformGametype() && inflictor && source && source->player) diff --git a/src/p_mobj.c b/src/p_mobj.c index 2cd6b7d77..d87e3cc20 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3619,15 +3619,20 @@ void P_MobjCheckWater(mobj_t *mobj) { if (!((p->powers[pw_super]) || (p->powers[pw_invulnerability]))) { - if ((p->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT) - { // Water removes attract shield. + if (p->powers[pw_shield] & SH_PROTECTELECTRICITY) + { // Water removes electric shields... p->powers[pw_shield] = p->powers[pw_shield] & SH_STACK; P_FlashPal(p, PAL_WHITE, 1); } + else if ((p->powers[pw_shield] & SH_PROTECTFIRE) && !(p->powers[pw_shield] & SH_PROTECTWATER)) + { // ...and fire-only shields. + p->powers[pw_shield] = p->powers[pw_shield] & SH_STACK; + P_FlashPal(p, PAL_NUKE, 1); + } } // Drown timer setting - if ((p->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL // Has elemental + if ((p->powers[pw_shield] & SH_PROTECTWATER) // Has water protection || (p->exiting) // Or exiting || (maptol & TOL_NIGHTS) // Or in NiGHTS mode || (mariomode)) // Or in Mario mode... diff --git a/src/p_spec.c b/src/p_spec.c index ed2ff055c..0119664aa 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3562,7 +3562,7 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers P_PlayerFlagBurst(player, false); break; case 12: // Space Countdown - if ((player->powers[pw_shield] & SH_NOSTACK) != SH_ELEMENTAL && !player->powers[pw_spacetime]) + if (!(player->powers[pw_shield] & SH_PROTECTWATER) && !player->powers[pw_spacetime]) player->powers[pw_spacetime] = spacetimetics + 1; break; case 13: // Ramp Sector (Increase step-up/down) diff --git a/src/p_user.c b/src/p_user.c index df28806b6..8ceef8d6e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2229,7 +2229,7 @@ static void P_DoBubbleBreath(player_t *player) fixed_t z = player->mo->z; mobj_t *bubble = NULL; - if (!(player->mo->eflags & MFE_UNDERWATER) || ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL && !(player->pflags & PF_NIGHTSMODE)) || player->spectator) + if (!(player->mo->eflags & MFE_UNDERWATER) || ((player->powers[pw_shield] & SH_PROTECTWATER) && !(player->pflags & PF_NIGHTSMODE)) || player->spectator) return; if (player->charflags & SF_MACHINE) @@ -9242,7 +9242,7 @@ void P_PlayerThink(player_t *player) if (player->powers[pw_tailsfly] && player->powers[pw_tailsfly] < UINT16_MAX && player->charability != CA_SWIM && !(player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))) // tails fly counter player->powers[pw_tailsfly]--; - if (player->powers[pw_underwater] && (player->pflags & PF_GODMODE || (player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL)) + if (player->powers[pw_underwater] && (player->pflags & PF_GODMODE || (player->powers[pw_shield] & SH_PROTECTWATER))) { if (player->powers[pw_underwater] <= 12*TICRATE+1) P_RestoreMusic(player); //incase they were about to drown @@ -9252,7 +9252,7 @@ void P_PlayerThink(player_t *player) else if (player->powers[pw_underwater] && !(maptol & TOL_NIGHTS) && !((netgame || multiplayer) && player->spectator)) // underwater timer player->powers[pw_underwater]--; - if (player->powers[pw_spacetime] && (player->pflags & PF_GODMODE || (player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL)) + if (player->powers[pw_spacetime] && (player->pflags & PF_GODMODE || (player->powers[pw_shield] & SH_PROTECTWATER))) player->powers[pw_spacetime] = 0; else if (player->powers[pw_spacetime] && !(maptol & TOL_NIGHTS) && !((netgame || multiplayer) && player->spectator)) // underwater timer player->powers[pw_spacetime]--; From 2acfc72d86dde21e77ae813e0d6b8d502c58f7d3 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 209/808] Made P_SwitchShield take into account the force shield, then made A_ForceShield take the number of bonus hitpoints as its var1. (Also, drowning timer is properly reset by ALL protectwater shields, not just elemental.) --- src/info.c | 2 +- src/p_enemy.c | 61 ++++++++------------------------------------------- src/p_user.c | 30 ++++++++++++++++++++----- 3 files changed, 35 insertions(+), 58 deletions(-) diff --git a/src/info.c b/src/info.c index 85a9589c9..b991e6825 100644 --- a/src/info.c +++ b/src/info.c @@ -1670,7 +1670,7 @@ state_t states[NUMSTATES] = {SPR_TVAT, 2, 18, {A_RingShield},0, 0, S_NULL}, // S_ATTRACT_ICON2 {SPR_TVFO, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_FORCE_ICON2}, // S_FORCE_ICON1 - {SPR_TVFO, 2, 18, {A_ForceShield}, 0, 0, S_NULL}, // S_FORCE_ICON2 + {SPR_TVFO, 2, 18, {A_ForceShield}, 1, 0, S_NULL}, // S_FORCE_ICON2 {SPR_TVAR, FF_ANIMATE|2, 18, {NULL}, 3, 4, S_ARMAGEDDON_ICON2}, // S_ARMAGEDDON_ICON1 {SPR_TVAR, 2, 18, {A_BombShield}, 0, 0, S_NULL}, // S_ARMAGEDDON_ICON2 diff --git a/src/p_enemy.c b/src/p_enemy.c index 6345a89c4..900547ccb 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3324,29 +3324,19 @@ void A_WaterShield(mobj_t *actor) S_StartSound(player->mo, actor->info->seesound); else S_StartSound(player->mo, sfx_itemup); - - if (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1) - P_RestoreMusic(player); - - player->powers[pw_underwater] = 0; - - if (player->powers[pw_spacetime] > 1) - { - player->powers[pw_spacetime] = 0; - P_RestoreMusic(player); - } } // Function: A_ForceShield // // Description: Awards the player a force shield. // -// var1 = unused +// var1 = Number of additional hitpoints to give // var2 = unused // void A_ForceShield(mobj_t *actor) { player_t *player; + INT32 locvar1 = var1; #ifdef HAVE_BLUA if (LUA_CallAction("A_ForceShield", actor)) @@ -3358,51 +3348,18 @@ void A_ForceShield(mobj_t *actor) return; } + if (locvar1 < 0 || locvar1 > SH_FORCEHP) + { + CONS_Debug(DBG_GAMELOGIC, "Invalid number of additional hitpoints.\n"); + return; + } + player = actor->target->player; - //can't use P_SwitchShield(player, SH_FORCE) - special case - - if (mariomode) - { - mobj_t *scoremobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + (player->mo->height / 2), MT_SCORE); - P_SetMobjState(scoremobj, mobjinfo[MT_SCORE].spawnstate+3); // 1000 - P_AddPlayerScore(player, 1000); - } - - if (!(player->powers[pw_shield] & SH_FORCE)) - { - // Just in case. - if (player->pflags & PF_SHIELDABILITY) - { - player->pflags &= ~PF_SHIELDABILITY; - player->homing = 0; - } - - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER - && !(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) - { - player->mo->color = player->skincolor; - G_GhostAddColor(GHC_NORMAL); - } - - S_StartSound(player->mo, actor->info->seesound); - } - else if (!mariomode) + if (P_SwitchShield(player, SH_FORCE|locvar1)) S_StartSound(player->mo, actor->info->seesound); else S_StartSound(player->mo, sfx_itemup); - - if ((player->powers[pw_shield] & SH_FORCE) && (player->powers[pw_shield] & SH_FORCEHP)) - return; // if you have a force shield with at least 2hp already, let's not go any further. - - if (mariomode) - { - player->mo->movecount = player->powers[pw_shield]; - player->powers[pw_marioflashing] = MARIOFLASHINGTICS; - } - - player->powers[pw_shield] = SH_FORCE|(mariomode ? SH_MUSHROOM : player->powers[pw_shield] & SH_STACK)|0x01; - P_SpawnShieldOrb(player); } // Function: A_PityShield diff --git a/src/p_user.c b/src/p_user.c index 8ceef8d6e..589e5e3c7 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1443,10 +1443,16 @@ void P_SpawnShieldOrb(player_t *player) // // Returns whether to play a normal sound or an itemup. // -// Not for use if shieldtype would be SH_FORCE. -// boolean P_SwitchShield(player_t *player, UINT16 shieldtype) { + boolean donthavealready = (shieldtype & SH_FORCE) + ? (!(player->powers[pw_shield] & SH_FORCE) || (player->powers[pw_shield] & SH_FORCEHP) < (shieldtype & ~SH_FORCE)) + : ((player->powers[pw_shield] & SH_NOSTACK) != shieldtype); + + boolean stopshieldability = (shieldtype & SH_FORCE) + ? (!(player->powers[pw_shield] & SH_FORCE)) + : true; + if (mariomode) { mobj_t *scoremobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + (player->mo->height / 2), MT_SCORE); @@ -1454,7 +1460,7 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) P_AddPlayerScore(player, 1000); } - if ((player->powers[pw_shield] & SH_NOSTACK) != shieldtype) + if (donthavealready) { if (mariomode) { @@ -1463,9 +1469,9 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) } // Just in case. - if (player->pflags & PF_SHIELDABILITY) + if (stopshieldability && player->pflags & PF_SHIELDABILITY) { - player->pflags &= ~PF_SPINNING|PF_SHIELDABILITY; // They'll still have PF_THOKKED... + player->pflags &= ~(PF_SPINNING|PF_SHIELDABILITY); // They'll still have PF_THOKKED... player->homing = 0; if (player->powers[pw_shield] & SH_FORCE) // Dash. { @@ -1486,6 +1492,20 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) player->powers[pw_shield] = shieldtype|(mariomode ? SH_MUSHROOM : player->powers[pw_shield] & SH_STACK); P_SpawnShieldOrb(player); + + if (shieldtype & SH_PROTECTWATER) + { + if (player->powers[pw_underwater] && player->powers[pw_underwater] <= 12*TICRATE + 1) + P_RestoreMusic(player); + + player->powers[pw_underwater] = 0; + + if (player->powers[pw_spacetime] > 1) + { + player->powers[pw_spacetime] = 0; + P_RestoreMusic(player); + } + } return true; } return (!mariomode); From 5ff507213bea4a9a0f987ff564a445684f9b5821 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 210/808] * Some shield constants renamed. * Some shield sounds swapped (can be reverted later). * Partial implementation of S3K shield abilities. * The ability to elemental-groundpound onto gold monitors without going straight through them. * Force shield ability removed because nobody could agree on it, we'll keep it blank until another idea can get through the disagreement juggernaut. --- src/d_player.h | 10 +-- src/dehacked.c | 12 ++-- src/info.c | 52 +++++++------- src/info.h | 6 +- src/p_enemy.c | 16 ++--- src/p_floor.c | 4 +- src/p_inter.c | 6 +- src/p_map.c | 12 +++- src/p_mobj.c | 29 ++++---- src/p_user.c | 182 ++++++++++++++++++------------------------------- src/st_stuff.c | 4 +- 11 files changed, 150 insertions(+), 183 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index a7b19439d..54960115f 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -185,22 +185,22 @@ typedef enum // Shield flags SH_PROTECTFIRE = 0x400, SH_PROTECTWATER = 0x800, - SH_PROTECTELECTRICITY = 0x1000, + SH_PROTECTELECTRIC = 0x1000, // Indivisible shields SH_PITY = 1, - SH_JUMP, - SH_BOMB, + SH_WHIRLWIND, + SH_ARMAGEDDON, SH_FIREFLOWER, // normal shields that use flags - SH_ATTRACT = SH_PROTECTELECTRICITY, + SH_ATTRACT = SH_PROTECTELECTRIC, SH_ELEMENTAL = SH_PROTECTFIRE|SH_PROTECTWATER, // Sonic 3 shields SH_FLAMEAURA = SH_PROTECTFIRE, SH_BUBBLEWRAP = SH_PROTECTWATER, - SH_THUNDERCOIN = SH_JUMP|SH_PROTECTELECTRICITY, + SH_THUNDERCOIN = SH_WHIRLWIND|SH_PROTECTELECTRIC, // The force shield uses the lower 8 bits to count how many extra hits are left. SH_FORCE = 0x100, diff --git a/src/dehacked.c b/src/dehacked.c index 20dce51d4..cfaa7b526 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5459,6 +5459,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_BUBSB1", "S_BUBSB2", + "S_BUBSB3", + "S_BUBSB4", "S_ZAPS1", "S_ZAPS2", @@ -6509,8 +6511,8 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_ELEMENTAL_ORB", // Elemental shield mobj "MT_ATTRACT_ORB", // Attract shield mobj "MT_FORCE_ORB", // Force shield mobj - "MT_BOMB_ORB", // Armageddon shield mobj - "MT_JUMP_ORB", // Whirlwind shield mobj + "MT_ARMAGEDDON_ORB", // Armageddon shield mobj + "MT_WHIRLWIND_ORB", // Whirlwind shield mobj "MT_PITY_ORB", // Pity shield mobj "MT_FLAMEAURA_ORB", // Flame shield mobj "MT_BUBBLEWRAP_ORB", // Bubble shield mobj @@ -7178,11 +7180,11 @@ struct { // Shield flags {"SH_PROTECTFIRE",SH_PROTECTFIRE}, {"SH_PROTECTWATER",SH_PROTECTWATER}, - {"SH_PROTECTELECTRICITY",SH_PROTECTELECTRICITY}, + {"SH_PROTECTELECTRIC",SH_PROTECTELECTRIC}, // Indivisible shields {"SH_PITY",SH_PITY}, - {"SH_JUMP",SH_JUMP}, - {"SH_BOMB",SH_BOMB}, + {"SH_WHIRLWIND",SH_WHIRLWIND}, + {"SH_ARMAGEDDON",SH_ARMAGEDDON}, {"SH_FIREFLOWER",SH_FIREFLOWER}, // normal shields that use flags {"SH_ATTRACT",SH_ATTRACT}, diff --git a/src/info.c b/src/info.c index b991e6825..56edd0b85 100644 --- a/src/info.c +++ b/src/info.c @@ -2175,18 +2175,20 @@ state_t states[NUMSTATES] = {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|16, 2, {NULL}, 0, 0, S_FIRSB9}, // S_FIRSB8 {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|17, 2, {NULL}, 0, 0, S_FIRSB1}, // S_FIRSB9 - {SPR_BUBS, FF_TRANS30| 2, 2, {NULL}, 0, 0, S_BUBS2}, // S_BUBS1 - {SPR_BUBS, FF_TRANS30| 3, 2, {NULL}, 0, 0, S_BUBS3}, // S_BUBS2 - {SPR_BUBS, FF_TRANS30| 4, 2, {NULL}, 0, 0, S_BUBS4}, // S_BUBS3 - {SPR_BUBS, FF_TRANS30| 5, 2, {NULL}, 0, 0, S_BUBS5}, // S_BUBS4 - {SPR_BUBS, FF_TRANS30| 6, 2, {NULL}, 0, 0, S_BUBS6}, // S_BUBS5 - {SPR_BUBS, FF_TRANS30| 7, 2, {NULL}, 0, 0, S_BUBS7}, // S_BUBS6 - {SPR_BUBS, FF_TRANS30| 8, 2, {NULL}, 0, 0, S_BUBS8}, // S_BUBS7 - {SPR_BUBS, FF_TRANS30| 9, 2, {NULL}, 0, 0, S_BUBS9}, // S_BUBS8 - {SPR_BUBS, FF_TRANS30|10, 2, {NULL}, 0, 0, S_BUBS1}, // S_BUBS9 + {SPR_BUBS, FF_TRANS30 , 2, {NULL}, 0, 0, S_BUBS2}, // S_BUBS1 + {SPR_BUBS, FF_TRANS30|1, 2, {NULL}, 0, 0, S_BUBS3}, // S_BUBS2 + {SPR_BUBS, FF_TRANS30|2, 2, {NULL}, 0, 0, S_BUBS4}, // S_BUBS3 + {SPR_BUBS, FF_TRANS30|3, 2, {NULL}, 0, 0, S_BUBS5}, // S_BUBS4 + {SPR_BUBS, FF_TRANS30|4, 2, {NULL}, 0, 0, S_BUBS6}, // S_BUBS5 + {SPR_BUBS, FF_TRANS30|5, 2, {NULL}, 0, 0, S_BUBS7}, // S_BUBS6 + {SPR_BUBS, FF_TRANS30|6, 2, {NULL}, 0, 0, S_BUBS8}, // S_BUBS7 + {SPR_BUBS, FF_TRANS30|7, 2, {NULL}, 0, 0, S_BUBS9}, // S_BUBS8 + {SPR_BUBS, FF_TRANS30|8, 2, {NULL}, 0, 0, S_BUBS1}, // S_BUBS9 - {SPR_BUBS, FF_TRANS30 , 2, {NULL}, 0, 0, S_BUBSB2}, // S_BUBSB1 - {SPR_BUBS, FF_TRANS30|1, 2, {NULL}, 0, 0, S_BUBSB1}, // S_BUBSB2 + {SPR_BUBS, FF_TRANS30| 9, 2, {NULL}, 0, 0, S_BUBSB2}, // S_BUBSB1 + {SPR_BUBS, FF_TRANS30|10, 2, {NULL}, 0, 0, S_BUBSB3}, // S_BUBSB2 + {SPR_BUBS, FF_TRANS30|11, 2, {NULL}, 0, 0, S_BUBSB4}, // S_BUBSB3 + {SPR_BUBS, FF_TRANS30|10, 2, {NULL}, 0, 0, S_BUBSB1}, // S_BUBSB4 {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20 , 2, {NULL}, 0, 0, S_ZAPS2 }, // S_ZAPS1 {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 1, 2, {NULL}, 0, 0, S_ZAPS3 }, // S_ZAPS2 @@ -7057,7 +7059,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_ATTRACT_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_shield, // seesound + sfx_s3k41, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -7111,7 +7113,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_ARMAGEDDON_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_shield, // seesound + sfx_s3k3e, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -7165,7 +7167,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_ELEMENTAL_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_shield, // seesound + sfx_s3k3f, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -7435,7 +7437,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_FLAMEAURA_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_shield, // seesound + sfx_s3k3e, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -7462,7 +7464,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_BUBBLEWRAP_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_shield, // seesound + sfx_s3k3f, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -7489,7 +7491,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_THUNDERCOIN_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_shield, // seesound + sfx_s3k41, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -10762,7 +10764,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // seesound 0, // reactiontime sfx_None, // attacksound - S_ELEMF9, // painstate + S_NULL, // painstate SKINCOLOR_NONE, // painchance sfx_None, // painsound S_NULL, // meleestate @@ -10778,7 +10780,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // damage sfx_None, // activesound MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags - S_NULL // raisestate + S_ELEMF9 // raisestate }, { // MT_ATTRACT_ORB @@ -10835,7 +10837,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_BOMB_ORB + { // MT_ARMAGEDDON_ORB -1, // doomednum S_ARMA1, // spawnstate 1000, // spawnhealth @@ -10851,7 +10853,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound - SH_BOMB, // speed + SH_ARMAGEDDON, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height 2, // display offset @@ -10862,7 +10864,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, - { // MT_JUMP_ORB + { // MT_WHIRLWIND_ORB -1, // doomednum S_WIND1, // spawnstate 1000, // spawnhealth @@ -10878,7 +10880,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound - SH_JUMP, // speed + SH_WHIRLWIND, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height 2, // display offset @@ -10978,7 +10980,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // seesound 8, // reactiontime sfx_None, // attacksound - S_NULL, // painstate + S_ZAPSB11, // painstate SKINCOLOR_NONE, // painchance sfx_None, // painsound S_NULL, // meleestate @@ -10994,7 +10996,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // damage sfx_None, // activesound MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags - S_NULL // raisestate + S_ZAPS14 // raisestate }, { // MT_IVSP diff --git a/src/info.h b/src/info.h index 638657226..a18a374d9 100644 --- a/src/info.h +++ b/src/info.h @@ -2373,6 +2373,8 @@ typedef enum state S_BUBSB1, S_BUBSB2, + S_BUBSB3, + S_BUBSB4, S_ZAPS1, S_ZAPS2, @@ -3442,8 +3444,8 @@ typedef enum mobj_type MT_ELEMENTAL_ORB, // Elemental shield mobj MT_ATTRACT_ORB, // Attract shield mobj MT_FORCE_ORB, // Force shield mobj - MT_BOMB_ORB, // Armageddon shield mobj - MT_JUMP_ORB, // Whirlwind shield mobj + MT_ARMAGEDDON_ORB, // Armageddon shield mobj + MT_WHIRLWIND_ORB, // Whirlwind shield mobj MT_PITY_ORB, // Pity shield mobj MT_FLAMEAURA_ORB, // Flame shield mobj MT_BUBBLEWRAP_ORB, // Bubble shield mobj diff --git a/src/p_enemy.c b/src/p_enemy.c index 900547ccb..cde3f6310 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -741,7 +741,7 @@ static boolean P_LookForShield(mobj_t *actor) (actor->type == MT_BLUETEAMRING && player->ctfteam != 2)) continue; - if ((player->powers[pw_shield] & SH_PROTECTELECTRICITY) + if ((player->powers[pw_shield] & SH_PROTECTELECTRIC) && (P_AproxDistance(P_AproxDistance(actor->x-player->mo->x, actor->y-player->mo->y), actor->z-player->mo->z) < FixedMul(RING_DIST, player->mo->scale))) { P_SetTarget(&actor->tracer, player->mo); @@ -3061,7 +3061,7 @@ void A_JumpShield(mobj_t *actor) player = actor->target->player; - if (P_SwitchShield(player, SH_JUMP)) + if (P_SwitchShield(player, SH_WHIRLWIND)) S_StartSound(player->mo, actor->info->seesound); else S_StartSound(player->mo, sfx_itemup); @@ -3289,11 +3289,11 @@ void A_BombShield(mobj_t *actor) player = actor->target->player; // If you already have a bomb shield, use it! - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_BOMB) + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ARMAGEDDON) P_BlackOw(player); // Now we know for certain that we don't have a bomb shield, so add one. :3 - P_SwitchShield(player, SH_BOMB); // will never return false, so no need for sound test + P_SwitchShield(player, SH_ARMAGEDDON); // will never return false, so no need for sound test S_StartSound(player->mo, actor->info->seesound); } @@ -3774,7 +3774,7 @@ void A_AttractChase(mobj_t *actor) // Turn flingrings back into regular rings if attracted. if (actor->tracer && actor->tracer->player - && !(actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRICITY) && actor->info->reactiontime && actor->type != (mobjtype_t)actor->info->reactiontime) + && !(actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRIC) && actor->info->reactiontime && actor->type != (mobjtype_t)actor->info->reactiontime) { mobj_t *newring; newring = P_SpawnMobj(actor->x, actor->y, actor->z, actor->info->reactiontime); @@ -3979,7 +3979,7 @@ void A_ThrownRing(mobj_t *actor) // A non-homing ring getting attracted by a // magnetic player. If he gets too far away, make // sure to stop the attraction! - if ((!actor->tracer->health) || (actor->tracer->player && (actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRICITY) + if ((!actor->tracer->health) || (actor->tracer->player && (actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRIC) && P_AproxDistance(P_AproxDistance(actor->tracer->x-actor->x, actor->tracer->y-actor->y), actor->tracer->z-actor->z) > FixedMul(RING_DIST/4, actor->tracer->scale))) { @@ -3987,7 +3987,7 @@ void A_ThrownRing(mobj_t *actor) } if (actor->tracer && (actor->tracer->health) - && (actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRICITY))// Already found someone to follow. + && (actor->tracer->player->powers[pw_shield] & SH_PROTECTELECTRIC))// Already found someone to follow. { const INT32 temp = actor->threshold; actor->threshold = 32000; @@ -4055,7 +4055,7 @@ void A_ThrownRing(mobj_t *actor) if (!P_CheckSight(actor, player->mo)) continue; // out of sight - if ((player->powers[pw_shield] & SH_PROTECTELECTRICITY) + if ((player->powers[pw_shield] & SH_PROTECTELECTRIC) && dist < FixedMul(RING_DIST/4, player->mo->scale)) P_SetTarget(&actor->tracer, player->mo); return; diff --git a/src/p_floor.c b/src/p_floor.c index 3d18cc3bd..96d854a10 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -1751,8 +1751,8 @@ static mobj_t *SearchMarioNode(msecnode_t *node) case MT_ELEMENTAL_ORB: case MT_ATTRACT_ORB: case MT_FORCE_ORB: - case MT_BOMB_ORB: - case MT_JUMP_ORB: + case MT_ARMAGEDDON_ORB: + case MT_WHIRLWIND_ORB: case MT_PITY_ORB: case MT_FLAMEAURA_ORB: case MT_BUBBLEWRAP_ORB: diff --git a/src/p_inter.c b/src/p_inter.c index c5938c90e..822602fd8 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1582,7 +1582,7 @@ static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *sour else switch (inflictor->type) { case MT_PLAYER: - if ((inflictor->player->powers[pw_shield] & SH_NOSTACK) == SH_BOMB) + if ((inflictor->player->powers[pw_shield] & SH_NOSTACK) == SH_ARMAGEDDON) str = M_GetText("%s%s's armageddon blast %s %s.\n"); else if (inflictor->player->powers[pw_invulnerability]) str = M_GetText("%s%s's invincibility aura %s %s.\n"); @@ -2791,7 +2791,7 @@ void P_RemoveShield(player_t *player) { // Second layer shields player->powers[pw_shield] = SH_NONE; } - else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_BOMB) // Give them what's coming to them! + else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ARMAGEDDON) // Give them what's coming to them! { P_BlackOw(player); // BAM! player->pflags |= PF_JUMPDOWN; @@ -3033,7 +3033,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da return false; // Invincible to fire damage break; case DMG_ELECTRIC: - if (player->powers[pw_shield] & SH_PROTECTELECTRICITY) + if (player->powers[pw_shield] & SH_PROTECTELECTRIC) return false; // Invincible to electric damage break; default: diff --git a/src/p_map.c b/src/p_map.c index b3ad9b74f..bb904cc3d 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1052,6 +1052,8 @@ static boolean PIT_CheckThing(mobj_t *thing) else if (thing->z - FixedMul(FRACUNIT, thing->scale) <= tmthing->z + tmthing->height && thing->z + thing->height + FixedMul(FRACUNIT, thing->scale) >= tmthing->z) { + boolean elementalpierce = (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) + && (tmthing->player->pflags & PF_SHIELDABILITY)); if (thing->flags & MF_MONITOR && (tmthing->player->pflags & (PF_SPINNING|PF_GLIDING) || ((tmthing->player->pflags & PF_JUMPED) @@ -1059,11 +1061,12 @@ static boolean PIT_CheckThing(mobj_t *thing) && !(tmthing->player->charability == CA_TWINSPIN && tmthing->player->panim == PA_ABILITY))) || (tmthing->player->charability2 == CA2_MELEE && tmthing->player->panim == PA_ABILITY2) || ((tmthing->player->charflags & SF_STOMPDAMAGE) - && (P_MobjFlip(tmthing)*(tmthing->z - (thing->z + thing->height/2)) > 0) && (P_MobjFlip(tmthing)*tmthing->momz < 0)))) + && (P_MobjFlip(tmthing)*(tmthing->z - (thing->z + thing->height/2)) > 0) && (P_MobjFlip(tmthing)*tmthing->momz < 0)) + || elementalpierce)) { SINT8 flipval = P_MobjFlip(thing); // Save this value in case monitor gets removed. fixed_t *momz = &tmthing->momz; // tmthing gets changed by P_DamageMobj, so we need a new pointer?! X_x;; - boolean elementalpierce = (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) && (tmthing->player->pflags & PF_SHIELDABILITY)); + fixed_t *z = &tmthing->z; // aau. P_DamageMobj(thing, tmthing, tmthing, 1, 0); // break the monitor // Going down? Then bounce back up. if ((P_MobjWasRemoved(thing) // Monitor was removed @@ -1071,7 +1074,10 @@ static boolean PIT_CheckThing(mobj_t *thing) && (flipval*(*momz) < 0) // monitor is on the floor and you're going down, or on the ceiling and you're going up && !elementalpierce) // you're not piercing through the monitor... *momz = -*momz; // Therefore, you should be thrust in the opposite direction, vertically. - return false; + if (!(elementalpierce && thing->flags & MF_GRENADEBOUNCE)) // prevent gold monitor clipthrough. + return false; + else + *z -= *momz; // to ensure proper collision. } } } diff --git a/src/p_mobj.c b/src/p_mobj.c index d87e3cc20..840d4aa49 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3250,14 +3250,6 @@ static void P_PlayerZMovement(mobj_t *mo) P_SetPlayerMobjState(mo, S_PLAY_FALL); clipmomz = false; } - else if (mo->player->powers[pw_shield] & SH_FORCE) // Force shield's dodge dash. - { - P_SetPlayerMobjState(mo, S_PLAY_WALK); - mo->flags &= ~MF_NOGRAVITY; - mo->player->pflags &= ~(PF_FULLSTASIS|PF_SPINNING); - mo->momx >>= 3; - mo->momy >>= 3; - } } mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY/*|PF_GLIDING*/); mo->player->jumping = 0; @@ -3619,7 +3611,7 @@ void P_MobjCheckWater(mobj_t *mobj) { if (!((p->powers[pw_super]) || (p->powers[pw_invulnerability]))) { - if (p->powers[pw_shield] & SH_PROTECTELECTRICITY) + if (p->powers[pw_shield] & SH_PROTECTELECTRIC) { // Water removes electric shields... p->powers[pw_shield] = p->powers[pw_shield] & SH_STACK; P_FlashPal(p, PAL_WHITE, 1); @@ -6774,14 +6766,25 @@ void P_MobjThinker(mobj_t *mobj) && (mobj->target->target->player) && ((mobj->target->target->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) && (mobj->target->target->player->pflags & PF_SHIELDABILITY) - && (mobj->state->nextstate < mobj->target->info->painstate)) // Special casing for elemental shield piercing attack. + && (mobj->state->nextstate < mobj->target->info->raisestate)) // Special casing for elemental shield piercing attack. { - P_SetMobjState(mobj, mobj->target->info->painstate); + P_SetMobjState(mobj, mobj->target->info->raisestate); + mobj->tics++; + } + else if ((mobj->target->type == MT_THUNDERCOIN_ORB) + && (mobj->target->target) + && (mobj->target->target->player) + && ((mobj->target->target->player->powers[pw_shield] & SH_NOSTACK) == SH_THUNDERCOIN) + && (mobj->target->target->player->pflags & PF_SHIELDABILITY)) // Special casing for thundercoin shield jump.. + { + P_SetMobjState(mobj, mobj->target->info->raisestate); + P_SetMobjState(mobj->target, mobj->target->info->painstate); + mobj->target->target->player->pflags &= ~PF_SHIELDABILITY; mobj->tics++; } break; - case MT_BOMB_ORB: - case MT_JUMP_ORB: + case MT_ARMAGEDDON_ORB: + case MT_WHIRLWIND_ORB: case MT_ELEMENTAL_ORB: case MT_FORCE_ORB: case MT_PITY_ORB: diff --git a/src/p_user.c b/src/p_user.c index 589e5e3c7..85f640108 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -877,15 +877,6 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor) // Useful when you want to kill everything the player is doing. void P_ResetPlayer(player_t *player) { - if (player->mo - && player->powers[pw_shield] & SH_FORCE // Dash. - && player->pflags & PF_SHIELDABILITY) - { - P_SetPlayerMobjState(player->mo, S_PLAY_FALL); - player->mo->flags &= ~MF_NOGRAVITY; - player->pflags &= ~PF_FULLSTASIS; - } - player->pflags &= ~(PF_SPINNING|PF_STARTDASH|PF_JUMPED|PF_GLIDING|PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY); player->powers[pw_carry] = CR_NONE; player->jumping = 0; @@ -1351,8 +1342,8 @@ void P_SpawnShieldOrb(player_t *player) orbtype = MT_FORCE_ORB; else switch (player->powers[pw_shield] & SH_NOSTACK) { - case SH_JUMP: - orbtype = MT_JUMP_ORB; + case SH_WHIRLWIND: + orbtype = MT_WHIRLWIND_ORB; break; case SH_ATTRACT: orbtype = MT_ATTRACT_ORB; @@ -1360,8 +1351,8 @@ void P_SpawnShieldOrb(player_t *player) case SH_ELEMENTAL: orbtype = MT_ELEMENTAL_ORB; break; - case SH_BOMB: - orbtype = MT_BOMB_ORB; + case SH_ARMAGEDDON: + orbtype = MT_ARMAGEDDON_ORB; break; case SH_PITY: orbtype = MT_PITY_ORB; @@ -1473,14 +1464,6 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) { player->pflags &= ~(PF_SPINNING|PF_SHIELDABILITY); // They'll still have PF_THOKKED... player->homing = 0; - if (player->powers[pw_shield] & SH_FORCE) // Dash. - { - P_SetPlayerMobjState(player->mo, S_PLAY_FALL); - player->mo->flags &= ~MF_NOGRAVITY; - player->pflags &= ~PF_FULLSTASIS; - player->mo->momx >>= 3; - player->mo->momy >>= 3; - } } if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER // it's implicit that the new shield isn't a fireflower @@ -3944,18 +3927,27 @@ static void P_DoSpinAbility(player_t *player, ticcmd_t *cmd) // void P_DoJumpShield(player_t *player) { + boolean electric = ((player->powers[pw_shield] & SH_PROTECTELECTRIC) == SH_PROTECTELECTRIC); + if (player->pflags & PF_THOKKED) return; player->pflags &= ~PF_JUMPED; P_DoJump(player, false); - player->pflags &= ~PF_JUMPED; - player->secondjump = 0; player->jumping = 0; + player->secondjump = 0; player->pflags |= PF_THOKKED|PF_SHIELDABILITY; player->pflags &= ~PF_SPINNING; - P_SetPlayerMobjState(player->mo, S_PLAY_FALL); - S_StartSound(player->mo, sfx_wdjump); + if (electric) + { + S_StartSound(player->mo, sfx_s3k45); + } + else + { + player->pflags &= ~PF_JUMPED; + P_SetPlayerMobjState(player->mo, S_PLAY_FALL); + S_StartSound(player->mo, sfx_wdjump); + } } // @@ -4026,7 +4018,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) {} else if (onground || player->climbing || (player->mo->tracer && player->powers[pw_carry])) {} - else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_JUMP + else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_WHIRLWIND && !(player->pflags & PF_JUMPED) && !(player->pflags & PF_USEDOWN)) P_DoJumpShield(player); @@ -4307,7 +4299,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) break; } } - else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_JUMP && !player->powers[pw_super]) + else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_WHIRLWIND && !player->powers[pw_super]) P_DoJumpShield(player); } @@ -6993,79 +6985,58 @@ static void P_MovePlayer(player_t *player) { if (player->pflags & PF_JUMPED) // If the player is jumping { - if (!(player->pflags & PF_USEDOWN)) // If the player is not holding down BT_USE + pflags_t check = (PF_USEDOWN|PF_GLIDING|PF_SLIDING|PF_THOKKED); + if (!(player->pflags & check)) // If the player is not holding down BT_USE, or having used an ability previously { - // Jump shield activation - if (!P_PlayerInPain(player) // If the player is not in pain - && !player->climbing // If the player is not climbing - && !(player->pflags & (PF_GLIDING|PF_SLIDING|PF_THOKKED)) // If the player is not gliding or sliding and hasn't used their ability - && !onground) // If the player isn't on the ground - { - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_JUMP && !player->powers[pw_super]) - P_DoJumpShield(player); - else if (player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]) && player->charability == CA_FLY) - { - P_DoJumpShield(player); - player->mo->momz *= 2; - } - } - // Bomb shield activation - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_BOMB) - { - // Don't let Super Sonic or invincibility use it - if (!(player->powers[pw_super] || player->powers[pw_invulnerability])) - P_BlackOw(player); - } - // Attract shield activation - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT) - { - if (!(player->pflags & PF_THOKKED)) - { - player->pflags |= PF_THOKKED|PF_SHIELDABILITY; - player->homing = 2; - if (P_LookForEnemies(player, false) && player->mo->tracer) - { - S_StartSound(player->mo, sfx_s3k40); - player->homing = 3*TICRATE; - } - else - S_StartSound(player->mo, sfx_s3k41); - } - } - // Elemental shield activation - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) - { - if (!(player->pflags & PF_THOKKED)) - { - player->pflags |= PF_THOKKED|PF_SHIELDABILITY; - S_StartSound(player->mo, sfx_s3k43); - player->mo->momx = player->mo->momy = 0; - P_SetObjectMomZ(player->mo, -24*FRACUNIT, false); - } - } // Force shield activation if (player->powers[pw_shield] & SH_FORCE) + ; // TODO + else { - if (!(player->pflags & PF_THOKKED)) + switch (player->powers[pw_shield] & SH_NOSTACK) { - angle_t dashangle = player->mo->angle; -#if 1 // shadow.wad style redirection - hold down directional keys to set your path, go backwards by default - if (!(player->pflags & PF_ANALOGMODE) && (player->cmd.forwardmove || player->cmd.sidemove)) - dashangle += R_PointToAngle2(0, 0, player->cmd.forwardmove<cmd.sidemove<mo->momx || player->mo->momy) - dashangle = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy); -#endif - dashangle += ANGLE_180; - P_ResetPlayer(player); - player->homing = 2 + (player->powers[pw_shield] & SH_FORCEHP); // might get ridiculous with 256 hitpoints, don't you think? - S_StartSound(player->mo, sfx_s3k47); - P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); - player->pflags |= PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY; - player->mo->flags |= MF_NOGRAVITY; - P_InstaThrust(player->mo, dashangle, 64*FRACUNIT); - player->mo->momz = 0; + // Whirlwind/Thundercoin shield activation + case SH_WHIRLWIND: + case SH_THUNDERCOIN: + if (!player->powers[pw_super]) + P_DoJumpShield(player); + break; + // Armageddon shield activation + case SH_ARMAGEDDON: + // Don't let Super Sonic or invincibility use it + if (!(player->powers[pw_super] || player->powers[pw_invulnerability])) + P_BlackOw(player); + break; + // Attract shield activation + case SH_ATTRACT: + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + player->homing = 2; + if (P_LookForEnemies(player, false) && player->mo->tracer) + { + S_StartSound(player->mo, sfx_s3k40); + player->homing = 3*TICRATE; + } + else + S_StartSound(player->mo, sfx_s3k45); + break; + // Elemental/Bubblewrap shield activation + case SH_ELEMENTAL: + case SH_BUBBLEWRAP: + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + player->mo->momx = player->mo->momy = 0; + P_SetObjectMomZ(player->mo, -24*FRACUNIT, false); + S_StartSound(player->mo, + ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) + ? sfx_s3k43 + : sfx_s3k44); + break; + // Flame shield activation + case SH_FLAMEAURA: + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + P_Thrust(player->mo, player->mo->angle, 30*player->mo->scale - FixedMul(FixedSqrt(player->speed), FixedSqrt(player->mo->scale))); + S_StartSound(player->mo, sfx_s3k43); + default: + break; } } } @@ -7084,26 +7055,7 @@ static void P_MovePlayer(player_t *player) } // HOMING option. - if (player->powers[pw_shield] & SH_FORCE // Dash. - && player->pflags & PF_SHIELDABILITY) - { - if (player->homing) - { - player->pflags |= PF_FULLSTASIS; - player->mo->momz = 0; - if (!(player->pflags & PF_SPINNING)) - player->homing = 0; - } - - if (player->homing == 0) - { - P_ResetPlayer(player); - player->pflags |= PF_THOKKED; // silly silly - player->mo->momx >>= 3; - player->mo->momy >>= 3; - } - } - else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT // Sonic 3D Blast. + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ATTRACT // Sonic 3D Blast. && player->pflags & PF_SHIELDABILITY) { if (player->homing && player->mo->tracer) diff --git a/src/st_stuff.c b/src/st_stuff.c index 08d4204af..14c879c3e 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -811,9 +811,9 @@ static void ST_drawFirstPersonHUD(void) } else switch (player->powers[pw_shield] & SH_NOSTACK) { - case SH_JUMP: p = jumpshield; break; + case SH_WHIRLWIND: p = jumpshield; break; case SH_ELEMENTAL: p = watershield; break; - case SH_BOMB: p = bombshield; break; + case SH_ARMAGEDDON: p = bombshield; break; case SH_ATTRACT: p = ringshield; break; case SH_PITY: p = pityshield; break; case SH_FLAMEAURA: p = flameshield; break; From 76700241f675f900194e507a2a41feaf9ac6cc8b Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 211/808] Leaky Mario mode bug fixed. --- src/p_inter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_inter.c b/src/p_inter.c index 822602fd8..3b8707e62 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2304,7 +2304,8 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget target->fuse = TICRATE*3; // timer before mobj disappears from view (even if not an actual player) if (!mariodeathpit) { - target->player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + if (mariomode) + target->player->powers[pw_marioflashing] = MARIOFLASHINGTICS; target->momx = target->momy = target->momz = 0; } if (damagetype == DMG_DROWNED) // drowned From 76b30df52808bec5dff031b07527359b935d1f61 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 13 Oct 2016 15:13:33 +0100 Subject: [PATCH 212/808] * Slower Bubblewrap animation. * Corrected bounce height for Elemental underwater. * Using Elemental ability in goo is cancelled. * Different Attract failure sound. --- src/info.c | 18 +++++++++--------- src/p_mobj.c | 9 ++++++++- src/p_user.c | 2 +- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/info.c b/src/info.c index 56edd0b85..9aea3b3df 100644 --- a/src/info.c +++ b/src/info.c @@ -2175,15 +2175,15 @@ state_t states[NUMSTATES] = {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|16, 2, {NULL}, 0, 0, S_FIRSB9}, // S_FIRSB8 {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|17, 2, {NULL}, 0, 0, S_FIRSB1}, // S_FIRSB9 - {SPR_BUBS, FF_TRANS30 , 2, {NULL}, 0, 0, S_BUBS2}, // S_BUBS1 - {SPR_BUBS, FF_TRANS30|1, 2, {NULL}, 0, 0, S_BUBS3}, // S_BUBS2 - {SPR_BUBS, FF_TRANS30|2, 2, {NULL}, 0, 0, S_BUBS4}, // S_BUBS3 - {SPR_BUBS, FF_TRANS30|3, 2, {NULL}, 0, 0, S_BUBS5}, // S_BUBS4 - {SPR_BUBS, FF_TRANS30|4, 2, {NULL}, 0, 0, S_BUBS6}, // S_BUBS5 - {SPR_BUBS, FF_TRANS30|5, 2, {NULL}, 0, 0, S_BUBS7}, // S_BUBS6 - {SPR_BUBS, FF_TRANS30|6, 2, {NULL}, 0, 0, S_BUBS8}, // S_BUBS7 - {SPR_BUBS, FF_TRANS30|7, 2, {NULL}, 0, 0, S_BUBS9}, // S_BUBS8 - {SPR_BUBS, FF_TRANS30|8, 2, {NULL}, 0, 0, S_BUBS1}, // S_BUBS9 + {SPR_BUBS, FF_TRANS30 , 3, {NULL}, 0, 0, S_BUBS2}, // S_BUBS1 + {SPR_BUBS, FF_TRANS30|1, 3, {NULL}, 0, 0, S_BUBS3}, // S_BUBS2 + {SPR_BUBS, FF_TRANS30|2, 3, {NULL}, 0, 0, S_BUBS4}, // S_BUBS3 + {SPR_BUBS, FF_TRANS30|3, 3, {NULL}, 0, 0, S_BUBS5}, // S_BUBS4 + {SPR_BUBS, FF_TRANS30|4, 3, {NULL}, 0, 0, S_BUBS6}, // S_BUBS5 + {SPR_BUBS, FF_TRANS30|5, 3, {NULL}, 0, 0, S_BUBS7}, // S_BUBS6 + {SPR_BUBS, FF_TRANS30|6, 3, {NULL}, 0, 0, S_BUBS8}, // S_BUBS7 + {SPR_BUBS, FF_TRANS30|7, 3, {NULL}, 0, 0, S_BUBS9}, // S_BUBS8 + {SPR_BUBS, FF_TRANS30|8, 3, {NULL}, 0, 0, S_BUBS1}, // S_BUBS9 {SPR_BUBS, FF_TRANS30| 9, 2, {NULL}, 0, 0, S_BUBSB2}, // S_BUBSB1 {SPR_BUBS, FF_TRANS30|10, 2, {NULL}, 0, 0, S_BUBSB3}, // S_BUBSB2 diff --git a/src/p_mobj.c b/src/p_mobj.c index 840d4aa49..8da0a2360 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3246,7 +3246,11 @@ static void P_PlayerZMovement(mobj_t *mo) S_StartSound(mo, sfx_s3k47); P_ElementalFire(mo->player, true); } - P_SetObjectMomZ(mo, 5*FRACUNIT/2, false); + P_SetObjectMomZ(mo, + (mo->eflags & MFE_UNDERWATER) + ? 6*FRACUNIT/5 + : 5*FRACUNIT/2, + false); P_SetPlayerMobjState(mo, S_PLAY_FALL); clipmomz = false; } @@ -3637,6 +3641,9 @@ void P_MobjCheckWater(mobj_t *mobj) // Then we'll set it! p->powers[pw_underwater] = underwatertics + 1; } + + if ((mobj->eflags & MFE_GOOWATER) && (p->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL && (p->pflags & PF_SHIELDABILITY)) + p->pflags &= ~PF_SHIELDABILITY; } // The rest of this code only executes on a water state change. diff --git a/src/p_user.c b/src/p_user.c index 85f640108..adaacfaba 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7017,7 +7017,7 @@ static void P_MovePlayer(player_t *player) player->homing = 3*TICRATE; } else - S_StartSound(player->mo, sfx_s3k45); + S_StartSound(player->mo, sfx_s3ka6); break; // Elemental/Bubblewrap shield activation case SH_ELEMENTAL: From c693af96b16bb1bdaf1e78b87d18e867fb7bcd13 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Oct 2016 14:03:32 +0100 Subject: [PATCH 213/808] * Bubble bounce completed (minus graphics). * Flame burst fixed with respect to scale. --- src/p_inter.c | 2 +- src/p_map.c | 3 ++- src/p_mobj.c | 10 +++++++++- src/p_user.c | 2 +- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 3b8707e62..ce5209a41 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -295,7 +295,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; #endif - elementalpierce = (((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) && (player->pflags & PF_SHIELDABILITY)); + elementalpierce = (((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL || (player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (player->pflags & PF_SHIELDABILITY)); if (special->flags & MF_BOSS) { diff --git a/src/p_map.c b/src/p_map.c index bb904cc3d..6c4ea979a 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1052,7 +1052,8 @@ static boolean PIT_CheckThing(mobj_t *thing) else if (thing->z - FixedMul(FRACUNIT, thing->scale) <= tmthing->z + tmthing->height && thing->z + thing->height + FixedMul(FRACUNIT, thing->scale) >= tmthing->z) { - boolean elementalpierce = (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) + boolean elementalpierce = (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL + || (tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (tmthing->player->pflags & PF_SHIELDABILITY)); if (thing->flags & MF_MONITOR && (tmthing->player->pflags & (PF_SPINNING|PF_GLIDING) diff --git a/src/p_mobj.c b/src/p_mobj.c index 8da0a2360..87f40b2fc 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3252,6 +3252,14 @@ static void P_PlayerZMovement(mobj_t *mo) : 5*FRACUNIT/2, false); P_SetPlayerMobjState(mo, S_PLAY_FALL); + mo->momx = mo->momy = 0; + clipmomz = false; + } + else if ((mo->player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) // Bubble shield's bounce attack. + { + S_StartSound(mo, sfx_s3k44); + P_DoJump(mo->player, false); + mo->momz = FixedMul(mo->momz, 5*FRACUNIT/4); clipmomz = false; } } @@ -3642,7 +3650,7 @@ void P_MobjCheckWater(mobj_t *mobj) p->powers[pw_underwater] = underwatertics + 1; } - if ((mobj->eflags & MFE_GOOWATER) && (p->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL && (p->pflags & PF_SHIELDABILITY)) + if ((mobj->eflags & MFE_GOOWATER) && ((p->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL || (p->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (p->pflags & PF_SHIELDABILITY)) p->pflags &= ~PF_SHIELDABILITY; } diff --git a/src/p_user.c b/src/p_user.c index adaacfaba..93823542d 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7033,7 +7033,7 @@ static void P_MovePlayer(player_t *player) // Flame shield activation case SH_FLAMEAURA: player->pflags |= PF_THOKKED|PF_SHIELDABILITY; - P_Thrust(player->mo, player->mo->angle, 30*player->mo->scale - FixedMul(FixedSqrt(player->speed), FixedSqrt(player->mo->scale))); + P_Thrust(player->mo, player->mo->angle, FixedMul(30*FRACUNIT - FixedSqrt(FixedDiv(player->speed, player->mo->scale)), player->mo->scale)); S_StartSound(player->mo, sfx_s3k43); default: break; From 366e282495ecec867b640fab0b8f705563adee66 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Oct 2016 14:39:32 +0100 Subject: [PATCH 214/808] Cleaned up the shield-ability stuff to be cleaner (and reduce MT_OVERLAY thinking). --- src/p_mobj.c | 63 +++++++++++++++++++++++++++++----------------------- src/p_user.c | 1 + 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 87f40b2fc..ba6e7cd41 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6776,50 +6776,57 @@ void P_MobjThinker(mobj_t *mobj) } else P_AddOverlay(mobj); - if ((mobj->target->type == MT_ELEMENTAL_ORB) - && (mobj->target->target) - && (mobj->target->target->player) - && ((mobj->target->target->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) - && (mobj->target->target->player->pflags & PF_SHIELDABILITY) - && (mobj->state->nextstate < mobj->target->info->raisestate)) // Special casing for elemental shield piercing attack. - { - P_SetMobjState(mobj, mobj->target->info->raisestate); - mobj->tics++; - } - else if ((mobj->target->type == MT_THUNDERCOIN_ORB) - && (mobj->target->target) - && (mobj->target->target->player) - && ((mobj->target->target->player->powers[pw_shield] & SH_NOSTACK) == SH_THUNDERCOIN) - && (mobj->target->target->player->pflags & PF_SHIELDABILITY)) // Special casing for thundercoin shield jump.. - { - P_SetMobjState(mobj, mobj->target->info->raisestate); - P_SetMobjState(mobj->target, mobj->target->info->painstate); - mobj->target->target->player->pflags &= ~PF_SHIELDABILITY; - mobj->tics++; - } break; - case MT_ARMAGEDDON_ORB: - case MT_WHIRLWIND_ORB: - case MT_ELEMENTAL_ORB: - case MT_FORCE_ORB: case MT_PITY_ORB: + case MT_WHIRLWIND_ORB: + case MT_ARMAGEDDON_ORB: + case MT_FORCE_ORB: case MT_FLAMEAURA_ORB: case MT_BUBBLEWRAP_ORB: - case MT_THUNDERCOIN_ORB: if (!P_AddShield(mobj)) return; break; case MT_ATTRACT_ORB: if (!P_AddShield(mobj)) return; - if ((mobj->target) + if (/*(mobj->target) -- the following is implicit by P_AddShield && (mobj->target->player) - && (mobj->target->player->homing)) + &&*/ (mobj->target->player->homing)) { P_SetMobjState(mobj, mobj->info->painstate); mobj->tics++; } break; + case MT_ELEMENTAL_ORB: + if (!P_AddShield(mobj)) + return; + if (mobj->tracer + /* && mobj->target -- the following is implicit by P_AddShield + && mobj->target->player + && (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL*/ + && (mobj->target->player->pflags & PF_SHIELDABILITY) + && (mobj->tracer->state->nextstate < mobj->info->raisestate)) + { + P_SetMobjState(mobj->tracer, mobj->info->raisestate); + mobj->tracer->tics++; + } + break; + case MT_THUNDERCOIN_ORB: + if (!P_AddShield(mobj)) + return; + if (mobj->tracer + /* && mobj->target -- the following is implicit by P_AddShield + && mobj->target->player + && (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_THUNDERCOIN*/ + && (mobj->target->player->pflags & PF_SHIELDABILITY)) + { + P_SetMobjState(mobj, mobj->info->painstate); + mobj->tics++; + P_SetMobjState(mobj->tracer, mobj->info->raisestate); + mobj->tracer->tics++; + mobj->target->player->pflags &= ~PF_SHIELDABILITY; // prevent eternal spark + } + break; case MT_WATERDROP: P_SceneryCheckWater(mobj); if ((mobj->z <= mobj->floorz || mobj->z <= mobj->watertop) diff --git a/src/p_user.c b/src/p_user.c index 93823542d..28ddd364b 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1398,6 +1398,7 @@ void P_SpawnShieldOrb(player_t *player) ov = P_SpawnMobj(shieldobj->x, shieldobj->y, shieldobj->z, MT_OVERLAY); P_SetTarget(&ov->target, shieldobj); P_SetMobjState(ov, shieldobj->info->seestate); + P_SetTarget(&shieldobj->tracer, ov); } if (shieldobj->info->meleestate) { From e107fe498b3c1384b1a02776b652caad3dcfefce Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Oct 2016 18:01:43 +0100 Subject: [PATCH 215/808] Adding new sounds for SRB2 shields. --- src/info.c | 10 +++++----- src/sounds.c | 9 +++++++-- src/sounds.h | 5 +++++ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/info.c b/src/info.c index 9aea3b3df..097b288fa 100644 --- a/src/info.c +++ b/src/info.c @@ -7086,7 +7086,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_FORCE_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_shield, // seesound + sfx_forcsg, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -7113,7 +7113,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_ARMAGEDDON_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_s3k3e, // seesound + sfx_armasg, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -7140,7 +7140,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_WHIRLWIND_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_shield, // seesound + sfx_wirlsg, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -7167,7 +7167,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_ELEMENTAL_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_s3k3f, // seesound + sfx_elemsg, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate @@ -10853,7 +10853,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound - SH_ARMAGEDDON, // speed + SH_ARMAGEDDON, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height 2, // display offset diff --git a/src/sounds.c b/src/sounds.c index 75ee1358c..b551b73b5 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -165,8 +165,12 @@ sfxinfo_t S_sfx[NUMSFX] = {"rail1", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"rail2", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"rlaunc", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"shield", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"shldls", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"shield", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // generic GET! + {"wirlsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Whirlwind GET! + {"forcsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Force GET! + {"elemsg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Elemental GET! + {"armasg", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Armaggeddon GET! + {"shldls", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // You LOSE! {"spdpad", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"spkdth", false, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"spring", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -183,6 +187,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"wdjump", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"mswarp", false, 60, 16, -1, NULL, 0, -1, -1, LUMPERROR}, {"mspogo", false, 60, 8, -1, NULL, 0, -1, -1, LUMPERROR}, + {"boingf", false, 60, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Menu, interface {"chchng", false, 120, 0, -1, NULL, 0, -1, -1, LUMPERROR}, diff --git a/src/sounds.h b/src/sounds.h index 532c61da6..42fa4c308 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -229,6 +229,10 @@ typedef enum sfx_rail2, sfx_rlaunc, sfx_shield, + sfx_wirlsg, + sfx_forcsg, + sfx_elemsg, + sfx_armasg, sfx_shldls, sfx_spdpad, sfx_spkdth, @@ -246,6 +250,7 @@ typedef enum sfx_wdjump, sfx_mswarp, sfx_mspogo, + sfx_boingf, // Menu, interface sfx_chchng, From beecd72a220c6dd967648e3620077ef6e43b4c9c Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Oct 2016 20:39:22 +0100 Subject: [PATCH 216/808] BUBBLE BOUNCE ANIMATION --- src/dehacked.c | 6 ++++++ src/info.c | 22 +++++++++++++++------- src/info.h | 6 ++++++ src/p_mobj.c | 40 ++++++++++++++++++++++++++++++++++------ 4 files changed, 61 insertions(+), 13 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index cfaa7b526..239e1fe42 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5457,11 +5457,17 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_BUBS8", "S_BUBS9", + "S_BUBS10", + "S_BUBS11", + "S_BUBSB1", "S_BUBSB2", "S_BUBSB3", "S_BUBSB4", + "S_BUBSB5", + "S_BUBSB6", + "S_ZAPS1", "S_ZAPS2", "S_ZAPS3", diff --git a/src/info.c b/src/info.c index 097b288fa..92d02a0a0 100644 --- a/src/info.c +++ b/src/info.c @@ -2096,6 +2096,7 @@ state_t states[NUMSTATES] = {SPR_MAGN, FF_FULLBRIGHT|FF_TRANS40| 9, 2, {NULL}, 0, 0, S_MAGN11}, // S_MAGN10 {SPR_MAGN, FF_FULLBRIGHT|FF_TRANS40|10, 2, {NULL}, 0, 0, S_MAGN12}, // S_MAGN11 {SPR_MAGN, FF_FULLBRIGHT|FF_TRANS40|11, 2, {NULL}, 0, 0, S_MAGN1 }, // S_MAGN12 + {SPR_MAGN, FF_FULLBRIGHT|FF_TRANS10|12, 2, {NULL}, 0, 0, S_MAGN1 }, // S_MAGN13 {SPR_FORC, FF_TRANS50 , 3, {NULL}, 0, 0, S_FORC2 }, // S_FORC1 @@ -2141,6 +2142,7 @@ state_t states[NUMSTATES] = {SPR_ELEM, FF_FULLBRIGHT|17, 3, {NULL}, 0, 0, S_ELEMF7 }, // S_ELEMF6 {SPR_ELEM, FF_FULLBRIGHT|18, 3, {NULL}, 0, 0, S_ELEMF8 }, // S_ELEMF7 {SPR_ELEM, FF_FULLBRIGHT|19, 3, {NULL}, 0, 0, S_ELEMF1 }, // S_ELEMF8 + {SPR_ELEM, FF_FULLBRIGHT|20, 1, {NULL}, 0, 0, S_ELEMF10}, // S_ELEMF9 {SPR_NULL, 0, 1, {NULL}, 0, 0, S_ELEMF1 }, // S_ELEMF10 @@ -2185,10 +2187,16 @@ state_t states[NUMSTATES] = {SPR_BUBS, FF_TRANS30|7, 3, {NULL}, 0, 0, S_BUBS9}, // S_BUBS8 {SPR_BUBS, FF_TRANS30|8, 3, {NULL}, 0, 0, S_BUBS1}, // S_BUBS9 - {SPR_BUBS, FF_TRANS30| 9, 2, {NULL}, 0, 0, S_BUBSB2}, // S_BUBSB1 - {SPR_BUBS, FF_TRANS30|10, 2, {NULL}, 0, 0, S_BUBSB3}, // S_BUBSB2 - {SPR_BUBS, FF_TRANS30|11, 2, {NULL}, 0, 0, S_BUBSB4}, // S_BUBSB3 - {SPR_BUBS, FF_TRANS30|10, 2, {NULL}, 0, 0, S_BUBSB1}, // S_BUBSB4 + {SPR_NULL, 0, 3, {NULL}, 0, 0, S_BUBS1}, // S_BUBS10 + {SPR_NULL, 0, 4*3, {NULL}, 0, 0, S_BUBS1}, // S_BUBS11 + + {SPR_BUBS, FF_TRANS30| 9, 3, {NULL}, 0, 0, S_BUBSB2}, // S_BUBSB1 + {SPR_BUBS, FF_TRANS30|10, 3, {NULL}, 0, 0, S_BUBSB3}, // S_BUBSB2 + {SPR_BUBS, FF_TRANS30|11, 3, {NULL}, 0, 0, S_BUBSB4}, // S_BUBSB3 + {SPR_BUBS, FF_TRANS30|10, 3, {NULL}, 0, 0, S_BUBSB1}, // S_BUBSB4 + + {SPR_BUBS, FF_TRANS30|12, 3, {NULL}, 0, 0, S_BUBSB3}, // S_BUBSB5 + {SPR_BUBS, FF_TRANS30|13, 3, {NULL}, 0, 0, S_BUBSB5}, // S_BUBSB6 {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20 , 2, {NULL}, 0, 0, S_ZAPS2 }, // S_ZAPS1 {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20| 1, 2, {NULL}, 0, 0, S_ZAPS3 }, // S_ZAPS2 @@ -10953,7 +10961,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // seesound 8, // reactiontime sfx_None, // attacksound - S_NULL, // painstate + S_BUBSB5, // painstate SKINCOLOR_NONE, // painchance sfx_None, // painsound S_NULL, // meleestate @@ -10964,12 +10972,12 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = SH_BUBBLEWRAP, // speed 64*FRACUNIT, // radius 64*FRACUNIT, // height - -2, // display offset + 2, // display offset 16, // mass 0, // damage sfx_None, // activesound MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags - S_NULL // raisestate + S_BUBS10 // raisestate }, { // MT_THUNDERCOIN_ORB diff --git a/src/info.h b/src/info.h index a18a374d9..2ae93f4c1 100644 --- a/src/info.h +++ b/src/info.h @@ -2371,11 +2371,17 @@ typedef enum state S_BUBS8, S_BUBS9, + S_BUBS10, + S_BUBS11, + S_BUBSB1, S_BUBSB2, S_BUBSB3, S_BUBSB4, + S_BUBSB5, + S_BUBSB6, + S_ZAPS1, S_ZAPS2, S_ZAPS3, diff --git a/src/p_mobj.c b/src/p_mobj.c index ba6e7cd41..e929b8426 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6782,7 +6782,6 @@ void P_MobjThinker(mobj_t *mobj) case MT_ARMAGEDDON_ORB: case MT_FORCE_ORB: case MT_FLAMEAURA_ORB: - case MT_BUBBLEWRAP_ORB: if (!P_AddShield(mobj)) return; break; @@ -6791,7 +6790,7 @@ void P_MobjThinker(mobj_t *mobj) return; if (/*(mobj->target) -- the following is implicit by P_AddShield && (mobj->target->player) - &&*/ (mobj->target->player->homing)) + && */ (mobj->target->player->homing)) { P_SetMobjState(mobj, mobj->info->painstate); mobj->tics++; @@ -6803,21 +6802,50 @@ void P_MobjThinker(mobj_t *mobj) if (mobj->tracer /* && mobj->target -- the following is implicit by P_AddShield && mobj->target->player - && (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL*/ - && (mobj->target->player->pflags & PF_SHIELDABILITY) - && (mobj->tracer->state->nextstate < mobj->info->raisestate)) + && (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL */ + && mobj->target->player->pflags & PF_SHIELDABILITY + && ((statenum_t)(mobj->tracer->state-states) < mobj->info->raisestate + || (mobj->tracer->state->nextstate < mobj->info->raisestate && mobj->tracer->tics == 1))) { P_SetMobjState(mobj->tracer, mobj->info->raisestate); mobj->tracer->tics++; } break; + case MT_BUBBLEWRAP_ORB: + if (!P_AddShield(mobj)) + return; + if (mobj->tracer + /* && mobj->target -- the following is implicit by P_AddShield + && mobj->target->player + && (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP */ + ) + { + if (mobj->target->player->pflags & PF_SHIELDABILITY + && ((statenum_t)(mobj->state-states) < mobj->info->painstate + || (mobj->state->nextstate < mobj->info->painstate && mobj->tics == 1))) + { + P_SetMobjState(mobj, mobj->info->painstate); + mobj->tics++; + P_SetMobjState(mobj->tracer, mobj->info->raisestate); + mobj->tracer->tics++; + } + else if (mobj->target->eflags & MFE_JUSTHITFLOOR + && (statenum_t)(mobj->state-states) == mobj->info->painstate) + { + P_SetMobjState(mobj, mobj->info->painstate+1); + mobj->tics++; + P_SetMobjState(mobj->tracer, mobj->info->raisestate+1); + mobj->tracer->tics++; + } + } + break; case MT_THUNDERCOIN_ORB: if (!P_AddShield(mobj)) return; if (mobj->tracer /* && mobj->target -- the following is implicit by P_AddShield && mobj->target->player - && (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_THUNDERCOIN*/ + && (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_THUNDERCOIN */ && (mobj->target->player->pflags & PF_SHIELDABILITY)) { P_SetMobjState(mobj, mobj->info->painstate); From 51ffa6d5eaa50aee99a4953933da4052c4d9d45c Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Oct 2016 21:23:58 +0100 Subject: [PATCH 217/808] Kill an overlay if the target is removed between P_AddOverlay and P_RunOverlays. --- src/p_mobj.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index e929b8426..1541ea79c 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6499,6 +6499,13 @@ void P_RunOverlays(void) if (!mo->target) continue; + + if (P_MobjWasRemoved(mo->target)) + { + P_RemoveMobj(mo); + continue; + } + if (!splitscreen /*&& rendermode != render_soft*/) { angle_t viewingangle; From 0e73924ebbb52f5e19560bcde265c3c39c5db676 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Oct 2016 21:24:10 +0100 Subject: [PATCH 218/808] Changed the pity shield sound to one with a higher volume. --- src/info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/info.c b/src/info.c index 92d02a0a0..b563c71fd 100644 --- a/src/info.c +++ b/src/info.c @@ -7040,7 +7040,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_PITY_ICON1, // spawnstate 1, // spawnhealth S_NULL, // seestate - sfx_shield, // seesound + sfx_s3k3a, // seesound 8, // reactiontime sfx_None, // attacksound S_NULL, // painstate From 9b4c81ed0bbd4cd4115c796604b286f27c4e5d49 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 17 Oct 2016 23:22:04 +0100 Subject: [PATCH 219/808] Thundercoin shield complete. --- src/dehacked.c | 6 +++++- src/info.c | 30 ++++++++++++++++++++++++++++++ src/info.h | 6 +++++- src/p_user.c | 18 +++++++++++++++++- 4 files changed, 57 insertions(+), 3 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 239e1fe42..8c6147424 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5497,6 +5497,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_ZAPSB10", "S_ZAPSB11", // blank frame + // Thunder spark + "S_THUNDERCOIN_SPARK", + // Invincibility Sparkles "S_IVSP", @@ -6523,7 +6526,8 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_FLAMEAURA_ORB", // Flame shield mobj "MT_BUBBLEWRAP_ORB", // Bubble shield mobj "MT_THUNDERCOIN_ORB", // Thunder shield mobj - "MT_IVSP", // invincibility sparkles + "MT_THUNDERCOIN_SPARK", // Thunder spark + "MT_IVSP", // Invincibility sparkles "MT_SUPERSPARK", // Super Sonic Spark // Freed Animals diff --git a/src/info.c b/src/info.c index b563c71fd..85630766a 100644 --- a/src/info.c +++ b/src/info.c @@ -2227,6 +2227,9 @@ state_t states[NUMSTATES] = {SPR_ZAPS, FF_FULLBRIGHT|FF_TRANS20 , 2, {NULL}, 0, 0, S_ZAPSB11}, // S_ZAPSB10 {SPR_NULL, 0, 15*2, {NULL}, 0, 0, S_ZAPSB2 }, // S_ZAPSB11 + // Thunder spark + {SPR_SSPK, FF_ANIMATE, 18, {NULL}, 1, 2, S_NULL}, // S_THUNDERCOIN_SPARK + // Invincibility Sparkles {SPR_IVSP, FF_ANIMATE, 32, {NULL}, 31, 1, S_NULL}, // S_IVSP @@ -11007,6 +11010,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_ZAPS14 // raisestate }, + { // MT_THUNDERCOIN_SPARK + -1, // doomednum + S_THUNDERCOIN_SPARK, // 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_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 4*FRACUNIT, // radius + 4*FRACUNIT, // height + 0, // display offset + 100, // mass + 0, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags + S_NULL // raisestate + }, + { // MT_IVSP -1, // doomednum S_IVSP, // spawnstate diff --git a/src/info.h b/src/info.h index 2ae93f4c1..618e848c5 100644 --- a/src/info.h +++ b/src/info.h @@ -2411,6 +2411,9 @@ typedef enum state S_ZAPSB10, S_ZAPSB11, // blank frame + //Thunder spark + S_THUNDERCOIN_SPARK, + // Invincibility Sparkles S_IVSP, @@ -3456,7 +3459,8 @@ typedef enum mobj_type MT_FLAMEAURA_ORB, // Flame shield mobj MT_BUBBLEWRAP_ORB, // Bubble shield mobj MT_THUNDERCOIN_ORB, // Thunder shield mobj - MT_IVSP, // invincibility sparkles + MT_THUNDERCOIN_SPARK, // Thunder spark + MT_IVSP, // Invincibility sparkles MT_SUPERSPARK, // Super Sonic Spark // Freed Animals diff --git a/src/p_user.c b/src/p_user.c index 28ddd364b..2deda6d60 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3941,6 +3941,20 @@ void P_DoJumpShield(player_t *player) player->pflags &= ~PF_SPINNING; if (electric) { + mobj_t *spark; + INT32 i; +#define numangles 6 +#define limitangle (360/numangles) + angle_t travelangle = player->mo->angle + P_RandomRange(-limitangle, limitangle)*ANG1; + for (i = 0; i < numangles; i++) + { + spark = P_SpawnMobjFromMobj(player->mo, 0, 0, 0, MT_THUNDERCOIN_SPARK); + P_InstaThrust(spark, travelangle + i*(ANGLE_MAX/numangles), FixedMul(4*FRACUNIT, spark->scale)); + if (i % 2) + P_SetObjectMomZ(spark, -4*FRACUNIT, false); + } +#undef limitangle +#undef numangles S_StartSound(player->mo, sfx_s3k45); } else @@ -6304,8 +6318,9 @@ void P_ElementalFire(player_t *player, boolean cropcircle) if (cropcircle) { - travelangle = player->mo->angle + P_RandomRange(-ANGLE_45, ANGLE_45); #define numangles 8 +#define limitangle (180/numangles) + travelangle = player->mo->angle + P_RandomRange(-limitangle, limitangle)*ANG1; for (i = 0; i < numangles; i++) { flame = P_SpawnMobj(player->mo->x, player->mo->y, ground, MT_SPINFIRE); @@ -6319,6 +6334,7 @@ void P_ElementalFire(player_t *player, boolean cropcircle) P_InstaThrust(flame, flame->angle, FixedMul(3*FRACUNIT, flame->scale)); P_SetObjectMomZ(flame, 3*FRACUNIT, false); } +#undef limitangle #undef numangles } else From e1baf02b7a3f2dd27ccf8bcf6089c5d765dfe756 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 18 Oct 2016 22:07:20 +0100 Subject: [PATCH 220/808] Lua now errors if negative scales are used with v.drawScaled --- src/lua_hudlib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 7aadd9c0e..60cbbe501 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -369,6 +369,8 @@ static int libd_drawScaled(lua_State *L) x = luaL_checkinteger(L, 1); y = luaL_checkinteger(L, 2); scale = luaL_checkinteger(L, 3); + if (scale < 0) + return luaL_error(L, "negative scale"); patch = *((patch_t **)luaL_checkudata(L, 4, META_PATCH)); flags = luaL_optinteger(L, 5, 0); if (!lua_isnoneornil(L, 6)) From aa3e52f05e5b044e4f9a6f710027fae020b625c7 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Wed, 19 Oct 2016 03:17:36 -0400 Subject: [PATCH 221/808] Fix ANIMDEFS parsing to allow overwrite. ANIMATED and ANIMDEFS are now processed in reverse order, and duplicate definitions in ANIMDEFS are dropped. --- src/p_spec.c | 111 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 66 insertions(+), 45 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index cb928eeef..b04c55881 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -221,8 +221,8 @@ static animdef_t harddefs[] = static animdef_t *animdefs = NULL; // A prototype; here instead of p_spec.h, so they're "private" -void P_ParseANIMDEFSLump(INT32 wadNum, UINT16 lumpnum, INT32 *i); -void P_ParseAnimationDefintion(SINT8 istexture, INT32 *i); +void P_ParseANIMDEFSLump(INT32 wadNum, UINT16 lumpnum); +void P_ParseAnimationDefintion(SINT8 istexture); /** Sets up texture and flat animations. * @@ -232,24 +232,21 @@ void P_ParseAnimationDefintion(SINT8 istexture, INT32 *i); * Issues an error if any animation cycles are invalid. * * \sa P_FindAnimatedFlat, P_SetupLevelFlatAnims - * \author Steven McGranahan (original), Shadow Hog (had to rewrite it to handle multiple WADs) + * \author Steven McGranahan (original), Shadow Hog (had to rewrite it to handle multiple WADs), JTE (had to rewrite it to handle multiple WADs _correctly_) */ void P_InitPicAnims(void) { // Init animation - INT32 i; // Position in the animdefs array INT32 w; // WAD - UINT8 *wadAnimdefs; // not to be confused with animdefs, the combined total of every ANIMATED lump in every WAD, or ANIMDEFS, the ZDoom lump I intend to implement later + UINT8 *animatedLump; UINT8 *currentPos; + size_t i; + + I_Assert(animdefs == NULL); if (W_CheckNumForName("ANIMATED") != LUMPERROR || W_CheckNumForName("ANIMDEFS") != LUMPERROR) { - if (animdefs) - { - Z_Free(animdefs); - animdefs = NULL; - } - for (w = 0, i = 0, maxanims = 0; w < numwadfiles; w++) + for (w = numwadfiles-1, maxanims = 0; w >= 0; w--) { UINT16 animatedLumpNum; UINT16 animdefsLumpNum; @@ -258,20 +255,20 @@ void P_InitPicAnims(void) animatedLumpNum = W_CheckNumForNamePwad("ANIMATED", w, 0); if (animatedLumpNum != INT16_MAX) { - wadAnimdefs = (UINT8 *)W_CacheLumpNumPwad(w, animatedLumpNum, PU_STATIC); + animatedLump = (UINT8 *)W_CacheLumpNumPwad(w, animatedLumpNum, PU_STATIC); // Get the number of animations in the file - for (currentPos = wadAnimdefs; *currentPos != UINT8_MAX; maxanims++, currentPos+=23); + i = maxanims; + for (currentPos = animatedLump; *currentPos != UINT8_MAX; maxanims++, currentPos+=23); // Resize animdefs (or if it hasn't been created, create it) animdefs = (animdef_t *)Z_Realloc(animdefs, sizeof(animdef_t)*(maxanims + 1), PU_STATIC, NULL); // Sanity check it - if (!animdefs) { + if (!animdefs) I_Error("Not enough free memory for ANIMATED data"); - } // Populate the new array - for (currentPos = wadAnimdefs; *currentPos != UINT8_MAX; i++, currentPos+=23) + for (currentPos = animatedLump; *currentPos != UINT8_MAX; i++, currentPos+=23) { M_Memcpy(&(animdefs[i].istexture), currentPos, 1); // istexture, 1 byte M_Memcpy(animdefs[i].endname, (currentPos + 1), 9); // endname, 9 bytes @@ -279,15 +276,13 @@ void P_InitPicAnims(void) M_Memcpy(&(animdefs[i].speed), (currentPos + 19), 4); // speed, 4 bytes } - Z_Free(wadAnimdefs); + Z_Free(animatedLump); } // Now find ANIMDEFS animdefsLumpNum = W_CheckNumForNamePwad("ANIMDEFS", w, 0); if (animdefsLumpNum != INT16_MAX) - { - P_ParseANIMDEFSLump(w, animdefsLumpNum, &i); - } + P_ParseANIMDEFSLump(w, animdefsLumpNum); } // Define the last one animdefs[maxanims].istexture = -1; @@ -347,16 +342,20 @@ void P_InitPicAnims(void) lastanim->istexture = -1; R_ClearTextureNumCache(false); + // Clear animdefs now that we're done with it. + // We'll only be using anims from now on. if (animdefs != harddefs) - Z_ChangeTag(animdefs, PU_CACHE); + Z_Free(animdefs); + animdefs = NULL; } -void P_ParseANIMDEFSLump(INT32 wadNum, UINT16 lumpnum, INT32 *i) +void P_ParseANIMDEFSLump(INT32 wadNum, UINT16 lumpnum) { char *animdefsLump; size_t animdefsLumpLength; char *animdefsText; char *animdefsToken; + char *p; // Since lumps AREN'T \0-terminated like I'd assumed they should be, I'll // need to make a space of memory where I can ensure that it will terminate @@ -376,18 +375,19 @@ void P_ParseANIMDEFSLump(INT32 wadNum, UINT16 lumpnum, INT32 *i) Z_Free(animdefsLump); // Now, let's start parsing this thing - animdefsToken = M_GetToken(animdefsText); + p = animdefsText; + animdefsToken = M_GetToken(p); while (animdefsToken != NULL) { if (stricmp(animdefsToken, "TEXTURE") == 0) { Z_Free(animdefsToken); - P_ParseAnimationDefintion(1, i); + P_ParseAnimationDefintion(1); } else if (stricmp(animdefsToken, "FLAT") == 0) { Z_Free(animdefsToken); - P_ParseAnimationDefintion(0, i); + P_ParseAnimationDefintion(0); } else if (stricmp(animdefsToken, "OSCILLATE") == 0) { @@ -398,23 +398,22 @@ void P_ParseANIMDEFSLump(INT32 wadNum, UINT16 lumpnum, INT32 *i) { I_Error("Error parsing ANIMDEFS lump: Expected \"TEXTURE\" or \"FLAT\", got \"%s\"",animdefsToken); } - animdefsToken = M_GetToken(NULL); + // parse next line + while (*p != '\0' && *p != '\n') ++p; + if (*p == '\n') ++p; + animdefsToken = M_GetToken(p); } Z_Free(animdefsToken); Z_Free((void *)animdefsText); } -void P_ParseAnimationDefintion(SINT8 istexture, INT32 *i) +void P_ParseAnimationDefintion(SINT8 istexture) { char *animdefsToken; size_t animdefsTokenLength; char *endPos; INT32 animSpeed; - - // Increase the size to make room for the new animation definition - maxanims++; - animdefs = (animdef_t *)Z_Realloc(animdefs, sizeof(animdef_t)*(maxanims + 1), PU_STATIC, NULL); - animdefs[*i].istexture = istexture; + size_t i; // Startname animdefsToken = M_GetToken(NULL); @@ -448,14 +447,39 @@ void P_ParseAnimationDefintion(SINT8 istexture, INT32 *i) { I_Error("Error parsing ANIMDEFS lump: lump name \"%s\" exceeds 8 characters", animdefsToken); } - strncpy(animdefs[*i].startname, animdefsToken, 9); + + // Search for existing animdef + for (i = 0; i < maxanims; i++) + if (stricmp(animdefsToken, animdefs[i].startname) == 0) + { + //CONS_Alert(CONS_NOTICE, "Duplicate animation: %s\n", animdefsToken); + + // If we weren't parsing in reverse order, we would `break` here and parse the new data into the existing slot we found. + // Instead, we're just going to skip parsing the rest of this line entirely. + Z_Free(animdefsToken); + return; + } + + // Not found + if (i == maxanims) + { + // Increase the size to make room for the new animation definition + maxanims++; + animdefs = (animdef_t *)Z_Realloc(animdefs, sizeof(animdef_t)*(maxanims + 1), PU_STATIC, NULL); + strncpy(animdefs[i].startname, animdefsToken, 9); + } + + // animdefs[i].startname is now set to animdefsToken either way. Z_Free(animdefsToken); + // set texture type + animdefs[i].istexture = istexture; + // "RANGE" animdefsToken = M_GetToken(NULL); if (animdefsToken == NULL) { - I_Error("Error parsing ANIMDEFS lump: Unexpected end of file where \"RANGE\" after \"%s\"'s startname should be", animdefs[*i].startname); + I_Error("Error parsing ANIMDEFS lump: Unexpected end of file where \"RANGE\" after \"%s\"'s startname should be", animdefs[i].startname); } if (stricmp(animdefsToken, "ALLOWDECALS") == 0) { @@ -470,7 +494,7 @@ void P_ParseAnimationDefintion(SINT8 istexture, INT32 *i) } if (stricmp(animdefsToken, "RANGE") != 0) { - I_Error("Error parsing ANIMDEFS lump: Expected \"RANGE\" after \"%s\"'s startname, got \"%s\"", animdefs[*i].startname, animdefsToken); + I_Error("Error parsing ANIMDEFS lump: Expected \"RANGE\" after \"%s\"'s startname, got \"%s\"", animdefs[i].startname, animdefsToken); } Z_Free(animdefsToken); @@ -478,21 +502,21 @@ void P_ParseAnimationDefintion(SINT8 istexture, INT32 *i) animdefsToken = M_GetToken(NULL); if (animdefsToken == NULL) { - I_Error("Error parsing ANIMDEFS lump: Unexpected end of file where \"%s\"'s end texture/flat name should be", animdefs[*i].startname); + I_Error("Error parsing ANIMDEFS lump: Unexpected end of file where \"%s\"'s end texture/flat name should be", animdefs[i].startname); } animdefsTokenLength = strlen(animdefsToken); if (animdefsTokenLength>8) { I_Error("Error parsing ANIMDEFS lump: lump name \"%s\" exceeds 8 characters", animdefsToken); } - strncpy(animdefs[*i].endname, animdefsToken, 9); + strncpy(animdefs[i].endname, animdefsToken, 9); Z_Free(animdefsToken); // "TICS" animdefsToken = M_GetToken(NULL); if (animdefsToken == NULL) { - I_Error("Error parsing ANIMDEFS lump: Unexpected end of file where \"%s\"'s \"TICS\" should be", animdefs[*i].startname); + I_Error("Error parsing ANIMDEFS lump: Unexpected end of file where \"%s\"'s \"TICS\" should be", animdefs[i].startname); } if (stricmp(animdefsToken, "RAND") == 0) { @@ -501,7 +525,7 @@ void P_ParseAnimationDefintion(SINT8 istexture, INT32 *i) } if (stricmp(animdefsToken, "TICS") != 0) { - I_Error("Error parsing ANIMDEFS lump: Expected \"TICS\" in animation definition for \"%s\", got \"%s\"", animdefs[*i].startname, animdefsToken); + I_Error("Error parsing ANIMDEFS lump: Expected \"TICS\" in animation definition for \"%s\", got \"%s\"", animdefs[i].startname, animdefsToken); } Z_Free(animdefsToken); @@ -509,7 +533,7 @@ void P_ParseAnimationDefintion(SINT8 istexture, INT32 *i) animdefsToken = M_GetToken(NULL); if (animdefsToken == NULL) { - I_Error("Error parsing ANIMDEFS lump: Unexpected end of file where \"%s\"'s animation speed should be", animdefs[*i].startname); + I_Error("Error parsing ANIMDEFS lump: Unexpected end of file where \"%s\"'s animation speed should be", animdefs[i].startname); } endPos = NULL; #ifndef AVOID_ERRNO @@ -523,13 +547,10 @@ void P_ParseAnimationDefintion(SINT8 istexture, INT32 *i) #endif || animSpeed < 0) // Number is not positive { - I_Error("Error parsing ANIMDEFS lump: Expected a positive integer for \"%s\"'s animation speed, got \"%s\"", animdefs[*i].startname, animdefsToken); + I_Error("Error parsing ANIMDEFS lump: Expected a positive integer for \"%s\"'s animation speed, got \"%s\"", animdefs[i].startname, animdefsToken); } - animdefs[*i].speed = animSpeed; + animdefs[i].speed = animSpeed; Z_Free(animdefsToken); - - // Increment i before we go, so this doesn't cause issues later - (*i)++; } From cdb841ef544f479cc4f9548e067f98d548987456 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Wed, 19 Oct 2016 03:22:11 -0400 Subject: [PATCH 222/808] Only P_InitPicAnims when wads are loaded. Not in P_SetupLevel. That's just dumb. --- src/p_setup.c | 7 +++---- src/r_data.c | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index e56c44c70..f1d3a68c8 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2587,10 +2587,6 @@ boolean P_SetupLevel(boolean skipprecip) R_ReInitColormaps(mapheaderinfo[gamemap-1]->palette); CON_ReSetupBackColormap(mapheaderinfo[gamemap-1]->palette); - // now part of level loading since in future each level may have - // its own anim texture sequences, switches etc. - P_InitPicAnims(); - // SRB2 determines the sky texture to be used depending on the map header. P_SetupLevelSky(mapheaderinfo[gamemap-1]->skynum, true); @@ -3001,6 +2997,9 @@ boolean P_AddWadFile(const char *wadfilename, char **firstmapname) else R_FlushTextureCache(); // just reload it from file + // Reload ANIMATED / ANIMDEFS + P_InitPicAnims(); + // Flush and reload HUD graphics ST_UnloadGraphics(); HU_LoadGraphics(); diff --git a/src/r_data.c b/src/r_data.c index cb5cf3591..87b6b1193 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -1499,6 +1499,9 @@ void R_InitData(void) CONS_Printf("R_LoadTextures()...\n"); R_LoadTextures(); + CONS_Printf("P_InitPicAnims()...\n"); + P_InitPicAnims(); + CONS_Printf("R_InitSprites()...\n"); R_InitSpriteLumps(); R_InitSprites(); From 8fe932b0e7656ce3541713d77aa9ea6373961b65 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 20 Oct 2016 00:33:12 +0100 Subject: [PATCH 223/808] * Force shield force stop completed * Bubblewrap shield bounce now no longer allows thokking post-bounce, but still allows bouncing * plus a bunch of tiny changes to clean up code around the place. --- src/d_player.h | 6 ++--- src/p_enemy.c | 2 +- src/p_inter.c | 2 +- src/p_mobj.c | 63 +++++++++++++++++++++++++++++++++++++------------- src/p_user.c | 17 +++++++++++--- 5 files changed, 66 insertions(+), 24 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 54960115f..e5e296f17 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -188,7 +188,7 @@ typedef enum SH_PROTECTELECTRIC = 0x1000, // Indivisible shields - SH_PITY = 1, + SH_PITY = 1, // the world's most basic shield ever, given to players who suck at Match SH_WHIRLWIND, SH_ARMAGEDDON, SH_FIREFLOWER, @@ -377,8 +377,8 @@ typedef struct player_s UINT8 gotcontinue; // Got continue from this stage? fixed_t speed; // Player's speed (distance formula of MOMX and MOMY values) - UINT8 jumping; // Jump counter - UINT8 secondjump; + UINT8 jumping; // Holding down jump button + UINT8 secondjump; // Jump counter UINT8 fly1; // Tails flying UINT8 scoreadd; // Used for multiple enemy attack bonus diff --git a/src/p_enemy.c b/src/p_enemy.c index cde3f6310..e94a936a2 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3348,7 +3348,7 @@ void A_ForceShield(mobj_t *actor) return; } - if (locvar1 < 0 || locvar1 > SH_FORCEHP) + if (locvar1 & ~SH_FORCEHP) { CONS_Debug(DBG_GAMELOGIC, "Invalid number of additional hitpoints.\n"); return; diff --git a/src/p_inter.c b/src/p_inter.c index ce5209a41..e3523d29d 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2784,7 +2784,7 @@ void P_RemoveShield(player_t *player) if (player->powers[pw_shield] & SH_FORCE) { // Multi-hit if ((player->powers[pw_shield] & SH_FORCEHP) == 0) - player->powers[pw_shield] &= ~SH_FORCE; + player->powers[pw_shield] &= SH_STACK; else player->powers[pw_shield]--; } diff --git a/src/p_mobj.c b/src/p_mobj.c index 1541ea79c..5af16f0ff 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3235,8 +3235,16 @@ static void P_PlayerZMovement(mobj_t *mo) if (!(mo->player->pflags & PF_GLIDING)) mo->player->pflags &= ~PF_JUMPED; + mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY/*|PF_GLIDING*/); + mo->player->secondjump = 0; + mo->player->glidetime = 0; + mo->player->climbing = 0; + mo->player->powers[pw_tailsfly] = 0; + if (mo->player->pflags & PF_SHIELDABILITY) { + mo->player->pflags &= ~PF_SHIELDABILITY; + if ((mo->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) // Elemental shield's stomp attack. { if (mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER)) // play a blunt sound @@ -3259,16 +3267,14 @@ static void P_PlayerZMovement(mobj_t *mo) { S_StartSound(mo, sfx_s3k44); P_DoJump(mo->player, false); + mo->player->pflags |= PF_THOKKED; + mo->player->secondjump = UINT8_MAX; mo->momz = FixedMul(mo->momz, 5*FRACUNIT/4); clipmomz = false; } } - mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY/*|PF_GLIDING*/); - mo->player->jumping = 0; - mo->player->secondjump = 0; - mo->player->glidetime = 0; - mo->player->climbing = 0; - mo->player->powers[pw_tailsfly] = 0; + + mo->player->jumping = 0; // done down here because of bubblewrap } } if (!(mo->player->pflags & PF_SPINNING)) @@ -3623,15 +3629,19 @@ void P_MobjCheckWater(mobj_t *mobj) { if (!((p->powers[pw_super]) || (p->powers[pw_invulnerability]))) { - if (p->powers[pw_shield] & SH_PROTECTELECTRIC) - { // Water removes electric shields... + boolean electric = !!(p->powers[pw_shield] & SH_PROTECTELECTRIC); +#define SH_OP (SH_PROTECTFIRE|SH_PROTECTWATER|SH_PROTECTELECTRIC) + if ((p->powers[pw_shield] & SH_OP) == SH_OP) // No. + P_KillMobj(mobj, NULL, NULL, DMG_INSTAKILL); +#undef SH_OP + else if (electric || ((p->powers[pw_shield] & SH_PROTECTFIRE) && !(p->powers[pw_shield] & SH_PROTECTWATER))) + { // Water removes electric and non-water fire shields... + P_FlashPal(p, + electric + ? PAL_WHITE + : PAL_NUKE, + 1); p->powers[pw_shield] = p->powers[pw_shield] & SH_STACK; - P_FlashPal(p, PAL_WHITE, 1); - } - else if ((p->powers[pw_shield] & SH_PROTECTFIRE) && !(p->powers[pw_shield] & SH_PROTECTWATER)) - { // ...and fire-only shields. - p->powers[pw_shield] = p->powers[pw_shield] & SH_STACK; - P_FlashPal(p, PAL_NUKE, 1); } } @@ -3651,7 +3661,10 @@ void P_MobjCheckWater(mobj_t *mobj) } if ((mobj->eflags & MFE_GOOWATER) && ((p->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL || (p->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (p->pflags & PF_SHIELDABILITY)) + { p->pflags &= ~PF_SHIELDABILITY; + mobj->momz >>= 1; + } } // The rest of this code only executes on a water state change. @@ -6683,7 +6696,7 @@ void P_MobjThinker(mobj_t *mobj) fixed_t oldheight = mobj->height; UINT8 correctionType = 0; // Don't correct Z position, just gain height - if (mobj->z > mobj->floorz && mobj->z + mobj->height < mobj->ceilingz + if ((mobj->flags & MF_NOCLIPHEIGHT || (mobj->z > mobj->floorz && mobj->z + mobj->height < mobj->ceilingz)) && mobj->type != MT_EGGMOBILE_FIRE) correctionType = 1; // Correct Z position by centering else if (mobj->eflags & MFE_VERTICALFLIP) @@ -6787,7 +6800,6 @@ void P_MobjThinker(mobj_t *mobj) case MT_PITY_ORB: case MT_WHIRLWIND_ORB: case MT_ARMAGEDDON_ORB: - case MT_FORCE_ORB: case MT_FLAMEAURA_ORB: if (!P_AddShield(mobj)) return; @@ -6818,6 +6830,25 @@ void P_MobjThinker(mobj_t *mobj) mobj->tracer->tics++; } break; + case MT_FORCE_ORB: + if (!P_AddShield(mobj)) + return; + if (/* + && mobj->target -- the following is implicit by P_AddShield + && mobj->target->player + && (mobj->target->player->powers[pw_shield] & SH_FORCE) + && */ (mobj->target->player->pflags & PF_SHIELDABILITY)) + { + mobj_t *whoosh = P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_GHOST); + whoosh->sprite = SPR_FORC; + whoosh->frame = 20|(tr_trans50<destscale = whoosh->scale<<1; + whoosh->fuse = 10; + whoosh->tics = -1; + whoosh->flags |= MF_NOCLIPHEIGHT; + whoosh->height = 42*FRACUNIT; + mobj->target->player->pflags &= ~PF_SHIELDABILITY; // prevent eternal whoosh + } case MT_BUBBLEWRAP_ORB: if (!P_AddShield(mobj)) return; diff --git a/src/p_user.c b/src/p_user.c index 2deda6d60..18f804a9e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7002,12 +7002,22 @@ static void P_MovePlayer(player_t *player) { if (player->pflags & PF_JUMPED) // If the player is jumping { - pflags_t check = (PF_USEDOWN|PF_GLIDING|PF_SLIDING|PF_THOKKED); - if (!(player->pflags & check)) // If the player is not holding down BT_USE, or having used an ability previously + if (!(player->pflags & (PF_USEDOWN|PF_GLIDING|PF_SLIDING|PF_SHIELDABILITY)) // If the player is not holding down BT_USE, or having used an ability previously + && (!(player->pflags & PF_THOKKED) || ((player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP && player->secondjump == UINT8_MAX))) // thokked is optional if you're bubblewrapped { // Force shield activation if (player->powers[pw_shield] & SH_FORCE) - ; // TODO + { +//#define PERFECTFORCESTOP + player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + player->mo->momx = player->mo->momy = 0; +#if 1 // almost imperceptible hop for the purposes of aligning with the aura for as long as possible + P_SetObjectMomZ(player->mo, -4*P_GetMobjGravity(player->mo), false); +#else + player->mo->momz = 0; +#endif + S_StartSound(player->mo, sfx_ngskid); + } else { switch (player->powers[pw_shield] & SH_NOSTACK) @@ -7040,6 +7050,7 @@ static void P_MovePlayer(player_t *player) case SH_ELEMENTAL: case SH_BUBBLEWRAP: player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + player->secondjump = 0; player->mo->momx = player->mo->momy = 0; P_SetObjectMomZ(player->mo, -24*FRACUNIT, false); S_StartSound(player->mo, From c1a8dd9a371816374c03a0029502313785b3bbc4 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 20 Oct 2016 13:44:03 +0100 Subject: [PATCH 224/808] Minor refactor of what I did last night - as a modifiable state instead of hardcoded references. --- src/dehacked.c | 2 ++ src/info.c | 4 +++- src/info.h | 2 ++ src/p_mobj.c | 6 ++---- src/p_user.c | 5 ++--- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 8c6147424..e8f29e03e 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5392,6 +5392,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_FORC19", "S_FORC20", + "S_FORC21", + "S_ELEM1", "S_ELEM2", "S_ELEM3", diff --git a/src/info.c b/src/info.c index 85630766a..42706cc8d 100644 --- a/src/info.c +++ b/src/info.c @@ -2121,6 +2121,8 @@ state_t states[NUMSTATES] = {SPR_FORC, FF_TRANS50|18, 3, {NULL}, 0, 0, S_FORC20}, // S_FORC19 {SPR_FORC, FF_TRANS50|19, 3, {NULL}, 0, 0, S_FORC11}, // S_FORC20 + {SPR_FORC, FF_TRANS50|20, -1, {NULL}, 0, 0, S_NULL}, // S_FORC21 + {SPR_ELEM, FF_TRANS50 , 4, {NULL}, 0, 0, S_ELEM2 }, // S_ELEM1 {SPR_ELEM, FF_TRANS50| 1, 4, {NULL}, 0, 0, S_ELEM3 }, // S_ELEM2 {SPR_ELEM, FF_TRANS50| 2, 4, {NULL}, 0, 0, S_ELEM4 }, // S_ELEM3 @@ -10845,7 +10847,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // damage sfx_None, // activesound MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags - S_NULL // raisestate + S_FORC21 // raisestate }, { // MT_ARMAGEDDON_ORB diff --git a/src/info.h b/src/info.h index 618e848c5..8624f13a0 100644 --- a/src/info.h +++ b/src/info.h @@ -2306,6 +2306,8 @@ typedef enum state S_FORC19, S_FORC20, + S_FORC21, + S_ELEM1, S_ELEM2, S_ELEM3, diff --git a/src/p_mobj.c b/src/p_mobj.c index 5af16f0ff..77952c269 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6839,12 +6839,10 @@ void P_MobjThinker(mobj_t *mobj) && (mobj->target->player->powers[pw_shield] & SH_FORCE) && */ (mobj->target->player->pflags & PF_SHIELDABILITY)) { - mobj_t *whoosh = P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_GHOST); - whoosh->sprite = SPR_FORC; - whoosh->frame = 20|(tr_trans50<info->raisestate); whoosh->destscale = whoosh->scale<<1; whoosh->fuse = 10; - whoosh->tics = -1; whoosh->flags |= MF_NOCLIPHEIGHT; whoosh->height = 42*FRACUNIT; mobj->target->player->pflags &= ~PF_SHIELDABILITY; // prevent eternal whoosh diff --git a/src/p_user.c b/src/p_user.c index 18f804a9e..8b871f72b 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7008,14 +7008,13 @@ static void P_MovePlayer(player_t *player) // Force shield activation if (player->powers[pw_shield] & SH_FORCE) { -//#define PERFECTFORCESTOP player->pflags |= PF_THOKKED|PF_SHIELDABILITY; - player->mo->momx = player->mo->momy = 0; #if 1 // almost imperceptible hop for the purposes of aligning with the aura for as long as possible P_SetObjectMomZ(player->mo, -4*P_GetMobjGravity(player->mo), false); #else - player->mo->momz = 0; + player->mo->momz = // intentionally carries to post-endif line as multiple-assignment #endif + player->mo->momx = player->mo->momy = 0; S_StartSound(player->mo, sfx_ngskid); } else From 59fccab8e50aa4cc2227952e6af35357dd625d3d Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 20 Oct 2016 20:55:15 +0100 Subject: [PATCH 225/808] Restructured things so nojumpdamage characters can use the elemental, bubblewrap and attract shields. --- src/d_player.h | 5 ++++- src/lua_hook.h | 2 ++ src/lua_hooklib.c | 1 + src/p_inter.c | 6 +++--- src/p_map.c | 8 ++++---- src/p_mobj.c | 4 +++- src/p_user.c | 14 ++++++++++++-- 7 files changed, 29 insertions(+), 11 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index e5e296f17..4f9833fa0 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -154,7 +154,10 @@ typedef enum PF_CANCARRY = 1<<27, // Used shield ability - PF_SHIELDABILITY = 1<<28 + PF_SHIELDABILITY = 1<<28, + + // Do jump damage? + PF_JUMPDAMAGE = 1<<29 // free up to and including 1<<31 } pflags_t; diff --git a/src/lua_hook.h b/src/lua_hook.h index bed32edac..e0f08d175 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -43,6 +43,7 @@ enum hook { hook_PlayerMsg, hook_HurtMsg, hook_PlayerSpawn, + hook_ShieldSpawn, hook_MAX // last hook }; @@ -77,5 +78,6 @@ boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector); // Hook boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg); // Hook for chat messages boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source); // Hook for hurt messages #define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for G_SpawnPlayer +#define LUAh_ShieldSpawn(player) LUAh_PlayerHook(player, hook_ShieldSpawn) // Hook for P_SpawnShieldOrb #endif diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 1b9652571..1065f193a 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -54,6 +54,7 @@ const char *const hookNames[hook_MAX+1] = { "PlayerMsg", "HurtMsg", "PlayerSpawn", + "ShieldSpawn", NULL }; diff --git a/src/p_inter.c b/src/p_inter.c index e3523d29d..ddbac5ed3 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -306,7 +306,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) } if (((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING)) - || ((player->pflags & PF_JUMPED) && !(player->charflags & SF_NOJUMPDAMAGE && !(player->charability == CA_TWINSPIN && player->panim == PA_ABILITY))) + || ((player->pflags & PF_JUMPED) && (player->pflags & PF_JUMPDAMAGE || (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY))) || (player->pflags & (PF_SPINNING|PF_GLIDING)) || (player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2) || ((player->charflags & SF_STOMPDAMAGE) && (P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0) && (P_MobjFlip(toucher)*toucher->momz < 0)) @@ -353,7 +353,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) P_DamageMobj(toucher, special, special, 1, 0); } else if (((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING)) - || ((player->pflags & PF_JUMPED) && !(player->charflags & SF_NOJUMPDAMAGE && !(player->charability == CA_TWINSPIN && player->panim == PA_ABILITY))) + || ((player->pflags & PF_JUMPED) && (player->pflags & PF_JUMPDAMAGE || (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY))) || (player->pflags & (PF_SPINNING|PF_GLIDING)) || (player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2) || ((player->charflags & SF_STOMPDAMAGE) && (P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0) && (P_MobjFlip(toucher)*toucher->momz < 0)) @@ -1346,7 +1346,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; } else if (((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING)) - || ((player->pflags & PF_JUMPED) && !(player->charflags & SF_NOJUMPDAMAGE)) + || ((player->pflags & PF_JUMPED) && (player->pflags & PF_JUMPDAMAGE || (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY))) || ((player->charflags & SF_STOMPDAMAGE) && (P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0) && (P_MobjFlip(toucher)*toucher->momz < 0)) || (player->pflags & (PF_SPINNING|PF_GLIDING)) || player->powers[pw_invulnerability] || player->powers[pw_super]) // Do you possess the ability to subdue the object? diff --git a/src/p_map.c b/src/p_map.c index 6c4ea979a..d924ad564 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1058,8 +1058,8 @@ static boolean PIT_CheckThing(mobj_t *thing) if (thing->flags & MF_MONITOR && (tmthing->player->pflags & (PF_SPINNING|PF_GLIDING) || ((tmthing->player->pflags & PF_JUMPED) - && !(tmthing->player->charflags & SF_NOJUMPDAMAGE - && !(tmthing->player->charability == CA_TWINSPIN && tmthing->player->panim == PA_ABILITY))) + && (tmthing->player->pflags & PF_JUMPDAMAGE + || (tmthing->player->charability == CA_TWINSPIN && tmthing->player->panim == PA_ABILITY))) || (tmthing->player->charability2 == CA2_MELEE && tmthing->player->panim == PA_ABILITY2) || ((tmthing->player->charflags & SF_STOMPDAMAGE) && (P_MobjFlip(tmthing)*(tmthing->z - (thing->z + thing->height/2)) > 0) && (P_MobjFlip(tmthing)*tmthing->momz < 0)) @@ -1093,8 +1093,8 @@ static boolean PIT_CheckThing(mobj_t *thing) else if (thing->flags & MF_MONITOR && tmthing->player && (tmthing->player->pflags & (PF_SPINNING|PF_GLIDING) || ((tmthing->player->pflags & PF_JUMPED) - && !(tmthing->player->charflags & SF_NOJUMPDAMAGE - && !(tmthing->player->charability == CA_TWINSPIN && tmthing->player->panim == PA_ABILITY))) + && (tmthing->player->pflags & PF_JUMPDAMAGE + || (tmthing->player->charability == CA_TWINSPIN && tmthing->player->panim == PA_ABILITY))) || (tmthing->player->charability2 == CA2_MELEE && tmthing->player->panim == PA_ABILITY2) || ((tmthing->player->charflags & SF_STOMPDAMAGE) && (P_MobjFlip(tmthing)*(tmthing->z - (thing->z + thing->height/2)) > 0) && (P_MobjFlip(tmthing)*tmthing->momz < 0))) diff --git a/src/p_mobj.c b/src/p_mobj.c index 77952c269..40683a991 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3233,7 +3233,7 @@ static void P_PlayerZMovement(mobj_t *mo) mo->player->pflags &= ~PF_SPINNING; if (!(mo->player->pflags & PF_GLIDING)) - mo->player->pflags &= ~PF_JUMPED; + mo->player->pflags &= ~(PF_JUMPED|PF_JUMPDAMAGE); mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY/*|PF_GLIDING*/); mo->player->secondjump = 0; @@ -3267,6 +3267,8 @@ static void P_PlayerZMovement(mobj_t *mo) { S_StartSound(mo, sfx_s3k44); P_DoJump(mo->player, false); + if (mo->player->charflags & SF_NOJUMPSPIN) + P_SetPlayerMobjState(mo, S_PLAY_FALL); mo->player->pflags |= PF_THOKKED; mo->player->secondjump = UINT8_MAX; mo->momz = FixedMul(mo->momz, 5*FRACUNIT/4); diff --git a/src/p_user.c b/src/p_user.c index 8b871f72b..1ddb7a25c 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -877,7 +877,7 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor) // Useful when you want to kill everything the player is doing. void P_ResetPlayer(player_t *player) { - player->pflags &= ~(PF_SPINNING|PF_STARTDASH|PF_JUMPED|PF_GLIDING|PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY); + player->pflags &= ~(PF_SPINNING|PF_STARTDASH|PF_JUMPED|PF_JUMPDAMAGE|PF_GLIDING|PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY); player->powers[pw_carry] = CR_NONE; player->jumping = 0; player->secondjump = 0; @@ -1338,6 +1338,11 @@ void P_SpawnShieldOrb(player_t *player) I_Error("P_SpawnShieldOrb: player->mo is NULL!\n"); #endif +#ifdef HAVE_BLUA + if (LUAh_ShieldSpawn(player)) + return; +#endif + if (player->powers[pw_shield] & SH_FORCE) orbtype = MT_FORCE_ORB; else switch (player->powers[pw_shield] & SH_NOSTACK) @@ -3761,6 +3766,8 @@ void P_DoJump(player_t *player, boolean soundandstate) player->mo->eflags &= ~MFE_APPLYPMOMZ; player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; if (soundandstate) { @@ -7039,6 +7046,8 @@ static void P_MovePlayer(player_t *player) player->homing = 2; if (P_LookForEnemies(player, false) && player->mo->tracer) { + player->pflags |= PF_JUMPDAMAGE; + P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); S_StartSound(player->mo, sfx_s3k40); player->homing = 3*TICRATE; } @@ -7048,7 +7057,8 @@ static void P_MovePlayer(player_t *player) // Elemental/Bubblewrap shield activation case SH_ELEMENTAL: case SH_BUBBLEWRAP: - player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + player->pflags |= PF_JUMPDAMAGE|PF_THOKKED|PF_SHIELDABILITY; + P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); player->secondjump = 0; player->mo->momx = player->mo->momy = 0; P_SetObjectMomZ(player->mo, -24*FRACUNIT, false); From 769962c884e025f1ad1aaf7ed325f2cfc8eb0cdf Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 20 Oct 2016 21:15:41 +0100 Subject: [PATCH 226/808] Minor cleanup. --- src/p_user.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 1ddb7a25c..c4b810414 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1446,10 +1446,6 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) ? (!(player->powers[pw_shield] & SH_FORCE) || (player->powers[pw_shield] & SH_FORCEHP) < (shieldtype & ~SH_FORCE)) : ((player->powers[pw_shield] & SH_NOSTACK) != shieldtype); - boolean stopshieldability = (shieldtype & SH_FORCE) - ? (!(player->powers[pw_shield] & SH_FORCE)) - : true; - if (mariomode) { mobj_t *scoremobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + (player->mo->height / 2), MT_SCORE); @@ -1459,6 +1455,10 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) if (donthavealready) { + boolean stopshieldability = (shieldtype & SH_FORCE) + ? (!(player->powers[pw_shield] & SH_FORCE)) + : true; + if (mariomode) { player->mo->movecount = player->powers[pw_shield]; @@ -7013,7 +7013,7 @@ static void P_MovePlayer(player_t *player) && (!(player->pflags & PF_THOKKED) || ((player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP && player->secondjump == UINT8_MAX))) // thokked is optional if you're bubblewrapped { // Force shield activation - if (player->powers[pw_shield] & SH_FORCE) + if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FORCE) { player->pflags |= PF_THOKKED|PF_SHIELDABILITY; #if 1 // almost imperceptible hop for the purposes of aligning with the aura for as long as possible @@ -8177,9 +8177,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall camheight = FixedMul(cv_cam2_height.value, FixedMul(player->camerascale, mo->scale)); } - if (player->powers[pw_shield] & SH_FORCE && player->pflags & PF_SHIELDABILITY) - camspeed <<= 1; - #ifdef REDSANALOG if (P_AnalogMove(player) && (player->cmd.buttons & (BT_CAMLEFT|BT_CAMRIGHT)) == (BT_CAMLEFT|BT_CAMRIGHT)) { camstill = true; From f145898ca4c60cf9ad7c18c16979b4e6c8bb9648 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 20 Oct 2016 21:39:58 +0100 Subject: [PATCH 227/808] Woops. --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index c4b810414..c2115ff7d 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7013,7 +7013,7 @@ static void P_MovePlayer(player_t *player) && (!(player->pflags & PF_THOKKED) || ((player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP && player->secondjump == UINT8_MAX))) // thokked is optional if you're bubblewrapped { // Force shield activation - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FORCE) + if ((player->powers[pw_shield] & ~(SH_FORCEHP|SH_STACK)) == SH_FORCE) { player->pflags |= PF_THOKKED|PF_SHIELDABILITY; #if 1 // almost imperceptible hop for the purposes of aligning with the aura for as long as possible From a053b117e18bb806753632551c4c82b13728cc48 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 21 Oct 2016 11:08:32 +0100 Subject: [PATCH 228/808] Moved the Super Sonic hover over to holding down the jump button (which conveniently links it pretty closely to the thok, which could be called the Float Thok or something I dunno.) Also, only one shield ability is selectively blocked by being Super now, and that's because Invincibility does it too and therefore I assume that's a match balance thing instead of a keyboard clash. --- src/p_user.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index c2115ff7d..794f2b5a8 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4361,10 +4361,10 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) player->secondjump = 2; - // If letting go of the jump button while still on ascent, cut the jump height. - if (player->pflags & PF_JUMPED && P_MobjFlip(player->mo)*player->mo->momz > 0 && player->jumping == 1) + if (player->pflags & PF_JUMPED && player->jumping == 1) { - player->mo->momz >>= 1; + if (P_MobjFlip(player->mo)*player->mo->momz > 0) + player->mo->momz >>= 1; // If letting go of the jump button while still on ascent, cut the jump height. player->jumping = 0; } } @@ -7005,9 +7005,9 @@ static void P_MovePlayer(player_t *player) //STUFF! // /////////////////////////// - if (cmd->buttons & BT_USE) // Spin button effects + if (player->pflags & PF_JUMPED) { - if (player->pflags & PF_JUMPED) // If the player is jumping + if (cmd->buttons & BT_USE) // Spin button effects { if (!(player->pflags & (PF_USEDOWN|PF_GLIDING|PF_SLIDING|PF_SHIELDABILITY)) // If the player is not holding down BT_USE, or having used an ability previously && (!(player->pflags & PF_THOKKED) || ((player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP && player->secondjump == UINT8_MAX))) // thokked is optional if you're bubblewrapped @@ -7031,8 +7031,7 @@ static void P_MovePlayer(player_t *player) // Whirlwind/Thundercoin shield activation case SH_WHIRLWIND: case SH_THUNDERCOIN: - if (!player->powers[pw_super]) - P_DoJumpShield(player); + P_DoJumpShield(player); break; // Armageddon shield activation case SH_ARMAGEDDON: @@ -7077,7 +7076,9 @@ static void P_MovePlayer(player_t *player) } } } - // Super Sonic move + } + else if (cmd->buttons & BT_JUMP && !player->jumping) // Super Sonic move + { if (player->skin == 0 && player->powers[pw_super] && player->speed > FixedMul(5<mo->scale) && P_MobjFlip(player->mo)*player->mo->momz <= 0) { From b34dc93a18c6fa3f3aeda4474a2dd855089ebd88 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 21 Oct 2016 11:31:44 +0100 Subject: [PATCH 229/808] Fix to the previous commit to basically do what I wanted it to do as opposed to accidentially altering behaviour of jumping on crawlas. --- src/p_user.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 794f2b5a8..b7e847619 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4361,10 +4361,10 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) player->secondjump = 2; - if (player->pflags & PF_JUMPED && player->jumping == 1) + // If letting go of the jump button while still on ascent, cut the jump height. + if (player->pflags & PF_JUMPED && P_MobjFlip(player->mo)*player->mo->momz > 0 && player->jumping == 1) { - if (P_MobjFlip(player->mo)*player->mo->momz > 0) - player->mo->momz >>= 1; // If letting go of the jump button while still on ascent, cut the jump height. + player->mo->momz >>= 1; player->jumping = 0; } } @@ -7077,7 +7077,7 @@ static void P_MovePlayer(player_t *player) } } } - else if (cmd->buttons & BT_JUMP && !player->jumping) // Super Sonic move + else if ((cmd->buttons & BT_JUMP) && (player->pflags & PF_THOKKED)) // Super Sonic move { if (player->skin == 0 && player->powers[pw_super] && player->speed > FixedMul(5<mo->scale) && P_MobjFlip(player->mo)*player->mo->momz <= 0) From 4c0ef9f0a35c6c799c03d09a65e215072d396c3c Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 21 Oct 2016 11:48:41 +0100 Subject: [PATCH 230/808] * No ridiculously-fast float animation. * No falling when you accidentially press spin. --- src/p_user.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index b7e847619..71e6ad021 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7077,12 +7077,13 @@ static void P_MovePlayer(player_t *player) } } } - else if ((cmd->buttons & BT_JUMP) && (player->pflags & PF_THOKKED)) // Super Sonic move + + if ((cmd->buttons & BT_JUMP) && (player->pflags & PF_THOKKED)) // Super Sonic move { if (player->skin == 0 && player->powers[pw_super] && player->speed > FixedMul(5<mo->scale) && P_MobjFlip(player->mo)*player->mo->momz <= 0) { - if (player->panim == PA_ROLL || player->panim == PA_JUMP || player->mo->state-states == S_PLAY_PAIN || player->panim == PA_WALK) + if (player->panim == PA_JUMP || player->panim == PA_FALL) P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_FLOAT); player->mo->momz = 0; From bda630ce41b1791e271e132160028e575d64abc5 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 21 Oct 2016 11:57:59 +0100 Subject: [PATCH 231/808] I could do better than the previous commit. --- src/p_user.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 71e6ad021..705a797c2 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7083,7 +7083,8 @@ static void P_MovePlayer(player_t *player) if (player->skin == 0 && player->powers[pw_super] && player->speed > FixedMul(5<mo->scale) && P_MobjFlip(player->mo)*player->mo->momz <= 0) { - if (player->panim == PA_JUMP || player->panim == PA_FALL) + if (player->mo->state-states == S_PLAY_PAIN || player->panim == PA_JUMP || player->panim == PA_FALL + || (player->panim == PA_WALK && player->mo->state-states != S_PLAY_SUPER_FLOAT)) P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_FLOAT); player->mo->momz = 0; From 6abd4d20d3a724c661118b734b6606b89d883f08 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 21 Oct 2016 12:31:06 +0100 Subject: [PATCH 232/808] Further tightening. --- src/p_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 705a797c2..10476a5d3 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7078,7 +7078,7 @@ static void P_MovePlayer(player_t *player) } } - if ((cmd->buttons & BT_JUMP) && (player->pflags & PF_THOKKED)) // Super Sonic move + if ((cmd->buttons & BT_JUMP) && (player->pflags & PF_THOKKED) && !player->homing) // Super Sonic move { if (player->skin == 0 && player->powers[pw_super] && player->speed > FixedMul(5<mo->scale) && P_MobjFlip(player->mo)*player->mo->momz <= 0) @@ -7088,7 +7088,7 @@ static void P_MovePlayer(player_t *player) P_SetPlayerMobjState(player->mo, S_PLAY_SUPER_FLOAT); player->mo->momz = 0; - player->pflags &= ~PF_SPINNING; + player->pflags &= ~(PF_SPINNING|PF_SHIELDABILITY); player->jumping = 0; // don't cut jump height after bouncing off something } } From 5ad7fc8495da56b6566b4195644ad496189b8904 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 21 Oct 2016 12:34:16 +0100 Subject: [PATCH 233/808] A better check than for skin==0. --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index 10476a5d3..6bf5b80b2 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7080,7 +7080,7 @@ static void P_MovePlayer(player_t *player) if ((cmd->buttons & BT_JUMP) && (player->pflags & PF_THOKKED) && !player->homing) // Super Sonic move { - if (player->skin == 0 && player->powers[pw_super] && player->speed > FixedMul(5<mo->scale) + if ((player->charability == CA_THOK) && player->powers[pw_super] && player->speed > FixedMul(5<mo->scale) && P_MobjFlip(player->mo)*player->mo->momz <= 0) { if (player->mo->state-states == S_PLAY_PAIN || player->panim == PA_JUMP || player->panim == PA_FALL From 587c0079e263b9c404865ce2c22ba9f02e5305f5 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 22 Oct 2016 23:19:24 +0100 Subject: [PATCH 234/808] Started work on FLIPX/FLIPY support for patches. Doesn't do anything yet, but the parser should know how to look for them now Note: I had to create M_UnGetToken in order to avoid problems with looking for patch parameters (marked by { and }) but not finding anything --- src/dehacked.c | 2 +- src/doomdef.h | 1 + src/m_misc.c | 21 ++++++++++++++++++--- src/r_data.c | 43 +++++++++++++++++++++++++++++++++++++++++++ src/r_data.h | 1 + 5 files changed, 64 insertions(+), 4 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 20f835981..920e5eec3 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -2778,7 +2778,7 @@ static void readpatch(MYFILE *f, const char *name, UINT16 wad) char *word2; char *tmp; INT32 i = 0, j = 0, value; - texpatch_t patch = {0, 0, UINT16_MAX, UINT16_MAX}; + texpatch_t patch = {0, 0, UINT16_MAX, UINT16_MAX, 0}; // Jump to the texture this patch belongs to, which, // coincidentally, is always the last one on the buffer cache. diff --git a/src/doomdef.h b/src/doomdef.h index 410e740fa..d0ac3a676 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -407,6 +407,7 @@ void M_StartupLocale(void); extern void *(*M_Memcpy)(void* dest, const void* src, size_t n) FUNCNONNULL; char *va(const char *format, ...) FUNCPRINTF; char *M_GetToken(const char *inputString); +void M_UnGetToken(void); char *sizeu1(size_t num); char *sizeu2(size_t num); char *sizeu3(size_t num); diff --git a/src/m_misc.c b/src/m_misc.c index cfe73d88f..d6ab40196 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -1617,6 +1617,11 @@ INT32 axtoi(const char *hexStg) return intValue; } +// Token parser variables + +static UINT32 oldendPos = 0; // old value of endPos, used by M_UnGetToken +static UINT32 endPos = 0; // now external to M_GetToken, but still static + /** Token parser for TEXTURES, ANIMDEFS, and potentially other lumps later down the line. * Was originally R_GetTexturesToken when I was coding up the TEXTURES parser, until I realized I needed it for ANIMDEFS too. * Parses up to the next whitespace character or comma. When finding the start of the next token, whitespace is skipped. @@ -1631,7 +1636,7 @@ char *M_GetToken(const char *inputString) { static const char *stringToUse = NULL; // Populated if inputString != NULL; used otherwise static UINT32 startPos = 0; - static UINT32 endPos = 0; +// static UINT32 endPos = 0; static UINT32 stringLength = 0; static UINT8 inComment = 0; // 0 = not in comment, 1 = // Single-line, 2 = /* Multi-line */ char *texturesToken = NULL; @@ -1641,12 +1646,12 @@ char *M_GetToken(const char *inputString) { stringToUse = inputString; startPos = 0; - endPos = 0; + oldendPos = endPos = 0; stringLength = strlen(inputString); } else { - startPos = endPos; + startPos = oldendPos = endPos; } if (stringToUse == NULL) return NULL; @@ -1777,6 +1782,16 @@ char *M_GetToken(const char *inputString) return texturesToken; } +/** Undoes the last M_GetToken call + * The current position along the string being parsed is reset to the last saved position. + * This exists mostly because of R_ParseTexture/R_ParsePatch honestly, but could be useful elsewhere? + * -Monster Iestyn (22/10/16) + */ +void M_UnGetToken(void) +{ + endPos = oldendPos; +} + /** Count bits in a number. */ UINT8 M_CountBits(UINT32 num, UINT8 size) diff --git a/src/r_data.c b/src/r_data.c index cb5cf3591..5c3d06649 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -502,6 +502,7 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch) char *patchName = NULL; INT16 patchXPos; INT16 patchYPos; + UINT8 flip = 0; texpatch_t *resultPatch = NULL; lumpnum_t patchLumpNum; @@ -598,6 +599,47 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch) } Z_Free(texturesToken); + // Patch parameters block (OPTIONAL) + // added by Monster Iestyn (22/10/16) + + // Left Curly Brace + texturesToken = M_GetToken(NULL); + if (texturesToken == NULL) + ; // move on and ignore, R_ParseTextures will deal with this + else + { + if (strcmp(texturesToken,"{")==0) + { + Z_Free(texturesToken); + texturesToken = M_GetToken(NULL); + if (texturesToken == NULL) + { + I_Error("Error parsing TEXTURES lump: Unexpected end of file where patch \"%s\"'s parameters should be",patchName); + } + while (strcmp(texturesToken,"}")!=0) + { + if (stricmp(texturesToken, "FLIPX")==0) + flip |= 1; + else if (stricmp(texturesToken, "FLIPY")==0) + flip |= 2; + Z_Free(texturesToken); + + texturesToken = M_GetToken(NULL); + if (texturesToken == NULL) + { + I_Error("Error parsing TEXTURES lump: Unexpected end of file where patch \"%s\"'s parameters or right curly brace should be",patchName); + } + } + } + else + { + // this is not what we wanted... + // undo last read so R_ParseTextures can re-get the token for its own purposes + M_UnGetToken(); + } + Z_Free(texturesToken); + } + if (actuallyLoadPatch == true) { // Check lump exists @@ -608,6 +650,7 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch) resultPatch->originy = patchYPos; resultPatch->lump = patchLumpNum & 65535; resultPatch->wad = patchLumpNum>>16; + resultPatch->flip = flip; // Clean up a little after ourselves Z_Free(patchName); // Then return it diff --git a/src/r_data.h b/src/r_data.h index 69a2882af..1384ecac0 100644 --- a/src/r_data.h +++ b/src/r_data.h @@ -31,6 +31,7 @@ typedef struct // Block origin (always UL), which has already accounted for the internal origin of the patch. INT16 originx, originy; UINT16 wad, lump; + UINT8 flip; // 1 = flipx, 2 = flipy, 3 = both } texpatch_t; // A maptexturedef_t describes a rectangular texture, From 9d5e0b314b83c1ae1698ce3266b003e09c6ea2d4 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Sun, 23 Oct 2016 03:44:51 -0700 Subject: [PATCH 235/808] Autoload music_new.dta if it exists Same no non-music lump requirement as music.dta, and is ignored with no error if music_new.dta doesn't exist (should hopefully make playing around with music easier) --- src/d_main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/d_main.c b/src/d_main.c index c5f0d0b39..0dfaceab8 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -859,6 +859,18 @@ static void IdentifyVersion(void) I_Error("File %s has been modified with non-music lumps",musicfile); } #endif + +#if 1 // This section can be deleted when music_new is merged with music.dta + { + const char *musicfile = "music_new.dta"; + const char *musicpath = va(pandf,srb2waddir,musicfile); + int ms = W_VerifyNMUSlumps(musicpath); // Don't forget the music! + if (ms == 1) + D_AddFile(musicpath); + else if (ms == 0) + I_Error("File %s has been modified with non-music lumps",musicfile); + } +#endif } /* ======================================================================== */ From e390598e133815efed008b99651349a78e8fb607 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 23 Oct 2016 14:35:35 +0100 Subject: [PATCH 236/808] Fix objectplace controls text so it displays "Weapon Next/Prev" --- src/m_cheat.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/m_cheat.c b/src/m_cheat.c index 4c44d4b89..9086236c3 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -1265,10 +1265,10 @@ void Command_ObjectPlace_f(void) HU_DoCEcho(va(M_GetText( "\\\\\\\\\\\\\\\\\\\\\\\\\x82" " Objectplace Controls: \x80\\\\" - "Weapon L/R: Cycle mapthings\\" - " Jump: Float up \\" - " Spin: Float down \\" - " Fire Ring: Place object \\"))); + "Weapon Next/Prev: Cycle mapthings\\" + " Jump: Float up \\" + " Spin: Float down \\" + " Fire Ring: Place object \\"))); } // Save all the player's data. From 8720252059542523a895a22a207d157925cb965f Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 23 Oct 2016 14:42:37 +0100 Subject: [PATCH 237/808] Thorough jumpdamage setting. --- src/p_map.c | 4 +++- src/p_spec.c | 4 ++++ src/p_user.c | 35 +++++++++++++++++++++++++++++++---- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index d924ad564..fe9cecdba 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -203,7 +203,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) } } - pflags = object->player->pflags & (PF_JUMPED|PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY); // I still need these. + pflags = object->player->pflags & (PF_JUMPED|PF_JUMPDAMAGE|PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY); // I still need these. jumping = object->player->jumping; secondjump = object->player->secondjump; P_ResetPlayer(object->player); @@ -211,6 +211,8 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) if (spring->info->painchance) { object->player->pflags |= PF_JUMPED; + if (!(object->player->charflags & SF_NOJUMPDAMAGE)) + object->player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(object, S_PLAY_JUMP); } else if (P_MobjFlip(object)*vertispeed > 0) diff --git a/src/p_spec.c b/src/p_spec.c index 617bc6abe..2284fdadf 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -7533,7 +7533,11 @@ void T_Pusher(pusher_t *p) P_ResetPlayer (thing->player); if (jumped) + { thing->player->pflags |= PF_JUMPED; + if (!(thing->player->charflags & SF_NOJUMPDAMAGE)) + thing->player->pflags |= PF_JUMPDAMAGE; + } thing->player->pflags |= PF_SLIDING; P_SetPlayerMobjState (thing, thing->info->painstate); // Whee! diff --git a/src/p_user.c b/src/p_user.c index 6bf5b80b2..4c0b23aca 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -577,7 +577,7 @@ static void P_DeNightserizePlayer(player_t *player) player->pflags &= ~PF_NIGHTSMODE; player->powers[pw_underwater] = 0; - player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_THOKKED|PF_SPINNING|PF_DRILLING|PF_TRANSFERTOCLOSEST); + player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_JUMPDAMAGE|PF_THOKKED|PF_SPINNING|PF_DRILLING|PF_TRANSFERTOCLOSEST); player->secondjump = 0; player->jumping = 0; player->homing = 0; @@ -650,7 +650,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) if (!(player->pflags & PF_NIGHTSMODE)) player->mo->height = P_GetPlayerHeight(player); // Just to make sure jumping into the drone doesn't result in a squashed hitbox. - player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_THOKKED|PF_SHIELDABILITY|PF_SPINNING|PF_DRILLING); + player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_JUMPDAMAGE|PF_THOKKED|PF_SHIELDABILITY|PF_SPINNING|PF_DRILLING); player->homing = 0; player->mo->fuse = 0; player->speed = 0; @@ -1677,6 +1677,8 @@ void P_DoPlayerExit(player_t *player) { player->climbing = 0; player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } player->powers[pw_underwater] = 0; @@ -1997,6 +1999,8 @@ static void P_CheckBouncySectors(player_t *player) { player->pflags &= ~PF_SPINNING; player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; player->pflags |= PF_THOKKED; } } @@ -2008,8 +2012,9 @@ static void P_CheckBouncySectors(player_t *player) if (player->pflags & PF_SPINNING) { player->pflags &= ~PF_SPINNING; - player->pflags |= PF_JUMPED; - player->pflags |= PF_THOKKED; + player->pflags |= (PF_JUMPED|PF_THOKKED); + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; } } @@ -2017,6 +2022,8 @@ static void P_CheckBouncySectors(player_t *player) { player->pflags &= ~PF_SPINNING; player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; } goto bouncydone; @@ -2760,6 +2767,8 @@ static void P_DoClimbing(player_t *player) player->climbing = 0; player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } @@ -2767,6 +2776,8 @@ static void P_DoClimbing(player_t *player) { player->climbing = 0; player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } } @@ -2774,6 +2785,8 @@ static void P_DoClimbing(player_t *player) { player->climbing = 0; player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } @@ -2792,6 +2805,8 @@ static void P_DoClimbing(player_t *player) { player->climbing = 0; player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); P_SetObjectMomZ(player->mo, 4*FRACUNIT, false); P_InstaThrust(player->mo, player->mo->angle, FixedMul(-4*FRACUNIT, player->mo->scale)); @@ -6712,6 +6727,8 @@ static void P_MovePlayer(player_t *player) else { player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } player->pflags &= ~PF_GLIDING; @@ -6769,6 +6786,8 @@ static void P_MovePlayer(player_t *player) || (player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]) && player->charability == CA_GLIDEANDCLIMB)) { player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } else @@ -6839,6 +6858,8 @@ static void P_MovePlayer(player_t *player) else { player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } } @@ -7488,6 +7509,8 @@ static void P_DoRopeHang(player_t *player) P_SetTarget(&player->mo->tracer, NULL); player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; player->powers[pw_carry] = CR_NONE; if (!(player->pflags & PF_SLIDING) && (player->pflags & PF_JUMPED) @@ -7586,6 +7609,8 @@ static void P_DoRopeHang(player_t *player) if (player->mo->tracer->flags & MF_SLIDEME) { player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; if (!(player->pflags & PF_SLIDING) && (player->pflags & PF_JUMPED) && !(player->panim == PA_JUMP)) @@ -9681,6 +9706,8 @@ void P_PlayerAfterThink(player_t *player) player->mo->momz = (player->mo->tracer->z - (player->mo->height-player->mo->tracer->height/2) - player->mo->z)*2; P_TeleportMove(player->mo, player->mo->tracer->x, player->mo->tracer->y, player->mo->tracer->z - (player->mo->height-player->mo->tracer->height/2)); player->pflags |= PF_JUMPED; + if (!(player->charflags & SF_NOJUMPDAMAGE)) + player->pflags |= PF_JUMPDAMAGE; player->secondjump = 0; player->pflags &= ~PF_THOKKED; From 76ff26e6fb4aa71c88c6841d0e0f42851f295685 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 23 Oct 2016 15:53:12 +0100 Subject: [PATCH 238/808] Revert "Thorough jumpdamage setting." This reverts commit 8720252059542523a895a22a207d157925cb965f. --- src/p_map.c | 4 +--- src/p_spec.c | 4 ---- src/p_user.c | 35 ++++------------------------------- 3 files changed, 5 insertions(+), 38 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index fe9cecdba..d924ad564 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -203,7 +203,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) } } - pflags = object->player->pflags & (PF_JUMPED|PF_JUMPDAMAGE|PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY); // I still need these. + pflags = object->player->pflags & (PF_JUMPED|PF_SPINNING|PF_THOKKED|PF_SHIELDABILITY); // I still need these. jumping = object->player->jumping; secondjump = object->player->secondjump; P_ResetPlayer(object->player); @@ -211,8 +211,6 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object) if (spring->info->painchance) { object->player->pflags |= PF_JUMPED; - if (!(object->player->charflags & SF_NOJUMPDAMAGE)) - object->player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(object, S_PLAY_JUMP); } else if (P_MobjFlip(object)*vertispeed > 0) diff --git a/src/p_spec.c b/src/p_spec.c index a52e63104..d0c268c86 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -7508,11 +7508,7 @@ void T_Pusher(pusher_t *p) P_ResetPlayer (thing->player); if (jumped) - { thing->player->pflags |= PF_JUMPED; - if (!(thing->player->charflags & SF_NOJUMPDAMAGE)) - thing->player->pflags |= PF_JUMPDAMAGE; - } thing->player->pflags |= PF_SLIDING; P_SetPlayerMobjState (thing, thing->info->painstate); // Whee! diff --git a/src/p_user.c b/src/p_user.c index afd193066..5533ed619 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -577,7 +577,7 @@ static void P_DeNightserizePlayer(player_t *player) player->pflags &= ~PF_NIGHTSMODE; player->powers[pw_underwater] = 0; - player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_JUMPDAMAGE|PF_THOKKED|PF_SPINNING|PF_DRILLING|PF_TRANSFERTOCLOSEST); + player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_THOKKED|PF_SPINNING|PF_DRILLING|PF_TRANSFERTOCLOSEST); player->secondjump = 0; player->jumping = 0; player->homing = 0; @@ -650,7 +650,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) if (!(player->pflags & PF_NIGHTSMODE)) player->mo->height = P_GetPlayerHeight(player); // Just to make sure jumping into the drone doesn't result in a squashed hitbox. - player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_JUMPDAMAGE|PF_THOKKED|PF_SHIELDABILITY|PF_SPINNING|PF_DRILLING); + player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_THOKKED|PF_SHIELDABILITY|PF_SPINNING|PF_DRILLING); player->homing = 0; player->mo->fuse = 0; player->speed = 0; @@ -1677,8 +1677,6 @@ void P_DoPlayerExit(player_t *player) { player->climbing = 0; player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } player->powers[pw_underwater] = 0; @@ -1999,8 +1997,6 @@ static void P_CheckBouncySectors(player_t *player) { player->pflags &= ~PF_SPINNING; player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; player->pflags |= PF_THOKKED; } } @@ -2012,9 +2008,8 @@ static void P_CheckBouncySectors(player_t *player) if (player->pflags & PF_SPINNING) { player->pflags &= ~PF_SPINNING; - player->pflags |= (PF_JUMPED|PF_THOKKED); - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; + player->pflags |= PF_JUMPED; + player->pflags |= PF_THOKKED; } } @@ -2022,8 +2017,6 @@ static void P_CheckBouncySectors(player_t *player) { player->pflags &= ~PF_SPINNING; player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; } goto bouncydone; @@ -2767,8 +2760,6 @@ static void P_DoClimbing(player_t *player) player->climbing = 0; player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } @@ -2776,8 +2767,6 @@ static void P_DoClimbing(player_t *player) { player->climbing = 0; player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } } @@ -2785,8 +2774,6 @@ static void P_DoClimbing(player_t *player) { player->climbing = 0; player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } @@ -2805,8 +2792,6 @@ static void P_DoClimbing(player_t *player) { player->climbing = 0; player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); P_SetObjectMomZ(player->mo, 4*FRACUNIT, false); P_InstaThrust(player->mo, player->mo->angle, FixedMul(-4*FRACUNIT, player->mo->scale)); @@ -6727,8 +6712,6 @@ static void P_MovePlayer(player_t *player) else { player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } player->pflags &= ~PF_GLIDING; @@ -6786,8 +6769,6 @@ static void P_MovePlayer(player_t *player) || (player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]) && player->charability == CA_GLIDEANDCLIMB)) { player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } else @@ -6858,8 +6839,6 @@ static void P_MovePlayer(player_t *player) else { player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); } } @@ -7509,8 +7488,6 @@ static void P_DoRopeHang(player_t *player) P_SetTarget(&player->mo->tracer, NULL); player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; player->powers[pw_carry] = CR_NONE; if (!(player->pflags & PF_SLIDING) && (player->pflags & PF_JUMPED) @@ -7609,8 +7586,6 @@ static void P_DoRopeHang(player_t *player) if (player->mo->tracer->flags & MF_SLIDEME) { player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; if (!(player->pflags & PF_SLIDING) && (player->pflags & PF_JUMPED) && !(player->panim == PA_JUMP)) @@ -9706,8 +9681,6 @@ void P_PlayerAfterThink(player_t *player) player->mo->momz = (player->mo->tracer->z - (player->mo->height-player->mo->tracer->height/2) - player->mo->z)*2; P_TeleportMove(player->mo, player->mo->tracer->x, player->mo->tracer->y, player->mo->tracer->z - (player->mo->height-player->mo->tracer->height/2)); player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; player->secondjump = 0; player->pflags &= ~PF_THOKKED; From c54d62851cad7f2e4a042397d8dab3205d0048ee Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 23 Oct 2016 16:04:02 +0100 Subject: [PATCH 239/808] Okay, this is a MUCH better solution than PF_JUMPDAMAGE. --- src/d_player.h | 4 ++-- src/p_inter.c | 6 +++--- src/p_map.c | 6 ++++-- src/p_mobj.c | 2 +- src/p_user.c | 8 +++----- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 4f9833fa0..4f3e37e59 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -156,8 +156,8 @@ typedef enum // Used shield ability PF_SHIELDABILITY = 1<<28, - // Do jump damage? - PF_JUMPDAMAGE = 1<<29 + // Force jump damage? + PF_FORCEJUMPDAMAGE = 1<<29 // free up to and including 1<<31 } pflags_t; diff --git a/src/p_inter.c b/src/p_inter.c index 8c66d35a0..4bf600c51 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -306,7 +306,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) } if (((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING)) - || ((player->pflags & PF_JUMPED) && (player->pflags & PF_JUMPDAMAGE || (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY))) + || ((player->pflags & PF_JUMPED) && (player->pflags & PF_FORCEJUMPDAMAGE || !(player->charflags & SF_NOJUMPSPIN) || (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY))) || (player->pflags & (PF_SPINNING|PF_GLIDING)) || (player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2) || ((player->charflags & SF_STOMPDAMAGE) && (P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0) && (P_MobjFlip(toucher)*toucher->momz < 0)) @@ -353,7 +353,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) P_DamageMobj(toucher, special, special, 1, 0); } else if (((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING)) - || ((player->pflags & PF_JUMPED) && (player->pflags & PF_JUMPDAMAGE || (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY))) + || ((player->pflags & PF_JUMPED) && (player->pflags & PF_FORCEJUMPDAMAGE || !(player->charflags & SF_NOJUMPSPIN) || (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY))) || (player->pflags & (PF_SPINNING|PF_GLIDING)) || (player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2) || ((player->charflags & SF_STOMPDAMAGE) && (P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0) && (P_MobjFlip(toucher)*toucher->momz < 0)) @@ -1346,7 +1346,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; } else if (((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING)) - || ((player->pflags & PF_JUMPED) && (player->pflags & PF_JUMPDAMAGE || (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY))) + || ((player->pflags & PF_JUMPED) && (player->pflags & PF_FORCEJUMPDAMAGE || !(player->charflags & SF_NOJUMPSPIN) || (player->charability == CA_TWINSPIN && player->panim == PA_ABILITY))) || ((player->charflags & SF_STOMPDAMAGE) && (P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0) && (P_MobjFlip(toucher)*toucher->momz < 0)) || (player->pflags & (PF_SPINNING|PF_GLIDING)) || player->powers[pw_invulnerability] || player->powers[pw_super]) // Do you possess the ability to subdue the object? diff --git a/src/p_map.c b/src/p_map.c index d924ad564..72668e478 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1058,7 +1058,8 @@ static boolean PIT_CheckThing(mobj_t *thing) if (thing->flags & MF_MONITOR && (tmthing->player->pflags & (PF_SPINNING|PF_GLIDING) || ((tmthing->player->pflags & PF_JUMPED) - && (tmthing->player->pflags & PF_JUMPDAMAGE + && (tmthing->player->pflags & PF_FORCEJUMPDAMAGE + || !(tmthing->player->charflags & SF_NOJUMPSPIN) || (tmthing->player->charability == CA_TWINSPIN && tmthing->player->panim == PA_ABILITY))) || (tmthing->player->charability2 == CA2_MELEE && tmthing->player->panim == PA_ABILITY2) || ((tmthing->player->charflags & SF_STOMPDAMAGE) @@ -1093,7 +1094,8 @@ static boolean PIT_CheckThing(mobj_t *thing) else if (thing->flags & MF_MONITOR && tmthing->player && (tmthing->player->pflags & (PF_SPINNING|PF_GLIDING) || ((tmthing->player->pflags & PF_JUMPED) - && (tmthing->player->pflags & PF_JUMPDAMAGE + && (tmthing->player->pflags & PF_FORCEJUMPDAMAGE + || !(tmthing->player->charflags & SF_NOJUMPSPIN) || (tmthing->player->charability == CA_TWINSPIN && tmthing->player->panim == PA_ABILITY))) || (tmthing->player->charability2 == CA2_MELEE && tmthing->player->panim == PA_ABILITY2) || ((tmthing->player->charflags & SF_STOMPDAMAGE) diff --git a/src/p_mobj.c b/src/p_mobj.c index e15fe26cd..ecf0133f1 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3233,7 +3233,7 @@ static void P_PlayerZMovement(mobj_t *mo) mo->player->pflags &= ~PF_SPINNING; if (!(mo->player->pflags & PF_GLIDING)) - mo->player->pflags &= ~(PF_JUMPED|PF_JUMPDAMAGE); + mo->player->pflags &= ~(PF_JUMPED|PF_FORCEJUMPDAMAGE); mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY/*|PF_GLIDING*/); mo->player->secondjump = 0; diff --git a/src/p_user.c b/src/p_user.c index 5533ed619..fc7ea2159 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -877,7 +877,7 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor) // Useful when you want to kill everything the player is doing. void P_ResetPlayer(player_t *player) { - player->pflags &= ~(PF_SPINNING|PF_STARTDASH|PF_JUMPED|PF_JUMPDAMAGE|PF_GLIDING|PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY); + player->pflags &= ~(PF_SPINNING|PF_STARTDASH|PF_JUMPED|PF_FORCEJUMPDAMAGE|PF_GLIDING|PF_THOKKED|PF_CANCARRY|PF_SHIELDABILITY); player->powers[pw_carry] = CR_NONE; player->jumping = 0; player->secondjump = 0; @@ -3766,8 +3766,6 @@ void P_DoJump(player_t *player, boolean soundandstate) player->mo->eflags &= ~MFE_APPLYPMOMZ; player->pflags |= PF_JUMPED; - if (!(player->charflags & SF_NOJUMPDAMAGE)) - player->pflags |= PF_JUMPDAMAGE; if (soundandstate) { @@ -7045,7 +7043,7 @@ static void P_MovePlayer(player_t *player) player->homing = 2; if (P_LookForEnemies(player, false) && player->mo->tracer) { - player->pflags |= PF_JUMPDAMAGE; + player->pflags |= PF_FORCEJUMPDAMAGE; P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); S_StartSound(player->mo, sfx_s3k40); player->homing = 3*TICRATE; @@ -7056,7 +7054,7 @@ static void P_MovePlayer(player_t *player) // Elemental/Bubblewrap shield activation case SH_ELEMENTAL: case SH_BUBBLEWRAP: - player->pflags |= PF_JUMPDAMAGE|PF_THOKKED|PF_SHIELDABILITY; + player->pflags |= PF_FORCEJUMPDAMAGE|PF_THOKKED|PF_SHIELDABILITY; P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); player->secondjump = 0; player->mo->momx = player->mo->momy = 0; From 956a8358c274f912b6817cf454a914abfdba8296 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 23 Oct 2016 16:26:36 +0100 Subject: [PATCH 240/808] Important component for nojumpspin characters. --- src/p_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_user.c b/src/p_user.c index fc7ea2159..03f91a7cd 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9678,7 +9678,7 @@ void P_PlayerAfterThink(player_t *player) player->mo->momy = (player->mo->tracer->y - player->mo->y)*2; player->mo->momz = (player->mo->tracer->z - (player->mo->height-player->mo->tracer->height/2) - player->mo->z)*2; P_TeleportMove(player->mo, player->mo->tracer->x, player->mo->tracer->y, player->mo->tracer->z - (player->mo->height-player->mo->tracer->height/2)); - player->pflags |= PF_JUMPED; + player->pflags |= PF_JUMPED|PF_FORCEJUMPDAMAGE; player->secondjump = 0; player->pflags &= ~PF_THOKKED; From cfc9302bd32ebd5ecc6cc6738ad19f6ad063c861 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 23 Oct 2016 17:05:17 +0100 Subject: [PATCH 241/808] Minor fix to ensure PF_FORCEJUMPDAMAGE is always known. --- src/p_user.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 03f91a7cd..8cb1b7607 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6673,7 +6673,7 @@ static void P_MovePlayer(player_t *player) P_SetPlayerMobjState(player->mo, S_PLAY_WALK); } - // If Springing (or nojumpspinning), but travelling DOWNWARD, change back! (nojumpspin also turns to fall once PF_THOKKED is added.) + // If Springing (or nojumpspinning), but travelling DOWNWARD, change back! if ((player->panim == PA_SPRING && P_MobjFlip(player->mo)*player->mo->momz < 0) || ((((player->charflags & SF_NOJUMPSPIN) && (player->pflags & PF_JUMPED) && player->panim == PA_JUMP)) && (P_MobjFlip(player->mo)*player->mo->momz < 0))) @@ -8929,8 +8929,13 @@ void P_PlayerThink(player_t *player) if (player->panim != PA_ABILITY) P_SetPlayerMobjState(player->mo, S_PLAY_GLIDE); } - else if ((player->pflags & PF_JUMPED) && !player->powers[pw_super] && player->panim != PA_JUMP && !(player->charflags & SF_NOJUMPSPIN)) - P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); + else if ((player->pflags & PF_JUMPED) && !player->powers[pw_super] && ((player->charflags & SF_NOJUMPSPIN && player->pflags & PF_FORCEJUMPDAMAGE && player->panim != PA_ROLL) || (!(player->charflags & SF_NOJUMPSPIN) && player->panim != PA_JUMP))) + { + if (!(player->charflags & SF_NOJUMPSPIN)) + P_SetPlayerMobjState(player->mo, S_PLAY_JUMP); + else if (player->pflags & PF_FORCEJUMPDAMAGE) + P_SetPlayerMobjState(player->mo, S_PLAY_SPIN); + } if (player->flashcount) player->flashcount--; From 45d32b7f7cd3e54a1d6fd1df8f7adcc54f000c27 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 23 Oct 2016 20:34:43 +0100 Subject: [PATCH 242/808] * Flameaura shield now has boosh sprites. * MF2_SHIELD calls shield thinker (P_AddShield/P_ShieldLook). * Multiple types of force shields now handled. --- src/dehacked.c | 67 ++++++++++++++++++++++++++++---------------------- src/info.c | 14 ++++++++--- src/info.h | 8 ++++++ src/p_mobj.c | 48 +++++++++++++++++++++++++++--------- src/p_mobj.h | 1 + src/p_user.c | 2 ++ 6 files changed, 96 insertions(+), 44 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index a0eee8229..224b4393d 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5407,6 +5407,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_ELEM11", "S_ELEM12", + "S_ELEM13", + "S_ELEM14", + "S_ELEMF1", "S_ELEMF2", "S_ELEMF3", @@ -5439,6 +5442,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_FIRS8", "S_FIRS9", + "S_FIRS10", + "S_FIRS11", + "S_FIRSB1", "S_FIRSB2", "S_FIRSB3", @@ -5449,6 +5455,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_FIRSB8", "S_FIRSB9", + "S_FIRSB10", + "S_BUBS1", "S_BUBS2", "S_BUBS3", @@ -6653,35 +6661,36 @@ static const char *const MOBJFLAG_LIST[] = { // \tMF2_(\S+).*// (.+) --> \t"\1", // \2 static const char *const MOBJFLAG2_LIST[] = { - "AXIS", // It's a NiGHTS axis! (For faster checking) - "TWOD", // Moves like it's in a 2D level - "DONTRESPAWN", // Don't respawn this object! - "DONTDRAW", // Don't generate a vissprite - "AUTOMATIC", // Thrown ring has automatic properties - "RAILRING", // Thrown ring has rail properties - "BOUNCERING", // Thrown ring has bounce properties - "EXPLOSION", // Thrown ring has explosive properties - "SCATTER", // Thrown ring has scatter properties - "BEYONDTHEGRAVE",// Source of this missile has died and has since respawned. - "SLIDEPUSH", // MF_PUSHABLE that pushes continuously. - "CLASSICPUSH", // Drops straight down when object has negative Z. - "STANDONME", // While not pushable, stand on me anyway. - "INFLOAT", // Floating to a height for a move, don't auto float to target's height. - "DEBRIS", // Splash ring from explosion ring - "NIGHTSPULL", // Attracted from a paraloop - "JUSTATTACKED", // can be pushed by other moving mobjs - "FIRING", // turret fire - "SUPERFIRE", // Firing something with Super Sonic-stopping properties. Or, if mobj has MF_MISSILE, this is the actual fire from it. - "SHADOW", // Fuzzy draw, makes targeting harder. - "STRONGBOX", // Flag used for "strong" random monitors. - "OBJECTFLIP", // Flag for objects that always have flipped gravity. - "SKULLFLY", // Special handling: skull in flight. - "FRET", // Flashing from a previous hit - "BOSSNOTRAP", // No Egg Trap after boss - "BOSSFLEE", // Boss is fleeing! - "BOSSDEAD", // Boss is dead! (Not necessarily fleeing, if a fleeing point doesn't exist.) - "AMBUSH", // Alternate behaviour typically set by MTF_AMBUSH - "LINKDRAW", // Draw vissprite of mobj immediately before/after tracer's vissprite (dependent on dispoffset and position) + "AXIS", // It's a NiGHTS axis! (For faster checking) + "TWOD", // Moves like it's in a 2D level + "DONTRESPAWN", // Don't respawn this object! + "DONTDRAW", // Don't generate a vissprite + "AUTOMATIC", // Thrown ring has automatic properties + "RAILRING", // Thrown ring has rail properties + "BOUNCERING", // Thrown ring has bounce properties + "EXPLOSION", // Thrown ring has explosive properties + "SCATTER", // Thrown ring has scatter properties + "BEYONDTHEGRAVE", // Source of this missile has died and has since respawned. + "SLIDEPUSH", // MF_PUSHABLE that pushes continuously. + "CLASSICPUSH", // Drops straight down when object has negative Z. + "STANDONME", // While not pushable, stand on me anyway. + "INFLOAT", // Floating to a height for a move, don't auto float to target's height. + "DEBRIS", // Splash ring from explosion ring + "NIGHTSPULL", // Attracted from a paraloop + "JUSTATTACKED", // can be pushed by other moving mobjs + "FIRING", // turret fire + "SUPERFIRE", // Firing something with Super Sonic-stopping properties. Or, if mobj has MF_MISSILE, this is the actual fire from it. + "SHADOW", // Fuzzy draw, makes targeting harder. + "STRONGBOX", // Flag used for "strong" random monitors. + "OBJECTFLIP", // Flag for objects that always have flipped gravity. + "SKULLFLY", // Special handling: skull in flight. + "FRET", // Flashing from a previous hit + "BOSSNOTRAP", // No Egg Trap after boss + "BOSSFLEE", // Boss is fleeing! + "BOSSDEAD", // Boss is dead! (Not necessarily fleeing, if a fleeing point doesn't exist.) + "AMBUSH", // Alternate behaviour typically set by MTF_AMBUSH + "LINKDRAW", // Draw vissprite of mobj immediately before/after tracer's vissprite (dependent on dispoffset and position) + "SHIELD", // Thinker calls P_AddShield/P_ShieldLook (must be partnered with MF_SCENERY to use) NULL }; diff --git a/src/info.c b/src/info.c index 2c0514634..802f90f26 100644 --- a/src/info.c +++ b/src/info.c @@ -2119,6 +2119,9 @@ state_t states[NUMSTATES] = {SPR_ELEM, FF_TRANS50|10, 4, {NULL}, 0, 0, S_ELEM12}, // S_ELEM11 {SPR_ELEM, FF_TRANS50|11, 4, {NULL}, 0, 0, S_ELEM1 }, // S_ELEM12 + {SPR_NULL, 0, 1, {NULL}, 0, 0, S_ELEM14}, // S_ELEM13 + {SPR_ELEM, FF_TRANS50|11, 1, {NULL}, 0, 0, S_ELEM1 }, // S_ELEM14 + {SPR_ELEM, FF_FULLBRIGHT|12, 3, {NULL}, 0, 0, S_ELEMF2 }, // S_ELEMF1 {SPR_ELEM, FF_FULLBRIGHT|13, 3, {NULL}, 0, 0, S_ELEMF3 }, // S_ELEMF2 {SPR_ELEM, FF_FULLBRIGHT|14, 3, {NULL}, 0, 0, S_ELEMF4 }, // S_ELEMF3 @@ -2152,6 +2155,9 @@ state_t states[NUMSTATES] = {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|7, 2, {NULL}, 0, 0, S_FIRS9}, // S_FIRS8 {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|8, 2, {NULL}, 0, 0, S_FIRS1}, // S_FIRS9 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|18, 1, {NULL}, 0, 0, S_FIRS11}, // S_FIRS10 + {SPR_NULL, 0, 1, {NULL}, 0, 0, S_FIRS1 }, // S_FIRS11 + {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40| 9, 2, {NULL}, 0, 0, S_FIRSB2}, // S_FIRSB1 {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|10, 2, {NULL}, 0, 0, S_FIRSB3}, // S_FIRSB2 {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|11, 2, {NULL}, 0, 0, S_FIRSB4}, // S_FIRSB3 @@ -2162,6 +2168,8 @@ state_t states[NUMSTATES] = {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|16, 2, {NULL}, 0, 0, S_FIRSB9}, // S_FIRSB8 {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|17, 2, {NULL}, 0, 0, S_FIRSB1}, // S_FIRSB9 + {SPR_NULL, 0, 2, {NULL}, 0, 0, S_FIRSB1 }, // S_FIRSB10 + {SPR_BUBS, FF_TRANS30 , 3, {NULL}, 0, 0, S_BUBS2}, // S_BUBS1 {SPR_BUBS, FF_TRANS30|1, 3, {NULL}, 0, 0, S_BUBS3}, // S_BUBS2 {SPR_BUBS, FF_TRANS30|2, 3, {NULL}, 0, 0, S_BUBS4}, // S_BUBS3 @@ -10697,7 +10705,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // seesound 0, // reactiontime sfx_None, // attacksound - S_NULL, // painstate + S_ELEM13, // painstate SKINCOLOR_NONE, // painchance sfx_None, // painsound S_NULL, // meleestate @@ -10859,7 +10867,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // seesound 8, // reactiontime sfx_None, // attacksound - S_NULL, // painstate + S_FIRSB10, // painstate SKINCOLOR_NONE, // painchance sfx_None, // painsound S_NULL, // meleestate @@ -10875,7 +10883,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // damage sfx_None, // activesound MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY, // flags - S_NULL // raisestate + S_FIRS10 // raisestate }, { // MT_BUBBLEWRAP_ORB diff --git a/src/info.h b/src/info.h index 914d04d16..b9dc034bf 100644 --- a/src/info.h +++ b/src/info.h @@ -2304,6 +2304,9 @@ typedef enum state S_ELEM11, S_ELEM12, + S_ELEM13, + S_ELEM14, + S_ELEMF1, S_ELEMF2, S_ELEMF3, @@ -2336,6 +2339,9 @@ typedef enum state S_FIRS8, S_FIRS9, + S_FIRS10, + S_FIRS11, + S_FIRSB1, S_FIRSB2, S_FIRSB3, @@ -2346,6 +2352,8 @@ typedef enum state S_FIRSB8, S_FIRSB9, + S_FIRSB10, + S_BUBS1, S_BUBS2, S_BUBS3, diff --git a/src/p_mobj.c b/src/p_mobj.c index ecf0133f1..e49c3e797 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6392,7 +6392,7 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) // TODO: Make an MT_SHIELDORB which changes color/states to always match the appropriate shield, // instead of having completely seperate mobjtypes. - if (shield != SH_FORCE) + if (!(shield & SH_FORCE)) { // Regular shields check for themselves only if ((shieldtype_t)(thing->target->player->powers[pw_shield] & SH_NOSTACK) != shield) { @@ -6406,7 +6406,7 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) return false; } - if (shield == SH_FORCE && thing->movecount != (thing->target->player->powers[pw_shield] & SH_FORCEHP)) + if (shield & SH_FORCE && thing->movecount != (thing->target->player->powers[pw_shield] & SH_FORCEHP)) { thing->movecount = (thing->target->player->powers[pw_shield] & SH_FORCEHP); if (thing->movecount < 1) @@ -6458,7 +6458,7 @@ void P_RunShields(void) // run shields for (i = 0; i < numshields; i++) { - P_ShieldLook(shields[i], shields[i]->info->speed); + P_ShieldLook(shields[i], shields[i]->threshold); P_SetTarget(&shields[i], NULL); } numshields = 0; @@ -6466,7 +6466,7 @@ void P_RunShields(void) static boolean P_AddShield(mobj_t *thing) { - shieldtype_t shield = thing->info->speed; + shieldtype_t shield = thing->threshold; if (!thing->target || thing->target->health <= 0 || !thing->target->player || (thing->target->player->powers[pw_shield] & SH_NOSTACK) == SH_NONE || thing->target->player->powers[pw_super] @@ -6476,7 +6476,7 @@ static boolean P_AddShield(mobj_t *thing) return false; } - if (shield != SH_FORCE) + if (!(shield & SH_FORCE)) { // Regular shields check for themselves only if ((shieldtype_t)(thing->target->player->powers[pw_shield] & SH_NOSTACK) != shield) { @@ -6743,6 +6743,11 @@ void P_MobjThinker(mobj_t *mobj) if (P_MobjWasRemoved(mobj)) return; #endif + + if (mobj->flags2 & MF2_SHIELD) + if (!P_AddShield(mobj)) + return; + switch (mobj->type) { case MT_HOOP: @@ -6802,12 +6807,11 @@ void P_MobjThinker(mobj_t *mobj) case MT_PITY_ORB: case MT_WHIRLWIND_ORB: case MT_ARMAGEDDON_ORB: - case MT_FLAMEAURA_ORB: - if (!P_AddShield(mobj)) + if (!(mobj->flags2 & MF2_SHIELD)) return; break; case MT_ATTRACT_ORB: - if (!P_AddShield(mobj)) + if (!(mobj->flags2 & MF2_SHIELD)) return; if (/*(mobj->target) -- the following is implicit by P_AddShield && (mobj->target->player) @@ -6818,7 +6822,7 @@ void P_MobjThinker(mobj_t *mobj) } break; case MT_ELEMENTAL_ORB: - if (!P_AddShield(mobj)) + if (!(mobj->flags2 & MF2_SHIELD)) return; if (mobj->tracer /* && mobj->target -- the following is implicit by P_AddShield @@ -6828,12 +6832,14 @@ void P_MobjThinker(mobj_t *mobj) && ((statenum_t)(mobj->tracer->state-states) < mobj->info->raisestate || (mobj->tracer->state->nextstate < mobj->info->raisestate && mobj->tracer->tics == 1))) { + P_SetMobjState(mobj, mobj->info->painstate); + mobj->tics++; P_SetMobjState(mobj->tracer, mobj->info->raisestate); mobj->tracer->tics++; } break; case MT_FORCE_ORB: - if (!P_AddShield(mobj)) + if (!(mobj->flags2 & MF2_SHIELD)) return; if (/* && mobj->target -- the following is implicit by P_AddShield @@ -6849,8 +6855,26 @@ void P_MobjThinker(mobj_t *mobj) whoosh->height = 42*FRACUNIT; mobj->target->player->pflags &= ~PF_SHIELDABILITY; // prevent eternal whoosh } + case MT_FLAMEAURA_ORB: + if (!(mobj->flags2 & MF2_SHIELD)) + return; + mobj->angle = mobj->target->angle; // implicitly okay because of P_AddShield + if (mobj->tracer + /* && mobj->target -- the following is implicit by P_AddShield + && mobj->target->player + && (mobj->target->player->powers[pw_shield] & SH_NOSTACK) == SH_FLAMEAURA */ + && mobj->target->player->pflags & PF_SHIELDABILITY + && ((statenum_t)(mobj->tracer->state-states) < mobj->info->raisestate + || (mobj->tracer->state->nextstate < mobj->info->raisestate && mobj->tracer->tics == 1))) + { + P_SetMobjState(mobj, mobj->info->painstate); + mobj->tics++; + P_SetMobjState(mobj->tracer, mobj->info->raisestate); + mobj->tracer->tics++; + } + break; case MT_BUBBLEWRAP_ORB: - if (!P_AddShield(mobj)) + if (!(mobj->flags2 & MF2_SHIELD)) return; if (mobj->tracer /* && mobj->target -- the following is implicit by P_AddShield @@ -6878,7 +6902,7 @@ void P_MobjThinker(mobj_t *mobj) } break; case MT_THUNDERCOIN_ORB: - if (!P_AddShield(mobj)) + if (!(mobj->flags2 & MF2_SHIELD)) return; if (mobj->tracer /* && mobj->target -- the following is implicit by P_AddShield diff --git a/src/p_mobj.h b/src/p_mobj.h index 69e0e11aa..40d5a732e 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -193,6 +193,7 @@ typedef enum MF2_BOSSDEAD = 1<<26, // Boss is dead! (Not necessarily fleeing, if a fleeing point doesn't exist.) MF2_AMBUSH = 1<<27, // Alternate behaviour typically set by MTF_AMBUSH MF2_LINKDRAW = 1<<28, // Draw vissprite of mobj immediately before/after tracer's vissprite (dependent on dispoffset and position) + MF2_SHIELD = 1<<29, // Thinker calls P_AddShield/P_ShieldLook (must be partnered with MF_SCENERY to use) // free: to and including 1<<31 } mobjflag2_t; diff --git a/src/p_user.c b/src/p_user.c index 8cb1b7607..c5490abe0 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1395,8 +1395,10 @@ void P_SpawnShieldOrb(player_t *player) } shieldobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, orbtype); + shieldobj->flags2 |= MF2_SHIELD; P_SetTarget(&shieldobj->target, player->mo); shieldobj->color = (UINT8)shieldobj->info->painchance; + shieldobj->threshold = (player->powers[pw_shield] & SH_FORCE) ? SH_FORCE : (player->powers[pw_shield] & SH_NOSTACK); if (shieldobj->info->seestate) { From a5a6ceff7149b1b768e868d4ec3b391fe8aba592 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 23 Oct 2016 22:21:42 +0100 Subject: [PATCH 243/808] More thorough Mario soundification for new shield sounds. --- src/s_sound.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/s_sound.c b/src/s_sound.c index 47a955561..971961897 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -607,6 +607,13 @@ void S_StartSound(const void *origin, sfxenum_t sfx_id) sfx_id = sfx_mario6; break; case sfx_shield: + case sfx_wirlsg: + case sfx_forcsg: + case sfx_elemsg: + case sfx_armasg: + case sfx_s3k3e: + case sfx_s3k3f: + case sfx_s3k41: sfx_id = sfx_mario3; break; case sfx_itemup: From 5787817662a5d1433949439f5ff4be61c86d3743 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 23 Oct 2016 23:13:11 +0100 Subject: [PATCH 244/808] Committing my work on P_SearchBlockmap_Objects so far, no idea if it's even functional yet so I've commented it out for now --- src/lua_baselib.c | 102 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 48b095e08..f6933cd3a 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -27,6 +27,8 @@ #define NOHUD if (hud_running) return luaL_error(L, "HUD rendering code should not call this function!"); +// uncomment if you want to test +// #define LUA_BLOCKMAP boolean luaL_checkboolean(lua_State *L, int narg) { luaL_checktype(L, narg, LUA_TBOOLEAN); @@ -215,6 +217,103 @@ static int lib_pPointOnLineSide(lua_State *L) return 1; } +#ifdef LUA_BLOCKMAP +// auxillary function for lib_pSearchBlockmap_Objects +static boolean lib_pSearchBlockmap_Objects_aux(lua_State *L, INT32 x, INT32 y, mobj_t *thing, int funcarg) +{ + mobj_t *mobj, *bnext = NULL; + + if (x < 0 || y < 0 || x >= bmapwidth || y >= bmapheight) + return true; + + // Check interaction with the objects in the blockmap. + for (mobj = blocklinks[y*bmapwidth + x]; mobj; mobj = bnext) + { + P_SetTarget(&bnext, mobj->bnext); // We want to note our reference to bnext here incase it is MF_NOTHINK and gets removed! + lua_pushvalue(L, funcarg); + LUA_PushUserdata(L, thing, META_MOBJ); + LUA_PushUserdata(L, mobj, META_MOBJ); + if (lua_pcall(gL, 2, 1, 0)) { + if (cv_debug & DBG_LUA) + CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1)); + lua_pop(gL, 1); + return false; + } + if (!lua_isnil(gL, -1)) + { // if nil, continue + if (lua_toboolean(gL, -1)) + return false; + } + if (P_MobjWasRemoved(thing) // func just popped our thing, cannot continue. + || (bnext && P_MobjWasRemoved(bnext))) // func just broke blockmap chain, cannot continue. + { + P_SetTarget(&bnext, NULL); + return true; + } + } + return true; +} + +// P_SearchBlockmap_Objects +// Lua-exclusive, but it kind of needs to be for best results +static int lib_pSearchBlockmap_Objects(lua_State *L) +{ + int n = lua_gettop(L); + mobj_t *mobj; + INT32 xl, xh, yl, yh, bx, by; + fixed_t x1, x2, y1, y2; + int funcarg; + + // the mobj we are searching around + mobj_t *mobj = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); + if (!mobj) + return LUA_ErrInvalid(L, "mobj_t"); + + if (n > 2) // specific x/y ranges have been supplied + { + if (n < 6) + return luaL_error(L, "arguments 2 to 5 not all given (expected 4 fixed-point integers)"); + + x1 = luaL_checkfixed(L, 2); + x2 = luaL_checkfixed(L, 3); + y1 = luaL_checkfixed(L, 4); + y2 = luaL_checkfixed(L, 5); + funcarg = 6; + } + else // mobj and function only - search around mobj's radius by default + { + x1 = mobj->x - mobj->radius; + x2 = mobj->x + mobj->radius; + y1 = mobj->y - mobj->radius; + y2 = mobj->y + mobj->radius; + funcarg = 2; + } + luaL_checktype(L, funcarg, LUA_TFUNCTION); + + xl = (unsigned)(x1 - bmaporgx - MAXRADIUS)>>MAPBLOCKSHIFT; + xh = (unsigned)(x2 - bmaporgx + MAXRADIUS)>>MAPBLOCKSHIFT; + yl = (unsigned)(y1 - bmaporgy - MAXRADIUS)>>MAPBLOCKSHIFT; + yh = (unsigned)(y2 - bmaporgy + MAXRADIUS)>>MAPBLOCKSHIFT; + + BMBOUNDFIX(xl, xh, yl, yh); + + for (bx = xl; bx <= xh; bx++) + for (by = yl; by <= yh; by++) + { + if (!lib_pSearchBlockmap_Objects_aux(L, bx, by, mobj, funcarg)){ + lua_pushboolean(L, false); + return 1; + } + if (P_MobjWasRemoved(mobj)){ + lua_pushboolean(L, false); + return 1; + } + } + lua_pushboolean(L, true); + return 1; +} +#endif + // P_ENEMY ///////////// @@ -2002,6 +2101,9 @@ static luaL_Reg lib[] = { {"P_AproxDistance",lib_pAproxDistance}, {"P_ClosestPointOnLine",lib_pClosestPointOnLine}, {"P_PointOnLineSide",lib_pPointOnLineSide}, +#ifdef LUA_BLOCKMAP + {"P_SearchBlockmap_Objects",lib_pSearchBlockmap_Objects}, +#endif // p_enemy {"P_CheckMeleeRange", lib_pCheckMeleeRange}, From 3ce411b62a7a3df42a95dcf71d6a20291b1107cb Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Oct 2016 12:35:40 +0100 Subject: [PATCH 245/808] Mario mode is boring again. (I'm going to revert this commit as soon as possible, but shield_actions needs to be clean of Mario stuff for now.) --- src/d_player.h | 6 ++-- src/dehacked.c | 3 +- src/g_game.c | 3 -- src/p_enemy.c | 59 +++++++++++++++------------------ src/p_inter.c | 89 +++++++++++++------------------------------------- src/p_local.h | 9 ++--- src/p_mobj.c | 35 ++------------------ src/p_user.c | 61 +++++----------------------------- src/r_things.c | 13 +------- 9 files changed, 66 insertions(+), 212 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 4f3e37e59..13729eebe 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -194,7 +194,6 @@ typedef enum SH_PITY = 1, // the world's most basic shield ever, given to players who suck at Match SH_WHIRLWIND, SH_ARMAGEDDON, - SH_FIREFLOWER, // normal shields that use flags SH_ATTRACT = SH_PROTECTELECTRIC, @@ -210,9 +209,9 @@ typedef enum SH_FORCEHP = 0xFF, // to be used as a bitmask only // Mostly for use with Mario mode. - SH_MUSHROOM = 0x200, + SH_FIREFLOWER = 0x200, - SH_STACK = SH_MUSHROOM, // second-layer shields + SH_STACK = SH_FIREFLOWER, // second-layer shields SH_NOSTACK = ~SH_STACK } shieldtype_t; // pw_shield @@ -241,7 +240,6 @@ typedef enum pw_underwater, // underwater timer pw_spacetime, // In space, no one can hear you spin! pw_extralife, // Extra Life timer - pw_marioflashing, // Getting/losing powerup pw_super, // Are you super? pw_gravityboots, // gravity boots diff --git a/src/dehacked.c b/src/dehacked.c index 224b4393d..7667ead82 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7126,7 +7126,6 @@ struct { {"SH_PITY",SH_PITY}, {"SH_WHIRLWIND",SH_WHIRLWIND}, {"SH_ARMAGEDDON",SH_ARMAGEDDON}, - {"SH_FIREFLOWER",SH_FIREFLOWER}, // normal shields that use flags {"SH_ATTRACT",SH_ATTRACT}, {"SH_ELEMENTAL",SH_ELEMENTAL}, @@ -7138,7 +7137,7 @@ struct { {"SH_FORCE",SH_FORCE}, {"SH_FORCEHP",SH_FORCEHP}, // to be used as a bitmask only // Mostly for use with Mario mode. - {"SH_MUSHROOM", SH_MUSHROOM}, + {"SH_FIREFLOWER", SH_FIREFLOWER}, {"SH_STACK",SH_STACK}, {"SH_NOSTACK",SH_NOSTACK}, diff --git a/src/g_game.c b/src/g_game.c index 200a0f45b..5e45921b7 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2196,9 +2196,6 @@ void G_PlayerReborn(INT32 player) p->health = 1; // 0 rings p->panim = PA_IDLE; // standing animation - if (mariomode) - p->powers[pw_shield] = SH_MUSHROOM; // start big - if ((netgame || multiplayer) && !p->spectator) p->powers[pw_flashing] = flashingtics-1; // Babysitting deterrent diff --git a/src/p_enemy.c b/src/p_enemy.c index 7212bd8c8..fb0e41903 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3061,10 +3061,9 @@ void A_JumpShield(mobj_t *actor) player = actor->target->player; - if (P_SwitchShield(player, SH_WHIRLWIND)) - S_StartSound(player->mo, actor->info->seesound); - else - S_StartSound(player->mo, sfx_itemup); + P_SwitchShield(player, SH_WHIRLWIND); + + S_StartSound(player->mo, actor->info->seesound); } // Function: A_RingShield @@ -3090,10 +3089,9 @@ void A_RingShield(mobj_t *actor) player = actor->target->player; - if (P_SwitchShield(player, SH_ATTRACT)) - S_StartSound(player->mo, actor->info->seesound); - else - S_StartSound(player->mo, sfx_itemup); + P_SwitchShield(player, SH_ATTRACT); + + S_StartSound(player->mo, actor->info->seesound); } // Function: A_RingBox @@ -3293,7 +3291,8 @@ void A_BombShield(mobj_t *actor) P_BlackOw(player); // Now we know for certain that we don't have a bomb shield, so add one. :3 - P_SwitchShield(player, SH_ARMAGEDDON); // will never return false, so no need for sound test + P_SwitchShield(player, SH_ARMAGEDDON); + S_StartSound(player->mo, actor->info->seesound); } @@ -3320,10 +3319,9 @@ void A_WaterShield(mobj_t *actor) player = actor->target->player; - if (P_SwitchShield(player, SH_ELEMENTAL)) - S_StartSound(player->mo, actor->info->seesound); - else - S_StartSound(player->mo, sfx_itemup); + P_SwitchShield(player, SH_ELEMENTAL); + + S_StartSound(player->mo, actor->info->seesound); } // Function: A_ForceShield @@ -3356,10 +3354,9 @@ void A_ForceShield(mobj_t *actor) player = actor->target->player; - if (P_SwitchShield(player, SH_FORCE|locvar1)) - S_StartSound(player->mo, actor->info->seesound); - else - S_StartSound(player->mo, sfx_itemup); + P_SwitchShield(player, SH_FORCE|locvar1); + + S_StartSound(player->mo, actor->info->seesound); } // Function: A_PityShield @@ -3389,10 +3386,9 @@ void A_PityShield(mobj_t *actor) player = actor->target->player; - if (P_SwitchShield(player, SH_PITY)) - S_StartSound(player->mo, actor->info->seesound); - else - S_StartSound(player->mo, sfx_itemup); + P_SwitchShield(player, SH_PITY); + + S_StartSound(player->mo, actor->info->seesound); } // Function: A_FlameShield @@ -3418,10 +3414,9 @@ void A_FlameShield(mobj_t *actor) player = actor->target->player; - if (P_SwitchShield(player, SH_FLAMEAURA)) - S_StartSound(player->mo, actor->info->seesound); - else - S_StartSound(player->mo, sfx_itemup); + P_SwitchShield(player, SH_FLAMEAURA); + + S_StartSound(player->mo, actor->info->seesound); } // Function: A_BubbleShield @@ -3447,10 +3442,9 @@ void A_BubbleShield(mobj_t *actor) player = actor->target->player; - if (P_SwitchShield(player, SH_BUBBLEWRAP)) - S_StartSound(player->mo, actor->info->seesound); - else - S_StartSound(player->mo, sfx_itemup); + P_SwitchShield(player, SH_BUBBLEWRAP); + + S_StartSound(player->mo, actor->info->seesound); } // Function: A_ThunderShield @@ -3476,10 +3470,9 @@ void A_ThunderShield(mobj_t *actor) player = actor->target->player; - if (P_SwitchShield(player, SH_THUNDERCOIN)) - S_StartSound(player->mo, actor->info->seesound); - else - S_StartSound(player->mo, sfx_itemup); + P_SwitchShield(player, SH_THUNDERCOIN); + + S_StartSound(player->mo, actor->info->seesound); } diff --git a/src/p_inter.c b/src/p_inter.c index 4bf600c51..d038677db 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1141,27 +1141,16 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) case MT_FIREFLOWER: if (player->bot) return; - { - mobj_t *scoremobj = P_SpawnMobj(toucher->x, toucher->y, toucher->z + (toucher->height / 2), MT_SCORE); - P_SetMobjState(scoremobj, mobjinfo[MT_SCORE].spawnstate+3); // 1000 - P_AddPlayerScore(player, 1000); - } - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER) - { - S_StartSound(toucher, sfx_itemup); - break; - } - else - S_StartSound(toucher, sfx_mario3); + S_StartSound(toucher, sfx_mario3); - if (mariomode) + player->powers[pw_shield] = (player->powers[pw_shield] & SH_NOSTACK)|SH_FIREFLOWER; + + if (!(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) { - toucher->movecount = player->powers[pw_shield]; - player->powers[pw_marioflashing] = MARIOFLASHINGTICS; + player->mo->color = SKINCOLOR_WHITE; + G_GhostAddColor(GHC_FIREFLOWER); } - player->powers[pw_shield] = (mariomode ? SH_MUSHROOM : player->powers[pw_shield] & SH_STACK)|SH_FIREFLOWER; - P_SpawnShieldOrb(player); break; @@ -1226,21 +1215,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) S_StartSound(toucher, special->info->painsound); - if (mariomode) - { - mobj_t *scoremobj = P_SpawnMobj(toucher->x, toucher->y, toucher->z + (toucher->height / 2), MT_SCORE); - P_SetMobjState(scoremobj, mobjinfo[MT_SCORE].spawnstate+7); // 2000 - P_AddPlayerScore(player, 2000); - if (!player->powers[pw_shield]) - { - S_StartSound(toucher, sfx_mario3); - player->mo->movecount = player->powers[pw_shield]; - player->powers[pw_marioflashing] = MARIOFLASHINGTICS; - player->powers[pw_shield] = SH_MUSHROOM; - P_SpawnShieldOrb(player); - } - } - if (!(netgame && circuitmap && player != &players[consoleplayer])) P_SetMobjState(special, special->info->painstate); return; @@ -2300,14 +2274,9 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget case MT_PLAYER: { - boolean mariodeathpit = (mariomode && damagetype == DMG_DEATHPIT); target->fuse = TICRATE*3; // timer before mobj disappears from view (even if not an actual player) - if (!mariodeathpit) - { - if (mariomode) - target->player->powers[pw_marioflashing] = MARIOFLASHINGTICS; - target->momx = target->momy = target->momz = 0; - } + target->momx = target->momy = target->momz = 0; + if (damagetype == DMG_DROWNED) // drowned { target->movedir = damagetype; // we're MOVING the Damage Into anotheR function... Okay, this is a bit of a hack. @@ -2319,8 +2288,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget } else { - if (!mariodeathpit) - P_SetObjectMomZ(target, 14*FRACUNIT, false); + P_SetObjectMomZ(target, 14*FRACUNIT, false); if ((source && source->type == MT_SPIKE) || damagetype == DMG_SPIKE) // Spikes S_StartSound(target, sfx_spkdth); else @@ -2680,11 +2648,8 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage) if (source && (gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF)) P_PlayerRingBurst(player, player->health - 1); - if (!mariomode) // Get rid of shield - { - player->powers[pw_shield] = SH_NONE; - player->mo->color = player->skincolor; - } + player->powers[pw_shield] = SH_NONE; + player->mo->color = player->skincolor; // Get rid of emeralds player->powers[pw_emeralds] = 0; @@ -2780,16 +2745,20 @@ static inline void P_SuperDamage(player_t *player, mobj_t *inflictor, mobj_t *so void P_RemoveShield(player_t *player) { - boolean fireflower = ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER); if (player->powers[pw_shield] & SH_FORCE) { // Multi-hit - if ((player->powers[pw_shield] & SH_FORCEHP) == 0) - player->powers[pw_shield] &= SH_STACK; - else + if (player->powers[pw_shield] & SH_FORCEHP) player->powers[pw_shield]--; + else + player->powers[pw_shield] &= SH_STACK; } else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_NONE) { // Second layer shields + if (((player->powers[pw_shield] & SH_STACK) == SH_FIREFLOWER) && !(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) + { + player->mo->color = player->skincolor; + G_GhostAddColor(GHC_NORMAL); + } player->powers[pw_shield] = SH_NONE; } else if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ARMAGEDDON) // Give them what's coming to them! @@ -2799,11 +2768,6 @@ void P_RemoveShield(player_t *player) } else player->powers[pw_shield] = player->powers[pw_shield] & SH_STACK; - if (fireflower && !(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) - { - player->mo->color = player->skincolor; - G_GhostAddColor(GHC_NORMAL); - } } static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, INT32 damage) @@ -2815,14 +2779,7 @@ static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source, P_ForceFeed(player, 40, 10, TICRATE, 40 + min(damage, 100)*2); - if (mariomode) - { - S_StartSound(player->mo, sfx_mario8); - // Burst weapons and emeralds in Match/CTF only - if (!player->powers[pw_shield] && (gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF)) - P_PlayerRingBurst(player, 0); - } - else if (source && (source->type == MT_SPIKE || (source->type == MT_NULL && source->threshold == 43))) // spikes + if (source && (source->type == MT_SPIKE || (source->type == MT_NULL && source->threshold == 43))) // spikes S_StartSound(player->mo, sfx_spkdth); else S_StartSound (player->mo, sfx_shldls); // Ba-Dum! Shield loss. @@ -3133,7 +3090,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da P_ShieldDamage(player, inflictor, source, damage); damage = 0; } - else if (!mariomode && player->mo->health > 1) // No shield but have rings. + else if (player->mo->health > 1) // No shield but have rings. { damage = player->mo->health - 1; P_RingDamage(player, inflictor, source, damage, damagetype); @@ -3295,11 +3252,11 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings) // Spill the ammo P_PlayerWeaponAmmoBurst(player); - if (mariomode) return; - for (i = 0; i < num_rings; i++) { INT32 objType = mobjinfo[MT_RING].reactiontime; + if (mariomode) + objType = mobjinfo[MT_COIN].reactiontime; z = player->mo->z; if (player->mo->eflags & MFE_VERTICALFLIP) diff --git a/src/p_local.h b/src/p_local.h index 7107432ef..ee61d3389 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -62,12 +62,9 @@ #define twodlevel (maptol & TOL_2D) #define mariomode (maptol & TOL_MARIO) -#define shortmario(player) ((player && mariomode && !player->powers[pw_shield]) ? 1 : 0) -#define MARIOFLASHINGTICS 21 - -#define P_GetPlayerHeight(player) (FixedMul(player->height, player->mo->scale) >> shortmario(player)) -#define P_GetPlayerSpinHeight(player) (FixedMul(player->spinheight, player->mo->scale) >> shortmario(player)) +#define P_GetPlayerHeight(player) FixedMul(player->height, player->mo->scale) +#define P_GetPlayerSpinHeight(player) FixedMul(player->spinheight, player->mo->scale) // // P_TICK @@ -146,7 +143,7 @@ boolean P_InQuicksand(mobj_t *mo); void P_SetObjectMomZ(mobj_t *mo, fixed_t value, boolean relative); void P_RestoreMusic(player_t *player); void P_SpawnShieldOrb(player_t *player); -boolean P_SwitchShield(player_t *player, UINT16 shieldtype); +void P_SwitchShield(player_t *player, UINT16 shieldtype); mobj_t *P_SpawnGhostMobj(mobj_t *mobj); void P_GivePlayerRings(player_t *player, INT32 num_rings); void P_GivePlayerLives(player_t *player, INT32 numlives); diff --git a/src/p_mobj.c b/src/p_mobj.c index e49c3e797..c94587ab4 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4088,32 +4088,6 @@ static void P_PlayerMobjThinker(mobj_t *mobj) I_Assert(mobj->player != NULL); I_Assert(!P_MobjWasRemoved(mobj)); - if (mobj->player->powers[pw_marioflashing]) - { - if (!mobj->player->powers[pw_nocontrol]++) - mobj->player->powers[pw_nocontrol]++; - - if (!(--mobj->player->powers[pw_marioflashing] % 4)) - { - UINT16 shieldswitch = mobj->player->powers[pw_shield]; - mobj->player->powers[pw_shield] = mobj->movecount; - mobj->movecount = shieldswitch; - if (mobj->player->powers[pw_shield] & SH_NOSTACK && (mobj->player->powers[pw_shield] & SH_NOSTACK) != (mobj->movecount & SH_NOSTACK)) - P_SpawnShieldOrb(mobj->player); - if ((mobj->player->powers[pw_shield] & SH_NOSTACK) != SH_FIREFLOWER && (mobj->movecount & SH_NOSTACK) == SH_FIREFLOWER - && !(mobj->player->powers[pw_super] || (mariomode && mobj->player->powers[pw_invulnerability]))) - { - mobj->color = mobj->player->skincolor; - G_GhostAddColor(GHC_NORMAL); - } - } - - if (mobj->player->powers[pw_flashing] && mobj->player->powers[pw_flashing] < UINT16_MAX && mobj->player->powers[pw_flashing] > flashingtics) - if (--(mobj->player->powers[pw_flashing]) == flashingtics) - mobj->player->powers[pw_flashing]--; - return; - } - P_MobjCheckWater(mobj); #ifdef ESLOPE @@ -6433,9 +6407,9 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) thing->x = thing->target->x; thing->y = thing->target->y; if (thing->eflags & MFE_VERTICALFLIP) - thing->z = thing->target->z + ((thing->target->height - thing->height + FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT)) << shortmario(thing->target->player)) - FixedMul(2*FRACUNIT, thing->target->scale); + thing->z = thing->target->z + (thing->target->height - thing->height + FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT)) - FixedMul(2*FRACUNIT, thing->target->scale); else - thing->z = thing->target->z - ((FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT)) << shortmario(thing->target->player)) + FixedMul(2*FRACUNIT, thing->target->scale); + thing->z = thing->target->z - (FixedDiv(P_GetPlayerHeight(thing->target->player) - thing->target->height, 3*FRACUNIT)) + FixedMul(2*FRACUNIT, thing->target->scale); P_SetThingPosition(thing); P_CheckPosition(thing, thing->x, thing->y); @@ -7240,11 +7214,6 @@ void P_MobjThinker(mobj_t *mobj) break; case MT_PLAYER: /// \todo Have the player's dead body completely finish its animation even if they've already respawned. - if (mobj->player && mobj->player->powers[pw_marioflashing]) - { - mobj->player->powers[pw_marioflashing]--; - return; // don't do any momz - } if (!(mobj->flags2 & MF2_DONTDRAW)) { if (!mobj->fuse) diff --git a/src/p_user.c b/src/p_user.c index c5490abe0..3754623de 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -793,7 +793,6 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor) if (player->powers[pw_carry] == CR_ROPEHANG) P_SetTarget(&player->mo->tracer, NULL); - if (!mariomode) { angle_t ang; fixed_t fallbackspeed; @@ -860,12 +859,6 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor) } player->powers[pw_flashing] = flashingtics; - if (mariomode) - { - player->powers[pw_marioflashing] = MARIOFLASHINGTICS; - player->powers[pw_flashing] += MARIOFLASHINGTICS; - player->mo->movecount = player->powers[pw_shield]; - } if (player->timeshit != UINT8_MAX) ++player->timeshit; @@ -928,7 +921,7 @@ void P_GivePlayerRings(player_t *player, INT32 num_rings) { INT32 gainlives = 0; - while ((mariomode || player->xtralife < maxXtraLife) && player->health > 100 * (player->xtralife+1)) + while (player->xtralife < maxXtraLife && player->health > 100 * (player->xtralife+1)) { ++gainlives; ++player->xtralife; @@ -940,13 +933,6 @@ void P_GivePlayerRings(player_t *player, INT32 num_rings) P_PlayLivesJingle(player); } } - - if (mariomode && player->health > 100 && !G_RingSlingerGametype() && !G_TagGametype()) - { - player->mo->health = 1 + (player->health - 1) % 100; - player->health = player->mo->health; - player->xtralife = 0; - } } // @@ -1371,13 +1357,6 @@ void P_SpawnShieldOrb(player_t *player) case SH_THUNDERCOIN: orbtype = MT_THUNDERCOIN_ORB; break; - case SH_FIREFLOWER: - if (!(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) - { - player->mo->color = SKINCOLOR_WHITE; - G_GhostAddColor(GHC_FIREFLOWER); - } - return; default: return; } @@ -1440,33 +1419,18 @@ void P_SpawnShieldOrb(player_t *player) // the non-stack layer of shields thoroughly, // then adds the desired one. // -// Returns whether to play a normal sound or an itemup. -// -boolean P_SwitchShield(player_t *player, UINT16 shieldtype) +void P_SwitchShield(player_t *player, UINT16 shieldtype) { boolean donthavealready = (shieldtype & SH_FORCE) ? (!(player->powers[pw_shield] & SH_FORCE) || (player->powers[pw_shield] & SH_FORCEHP) < (shieldtype & ~SH_FORCE)) : ((player->powers[pw_shield] & SH_NOSTACK) != shieldtype); - if (mariomode) - { - mobj_t *scoremobj = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + (player->mo->height / 2), MT_SCORE); - P_SetMobjState(scoremobj, mobjinfo[MT_SCORE].spawnstate+3); // 1000 - P_AddPlayerScore(player, 1000); - } - if (donthavealready) { boolean stopshieldability = (shieldtype & SH_FORCE) ? (!(player->powers[pw_shield] & SH_FORCE)) : true; - if (mariomode) - { - player->mo->movecount = player->powers[pw_shield]; - player->powers[pw_marioflashing] = MARIOFLASHINGTICS; - } - // Just in case. if (stopshieldability && player->pflags & PF_SHIELDABILITY) { @@ -1474,14 +1438,7 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) player->homing = 0; } - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER // it's implicit that the new shield isn't a fireflower - && !(player->powers[pw_super] || (mariomode && player->powers[pw_invulnerability]))) - { - player->mo->color = player->skincolor; - G_GhostAddColor(GHC_NORMAL); - } - - player->powers[pw_shield] = shieldtype|(mariomode ? SH_MUSHROOM : player->powers[pw_shield] & SH_STACK); + player->powers[pw_shield] = shieldtype|(player->powers[pw_shield] & SH_STACK); P_SpawnShieldOrb(player); if (shieldtype & SH_PROTECTWATER) @@ -1497,9 +1454,7 @@ boolean P_SwitchShield(player_t *player, UINT16 shieldtype) P_RestoreMusic(player); } } - return true; } - return (!mariomode); } // @@ -2203,7 +2158,7 @@ static void P_CheckInvincibilityTimer(player_t *player) { if (mariomode) { - if ((player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER) + if ((player->powers[pw_shield] & SH_STACK) == SH_FIREFLOWER) { player->mo->color = SKINCOLOR_WHITE; G_GhostAddColor(GHC_FIREFLOWER); @@ -3227,7 +3182,7 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) if (cmd->buttons & BT_ATTACK || cmd->buttons & BT_FIRENORMAL) { - if (!(player->pflags & PF_ATTACKDOWN) && (player->powers[pw_shield] & SH_NOSTACK) == SH_FIREFLOWER && !player->climbing) + if (!(player->pflags & PF_ATTACKDOWN) && (player->powers[pw_shield] & SH_STACK) == SH_FIREFLOWER && !player->climbing) { player->pflags |= PF_ATTACKDOWN; P_SpawnPlayerMissile(player->mo, MT_FIREBALL, 0); @@ -8594,9 +8549,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall dist = FixedHypot(f1, f2); if (mo->eflags & MFE_VERTICALFLIP) - angle = R_PointToAngle2(0, thiscam->z + thiscam->height, dist, mo->z + mo->height - (P_GetPlayerHeight(player) << shortmario(player))); + angle = R_PointToAngle2(0, thiscam->z + thiscam->height, dist, mo->z + mo->height - P_GetPlayerHeight(player)); else - angle = R_PointToAngle2(0, thiscam->z, dist, mo->z + (P_GetPlayerHeight(player) << shortmario(player))); + angle = R_PointToAngle2(0, thiscam->z, dist, mo->z + P_GetPlayerHeight(player)); if (player->playerstate != PST_DEAD) angle += (focusaiming < ANGLE_180 ? focusaiming/2 : InvAngle(InvAngle(focusaiming)/2)); // overcomplicated version of '((signed)focusaiming)/2;' @@ -9335,7 +9290,7 @@ void P_PlayerThink(player_t *player) player->losstime--; // Flash player after being hit. - if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < flashingtics && (leveltime & 1) && !player->powers[pw_marioflashing]) + if (player->powers[pw_flashing] > 0 && player->powers[pw_flashing] < flashingtics && (leveltime & 1)) player->mo->flags2 |= MF2_DONTDRAW; else player->mo->flags2 &= ~MF2_DONTDRAW; diff --git a/src/r_things.c b/src/r_things.c index eb1a3cb25..e8aa2956f 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1128,8 +1128,6 @@ static void R_ProjectSprite(mobj_t *thing) fixed_t offset, offset2; boolean papersprite = !!(thing->frame & FF_PAPERSPRITE); - fixed_t shortmarioshift = (objectplacing ? 0 : shortmario(thing->player)); - INT32 dispoffset = thing->info->dispoffset; //SoM: 3/17/2000 @@ -1364,12 +1362,6 @@ static void R_ProjectSprite(mobj_t *thing) return; } - if (shortmarioshift) // squish mario - { - yscale >>= shortmarioshift; - this_scale >>= shortmarioshift; - } - //SoM: 3/17/2000: Disregard sprites that are out of view.. if (vflip) { @@ -1385,9 +1377,6 @@ static void R_ProjectSprite(mobj_t *thing) gz = gzt - FixedMul(spritecachedinfo[lump].height, this_scale); } - if (shortmarioshift) // unsquish the x component - this_scale <<= shortmarioshift; - if (thing->subsector->sector->cullheight) { if (R_DoCulling(thing->subsector->sector->cullheight, viewsector->cullheight, viewz, gz, gzt)) @@ -1453,7 +1442,7 @@ static void R_ProjectSprite(mobj_t *thing) vis->thingheight = thing->height; vis->pz = thing->z; vis->pzt = vis->pz + vis->thingheight; - vis->texturemid = (vis->gzt - viewz) << shortmarioshift; + vis->texturemid = vis->gzt - viewz; vis->scalestep = scalestep; vis->mobj = thing; // Easy access! Tails 06-07-2002 From 0ccf6fe6a95ff651fc02f672a4f06ebccb3fa01e Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Oct 2016 12:43:54 +0100 Subject: [PATCH 246/808] I commented out this line a while ago because it didn't seem to be important, and flashingtics seems to be thoroughly set elsewhere. Here's an actual removal so it stands out on the git diff. --- 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 d038677db..3abb9aaca 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3135,7 +3135,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da else { player->health -= damage; // mirror mobj health here - //target->player->powers[pw_flashing] = flashingtics; + if (damage > 0) // don't spill emeralds/ammo/panels for shield damage P_PlayerRingBurst(player, damage); } From 162c04c37066d937193811e1f1020645590820ac Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Oct 2016 13:33:10 +0100 Subject: [PATCH 247/808] Bubblewrap shield now bounces on enemies and monitors instead of piercing through them. --- src/lua_baselib.c | 11 +++++++++++ src/p_inter.c | 25 +++++++++++++++++++------ src/p_local.h | 1 + src/p_map.c | 19 +++++++++++++------ src/p_mobj.c | 11 ++--------- src/p_user.c | 18 ++++++++++++++++++ 6 files changed, 64 insertions(+), 21 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index fca8050a9..33e54123d 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -777,6 +777,16 @@ static int lib_pDoJumpShield(lua_State *L) return 0; } +static int lib_pDoBubbleBounce(lua_State *L) +{ + player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + NOHUD + if (!player) + return LUA_ErrInvalid(L, "player_t"); + P_DoBubbleBounce(player); + return 0; +} + static int lib_pBlackOw(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); @@ -2048,6 +2058,7 @@ static luaL_Reg lib[] = { {"P_GivePlayerLives",lib_pGivePlayerLives}, {"P_ResetScore",lib_pResetScore}, {"P_DoJumpShield",lib_pDoJumpShield}, + {"P_DoBubbleBounce",lib_pDoBubbleBounce}, {"P_BlackOw",lib_pBlackOw}, {"P_ElementalFire",lib_pElementalFire}, {"P_DoPlayerExit",lib_pDoPlayerExit}, diff --git a/src/p_inter.c b/src/p_inter.c index 3abb9aaca..56e730017 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -240,7 +240,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) { player_t *player; INT32 i; - boolean elementalpierce; + UINT8 elementalpierce; if (objectplacing) return; @@ -295,7 +295,10 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) return; #endif - elementalpierce = (((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL || (player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (player->pflags & PF_SHIELDABILITY)); + // 0 = none, 1 = elemental pierce, 2 = bubble bounce + elementalpierce = (((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL || (player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (player->pflags & PF_SHIELDABILITY) + ? (((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) ? 1 : 2) + : 0); if (special->flags & MF_BOSS) { @@ -313,8 +316,13 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) || player->powers[pw_invulnerability] || player->powers[pw_super] || elementalpierce) // Do you possess the ability to subdue the object? { - if ((P_MobjFlip(toucher)*toucher->momz < 0) && !elementalpierce) - toucher->momz = -toucher->momz; + if ((P_MobjFlip(toucher)*toucher->momz < 0) && (elementalpierce != 1)) + { + if (elementalpierce == 2) + P_DoBubbleBounce(player); + else + toucher->momz = -toucher->momz; + } toucher->momx = -toucher->momx; toucher->momy = -toucher->momy; P_DamageMobj(special, toucher, toucher, 1, 0); @@ -359,8 +367,13 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) || ((player->charflags & SF_STOMPDAMAGE) && (P_MobjFlip(toucher)*(toucher->z - (special->z + special->height/2)) > 0) && (P_MobjFlip(toucher)*toucher->momz < 0)) || player->powers[pw_invulnerability] || player->powers[pw_super]) // Do you possess the ability to subdue the object? { - if ((P_MobjFlip(toucher)*toucher->momz < 0) && !elementalpierce) - toucher->momz = -toucher->momz; + if ((P_MobjFlip(toucher)*toucher->momz < 0) && (elementalpierce != 1)) + { + if (elementalpierce == 2) + P_DoBubbleBounce(player); + else + toucher->momz = -toucher->momz; + } P_DamageMobj(special, toucher, toucher, 1, 0); } diff --git a/src/p_local.h b/src/p_local.h index ee61d3389..322675f03 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -153,6 +153,7 @@ void P_ResetScore(player_t *player); boolean P_AutoPause(void); void P_DoJumpShield(player_t *player); +void P_DoBubbleBounce(player_t *player); void P_BlackOw(player_t *player); void P_ElementalFire(player_t *player, boolean cropcircle); diff --git a/src/p_map.c b/src/p_map.c index 72668e478..54eecac7a 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1052,9 +1052,10 @@ static boolean PIT_CheckThing(mobj_t *thing) else if (thing->z - FixedMul(FRACUNIT, thing->scale) <= tmthing->z + tmthing->height && thing->z + thing->height + FixedMul(FRACUNIT, thing->scale) >= tmthing->z) { - boolean elementalpierce = (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL - || (tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) - && (tmthing->player->pflags & PF_SHIELDABILITY)); + // 0 = none, 1 = elemental pierce, 2 = bubble bounce + UINT8 elementalpierce = (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL || (tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) && (tmthing->player->pflags & PF_SHIELDABILITY) + ? (((tmthing->player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL) ? 1 : 2) + : 0); if (thing->flags & MF_MONITOR && (tmthing->player->pflags & (PF_SPINNING|PF_GLIDING) || ((tmthing->player->pflags & PF_JUMPED) @@ -1066,6 +1067,7 @@ static boolean PIT_CheckThing(mobj_t *thing) && (P_MobjFlip(tmthing)*(tmthing->z - (thing->z + thing->height/2)) > 0) && (P_MobjFlip(tmthing)*tmthing->momz < 0)) || elementalpierce)) { + player_t *player = tmthing->player; SINT8 flipval = P_MobjFlip(thing); // Save this value in case monitor gets removed. fixed_t *momz = &tmthing->momz; // tmthing gets changed by P_DamageMobj, so we need a new pointer?! X_x;; fixed_t *z = &tmthing->z; // aau. @@ -1074,9 +1076,14 @@ static boolean PIT_CheckThing(mobj_t *thing) if ((P_MobjWasRemoved(thing) // Monitor was removed || !thing->health) // or otherwise popped && (flipval*(*momz) < 0) // monitor is on the floor and you're going down, or on the ceiling and you're going up - && !elementalpierce) // you're not piercing through the monitor... - *momz = -*momz; // Therefore, you should be thrust in the opposite direction, vertically. - if (!(elementalpierce && thing->flags & MF_GRENADEBOUNCE)) // prevent gold monitor clipthrough. + && (elementalpierce != 1)) // you're not piercing through the monitor... + { + if (elementalpierce == 2) + P_DoBubbleBounce(player); + else + *momz = -*momz; // Therefore, you should be thrust in the opposite direction, vertically. + } + if (!(elementalpierce == 1 && thing->flags & MF_GRENADEBOUNCE)) // prevent gold monitor clipthrough. return false; else *z -= *momz; // to ensure proper collision. diff --git a/src/p_mobj.c b/src/p_mobj.c index c94587ab4..31e0d477c 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3236,6 +3236,7 @@ static void P_PlayerZMovement(mobj_t *mo) mo->player->pflags &= ~(PF_JUMPED|PF_FORCEJUMPDAMAGE); mo->player->pflags &= ~(PF_THOKKED|PF_CANCARRY/*|PF_GLIDING*/); + mo->player->jumping = 0; mo->player->secondjump = 0; mo->player->glidetime = 0; mo->player->climbing = 0; @@ -3265,18 +3266,10 @@ static void P_PlayerZMovement(mobj_t *mo) } else if ((mo->player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP) // Bubble shield's bounce attack. { - S_StartSound(mo, sfx_s3k44); - P_DoJump(mo->player, false); - if (mo->player->charflags & SF_NOJUMPSPIN) - P_SetPlayerMobjState(mo, S_PLAY_FALL); - mo->player->pflags |= PF_THOKKED; - mo->player->secondjump = UINT8_MAX; - mo->momz = FixedMul(mo->momz, 5*FRACUNIT/4); + P_DoBubbleBounce(mo->player); clipmomz = false; } } - - mo->player->jumping = 0; // done down here because of bubblewrap } } if (!(mo->player->pflags & PF_SPINNING)) diff --git a/src/p_user.c b/src/p_user.c index 3754623de..5aa50458e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3927,6 +3927,24 @@ void P_DoJumpShield(player_t *player) } } +// +// P_DoBubbleBounce +// +// Bubblewrap shield landing handling +// +void P_DoBubbleBounce(player_t *player) +{ + player->pflags &= ~(PF_JUMPED|PF_SHIELDABILITY); + S_StartSound(player->mo, sfx_s3k44); + P_DoJump(player, false); + if (player->charflags & SF_NOJUMPSPIN) + P_SetPlayerMobjState(player->mo, S_PLAY_FALL); + player->pflags |= PF_THOKKED; + player->jumping = 0; + player->secondjump = UINT8_MAX; + player->mo->momz = FixedMul(player->mo->momz, 5*FRACUNIT/4); +} + // // P_Telekinesis // From 0ee2937392a8f4072937d725643374d7744c4c34 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Oct 2016 13:52:36 +0100 Subject: [PATCH 248/808] Adding ShieldSpecial hook. (Activates under different circumstances to the JumpSpinSpecial hook, and can be used to cancel existing shield actions.) --- src/lua_hook.h | 2 ++ src/lua_hooklib.c | 1 + src/p_user.c | 6 +++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lua_hook.h b/src/lua_hook.h index e0f08d175..cbeaa6868 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -44,6 +44,7 @@ enum hook { hook_HurtMsg, hook_PlayerSpawn, hook_ShieldSpawn, + hook_ShieldSpecial, hook_MAX // last hook }; @@ -79,5 +80,6 @@ boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg); // Hook fo boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source); // Hook for hurt messages #define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for G_SpawnPlayer #define LUAh_ShieldSpawn(player) LUAh_PlayerHook(player, hook_ShieldSpawn) // Hook for P_SpawnShieldOrb +#define LUAh_ShieldSpecial(player) LUAh_PlayerHook(player, hook_ShieldSpecial) // Hook for shield abilities #endif diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 1065f193a..ac0e555f7 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -55,6 +55,7 @@ const char *const hookNames[hook_MAX+1] = { "HurtMsg", "PlayerSpawn", "ShieldSpawn", + "ShieldSpecial", NULL }; diff --git a/src/p_user.c b/src/p_user.c index 5aa50458e..55d2ad544 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6978,10 +6978,14 @@ static void P_MovePlayer(player_t *player) //STUFF! // /////////////////////////// - if (player->pflags & PF_JUMPED) + if (player->pflags & PF_JUMPED && !player->exiting && player->mo->health) { if (cmd->buttons & BT_USE) // Spin button effects { +#ifdef HAVE_BLUA + if (LUAh_ShieldSpecial(player)) + return; +#endif if (!(player->pflags & (PF_USEDOWN|PF_GLIDING|PF_SLIDING|PF_SHIELDABILITY)) // If the player is not holding down BT_USE, or having used an ability previously && (!(player->pflags & PF_THOKKED) || ((player->powers[pw_shield] & SH_NOSTACK) == SH_BUBBLEWRAP && player->secondjump == UINT8_MAX))) // thokked is optional if you're bubblewrapped { From ea30450180e46be303b58f8a65adcea2268f0fcc Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Oct 2016 13:52:36 +0100 Subject: [PATCH 249/808] Minor correction to force-hud conditional. --- src/st_stuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 7670f577b..49872c68c 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -812,7 +812,7 @@ static void ST_drawFirstPersonHUD(void) return; // Graue 06-18-2004: no V_NOSCALESTART, no SCX, no SCY, snap to right - if (player->powers[pw_shield] & SH_FORCE) + if ((player->powers[pw_shield] & SH_NOSTACK & ~SH_FORCEHP) == SH_FORCE) { if ((player->powers[pw_shield] & SH_FORCEHP) > 0 || leveltime & 1) p = forceshield; From bf873f8a9bbf15a46e566448cd54644afda8e3d5 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Oct 2016 13:52:36 +0100 Subject: [PATCH 250/808] Fixed a heinous modding bug with not properly updating dehacked.c, and added pf_SHieldability to debug. --- src/dehacked.c | 2 ++ src/st_stuff.c | 13 +++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 7667ead82..eb7badd10 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6772,7 +6772,9 @@ static const char *const PLAYERFLAG_LIST[] = { /*** misc ***/ "FORCESTRAFE", // Translate turn inputs into strafe inputs "ANALOGMODE", // Analog mode? + "CANCARRY", // Can carry? "SHIELDABILITY", // Thokked with shield ability + "FORCEJUMPDAMAGE", // Force jump damage NULL // stop loop here. }; diff --git a/src/st_stuff.c b/src/st_stuff.c index 49872c68c..fb90bfe80 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -582,12 +582,13 @@ static void ST_drawDebugInfo(void) V_DrawRightAlignedString(320, height - 80, V_MONOSPACE, va("AIR: %4d, %3d", stplyr->powers[pw_underwater], stplyr->powers[pw_spacetime])); // Flags - V_DrawRightAlignedString(304-74, height - 72, V_MONOSPACE, "PF:"); - V_DrawString(304-72, height - 72, (stplyr->jumping) ? V_GREENMAP : V_REDMAP, "JM"); - V_DrawString(304-54, height - 72, (stplyr->pflags & PF_JUMPED) ? V_GREENMAP : V_REDMAP, "JD"); - V_DrawString(304-36, height - 72, (stplyr->pflags & PF_SPINNING) ? V_GREENMAP : V_REDMAP, "SP"); - V_DrawString(304-18, height - 72, (stplyr->pflags & PF_STARTDASH) ? V_GREENMAP : V_REDMAP, "ST"); - V_DrawString(304, height - 72, (stplyr->pflags & PF_THOKKED) ? V_GREENMAP : V_REDMAP, "TH"); + V_DrawRightAlignedString(304-92, height - 72, V_MONOSPACE, "PF:"); + V_DrawString(304-90, height - 72, (stplyr->jumping) ? V_GREENMAP : V_REDMAP, "JM"); + V_DrawString(304-72, height - 72, (stplyr->pflags & PF_JUMPED) ? V_GREENMAP : V_REDMAP, "JD"); + V_DrawString(304-54, height - 72, (stplyr->pflags & PF_SPINNING) ? V_GREENMAP : V_REDMAP, "SP"); + V_DrawString(304-36, height - 72, (stplyr->pflags & PF_STARTDASH) ? V_GREENMAP : V_REDMAP, "ST"); + V_DrawString(304-18, height - 72, (stplyr->pflags & PF_THOKKED) ? V_GREENMAP : V_REDMAP, "TH"); + V_DrawString(304, height - 72, (stplyr->pflags & PF_SHIELDABILITY) ? V_GREENMAP : V_REDMAP, "SH"); V_DrawRightAlignedString(320, height - 64, V_MONOSPACE, va("CEILZ: %6d", stplyr->mo->ceilingz>>FRACBITS)); V_DrawRightAlignedString(320, height - 56, V_MONOSPACE, va("FLOORZ: %6d", stplyr->mo->floorz>>FRACBITS)); From cc4d780371e81a8668292b61c538e0ca49b49d01 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Oct 2016 13:52:36 +0100 Subject: [PATCH 251/808] Making things more scale-friendly (but it's not perfect...) --- src/p_mobj.c | 1 - src/p_user.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 31e0d477c..5d1af9c45 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6819,7 +6819,6 @@ void P_MobjThinker(mobj_t *mobj) whoosh->destscale = whoosh->scale<<1; whoosh->fuse = 10; whoosh->flags |= MF_NOCLIPHEIGHT; - whoosh->height = 42*FRACUNIT; mobj->target->player->pflags &= ~PF_SHIELDABILITY; // prevent eternal whoosh } case MT_FLAMEAURA_ORB: diff --git a/src/p_user.c b/src/p_user.c index 55d2ad544..1514fdef6 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6994,7 +6994,7 @@ static void P_MovePlayer(player_t *player) { player->pflags |= PF_THOKKED|PF_SHIELDABILITY; #if 1 // almost imperceptible hop for the purposes of aligning with the aura for as long as possible - P_SetObjectMomZ(player->mo, -4*P_GetMobjGravity(player->mo), false); + P_SetObjectMomZ(player->mo, FixedDiv(-4*P_GetMobjGravity(player->mo), player->mo->scale), false); #else player->mo->momz = // intentionally carries to post-endif line as multiple-assignment #endif From a533701d859a8f44acaaebeb8a2136b2988f8f08 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Oct 2016 13:52:36 +0100 Subject: [PATCH 252/808] You know what, let's make this less hacky. --- src/p_user.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 1514fdef6..eddd0d9b8 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6993,10 +6993,9 @@ static void P_MovePlayer(player_t *player) if ((player->powers[pw_shield] & ~(SH_FORCEHP|SH_STACK)) == SH_FORCE) { player->pflags |= PF_THOKKED|PF_SHIELDABILITY; + player->mo->momz = // would intentionally carry to post-endif line as multiple-assignment #if 1 // almost imperceptible hop for the purposes of aligning with the aura for as long as possible - P_SetObjectMomZ(player->mo, FixedDiv(-4*P_GetMobjGravity(player->mo), player->mo->scale), false); -#else - player->mo->momz = // intentionally carries to post-endif line as multiple-assignment + -4*P_GetMobjGravity(player->mo); #endif player->mo->momx = player->mo->momy = 0; S_StartSound(player->mo, sfx_ngskid); From bfdaf5ee90ba81ab3b5659269883737093675cd1 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 24 Oct 2016 13:52:36 +0100 Subject: [PATCH 253/808] Fixed the Force stop's scaling properly. Woo! Branch is basically done now. --- src/p_mobj.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index 5d1af9c45..804b73372 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6396,6 +6396,7 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) thing->eflags = (thing->eflags & ~MFE_VERTICALFLIP)|(thing->target->eflags & MFE_VERTICALFLIP); P_SetScale(thing, FixedMul(thing->target->scale, thing->target->player->shieldscale)); + thing->destscale = thing->scale; P_UnsetThingPosition(thing); thing->x = thing->target->x; thing->y = thing->target->y; @@ -6817,6 +6818,8 @@ void P_MobjThinker(mobj_t *mobj) mobj_t *whoosh = P_SpawnMobjFromMobj(mobj, 0, 0, 0, MT_GHOST); // done here so the offset is correct P_SetMobjState(whoosh, mobj->info->raisestate); whoosh->destscale = whoosh->scale<<1; + whoosh->scalespeed = FixedMul(whoosh->scalespeed, whoosh->scale); + whoosh->height = 38*whoosh->scale; whoosh->fuse = 10; whoosh->flags |= MF_NOCLIPHEIGHT; mobj->target->player->pflags &= ~PF_SHIELDABILITY; // prevent eternal whoosh From 36b7156ff7601fbc01ce718e86aa8317ee969365 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 24 Oct 2016 23:11:41 +0100 Subject: [PATCH 254/808] Turns out it does work yay, just had to make some tweaks really Next question: should the calling mo be able to find itself in the blockmap, or should it skip itself? --- src/lua_baselib.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index f6933cd3a..8c0d3ff19 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -28,7 +28,7 @@ #define NOHUD if (hud_running) return luaL_error(L, "HUD rendering code should not call this function!"); // uncomment if you want to test -// #define LUA_BLOCKMAP + #define LUA_BLOCKMAP boolean luaL_checkboolean(lua_State *L, int narg) { luaL_checktype(L, narg, LUA_TBOOLEAN); @@ -218,6 +218,7 @@ static int lib_pPointOnLineSide(lua_State *L) } #ifdef LUA_BLOCKMAP +static boolean blockfuncerror = false; // auxillary function for lib_pSearchBlockmap_Objects static boolean lib_pSearchBlockmap_Objects_aux(lua_State *L, INT32 x, INT32 y, mobj_t *thing, int funcarg) { @@ -234,10 +235,11 @@ static boolean lib_pSearchBlockmap_Objects_aux(lua_State *L, INT32 x, INT32 y, m LUA_PushUserdata(L, thing, META_MOBJ); LUA_PushUserdata(L, mobj, META_MOBJ); if (lua_pcall(gL, 2, 1, 0)) { - if (cv_debug & DBG_LUA) + if (!blockfuncerror || cv_debug & DBG_LUA) CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1)); lua_pop(gL, 1); - return false; + blockfuncerror = true; + return true; } if (!lua_isnil(gL, -1)) { // if nil, continue @@ -263,9 +265,10 @@ static int lib_pSearchBlockmap_Objects(lua_State *L) INT32 xl, xh, yl, yh, bx, by; fixed_t x1, x2, y1, y2; int funcarg; + boolean retval = true; // the mobj we are searching around - mobj_t *mobj = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); + mobj = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); if (!mobj) return LUA_ErrInvalid(L, "mobj_t"); @@ -297,19 +300,18 @@ static int lib_pSearchBlockmap_Objects(lua_State *L) BMBOUNDFIX(xl, xh, yl, yh); + blockfuncerror = false; // reset for (bx = xl; bx <= xh; bx++) for (by = yl; by <= yh; by++) { - if (!lib_pSearchBlockmap_Objects_aux(L, bx, by, mobj, funcarg)){ - lua_pushboolean(L, false); - return 1; - } + if (!lib_pSearchBlockmap_Objects_aux(L, bx, by, mobj, funcarg)) + retval = false; if (P_MobjWasRemoved(mobj)){ lua_pushboolean(L, false); - return 1; + return 1; } } - lua_pushboolean(L, true); + lua_pushboolean(L, retval); return 1; } #endif From 98e43ac0d94b5813fb2abcfb9f73842f8df0f116 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 25 Oct 2016 16:15:17 +0100 Subject: [PATCH 255/808] Fixed ffloor_t Lua variables not actually saving to $$$.sav Stupid overlooked semicolons --- src/lua_script.c | 4 ++-- src/p_spec.c | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/lua_script.c b/src/lua_script.c index 158b1bc4b..35d3fd51f 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -715,10 +715,10 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex) if (!rover) WRITEUINT8(save_p, ARCH_NULL); else { - ffloor_t *r2 = NULL; + ffloor_t *r2; UINT16 i = 0; // search for id - for (r2 = rover->target->ffloors; r2; r2 = r2->next); + for (r2 = rover->target->ffloors; r2; r2 = r2->next) { if (r2 == rover) break; diff --git a/src/p_spec.c b/src/p_spec.c index 2b02cc6ca..31203165d 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4753,7 +4753,7 @@ static inline ffloor_t *P_GetFFloorBySec(sector_t *sec, sector_t *sec2) /** Gets a 3Dfloor by ID number. * * \param sec Target sector. - * \param id ID of 3Dfloor in target sector. Can be a number from 0 to sec->numattached-1. + * \param id ID of 3Dfloor in target sector. Note that the first FOF's ID is 0. * \return Pointer to found 3Dfloor, or NULL. * \sa P_GetFFloorBySec */ @@ -4764,8 +4764,6 @@ ffloor_t *P_GetFFloorByID(sector_t *sec, UINT16 id) if (!sec->ffloors) return NULL; - if (id >= sec->numattached) - return NULL; // ID out of range for (rover = sec->ffloors; rover; rover = rover->next) if (i++ == id) return rover; From 60dcfd1021a58cef8a3f5a3fac10c7d5a7b13dd2 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 25 Oct 2016 22:39:27 +0100 Subject: [PATCH 256/808] Pop result of P_SearchBlockmap_Objects's function arg Also P_SearchBlockmap_Lines is a thing now too --- src/lua_baselib.c | 154 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 8c0d3ff19..9eec5bc6e 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -246,6 +246,7 @@ static boolean lib_pSearchBlockmap_Objects_aux(lua_State *L, INT32 x, INT32 y, m if (lua_toboolean(gL, -1)) return false; } + lua_pop(gL, 1); if (P_MobjWasRemoved(thing) // func just popped our thing, cannot continue. || (bnext && P_MobjWasRemoved(bnext))) // func just broke blockmap chain, cannot continue. { @@ -314,6 +315,158 @@ static int lib_pSearchBlockmap_Objects(lua_State *L) lua_pushboolean(L, retval); return 1; } + +// auxillary function for lib_pSearchBlockmap_Objects +static boolean lib_pSearchBlockmap_Lines_aux(lua_State *L, INT32 x, INT32 y, mobj_t *thing, int funcarg) +{ + INT32 offset; + const INT32 *list; // Big blockmap +#ifdef POLYOBJECTS + polymaplink_t *plink; // haleyjd 02/22/06 +#endif + line_t *ld; + + if (x < 0 || y < 0 || x >= bmapwidth || y >= bmapheight) + return true; + + offset = y*bmapwidth + x; + +#ifdef POLYOBJECTS + // haleyjd 02/22/06: consider polyobject lines + plink = polyblocklinks[offset]; + + while (plink) + { + polyobj_t *po = plink->po; + + if (po->validcount != validcount) // if polyobj hasn't been checked + { + size_t i; + po->validcount = validcount; + + for (i = 0; i < po->numLines; ++i) + { + if (po->lines[i]->validcount == validcount) // line has been checked + continue; + po->lines[i]->validcount = validcount; + + lua_pushvalue(L, funcarg); + LUA_PushUserdata(L, thing, META_MOBJ); + LUA_PushUserdata(L, po->lines[i], META_LINE); + if (lua_pcall(gL, 2, 1, 0)) { + if (!blockfuncerror || cv_debug & DBG_LUA) + CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1)); + lua_pop(gL, 1); + blockfuncerror = true; + return true; + } + if (!lua_isnil(gL, -1)) + { // if nil, continue + if (lua_toboolean(gL, -1)) + return false; + } + lua_pop(gL, 1); + if (P_MobjWasRemoved(thing)) + return true; + } + } + plink = (polymaplink_t *)(plink->link.next); + } +#endif + + offset = *(blockmap + offset); // offset = blockmap[y*bmapwidth+x]; + + // First index is really empty, so +1 it. + for (list = blockmaplump + offset + 1; *list != -1; list++) + { + ld = &lines[*list]; + + if (ld->validcount == validcount) + continue; // Line has already been checked. + + ld->validcount = validcount; + + lua_pushvalue(L, funcarg); + LUA_PushUserdata(L, thing, META_MOBJ); + LUA_PushUserdata(L, ld, META_LINE); + if (lua_pcall(gL, 2, 1, 0)) { + if (!blockfuncerror || cv_debug & DBG_LUA) + CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1)); + lua_pop(gL, 1); + blockfuncerror = true; + return true; + } + if (!lua_isnil(gL, -1)) + { // if nil, continue + if (lua_toboolean(gL, -1)) + return false; + } + lua_pop(gL, 1); + if (P_MobjWasRemoved(thing)) + return true; + } + return true; // Everything was checked. +} + +// P_SearchBlockmap_Lines +// same deal as the _Objects version +static int lib_pSearchBlockmap_Lines(lua_State *L) +{ + int n = lua_gettop(L); + mobj_t *mobj; + INT32 xl, xh, yl, yh, bx, by; + fixed_t x1, x2, y1, y2; + int funcarg; + boolean retval = true; + + // the mobj we are searching around + mobj = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); + if (!mobj) + return LUA_ErrInvalid(L, "mobj_t"); + + if (n > 2) // specific x/y ranges have been supplied + { + if (n < 6) + return luaL_error(L, "arguments 2 to 5 not all given (expected 4 fixed-point integers)"); + + x1 = luaL_checkfixed(L, 2); + x2 = luaL_checkfixed(L, 3); + y1 = luaL_checkfixed(L, 4); + y2 = luaL_checkfixed(L, 5); + funcarg = 6; + } + else // mobj and function only - search around mobj's radius by default + { + x1 = mobj->x - mobj->radius; + x2 = mobj->x + mobj->radius; + y1 = mobj->y - mobj->radius; + y2 = mobj->y + mobj->radius; + funcarg = 2; + } + luaL_checktype(L, funcarg, LUA_TFUNCTION); + + xl = (unsigned)(x1 - bmaporgx - MAXRADIUS)>>MAPBLOCKSHIFT; + xh = (unsigned)(x2 - bmaporgx + MAXRADIUS)>>MAPBLOCKSHIFT; + yl = (unsigned)(y1 - bmaporgy - MAXRADIUS)>>MAPBLOCKSHIFT; + yh = (unsigned)(y2 - bmaporgy + MAXRADIUS)>>MAPBLOCKSHIFT; + + BMBOUNDFIX(xl, xh, yl, yh); + + blockfuncerror = false; // reset + validcount++; + for (bx = xl; bx <= xh; bx++) + for (by = yl; by <= yh; by++) + { + if (!lib_pSearchBlockmap_Lines_aux(L, bx, by, mobj, funcarg)) + retval = false; + if (P_MobjWasRemoved(mobj)){ + lua_pushboolean(L, false); + return 1; + } + } + lua_pushboolean(L, retval); + return 1; +} #endif // P_ENEMY @@ -2105,6 +2258,7 @@ static luaL_Reg lib[] = { {"P_PointOnLineSide",lib_pPointOnLineSide}, #ifdef LUA_BLOCKMAP {"P_SearchBlockmap_Objects",lib_pSearchBlockmap_Objects}, + {"P_SearchBlockmap_Lines",lib_pSearchBlockmap_Lines}, #endif // p_enemy From dc1e7165f7938812f6e0c825b45923bd825c50a2 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 27 Oct 2016 18:10:30 +0100 Subject: [PATCH 257/808] Created lua_blockmaplib.c, for Lua's blockmap library my P_SearchBlockmap_* functions are now a single searchBlockmap function, you can choose between "objects" and "lines" with the first arg to decide what to iterate through. I also rearranged the argument order a bit for easy stack cleanup etc I'll remove the old stuff later, don't worry, it's disabled for now --- SRB2.cbp | 15 ++ src/CMakeLists.txt | 1 + src/blua/Makefile.cfg | 1 + src/lua_baselib.c | 3 +- src/lua_blockmaplib.c | 248 +++++++++++++++++++++++++ src/lua_libs.h | 1 + src/lua_script.c | 1 + src/sdl/Srb2SDL-vc10.vcxproj | 1 + src/sdl/Srb2SDL-vc10.vcxproj.filters | 3 + src/win32/Srb2win-vc10.vcxproj | 1 + src/win32/Srb2win-vc10.vcxproj.filters | 3 + 11 files changed, 277 insertions(+), 1 deletion(-) create mode 100644 src/lua_blockmaplib.c diff --git a/SRB2.cbp b/SRB2.cbp index 99a712264..f56a9a160 100644 --- a/SRB2.cbp +++ b/SRB2.cbp @@ -2561,6 +2561,21 @@ HW3SOUND for 3D hardware sound support