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

📄 client.htm

📁 Quake 的 各 种 文 档 格 式 说 明
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<i>/*
===========
PutClientInServer

called each time a player is spawned
============
*/</i>

<a href="qc-types.htm#void">void</a>() <a href="client.htm#DecodeLevelParms">DecodeLevelParms</a>;
<a href="qc-types.htm#void">void</a>() <a href="player.htm#PlayerDie">PlayerDie</a>;


<a href="qc-types.htm#void">void</a>() <b><a href="qc-glob.htm#f_PutClientInServer">PutClientInServer</a></b><a name="PutClientInServer">=</a>
{
	<b>local</b>	<a href="qc-types.htm#entity">entity</a> spot;

	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_classname">classname</a> = <b>"player"</b>;
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_health">health</a> = 100;
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_takedamage">takedamage</a> = <a href="qc-defs.htm#DAMAGE_AIM">DAMAGE_AIM</a>;
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_solid">solid</a> = <a href="qc-defs.htm#SOLID_SLIDEBOX">SOLID_SLIDEBOX</a>;
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_movetype">movetype</a> = <a href="qc-defs.htm#MOVETYPE_WALK">MOVETYPE_WALK</a>;
	<a href="qc-glob.htm#self">self</a>.show_hostile = 0;
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_max_health">max_health</a> = 100;
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_flags">flags</a> = <a href="defs.htm#FL_CLIENT">FL_CLIENT</a>;
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_air_finished">air_finished</a> = <a href="qc-glob.htm#time">time</a> + 12;
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_dmg">dmg</a> = 2;   		<i>// initial water damage</i>
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_super_damage_finished">super_damage_finished</a> = 0;
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_radsuit_finished">radsuit_finished</a> = 0;
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_invisible_finished">invisible_finished</a> = 0;
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_invincible_finished">invincible_finished</a> = 0;
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_effects">effects</a> = 0;
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_invincible_time">invincible_time</a> = 0;

	<a href="client.htm#DecodeLevelParms">DecodeLevelParms</a> ();
	
	<a href="weapons.htm#W_SetCurrentAmmo">W_SetCurrentAmmo</a> ();

	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_attack_finished">attack_finished</a> = <a href="qc-glob.htm#time">time</a>;
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_th_pain">th_pain</a> = <a href="player.htm#player_pain">player_pain</a>;
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_th_die">th_die</a> = <a href="player.htm#PlayerDie">PlayerDie</a>;
	
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_deadflag">deadflag</a> = <a href="qc-defs.htm#DEAD_NO">DEAD_NO</a>;
<i>// paustime is set by teleporters to keep the player from moving a while</i>
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_pausetime">pausetime</a> = 0;
	
	spot = <a href="client.htm#SelectSpawnPoint">SelectSpawnPoint</a> ();

	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin">origin</a> = spot.<a href="qc-enty.htm#dot_origin">origin</a> + '0 0 1';
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_angles">angles</a> = spot.<a href="qc-enty.htm#dot_angles">angles</a>;
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_fixangle">fixangle</a> = <a href="defs.htm#TRUE">TRUE</a>;		<i>// turn this way immediately</i>

<i>// oh, this is a hack!</i>
	<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"progs/eyes.mdl"</b>);
	modelindex_eyes = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_modelindex">modelindex</a>;

	<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"progs/player.mdl"</b>);
	modelindex_player = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_modelindex">modelindex</a>;

	<a href="qc-built.htm#setsize">setsize</a> (<a href="qc-glob.htm#self">self</a>, <a href="defs.htm#VEC_HULL_MIN">VEC_HULL_MIN</a>, <a href="defs.htm#VEC_HULL_MAX">VEC_HULL_MAX</a>);
	
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_view_ofs">view_ofs</a> = '0 0 22';

	<a href="player.htm#player_stand1">player_stand1</a> ();
	
	<b>if</b> (<a href="qc-glob.htm#deathmatch">deathmatch</a> || <a href="qc-glob.htm#coop">coop</a>)
	{
		<a href="qc-built.htm#makevectors">makevectors</a>(<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_angles">angles</a>);
		<a href="triggers.htm#spawn_tfog">spawn_tfog</a> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin">origin</a> + <a href="qc-built.htm#v_forward">v_forward</a>*20);
	}

	<a href="triggers.htm#spawn_tdeath">spawn_tdeath</a> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin">origin</a>, <a href="qc-glob.htm#self">self</a>);
};


<i>/*
=============================================================================

				QUAKED FUNCTIONS

=============================================================================
*/</i>



<i>/*QUAKED info_player_start (1 0 0) (-16 -16 -24) (16 16 24)
The normal starting point for a level.
*/</i>

<a href="qc-types.htm#void">void</a>() <b>info_player_start</b><a name="info_player_start">=</a>
{
};


<i>/*QUAKED info_player_start2 (1 0 0) (-16 -16 -24) (16 16 24)
Only used on start map for the return point from an episode.
*/</i>

<a href="qc-types.htm#void">void</a>() <b>info_player_start2</b><a name="info_player_start2">=</a>
{
};


<i>/*
saved out by quaked in region mode
*/</i>

<a href="qc-types.htm#void">void</a>() <b>testplayerstart</b><a name="testplayerstart">=</a>
{
};

<i>/*QUAKED info_player_deathmatch (1 0 1) (-16 -16 -24) (16 16 24)
potential spawning position for deathmatch games
*/</i>

<a href="qc-types.htm#void">void</a>() <b>info_player_deathmatch</b><a name="info_player_deathmatch">=</a>
{
};

<i>/*QUAKED info_player_coop (1 0 1) (-16 -16 -24) (16 16 24)
potential spawning position for coop games
*/</i>

<a href="qc-types.htm#void">void</a>() <b>info_player_coop</b><a name="info_player_coop">=</a>
{
};

<i>/*
===============================================================================

RULES

===============================================================================
*/</i>


<a href="qc-types.htm#void">void</a>(<a href="qc-types.htm#entity">entity</a> c) <b>PrintClientScore</b><a name="PrintClientScore">=</a>
{
	<b>if</b> (c.<a href="qc-enty.htm#dot_frags">frags</a> &gt; -10 &amp;&amp; c.<a href="qc-enty.htm#dot_frags">frags</a> &lt; 0)
		<a href="qc-built.htm#bprint">bprint</a> (<b>" "</b>);
	<b>else</b> <b>if</b> (c.<a href="qc-enty.htm#dot_frags">frags</a> &gt;= 0)
	{
		<b>if</b> (c.<a href="qc-enty.htm#dot_frags">frags</a> &lt; 100)
			<a href="qc-built.htm#bprint">bprint</a> (<b>" "</b>);
		<b>if</b> (c.<a href="qc-enty.htm#dot_frags">frags</a> &lt; 10)
			<a href="qc-built.htm#bprint">bprint</a> (<b>" "</b>);
	}
	<a href="qc-built.htm#bprint">bprint</a> (<a href="qc-built.htm#ftos">ftos</a>(c.<a href="qc-enty.htm#dot_frags">frags</a>));
	<a href="qc-built.htm#bprint">bprint</a> (<b>" "</b>);
	<a href="qc-built.htm#bprint">bprint</a> (c.<a href="qc-enty.htm#dot_netname">netname</a>);
	<a href="qc-built.htm#bprint">bprint</a> (<b>"\n"</b>);
};

<a href="qc-types.htm#void">void</a>() <b>DumpScore</b><a name="DumpScore">=</a>
{
	<b>local</b> <a href="qc-types.htm#entity">entity</a>	e, sort, walk;

	<b>if</b> (<a href="qc-glob.htm#world">world</a>.<a href="qc-enty.htm#dot_chain">chain</a>)
		<a href="qc-built.htm#error">error</a> (<b>"DumpScore: world.chain is set"</b>);

<i>// build a sorted lis</i>
	e = <a href="qc-built.htm#find">find</a>(<a href="qc-glob.htm#world">world</a>, classname, <b>"player"</b>);
	sort = <a href="qc-glob.htm#world">world</a>;
	<b>while</b> (e)
	{
		<b>if</b> (!sort)
		{
			sort = e;
			e.<a href="qc-enty.htm#dot_chain">chain</a> = <a href="qc-glob.htm#world">world</a>;
		}
		<b>else</b>
		{
			<b>if</b> (e.<a href="qc-enty.htm#dot_frags">frags</a> &gt; sort.<a href="qc-enty.htm#dot_frags">frags</a>)
			{
				e.<a href="qc-enty.htm#dot_chain">chain</a> = sort;
				sort = e;
			}
			<b>else</b>
			{
				walk = sort;
				<b>do</b>
				{
					<b>if</b> (!walk.<a href="qc-enty.htm#dot_chain">chain</a>)
					{
						e.<a href="qc-enty.htm#dot_chain">chain</a> = <a href="qc-glob.htm#world">world</a>;
						walk.<a href="qc-enty.htm#dot_chain">chain</a> = e;
					}
					<b>else</b> <b>if</b> (walk.<a href="qc-enty.htm#dot_chain">chain</a>.<a href="qc-enty.htm#dot_frags">frags</a> &lt; e.<a href="qc-enty.htm#dot_frags">frags</a>)
					{
						e.<a href="qc-enty.htm#dot_chain">chain</a> = walk.<a href="qc-enty.htm#dot_chain">chain</a>;
						walk.<a href="qc-enty.htm#dot_chain">chain</a> = e;
					}
					<b>else</b>
						walk = walk.<a href="qc-enty.htm#dot_chain">chain</a>;
				} <b>while</b> (walk.<a href="qc-enty.htm#dot_chain">chain</a> != e);
			}
		}
		
		e = <a href="qc-built.htm#find">find</a>(e, classname, <b>"player"</b>);
	}

<i>// print the list</i>
	
	<a href="qc-built.htm#bprint">bprint</a> (<b>"\n"</b>);	
	<b>while</b> (sort)
	{
		<a href="client.htm#PrintClientScore">PrintClientScore</a> (sort);
		sort = sort.<a href="qc-enty.htm#dot_chain">chain</a>;
	}
	<a href="qc-built.htm#bprint">bprint</a> (<b>"\n"</b>);
};

<i>/*
go to the next level for deathmatch
*/</i>

<a href="qc-types.htm#void">void</a>() <b>NextLevel</b><a name="NextLevel">=</a>
{
	<b>local</b> <a href="qc-types.htm#entity">entity</a> o;

<i>// find a trigger changelevel</i>
	o = <a href="qc-built.htm#find">find</a>(<a href="qc-glob.htm#world">world</a>, classname, <b>"trigger_changelevel"</b>);
	<b>if</b> (!o || <a href="qc-glob.htm#mapname">mapname</a> == <b>"start"</b>)
	{	<i>// go back to same map if no trigger_changelevel</i>
		o = <a href="qc-built.htm#spawn">spawn</a>();

⌨️ 快捷键说明

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