text
stringlengths 0
774
|
|---|
}
|
// don't do radius damage to the other, because all the damage
|
// was done in the impact
|
T_RadiusDamage (self, self.owner, 120, other);
|
// sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM);
|
self.origin = self.origin - 8*normalize(self.velocity);
|
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
|
WriteByte (MSG_BROADCAST, TE_EXPLOSION);
|
WriteCoord (MSG_BROADCAST, self.origin_x);
|
WriteCoord (MSG_BROADCAST, self.origin_y);
|
WriteCoord (MSG_BROADCAST, self.origin_z);
|
BecomeExplosion ();
|
};
|
//dumptruck_ds start -- from inside qc tut http://www.insideqc.com/qctut/lesson-32.shtml
|
void(float direct, float splash) T_MonsterMisTouch =
|
{
|
local float damg;
|
if (other == self.owner)
|
return; // don't explode on owner
|
if (pointcontents(self.origin) == CONTENT_SKY)
|
{
|
remove(self);
|
return;
|
}
|
damg = direct + random()*2; //dumptruck_ds
|
if (other.health)
|
{
|
if (other.classname == "monster_shambler")
|
damg = damg * 0.5; // mostly immune
|
T_Damage (other, self, self.owner, damg );
|
}
|
// don't do radius damage to the other, because all the damage
|
// was done in the impact
|
T_RadiusDamage (self, self.owner, splash, other); //dumptruck_ds
|
// sound (self, CHAN_WEAPON, "weapons/r_exp3.wav", 1, ATTN_NORM);
|
self.origin = self.origin - 8*normalize(self.velocity);
|
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
|
WriteByte (MSG_BROADCAST, TE_EXPLOSION);
|
WriteCoord (MSG_BROADCAST, self.origin_x);
|
WriteCoord (MSG_BROADCAST, self.origin_y);
|
WriteCoord (MSG_BROADCAST, self.origin_z);
|
BecomeExplosion ();
|
};
|
void() T_GruntMisTouch =
|
{
|
T_MonsterMisTouch(30, 40);
|
};
|
// less direct damage, more splash than grunt
|
// TODO: add damage modifier
|
void() T_HellKnightMisTouch =
|
{
|
T_MonsterMisTouch(20, 50);
|
};
|
// big damage. explody scrag should be beefy.
|
// TODO: add damage modifier
|
void() T_WizardMisTouch =
|
{
|
T_MonsterMisTouch(50, 50);
|
};
|
//dumptruck_ds end"</s>
|
<s>[INST] Could you please write QuakeC code for some fps weapons for my game?[/INST]
|
"But of course! Here's part 5 of the fps weapons QuakeC code, where we handle rocket launcher etc:
|
/*
|
================
|
W_FireRocket
|
================
|
*/
|
void() W_FireRocket =
|
{
|
local entity missile;
|
self.currentammo = self.ammo_rockets = self.ammo_rockets - 1;
|
sound (self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM);
|
self.punchangle_x = -2;
|
missile = spawn ();
|
missile.owner = self;
|
missile.movetype = MOVETYPE_FLYMISSILE;
|
missile.solid = SOLID_BBOX;
|
missile.classname = "missile";
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.