Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ==============================================================================
- BFG
- ==============================================================================
- */
- void() bfgshot1 = [0, bfgshot2] {self.nextthink = time + 0.05;};
- void() bfgshot2 = [1, bfgshot1] {self.nextthink = time + 0.05;};
- void() bfg_ball_think =
- {
- //continuous lightning bolt targetting nearby ennemies from BFG orb
- local vector org;
- //local float cells,damage=0;
- local entity head;
- org = self.origin + '0 0 16';
- head = findradius(self.origin, 250); // finds all entitys within 250 (2.5 meters?)
- 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);
- sound (head, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM);
- damage = 40; //40 + random()*20
- T_Damage (head, self, self.owner, damage);
- }
- }
- //head = head.chain; // cycle to next head (entity)
- }
- }
- void(vector org, vector vec) BFGShot =
- {
- local vector vec;
- local entity bfgsphere;
- vec = normalize(vec);
- bfgsphere = spawn();
- bfgsphere.owner = self;
- bfgsphere.movetype = MOVETYPE_FLY;
- bfgsphere.solid = SOLID_BBOX;
- bfgsphere.effects = EF_DIMLIGHT;
- setmodel (bfgsphere, "progs/bfgshot.spr");
- setsize (bfgsphere, '0 0 0', '0 0 0');
- bfgsphere.think = bfgshot1;
- setorigin (bfgsphere, org);
- bfgsphere.velocity = vec * 800; //600
- bfgsphere.angles = vectoangles(bfgsphere.velocity);
- bfgsphere.nextthink = time + 0.1;
- bfgsphere.think = bfgshot1;
- self.nextthink = time + 0.1; //how often lightning strikes, 0.3 original value
- self.think = bfg_ball_think; //keep repeating
- bfgsphere.nextthink = time + 5;
- bfgsphere.think = SUB_Remove
- bfgsphere.touch = BFG_Touch;
- };
- 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)
- {
- 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
- {
- BFG_Expl();
- remove(self);
- }
- };
- void() bfg_fire =
- {
- local vector org;
- self.effects = self.effects | EF_MUZZLEFLASH;
- makevectors (self.angles);
- org = self.origin + v_forward * 30 + v_right * 8.5 + '0 0 16';
- sound (head, CHAN_WEAPON, "weapons/bfgfire1.wav", 1, ATTN_NORM);
- BFGShot(org, self.enemy.origin - self.origin);
- };
- void() bfgexpl1 = [0, bfgexpl2] {self.nextthink = time + 0.05;};
- void() bfgexpl2 = [1, bfgexpl3] {self.nextthink = time + 0.05;};
- void() bfgexpl3 = [2, bfgexpl4] {self.nextthink = time + 0.05;};
- void() bfgexpl4 = [3, bfgexpl5] {self.nextthink = time + 0.05;};
- void() bfgexpl5 = [4, SUB_Remove] {self.nextthink = time + 0.05;};
- void() bfgblast1 = [0, bfgblast2] {self.nextthink = time + 0.05;};
- void() bfgblast2 = [1, bfgblast3] {self.nextthink = time + 0.05;};
- void() bfgblast3 = [2, bfgblast4] {self.nextthink = time + 0.05;};
- void() bfgblast4 = [3, bfgblast5] {self.nextthink = time + 0.05;};
- void() bfgblast5 = [4, SUB_Remove] {self.nextthink = time + 0.05;};
- void() BFG_Expl =
- {
- local vector org;
- local entity head;
- 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 = 100;
- T_Damage (head, self, self.owner, damage);
- }
- }
- head = head.chain; // cycle to next head (entity)
- }
- };
- void() BFG_Blast =
- {
- local vector org;
- local entity head;
- self.movetype = MOVETYPE_NONE;
- self.velocity = '0 0 0';
- self.touch = SUB_Null;
- setmodel (self, "progs/bfgblast.spr");
- self.solid = SOLID_NOT;
- bfgexpl1 ();
- sound (head, CHAN_WEAPON, "weapons/bfgblast.wav", 1, ATTN_NORM);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement