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

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

?? trigger.cpp

?? this keik game source
?? CPP
?? 第 1 頁 / 共 5 頁
字號:

if "killtarget" is set, any objects that have a matching "target" will be
removed when the trigger is fired.

if "angle" is set, the trigger will only fire when someone is facing the 
direction of the angle.  Use "360" for an angle of 0.

"key" The item needed to activate this. (default nothing)

If NOT_PLAYERS is set, the trigger does not respond to players
If MONSTERS is set, the trigger will respond to monsters
If PROJECTILES is set, the trigger will respond to projectiles (rockets, grenades, etc.)

set "message" to text string

/*****************************************************************************/

CLASS_DECLARATION( Trigger, TriggerOnce, "trigger_once" );

ResponseDef TriggerOnce::Responses[] =
	{
		{ NULL, NULL }
	};

TriggerOnce::TriggerOnce()
	{
   //
   // gross HACK for oilrig.bsp
   //
   if ( message == "Foreman jumps over the edge of the rig" )
      {
      PostEvent( EV_Remove, 0 );
      }

	//
	// no matter what, we only trigger once
	//
	count = 1;
	respondto = spawnflags ^ TRIGGER_PLAYERS;

   // 
   // if it's not supposed to be touchable, clear the trigger
   //
   if ( spawnflags & 1 )
	   setSolidType( SOLID_NOT );
	}

/*****************************************************************************/
/*SINED trigger_relay (.5 .5 .5) (-8 -8 -8) (8 8 8) x x NOT_PLAYERS MONSTERS PROJECTILES

This fixed size trigger cannot be touched, it can only be fired by other events.
It can contain killtargets, targets, delays, and messages.

If NOT_PLAYERS is set, the trigger does not respond to events triggered by players
If MONSTERS is set, the trigger will respond to events triggered by monsters
If PROJECTILES is set, the trigger will respond to events triggered by projectiles (rockets, grenades, etc.)

/*****************************************************************************/

CLASS_DECLARATION( Trigger, TriggerRelay, "trigger_relay" );

ResponseDef TriggerRelay::Responses[] =
	{
		{ &EV_Touch, NULL },
		{ NULL, NULL }
	};

TriggerRelay::TriggerRelay()
	{
	setSolidType( SOLID_NOT );
	}

/*****************************************************************************/
/*SINED trigger_damagethreshold (0 .5 .8) ? x INVISIBLE NOT_PLAYERS MONSTERS ACCUMULATIVE

Triggers only when a threshold of damage is exceeded.
When used in conjunction with func_breakawaywall, allows
walls that may be destroyed with a rocket blast.  Will also trigger
any targeted func_areaportals when not invisible.

INVISIBLE tells the trigger to not be visible.

"health" specifies how much damage must occur before trigger fires.
Default is 60.

"cnt" specifies how many times the trigger can fire before it will remove itself.
-1 sepecies infinite firing.  Default is 1.

"key" The item needed to activate this. (default nothing)

If NOT_PLAYERS is set, the trigger does not respond to damage caused by players
If MONSTERS is set, the trigger will respond to damage caused by monsters

/*****************************************************************************/
#define DAMAGETHRESHOLD_ACCUMULATIVE   ( 1 << 4 )

CLASS_DECLARATION( Trigger, DamageThreshold, "trigger_damagethreshold" );

// Only used internally
static Event EV_DamageThreshold_Setup( "setup" );

ResponseDef DamageThreshold::Responses[] =
	{
	   { &EV_Damage,						( Response )DamageThreshold::DamageEvent },
	   { &EV_DamageThreshold_Setup,	( Response )DamageThreshold::Setup },
		{ &EV_Touch,						NULL },
		{ NULL, NULL }
	};

void DamageThreshold::DamageEvent
	(
	Event *ev
	)

	{
	Event			*event;
	Entity		*inflictor;
	Entity		*attacker;
	int			damage;

	if ( takedamage == DAMAGE_NO )
		{
		return;
		}

	damage		= ev->GetInteger( 1 );
	inflictor	= ev->GetEntity( 2 );
	attacker		= ev->GetEntity( 3 );

   if ( spawnflags & DAMAGETHRESHOLD_ACCUMULATIVE )
      {
      health -= damage;
   	damage_taken += damage;
      if ( health > 0 )
         return;
      }
   else
      {
	   if ( damage < health )
		   {
		   return;
		   }
   	damage_taken = damage;
      }

	event = new Event( EV_Activate );
	event->AddEntity( attacker );
	ProcessEvent( event );
	}

void DamageThreshold::Setup
	(
	Event *ev
	)

	{
	SetAreaPortals( Target(), false );
	}

DamageThreshold::DamageThreshold()
	{
	//
	// Default behavior is one use
	//
	count = G_GetIntArg( "cnt", 1 );

	damage_taken = 0;

	setSolidType( SOLID_BSP );
	setMoveType( MOVETYPE_PUSH );

	if ( !( spawnflags & INVISIBLE ) )
		{
		showModel();
		PostEvent( EV_DamageThreshold_Setup, 0 );
		}

	health = G_GetFloatArg( "health", 60 );
	max_health = health;
	takedamage = DAMAGE_YES;

	respondto = ( spawnflags ^ TRIGGER_PLAYERS ) & ~TRIGGER_PROJECTILES;
	}

/*****************************************************************************/
/*SINED trigger_secret (.5 .5 .5) ? notouch x NOT_PLAYERS MONSTERS PROJECTILES
Secret counter trigger.  Automatically sets and increments script variables \
level.total_secrets and level.found_secrets.

set "message" to text string

"key" The item needed to activate this. (default nothing)

"thread" name of thread to trigger.  This can be in a different script file as well \
by using the '::' notation.  (defaults to "global/universal_script.scr::secret")

If NOT_PLAYERS is set, the trigger does not respond to players
If MONSTERS is set, the trigger will respond to monsters
If PROJECTILES is set, the trigger will respond to projectiles (rockets, grenades, etc.)

/*****************************************************************************/

CLASS_DECLARATION( TriggerOnce, TriggerSecret, "trigger_secret" );

ResponseDef TriggerSecret::Responses[] =
	{
		{ &EV_Trigger_Effect,		( Response )TriggerSecret::FoundSecret },
		{ NULL, NULL }
	};

TriggerSecret::TriggerSecret()
	{
   if ( !LoadingSavegame )
      {
	   level.total_secrets++;
      levelVars.SetVariable( "total_secrets", level.total_secrets );
      }
	respondto = spawnflags ^ TRIGGER_PLAYERS;

   // set the thread to trigger when secrets are found
   thread = G_GetStringArg( "thread", "global/universal_script.scr::secret" );
	}

void TriggerSecret::FoundSecret
	(
	Event *ev
	)

	{
	//
	// anything that causes the trigger to fire increments the number
   // of secrets found.  This way, if the level designer triggers the
   // secret from the script, the player still gets credit for finding
   // it.  This is to prevent a secret from becoming undiscoverable.
	//
	level.found_secrets++;
   levelVars.SetVariable( "found_secrets", level.found_secrets );
   }

/*****************************************************************************/
/*SINED trigger_push (.5 .5 .5) ? x x NOT_PLAYERS NOT_MONSTERS NOT_PROJECTILES

Pushes entities as if they were caught in a heavy wind.

"speed" indicates the rate that entities are pushed (default 1000).

"angle" indicates the direction the wind is blowing (-1 is up, -2 is down)

"key" The item needed to activate this. (default nothing)

"target" if target is set, then a velocity will be calculated based on speed

If NOT_PLAYERS is set, the trigger does not push players
If NOT_MONSTERS is set, the trigger will not push monsters
If NOT_PROJECTILES is set, the trigger will not push projectiles (rockets, grenades, etc.)

/*****************************************************************************/

CLASS_DECLARATION( Trigger, TriggerPush, "trigger_push" );

ResponseDef TriggerPush::Responses[] =
	{
	   { &EV_Trigger_Effect,			( Response )TriggerPush::Push },
		{ NULL, NULL }
	};

void TriggerPush::Push
	(
	Event *ev
	)

	{
	Entity *other;

	other = ev->GetEntity( 1 );
	if ( other )
		{
      const char * targ;
	   Entity *ent;
	   int num;

      targ = Target ();
      if ( targ[ 0 ] )
         {
		   num = G_FindTarget( 0, Target() );
		   ent = G_GetEntity( num );
		   if ( num && ent )
            {
            other->velocity = G_CalculateImpulse
               (
               other->worldorigin,
               ent->worldorigin,
               speed,
               other->gravity
               );
            }
         }
      else
		   other->velocity = pushvelocity;
		}
	}

TriggerPush::TriggerPush()
	{
   speed = G_GetFloatArg( "speed", 1000 );
	pushvelocity = G_GetMovedir() * speed;
	respondto = spawnflags ^ ( TRIGGER_PLAYERS | TRIGGER_MONSTERS | TRIGGER_PROJECTILES );
	}

/*****************************************************************************/
/*SINED trigger_pushany (.5 .5 .5) ? x x NOT_PLAYERS NOT_MONSTERS NOT_PROJECTILES

Pushes entities as if they were caught in a heavy wind.

"speed" indicates the rate that entities are pushed (default 1000).
"angles" indicates the direction of the push
"key" The item needed to activate this. (default nothing)
"target" if target is set, then a velocity will be calculated based on speed

If NOT_PLAYERS is set, the trigger does not push players
If NOT_MONSTERS is set, the trigger will not push monsters
If NOT_PROJECTILES is set, the trigger will not push projectiles (rockets, grenades, etc.)

/*****************************************************************************/

CLASS_DECLARATION( Trigger, TriggerPushAny, "trigger_pushany" );

ResponseDef TriggerPushAny::Responses[] =
	{
	   { &EV_Trigger_Effect,			( Response )TriggerPushAny::Push },
		{ NULL, NULL }
	};

void TriggerPushAny::Push
	(
	Event *ev
	)

	{
	Entity *other;

	other = ev->GetEntity( 1 );
	if ( other )
		{
      const char * targ;
	   Entity *ent;
	   int num;

      targ = Target ();
      if ( targ[ 0 ] )
         {
		   num = G_FindTarget( 0, Target() );
		   ent = G_GetEntity( num );
		   if ( num && ent )
            {
            other->velocity = G_CalculateImpulse
               (
               other->worldorigin,
               ent->worldorigin,
               speed,
               other->gravity
               );
            }
         }
      else
		   other->velocity = pushvelocity;
		}
	}

TriggerPushAny::TriggerPushAny()
	{
   float mat[3][3];

   setAngles( G_GetVectorArg( "angles", Vector( 0, 0, 0 ) ) );
   AnglesToMat( angles.vec3(), mat );
   speed = G_GetFloatArg( "speed", 1000 );
	pushvelocity = Vector( mat[0][0],mat[0][1], mat[0][2] ) * speed;
	respondto = spawnflags ^ ( TRIGGER_PLAYERS | TRIGGER_MONSTERS | TRIGGER_PROJECTILES );
	}

/*****************************************************************************/
/*SINED play_sound_triggered (0.3 0.1 0.6) (-8 -8 -8) (8 8 8) AMBIENT-ON RELIABLE NOT_PLAYERS MONSTERS PROJECTILES AMBIENT-OFF x TOGGLE

DO NOT USE, USE TRIGGER_SPEAKER INSTEAD

play a sound when it is used

AMBIENT-ON specifies an ambient sound that starts on
RELIABLE should only be set for crucial voice-overs or sounds
AMBIENT-OFF specifies an ambient sound that starts off

if (AMBIENT-?) is not set, then the sound is sent over explicitly this creates more net traffic

"volume" how loud 0-4 (1 default full volume, ambients do not respond to volume)
"noise" sound to play
"channel" channel on which to play sound (0-7) (2 (voice) is default)
"attenuation" attenuation factor (0 becomes 1 for non-ambients, 2 for ambients)
   -1 - none, send to whole level
    0 - default (normal or ambient)
    1 - normal fighting sounds
    2 - idle monster sounds
    3 - ambient sounds
"key"          The item needed to activate this. (default nothing)

Normal sounds play each time the target is used.

Ambient Looped sounds have an attenuation of 2 by default, volume 1, and the use function toggles it on/off.
Multiple identical ambient looping sounds will just increase volume without any speed cost.
The attenuation factor can be over-ridden by specifying an attenuation factor.

If NOT_PLAYERS is set, the trigger does not respond to players
If MONSTERS is set, the trigger will respond to monsters
If PROJECTILES is set, the trigger will respond to projectiles (rockets, grenades, etc.)

/*****************************************************************************/

CLASS_DECLARATION( Trigger, TriggerPlaySound, "play_sound_triggered" );

Event EV_TriggerPlaySound_SetVolume( "volume" );
Event EV_TriggerPlaySound_SetAttenuation( "attenuation" );
Event EV_TriggerPlaySound_SetChannel( "channel" );

ResponseDef TriggerPlaySound::Responses[] =
	{
	   { &EV_Trigger_Effect,						( Response )TriggerPlaySound::ToggleSound },
	   { &EV_TriggerPlaySound_SetVolume,		( Response )TriggerPlaySound::SetVolume },
	   { &EV_TriggerPlaySound_SetAttenuation,	( Response )TriggerPlaySound::SetAttenuation },
	   { &EV_TriggerPlaySound_SetChannel,		( Response )TriggerPlaySound::SetChannel },
		{ &EV_Touch,                           NULL },
		{ NULL, NULL }
	};

void TriggerPlaySound::ToggleSound
	(
	Event *ev
	)

	{
	if ( !state )
		{
		// noise should already be initialized
		assert( Noise().length() );
      if ( ambient || spawnflags & 128 )
 		   state = 1;

      if (ambient)
         {
         int attn;

         attn = attenuation;
         if (attn > 3) attn = 3;
         if (attn < 0) attn = 0;
         edict->s.sound = ( gi.soundindex( Noise().c_str() ) ) + (attn<<14);
         }
      else
         {
		   sound( Noise().c_str(), volume, channel, attenuation, pitch, timeofs, fadetime );
         }
		}
	else
		{
		state = 0;
      if (ambient)
         edict->s.sound = 0;
      else
		   RandomGlobalSound( "null_sound", volume, channel | CHAN_NO_PHS_ADD, -1 );
		}
	}

void TriggerPlaySound::SetVolume
	(
	Event *ev
	)

	{
	//FIXME
	// update sound volume on client

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品影视在线| 成人av动漫在线| 欧美色视频一区| 亚洲欧洲中文日韩久久av乱码| 另类小说综合欧美亚洲| 欧美精品 日韩| 亚洲成人午夜电影| 国产一区二区三区美女| 久久婷婷国产综合国色天香| 国产自产视频一区二区三区| 中文字幕一区二区三| 欧美做爰猛烈大尺度电影无法无天| 亚洲电影在线播放| 日韩精品一区二区三区视频播放| 国产成人免费视频网站高清观看视频 | 久久国内精品自在自线400部| 精品国产伦一区二区三区观看方式 | 欧美一区二区视频在线观看2020 | 日韩欧美另类在线| 国产91在线|亚洲| 一区二区久久久久久| 日韩色在线观看| 成人免费视频网站在线观看| 一区二区三区四区不卡视频| 日韩精品一区二区在线| caoporm超碰国产精品| 日本亚洲视频在线| 1000精品久久久久久久久| 日韩一区二区免费视频| 99久久综合99久久综合网站| 蜜臀国产一区二区三区在线播放| 国产精品国产三级国产三级人妇| 欧美高清激情brazzers| av不卡在线播放| 日韩av在线发布| 亚洲欧美日韩在线不卡| 久久久精品免费免费| 欧美日韩国产一区二区三区地区| 成人永久看片免费视频天堂| 三级久久三级久久久| 亚洲色图制服诱惑| 久久精品视频一区| 欧美高清视频在线高清观看mv色露露十八 | 欧美精品自拍偷拍动漫精品| 成人在线综合网站| 精品一区二区三区在线视频| 亚洲妇熟xx妇色黄| 亚洲免费资源在线播放| 国产视频一区二区在线| 日韩三级中文字幕| 欧美在线你懂得| 91啪九色porn原创视频在线观看| 国产精选一区二区三区| 免费在线视频一区| 亚洲国产视频直播| 亚洲女人的天堂| 国产精品久久久久永久免费观看 | 欧美va在线播放| 884aa四虎影成人精品一区| 91在线观看美女| 成人黄色小视频| 国产高清久久久久| 麻豆专区一区二区三区四区五区| 亚洲成人午夜影院| 性久久久久久久久| 亚洲高清久久久| 一区二区在线观看免费视频播放| 中文字幕精品三区| 欧美国产日产图区| 亚洲国产岛国毛片在线| 久久网站热最新地址| 精品少妇一区二区三区日产乱码 | 午夜精品免费在线| 天堂va蜜桃一区二区三区漫画版| 一区二区欧美精品| 亚洲国产精品久久久久婷婷884 | 国产精品电影一区二区| 国产精品理论片在线观看| 国产精品乱人伦一区二区| 中文字幕日韩av资源站| 亚洲欧美aⅴ...| 一区二区三区四区高清精品免费观看 | 亚洲电影第三页| 亚洲永久精品国产| 午夜av电影一区| 日本一道高清亚洲日美韩| 蜜桃91丨九色丨蝌蚪91桃色| 精品在线免费观看| 国产99久久久精品| 色综合久久久久综合体| 在线免费av一区| 91精品一区二区三区在线观看| 欧美一区二区三区系列电影| 精品奇米国产一区二区三区| 国产欧美一区视频| 18成人在线视频| 亚洲1区2区3区4区| 狠狠色伊人亚洲综合成人| 国产福利精品一区| 一本到不卡精品视频在线观看| 欧美中文字幕一二三区视频| 日韩亚洲欧美一区| 国产欧美精品区一区二区三区 | 午夜视频在线观看一区二区三区| 日韩激情中文字幕| 国产一区二区三区久久久| 色综合久久综合| 91精品国产一区二区三区蜜臀| 久久亚洲一区二区三区四区| 亚洲视频一区二区在线观看| 亚洲图片欧美一区| 国模无码大尺度一区二区三区| 不卡在线观看av| 制服丝袜在线91| 国产精品国产三级国产a| 午夜精品久久久久久久久久| 久久99精品网久久| 色欧美片视频在线观看在线视频| 欧美一区日本一区韩国一区| 国产精品国产三级国产三级人妇| 日日欢夜夜爽一区| 9久草视频在线视频精品| 日韩一区二区影院| 亚洲美女屁股眼交| 久久av老司机精品网站导航| 91蜜桃网址入口| 亚洲人吸女人奶水| 日本中文在线一区| 91视频精品在这里| 久久久亚洲综合| 婷婷丁香激情综合| 不卡大黄网站免费看| 精品国产一区久久| 亚州成人在线电影| 91热门视频在线观看| 欧美高清在线一区二区| 免费成人av资源网| 欧美天堂一区二区三区| 国产精品高潮呻吟久久| 国产在线不卡一区| 欧美日韩精品一区二区三区 | 亚洲一区中文在线| 成人午夜电影网站| 精品国产乱码久久久久久免费| 日韩精品乱码免费| 欧美性大战久久久久久久| 国产精品久久久一本精品| 国产乱人伦偷精品视频免下载| 91精品在线观看入口| 亚洲福利视频导航| 欧美性视频一区二区三区| **性色生活片久久毛片| 成人丝袜视频网| 国产亚洲综合性久久久影院| 久久99精品久久久| 日韩一级大片在线| 美女网站视频久久| 欧美一三区三区四区免费在线看| 亚洲a一区二区| 91.麻豆视频| 亚洲成人久久影院| 欧美日韩精品一区二区三区四区| 亚洲自拍偷拍欧美| 欧美日韩一区精品| 亚洲高清免费在线| 制服丝袜亚洲色图| 日本va欧美va欧美va精品| 51精品视频一区二区三区| 日韩国产在线观看| 日韩色视频在线观看| 毛片不卡一区二区| 久久夜色精品国产噜噜av| 国产精品伊人色| 中文字幕第一页久久| 不卡av免费在线观看| 中文字幕五月欧美| 在线亚洲人成电影网站色www| 亚洲精品久久久蜜桃| 欧美优质美女网站| 日韩和欧美一区二区| 欧美一卡二卡在线| 国模娜娜一区二区三区| 国产精品久久久久桃色tv| 波多野结衣中文字幕一区二区三区 | 欧美日韩国产a| 国产高清视频一区| 国产精品毛片高清在线完整版| 91在线免费看| 午夜精品久久久久久久久久| 欧美精品一区二区三区视频| www.99精品| 亚洲va中文字幕| 久久亚洲私人国产精品va媚药| eeuss鲁片一区二区三区| 午夜免费久久看| 久久久精品蜜桃| 欧美图片一区二区三区| 久久国产精品99久久久久久老狼| 日本一二三不卡| 欧美日韩精品一区二区天天拍小说|