Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function bool checkhaveamp(optional bool eatcharge,optional float eatchargep)
- { // Find ANY amp, that the player owns, and use its charge to increase weapons output..
- // Basicly let any arbritary object become a usable amplifier.
- local pickup p;
- local bool useitup;
- // Make sure we acully have a value higher then 0.0
- //if (eatcharge < 0.1) { eatcharge = 0.1;}
- // could have just check float for zero isstead of using a bool...
- foreach AllActors(class'pickup',p) // Find stuff
- { if (p.owner == playerpawn(owner)) // Stuff this current owner has
- { if (p.IsA('amplifier') || p.IsA('enhAmp')||p.IsA('dzamplifier'))
- { // various amplifiers or any object can be used.
- if (p.charge > 0) // It really dont matter if we are not subtracting
- {
- if (useitup && p.IsInState('activated')) // Only Consume if the player has it active.
- { // it may subtract from all the amp(s) you have ,
- // but the players not expeced to have more then one.
- p.charge=p.charge - eatchargep;
- return true;
- }else{
- return true;
- }
- }
- }
- }
- }
- return false;
- }
- function Fire( float Value )
- {
- GotoState('NormalFire');
- if ( PlayerPawn(Owner) != None )
- PlayerPawn(Owner).ShakeView(ShakeTime, ShakeMag, ShakeVert);
- bPointing=True;
- PlayFiring();
- // if ( !bRapidFire && (FiringSpeed > 0) )
- // {
- // Pawn(Owner).PlayRecoil(FiringSpeed);
- if ( PowerLevel > 0 && powerlevel < 2 )
- {
- pjt = ProjectileFire(class'DispersionAmmo', ProjectileSpeed, bWarnTarget);
- if (pjt != none && checkhaveamp())
- {
- pjt.damage = pjt.Damage + 5;
- pjt.drawscale= 1.8;
- }
- }
- if ( PowerLevel > 1 && powerlevel < 3 )
- {
- pjt= ProjectileFire(class'dammo2', ProjectileSpeed, bWarnTarget);
- if (pjt != none && checkhaveamp())
- {
- pjt.damage = pjt.Damage + 5;
- pjt.drawscale= 1.8;
- }
- }
- if ( PowerLevel > 2 && powerlevel < 4 )
- {
- pjt = ProjectileFire(class'dammo3', ProjectileSpeed, bWarnTarget);
- if (pjt != none && checkhaveamp())
- {
- pjt.damage = pjt.Damage + 5;
- pjt.drawscale= 1.8;
- }
- }
- if ( PowerLevel > 3 && powerlevel < 5 )
- {
- pjt =ProjectileFire(class'dammo4', ProjectileSpeed, bWarnTarget);
- if (pjt != none && checkhaveamp())
- {
- pjt.damage = pjt.Damage + 5;
- pjt.drawscale= 1.8;
- }
- }
- if ( PowerLevel > 4 && powerlevel < 6 )
- {
- pjt = ProjectileFire(class'dammo5', ProjectileSpeed, bWarnTarget);
- if (pjt != none && checkhaveamp())
- {
- pjt.damage = pjt.Damage + 5;
- pjt.drawscale= 1.8;
- }
- }
- //}
- if ( Owner.bHidden )
- CheckVisibility();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement