⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ogre.htm

📁 Quake 的 各 种 文 档 格 式 说 明
💻 HTM
📖 第 1 页 / 共 3 页
字号:
<html><head><title>ogre.qc</title></head><body bgcolor="#C0F0D0">
<base target=examine>
<pre>
<i>/*
==============================================================================

OGRE

==============================================================================
*/</i>


<b>$</b><a href="qc-mdl.htm#s_cd">cd</a> <b>/raid/quake/id1/models/ogre_c</b>
<b>$</b><a href="qc-mdl.htm#s_origin">origin</a> <b>0 0 24</b>
<b>$</b><a href="qc-mdl.htm#s_base">base</a> <b>base		</b>
<b>$</b><a href="qc-mdl.htm#s_skin">skin</a> <b>base</b>

<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9</b>

<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>walk1 walk2 walk3 walk4 walk5 walk6 walk7</b>
<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>walk8 walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16</b>

<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>run1 run2 run3 run4 run5 run6 run7 run8</b>

<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>swing1 swing2 swing3 swing4 swing5 swing6 swing7</b>
<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>swing8 swing9 swing10 swing11 swing12 swing13 swing14</b>

<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>smash1 smash2 smash3 smash4 smash5 smash6 smash7</b>
<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>smash8 smash9 smash10 smash11 smash12 smash13 smash14</b>

<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>shoot1 shoot2 shoot3 shoot4 shoot5 shoot6</b>

<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>pain1 pain2 pain3 pain4 pain5</b>

<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>painb1 painb2 painb3</b>

<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>painc1 painc2 painc3 painc4 painc5 painc6</b>

<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 paind9 paind10</b>
<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>paind11 paind12 paind13 paind14 paind15 paind16</b>

<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>paine1 paine2 paine3 paine4 paine5 paine6 paine7 paine8 paine9 paine10</b>
<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>paine11 paine12 paine13 paine14 paine15</b>

<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>death1 death2 death3 death4 death5 death6</b>
<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>death7 death8 death9 death10 death11 death12</b>
<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>death13 death14</b>

<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>bdeath1 bdeath2 bdeath3 bdeath4 bdeath5 bdeath6</b>
<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>bdeath7 bdeath8 bdeath9 bdeath10</b>

<b>$</b><a href="qc-mdl.htm#s_frame">frame</a> <b>pull1 pull2 pull3 pull4 pull5 pull6 pull7 pull8 pull9 pull10 pull11</b>

<i>//=============================================================================</i>


<a href="qc-types.htm#void">void</a>() <b>OgreGrenadeExplode</b><a name="OgreGrenadeExplode">=</a>
{
	<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_VOICE">CHAN_VOICE</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> ();
};

<a href="qc-types.htm#void">void</a>() <b>OgreGrenadeTouch</b><a name="OgreGrenadeTouch">=</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="qc-defs.htm#DAMAGE_AIM">DAMAGE_AIM</a>)
	{
		<a href="ogre.htm#OgreGrenadeExplode">OgreGrenadeExplode</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_VOICE">CHAN_VOICE</a>, <b>"weapons/bounce.wav"</b>, 1, <a href="qc-defs.htm#ATTN_NORM">ATTN_NORM</a>);	<i>// bounce sound</i>
	<b>if</b> (<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';
};

<i>/*
================
OgreFireGrenade
================
*/</i>

<a href="qc-types.htm#void">void</a>() <b>OgreFireGrenade</b><a name="OgreFireGrenade">=</a>
{
	<b>local</b>	<a href="qc-types.htm#entity">entity</a> missile, mpuff;
	
	<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>"weapons/grenade.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>// 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> - <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin">origin</a>);
	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> = '300 300 300';

	missile.<a href="qc-enty.htm#dot_angles">angles</a> = <a href="qc-built.htm#vectoangles">vectoangles</a>(missile.<a href="qc-enty.htm#dot_velocity">velocity</a>);
	
	missile.<a href="qc-enty.htm#dot_touch">touch</a> = <a href="ogre.htm#OgreGrenadeTouch">OgreGrenadeTouch</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="ogre.htm#OgreGrenadeExplode">OgreGrenadeExplode</a>;

	<a href="qc-built.htm#setmodel">setmodel</a> (missile, <b>"progs/grenade.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, <a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_origin">origin</a>);
};


<i>//=============================================================================</i>

<i>/*
================
chainsaw

FIXME
================
*/</i>

<a href="qc-types.htm#void">void</a>(<a href="qc-types.htm#float">float</a> side) <b>chainsaw</b><a name="chainsaw">=</a>
{
<b>local</b> <a href="qc-types.htm#vector">vector</a>	delta;
<b>local</b> <a href="qc-types.htm#float">float</a> 	ldmg;

	<b>if</b> (!<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_enemy">enemy</a>)
		<b>return</b>;
	<b>if</b> (!<a href="combat.htm#CanDamage">CanDamage</a> (<a href="qc-glob.htm#self">self</a>.<a href="qc-enty.htm#dot_enemy">enemy</a>, <a href="qc-glob.htm#self">self</a>))
		<b>return</b>;

	<a href="fight.htm#ai_charge">ai_charge</a>(10);

	delta = <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>;

	<b>if</b> (<a href="qc-built.htm#vlen">vlen</a>(delta) &gt; 100)
		<b>return</b>;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -