📄 misc.htm
字号:
<html><head><title>misc.qc</title></head><body bgcolor="#C0F0D0">
<base target=examine>
<pre>
<i>/*QUAKED info_null (0 0.5 0) (-4 -4 -4) (4 4 4)
Used as a positional target for spotlights, etc.
*/</i>
<a href="qc-types.htm#void">void</a>() <b>info_null</b><a name="info_null">=</a>
{
<a href="qc-built.htm#remove">remove</a>(<a href="qc-glob.htm#self">self</a>);
};
<i>/*QUAKED info_notnull (0 0.5 0) (-4 -4 -4) (4 4 4)
Used as a positional target for lightning.
*/</i>
<a href="qc-types.htm#void">void</a>() <b>info_notnull</b><a name="info_notnull">=</a>
{
};
<i>//============================================================================</i>
<a href="qc-types.htm#float">float</a> <b><a name="START_OFF">START_OFF</a></b> = 1;
<a href="qc-types.htm#void">void</a>() <b>light_use</b><a name="light_use">=</a>
{
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> & <a href="misc.htm#START_OFF">START_OFF</a>)
{
<a href="qc-built.htm#lightstyle">lightstyle</a>(<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_style">style</a>, <b>"m"</b>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> - <a href="misc.htm#START_OFF">START_OFF</a>;
}
<b>else</b>
{
<a href="qc-built.htm#lightstyle">lightstyle</a>(<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_style">style</a>, <b>"a"</b>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> + <a href="misc.htm#START_OFF">START_OFF</a>;
}
};
<i>/*QUAKED light (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
Non-displayed light.
Default light value is 300
Default style is 0
If targeted, it will toggle between on or off.
*/</i>
<a href="qc-types.htm#void">void</a>() <b>light</b><a name="light">=</a>
{
<b>if</b> (!<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_targetname">targetname</a>)
{ <i>// inert light</i>
<a href="qc-built.htm#remove">remove</a>(<a href="qc-glob.htm#self">self</a>);
<b>return</b>;
}
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_style">style</a> >= 32)
{
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_use">use</a> = <a href="misc.htm#light_use">light_use</a>;
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> & <a href="misc.htm#START_OFF">START_OFF</a>)
<a href="qc-built.htm#lightstyle">lightstyle</a>(<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_style">style</a>, <b>"a"</b>);
<b>else</b>
<a href="qc-built.htm#lightstyle">lightstyle</a>(<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_style">style</a>, <b>"m"</b>);
}
};
<i>/*QUAKED light_fluoro (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
Non-displayed light.
Default light value is 300
Default style is 0
If targeted, it will toggle between on or off.
Makes steady fluorescent humming sound
*/</i>
<a href="qc-types.htm#void">void</a>() <b>light_fluoro</b><a name="light_fluoro">=</a>
{
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_style">style</a> >= 32)
{
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_use">use</a> = <a href="misc.htm#light_use">light_use</a>;
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> & <a href="misc.htm#START_OFF">START_OFF</a>)
<a href="qc-built.htm#lightstyle">lightstyle</a>(<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_style">style</a>, <b>"a"</b>);
<b>else</b>
<a href="qc-built.htm#lightstyle">lightstyle</a>(<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_style">style</a>, <b>"m"</b>);
}
<a href="qc-built.htm#precache_sound">precache_sound</a> (<b>"ambience/fl_hum1.wav"</b>);
<a href="qc-built.htm#ambientsound">ambientsound</a> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin">origin</a>, <b>"ambience/fl_hum1.wav"</b>, 0.5, <a href="qc-defs.htm#ATTN_STATIC">ATTN_STATIC</a>);
};
<i>/*QUAKED light_fluorospark (0 1 0) (-8 -8 -8) (8 8 8)
Non-displayed light.
Default light value is 300
Default style is 10
Makes sparking, broken fluorescent sound
*/</i>
<a href="qc-types.htm#void">void</a>() <b>light_fluorospark</b><a name="light_fluorospark">=</a>
{
<b>if</b> (!<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_style">style</a>)
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_style">style</a> = 10;
<a href="qc-built.htm#precache_sound">precache_sound</a> (<b>"ambience/buzz1.wav"</b>);
<a href="qc-built.htm#ambientsound">ambientsound</a> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin">origin</a>, <b>"ambience/buzz1.wav"</b>, 0.5, <a href="qc-defs.htm#ATTN_STATIC">ATTN_STATIC</a>);
};
<i>/*QUAKED light_globe (0 1 0) (-8 -8 -8) (8 8 8)
Sphere globe light.
Default light value is 300
Default style is 0
*/</i>
<a href="qc-types.htm#void">void</a>() <b>light_globe</b><a name="light_globe">=</a>
{
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"progs/s_light.spr"</b>);
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"progs/s_light.spr"</b>);
<a href="qc-built.htm#makestatic">makestatic</a> (<a href="qc-glob.htm#self">self</a>);
};
<a href="qc-types.htm#void">void</a>() <b>FireAmbient</b><a name="FireAmbient">=</a>
{
<a href="qc-built.htm#precache_sound">precache_sound</a> (<b>"ambience/fire1.wav"</b>);
<i>// attenuate fast</i>
<a href="qc-built.htm#ambientsound">ambientsound</a> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin">origin</a>, <b>"ambience/fire1.wav"</b>, 0.5, <a href="qc-defs.htm#ATTN_STATIC">ATTN_STATIC</a>);
};
<i>/*QUAKED light_torch_small_walltorch (0 .5 0) (-10 -10 -20) (10 10 20)
Short wall torch
Default light value is 200
Default style is 0
*/</i>
<a href="qc-types.htm#void">void</a>() <b>light_torch_small_walltorch</b><a name="light_torch_small_walltorch">=</a>
{
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"progs/flame.mdl"</b>);
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"progs/flame.mdl"</b>);
<a href="misc.htm#FireAmbient">FireAmbient</a> ();
<a href="qc-built.htm#makestatic">makestatic</a> (<a href="qc-glob.htm#self">self</a>);
};
<i>/*QUAKED light_flame_large_yellow (0 1 0) (-10 -10 -12) (12 12 18)
Large yellow flame ball
*/</i>
<a href="qc-types.htm#void">void</a>() <b>light_flame_large_yellow</b><a name="light_flame_large_yellow">=</a>
{
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"progs/flame2.mdl"</b>);
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"progs/flame2.mdl"</b>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_frame">frame</a> = 1;
<a href="misc.htm#FireAmbient">FireAmbient</a> ();
<a href="qc-built.htm#makestatic">makestatic</a> (<a href="qc-glob.htm#self">self</a>);
};
<i>/*QUAKED light_flame_small_yellow (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
Small yellow flame ball
*/</i>
<a href="qc-types.htm#void">void</a>() <b>light_flame_small_yellow</b><a name="light_flame_small_yellow">=</a>
{
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"progs/flame2.mdl"</b>);
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"progs/flame2.mdl"</b>);
<a href="misc.htm#FireAmbient">FireAmbient</a> ();
<a href="qc-built.htm#makestatic">makestatic</a> (<a href="qc-glob.htm#self">self</a>);
};
<i>/*QUAKED light_flame_small_white (0 1 0) (-10 -10 -40) (10 10 40) START_OFF
Small white flame ball
*/</i>
<a href="qc-types.htm#void">void</a>() <b>light_flame_small_white</b><a name="light_flame_small_white">=</a>
{
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"progs/flame2.mdl"</b>);
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"progs/flame2.mdl"</b>);
<a href="misc.htm#FireAmbient">FireAmbient</a> ();
<a href="qc-built.htm#makestatic">makestatic</a> (<a href="qc-glob.htm#self">self</a>);
};
<i>//============================================================================</i>
<i>/*QUAKED misc_fireball (0 .5 .8) (-8 -8 -8) (8 8 8)
Lava Balls
*/</i>
<a href="qc-types.htm#void">void</a>() <a href="misc.htm#fire_fly">fire_fly</a>;
<a href="qc-types.htm#void">void</a>() <a href="misc.htm#fire_touch">fire_touch</a>;
<a href="qc-types.htm#void">void</a>() <b>misc_fireball</b><a name="misc_fireball">=</a>
{
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"progs/lavaball.mdl"</b>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_classname">classname</a> = <b>"fireball"</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> + (<a href="qc-built.htm#random">random</a>() * 5);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_think">think</a> = <a href="misc.htm#fire_fly">fire_fly</a>;
<b>if</b> (!<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_speed">speed</a>)
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_speed">speed</a> == 1000;
};
<a href="qc-types.htm#void">void</a>() <b>fire_fly</b><a name="fire_fly">=</a>
{
<b>local</b> <a href="qc-types.htm#entity">entity</a> fireball;
fireball = <a href="qc-built.htm#spawn">spawn</a>();
fireball.<a href="qc-enty.htm#dot_solid">solid</a> = <a href="qc-defs.htm#SOLID_TRIGGER">SOLID_TRIGGER</a>;
fireball.<a href="qc-enty.htm#dot_movetype">movetype</a> = <a href="qc-defs.htm#MOVETYPE_TOSS">MOVETYPE_TOSS</a>;
fireball.<a href="qc-enty.htm#dot_velocity">velocity</a> = '0 0 1000';
fireball.velocity_x = (<a href="qc-built.htm#random">random</a>() * 100) - 50;
fireball.velocity_y = (<a href="qc-built.htm#random">random</a>() * 100) - 50;
fireball.velocity_z = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_speed">speed</a> + (<a href="qc-built.htm#random">random</a>() * 200);
fireball.<a href="qc-enty.htm#dot_classname">classname</a> = <b>"fireball"</b>;
<a href="qc-built.htm#setmodel">setmodel</a> (fireball, <b>"progs/lavaball.mdl"</b>);
<a href="qc-built.htm#setsize">setsize</a> (fireball, '0 0 0', '0 0 0');
<a href="qc-built.htm#setorigin">setorigin</a> (fireball, <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin">origin</a>);
fireball.<a href="qc-enty.htm#dot_nextthink">nextthink</a> = <a href="qc-glob.htm#time">time</a> + 5;
fireball.<a href="qc-enty.htm#dot_think">think</a> = <a href="subs.htm#SUB_Remove">SUB_Remove</a>;
fireball.<a href="qc-enty.htm#dot_touch">touch</a> = <a href="misc.htm#fire_touch">fire_touch</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> + (<a href="qc-built.htm#random">random</a>() * 5) + 3;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_think">think</a> = <a href="misc.htm#fire_fly">fire_fly</a>;
};
<a href="qc-types.htm#void">void</a>() <b>fire_touch</b><a name="fire_touch">=</a>
{
<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>, 20);
<a href="qc-built.htm#remove">remove</a>(<a href="qc-glob.htm#self">self</a>);
};
<i>//============================================================================</i>
<a href="qc-types.htm#void">void</a>() <b>barrel_explode</b><a name="barrel_explode">=</a>
{
<a href="qc-glob.htm#self">self</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#self">self</a>.<a href="qc-enty.htm#dot_classname">classname</a> = <b>"explo_box"</b>;
<i>// did say self.owner</i>
<a href="combat.htm#T_RadiusDamage">T_RadiusDamage</a> (<a href="qc-glob.htm#self">self</a>, <a href="qc-glob.htm#self">self</a>, 160, <a href="qc-glob.htm#world">world</a>);
<a href="qc-built.htm#sound">sound</a> (<a href="qc-glob.htm#self">self</a>, <a href="qc-defs.htm#CHAN_VOICE">CHAN_VOICE</a>, <b>"weapons/r_exp3.wav"</b>, 1, <a href="qc-defs.htm#ATTN_NORM">ATTN_NORM</a>);
<a href="qc-built.htm#particle">particle</a> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin">origin</a>, '0 0 0', 75, 255);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -