📄 zombie.htm
字号:
<a href="player.htm#ThrowHead">ThrowHead</a> (<b>"progs/h_zombie.mdl"</b>, <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_health">health</a>);
<a href="player.htm#ThrowGib">ThrowGib</a> (<b>"progs/gib1.mdl"</b>, <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_health">health</a>);
<a href="player.htm#ThrowGib">ThrowGib</a> (<b>"progs/gib2.mdl"</b>, <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_health">health</a>);
<a href="player.htm#ThrowGib">ThrowGib</a> (<b>"progs/gib3.mdl"</b>, <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_health">health</a>);
};
<i>/*
=================
zombie_pain
Zombies can only be killed (gibbed) by doing 60 hit points of damage
in a single frame (rockets, grenades, quad shotgun, quad nailgun).
A hit of 25 points or more (super shotgun, quad nailgun) will allways put it
down to the ground.
A hit of from 10 to 40 points in one frame will cause it to go down if it
has been twice in two seconds, otherwise it goes into one of the four
fast pain frames.
A hit of less than 10 points of damage (winged by a shotgun) will be ignored.
FIXME: don't use pain_finished because of nightmare hack
=================
*/</i>
<a href="qc-types.htm#void">void</a>(<a href="qc-types.htm#entity">entity</a> attacker, <a href="qc-types.htm#float">float</a> take) <b>zombie_pain</b><a name="zombie_pain">=</a>
{
<b>local</b> <a href="qc-types.htm#float">float</a> r;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_health">health</a> = 60; <i>// allways reset health</i>
<b>if</b> (take < 9)
<b>return</b>; <i>// totally ignore</i>
<b>if</b> (<a href="qc-glob.htm#self">self</a>.inpain == 2)
<b>return</b>; <i>// down on ground, so don't reset any counters</i>
<i>// go down immediately if a big enough hit</i>
<b>if</b> (take >= 25)
{
<a href="qc-glob.htm#self">self</a>.inpain = 2;
<a href="zombie.htm#zombie_paine1">zombie_paine1</a> ();
<b>return</b>;
}
<b>if</b> (<a href="qc-glob.htm#self">self</a>.inpain)
{
<i>// if hit again in next gre seconds while not in pain frames, definately drop</i>
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_pain_finished">pain_finished</a> = <a href="qc-glob.htm#time">time</a> + 3;
<b>return</b>; <i>// currently going through an animation, don't change</i>
}
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_pain_finished">pain_finished</a> > <a href="qc-glob.htm#time">time</a>)
{
<i>// hit again, so drop down</i>
<a href="qc-glob.htm#self">self</a>.inpain = 2;
<a href="zombie.htm#zombie_paine1">zombie_paine1</a> ();
<b>return</b>;
}
<i>// gp into one of the fast pain animations </i>
<a href="qc-glob.htm#self">self</a>.inpain = 1;
r = <a href="qc-built.htm#random">random</a>();
<b>if</b> (r < 0.25)
<a href="zombie.htm#zombie_paina1">zombie_paina1</a> ();
<b>else</b> <b>if</b> (r < 0.5)
<a href="zombie.htm#zombie_painb1">zombie_painb1</a> ();
<b>else</b> <b>if</b> (r < 0.75)
<a href="zombie.htm#zombie_painc1">zombie_painc1</a> ();
<b>else</b>
<a href="zombie.htm#zombie_paind1">zombie_paind1</a> ();
};
<i>//============================================================================</i>
<i>/*QUAKED monster_zombie (1 0 0) (-16 -16 -24) (16 16 32) Crucified ambush
If crucified, stick the bounding box 12 pixels back into a wall to look right.
*/</i>
<a href="qc-types.htm#void">void</a>() <b>monster_zombie</b><a name="monster_zombie">=</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/zombie.mdl"</b>);
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"progs/h_zombie.mdl"</b>);
<a href="qc-built.htm#precache_model">precache_model</a> (<b>"progs/zom_gib.mdl"</b>);
<a href="qc-built.htm#precache_sound">precache_sound</a> (<b>"zombie/z_idle.wav"</b>);
<a href="qc-built.htm#precache_sound">precache_sound</a> (<b>"zombie/z_idle1.wav"</b>);
<a href="qc-built.htm#precache_sound">precache_sound</a> (<b>"zombie/z_shot1.wav"</b>);
<a href="qc-built.htm#precache_sound">precache_sound</a> (<b>"zombie/z_gib.wav"</b>);
<a href="qc-built.htm#precache_sound">precache_sound</a> (<b>"zombie/z_pain.wav"</b>);
<a href="qc-built.htm#precache_sound">precache_sound</a> (<b>"zombie/z_pain1.wav"</b>);
<a href="qc-built.htm#precache_sound">precache_sound</a> (<b>"zombie/z_fall.wav"</b>);
<a href="qc-built.htm#precache_sound">precache_sound</a> (<b>"zombie/z_miss.wav"</b>);
<a href="qc-built.htm#precache_sound">precache_sound</a> (<b>"zombie/z_hit.wav"</b>);
<a href="qc-built.htm#precache_sound">precache_sound</a> (<b>"zombie/idle_w2.wav"</b>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_solid">solid</a> = <a href="qc-defs.htm#SOLID_SLIDEBOX">SOLID_SLIDEBOX</a>;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_movetype">movetype</a> = <a href="qc-defs.htm#MOVETYPE_STEP">MOVETYPE_STEP</a>;
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"progs/zombie.mdl"</b>);
<a href="qc-built.htm#setsize">setsize</a> (<a href="qc-glob.htm#self">self</a>, '-16 -16 -24', '16 16 40');
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_health">health</a> = 60;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_th_stand">th_stand</a> = <a href="zombie.htm#zombie_stand1">zombie_stand1</a>;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_th_walk">th_walk</a> = <a href="zombie.htm#zombie_walk1">zombie_walk1</a>;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_th_run">th_run</a> = <a href="zombie.htm#zombie_run1">zombie_run1</a>;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_th_pain">th_pain</a> = <a href="zombie.htm#zombie_pain">zombie_pain</a>;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_th_die">th_die</a> = <a href="zombie.htm#zombie_die">zombie_die</a>;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_th_missile">th_missile</a> = <a href="zombie.htm#zombie_missile">zombie_missile</a>;
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_spawnflags">spawnflags</a> & <a href="zombie.htm#SPAWN_CRUCIFIED">SPAWN_CRUCIFIED</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="zombie.htm#zombie_cruc1">zombie_cruc1</a> ();
}
<b>else</b>
<a href="monsters.htm#walkmonster_start">walkmonster_start</a>();
};
</pre></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -