📄 zombie.htm
字号:
<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>"zombie/z_idle1.wav"</b>, 1, <a href="qc-defs.htm#ATTN_IDLE">ATTN_IDLE</a>);
};
<i>/*
=============================================================================
ATTACKS
=============================================================================
*/</i>
<a href="qc-types.htm#void">void</a>() <b>ZombieGrenadeTouch</b><a name="ZombieGrenadeTouch">=</a>
{
<b>if</b> (<a href="qc-glob.htm#other">other</a> == <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_owner">owner</a>)
<b>return</b>; <i>// don't explode on owner</i>
<b>if</b> (<a href="qc-glob.htm#other">other</a>.<a href="qc-enty.htm#dot_takedamage">takedamage</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>.<a href="qc-enty.htm#dot_owner">owner</a>, 10 );
<a href="qc-built.htm#sound">sound</a> (<a href="qc-glob.htm#self">self</a>, <a href="qc-defs.htm#CHAN_WEAPON">CHAN_WEAPON</a>, <b>"zombie/z_hit.wav"</b>, 1, <a href="qc-defs.htm#ATTN_NORM">ATTN_NORM</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#sound">sound</a> (<a href="qc-glob.htm#self">self</a>, <a href="qc-defs.htm#CHAN_WEAPON">CHAN_WEAPON</a>, <b>"zombie/z_miss.wav"</b>, 1, <a href="qc-defs.htm#ATTN_NORM">ATTN_NORM</a>); <i>// bounce sound</i>
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_velocity">velocity</a> = '0 0 0';
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_avelocity">avelocity</a> = '0 0 0';
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_touch">touch</a> = <a href="subs.htm#SUB_Remove">SUB_Remove</a>;
};
<i>/*
================
ZombieFireGrenade
================
*/</i>
<a href="qc-types.htm#void">void</a>(<a href="qc-types.htm#vector">vector</a> st) <b>ZombieFireGrenade</b><a name="ZombieFireGrenade">=</a>
{
<b>local</b> <a href="qc-types.htm#entity">entity</a> missile, mpuff;
<b>local</b> <a href="qc-types.htm#vector">vector</a> org;
<a href="qc-built.htm#sound">sound</a> (<a href="qc-glob.htm#self">self</a>, <a href="qc-defs.htm#CHAN_WEAPON">CHAN_WEAPON</a>, <b>"zombie/z_shot1.wav"</b>, 1, <a href="qc-defs.htm#ATTN_NORM">ATTN_NORM</a>);
missile = <a href="qc-built.htm#spawn">spawn</a> ();
missile.<a href="qc-enty.htm#dot_owner">owner</a> = <a href="qc-glob.htm#self">self</a>;
missile.<a href="qc-enty.htm#dot_movetype">movetype</a> = <a href="qc-defs.htm#MOVETYPE_BOUNCE">MOVETYPE_BOUNCE</a>;
missile.<a href="qc-enty.htm#dot_solid">solid</a> = <a href="qc-defs.htm#SOLID_BBOX">SOLID_BBOX</a>;
<i>// calc org</i>
org = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin">origin</a> + st_x * <a href="qc-built.htm#v_forward">v_forward</a> + st_y * <a href="qc-built.htm#v_right">v_right</a> + (st_z - 24) * <a href="qc-built.htm#v_up">v_up</a>;
<i>// set missile speed </i>
<a href="qc-built.htm#makevectors">makevectors</a> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_angles">angles</a>);
missile.<a href="qc-enty.htm#dot_velocity">velocity</a> = <a href="qc-built.htm#normalize">normalize</a>(<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_enemy">enemy</a>.<a href="qc-enty.htm#dot_origin">origin</a> - org);
missile.<a href="qc-enty.htm#dot_velocity">velocity</a> = missile.<a href="qc-enty.htm#dot_velocity">velocity</a> * 600;
missile.velocity_z = 200;
missile.<a href="qc-enty.htm#dot_avelocity">avelocity</a> = '3000 1000 2000';
missile.<a href="qc-enty.htm#dot_touch">touch</a> = <a href="zombie.htm#ZombieGrenadeTouch">ZombieGrenadeTouch</a>;
<i>// set missile duration</i>
missile.<a href="qc-enty.htm#dot_nextthink">nextthink</a> = <a href="qc-glob.htm#time">time</a> + 2.5;
missile.<a href="qc-enty.htm#dot_think">think</a> = <a href="subs.htm#SUB_Remove">SUB_Remove</a>;
<a href="qc-built.htm#setmodel">setmodel</a> (missile, <b>"progs/zom_gib.mdl"</b>);
<a href="qc-built.htm#setsize">setsize</a> (missile, '0 0 0', '0 0 0');
<a href="qc-built.htm#setorigin">setorigin</a> (missile, org);
};
<a href="qc-types.htm#void">void</a>() <b>zombie_atta1</b><a name="zombie_atta1">=</a>[ $atta1, zombie_atta2 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_atta2</b><a name="zombie_atta2">=</a>[ $atta2, zombie_atta3 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_atta3</b><a name="zombie_atta3">=</a>[ $atta3, zombie_atta4 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_atta4</b><a name="zombie_atta4">=</a>[ $atta4, zombie_atta5 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_atta5</b><a name="zombie_atta5">=</a>[ $atta5, zombie_atta6 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_atta6</b><a name="zombie_atta6">=</a>[ $atta6, zombie_atta7 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_atta7</b><a name="zombie_atta7">=</a>[ $atta7, zombie_atta8 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_atta8</b><a name="zombie_atta8">=</a>[ $atta8, zombie_atta9 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_atta9</b><a name="zombie_atta9">=</a>[ $atta9, zombie_atta10 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_atta10</b><a name="zombie_atta10">=</a>[ $atta10, zombie_atta11 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_atta11</b><a name="zombie_atta11">=</a>[ $atta11, zombie_atta12 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_atta12</b><a name="zombie_atta12">=</a>[ $atta12, zombie_atta13 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_atta13</b><a name="zombie_atta13">=</a>[ $atta13, <a href="zombie.htm#zombie_run1">zombie_run1</a> ] {<a href="fight.htm#ai_face">ai_face</a>();<a href="zombie.htm#ZombieFireGrenade">ZombieFireGrenade</a>('-10 -22 30');};
<a href="qc-types.htm#void">void</a>() <b>zombie_attb1</b><a name="zombie_attb1">=</a>[ $attb1, zombie_attb2 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attb2</b><a name="zombie_attb2">=</a>[ $attb2, zombie_attb3 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attb3</b><a name="zombie_attb3">=</a>[ $attb3, zombie_attb4 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attb4</b><a name="zombie_attb4">=</a>[ $attb4, zombie_attb5 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attb5</b><a name="zombie_attb5">=</a>[ $attb5, zombie_attb6 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attb6</b><a name="zombie_attb6">=</a>[ $attb6, zombie_attb7 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attb7</b><a name="zombie_attb7">=</a>[ $attb7, zombie_attb8 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attb8</b><a name="zombie_attb8">=</a>[ $attb8, zombie_attb9 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attb9</b><a name="zombie_attb9">=</a>[ $attb9, zombie_attb10 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attb10</b><a name="zombie_attb10">=</a>[ $attb10, zombie_attb11 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attb11</b><a name="zombie_attb11">=</a>[ $attb11, zombie_attb12 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attb12</b><a name="zombie_attb12">=</a>[ $attb12, zombie_attb13 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attb13</b><a name="zombie_attb13">=</a>[ $attb13, zombie_attb14 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attb14</b><a name="zombie_attb14">=</a>[ $attb13, <a href="zombie.htm#zombie_run1">zombie_run1</a> ] {<a href="fight.htm#ai_face">ai_face</a>();<a href="zombie.htm#ZombieFireGrenade">ZombieFireGrenade</a>('-10 -24 29');};
<a href="qc-types.htm#void">void</a>() <b>zombie_attc1</b><a name="zombie_attc1">=</a>[ $attc1, zombie_attc2 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attc2</b><a name="zombie_attc2">=</a>[ $attc2, zombie_attc3 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attc3</b><a name="zombie_attc3">=</a>[ $attc3, zombie_attc4 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attc4</b><a name="zombie_attc4">=</a>[ $attc4, zombie_attc5 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attc5</b><a name="zombie_attc5">=</a>[ $attc5, zombie_attc6 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attc6</b><a name="zombie_attc6">=</a>[ $attc6, zombie_attc7 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attc7</b><a name="zombie_attc7">=</a>[ $attc7, zombie_attc8 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attc8</b><a name="zombie_attc8">=</a>[ $attc8, zombie_attc9 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attc9</b><a name="zombie_attc9">=</a>[ $attc9, zombie_attc10 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attc10</b><a name="zombie_attc10">=</a>[ $attc10, zombie_attc11 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attc11</b><a name="zombie_attc11">=</a>[ $attc11, zombie_attc12 ] {<a href="fight.htm#ai_face">ai_face</a>();};
<a href="qc-types.htm#void">void</a>() <b>zombie_attc12</b><a name="zombie_attc12">=</a>[ $attc12, <a href="zombie.htm#zombie_run1">zombie_run1</a> ] {<a href="fight.htm#ai_face">ai_face</a>();<a href="zombie.htm#ZombieFireGrenade">ZombieFireGrenade</a>('-12 -19 29');};
<a href="qc-types.htm#void">void</a>() <b>zombie_missile</b><a name="zombie_missile">=</a>
{
<b>local</b> <a href="qc-types.htm#float">float</a> r;
r = <a href="qc-built.htm#random">random</a>();
<b>if</b> (r < 0.3)
<a href="zombie.htm#zombie_atta1">zombie_atta1</a> ();
<b>else</b> <b>if</b> (r < 0.6)
<a href="zombie.htm#zombie_attb1">zombie_attb1</a> ();
<b>else</b>
<a href="zombie.htm#zombie_attc1">zombie_attc1</a> ();
};
<i>/*
=============================================================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -