Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation
previous class next class | frames no frames

# tmod.tmodProjectileBlaster

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

    class tmodProjectileBlaster extends EquipmentClasses.ProjectileBlaster config(tribesmodSettings);

    //projectile
    var bool bShouldBounce;
    var config float bounceTime "The amount of time for which a projectile is allowed to bounce";
    var config int maxBounces;
    var config float damageAmt;
    //weapon
    var config float BlasterSpread;
    var config int BlasterBulletAmount;
    var config float BlasterRoundsPerSecond;
    var config float BlasterEnergyUsage;
    var config float BlasterVelocity;
    var config float BlasterPIVF;

    //const AI_FRIENDLY_FIRE_MULTIPLIER = 0.2;

    simulated function PostNetBeginPlay()
    {
        Super.PostNetBeginPlay();

        SetTimer(bounceTime, false); // blaster projectiles can only bounce over a short range
    }

    function PostBeginPlay()
    {
        SaveConfig();
    }

    simulated function Timer()
    {
        bShouldBounce = false;
    }

    simulated function HitWall(vector HitNormal, actor Wall)
    {
        if (bShouldBounce && bounceCount < maxBounces)
        {
            bounce(HitNormal, Location, Vect(0.0, 0.0, 0.0));
            TriggerEffectEvent('Bounce');

            if (Level.NetMode == NM_Client)
                Destroy();
        }
        else
        {
            endLife(None, Location, HitNormal);
        }
    }

    simulated function ProjectileHit(Actor Other, vector TouchLocation, vector TouchNormal)
    {
        local Rook rookOther;

        if (Level.NetMode == NM_StandAlone && Instigator != None && Instigator.Controller != None && !Instigator.Controller.bIsPlayer)
        {
            rookOther = Rook(Other);

            if (rookOther != None && rookOther.isFriendly(Rook(Instigator)))
                damageAmt *= AI_FRIENDLY_FIRE_MULTIPLIER;
        }

        super.ProjectileHit(Other, TouchLocation, TouchNormal);
    }

    /**
     * Unregistered hit fix. From NRBgone.
    */
    function ProjectileTouch(Actor Other, vector TouchLocation, vector TouchNormal){
        super.ProjectileTouch(Other, TouchLocation, TouchNormal);
    }

    defaultproperties
    {
         bShouldBounce=True
         bounceTime=0.500000
         maxBounces=2
         damageAmt=7.000000
         bScaleProjectile=True
         initialXDrawScale=0.050000
         xDrawScalePerSecond=10.000000
         Knockback=15000.000000
         DrawScale3D=(X=0.300000,Y=0.300000,Z=0.300000)

         BlasterSpread=2.200000
         BlasterBulletAmount=7
         BlasterRoundsPerSecond=1.200000
         BlasterEnergyUsage=1.500000
         BlasterVelocity=18000.000000
         BlasterPIVF=0.000000
    }

Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation
previous class next class | frames no frames

Class file time: po 8.1.2018 22:01:56.000 - Creation time: st 23.5.2018 00:10:47.847 - Created with UnCodeX