📄 items.htm
字号:
<a href="qc-glob.htm#self">self</a> = <a href="qc-glob.htm#other">other</a>;
<a href="weapons.htm#W_SetCurrentAmmo">W_SetCurrentAmmo</a>();
<a href="qc-glob.htm#self">self</a> = stemp;
<i>// remove it in single player, or setup for respawning in deathmatch</i>
<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#self">self</a>.<a href="qc-enty.htm#dot_solid">solid</a> = <a href="qc-defs.htm#SOLID_NOT">SOLID_NOT</a>;
<b>if</b> (<a href="qc-glob.htm#deathmatch">deathmatch</a> == 1)
<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> + 30;
<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="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#float">float</a> <b><a name="WEAPON_BIG2">WEAPON_BIG2</a></b> = 1;
<i>/*QUAKED item_shells (0 .5 .8) (0 0 0) (32 32 32) big
*/</i>
<a href="qc-types.htm#void">void</a>() <b>item_shells</b><a name="item_shells">=</a>
{
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_touch">touch</a> = <a href="items.htm#ammo_touch">ammo_touch</a>;
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> & <a href="items.htm#WEAPON_BIG2">WEAPON_BIG2</a>)
{
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"maps/b_shell1.bsp"</b>);
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"maps/b_shell1.bsp"</b>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_aflag">aflag</a> = 40;
}
<b>else</b>
{
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"maps/b_shell0.bsp"</b>);
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"maps/b_shell0.bsp"</b>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_aflag">aflag</a> = 20;
}
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_weapon">weapon</a> = 1;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_netname">netname</a> = <b>"shells"</b>;
<a href="qc-built.htm#setsize">setsize</a> (<a href="qc-glob.htm#self">self</a>, '0 0 0', '32 32 56');
<a href="items.htm#StartItem">StartItem</a> ();
};
<i>/*QUAKED item_spikes (0 .5 .8) (0 0 0) (32 32 32) big
*/</i>
<a href="qc-types.htm#void">void</a>() <b>item_spikes</b><a name="item_spikes">=</a>
{
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_touch">touch</a> = <a href="items.htm#ammo_touch">ammo_touch</a>;
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> & <a href="items.htm#WEAPON_BIG2">WEAPON_BIG2</a>)
{
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"maps/b_nail1.bsp"</b>);
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"maps/b_nail1.bsp"</b>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_aflag">aflag</a> = 50;
}
<b>else</b>
{
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"maps/b_nail0.bsp"</b>);
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"maps/b_nail0.bsp"</b>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_aflag">aflag</a> = 25;
}
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_weapon">weapon</a> = 2;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_netname">netname</a> = <b>"nails"</b>;
<a href="qc-built.htm#setsize">setsize</a> (<a href="qc-glob.htm#self">self</a>, '0 0 0', '32 32 56');
<a href="items.htm#StartItem">StartItem</a> ();
};
<i>/*QUAKED item_rockets (0 .5 .8) (0 0 0) (32 32 32) big
*/</i>
<a href="qc-types.htm#void">void</a>() <b>item_rockets</b><a name="item_rockets">=</a>
{
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_touch">touch</a> = <a href="items.htm#ammo_touch">ammo_touch</a>;
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> & <a href="items.htm#WEAPON_BIG2">WEAPON_BIG2</a>)
{
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"maps/b_rock1.bsp"</b>);
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"maps/b_rock1.bsp"</b>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_aflag">aflag</a> = 10;
}
<b>else</b>
{
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"maps/b_rock0.bsp"</b>);
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"maps/b_rock0.bsp"</b>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_aflag">aflag</a> = 5;
}
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_weapon">weapon</a> = 3;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_netname">netname</a> = <b>"rockets"</b>;
<a href="qc-built.htm#setsize">setsize</a> (<a href="qc-glob.htm#self">self</a>, '0 0 0', '32 32 56');
<a href="items.htm#StartItem">StartItem</a> ();
};
<i>/*QUAKED item_cells (0 .5 .8) (0 0 0) (32 32 32) big
*/</i>
<a href="qc-types.htm#void">void</a>() <b>item_cells</b><a name="item_cells">=</a>
{
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_touch">touch</a> = <a href="items.htm#ammo_touch">ammo_touch</a>;
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> & <a href="items.htm#WEAPON_BIG2">WEAPON_BIG2</a>)
{
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"maps/b_batt1.bsp"</b>);
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"maps/b_batt1.bsp"</b>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_aflag">aflag</a> = 12;
}
<b>else</b>
{
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"maps/b_batt0.bsp"</b>);
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"maps/b_batt0.bsp"</b>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_aflag">aflag</a> = 6;
}
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_weapon">weapon</a> = 4;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_netname">netname</a> = <b>"cells"</b>;
<a href="qc-built.htm#setsize">setsize</a> (<a href="qc-glob.htm#self">self</a>, '0 0 0', '32 32 56');
<a href="items.htm#StartItem">StartItem</a> ();
};
<i>/*QUAKED item_weapon (0 .5 .8) (0 0 0) (32 32 32) shotgun rocket spikes big
DO NOT USE THIS!!!! IT WILL BE REMOVED!
*/</i>
<a href="qc-types.htm#float">float</a> <b><a name="WEAPON_SHOTGUN">WEAPON_SHOTGUN</a></b> = 1;
<a href="qc-types.htm#float">float</a> <b><a name="WEAPON_ROCKET">WEAPON_ROCKET</a></b> = 2;
<a href="qc-types.htm#float">float</a> <b><a name="WEAPON_SPIKES">WEAPON_SPIKES</a></b> = 4;
<a href="qc-types.htm#float">float</a> <b><a name="WEAPON_BIG">WEAPON_BIG</a></b> = 8;
<a href="qc-types.htm#void">void</a>() <b>item_weapon</b><a name="item_weapon">=</a>
{
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_touch">touch</a> = <a href="items.htm#ammo_touch">ammo_touch</a>;
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> & <a href="items.htm#WEAPON_SHOTGUN">WEAPON_SHOTGUN</a>)
{
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> & <a href="items.htm#WEAPON_BIG">WEAPON_BIG</a>)
{
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"maps/b_shell1.bsp"</b>);
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"maps/b_shell1.bsp"</b>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_aflag">aflag</a> = 40;
}
<b>else</b>
{
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"maps/b_shell0.bsp"</b>);
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"maps/b_shell0.bsp"</b>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_aflag">aflag</a> = 20;
}
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_weapon">weapon</a> = 1;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_netname">netname</a> = <b>"shells"</b>;
}
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> & <a href="items.htm#WEAPON_SPIKES">WEAPON_SPIKES</a>)
{
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> & <a href="items.htm#WEAPON_BIG">WEAPON_BIG</a>)
{
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"maps/b_nail1.bsp"</b>);
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"maps/b_nail1.bsp"</b>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_aflag">aflag</a> = 40;
}
<b>else</b>
{
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"maps/b_nail0.bsp"</b>);
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"maps/b_nail0.bsp"</b>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_aflag">aflag</a> = 20;
}
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_weapon">weapon</a> = 2;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_netname">netname</a> = <b>"spikes"</b>;
}
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> & <a href="items.htm#WEAPON_ROCKET">WEAPON_ROCKET</a>)
{
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> & <a href="items.htm#WEAPON_BIG">WEAPON_BIG</a>)
{
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"maps/b_rock1.bsp"</b>);
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"maps/b_rock1.bsp"</b>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_aflag">aflag</a> = 10;
}
<b>else</b>
{
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"maps/b_rock0.bsp"</b>);
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"maps/b_rock0.bsp"</b>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_aflag">aflag</a> = 5;
}
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_weapon">weapon</a> = 3;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_netname">netname</a> = <b>"rockets"</b>;
}
<a href="qc-built.htm#setsize">setsize</a> (<a href="qc-glob.htm#self">self</a>, '0 0 0', '32 32 56');
<a href="items.htm#StartItem">StartItem</a> ();
};
<i>/*
===============================================================================
KEYS
===============================================================================
*/</i>
<a href="qc-types.htm#void">void</a>() <b>key_touch</b><a name="key_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> <= 0)
<b>return</b>;
<b>if</b> (<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>)
<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>);
<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#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>;
<b>if</b> (!<a href="qc-glob.htm#coop">coop</a>)
{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -