Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

DruidsRPGcvs.ArtifactPoisonBlast


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
class ArtifactPoisonBlast extends RPGArtifact
        config(UT2004RPG);

var config int AdrenalineRequired;
var config int BlastDistance;

var config float ChargeTime;
var config float MaxDrain;
var config float MinDrain;
var config float DrainTime;
var config float DamageRadius;

function BotConsider()
{
    if (Instigator.Controller.Adrenaline < AdrenalineRequired)
        return;

    if (bActive && (Instigator.Controller.Enemy == None || !Instigator.Controller.CanSee(Instigator.Controller.Enemy)))
        Activate();
    else if ( !bActive && Instigator.Controller.Enemy != None
           && Instigator.Controller.CanSee(Instigator.Controller.Enemy) && NoArtifactsActive() && FRand() < 0.5 )
        Activate();
}

function PostBeginPlay()
{
    super.PostBeginPlay();
    disable('Tick');
}

function Activate()
{
    local Vehicle V;
    local Vector FaceDir;
    local Vector BlastLocation;
    local vector HitLocation;
    local vector HitNormal;
    local PoisonBlastCharger PBC;

    if (Instigator != None)
    {
        if(Instigator.Controller.Adrenaline < AdrenalineRequired)
        {
            Instigator.ReceiveLocalizedMessage(MessageClass, AdrenalineRequired, None, None, Class);
            bActive = false;
            GotoState('');
            return;
        }
        
        V = Vehicle(Instigator);
        if (V != None )
        {
            Instigator.ReceiveLocalizedMessage(MessageClass, 3000, None, None, Class);
            bActive = false;
            GotoState('');
            return; // can't use in a vehicle

        }

        // change the guts of it
        FaceDir = Vector(Instigator.Controller.GetViewRotation());
        BlastLocation = Instigator.Location + (FaceDir * BlastDistance);
        if (!FastTrace(Instigator.Location, BlastLocation ))
        {
            // can't get directly to where we want to be. Spawn explosion where we collide.
                Trace(HitLocation, HitNormal, BlastLocation, Instigator.Location, true);
            BlastLocation = HitLocation;
        }

        PBC = Instigator.spawn(class'PoisonBlastCharger', Instigator.Controller,,BlastLocation);
        if(PBC != None)
        {
            PBC.MaxDrain = MaxDrain;
            PBC.MinDrain = MinDrain;
            PBC.DamageRadius = DamageRadius;
            PBC.ChargeTime = ChargeTime;
            PBC.DrainTime = DrainTime;

            Instigator.Controller.Adrenaline -= AdrenalineRequired;
            if (Instigator.Controller.Adrenaline < 0)
                Instigator.Controller.Adrenaline = 0;
        }

    }
}

exec function TossArtifact()
{
    //do nothing. This artifact cant be thrown
}

function DropFrom(vector StartLocation)
{
    if (bActive)
        GotoState('');
    bActive = false;

    Destroy();
    Instigator.NextItem();
}

static function string GetLocalString(optional int Switch, optional PlayerReplicationInfo RelatedPRI_1, optional PlayerReplicationInfo RelatedPRI_2)
{
    if (Switch == 3000)
        return "Cannot use this artifact inside a vehicle";
    else
        return switch @ "Adrenaline is required to use this artifact";
}

defaultproperties
{
     CostPerSec=1
     MinActivationTime=0.000001
     PickupClass=Class'ArtifactPoisonBlastPickup'
     IconMaterial=Texture'XEffects.Skins.MuzFlashLink_t'    
     ItemName="PoisonBlast"
     AdrenalineRequired=200
     BlastDistance=1500

     MaxDrain=30.000000
     MinDrain=15.000000
     DamageRadius=2200.000000
     DrainTime=5.0
     ChargeTime=2.0
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Sat 30/9/2006 20:30:50.000 - Creation time: Wed 7/2/2007 19:16:33.734 - Created with UnCodeX