Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void() BFG_Expl =
- {
- local vector org;
- local entity head;
- local float damage;
- local entity bfgexpl;
- self.movetype = MOVETYPE_NONE;
- self.velocity = '0 0 0';
- self.touch = SUB_Null;
- setmodel (self, "progs/bfgexpl.spr");
- self.solid = SOLID_NOT;
- bfgexpl1 ();
- //the bfg blast fires deadlier lightning bolts to nearby enemies, comes from BFG orb on impact
- org = self.origin + '0 0 16';
- head = findradius(self.origin, 300);
- while (head)
- {
- if (head.takedamage)
- {
- if(head != self) // if the entity (head) is you (self), skip
- {
- WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
- WriteByte (MSG_BROADCAST, TE_LIGHTNING2);
- WriteEntity (MSG_BROADCAST, head); // Start position for lightning
- WriteCoord (MSG_BROADCAST, org_x); // Your position
- WriteCoord (MSG_BROADCAST, org_y);
- WriteCoord (MSG_BROADCAST, org_z);
- WriteCoord (MSG_BROADCAST, head.origin_x); // entity's position
- WriteCoord (MSG_BROADCAST, head.origin_y);
- WriteCoord (MSG_BROADCAST, head.origin_z);
- damage = 150;
- T_Damage (head, self, self.owner, damage);
- BFG_Blast(head.origin);
- }
- }
- head = head.chain; // cycle to next head (entity)
- }
- };
- void() BFG_Touch =
- {
- local float rand;
- if (other == self.owner)
- return;
- if (other.solid == SOLID_TRIGGER)
- return; // trigger field, do nothing
- if (pointcontents(self.origin) == CONTENT_SKY)
- {
- remove(self);
- return;
- }
- // hit something that bleeds
- if (other.takedamage)
- {
- if (other.health < 265)
- {
- spawn_touchblood (32);
- T_Damage (other, self, self.owner, 300); //most monsters would gib on impact, so it will keep going. If the body's still in one piece when dying, the orb should explode as they're solid.
- }
- else
- {
- spawn_touchblood (32);
- WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
- WriteByte (MSG_BROADCAST, TE_EXPLOSION2);
- WriteCoord (MSG_BROADCAST, self.origin_x);
- WriteCoord (MSG_BROADCAST, self.origin_y);
- WriteCoord (MSG_BROADCAST, self.origin_z);
- WriteByte (MSG_BROADCAST, 246);
- WriteByte (MSG_BROADCAST, 1);
- sound (self, CHAN_WEAPON, "weapons/bfgexp.wav", 1, ATTN_NORM);
- T_Damage (other, self, self.owner, 300);
- BFG_Expl();
- remove(self);
- }
- }
- else
- {
- WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
- WriteByte (MSG_BROADCAST, TE_EXPLOSION2);
- WriteCoord (MSG_BROADCAST, self.origin_x);
- WriteCoord (MSG_BROADCAST, self.origin_y);
- WriteCoord (MSG_BROADCAST, self.origin_z);
- WriteByte (MSG_BROADCAST, 246);
- WriteByte (MSG_BROADCAST, 1);
- sound (self, CHAN_WEAPON, "weapons/bfgexp.wav", 1, ATTN_NORM);
- BFG_Expl();
- remove(self);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment