📄 shalrath.htm
字号:
ShalMissile
================
*/</i>
<a href="qc-types.htm#void">void</a>() <a href="shalrath.htm#ShalMissileTouch">ShalMissileTouch</a>;
<a href="qc-types.htm#void">void</a>() <a href="shalrath.htm#ShalHome">ShalHome</a>;
<a href="qc-types.htm#void">void</a>() <b>ShalMissile</b><a name="ShalMissile">=</a>
{
<b>local</b> <a href="qc-types.htm#entity">entity</a> missile;
<b>local</b> <a href="qc-types.htm#vector">vector</a> dir;
<b>local</b> <a href="qc-types.htm#float">float</a> dist, flytime;
dir = <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> + '0 0 10') - <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin">origin</a>);
dist = <a href="qc-built.htm#vlen">vlen</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> - <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin">origin</a>);
flytime = dist * 0.002;
<b>if</b> (flytime < 0.1)
flytime = 0.1;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_effects">effects</a> = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_effects">effects</a> | <a href="qc-defs.htm#EF_MUZZLEFLASH">EF_MUZZLEFLASH</a>;
<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>"shalrath/attack2.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_solid">solid</a> = <a href="qc-defs.htm#SOLID_BBOX">SOLID_BBOX</a>;
missile.<a href="qc-enty.htm#dot_movetype">movetype</a> = <a href="qc-defs.htm#MOVETYPE_FLYMISSILE">MOVETYPE_FLYMISSILE</a>;
<a href="qc-built.htm#setmodel">setmodel</a> (missile, <b>"progs/v_spike.mdl"</b>);
<a href="qc-built.htm#setsize">setsize</a> (missile, '0 0 0', '0 0 0');
missile.<a href="qc-enty.htm#dot_origin">origin</a> = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin">origin</a> + '0 0 10';
missile.<a href="qc-enty.htm#dot_velocity">velocity</a> = dir * 400;
missile.<a href="qc-enty.htm#dot_avelocity">avelocity</a> = '300 300 300';
missile.<a href="qc-enty.htm#dot_nextthink">nextthink</a> = flytime + <a href="qc-glob.htm#time">time</a>;
missile.<a href="qc-enty.htm#dot_think">think</a> = <a href="shalrath.htm#ShalHome">ShalHome</a>;
missile.<a href="qc-enty.htm#dot_enemy">enemy</a> = <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_enemy">enemy</a>;
missile.<a href="qc-enty.htm#dot_touch">touch</a> = <a href="shalrath.htm#ShalMissileTouch">ShalMissileTouch</a>;
};
<a href="qc-types.htm#void">void</a>() <b>ShalHome</b><a name="ShalHome">=</a>
{
<b>local</b> <a href="qc-types.htm#vector">vector</a> dir, vtemp;
vtemp = <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> + '0 0 10';
<b>if</b> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_enemy">enemy</a>.<a href="qc-enty.htm#dot_health">health</a> < 1)
{
<a href="qc-built.htm#remove">remove</a>(<a href="qc-glob.htm#self">self</a>);
<b>return</b>;
}
dir = <a href="qc-built.htm#normalize">normalize</a>(vtemp - <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin">origin</a>);
<b>if</b> (<a href="defs.htm#skill">skill</a> == 3)
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_velocity">velocity</a> = dir * 350;
<b>else</b>
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_velocity">velocity</a> = dir * 250;
<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> + 0.2;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_think">think</a> = <a href="shalrath.htm#ShalHome">ShalHome</a>;
};
<a href="qc-types.htm#void">void</a>() <b>ShalMissileTouch</b><a name="ShalMissileTouch">=</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_classname">classname</a> == <b>"monster_zombie"</b>)
<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>, 110);
<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>.<a href="qc-enty.htm#dot_owner">owner</a>, 40, <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_WEAPON">CHAN_WEAPON</a>, <b>"weapons/r_exp3.wav"</b>, 1, <a href="qc-defs.htm#ATTN_NORM">ATTN_NORM</a>);
<a href="qc-netf.htm#WriteByte">WriteByte</a> (<a href="qc-net.htm#MSG_BROADCAST">MSG_BROADCAST</a>, <a href="qc-net.htm#SVC_TEMPENTITY">SVC_TEMPENTITY</a>);
<a href="qc-netf.htm#WriteByte">WriteByte</a> (<a href="qc-net.htm#MSG_BROADCAST">MSG_BROADCAST</a>, <a href="defs.htm#TE_EXPLOSION">TE_EXPLOSION</a>);
<a href="qc-netf.htm#WriteCoord">WriteCoord</a> (<a href="qc-net.htm#MSG_BROADCAST">MSG_BROADCAST</a>, <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin_x">origin_x</a>);
<a href="qc-netf.htm#WriteCoord">WriteCoord</a> (<a href="qc-net.htm#MSG_BROADCAST">MSG_BROADCAST</a>, <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin_y">origin_y</a>);
<a href="qc-netf.htm#WriteCoord">WriteCoord</a> (<a href="qc-net.htm#MSG_BROADCAST">MSG_BROADCAST</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_velocity">velocity</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_Null">SUB_Null</a>;
<a href="qc-built.htm#setmodel">setmodel</a> (<a href="qc-glob.htm#self">self</a>, <b>"progs/s_explod.spr"</b>);
<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>;
<a href="weapons.htm#s_explode1">s_explode1</a> ();
};
<i>//=================================================================</i>
<i>/*QUAKED monster_shalrath (1 0 0) (-32 -32 -24) (32 32 48) Ambush
*/</i>
<a href="qc-types.htm#void">void</a>() <b>monster_shalrath</b><a name="monster_shalrath">=</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_model2">precache_model2</a> (<b>"progs/shalrath.mdl"</b>);
<a href="qc-built.htm#precache_model2">precache_model2</a> (<b>"progs/h_shal.mdl"</b>);
<a href="qc-built.htm#precache_model2">precache_model2</a> (<b>"progs/v_spike.mdl"</b>);
<a href="qc-built.htm#precache_sound2">precache_sound2</a> (<b>"shalrath/attack.wav"</b>);
<a href="qc-built.htm#precache_sound2">precache_sound2</a> (<b>"shalrath/attack2.wav"</b>);
<a href="qc-built.htm#precache_sound2">precache_sound2</a> (<b>"shalrath/death.wav"</b>);
<a href="qc-built.htm#precache_sound2">precache_sound2</a> (<b>"shalrath/idle.wav"</b>);
<a href="qc-built.htm#precache_sound2">precache_sound2</a> (<b>"shalrath/pain.wav"</b>);
<a href="qc-built.htm#precache_sound2">precache_sound2</a> (<b>"shalrath/sight.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/shalrath.mdl"</b>);
<a href="qc-built.htm#setsize">setsize</a> (<a href="qc-glob.htm#self">self</a>, <a href="defs.htm#VEC_HULL2_MIN">VEC_HULL2_MIN</a>, <a href="defs.htm#VEC_HULL2_MAX">VEC_HULL2_MAX</a>);
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_health">health</a> = 400;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_th_stand">th_stand</a> = <a href="shalrath.htm#shal_stand">shal_stand</a>;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_th_walk">th_walk</a> = <a href="shalrath.htm#shal_walk1">shal_walk1</a>;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_th_run">th_run</a> = <a href="shalrath.htm#shal_run1">shal_run1</a>;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_th_die">th_die</a> = <a href="shalrath.htm#shalrath_die">shalrath_die</a>;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_th_pain">th_pain</a> = <a href="shalrath.htm#shalrath_pain">shalrath_pain</a>;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_th_missile">th_missile</a> = <a href="shalrath.htm#shal_attack1">shal_attack1</a>;
<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_think">think</a> = <a href="monsters.htm#walkmonster_start">walkmonster_start</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> + 0.1 + <a href="qc-built.htm#random">random</a> ()*0.1;
};
</pre></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -