📄 client.htm
字号:
<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>"Now, you have all four Runes. You sense\ntremendous invisible forces moving to\nunseal ancient barriers. Shub-Niggurath\nhad hoped to use the Runes Herself to\nclear off the Earth, but now instead,\nyou will use them to enter her home and\nconfront her as an avatar of avenging\nEarth-life. If you defeat her, you will\nbe remembered forever as the savior of\nthe planet. If she conquers, it will be\nas if you had never been born."</b>);
<b>return</b>;
}
}
<a href="client.htm#GotoNextMap">GotoNextMap</a>();
};
<i>/*
============
IntermissionThink
When the player presses attack or jump, change to the next level
============
*/</i>
<a href="qc-types.htm#void">void</a>() <b>IntermissionThink</b><a name="IntermissionThink">=</a>
{
<b>if</b> (<a href="qc-glob.htm#time">time</a> < <a href="client.htm#intermission_exittime">intermission_exittime</a>)
<b>return</b>;
<b>if</b> (!<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_button0">button0</a> && !<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_button1">button1</a> && !<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_button2">button2</a>)
<b>return</b>;
<a href="client.htm#ExitIntermission">ExitIntermission</a> ();
};
<a href="qc-types.htm#void">void</a>() <b>execute_changelevel</b><a name="execute_changelevel">=</a>
{
<b>local</b> <a href="qc-types.htm#entity">entity</a> pos;
<a href="client.htm#intermission_running">intermission_running</a> = 1;
<i>// enforce a wait time before allowing changelevel</i>
<b>if</b> (<a href="qc-glob.htm#deathmatch">deathmatch</a>)
<a href="client.htm#intermission_exittime">intermission_exittime</a> = <a href="qc-glob.htm#time">time</a> + 5;
<b>else</b>
<a href="client.htm#intermission_exittime">intermission_exittime</a> = <a href="qc-glob.htm#time">time</a> + 2;
<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>, 3);
<a href="qc-netf.htm#WriteByte">WriteByte</a> (<a href="qc-net.htm#MSG_ALL">MSG_ALL</a>, 3);
pos = <a href="client.htm#FindIntermission">FindIntermission</a> ();
<a href="qc-glob.htm#other">other</a> = <a href="qc-built.htm#find">find</a> (<a href="qc-glob.htm#world">world</a>, classname, <b>"player"</b>);
<b>while</b> (<a href="qc-glob.htm#other">other</a> != <a href="qc-glob.htm#world">world</a>)
{
<a href="qc-glob.htm#other">other</a>.<a href="qc-enty.htm#dot_view_ofs">view_ofs</a> = '0 0 0';
<a href="qc-glob.htm#other">other</a>.<a href="qc-enty.htm#dot_angles">angles</a> = <a href="qc-glob.htm#other">other</a>.<a href="qc-enty.htm#dot_v_angle">v_angle</a> = pos.<a href="qc-enty.htm#dot_mangle">mangle</a>;
<a href="qc-glob.htm#other">other</a>.<a href="qc-enty.htm#dot_fixangle">fixangle</a> = <a href="defs.htm#TRUE">TRUE</a>; <i>// turn this way immediately</i>
<a href="qc-glob.htm#other">other</a>.<a href="qc-enty.htm#dot_nextthink">nextthink</a> = <a href="qc-glob.htm#time">time</a> + 0.5;
<a href="qc-glob.htm#other">other</a>.<a href="qc-enty.htm#dot_takedamage">takedamage</a> = <a href="qc-defs.htm#DAMAGE_NO">DAMAGE_NO</a>;
<a href="qc-glob.htm#other">other</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_movetype">movetype</a> = <a href="qc-defs.htm#MOVETYPE_NONE">MOVETYPE_NONE</a>;
<a href="qc-glob.htm#other">other</a>.<a href="qc-enty.htm#dot_modelindex">modelindex</a> = 0;
<a href="qc-built.htm#setorigin">setorigin</a> (<a href="qc-glob.htm#other">other</a>, pos.<a href="qc-enty.htm#dot_origin">origin</a>);
<a href="qc-glob.htm#other">other</a> = <a href="qc-built.htm#find">find</a> (<a href="qc-glob.htm#other">other</a>, classname, <b>"player"</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_INTERMISSION">SVC_INTERMISSION</a>);
};
<a href="qc-types.htm#void">void</a>() <b>changelevel_touch</b><a name="changelevel_touch">=</a>
{
<b>local</b> <a href="qc-types.htm#entity">entity</a> pos;
<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-built.htm#cvar">cvar</a>(<b>"noexit"</b>))
{
<a href="combat.htm#T_Damage">T_Damage</a> (<a href="qc-glob.htm#other">other</a>, <a href="qc-glob.htm#self">self</a>, <a href="qc-glob.htm#self">self</a>, 50000);
<b>return</b>;
}
<a href="qc-built.htm#bprint">bprint</a> (<a href="qc-glob.htm#other">other</a>.<a href="qc-enty.htm#dot_netname">netname</a>);
<a href="qc-built.htm#bprint">bprint</a> (<b>" exited the level\n"</b>);
<a href="client.htm#nextmap">nextmap</a> = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_map">map</a>;
<a href="subs.htm#SUB_UseTargets">SUB_UseTargets</a> ();
<b>if</b> ( (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> & 1) && (<a href="qc-glob.htm#deathmatch">deathmatch</a> == 0) )
{ <i>// NO_INTERMISSION</i>
<a href="client.htm#GotoNextMap">GotoNextMap</a>();
<b>return</b>;
}
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_touch">touch</a> = <a href="subs.htm#SUB_Null">SUB_Null</a>;
<i>// we can't move people right now, because touch functions are called</i>
<i>// in the middle of C movement code, so set a think time to do it</i>
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_think">think</a> = <a href="client.htm#execute_changelevel">execute_changelevel</a>;
<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> + 0.1;
};
<i>/*QUAKED trigger_changelevel (0.5 0.5 0.5) ? NO_INTERMISSION
When the player touches this, he gets sent to the map listed in the "map" variable. Unless the NO_INTERMISSION flag is set, the view will go to the info_intermission spot and display stats.
*/</i>
<a href="qc-types.htm#void">void</a>() <b>trigger_changelevel</b><a name="trigger_changelevel">=</a>
{
<b>if</b> (!<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_map">map</a>)
<a href="qc-built.htm#objerror">objerror</a> (<b>"chagnelevel trigger doesn't have map"</b>);
<a href="subs.htm#InitTrigger">InitTrigger</a> ();
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_touch">touch</a> = <a href="client.htm#changelevel_touch">changelevel_touch</a>;
};
<i>/*
=============================================================================
PLAYER GAME EDGE FUNCTIONS
=============================================================================
*/</i>
<a href="qc-types.htm#void">void</a>() <a href="player.htm#set_suicide_frame">set_suicide_frame</a>;
<i>// called by ClientKill and DeadThink</i>
<a href="qc-types.htm#void">void</a>() <b>respawn</b><a name="respawn">=</a>
{
<b>if</b> (<a href="qc-glob.htm#coop">coop</a>)
{
<i>// make a copy of the dead body for appearances sake</i>
<a href="world.htm#CopyToBodyQue">CopyToBodyQue</a> (<a href="qc-glob.htm#self">self</a>);
<i>// get the spawn parms as they were at level start</i>
<a href="qc-built.htm#setspawnparms">setspawnparms</a> (<a href="qc-glob.htm#self">self</a>);
<i>// respawn </i>
<a href="client.htm#PutClientInServer">PutClientInServer</a> ();
}
<b>else</b> <b>if</b> (<a href="qc-glob.htm#deathmatch">deathmatch</a>)
{
<i>// make a copy of the dead body for appearances sake</i>
<a href="world.htm#CopyToBodyQue">CopyToBodyQue</a> (<a href="qc-glob.htm#self">self</a>);
<i>// set default spawn parms</i>
<a href="client.htm#SetNewParms">SetNewParms</a> ();
<i>// respawn </i>
<a href="client.htm#PutClientInServer">PutClientInServer</a> ();
}
<b>else</b>
{ <i>// restart the entire server</i>
<a href="qc-built.htm#localcmd">localcmd</a> (<b>"restart\n"</b>);
}
};
<i>/*
============
ClientKill
Player entered the suicide command
============
*/</i>
<a href="qc-types.htm#void">void</a>() <b><a href="qc-glob.htm#f_ClientKill">ClientKill</a></b><a name="ClientKill">=</a>
{
<a href="qc-built.htm#bprint">bprint</a> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_netname">netname</a>);
<a href="qc-built.htm#bprint">bprint</a> (<b>" suicides\n"</b>);
<a href="player.htm#set_suicide_frame">set_suicide_frame</a> ();
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_modelindex">modelindex</a> = modelindex_player;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_frags">frags</a> = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_frags">frags</a> - 2; <i>// extra penalty</i>
<a href="client.htm#respawn">respawn</a> ();
};
<a href="qc-types.htm#float">float</a>(<a href="qc-types.htm#vector">vector</a> v) <b>CheckSpawnPoint</b><a name="CheckSpawnPoint">=</a>
{
return FALSE;
};
<i>/*
============
SelectSpawnPoint
Returns the entity to spawn at
============
*/</i>
<a href="qc-types.htm#entity">entity</a>() <b>SelectSpawnPoint</b><a name="SelectSpawnPoint">=</a>
{
<b>local</b> <a href="qc-types.htm#entity">entity</a> 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;
<i>// choose a info_player_deathmatch point</i>
<b>if</b> (<a href="qc-glob.htm#coop">coop</a>)
{
<a href="world.htm#lastspawn">lastspawn</a> = <a href="qc-built.htm#find">find</a>(<a href="world.htm#lastspawn">lastspawn</a>, classname, <b>"info_player_coop"</b>);
<b>if</b> (<a href="world.htm#lastspawn">lastspawn</a> == <a href="qc-glob.htm#world">world</a>)
<a href="world.htm#lastspawn">lastspawn</a> = <a href="qc-built.htm#find">find</a> (<a href="world.htm#lastspawn">lastspawn</a>, classname, <b>"info_player_start"</b>);
<b>if</b> (<a href="world.htm#lastspawn">lastspawn</a> != <a href="qc-glob.htm#world">world</a>)
return lastspawn;
}
<b>else</b> <b>if</b> (<a href="qc-glob.htm#deathmatch">deathmatch</a>)
{
<a href="world.htm#lastspawn">lastspawn</a> = <a href="qc-built.htm#find">find</a>(<a href="world.htm#lastspawn">lastspawn</a>, classname, <b>"info_player_deathmatch"</b>);
<b>if</b> (<a href="world.htm#lastspawn">lastspawn</a> == <a href="qc-glob.htm#world">world</a>)
<a href="world.htm#lastspawn">lastspawn</a> = <a href="qc-built.htm#find">find</a> (<a href="world.htm#lastspawn">lastspawn</a>, classname, <b>"info_player_deathmatch"</b>);
<b>if</b> (<a href="world.htm#lastspawn">lastspawn</a> != <a href="qc-glob.htm#world">world</a>)
return lastspawn;
}
<b>if</b> (<a href="qc-glob.htm#serverflags">serverflags</a>)
{ <i>// return with a rune to start</i>
spot = <a href="qc-built.htm#find">find</a> (<a href="qc-glob.htm#world">world</a>, classname, <b>"info_player_start2"</b>);
<b>if</b> (spot)
return spot;
}
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)
<a href="qc-built.htm#error">error</a> (<b>"PutClientInServer: no info_player_start on level"</b>);
return spot;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -