📄 misc.htm
字号:
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin_z">origin_z</a> = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin_z">origin_z</a> + 32;
<a href="weapons.htm#BecomeExplosion">BecomeExplosion</a> ();
};
<i>/*QUAKED misc_explobox (0 .5 .8) (0 0 0) (32 32 64)
TESTING THING
*/</i>
<a href="qc-types.htm#void">void</a>() <b>misc_explobox</b><a name="misc_explobox">=</a>
{
<b>local</b> <a href="qc-types.htm#float">float</a> oldz;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_solid">solid</a> = <a href="qc-defs.htm#SOLID_BBOX">SOLID_BBOX</a>;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_movetype">movetype</a> = <a href="qc-defs.htm#MOVETYPE_NONE">MOVETYPE_NONE</a>;
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"maps/b_explob.bsp"</b>);
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"maps/b_explob.bsp"</b>);
<a href="qc-built.htm#precache_sound">precache_sound</a> (<b>"weapons/r_exp3.wav"</b>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_health">health</a> = 20;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_th_die">th_die</a> = <a href="misc.htm#barrel_explode">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_AIM">DAMAGE_AIM</a>;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin_z">origin_z</a> = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin_z">origin_z</a> + 2;
oldz = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin_z">origin_z</a>;
<a href="qc-built.htm#droptofloor">droptofloor</a>();
<b>if</b> (oldz - <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin_z">origin_z</a> > 250)
{
<a href="qc-built.htm#dprint">dprint</a> (<b>"item fell out of level at "</b>);
<a href="qc-built.htm#dprint">dprint</a> (vtos(<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin">origin</a>));
<a href="qc-built.htm#dprint">dprint</a> (<b>"\n"</b>);
<a href="qc-built.htm#remove">remove</a>(<a href="qc-glob.htm#self">self</a>);
}
};
<i>/*QUAKED misc_explobox2 (0 .5 .8) (0 0 0) (32 32 64)
Smaller exploding box, REGISTERED ONLY
*/</i>
<a href="qc-types.htm#void">void</a>() <b>misc_explobox2</b><a name="misc_explobox2">=</a>
{
<b>local</b> <a href="qc-types.htm#float">float</a> oldz;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_solid">solid</a> = <a href="qc-defs.htm#SOLID_BBOX">SOLID_BBOX</a>;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_movetype">movetype</a> = <a href="qc-defs.htm#MOVETYPE_NONE">MOVETYPE_NONE</a>;
<a href="qc-built.htm#precache_model2">precache_model2</a> (<b>"maps/b_exbox2.bsp"</b>);
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"maps/b_exbox2.bsp"</b>);
<a href="qc-built.htm#precache_sound">precache_sound</a> (<b>"weapons/r_exp3.wav"</b>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_health">health</a> = 20;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_th_die">th_die</a> = <a href="misc.htm#barrel_explode">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_AIM">DAMAGE_AIM</a>;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin_z">origin_z</a> = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin_z">origin_z</a> + 2;
oldz = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin_z">origin_z</a>;
<a href="qc-built.htm#droptofloor">droptofloor</a>();
<b>if</b> (oldz - <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin_z">origin_z</a> > 250)
{
<a href="qc-built.htm#dprint">dprint</a> (<b>"item fell out of level at "</b>);
<a href="qc-built.htm#dprint">dprint</a> (vtos(<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin">origin</a>));
<a href="qc-built.htm#dprint">dprint</a> (<b>"\n"</b>);
<a href="qc-built.htm#remove">remove</a>(<a href="qc-glob.htm#self">self</a>);
}
};
<i>//============================================================================</i>
<a href="qc-types.htm#float">float</a> <b><a name="SPAWNFLAG_SUPERSPIKE">SPAWNFLAG_SUPERSPIKE</a></b> = 1;
<a href="qc-types.htm#float">float</a> <b><a name="SPAWNFLAG_LASER">SPAWNFLAG_LASER</a></b> = 2;
<a href="qc-types.htm#void">void</a>(<a href="qc-types.htm#vector">vector</a> org, <a href="qc-types.htm#vector">vector</a> vec) <a href="enforcer.htm#LaunchLaser">LaunchLaser</a>;
<a href="qc-types.htm#void">void</a>() <b>spikeshooter_use</b><a name="spikeshooter_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#SPAWNFLAG_LASER">SPAWNFLAG_LASER</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>"enforcer/enfire.wav"</b>, 1, <a href="qc-defs.htm#ATTN_NORM">ATTN_NORM</a>);
<a href="enforcer.htm#LaunchLaser">LaunchLaser</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>.<a href="qc-enty.htm#dot_movedir">movedir</a>);
}
<b>else</b>
{
<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/spike2.wav"</b>, 1, <a href="qc-defs.htm#ATTN_NORM">ATTN_NORM</a>);
<a href="weapons.htm#launch_spike">launch_spike</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>.<a href="qc-enty.htm#dot_movedir">movedir</a>);
<a href="defs.htm#newmis">newmis</a>.<a href="qc-enty.htm#dot_velocity">velocity</a> = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_movedir">movedir</a> * 500;
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> & <a href="misc.htm#SPAWNFLAG_SUPERSPIKE">SPAWNFLAG_SUPERSPIKE</a>)
<a href="defs.htm#newmis">newmis</a>.<a href="qc-enty.htm#dot_touch">touch</a> = <a href="weapons.htm#superspike_touch">superspike_touch</a>;
}
};
<a href="qc-types.htm#void">void</a>() <b>shooter_think</b><a name="shooter_think">=</a>
{
<a href="misc.htm#spikeshooter_use">spikeshooter_use</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-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_wait">wait</a>;
<a href="defs.htm#newmis">newmis</a>.<a href="qc-enty.htm#dot_velocity">velocity</a> = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_movedir">movedir</a> * 500;
};
<i>/*QUAKED trap_spikeshooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser
When triggered, fires a spike in the direction set in QuakeEd.
Laser is only for REGISTERED.
*/</i>
<a href="qc-types.htm#void">void</a>() <b>trap_spikeshooter</b><a name="trap_spikeshooter">=</a>
{
<a href="subs.htm#SetMovedir">SetMovedir</a> ();
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_use">use</a> = <a href="misc.htm#spikeshooter_use">spikeshooter_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#SPAWNFLAG_LASER">SPAWNFLAG_LASER</a>)
{
<a href="qc-built.htm#precache_model2">precache_model2</a> (<b>"progs/laser.mdl"</b>);
<a href="qc-built.htm#precache_sound2">precache_sound2</a> (<b>"enforcer/enfire.wav"</b>);
<a href="qc-built.htm#precache_sound2">precache_sound2</a> (<b>"enforcer/enfstop.wav"</b>);
}
<b>else</b>
<a href="qc-built.htm#precache_sound">precache_sound</a> (<b>"weapons/spike2.wav"</b>);
};
<i>/*QUAKED trap_shooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser
Continuously fires spikes.
"wait" time between spike (1.0 default)
"nextthink" delay before firing first spike, so multiple shooters can be stagered.
*/</i>
<a href="qc-types.htm#void">void</a>() <b>trap_shooter</b><a name="trap_shooter">=</a>
{
<a href="misc.htm#trap_spikeshooter">trap_spikeshooter</a> ();
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_wait">wait</a> == 0)
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_wait">wait</a> = 1;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_nextthink">nextthink</a> = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_nextthink">nextthink</a> + <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_wait">wait</a> + <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_ltime">ltime</a>;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_think">think</a> = <a href="misc.htm#shooter_think">shooter_think</a>;
};
<i>/*
===============================================================================
===============================================================================
*/</i>
<a href="qc-types.htm#void">void</a>() <a href="misc.htm#make_bubbles">make_bubbles</a>;
<a href="qc-types.htm#void">void</a>() <a href="misc.htm#bubble_remove">bubble_remove</a>;
<a href="qc-types.htm#void">void</a>() <a href="misc.htm#bubble_bob">bubble_bob</a>;
<i>/*QUAKED air_bubbles (0 .5 .8) (-8 -8 -8) (8 8 8)
testing air bubbles
*/</i>
<a href="qc-types.htm#void">void</a>() <b>air_bubbles</b><a name="air_bubbles">=</a>
{
<b>if</b> (<a href="qc-glob.htm#deathmatch">deathmatch</a>)
{
<a href="qc-built.htm#remove">remove</a> (<a href="qc-glob.htm#self">self</a>);
<b>return</b>;
}
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"progs/s_bubble.spr"</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> + 1;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_think">think</a> = <a href="misc.htm#make_bubbles">make_bubbles</a>;
};
<a href="qc-types.htm#void">void</a>() <b>make_bubbles</b><a name="make_bubbles">=</a>
{
<b>local</b> <a href="qc-types.htm#entity">entity</a> bubble;
bubble = <a href="qc-built.htm#spawn">spawn</a>();
<a href="qc-built.htm#setmodel">setmodel</a> (bubble, <b>"progs/s_bubble.spr"</b>);
<a href="qc-built.htm#setorigin">setorigin</a> (bubble, <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin">origin</a>);
bubble.<a href="qc-enty.htm#dot_movetype">movetype</a> = <a href="qc-defs.htm#MOVETYPE_NOCLIP">MOVETYPE_NOCLIP</a>;
bubble.<a href="qc-enty.htm#dot_solid">solid</a> = <a href="qc-defs.htm#SOLID_NOT">SOLID_NOT</a>;
bubble.<a href="qc-enty.htm#dot_velocity">velocity</a> = '0 0 15';
bubble.<a href="qc-enty.htm#dot_nextthink">nextthink</a> = <a href="qc-glob.htm#time">time</a> + 0.5;
bubble.<a href="qc-enty.htm#dot_think">think</a> = <a href="misc.htm#bubble_bob">bubble_bob</a>;
bubble.<a href="qc-enty.htm#dot_touch">touch</a> = <a href="misc.htm#bubble_remove">bubble_remove</a>;
bubble.<a href="qc-enty.htm#dot_classname">classname</a> = <b>"bubble"</b>;
bubble.<a href="qc-enty.htm#dot_frame">frame</a> = 0;
bubble.<a href="qc-enty.htm#dot_cnt">cnt</a> = 0;
<a href="qc-built.htm#setsize">setsize</a> (bubble, '-8 -8 -8', '8 8 8');
<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>() + 0.5;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_think">think</a> = <a href="misc.htm#make_bubbles">make_bubbles</a>;
};
<a href="qc-types.htm#void">void</a>() <b>bubble_split</b><a name="bubble_split">=</a>
{
<b>local</b> <a href="qc-types.htm#entity">entity</a> bubble;
bubble = <a href="qc-built.htm#spawn">spawn</a>();
<a href="qc-built.htm#setmodel">setmodel</a> (bubble, <b>"progs/s_bubble.spr"</b>);
<a href="qc-built.htm#setorigin">setorigin</a> (bubble, <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin">origin</a>);
bubble.<a href="qc-enty.htm#dot_movetype">movetype</a> = <a href="qc-defs.htm#MOVETYPE_NOCLIP">MOVETYPE_NOCLIP</a>;
bubble.<a href="qc-enty.htm#dot_solid">solid</a> = <a href="qc-defs.htm#SOLID_NOT">SOLID_NOT</a>;
bubble.<a href="qc-enty.htm#dot_velocity">velocity</a> = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_velocity">velocity</a>;
bubble.<a href="qc-enty.htm#dot_nextthink">nextthink</a> = <a href="qc-glob.htm#time">time</a> + 0.5;
bubble.<a href="qc-enty.htm#dot_think">think</a> = <a href="misc.htm#bubble_bob">bubble_bob</a>;
bubble.<a href="qc-enty.htm#dot_touch">touch</a> = <a href="misc.htm#bubble_remove">bubble_remove</a>;
bubble.<a href="qc-enty.htm#dot_classname">classname</a> = <b>"bubble"</b>;
bubble.<a href="qc-enty.htm#dot_frame">frame</a> = 1;
bubble.<a href="qc-enty.htm#dot_cnt">cnt</a> = 10;
<a href="qc-built.htm#setsize">setsize</a> (bubble, '-8 -8 -8', '8 8 8');
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_frame">frame</a> = 1;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_cnt">cnt</a> = 10;
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_waterlevel">waterlevel</a> != 3)
<a href="qc-built.htm#remove">remove</a> (<a href="qc-glob.htm#self">self</a>);
};
<a href="qc-types.htm#void">void</a>() <b>bubble_remove</b><a name="bubble_remove">=</a>
{
<b>if</b> (<a href="qc-glob.htm#other">other</a>.<a href="qc-enty.htm#dot_classname">classname</a> == <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_classname">classname</a>)
{
<i>// dprint ("bump");</i>
<b>return</b>;
}
<a href="qc-built.htm#remove">remove</a>(<a href="qc-glob.htm#self">self</a>);
};
<a href="qc-types.htm#void">void</a>() <b>bubble_bob</b><a name="bubble_bob">=</a>
{
<b>local</b> <a href="qc-types.htm#float">float</a> rnd1, rnd2, rnd3;
<b>local</b> <a href="qc-types.htm#vector">vector</a> vtmp1, modi;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_cnt">cnt</a> = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_cnt">cnt</a> + 1;
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_cnt">cnt</a> == 4)
<a href="misc.htm#bubble_split">bubble_split</a>();
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_cnt">cnt</a> == 20)
<a href="qc-built.htm#remove">remove</a>(<a href="qc-glob.htm#self">self</a>);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -