亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? p_spec.c

?? 游戲類程序源代碼---WinDoom 3D源程序.zip
?? C
?? 第 1 頁 / 共 2 頁
字號:
// Emacs style mode select   -*- C++ -*- 
//-----------------------------------------------------------------------------
//
// $Id:$
//
// Copyright (C) 1993-1996 by id Software, Inc.
//
// This source is available for distribution and/or modification
// only under the terms of the DOOM Source Code License as
// published by id Software. All rights reserved.
//
// The source is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
// for more details.
//
// $Log:$
//
// DESCRIPTION:
//	Implements special effects:
//	Texture animation, height or lighting changes
//	 according to adjacent sectors, respective
//	 utility functions, etc.
//	Line Tag handling. Line and Sector triggers.
//
//-----------------------------------------------------------------------------

static const char
rcsid[] = "$Id: p_spec.c,v 1.6 1997/02/03 22:45:12 b1 Exp $";

#include <stdlib.h>

#include "doomdef.h"
#include "doomstat.h"

#include "i_system.h"
#include "z_zone.h"
#include "m_argv.h"
#include "m_random.h"
#include "w_wad.h"

#include "r_local.h"
#include "p_local.h"

#include "g_game.h"

#include "s_sound.h"

// State.
#include "r_state.h"

// Data.
#include "sounds.h"


//
// Animating textures and planes
// There is another anim_t used in wi_stuff, unrelated.
//
typedef struct
{
    boolean	istexture;
    int		picnum;
    int		basepic;
    int		numpics;
    int		speed;
    
} anim_t;

//
//      source animation definition
//
typedef struct
{
    boolean	istexture;	// if false, it is a flat
    char	endname[9];
    char	startname[9];
    int		speed;
} animdef_t;



#define MAXANIMS                32

extern anim_t	anims[MAXANIMS];
extern anim_t*	lastanim;

//
// P_InitPicAnims
//

// Floor/ceiling animation sequences,
//  defined by first and last frame,
//  i.e. the flat (64x64 tile) name to
//  be used.
// The full animation sequence is given
//  using all the flats between the start
//  and end entry, in the order found in
//  the WAD file.
//
animdef_t		animdefs[] =
{
    {false,	"NUKAGE3",	"NUKAGE1",	8},
    {false,	"FWATER4",	"FWATER1",	8},
    {false,	"SWATER4",	"SWATER1", 	8},
    {false,	"LAVA4",	"LAVA1",	8},
    {false,	"BLOOD3",	"BLOOD1",	8},

    // DOOM II flat animations.
    {false,	"RROCK08",	"RROCK05",	8},		
    {false,	"SLIME04",	"SLIME01",	8},
    {false,	"SLIME08",	"SLIME05",	8},
    {false,	"SLIME12",	"SLIME09",	8},

    {true,	"BLODGR4",	"BLODGR1",	8},
    {true,	"SLADRIP3",	"SLADRIP1",	8},

    {true,	"BLODRIP4",	"BLODRIP1",	8},
    {true,	"FIREWALL",	"FIREWALA",	8},
    {true,	"GSTFONT3",	"GSTFONT1",	8},
    {true,	"FIRELAVA",	"FIRELAV3",	8},
    {true,	"FIREMAG3",	"FIREMAG1",	8},
    {true,	"FIREBLU2",	"FIREBLU1",	8},
    {true,	"ROCKRED3",	"ROCKRED1",	8},

    {true,	"BFALL4",	"BFALL1",	8},
    {true,	"SFALL4",	"SFALL1",	8},
    {true,	"WFALL4",	"WFALL1",	8},
    {true,	"DBRAIN4",	"DBRAIN1",	8},
	
    {-1}
};

anim_t		anims[MAXANIMS];
anim_t*		lastanim;


//
//      Animating line specials
//
#define MAXLINEANIMS            64

extern  short	numlinespecials;
extern  line_t*	linespeciallist[MAXLINEANIMS];



void P_InitPicAnims (void)
{
    int		i;

    
    //	Init animation
    lastanim = anims;
    for (i=0 ; animdefs[i].istexture != -1 ; i++)
    {
	if (animdefs[i].istexture)
	{
	    // different episode ?
	    if (R_CheckTextureNumForName(animdefs[i].startname) == -1)
		continue;	

	    lastanim->picnum = R_TextureNumForName (animdefs[i].endname);
	    lastanim->basepic = R_TextureNumForName (animdefs[i].startname);
	}
	else
	{
	    if (W_CheckNumForName(animdefs[i].startname) == -1)
		continue;

	    lastanim->picnum = R_FlatNumForName (animdefs[i].endname);
	    lastanim->basepic = R_FlatNumForName (animdefs[i].startname);
	}

	lastanim->istexture = animdefs[i].istexture;
	lastanim->numpics = lastanim->picnum - lastanim->basepic + 1;

	if (lastanim->numpics < 2)
	    I_Error ("P_InitPicAnims: bad cycle from %s to %s",
		     animdefs[i].startname,
		     animdefs[i].endname);
	
	lastanim->speed = animdefs[i].speed;
	lastanim++;
    }
	
}



//
// UTILITIES
//



//
// getSide()
// Will return a side_t*
//  given the number of the current sector,
//  the line number, and the side (0/1) that you want.
//
side_t*
getSide
( int		currentSector,
  int		line,
  int		side )
{
    return &sides[ (sectors[currentSector].lines[line])->sidenum[side] ];
}


//
// getSector()
// Will return a sector_t*
//  given the number of the current sector,
//  the line number and the side (0/1) that you want.
//
sector_t*
getSector
( int		currentSector,
  int		line,
  int		side )
{
    return sides[ (sectors[currentSector].lines[line])->sidenum[side] ].sector;
}


//
// twoSided()
// Given the sector number and the line number,
//  it will tell you whether the line is two-sided or not.
//
int
twoSided
( int	sector,
  int	line )
{
    return (sectors[sector].lines[line])->flags & ML_TWOSIDED;
}




//
// getNextSector()
// Return sector_t * of sector next to current.
// NULL if not two-sided line
//
sector_t*
getNextSector
( line_t*	line,
  sector_t*	sec )
{
    if (!(line->flags & ML_TWOSIDED))
	return NULL;
		
    if (line->frontsector == sec)
	return line->backsector;
	
    return line->frontsector;
}



//
// P_FindLowestFloorSurrounding()
// FIND LOWEST FLOOR HEIGHT IN SURROUNDING SECTORS
//
fixed_t	P_FindLowestFloorSurrounding(sector_t* sec)
{
    int			i;
    line_t*		check;
    sector_t*		other;
    fixed_t		floor = sec->floorheight;
	
    for (i=0 ;i < sec->linecount ; i++)
    {
	check = sec->lines[i];
	other = getNextSector(check,sec);

	if (!other)
	    continue;
	
	if (other->floorheight < floor)
	    floor = other->floorheight;
    }
    return floor;
}



//
// P_FindHighestFloorSurrounding()
// FIND HIGHEST FLOOR HEIGHT IN SURROUNDING SECTORS
//
fixed_t	P_FindHighestFloorSurrounding(sector_t *sec)
{
    int			i;
    line_t*		check;
    sector_t*		other;
    fixed_t		floor = -500*FRACUNIT;
	
    for (i=0 ;i < sec->linecount ; i++)
    {
	check = sec->lines[i];
	other = getNextSector(check,sec);
	
	if (!other)
	    continue;
	
	if (other->floorheight > floor)
	    floor = other->floorheight;
    }
    return floor;
}



//
// P_FindNextHighestFloor
// FIND NEXT HIGHEST FLOOR IN SURROUNDING SECTORS
// Note: this should be doable w/o a fixed array.

// 20 adjoining sectors max!
#define MAX_ADJOINING_SECTORS    	20

fixed_t
P_FindNextHighestFloor
( sector_t*	sec,
  int		currentheight )
{
    int			i;
    int			h;
    int			min;
    line_t*		check;
    sector_t*		other;
    fixed_t		height = currentheight;

    
    fixed_t		heightlist[MAX_ADJOINING_SECTORS];		

    for (i=0, h=0 ;i < sec->linecount ; i++)
    {
	check = sec->lines[i];
	other = getNextSector(check,sec);

	if (!other)
	    continue;
	
	if (other->floorheight > height)
	    heightlist[h++] = other->floorheight;

	// Check for overflow. Exit.
	if ( h >= MAX_ADJOINING_SECTORS )
	{
	    fprintf( stderr,
		     "Sector with more than 20 adjoining sectors\n" );
	    break;
	}
    }
    
    // Find lowest height in list
    if (!h)
	return currentheight;
		
    min = heightlist[0];
    
    // Range checking? 
    for (i = 1;i < h;i++)
	if (heightlist[i] < min)
	    min = heightlist[i];
			
    return min;
}


//
// FIND LOWEST CEILING IN THE SURROUNDING SECTORS
//
fixed_t
P_FindLowestCeilingSurrounding(sector_t* sec)
{
    int			i;
    line_t*		check;
    sector_t*		other;
    fixed_t		height = MAXINT;
	
    for (i=0 ;i < sec->linecount ; i++)
    {
	check = sec->lines[i];
	other = getNextSector(check,sec);

	if (!other)
	    continue;

	if (other->ceilingheight < height)
	    height = other->ceilingheight;
    }
    return height;
}


//
// FIND HIGHEST CEILING IN THE SURROUNDING SECTORS
//
fixed_t	P_FindHighestCeilingSurrounding(sector_t* sec)
{
    int		i;
    line_t*	check;
    sector_t*	other;
    fixed_t	height = 0;
	
    for (i=0 ;i < sec->linecount ; i++)
    {
	check = sec->lines[i];
	other = getNextSector(check,sec);

	if (!other)
	    continue;

	if (other->ceilingheight > height)
	    height = other->ceilingheight;
    }
    return height;
}



//
// RETURN NEXT SECTOR # THAT LINE TAG REFERS TO
//
int
P_FindSectorFromLineTag
( line_t*	line,
  int		start )
{
    int	i;
	
    for (i=start+1;i<numsectors;i++)
	if (sectors[i].tag == line->tag)
	    return i;
    
    return -1;
}




//
// Find minimum light from an adjacent sector
//
int
P_FindMinSurroundingLight
( sector_t*	sector,
  int		max )
{
    int		i;
    int		min;
    line_t*	line;
    sector_t*	check;
	
    min = max;
    for (i=0 ; i < sector->linecount ; i++)
    {
	line = sector->lines[i];
	check = getNextSector(line,sector);

	if (!check)
	    continue;

	if (check->lightlevel < min)
	    min = check->lightlevel;
    }
    return min;
}



//
// EVENTS
// Events are operations triggered by using, crossing,
// or shooting special lines, or by timed thinkers.
//

//
// P_CrossSpecialLine - TRIGGER
// Called every time a thing origin is about
//  to cross a line with a non 0 special.
//
void
P_CrossSpecialLine
( int		linenum,
  int		side,
  mobj_t*	thing )
{
    line_t*	line;
    int		ok;

    line = &lines[linenum];
    
    //	Triggers that other things can activate
    if (!thing->player)
    {
	// Things that should NOT trigger specials...
	switch(thing->type)
	{
	  case MT_ROCKET:
	  case MT_PLASMA:
	  case MT_BFG:
	  case MT_TROOPSHOT:
	  case MT_HEADSHOT:
	  case MT_BRUISERSHOT:
	    return;
	    break;
	    
	  default: break;
	}
		
	ok = 0;
	switch(line->special)
	{
	  case 39:	// TELEPORT TRIGGER
	  case 97:	// TELEPORT RETRIGGER
	  case 125:	// TELEPORT MONSTERONLY TRIGGER
	  case 126:	// TELEPORT MONSTERONLY RETRIGGER
	  case 4:	// RAISE DOOR
	  case 10:	// PLAT DOWN-WAIT-UP-STAY TRIGGER
	  case 88:	// PLAT DOWN-WAIT-UP-STAY RETRIGGER
	    ok = 1;
	    break;
	}
	if (!ok)
	    return;
    }

    
    // Note: could use some const's here.
    switch (line->special)
    {
	// TRIGGERS.
	// All from here to RETRIGGERS.
      case 2:
	// Open Door
	EV_DoDoor(line,open);
	line->special = 0;
	break;

      case 3:
	// Close Door
	EV_DoDoor(line,close);
	line->special = 0;
	break;

      case 4:
	// Raise Door
	EV_DoDoor(line,normal);
	line->special = 0;
	break;
	
      case 5:
	// Raise Floor
	EV_DoFloor(line,raiseFloor);
	line->special = 0;
	break;
	
      case 6:
	// Fast Ceiling Crush & Raise
	EV_DoCeiling(line,fastCrushAndRaise);
	line->special = 0;
	break;
	
      case 8:
	// Build Stairs
	EV_BuildStairs(line,build8);
	line->special = 0;
	break;
	
      case 10:
	// PlatDownWaitUp
	EV_DoPlat(line,downWaitUpStay,0);
	line->special = 0;
	break;
	
      case 12:
	// Light Turn On - brightest near
	EV_LightTurnOn(line,0);
	line->special = 0;
	break;
	
      case 13:
	// Light Turn On 255
	EV_LightTurnOn(line,255);
	line->special = 0;
	break;
	
      case 16:
	// Close Door 30
	EV_DoDoor(line,close30ThenOpen);
	line->special = 0;
	break;
	
      case 17:
	// Start Light Strobing
	EV_StartLightStrobing(line);
	line->special = 0;
	break;
	
      case 19:
	// Lower Floor
	EV_DoFloor(line,lowerFloor);
	line->special = 0;
	break;
	
      case 22:
	// Raise floor to nearest height and change texture
	EV_DoPlat(line,raiseToNearestAndChange,0);
	line->special = 0;
	break;
	
      case 25:
	// Ceiling Crush and Raise
	EV_DoCeiling(line,crushAndRaise);
	line->special = 0;
	break;
	
      case 30:
	// Raise floor to shortest texture height
	//  on either side of lines.
	EV_DoFloor(line,raiseToTexture);
	line->special = 0;
	break;
	
      case 35:
	// Lights Very Dark
	EV_LightTurnOn(line,35);
	line->special = 0;
	break;
	
      case 36:
	// Lower Floor (TURBO)
	EV_DoFloor(line,turboLower);
	line->special = 0;
	break;
	
      case 37:
	// LowerAndChange
	EV_DoFloor(line,lowerAndChange);
	line->special = 0;
	break;
	
      case 38:
	// Lower Floor To Lowest
	EV_DoFloor( line, lowerFloorToLowest );
	line->special = 0;
	break;
	
      case 39:
	// TELEPORT!
	EV_Teleport( line, side, thing );
	line->special = 0;
	break;

      case 40:
	// RaiseCeilingLowerFloor
	EV_DoCeiling( line, raiseToHighest );
	EV_DoFloor( line, lowerFloorToLowest );
	line->special = 0;
	break;
	
      case 44:
	// Ceiling Crush
	EV_DoCeiling( line, lowerAndCrush );
	line->special = 0;
	break;
	
      case 52:
	// EXIT!
	G_ExitLevel ();
	break;
	
      case 53:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲日本一区二区| 一卡二卡欧美日韩| 精品国产乱码久久久久久牛牛 | 一区二区三区在线免费播放| 国产蜜臀av在线一区二区三区| 欧美精品一区二区久久婷婷| 欧美大尺度电影在线| 日韩欧美国产小视频| www国产精品av| 久久一二三国产| 国产精品毛片大码女人| 亚洲人成精品久久久久| 亚洲综合在线免费观看| 舔着乳尖日韩一区| 久久不见久久见免费视频1| 精品一区二区三区在线播放 | 亚洲成a人片在线观看中文| 亚洲一区二区三区爽爽爽爽爽| 午夜久久久影院| 美女国产一区二区三区| 国产精品一区二区免费不卡| www.欧美色图| 欧美日韩免费观看一区三区| 欧美电影免费观看高清完整版| 国产偷v国产偷v亚洲高清| 亚洲精品免费在线观看| 男人操女人的视频在线观看欧美| 国产二区国产一区在线观看| 一本大道久久a久久综合| 在线成人免费视频| 欧美激情一区二区三区蜜桃视频| 一区二区三区色| 激情综合色综合久久| 色综合一个色综合亚洲| 欧美一区二区性放荡片| 国产精品女主播av| 日日摸夜夜添夜夜添亚洲女人| 国产一区二区按摩在线观看| 一本大道久久a久久精二百| 亚洲精品一区二区三区四区高清| 椎名由奈av一区二区三区| 免费的国产精品| 色综合中文综合网| 777奇米成人网| ㊣最新国产の精品bt伙计久久| 亚洲午夜视频在线| 国产福利91精品一区| 欧美一区二区三区爱爱| 亚洲精品免费视频| 成人午夜私人影院| 精品国产123| 亚洲一区二区综合| av电影在线观看不卡| 久久综合视频网| 婷婷成人综合网| 色天天综合久久久久综合片| 中文字幕精品三区| 国产一区激情在线| 精品国产网站在线观看| 日韩在线a电影| 91极品视觉盛宴| 亚洲视频综合在线| 99精品欧美一区二区三区综合在线| 精品成人在线观看| 国产在线视频一区二区| 日韩精品中午字幕| 日本va欧美va精品| 5858s免费视频成人| 亚洲一区欧美一区| 精品视频1区2区| 亚洲二区在线视频| 欧美在线观看视频一区二区三区| 亚洲精品五月天| 在线观看一区二区视频| 中文字幕亚洲成人| 在线一区二区三区| 亚洲国产你懂的| 欧美日本高清视频在线观看| 视频在线观看91| 欧美军同video69gay| 日精品一区二区| 91精品啪在线观看国产60岁| 青青草国产成人99久久| 欧美成人猛片aaaaaaa| 国产另类ts人妖一区二区| 久久精品亚洲精品国产欧美kt∨| 国内精品国产三级国产a久久 | 一区二区欧美国产| 欧美日韩一区中文字幕| 美日韩黄色大片| 日韩免费性生活视频播放| 韩国精品主播一区二区在线观看 | 99久久精品国产一区二区三区| 中文字幕综合网| 欧美日韩午夜在线视频| 美女www一区二区| 中文字幕成人在线观看| 在线亚洲免费视频| 蜜臀av性久久久久蜜臀aⅴ四虎| 久久久久9999亚洲精品| 99精品热视频| 日韩精品成人一区二区三区 | 一本高清dvd不卡在线观看| 亚瑟在线精品视频| 久久久噜噜噜久久中文字幕色伊伊 | 菠萝蜜视频在线观看一区| 一区二区三区四区不卡在线| 91精品国产综合久久精品app| 精品午夜久久福利影院| 亚洲人吸女人奶水| 精品少妇一区二区三区日产乱码 | 久久综合九色综合97婷婷女人 | 狠狠狠色丁香婷婷综合激情 | 久久综合久久久久88| 成人高清视频免费观看| 日本不卡视频在线观看| 国产精品色呦呦| 欧美一区二区三区性视频| 91色婷婷久久久久合中文| 久久精品国产网站| 亚洲一级在线观看| 国产精品久久久久久久久久免费看| 欧美丰满美乳xxx高潮www| av网站免费线看精品| 狠狠色综合色综合网络| 污片在线观看一区二区| 亚洲欧美日韩在线播放| 国产欧美1区2区3区| 欧美成人午夜电影| 欧美高清你懂得| 91麻豆福利精品推荐| 国产精品一区二区免费不卡| 天天色图综合网| 一区二区三区四区高清精品免费观看| 国产亚洲午夜高清国产拍精品| 538prom精品视频线放| 色94色欧美sute亚洲线路一ni | 制服丝袜一区二区三区| 欧美色涩在线第一页| 91精品福利视频| 99久久久国产精品免费蜜臀| 成人免费电影视频| 成人免费观看av| 国产精品888| 国产激情一区二区三区四区| 蜜臀国产一区二区三区在线播放| 亚洲一区二区精品3399| 亚洲一区二区四区蜜桃| 亚洲精品乱码久久久久久久久 | 欧美日韩电影在线播放| 91国模大尺度私拍在线视频| 97久久精品人人爽人人爽蜜臀 | 青青草97国产精品免费观看无弹窗版| 亚洲黄色在线视频| 亚洲黄色尤物视频| 亚洲国产wwwccc36天堂| 天天综合网 天天综合色| 免费看黄色91| 精品一区二区三区视频在线观看 | 蜜乳av一区二区| 激情伊人五月天久久综合| 韩国av一区二区三区在线观看| 韩国av一区二区三区四区| 成人午夜av电影| 91色在线porny| 欧美日韩中字一区| 日韩丝袜美女视频| 久久久久国产精品麻豆| 国产精品美女久久久久久2018| 亚洲欧美日韩国产成人精品影院| 亚洲午夜日本在线观看| 久久福利资源站| 不卡电影免费在线播放一区| 日本韩国一区二区三区| 欧美一区午夜视频在线观看| 久久综合色婷婷| 亚洲色图一区二区| 日韩av午夜在线观看| 高清成人在线观看| 欧美午夜理伦三级在线观看| 欧美r级在线观看| 国产精品高潮呻吟| 日本免费在线视频不卡一不卡二| 国产一区二区美女诱惑| 在线免费观看一区| 日韩欧美卡一卡二| 日韩一区有码在线| 奇米色777欧美一区二区| 成人精品电影在线观看| 欧美一区二区网站| 国产女同性恋一区二区| 偷拍与自拍一区| 丰满岳乱妇一区二区三区| 欧美日韩在线直播| 国产精品久久久久久久久免费桃花| 亚洲va中文字幕| 国产91精品一区二区麻豆亚洲| 欧美日韩精品一区视频| 中文字幕日韩av资源站| 国产精品一区二区不卡|