This has been Bugging me...
Moderator: InsideQC Admins
5 posts
• Page 1 of 1
This has been Bugging me...
Well From redrums Charge code, I made it suitable for Prime. But I was wondering, if The velocity returns when self.charge returns to 0.
Look
/*
================
Blaster Firing
================
*/
Should I have a seperate code that Givees another entity the same charge as the player? Like it passes the charge level of the player onto the entity, and When the entity gets removed, then entity.charge = 0?
Like once self.charge = 0;, Does the velocity return to else or does it stay the same all the time? I am just wondering. Don't know if you quite understand my question. This is just a quick question, and I will delete this thread once it's answered.
Look
/*
================
Blaster Firing
================
*/
- Code: Select all
void() W_FireBlaster =
{
local entity plasma;
blaster_flash();
self.currentammo = self.ammo_blaster = self.ammo_blaster - 0;
sound (self, CHAN_AUTO, "weapons/guncock.wav", 1, ATTN_NORM);
self.punchangle_x = -2;
plasma = spawn ();
plasma.owner = self;
plasma.movetype = MOVETYPE_FLYMISSILE;
plasma.solid = SOLID_BBOX;
plasma.classname = "missile";
// Set the speed of the Plasma
makevectors (self.v_angle);
plasma.velocity = aim(self, 1000);
if (self.charge >= 10) // Sets the Velocity for When charging the Blaster
if (self.charge < 20)
plasma.velocity = plasma.velocity * 4200;
if (self.charge >= 20)
if (self.charge < 30)
plasma.velocity = plasma.velocity * 3700;
if (self.charge >= 30)
if (self.charge < 40)
plasma.velocity = plasma.velocity * 3400;
if (self.charge >= 40)
if (self.charge < 50)
plasma.velocity = plasma.velocity * 3100;
if (self.charge >= 50)
if (self.charge < 60)
plasma.velocity = plasma.velocity * 2800;
if (self.charge >= 60)
if (self.charge < 70)
plasma.velocity = plasma.velocity * 2500;
if (self.charge >= 70)
plasma.velocity = plasma.velocity * 2000;
else
plasma.velocity = plasma.velocity * 4500;
plasma.angles = vectoangles(plasma.velocity);
if (self.charge >= 10) // Sets the Different Damages
if (self.charge < 20)
plasma.touch = BlasterTouch1;
if (self.charge >= 40)
if (self.charge < 50)
plasma.touch = BlasterTouch2;
if (self.charge >= 70)
plasma.touch = BlasterTouch3;
else
plasma.touch = BlasterTouch;
setmodel (plasma, "progs/blast.spr");
if (self.charge >= 50 || self.charge >= 70)
plasma.frame = 0;
else
plasma.frame = 2;
setsize (plasma, '0 0 0', '0 0 0');
setorigin (plasma, self.origin + v_forward*10 + '0 0 16');
// set missile duration
plasma.nextthink = time + 5;
plasma.think = SUB_Remove;
self.charge = 0;
};
Should I have a seperate code that Givees another entity the same charge as the player? Like it passes the charge level of the player onto the entity, and When the entity gets removed, then entity.charge = 0?
Like once self.charge = 0;, Does the velocity return to else or does it stay the same all the time? I am just wondering. Don't know if you quite understand my question. This is just a quick question, and I will delete this thread once it's answered.
-

Mexicouger - Posts: 514
- Joined: Sat May 01, 2010 10:12 pm
Your current code is always going to set the plasma.velocity to plasma.velocity * 4500 unless self.charge is more than 70.
You need to rewrite it like this:
You need to rewrite it like this:
- Code: Select all
if(self.charge >= 70)
plasma.velocity = plasma.velocity * 2000;
else if (self.charge >= 60)
plasma.velocity = plasma.velocity * 2500;
else if (self.charge >= 50)
plasma.velocity = plasma.velocity * 2800;
else if (self.charge >= 40)
plasma.velocity = plasma.velocity * 3100;
else if (self.charge >= 30)
plasma.velocity = plasma.velocity * 3400;
else if (self.charge >= 20)
plasma.velocity = plasma.velocity * 3700;
else if (self.charge >= 10)
plasma.velocity = plasma.velocity * 4200;
else
plasma.velocity = plasma.velocity * 4500;
- Code: Select all
if (self.charge >= 70)
plasma.touch = BlasterTouch3;
else if (self.charge >= 40 && self.charge < 50)
plasma.touch = BlasterTouch2;
else if (self.charge >= 10 && self.charge < 20)
plasma.touch = BlasterTouch1;
else
Plasma.touch = BlasterTouch;

-

DukeInstinct - Posts: 20
- Joined: Sat Jul 10, 2010 11:20 pm
- Location: DukeLand
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
