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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? actor.cpp

?? this keik game source
?? CPP
?? 第 1 頁 / 共 5 頁
字號(hào):
			ent = targetList.ObjectAt( i );
			if ( ent )
				{
            if ( ent->flags & (FL_CLOAK|FL_STEALTH) )
               continue;

				if ( !ent->deadflag && Hates( ent ) && !IsEnemy( ent ) )
					{
					MakeEnemy( ent );
					}
				else if ( ent->isSubclassOf( Actor ) && Likes( ent ) )
					{
					act = ( Actor * )ent;
					if ( act->currentEnemy && Hates( act->currentEnemy ) && !IsEnemy( act->currentEnemy ) )
						{
						MakeEnemy( act->currentEnemy );
                  if ( act->deadflag )
                     {
                     //
                     // we have passed on the post mortem message of our death, so let's clear it
                     //
                     act->ClearEnemies();
                     }
						}
					}
				}
			}
		}

	newtarget = BestTarget();
	if ( newtarget && ( newtarget != currentEnemy ) )
		{
      seenEnemy = false;
		currentEnemy = newtarget;
		if ( DoAction( "sightenemy" ) )
			{
			seenEnemy = true;
   		Chatter( "snd_sightenemy", 5 );
			}
		else
			{
			currentEnemy = NULL;
			}
		}
	}

Entity *Actor::BestTarget
	(
	void
	)

   {
	int i;
	int n;
	Entity *ent;
	Entity *bestent;
	float bestscore;
	float score;

	bestscore = 8192 * 8192 * 20;
	n = enemyList.NumObjects();
   if ( n == 1 )
      {
      // don't waste our time when we only have one enemy
      return enemyList.ObjectAt( 1 );
      }

	bestent = NULL;
	for( i = 1; i <= n; i++ )
		{
		ent = enemyList.ObjectAt( i );
		if ( !ent || ent->deadflag )
			{
			enemyList.RemoveObjectAt( i );
			i--;
			n--;
			continue;
			}

      score = Range( ent ) + 1;
		if ( ent->health < WEAK_HEALTH )
			{
			// Try to kill off really weak enemies
			score *= WEAK_WEIGHT;
			}
		
		if ( ent->health > health )
			{
			score *= STRONGER_WEIGHT;
			}

		if ( CanSeeFOV( ent ) )
			{
			// We're more interested in guys we can see
			score *= VISIBLE_WEIGHT;
			}

		if ( i == n )
			{
			// Favor the latest enemy
			score *= NEWENEMY_WEIGHT;
			}

		if ( score < bestscore )
			{
			bestscore = score;
			bestent = ent;
			}
		}

	return bestent;
   }

Sentient *Actor::NearFriend
	(
	void
	)

	{
	int i;
	int num;
	Entity *ent;

	num = nearbyList.NumObjects();
	for( i = 1; i < num; i++ )
		{
		ent = nearbyList.ObjectAt( i );
		if ( Likes( ent ) )
			{
			return ( Sentient * )ent;
			}
		}

	return NULL;
	}

qboolean Actor::CloseToEnemy
	(
	Vector pos,
	float howclose
	)
	
	{
	Entity	*ent;
	int		i;
	int		n;

	n = enemyList.NumObjects();
	for( i = 1; i <= n; i++ )
		{
		ent = enemyList.ObjectAt( i );
		if ( !ent || ent->deadflag || ( ent->flags & FL_NOTARGET ) )
			{
			continue;
			}

		if ( WithinDistance( ent, howclose ) )
			{
			return true;
			}
		}

	return false;
	}

void Actor::EyeOffset
	(
	Event *ev
	)
	{
   eyeposition -= eyeoffset;
   eyeoffset = ev->GetVector( 1 );
   eyeposition += eyeoffset;
   }

//***********************************************************************************************
//
// State control functions
//
//***********************************************************************************************

void Actor::EnableState
	(
	str action
	)

	{
	StateInfo *ptr;

	ptr = GetState( action );
	if ( ptr )
		{
		ptr->ignore = false;
		}
	}

void Actor::DisableState
	(
	str action
	)

	{
	StateInfo *ptr;

	ptr = GetState( action );
	if ( ptr )
		{
		ptr->ignore = true;
		}
	}

StateInfo *Actor::SetResponse
	(
	str action,
	str response,
	qboolean ignore
	)

	{
	StateInfo *ptr;

	ptr = GetState( action );
	if ( !ptr )
		{
		ptr = new StateInfo;

		actionList.AddObject( ptr );
		ptr->action = action;
		}

	ptr->response = response;
	ptr->ignore = ignore;

	return ptr;
	}

const char *Actor::GetResponse
	(
	str action,
   qboolean force
	)

	{
	StateInfo *ptr;

	ptr = GetState( action );
	if ( ptr && ( force || !ptr->ignore ) )
		{
		return ptr->response.c_str();
		}

	return "";
	}

StateInfo *Actor::GetState
	(
	str action
	)

	{
	int i;
	int n;
	StateInfo *ptr;

	n = actionList.NumObjects();
	for( i = 1; i <= n; i++ )
		{
		ptr = actionList.ObjectAt( i );
		if ( ptr->action == action )
			{
			return ptr;
			}
		}

	return NULL;
	}

//***********************************************************************************************
//
// State stack management
//
//***********************************************************************************************

void Actor::ClearStateStack
	(
	void
	)

	{
	ActorState *state;
	int n;
	int i;

	while( !stateStack.Empty() )
		{
		state = stateStack.Pop();

		if ( state->animDoneEvent )
			{
			delete state->animDoneEvent;
			}

		// delete the old action/response list
		n = state->actionList.NumObjects();
		for( i = n; i >= 1; i-- )
			{
			delete state->actionList.ObjectAt( i );
			}
		state->actionList.ClearObjectList();

		if ( state->behavior )
			{
			delete state->behavior;
			}

		if ( state->path )
			{
			delete state->path;
			}
		
		delete state;
		}

	numonstack = 0;
	}

qboolean Actor::PopState
	(
	void
	)

	{
	ActorState *newstate;
	int n;
	int i;

#ifdef DEBUG_PRINT
	gi.dprintf( "%d Pop:", numonstack );
#endif
	if ( !stateStack.Empty() )
		{
		newstate = stateStack.Pop();
		numonstack--;

		state = newstate->name;

#ifdef DEBUG_PRINT
		gi.dprintf( "state '%s' anim '%s'", state.c_str(), newstate->anim.c_str() );
#endif
		if ( newstate->anim.length() )
			{
			SetAnim( newstate->anim, newstate->animDoneEvent );
			ChangeAnim();
			}

		SetPath( newstate->path );

#ifdef DEBUG_PRINT
		if ( newstate->behavior )
			{
			gi.dprintf( "%s", newstate->behavior->getClassname() );
			}
		else
			{
			gi.dprintf( "NULL behavior" );
			}
		gi.dprintf( "\n" );
#endif

		// NULL out our current thread so that EndBehavior doesn't
		// signal the thread that the behavior ended.
		thread = NULL;
		EndBehavior();

		assert( !behavior );

		// Set the thread after ending the old behavior, but before the new behavior
		if ( newstate->thread != -1 )
			{
			thread = Director.GetThread( newstate->thread );

			// Since PopState is called from the thread, we don't need to tell the thread to continue processing.
			// In fact, depending upon the state of the thread when we pushed it onto the stack, we may not want
			// the thread to continue processing (for example, if the last command was a waitFor).  Just restoring the
			// position here will tell the thread to continue executing or wait for an event to occur.
			// If we ever call PopState from outside of a thread, we MUST check to see if the thread should
			// continue execution.
			//FIXME
			// This is probably an actorthread that was removed
			// ADDENDUM: actorThread is now only removed once.  Thread should never be NULL.
			if ( thread )
				{
				thread->Restore( &newstate->marker );
				}
			}
		else
			{
			thread = NULL;
			}

		// delete the old action/response list
		n = actionList.NumObjects();
		for( i = n; i >= 1; i-- )
			{
			delete actionList.ObjectAt( i );
			}
		actionList.ClearObjectList();
		
		// Copy the new action/response list
		n = newstate->actionList.NumObjects();
		for( i = 1; i <= n; i++ )
			{
			actionList.AddObject( newstate->actionList.ObjectAt( i ) );
			}

		assert( !behavior );

		SetBehavior( newstate->behavior, NULL, thread );

		delete newstate;
		}
	else
		{
#ifdef DEBUG_PRINT
		gi.dprintf( "\n" );
#endif
		EndBehavior();

		return false;
		}

	return true;
	}

void Actor::PushState
	(
	const char *newstate,
	ScriptThread *newthread,
	ThreadMarker *marker
	)

	{
	ActorState *oldstate;
	int i;
	int n;

	oldstate = new ActorState;

	// push the old state
#ifdef DEBUG_PRINT
	gi.dprintf( "%d : Pushing old state %s\n", numonstack, state.c_str() );
	if ( behavior )
		{
		gi.dprintf( "old behavior %s\n", behavior->getClassname() );
		}
	else
		{
		gi.dprintf( "old behavior NULL\n" );
		}
	gi.dprintf( "new state %s\n", newstate );
#endif

	oldstate->name = state;
	oldstate->anim = animname;
	oldstate->animDoneEvent = animDoneEvent;
	animDoneEvent = NULL;

	oldstate->path = path;

	oldstate->behavior = behavior;

	// newthread must always be the old thread
	assert( newthread );
	oldstate->thread = newthread->ThreadNum();
	assert( marker );
	oldstate->marker = *marker;

	// Copy the action/response list
	n = actionList.NumObjects();
	for( i = 1; i <= n; i++ )
		{
		StateInfo *ptr;
		StateInfo *newobj;

		ptr = actionList.ObjectAt( i );
		newobj = new StateInfo;
		newobj->action		= ptr->action;
		newobj->response	= ptr->response;
		newobj->ignore		= ptr->ignore;
		oldstate->actionList.AddObject( newobj );
		}

	numonstack++;
	stateStack.Push( oldstate );

	// Any SetBehavior following this will delete this behavior, so null it out so that it doesn't happen
	if ( behavior )
		{
		behavior->End( *this );
		behavior = NULL;
		}

	state = newstate;
	thread = newthread;
	}

//***********************************************************************************************
//
// State control script commands
//
//***********************************************************************************************

void Actor::DefineStateEvent
	(
	Event *ev
	)

	{
	const char		*action;
	str				response;
	ScriptThread	*thread;
	str				script;
	int				len;

	action = ev->GetString( 1 );
	response = ev->GetString( 2 );

	// check if we have a filename in the label
	if ( !strstr( response.c_str(), "::" ) )
		{
		thread = ev->GetThread();
		if ( thread )
			{
			// add filename to the label so that if we jump to another script, our labels are still valid
			response = str( thread->Filename() ) + "::" + response;
			}
		}
	else
		{
		// prepend our debug directory name
		script = ai_actorscript->string;
		len = script.length();

		// if we have a directory, make sure that it ends with a '/' or a '\'
		if ( ( len > 0 ) && ( script[ len - 1 ] != '/' ) && ( script[ len - 1 ] != '\\' ) )
			{
			script 

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产一二三区| 色婷婷激情综合| 国产精品伊人色| 欧美日韩中文另类| 亚洲一区二区三区爽爽爽爽爽| 97精品国产97久久久久久久久久久久| 国产精品电影一区二区| 成人免费视频播放| **性色生活片久久毛片| 一本到三区不卡视频| 一区二区三国产精华液| 欧美美女黄视频| 久久99最新地址| 久久久久成人黄色影片| 亚洲黄色尤物视频| 69堂成人精品免费视频| 国内精品国产成人| 国产精品久久久久久久久免费樱桃| www.亚洲免费av| 亚洲最新在线观看| 欧美电视剧免费全集观看| 国产在线日韩欧美| 亚洲另类春色国产| 欧美一级专区免费大片| 成人免费视频app| 亚洲一区二区三区在线播放| 欧美一级夜夜爽| 成人久久视频在线观看| 亚洲一区在线观看网站| 国产不卡免费视频| 亚洲电影在线播放| 国产亚洲综合性久久久影院| 91视频一区二区三区| 偷拍与自拍一区| 国产精品三级久久久久三级| 欧美亚洲精品一区| 国产乱码精品一区二区三| 一区二区三区精品视频| 精品国产乱码久久久久久牛牛| 99国产一区二区三精品乱码| 男男视频亚洲欧美| 亚洲丝袜另类动漫二区| 精品人伦一区二区色婷婷| 日本精品视频一区二区三区| 久草在线在线精品观看| 亚洲一区欧美一区| 日本一区二区三区四区| 制服.丝袜.亚洲.中文.综合| av激情综合网| 久草精品在线观看| 午夜精品一区二区三区电影天堂| 中文字幕免费观看一区| 欧美mv日韩mv| 欧美三级电影精品| 不卡在线观看av| 国产在线精品免费av| 午夜精品在线视频一区| 国产精品久久久久aaaa樱花| 欧美草草影院在线视频| 欧美区视频在线观看| 99久久综合精品| 国产成人免费视频网站| 奇米一区二区三区| 午夜在线电影亚洲一区| 一区二区三区欧美日| 国产精品久久久久aaaa樱花 | 亚洲色图都市小说| 久久久久久97三级| 日韩精品一区在线| 91精品国产一区二区人妖| 在线观看一区二区视频| 91色在线porny| 一级特黄大欧美久久久| 亚洲视频每日更新| 国产精品国产三级国产aⅴ无密码| 精品播放一区二区| 精品嫩草影院久久| 福利一区在线观看| 成人激情免费视频| 国产成人久久精品77777最新版本| 国产一区在线精品| 国产一区二区三区不卡在线观看| 韩国精品久久久| 国产精品888| 国产成人精品亚洲午夜麻豆| 国产美女精品人人做人人爽| 国产精品资源网| 成人免费高清视频| 成人性色生活片免费看爆迷你毛片| 国产成人精品一区二| av高清不卡在线| 91福利在线看| 3d成人动漫网站| 日韩欧美一区在线观看| 精品久久久久久最新网址| 欧美精品一区二区不卡 | 欧美午夜片在线看| 欧美三级韩国三级日本三斤| 欧美一区二区三区在线电影| 欧美成va人片在线观看| 亚洲国产精华液网站w| 国产精品国产自产拍高清av| 亚洲精品免费在线观看| 五月激情综合网| 国产在线日韩欧美| www.一区二区| 欧美精品亚洲一区二区在线播放| 欧美大片日本大片免费观看| 国产喷白浆一区二区三区| 亚洲人成网站影音先锋播放| 丝袜a∨在线一区二区三区不卡| 老司机午夜精品| 国产jizzjizz一区二区| 91在线视频播放地址| 欧美日韩国产综合草草| 2023国产一二三区日本精品2022| 亚洲欧洲日产国码二区| 日韩制服丝袜先锋影音| 国产电影一区二区三区| 91福利精品第一导航| 精品国产乱码久久久久久影片| 亚洲人精品午夜| 免费久久精品视频| 91亚洲精品一区二区乱码| 69堂成人精品免费视频| 自拍偷拍亚洲欧美日韩| 日本不卡一二三区黄网| av在线免费不卡| 日韩欧美一级片| 一区二区三区中文字幕电影| 麻豆中文一区二区| 色悠悠亚洲一区二区| 久久亚洲一区二区三区明星换脸| 亚洲最大色网站| av不卡免费电影| 精品少妇一区二区三区日产乱码| 亚洲女同ⅹxx女同tv| 国产一区二区三区视频在线播放| 在线观看精品一区| 国产精品日韩成人| 久久99精品久久久久久| 欧洲av一区二区嗯嗯嗯啊| 欧美国产一区视频在线观看| 男女性色大片免费观看一区二区| 色综合久久六月婷婷中文字幕| 久久先锋资源网| 美女一区二区在线观看| 欧美在线999| 国产精品久久久久aaaa樱花| 黄色资源网久久资源365| 欧美日韩激情一区二区| 一区二区三区在线影院| 福利电影一区二区三区| 精品国产3级a| 青青草原综合久久大伊人精品优势| 99精品欧美一区二区蜜桃免费 | 韩国三级在线一区| 欧美日韩成人激情| 亚洲一区二区三区中文字幕| 色婷婷国产精品综合在线观看| 欧美高清在线视频| 国产精品自拍在线| 国产精品视频观看| 国产精品正在播放| 成人app在线| 国产精品情趣视频| 国产精品99久久久久| 久久久不卡网国产精品一区| 美脚の诱脚舐め脚责91| 欧美一区二区福利在线| 国产日本一区二区| 成人国产精品免费观看动漫| 欧美高清在线一区| av中文字幕一区| ●精品国产综合乱码久久久久| 99精品视频在线免费观看| 国产精品女主播av| 91美女在线视频| 亚洲一区二区三区四区不卡| 欧美日韩高清在线播放| 天堂成人国产精品一区| 欧美日韩亚洲综合| 日本va欧美va瓶| 久久综合久久综合久久| 成人性生交大片免费看中文| 国产精品美女久久久久久久久| 99久久精品国产麻豆演员表| 亚洲美女屁股眼交| 欧美日韩国产另类一区| 麻豆成人av在线| 欧美经典一区二区| 一本一道久久a久久精品综合蜜臀 一本一道综合狠狠老 | 国产午夜精品理论片a级大结局| 亚洲女同女同女同女同女同69| 欧美色爱综合网| 紧缚奴在线一区二区三区| 日本一区二区成人在线| 日本精品裸体写真集在线观看| 午夜精品久久久久| 久久久久国产精品人|