📄 client.htm
字号:
<html><head><title>client.qc</title></head><body bgcolor="#C0F0D0">
<base target=examine>
<pre>
<i>// prototypes</i>
<a href="qc-types.htm#void">void</a> () <a href="weapons.htm#W_WeaponFrame">W_WeaponFrame</a>;
<a href="qc-types.htm#void">void</a>() <a href="weapons.htm#W_SetCurrentAmmo">W_SetCurrentAmmo</a>;
<a href="qc-types.htm#void">void</a>() <a href="player.htm#player_pain">player_pain</a>;
<a href="qc-types.htm#void">void</a>() <a href="player.htm#player_stand1">player_stand1</a>;
<a href="qc-types.htm#void">void</a> (<a href="qc-types.htm#vector">vector</a> org) <a href="triggers.htm#spawn_tfog">spawn_tfog</a>;
<a href="qc-types.htm#void">void</a> (<a href="qc-types.htm#vector">vector</a> org, <a href="qc-types.htm#entity">entity</a> death_owner) <a href="triggers.htm#spawn_tdeath">spawn_tdeath</a>;
<a href="qc-types.htm#float">float</a> modelindex_eyes, modelindex_player;
<i>/*
=============================================================================
LEVEL CHANGING / INTERMISSION
=============================================================================
*/</i>
<a href="qc-types.htm#float">float</a> <b><a name="intermission_running">intermission_running</a></b>;
<a href="qc-types.htm#float">float</a> <b><a name="intermission_exittime">intermission_exittime</a></b>;
<i>/*QUAKED info_intermission (1 0.5 0.5) (-16 -16 -16) (16 16 16)
This is the camera point for the intermission.
Use mangle instead of angle, so you can set pitch or roll as well as yaw. 'pitch roll yaw'
*/</i>
<a href="qc-types.htm#void">void</a>() <b>info_intermission</b><a name="info_intermission">=</a>
{
};
<a href="qc-types.htm#void">void</a>() <b><a href="qc-glob.htm#f_SetChangeParms">SetChangeParms</a></b><a name="SetChangeParms">=</a>
{
<i>// remove items</i>
<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_items">items</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-defs.htm#IT_KEY2">IT_KEY2</a> | <a href="qc-defs.htm#IT_INVISIBILITY">IT_INVISIBILITY</a> | <a href="qc-defs.htm#IT_INVULNERABILITY">IT_INVULNERABILITY</a> | <a href="qc-defs.htm#IT_SUIT">IT_SUIT</a> | <a href="qc-defs.htm#IT_QUAD">IT_QUAD</a>) );
<i>// cap super health</i>
<b>if</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_health">health</a> = 100;
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_health">health</a> < 50)
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_health">health</a> = 50;
<a href="qc-glob.htm#parm1">parm1</a> = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_items">items</a>;
<a href="qc-glob.htm#parm2">parm2</a> = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_health">health</a>;
<a href="qc-glob.htm#parm3">parm3</a> = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_armorvalue">armorvalue</a>;
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_ammo_shells">ammo_shells</a> < 25)
parm4 = 25;
<b>else</b>
parm4 = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_ammo_shells">ammo_shells</a>;
parm5 = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_ammo_nails">ammo_nails</a>;
parm6 = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_ammo_rockets">ammo_rockets</a>;
parm7 = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_ammo_cells">ammo_cells</a>;
<a href="qc-glob.htm#parm8">parm8</a> = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_weapon">weapon</a>;
<a href="qc-glob.htm#parm9">parm9</a> = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_armortype">armortype</a> * 100;
};
<a href="qc-types.htm#void">void</a>() <b><a href="qc-glob.htm#f_SetNewParms">SetNewParms</a></b><a name="SetNewParms">=</a>
{
<a href="qc-glob.htm#parm1">parm1</a> = <a href="qc-defs.htm#IT_SHOTGUN">IT_SHOTGUN</a> | <a href="qc-defs.htm#IT_AXE">IT_AXE</a>;
<a href="qc-glob.htm#parm2">parm2</a> = 100;
<a href="qc-glob.htm#parm3">parm3</a> = 0;
parm4 = 25;
parm5 = 0;
parm6 = 0;
parm6 = 0;
<a href="qc-glob.htm#parm8">parm8</a> = 1;
<a href="qc-glob.htm#parm9">parm9</a> = 0;
};
<a href="qc-types.htm#void">void</a>() <b>DecodeLevelParms</b><a name="DecodeLevelParms">=</a>
{
<b>if</b> (<a href="qc-glob.htm#serverflags">serverflags</a>)
{
<b>if</b> (<a href="qc-glob.htm#world">world</a>.<a href="qc-enty.htm#dot_model">model</a> == <b>"maps/start.bsp"</b>)
<a href="client.htm#SetNewParms">SetNewParms</a> (); <i>// take away all stuff on starting new episode</i>
}
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_items">items</a> = <a href="qc-glob.htm#parm1">parm1</a>;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_health">health</a> = <a href="qc-glob.htm#parm2">parm2</a>;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_armorvalue">armorvalue</a> = <a href="qc-glob.htm#parm3">parm3</a>;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_ammo_shells">ammo_shells</a> = parm4;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_ammo_nails">ammo_nails</a> = parm5;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_ammo_rockets">ammo_rockets</a> = parm6;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_ammo_cells">ammo_cells</a> = parm7;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_weapon">weapon</a> = <a href="qc-glob.htm#parm8">parm8</a>;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_armortype">armortype</a> = <a href="qc-glob.htm#parm9">parm9</a> * 0.01;
};
<i>/*
============
FindIntermission
Returns the entity to view from
============
*/</i>
<a href="qc-types.htm#entity">entity</a>() <b>FindIntermission</b><a name="FindIntermission">=</a>
{
<b>local</b> <a href="qc-types.htm#entity">entity</a> spot;
<b>local</b> <a href="qc-types.htm#float">float</a> cyc;
<i>// look for info_intermission first</i>
spot = <a href="qc-built.htm#find">find</a> (<a href="qc-glob.htm#world">world</a>, classname, <b>"info_intermission"</b>);
<b>if</b> (spot)
{ <i>// pick a random one</i>
cyc = <a href="qc-built.htm#random">random</a>() * 4;
<b>while</b> (cyc > 1)
{
spot = <a href="qc-built.htm#find">find</a> (spot, classname, <b>"info_intermission"</b>);
<b>if</b> (!spot)
spot = <a href="qc-built.htm#find">find</a> (spot, classname, <b>"info_intermission"</b>);
cyc = cyc - 1;
}
return spot;
}
<i>// then look for the start position</i>
spot = <a href="qc-built.htm#find">find</a> (<a href="qc-glob.htm#world">world</a>, classname, <b>"info_player_start"</b>);
<b>if</b> (spot)
return spot;
<i>// testinfo_player_start is only found in regioned levels</i>
spot = <a href="qc-built.htm#find">find</a> (<a href="qc-glob.htm#world">world</a>, classname, <b>"testplayerstart"</b>);
<b>if</b> (spot)
return spot;
<a href="qc-built.htm#objerror">objerror</a> (<b>"FindIntermission: no spot"</b>);
};
<a href="qc-types.htm#string">string</a> <b><a name="nextmap">nextmap</a></b>;
<a href="qc-types.htm#void">void</a>() <b>GotoNextMap</b><a name="GotoNextMap">=</a>
{
<b>if</b> (<a href="qc-built.htm#cvar">cvar</a>(<b>"samelevel"</b>)) <i>// if samelevel is set, stay on same level</i>
<a href="qc-built.htm#changelevel">changelevel</a> (<a href="qc-glob.htm#mapname">mapname</a>);
<b>else</b>
<a href="qc-built.htm#changelevel">changelevel</a> (<a href="client.htm#nextmap">nextmap</a>);
};
<a href="qc-types.htm#void">void</a>() <b>ExitIntermission</b><a name="ExitIntermission">=</a>
{
<i>// skip any text in deathmatch</i>
<b>if</b> (<a href="qc-glob.htm#deathmatch">deathmatch</a>)
{
<a href="client.htm#GotoNextMap">GotoNextMap</a> ();
<b>return</b>;
}
<a href="client.htm#intermission_exittime">intermission_exittime</a> = <a href="qc-glob.htm#time">time</a> + 1;
<a href="client.htm#intermission_running">intermission_running</a> = <a href="client.htm#intermission_running">intermission_running</a> + 1;
<i>//</i>
<i>// run some text if at the end of an episode</i>
<i>//</i>
<b>if</b> (<a href="client.htm#intermission_running">intermission_running</a> == 2)
{
<b>if</b> (<a href="qc-glob.htm#world">world</a>.<a href="qc-enty.htm#dot_model">model</a> == <b>"maps/e1m7.bsp"</b>)
{
<a href="qc-netf.htm#WriteByte">WriteByte</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, <a href="qc-net.htm#SVC_CDTRACK">SVC_CDTRACK</a>);
<a href="qc-netf.htm#WriteByte">WriteByte</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, 2);
<a href="qc-netf.htm#WriteByte">WriteByte</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, 3);
<b>if</b> (!<a href="qc-built.htm#cvar">cvar</a>(<b>"registered"</b>))
{
<a href="qc-netf.htm#WriteByte">WriteByte</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, <a href="qc-net.htm#SVC_FINALE">SVC_FINALE</a>);
<a href="qc-netf.htm#WriteString">WriteString</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, <b>"As the corpse of the monstrous entity\nChthon sinks back into the lava whence\nit rose, you grip the Rune of Earth\nMagic tightly. Now that you have\nconquered the Dimension of the Doomed,\nrealm of Earth Magic, you are ready to\ncomplete your task in the other three\nhaunted lands of Quake. Or are you? If\nyou don't register Quake, you'll never\nknow what awaits you in the Realm of\nBlack Magic, the Netherworld, and the\nElder World!"</b>);
}
<b>else</b>
{
<a href="qc-netf.htm#WriteByte">WriteByte</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, <a href="qc-net.htm#SVC_FINALE">SVC_FINALE</a>);
<a href="qc-netf.htm#WriteString">WriteString</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, <b>"As the corpse of the monstrous entity\nChthon sinks back into the lava whence\nit rose, you grip the Rune of Earth\nMagic tightly. Now that you have\nconquered the Dimension of the Doomed,\nrealm of Earth Magic, you are ready to\ncomplete your task. A Rune of magic\npower lies at the end of each haunted\nland of Quake. Go forth, seek the\ntotality of the four Runes!"</b>);
}
<b>return</b>;
}
<b>else</b> <b>if</b> (<a href="qc-glob.htm#world">world</a>.<a href="qc-enty.htm#dot_model">model</a> == <b>"maps/e2m6.bsp"</b>)
{
<a href="qc-netf.htm#WriteByte">WriteByte</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, <a href="qc-net.htm#SVC_CDTRACK">SVC_CDTRACK</a>);
<a href="qc-netf.htm#WriteByte">WriteByte</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, 2);
<a href="qc-netf.htm#WriteByte">WriteByte</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, 3);
<a href="qc-netf.htm#WriteByte">WriteByte</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, <a href="qc-net.htm#SVC_FINALE">SVC_FINALE</a>);
<a href="qc-netf.htm#WriteString">WriteString</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, <b>"The Rune of Black Magic throbs evilly in\nyour hand and whispers dark thoughts\ninto your brain. You learn the inmost\nlore of the Hell-Mother; Shub-Niggurath!\nYou now know that she is behind all the\nterrible plotting which has led to so\nmuch death and horror. But she is not\ninviolate! Armed with this Rune, you\nrealize that once all four Runes are\ncombined, the gate to Shub-Niggurath's\nPit will open, and you can face the\nWitch-Goddess herself in her frightful\notherworld cathedral."</b>);
<b>return</b>;
}
<b>else</b> <b>if</b> (<a href="qc-glob.htm#world">world</a>.<a href="qc-enty.htm#dot_model">model</a> == <b>"maps/e3m6.bsp"</b>)
{
<a href="qc-netf.htm#WriteByte">WriteByte</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, <a href="qc-net.htm#SVC_CDTRACK">SVC_CDTRACK</a>);
<a href="qc-netf.htm#WriteByte">WriteByte</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, 2);
<a href="qc-netf.htm#WriteByte">WriteByte</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, 3);
<a href="qc-netf.htm#WriteByte">WriteByte</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, <a href="qc-net.htm#SVC_FINALE">SVC_FINALE</a>);
<a href="qc-netf.htm#WriteString">WriteString</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, <b>"The charred viscera of diabolic horrors\nbubble viscously as you seize the Rune\nof Hell Magic. Its heat scorches your\nhand, and its terrible secrets blight\nyour mind. Gathering the shreds of your\ncourage, you shake the devil's shackles\nfrom your soul, and become ever more\nhard and determined to destroy the\nhideous creatures whose mere existence\nthreatens the souls and psyches of all\nthe population of Earth."</b>);
<b>return</b>;
}
<b>else</b> <b>if</b> (<a href="qc-glob.htm#world">world</a>.<a href="qc-enty.htm#dot_model">model</a> == <b>"maps/e4m7.bsp"</b>)
{
<a href="qc-netf.htm#WriteByte">WriteByte</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, <a href="qc-net.htm#SVC_CDTRACK">SVC_CDTRACK</a>);
<a href="qc-netf.htm#WriteByte">WriteByte</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, 2);
<a href="qc-netf.htm#WriteByte">WriteByte</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, 3);
<a href="qc-netf.htm#WriteByte">WriteByte</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, <a href="qc-net.htm#SVC_FINALE">SVC_FINALE</a>);
<a href="qc-netf.htm#WriteString">WriteString</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, <b>"Despite the awful might of the Elder\nWorld, you have achieved the Rune of\nElder Magic, capstone of all types of\narcane wisdom. Beyond good and evil,\nbeyond life and death, the Rune\npulsates, heavy with import. Patient and\npotent, the Elder Being Shub-Niggurath\nweaves her dire plans to clear off all\nlife from the Earth, and bring her own\nfoul offspring to our world! For all the\ndwellers in these nightmare dimensions\nare her descendants! Once all Runes of\nmagic power are united, the energy\nbehind them will blast open the Gateway\nto Shub-Niggurath, and you can travel\nthere to foil the Hell-Mother's plots\nin person."</b>);
<b>return</b>;
}
<a href="client.htm#GotoNextMap">GotoNextMap</a>();
}
<b>if</b> (<a href="client.htm#intermission_running">intermission_running</a> == 3)
{
<b>if</b> (!<a href="qc-built.htm#cvar">cvar</a>(<b>"registered"</b>))
{ <i>// shareware episode has been completed, go to sell screen</i>
<a href="qc-netf.htm#WriteByte">WriteByte</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, <a href="qc-net.htm#SVC_SELLSCREEN">SVC_SELLSCREEN</a>);
<b>return</b>;
}
<b>if</b> ( (<a href="qc-glob.htm#serverflags">serverflags</a>&15) == 15)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -