Announcement

Collapse
No announcement yet.

Max Hp + reducer mutator help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Max Hp + reducer mutator help

    i am doing a simple mutator that decreases your life every second, but also increases your max health limits over the default 199.

    however when i load the code, the max health limits increases, but the hp doesnt go down.
    when we run the mutator without the max health function the timer reduces health perfectly.
    here is my code
    Code:
    
    // BloodLust:
    
    class MutBloodLust extends Mutator;
    
    #exec OBJ LOAD File=MutatorArt.utx
    //timer code
    var() float RegenPerSecond;
    
    // Don't call Actor PreBeginPlay() for Mutator
    event PreBeginPlay()
    {
        SetTimer(1.0,true);
    }
    
    function Timer()
    {
        local Controller C;
    
        for (C = Level.ControllerList; C != None; C = C.NextController)
        {
    		if (C.Pawn != None && C.Pawn.Health > 1 )
            {
                C.Pawn.Health = Min( C.Pawn.Health+RegenPerSecond, C.Pawn.HealthMax );
            }
        }
    }
    ////////////////////////////////////////////////////////////////////////////////////
    
    function ModifyPlayer( Pawn P )           //here is the max hp code
    { 
    Super.ModifyPlayer(P); 
    P.SuperHealthMax=600; 
    P.HealthMax=600; // for normal health packs 
    P.Health=200; // start with 200 health 
    } 
    
    ///////////////////////////////////////////////////////////
    
    defaultproperties
    {
         RegenPerSecond=-1.0000
         GroupName="MutBloodLust"
         FriendlyName="Blood Lust"
         Description="Quench your thirst before your thirst quenches you (MPC Productions)."
         bAlwaysRelevant=true
         RemoteRole=ROLE_SimulatedProxy
    }
    FIXED
Working...
X