I am trying to randomly set the amount of points a pill gives you to a negative amount. Here is the code:
This refuses to change the AdrenalineAmount! I have tried doing it like this:
Still, no effect. I tried changing the pickup message, and this is the only one that worked:
However, this changes the pickup message for ALL pills in the level.
Anyone know what I am doing wrong?
Code:
var() float chanceOfDowner;
function bool CheckReplacement(Actor Other, out byte bSuperRelevant)
{
local AdrenalinePickup P;
if( AdrenalinePickup(Other)!=NONE )
{
if( FRand() <= chanceOfDowner )
P = AdrenalinePickup(Other);
P.AdrenalineAmount = - P.AdrenalineAmount; //invert adrenaline amount
}
return false; //don't replace
}
defaultproperties
{
chanceOfDowner = 0.5;
}
This refuses to change the AdrenalineAmount! I have tried doing it like this:
Code:
P.default.AdrenalineAmount = - P.default.AdrenalineAmount;
Still, no effect. I tried changing the pickup message, and this is the only one that worked:
Code:
P.default.PickupMessage = "Downer ";
However, this changes the pickup message for ALL pills in the level.
Anyone know what I am doing wrong?