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

UT2004RPG.RW_Penetrating


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
class RW_Penetrating extends RPGWeapon
    HideDropDown
    CacheExempt;

static function bool AllowedFor(class<Weapon> Weapon, Pawn Other)
{
    local int x;

    for (x = 0; x < NUM_FIRE_MODES; x++)
        if (class<InstantFire>(Weapon.default.FireModeClass[x]) != None)
            return true;

    return false;
}

function SetModifiedWeapon(Weapon w, bool bIdentify)
{
    Super.SetModifiedWeapon(w, bIdentify);

    if (InstantFire(FireMode[0]) != None && InstantFire(FireMode[1]) != None)
        AIRatingBonus *= 1.2;
}

function AdjustTargetDamage(out int Damage, Actor Victim, vector HitLocation, out vector Momentum, class<DamageType> DamageType)
{
    local int i;
    local vector X, Y, Z, StartTrace;

    if (HitLocation == vect(0,0,0))
        return;

    for (i = 0; i < NUM_FIRE_MODES; i++)
        if (InstantFire(FireMode[i]) != None && InstantFire(FireMode[i]).DamageType == DamageType)
        {
            if (!bIdentified)
                Identify();
            //HACK - compensate for shock rifle not firing on crosshair
            if (ShockBeamFire(FireMode[i]) != None && PlayerController(Instigator.Controller) != None)
            {
                StartTrace = Instigator.Location + Instigator.EyePosition();
                GetViewAxes(X,Y,Z);
                StartTrace = StartTrace + X*class'ShockProjFire'.Default.ProjSpawnOffset.X;
                if (!WeaponCentered())
                    StartTrace = StartTrace + Hand * Y*class'ShockProjFire'.Default.ProjSpawnOffset.Y + Z*class'ShockProjFire'.Default.ProjSpawnOffset.Z;
                InstantFire(FireMode[i]).DoTrace(HitLocation + Normal(HitLocation - StartTrace) * Victim.CollisionRadius * 2, rotator(HitLocation - StartTrace));
            }
            else
                InstantFire(FireMode[i]).DoTrace(HitLocation + Normal(HitLocation - (Instigator.Location + Instigator.EyePosition())) * Victim.CollisionRadius * 2, rotator(HitLocation - (Instigator.Location + Instigator.EyePosition())));
            return;
        }
}

defaultproperties
{
    PrefixPos="Penetrating "
    bCanHaveZeroModifier=true
    MaxModifier=0
    ModifierOverlay=Shader'XGameShaders.PlayerShaders.PlayerTrans'
    AIRatingBonus=0.08
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Mon 24/7/2006 19:49:22.000 - Creation time: Wed 7/2/2007 19:16:50.671 - Created with UnCodeX