From eac78ec995ca9c50c0aa9b1b77976abdf76df989 Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 30 Mar 2019 19:35:46 +0000 Subject: [PATCH] This is just a little bit of work on making Ion Maiden run properly with regular EDuke32 binaries git-svn-id: https://svn.eduke32.com/eduke32@7455 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/player.cpp | 110 +++++++++++++++++++++-------------- 1 file changed, 67 insertions(+), 43 deletions(-) diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index e2f9a4451..86b213c76 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -114,7 +114,7 @@ void P_QuickKill(DukePlayer_t * const pPlayer) sprite[pPlayer->i].cstat |= 32768; #ifndef EDUKE32_STANDALONE - if (ud.god == 0) + if (!IONMAIDEN && ud.god == 0) A_DoGuts(pPlayer->i,JIBS6,8); #endif } @@ -222,19 +222,22 @@ static int A_FindTargetSprite(const spritetype *pSprite, int projAng, int projec return -1; #ifndef EDUKE32_STANDALONE - switch (DYNAMICTILEMAP(projecTile)) + if (!IONMAIDEN) { - case TONGUE__STATIC: - case FREEZEBLAST__STATIC: - case SHRINKSPARK__STATIC: - case SHRINKER__STATIC: - case RPG__STATIC: - case FIRELASER__STATIC: - case SPIT__STATIC: - case COOLEXPLOSION1__STATIC: - return -1; - default: - break; + switch (DYNAMICTILEMAP(projecTile)) + { + case TONGUE__STATIC: + case FREEZEBLAST__STATIC: + case SHRINKSPARK__STATIC: + case SHRINKER__STATIC: + case RPG__STATIC: + case FIRELASER__STATIC: + case SPIT__STATIC: + case COOLEXPLOSION1__STATIC: + return -1; + default: + break; + } } #endif } @@ -273,7 +276,7 @@ static int A_FindTargetSprite(const spritetype *pSprite, int projAng, int projec continue; #ifndef EDUKE32_STANDALONE - if ((isShrinker && sprite[spriteNum].xrepeat < 30 + if (!IONMAIDEN && (isShrinker && sprite[spriteNum].xrepeat < 30 && (PN(spriteNum) == SHARK || !(PN(spriteNum) >= GREENSLIME && PN(spriteNum) <= GREENSLIME + 7))) || (isFreezer && sprite[spriteNum].pal == 1)) continue; @@ -297,7 +300,7 @@ static int A_FindTargetSprite(const spritetype *pSprite, int projAng, int projec } #ifndef EDUKE32_STANDALONE - int const zOffset = (PN(spriteNum) == ORGANTIC || PN(spriteNum) == ROTATEGUN) ? 0 : ZOFFSET5; + int const zOffset = IONMAIDEN ? 0 : (PN(spriteNum) == ORGANTIC || PN(spriteNum) == ROTATEGUN) ? 0 : ZOFFSET5; #else int const zOffset = 0; #endif @@ -328,6 +331,9 @@ static void A_SetHitData(int spriteNum, const hitdata_t *hitData) #ifndef EDUKE32_STANDALONE static int CheckShootSwitchTile(int tileNum) { + if (IONMAIDEN) + return 0; + return tileNum == DIPSWITCH || tileNum == DIPSWITCH + 1 || tileNum == DIPSWITCH2 || tileNum == DIPSWITCH2 + 1 || tileNum == DIPSWITCH3 || tileNum == DIPSWITCH3 + 1 || tileNum == HANDSWITCH || tileNum == HANDSWITCH + 1; } @@ -371,7 +377,7 @@ static int GetAutoAimAng(int spriteNum, int playerNum, int projecTile, int zAdju int zCenter = 2 * (pSprite->yrepeat * tilesiz[pSprite->picnum].y) + zAdjust; #ifndef EDUKE32_STANDALONE - if (aimFlags && + if (!IONMAIDEN && aimFlags && ((pSprite->picnum >= GREENSLIME && pSprite->picnum <= GREENSLIME + 7) || pSprite->picnum == ROTATEGUN || pSprite->cstat & CSTAT_SPRITE_YCENTER)) #else if (aimFlags && pSprite->cstat & CSTAT_SPRITE_YCENTER) @@ -650,7 +656,7 @@ static int P_PostFireHitscan(int playerNum, int const spriteNum, hitdata_t *cons { A_DamageObject(hitData->sprite, spriteNum); - if (sprite[hitData->sprite].picnum == APLAYER && + if (!IONMAIDEN && sprite[hitData->sprite].picnum == APLAYER && (ud.ffire == 1 || (!GTFLAGS(GAMETYPE_PLAYERSFRIENDLY) && GTFLAGS(GAMETYPE_TDM) && g_player[P_Get(hitData->sprite)].ps->team != g_player[P_Get(spriteOwner)].ps->team))) { @@ -669,7 +675,7 @@ static int P_PostFireHitscan(int playerNum, int const spriteNum, hitdata_t *cons Proj_MaybeSpawn(spriteNum, spawnTile, hitData); } #ifndef EDUKE32_STANDALONE - if (playerNum >= 0 && CheckShootSwitchTile(sprite[hitData->sprite].picnum)) + if (!IONMAIDEN && playerNum >= 0 && CheckShootSwitchTile(sprite[hitData->sprite].picnum)) { P_ActivateSwitch(playerNum, hitData->sprite, 1); return -1; @@ -686,7 +692,7 @@ static int P_PostFireHitscan(int playerNum, int const spriteNum, hitdata_t *cons goto SKIPBULLETHOLE; #ifndef EDUKE32_STANDALONE - if (playerNum >= 0 && CheckShootSwitchTile(hitWall->picnum)) + if (!IONMAIDEN && playerNum >= 0 && CheckShootSwitchTile(hitWall->picnum)) { P_ActivateSwitch(playerNum, hitData->wall, 0); return -1; @@ -1631,7 +1637,7 @@ int A_ShootWithZvel(int const spriteNum, int const projecTile, int const forceZv #else return A_CheckSpriteTileFlags(projecTile, SFLAG_PROJECTILE) ? A_ShootCustom(spriteNum, projecTile, shootAng, &startPos) - : A_ShootHardcoded(spriteNum, projecTile, shootAng, startPos, pSprite, playerNum, pPlayer); + : !IONMAIDEN ? A_ShootHardcoded(spriteNum, projecTile, shootAng, startPos, pSprite, playerNum, pPlayer) : -1; #endif } @@ -2172,7 +2178,7 @@ void P_DisplayWeapon(void) #ifndef EDUKE32_STANDALONE int const quickKickFrame = 14 - pPlayer->quick_kick; - if ((quickKickFrame != 14 || pPlayer->last_quick_kick) && ud.drawweapon == 1) + if (!IONMAIDEN && (quickKickFrame != 14 || pPlayer->last_quick_kick) && ud.drawweapon == 1) { int const weaponPal = P_GetKneePal(pPlayer); @@ -2187,7 +2193,7 @@ void P_DisplayWeapon(void) guniqhudid = 0; } - if (sprite[pPlayer->i].xrepeat < 40) + if (!IONMAIDEN && sprite[pPlayer->i].xrepeat < 40) { static int32_t fistPos; @@ -2216,7 +2222,7 @@ void P_DisplayWeapon(void) case 1: break; #ifndef EDUKE32_STANDALONE case 2: - if ((unsigned)hudweap.cur < MAX_WEAPONS && hudweap.cur != KNEE_WEAPON) + if (!IONMAIDEN && (unsigned)hudweap.cur < MAX_WEAPONS && hudweap.cur != KNEE_WEAPON) rotatesprite_win(160 << 16, (180 + (pPlayer->weapon_pos * pPlayer->weapon_pos)) << 16, divscale16(ud.statusbarscale, 100), 0, hudweap.cur == GROW_WEAPON ? GROWSPRITEICON : WeaponPickupSprites[hudweap.cur], 0, 0, 2); @@ -2233,6 +2239,7 @@ void P_DisplayWeapon(void) int const weaponPal = P_GetHudPal(pPlayer); + if (!IONMAIDEN) switch (currentWeapon) { case KNEE_WEAPON: @@ -3119,6 +3126,9 @@ static int32_t P_DoCounters(int playerNum) DukePlayer_t *const pPlayer = g_player[playerNum].ps; #ifndef EDUKE32_STANDALONE + if (IONMAIDEN) + goto access_incs; // I'm sorry + if (pPlayer->invdisptime > 0) pPlayer->invdisptime--; @@ -3206,6 +3216,8 @@ static int32_t P_DoCounters(int playerNum) } else if (pPlayer->last_quick_kick > 0) --pPlayer->last_quick_kick; + +access_incs: #endif if (pPlayer->access_incs && sprite[pPlayer->i].pal != 1) @@ -3279,7 +3291,7 @@ static int32_t P_DoCounters(int playerNum) } #ifndef EDUKE32_STANDALONE - if (pPlayer->knuckle_incs) + if (!IONMAIDEN && pPlayer->knuckle_incs) { if (++pPlayer->knuckle_incs == 10) { @@ -3322,7 +3334,7 @@ void P_DropWeapon(int const playerNum) if (krand() & 1) A_Spawn(pPlayer->i, WeaponPickupSprites[currentWeapon]); #ifndef EDUKE32_STANDALONE - else + else if (!IONMAIDEN) switch (PWEAPON(playerNum, currentWeapon, WorksLike)) { case RPG_WEAPON: @@ -3348,7 +3360,7 @@ static void P_AddWeaponNoSwitch(DukePlayer_t * const p, int const weaponNum) p->gotweapon |= (1<gotweapon |= (1<hurt_delay < 8) { @@ -3561,7 +3573,8 @@ static void P_CheckTouchDamage(DukePlayer_t *pPlayer, int touchObject) pPlayer->vel.y = -(sintable[(fix16_to_int(pPlayer->q16ang))&2047]<<8); #ifndef EDUKE32_STANDALONE - A_PlaySound(DUKE_LONGTERM_PAIN,pPlayer->i); + if (!IONMAIDEN) + A_PlaySound(DUKE_LONGTERM_PAIN,pPlayer->i); #endif DoWallTouchDamage(pPlayer, touchWall); break; @@ -3591,11 +3604,14 @@ static int P_CheckFloorDamage(DukePlayer_t *pPlayer, int floorTexture) else { #ifndef EDUKE32_STANDALONE - if (!A_CheckSoundPlaying(pPlayer->i, DUKE_LONGTERM_PAIN)) - A_PlaySound(DUKE_LONGTERM_PAIN, pPlayer->i); + if (!IONMAIDEN) + { + if (!A_CheckSoundPlaying(pPlayer->i, DUKE_LONGTERM_PAIN)) + A_PlaySound(DUKE_LONGTERM_PAIN, pPlayer->i); - if (!A_CheckSoundPlaying(pPlayer->i, SHORT_CIRCUIT)) - A_PlaySound(SHORT_CIRCUIT, pPlayer->i); + if (!A_CheckSoundPlaying(pPlayer->i, SHORT_CIRCUIT)) + A_PlaySound(SHORT_CIRCUIT, pPlayer->i); + } #endif P_PalFrom(pPlayer, 32, 64, 64, 64); @@ -3614,7 +3630,7 @@ static int P_CheckFloorDamage(DukePlayer_t *pPlayer, int floorTexture) else { #ifndef EDUKE32_STANDALONE - if (!A_CheckSoundPlaying(pPlayer->i, DUKE_LONGTERM_PAIN)) + if (!IONMAIDEN && !A_CheckSoundPlaying(pPlayer->i, DUKE_LONGTERM_PAIN)) A_PlaySound(DUKE_LONGTERM_PAIN, pPlayer->i); #endif @@ -3628,7 +3644,7 @@ static int P_CheckFloorDamage(DukePlayer_t *pPlayer, int floorTexture) #ifndef EDUKE32_STANDALONE case FLOORPLASMA__STATIC: - if (rnd(32)) + if (!IONMAIDEN && rnd(32)) { if (pPlayer->inv_amount[GET_BOOTS] > 0) return 1; @@ -3714,16 +3730,19 @@ void P_FragPlayer(int playerNum) } #ifndef EDUKE32_STANDALONE - pPlayer->jetpack_on = 0; - pPlayer->holoduke_on = -1; - - S_StopEnvSound(DUKE_JETPACK_IDLE, pPlayer->i); - - if (pPlayer->scream_voice > FX_Ok) + if (!IONMAIDEN) { - FX_StopSound(pPlayer->scream_voice); - S_Cleanup(); - pPlayer->scream_voice = -1; + pPlayer->jetpack_on = 0; + pPlayer->holoduke_on = -1; + + S_StopEnvSound(DUKE_JETPACK_IDLE, pPlayer->i); + + if (pPlayer->scream_voice > FX_Ok) + { + FX_StopSound(pPlayer->scream_voice); + S_Cleanup(); + pPlayer->scream_voice = -1; + } } #endif @@ -4337,6 +4356,9 @@ static int P_DoFist(DukePlayer_t *pPlayer) // the fist punching NUKEBUTTON #ifndef EDUKE32_STANDALONE + if (IONMAIDEN) + return 0; + if (++(pPlayer->fist_incs) == 28) { if (ud.recstat == 1) @@ -4367,6 +4389,8 @@ static int P_DoFist(DukePlayer_t *pPlayer) return 1; } +#else + UNREFERENCED_PARAMETER(pPlayer); #endif return 0;