Always snap to grid

Legacy:Stat Points System/Damage Modifier

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search

This is the damage modifying script for the Stat Mut

If you have followed this tutorial in order, go back to the file SPSMinigunFire you created earlier. Add this line of code:

function ModeTick(float dt)
    {
    	if (StatPoints > 0)
    		DamageMin = default.DamageMin + (StatPoints / 5)
    		DamageMax = default.DamageMax + (StatPoints / 5)
    	else
    		DamageMin = default.DamageMin
    		DamageMax = default.DamageMax
    }

So that this:

simulated function PostBeginPlay()
{
    Super.PostBeginPlay();
    FireRate = 1.f / (RoundsPerRotation * BarrelRotationsPerSec);
    MaxRollSpeed = 65536.f*BarrelRotationsPerSec;
    Gun = Minigun(Owner);
    function ModeTick(float dt)
    {
        if (StatPoints > 0)
        {        
                NewFireRate = FireRate + (StatPoints / 5);
        else
                FireRate = 1.f / (RoundsPerRotation * BarrelRotationsPerSec);
	}
    }
}

Will look like this:

simulated function PostBeginPlay()
{
    Super.PostBeginPlay();
    FireRate = 1.f / (RoundsPerRotation * BarrelRotationsPerSec);
    MaxRollSpeed = 65536.f*BarrelRotationsPerSec;
    Gun = Minigun(Owner);
    function ModeTick(float dt)
    {
    	if (StatPoints > 0)
    	{
    		DamageMin = default.DamageMin + (StatPoints / 5)
    		DamageMax = default.DamageMax + (StatPoints / 5)
    	else
    		DamageMin = default.DamageMin
    		DamageMax = default.DamageMax
    	}
    	if (StatPoints > 0)
        {        
                NewFireRate = FireRate + (StatPoints / 5);
        else
                FireRate = 1.f / (RoundsPerRotation * BarrelRotationsPerSec);
	}
    }   
}

For people who havn't done the original Tutorial, go here:

Stat Points System

Any comments or revisions would be helpful.

Comments[edit]

Related Topics[edit]

Stat Points System/Max Health Modifier

UnrealScript Lessons