1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

HeadShot Bonuses

Discussion in 'Ask a Coder' started by [FU2]SpawnKiller, Jan 4, 2004.

  1. [FU2]SpawnKiller

    [FU2]SpawnKiller New Member

    Joined:
    Sep 13, 2003
    Messages:
    26
    Likes Received:
    0
    I am wanting to add some more bonuses to the UT99 Headshot bonus ie Armor, Ut_iviso, etc...

    I am getting a error on compile with the armor i marked it in the code below any help would be greatly apprectiated

    Thanks much

    Code:
    class ArmorBonus expands Mutator;
    
    var bool       Initialized;
    var config int ArmorBonus;
    
    function PostBeginPlay()
    {
    	if (!Initialized)
        {
        	Initialized = True;
        	Level.Game.RegisterDamageMutator(Self); // register ourselves as a damage mutator
        }
    }
    
    function ScoreKill(Pawn Killer, Pawn Other)
    {
        if ((Killer.IsA('Bot') || Killer.IsA('PlayerPawn')) && Other.IsA('PlayerPawn') ) // a player or bot did it... to a player...
        { // why just to a player?  Hint: bots don't zoom... :-)
            if (Other.Weapon.isA('SniperRifle') && PlayerPawn(Other).bZooming) // if the victim was using a sniper rifle and zooming...
            {
                // give them some Armor
                Killer.Armor += ArmorBonus;     // unreconized member armor in class Pawn what should this be?????
                if (Killer.Armor > 200)
                {
                    Killer.Armor = 200;
                }
            }
        }
    
        super.ScoreKill(Killer, Other);
    }
    
    defaultproperties
    {
    ArmorBonus=20
    }
    
     
  2. Parser

    Parser Hello

    Joined:
    May 7, 2002
    Messages:
    1,531
    Likes Received:
    0
    Hmm.. I don't think there is actually a variable for the armour amount in a UT1 pawn.
    Instead, perhaps you could try spawning the armor and giving it to the player?

    How about this?

    Code:
    Spawn(class'Armor2', Killer).GiveTo(Killer);
    Of course you could use a modified armour class to modify the values and so on.. I dunno, I just woke up. :p
     
  3. EvilDrWong

    EvilDrWong Every line of code elevates you

    Joined:
    Jun 16, 2001
    Messages:
    932
    Likes Received:
    0
    yeah, Armor is an inventory class, so youll have to search the player to see if theyve got the armor first, then increase its Charge by however much. (iirc)
     
  4. Parser

    Parser Hello

    Joined:
    May 7, 2002
    Messages:
    1,531
    Likes Received:
    0
    UT2003 is nice and easy, just the AddShieldStrength() command. :p
     

Share This Page