⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 p_inter.c

📁 The source code of Doom legacy for windows
💻 C
📖 第 1 页 / 共 5 页
字号:
        sound = sfx_getpow;        break;      case SPR_PINS:        if (!P_GivePower (player, pw_invisibility))            return;        player->message = GOTINVIS;        sound = sfx_getpow;        break;      case SPR_SUIT:        if (!P_GivePower (player, pw_ironfeet))            return;        player->message = GOTSUIT;        sound = sfx_getpow;        break;      case SPR_SPMP: // Item_SuperMap      case SPR_PMAP:        if (!P_GivePower (player, pw_allmap))            return;        player->message = GOTMAP;        if( gamemode != heretic )            sound = sfx_getpow;        break;      case SPR_PVIS:        if (!P_GivePower (player, pw_infrared))            return;        player->message = GOTVISOR;        sound = sfx_getpow;        break;        // heretic Ammo      case SPR_AMG1: // Ammo_GoldWandWimpy          if(!P_GiveAmmo(player, am_goldwand, special->health))          {              return;          }          if( cv_showmessages.value==1 )              P_SetMessage(player, TXT_AMMOGOLDWAND1, false);          break;      case SPR_AMG2: // Ammo_GoldWandHefty          if(!P_GiveAmmo(player, am_goldwand, special->health))          {              return;          }          if( cv_showmessages.value==1 )              P_SetMessage(player, TXT_AMMOGOLDWAND2, false);          break;      case SPR_AMM1: // Ammo_MaceWimpy          if(!P_GiveAmmo(player, am_mace, special->health))          {              return;          }          if( cv_showmessages.value==1 )              P_SetMessage(player, TXT_AMMOMACE1, false);          break;      case SPR_AMM2: // Ammo_MaceHefty          if(!P_GiveAmmo(player, am_mace, special->health))          {              return;          }          if( cv_showmessages.value==1 )              P_SetMessage(player, TXT_AMMOMACE2, false);          break;      case SPR_AMC1: // Ammo_CrossbowWimpy          if(!P_GiveAmmo(player, am_crossbow, special->health))          {              return;          }          if( cv_showmessages.value==1 )              P_SetMessage(player, TXT_AMMOCROSSBOW1, false);          break;      case SPR_AMC2: // Ammo_CrossbowHefty          if(!P_GiveAmmo(player, am_crossbow, special->health))          {              return;          }          if( cv_showmessages.value==1 )              P_SetMessage(player, TXT_AMMOCROSSBOW2, false);          break;      case SPR_AMB1: // Ammo_BlasterWimpy          if(!P_GiveAmmo(player, am_blaster, special->health))          {              return;          }          if( cv_showmessages.value==1 )              P_SetMessage(player, TXT_AMMOBLASTER1, false);          break;      case SPR_AMB2: // Ammo_BlasterHefty          if(!P_GiveAmmo(player, am_blaster, special->health))          {              return;          }          if( cv_showmessages.value==1 )              P_SetMessage(player, TXT_AMMOBLASTER2, false);          break;      case SPR_AMS1: // Ammo_SkullRodWimpy          if(!P_GiveAmmo(player, am_skullrod, special->health))          {              return;          }          if( cv_showmessages.value==1 )              P_SetMessage(player, TXT_AMMOSKULLROD1, false);          break;      case SPR_AMS2: // Ammo_SkullRodHefty          if(!P_GiveAmmo(player, am_skullrod, special->health))          {              return;          }          if( cv_showmessages.value==1 )              P_SetMessage(player, TXT_AMMOSKULLROD2, false);          break;      case SPR_AMP1: // Ammo_PhoenixRodWimpy          if(!P_GiveAmmo(player, am_phoenixrod, special->health))          {              return;          }          if( cv_showmessages.value==1 )              P_SetMessage(player, TXT_AMMOPHOENIXROD1, false);          break;      case SPR_AMP2: // Ammo_PhoenixRodHefty          if(!P_GiveAmmo(player, am_phoenixrod, special->health))          {              return;          }          if( cv_showmessages.value==1 )              P_SetMessage(player, TXT_AMMOPHOENIXROD2, false);          break;        // ammo      case SPR_CLIP:        if (special->flags & MF_DROPPED)        {            if (!P_GiveAmmo (player,am_clip,clipammo[am_clip]/2))                return;        }        else        {            if (!P_GiveAmmo (player,am_clip,clipammo[am_clip]))                return;        }        if(cv_showmessages.value==1)            player->message = GOTCLIP;        break;      case SPR_AMMO:        if (!P_GiveAmmo (player, am_clip,5*clipammo[am_clip]))            return;        if(cv_showmessages.value==1)            player->message = GOTCLIPBOX;        break;      case SPR_ROCK:        if (!P_GiveAmmo (player, am_misl,clipammo[am_misl]))            return;        if(cv_showmessages.value==1)            player->message = GOTROCKET;        break;      case SPR_BROK:        if (!P_GiveAmmo (player, am_misl,5*clipammo[am_misl]))            return;        if(cv_showmessages.value==1)            player->message = GOTROCKBOX;        break;      case SPR_CELL:        if (!P_GiveAmmo (player, am_cell,clipammo[am_cell]))            return;        if(cv_showmessages.value==1)            player->message = GOTCELL;        break;      case SPR_CELP:        if (!P_GiveAmmo (player, am_cell,5*clipammo[am_cell]))            return;        if(cv_showmessages.value==1)            player->message = GOTCELLBOX;        break;      case SPR_SHEL:        if (!P_GiveAmmo (player, am_shell,clipammo[am_shell]))            return;        if(cv_showmessages.value==1)            player->message = GOTSHELLS;        break;      case SPR_SBOX:        if (!P_GiveAmmo (player, am_shell,5*clipammo[am_shell]))            return;        if(cv_showmessages.value==1)            player->message = GOTSHELLBOX;        break;      case SPR_BPAK:        if (!player->backpack)        {            for (i=0 ; i<NUMAMMO ; i++)                player->maxammo[i] *= 2;            player->backpack = true;        }        for (i=0 ; i<NUMAMMO ; i++)            P_GiveAmmo (player, i, clipammo[i]);        player->message = GOTBACKPACK;        break;      case SPR_BAGH: // Item_BagOfHolding        if(!player->backpack)        {            for(i = 0; i < NUMAMMO; i++)                player->maxammo[i] *= 2;            player->backpack = true;        }        P_GiveAmmo(player, am_goldwand, AMMO_GWND_WIMPY);        P_GiveAmmo(player, am_blaster, AMMO_BLSR_WIMPY);        P_GiveAmmo(player, am_crossbow, AMMO_CBOW_WIMPY);        P_GiveAmmo(player, am_skullrod, AMMO_SKRD_WIMPY);        P_GiveAmmo(player, am_phoenixrod, AMMO_PHRD_WIMPY);        P_SetMessage(player, TXT_ITEMBAGOFHOLDING, false);        break;        // weapons      case SPR_BFUG:        if (!P_GiveWeapon (player, wp_bfg, false) )            return;        player->message = GOTBFG9000;        sound = sfx_wpnup;        break;      case SPR_MGUN:        if (!P_GiveWeapon (player, wp_chaingun, special->flags&MF_DROPPED) )            return;        player->message = GOTCHAINGUN;        sound = sfx_wpnup;        break;      case SPR_CSAW:        if (!P_GiveWeapon (player, wp_chainsaw, false) )            return;        player->message = GOTCHAINSAW;        sound = sfx_wpnup;        break;      case SPR_LAUN:        if (!P_GiveWeapon (player, wp_missile, false) )            return;        player->message = GOTLAUNCHER;        sound = sfx_wpnup;        break;      case SPR_PLAS:        if (!P_GiveWeapon (player, wp_plasma, false) )            return;        player->message = GOTPLASMA;        sound = sfx_wpnup;        break;      case SPR_SHOT:        if (!P_GiveWeapon (player, wp_shotgun, special->flags&MF_DROPPED ) )            return;        player->message = GOTSHOTGUN;        sound = sfx_wpnup;        break;      case SPR_SGN2:        if (!P_GiveWeapon (player, wp_supershotgun, special->flags&MF_DROPPED ) )            return;        player->message = GOTSHOTGUN2;        sound = sfx_wpnup;        break;      // heretic weapons      case SPR_WMCE: // Weapon_Mace          if(!P_GiveWeapon(player, wp_mace,false))          {              return;          }          P_SetMessage(player, TXT_WPNMACE, false);          sound = sfx_wpnup;          break;      case SPR_WBOW: // Weapon_Crossbow          if(!P_GiveWeapon(player, wp_crossbow,false))          {              return;          }          P_SetMessage(player, TXT_WPNCROSSBOW, false);          sound = sfx_wpnup;          break;      case SPR_WBLS: // Weapon_Blaster          if(!P_GiveWeapon(player, wp_blaster,false))          {              return;          }          P_SetMessage(player, TXT_WPNBLASTER, false);          sound = sfx_wpnup;          break;      case SPR_WSKL: // Weapon_SkullRod          if(!P_GiveWeapon(player, wp_skullrod, false))          {              return;          }          P_SetMessage(player, TXT_WPNSKULLROD, false);          sound = sfx_wpnup;          break;      case SPR_WPHX: // Weapon_PhoenixRod          if(!P_GiveWeapon(player, wp_phoenixrod, false))          {              return;          }          P_SetMessage(player, TXT_WPNPHOENIXROD, false);          sound = sfx_wpnup;          break;      case SPR_WGNT: // Weapon_Gauntlets          if(!P_GiveWeapon(player, wp_gauntlets, false))          {              return;          }          P_SetMessage(player, TXT_WPNGAUNTLETS, false);          sound = sfx_wpnup;          break;      default:        // SoM: New gettable things with FraggleScript!        //CONS_Printf ("\2P_TouchSpecialThing: Unknown gettable thing\n");        return;    }    if (special->flags & MF_COUNTITEM)        player->itemcount++;    P_RemoveMobj ( special );    player->bonuscount += BONUSADD;    //added:16-01-98:consoleplayer -> displayplayer (hear sounds from viewpoint)    if (player == &players[displayplayer] || (cv_splitscreen.value && player==&players[secondarydisplayplayer]))        S_StartSound (NULL, sound);}#ifdef thatsbuggycode////  Tell each supported thing to check again its position,//  because the 'base' thing has vanished or diminished,//  the supported things might fall.////added:28-02-98:void P_CheckSupportThings (mobj_t* mobj){    fixed_t   supportz = mobj->z + mobj->height;    while ((mobj = mobj->supportthings))    {        // only for things above support thing        if (mobj->z > supportz)            mobj->eflags |= MF_CHECKPOS;    }}////  If a thing moves and supportthings,//  move the supported things along.////added:28-02-98:void P_MoveSupportThings (mobj_t* mobj, fixed_t xmove, fixed_t ymove, fixed_t zmove){    fixed_t   supportz = mobj->z + mobj->height;    mobj_t    *mo = mobj->supportthings;    while (mo)    {        //added:28-02-98:debug        if (mo==mobj)        {            mobj->supportthings = NULL;            break;        }        // only for things above support thing        if (mobj->z > supportz)        {            mobj->eflags |= MF_CHECKPOS;            mobj->momx += xmove;            mobj->momy += ymove;            mobj->momz += zmove;        }        mo = mo->supportthings;    }}////  Link a thing to it's 'base' (supporting) thing.//  When the supporting thing will move or change size,//  the supported will then be aware.////added:28-02-98:void P_LinkFloorThing(mobj_t*   mobj){    mobj_t*     mo;    mobj_t*     nmo;    // no supporting thing    if (!(mo = mobj->floorthing))        return;    // link mobj 'above' the lower mobjs, so that lower supporting    // mobjs act upon this mobj    while ( (nmo = mo->supportthings) &&            (nmo->z<=mobj->z) )    {        // dont link multiple times        if (nmo==mobj)            return;        mo = nmo;    }    mo->supportthings = mobj;    mobj->supportthings = nmo;}////  Unlink a thing from it's support,//  when it's 'floorthing' has changed,//  before linking with the new 'floorthing'.////added:28-02-98:void P_UnlinkFloorThing(mobj_t*   mobj){    mobj_t*     mo;    if (!(mo = mobj->floorthing))      // just to be sure (may happen)       return;    while (mo->supportthings)    {        if (mo->supportthings == mobj)        {            mo->supportthings = NULL;            break;        }        mo = mo->supportthings;    }}#endif// Death messages relating to the target (dying) player//static void P_DeathMessages ( mobj_t*       target,                              mobj_t*       inflictor,                              mobj_t*       source ){    int     w;    char    *str;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -