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

📄 items.htm

📁 Quake 的 各 种 文 档 格 式 说 明
💻 HTM
📖 第 1 页 / 共 5 页
字号:
		<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_solid">solid</a> = <a href="qc-defs.htm#SOLID_NOT">SOLID_NOT</a>;
		<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_model">model</a> = <a href="defs.htm#string_null">string_null</a>;
	}

	<a href="defs.htm#activator">activator</a> = <a href="qc-glob.htm#other">other</a>;
	<a href="subs.htm#SUB_UseTargets">SUB_UseTargets</a>();				<i>// fire all targets / killtargets</i>
};


<a href="qc-types.htm#void">void</a>() <b>key_setsounds</b><a name="key_setsounds">=</a>
{
	<b>if</b> (<a href="qc-glob.htm#world">world</a>.<a href="qc-enty.htm#dot_worldtype">worldtype</a> == 0)
	{
		<a href="qc-built.htm#precache_sound">precache_sound</a> (<b>"misc/medkey.wav"</b>);
		<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_noise">noise</a> = <b>"misc/medkey.wav"</b>;
	}
	<b>if</b> (<a href="qc-glob.htm#world">world</a>.<a href="qc-enty.htm#dot_worldtype">worldtype</a> == 1)
	{
		<a href="qc-built.htm#precache_sound">precache_sound</a> (<b>"misc/runekey.wav"</b>);
		<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_noise">noise</a> = <b>"misc/runekey.wav"</b>;
	}
	<b>if</b> (<a href="qc-glob.htm#world">world</a>.<a href="qc-enty.htm#dot_worldtype">worldtype</a> == 2)
	{
		<a href="qc-built.htm#precache_sound2">precache_sound2</a> (<b>"misc/basekey.wav"</b>);
		<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_noise">noise</a> = <b>"misc/basekey.wav"</b>;
	}
};

<i>/*QUAKED item_key1 (0 .5 .8) (-16 -16 -24) (16 16 32)
SILVER key
In order for keys to work
you MUST set your maps
worldtype to one of the
following:
0: medieval
1: metal
2: base
*/</i>


<a href="qc-types.htm#void">void</a>() <b>item_key1</b><a name="item_key1">=</a>
{
	<b>if</b> (<a href="qc-glob.htm#world">world</a>.<a href="qc-enty.htm#dot_worldtype">worldtype</a> == 0)
	{
		<a href="qc-built.htm#precache_model">precache_model</a> (<b>"progs/w_s_key.mdl"</b>);
		<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"progs/w_s_key.mdl"</b>);
		<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_netname">netname</a> = <b>"silver key"</b>;
	}
	<b>else</b> <b>if</b> (<a href="qc-glob.htm#world">world</a>.<a href="qc-enty.htm#dot_worldtype">worldtype</a> == 1)
	{
		<a href="qc-built.htm#precache_model">precache_model</a> (<b>"progs/m_s_key.mdl"</b>);
		<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"progs/m_s_key.mdl"</b>);
		<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_netname">netname</a> = <b>"silver runekey"</b>;
	}
	<b>else</b> <b>if</b> (<a href="qc-glob.htm#world">world</a>.<a href="qc-enty.htm#dot_worldtype">worldtype</a> == 2)
	{
		<a href="qc-built.htm#precache_model2">precache_model2</a> (<b>"progs/b_s_key.mdl"</b>);
		<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"progs/b_s_key.mdl"</b>);
		<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_netname">netname</a> = <b>"silver keycard"</b>;
	}
	<a href="items.htm#key_setsounds">key_setsounds</a>();
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_touch">touch</a> = <a href="items.htm#key_touch">key_touch</a>;
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_items">items</a> = <a href="qc-defs.htm#IT_KEY1">IT_KEY1</a>;
	<a href="qc-built.htm#setsize">setsize</a> (<a href="qc-glob.htm#self">self</a>, '-16 -16 -24', '16 16 32');
	<a href="items.htm#StartItem">StartItem</a> ();
};

<i>/*QUAKED item_key2 (0 .5 .8) (-16 -16 -24) (16 16 32)
GOLD key
In order for keys to work
you MUST set your maps
worldtype to one of the
following:
0: medieval
1: metal
2: base
*/</i>


<a href="qc-types.htm#void">void</a>() <b>item_key2</b><a name="item_key2">=</a>
{
	<b>if</b> (<a href="qc-glob.htm#world">world</a>.<a href="qc-enty.htm#dot_worldtype">worldtype</a> == 0)
	{
		<a href="qc-built.htm#precache_model">precache_model</a> (<b>"progs/w_g_key.mdl"</b>);
		<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"progs/w_g_key.mdl"</b>);
		<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_netname">netname</a> = <b>"gold key"</b>;
	}
	<b>if</b> (<a href="qc-glob.htm#world">world</a>.<a href="qc-enty.htm#dot_worldtype">worldtype</a> == 1)
	{
		<a href="qc-built.htm#precache_model">precache_model</a> (<b>"progs/m_g_key.mdl"</b>);
		<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"progs/m_g_key.mdl"</b>);
		<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_netname">netname</a> = <b>"gold runekey"</b>;
	}
	<b>if</b> (<a href="qc-glob.htm#world">world</a>.<a href="qc-enty.htm#dot_worldtype">worldtype</a> == 2)
	{
		<a href="qc-built.htm#precache_model2">precache_model2</a> (<b>"progs/b_g_key.mdl"</b>);
		<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"progs/b_g_key.mdl"</b>);
		<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_netname">netname</a> = <b>"gold keycard"</b>;
	}
	<a href="items.htm#key_setsounds">key_setsounds</a>();
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_touch">touch</a> = <a href="items.htm#key_touch">key_touch</a>;
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_items">items</a> = <a href="qc-defs.htm#IT_KEY2">IT_KEY2</a>;
	<a href="qc-built.htm#setsize">setsize</a> (<a href="qc-glob.htm#self">self</a>, '-16 -16 -24', '16 16 32');
	<a href="items.htm#StartItem">StartItem</a> ();
};



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

END OF LEVEL RUNES

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


<a href="qc-types.htm#void">void</a>() <b>sigil_touch</b><a name="sigil_touch">=</a>
{
<b>local</b> <a href="qc-types.htm#entity">entity</a>	stemp;
<b>local</b> <a href="qc-types.htm#float">float</a>		best;

	<b>if</b> (<a href="qc-glob.htm#other">other</a>.<a href="qc-enty.htm#dot_classname">classname</a> != <b>"player"</b>)
		<b>return</b>;
	<b>if</b> (<a href="qc-glob.htm#other">other</a>.<a href="qc-enty.htm#dot_health">health</a> &lt;= 0)
		<b>return</b>;

	<a href="qc-built.htm#centerprint">centerprint</a> (<a href="qc-glob.htm#other">other</a>, <b>"You got the rune!"</b>);

	<a href="qc-built.htm#sound">sound</a> (<a href="qc-glob.htm#other">other</a>, <a href="qc-defs.htm#CHAN_ITEM">CHAN_ITEM</a>, <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_noise">noise</a>, 1, <a href="qc-defs.htm#ATTN_NORM">ATTN_NORM</a>);
	<a href="qc-built.htm#stuffcmd">stuffcmd</a> (<a href="qc-glob.htm#other">other</a>, <b>"bf\n"</b>);
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_solid">solid</a> = <a href="qc-defs.htm#SOLID_NOT">SOLID_NOT</a>;
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_model">model</a> = <a href="defs.htm#string_null">string_null</a>;
	<a href="qc-glob.htm#serverflags">serverflags</a> = <a href="qc-glob.htm#serverflags">serverflags</a> | (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> &amp; 15);
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_classname">classname</a> = <b>""</b>;		<i>// so rune doors won't find it</i>
	
	<a href="defs.htm#activator">activator</a> = <a href="qc-glob.htm#other">other</a>;
	<a href="subs.htm#SUB_UseTargets">SUB_UseTargets</a>();				<i>// fire all targets / killtargets</i>
};


<i>/*QUAKED item_sigil (0 .5 .8) (-16 -16 -24) (16 16 32) E1 E2 E3 E4
End of level sigil, pick up to end episode and return to jrstart.
*/</i>


<a href="qc-types.htm#void">void</a>() <b>item_sigil</b><a name="item_sigil">=</a>
{
	<b>if</b> (!<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a>)
		<a href="qc-built.htm#objerror">objerror</a> (<b>"no spawnflags"</b>);

	<a href="qc-built.htm#precache_sound">precache_sound</a> (<b>"misc/runekey.wav"</b>);
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_noise">noise</a> = <b>"misc/runekey.wav"</b>;

	<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> &amp; 1)
	{
		<a href="qc-built.htm#precache_model">precache_model</a> (<b>"progs/end1.mdl"</b>);
		<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"progs/end1.mdl"</b>);
	}
	<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> &amp; 2)
	{
		<a href="qc-built.htm#precache_model2">precache_model2</a> (<b>"progs/end2.mdl"</b>);
		<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"progs/end2.mdl"</b>);
	}
	<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> &amp; 4)
	{
		<a href="qc-built.htm#precache_model2">precache_model2</a> (<b>"progs/end3.mdl"</b>);
		<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"progs/end3.mdl"</b>);
	}
	<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> &amp; 8)
	{
		<a href="qc-built.htm#precache_model2">precache_model2</a> (<b>"progs/end4.mdl"</b>);
		<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"progs/end4.mdl"</b>);
	}
	
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_touch">touch</a> = <a href="items.htm#sigil_touch">sigil_touch</a>;
	<a href="qc-built.htm#setsize">setsize</a> (<a href="qc-glob.htm#self">self</a>, '-16 -16 -24', '16 16 32');
	<a href="items.htm#StartItem">StartItem</a> ();
};

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

POWERUPS

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


<a href="qc-types.htm#void">void</a>() <a href="items.htm#powerup_touch">powerup_touch</a>;


<a href="qc-types.htm#void">void</a>() <b>powerup_touch</b><a name="powerup_touch">=</a>
{
<b>local</b> <a href="qc-types.htm#entity">entity</a>	stemp;
<b>local</b> <a href="qc-types.htm#float">float</a>		best;

	<b>if</b> (<a href="qc-glob.htm#other">other</a>.<a href="qc-enty.htm#dot_classname">classname</a> != <b>"player"</b>)
		<b>return</b>;
	<b>if</b> (<a href="qc-glob.htm#other">other</a>.<a href="qc-enty.htm#dot_health">health</a> &lt;= 0)
		<b>return</b>;

	<a href="qc-built.htm#sprint">sprint</a> (<a href="qc-glob.htm#other">other</a>, <b>"You got the "</b>);
	<a href="qc-built.htm#sprint">sprint</a> (<a href="qc-glob.htm#other">other</a>, <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_netname">netname</a>);
	<a href="qc-built.htm#sprint">sprint</a> (<a href="qc-glob.htm#other">other</a>,<b>"\n"</b>);

	<b>if</b> (<a href="qc-glob.htm#deathmatch">deathmatch</a>)
	{
		<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_mdl">mdl</a> = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_model">model</a>;
		
		<b>if</b> ((<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_classname">classname</a> == <b>"item_artifact_invulnerability"</b>) ||
			(<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_classname">classname</a> == <b>"item_artifact_invisibility"</b>))
			<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_nextthink">nextthink</a> = <a href="qc-glob.htm#time">time</a> + 60*5;
		<b>else</b>
			<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_nextthink">nextthink</a> = <a href="qc-glob.htm#time">time</a> + 60;
		
		<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_think">think</a> = <a href="items.htm#SUB_regen">SUB_regen</a>;
	}	

	<a href="qc-built.htm#sound">sound</a> (<a href="qc-glob.htm#other">other</a>, <a href="qc-defs.htm#CHAN_VOICE">CHAN_VOICE</a>, <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_noise">noise</a>, 1, <a href="qc-defs.htm#ATTN_NORM">ATTN_NORM</a>);
	<a href="qc-built.htm#stuffcmd">stuffcmd</a> (<a href="qc-glob.htm#other">other</a>, <b>"bf\n"</b>);
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_solid">solid</a> = <a href="qc-defs.htm#SOLID_NOT">SOLID_NOT</a>;
	<a href="qc-glob.htm#other">other</a>.<a href="qc-enty.htm#dot_items">items</a> = <a href="qc-glob.htm#other">other</a>.<a href="qc-enty.htm#dot_items">items</a> | <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_items">items</a>;
	<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_model">model</a> = <a href="defs.htm#string_null">string_null</a>;

<i>// do the apropriate action</i>
	<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_classname">classname</a> == <b>"item_artifac

⌨️ 快捷键说明

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