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

OnslaughtBP.ONSArtillerySideGun


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
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
//-----------------------------------------------------------
//
//-----------------------------------------------------------
class ONSArtillerySideGun extends ONSWeapon;

#exec OBJ LOAD FILE=ONSBPTextures.utx
#exec OBJ LOAD FILE=..\Animations\ONSWeapons-A.ukx

var class<ShockBeamEffect> BeamEffectClass;
var ONSSkyMine ComboTarget;
var float MinAim;

static function StaticPrecache(LevelInfo L)
{
    L.AddPrecacheMaterial(Material'XEffectMat.shock_mark_heat');
    L.AddPrecacheMaterial(Material'XEffectMat.shock_flash');
    L.AddPrecacheMaterial(Material'XEffectMat.purple_line');
    L.AddPrecacheMaterial(Material'XEffectMat.Shock_ring_a');
    L.AddPrecacheMaterial(Material'XWeapons_rc.ShockBeamTex');
    L.AddPrecacheMaterial(Material'XEffects.SaDScorcht');
    L.AddPrecacheMaterial(Material'XEffectMat.Shock.shock_core_low');
    L.AddPrecacheMaterial(Material'XEffectMat.Shock.shock_flare_a');
    L.AddPrecacheMaterial(Material'XEffectMat.Shock.shock_core');
    L.AddPrecacheMaterial(Material'XEffectMat.Shock.shock_Energy_green_faded');
    L.AddPrecacheMaterial(Material'AW-2004Particles.Energy.EclipseCircle');
}

simulated function UpdatePrecacheMaterials()
{
    Level.AddPrecacheMaterial(Material'XEffectMat.shock_mark_heat');
    Level.AddPrecacheMaterial(Material'XEffectMat.shock_flash');
    Level.AddPrecacheMaterial(Material'XEffectMat.purple_line');
    Level.AddPrecacheMaterial(Material'XEffectMat.Shock_ring_a');
    Level.AddPrecacheMaterial(Material'XWeapons_rc.ShockBeamTex');
    Level.AddPrecacheMaterial(Material'XEffects.SaDScorcht');
    Level.AddPrecacheMaterial(Material'XEffectMat.Shock.shock_core_low');
    Level.AddPrecacheMaterial(Material'XEffectMat.Shock.shock_flare_a');
    Level.AddPrecacheMaterial(Material'XEffectMat.Shock.shock_core');
    Level.AddPrecacheMaterial(Material'XEffectMat.Shock.shock_Energy_green_faded');
    Level.AddPrecacheMaterial(Material'AW-2004Particles.Energy.EclipseCircle');

    Super.UpdatePrecacheMaterials();
}

function byte BestMode()
{
    local Bot B;

    if (ComboTarget != None && Vehicle(Instigator).bWeaponIsAltFiring)
    {
        B = Bot(Instigator.Controller);
        if ( (B == None) || (B.Enemy == None) || (B.Enemy != B.Target) || B.EnemyVisible() ) 
            return 1;
        return 0;
    }
    else
        return 0;
}

function rotator AdjustAim(bool bAltFire)
{
    if (bAltFire && ComboTarget != None)
        return rotator(ComboTarget.Location - WeaponFireLocation);

    return Super.AdjustAim(bAltFire);
}

function SpawnBeamEffect(Vector Start, Rotator Dir, Vector HitLocation, Vector HitNormal, int ReflectNum)
{
    local ShockBeamEffect Beam;

    Beam = Spawn(BeamEffectClass,,, Start, Dir);
    Beam.Instigator = None; // prevents client side repositioning of beam start
    Beam.AimAt(HitLocation, HitNormal);
}

function SetComboTarget(ONSSkyMine S)
{
    if (Bot(Instigator.Controller) == None || Instigator.Controller.Enemy == None)
        return;

    ComboTarget = S;
    ComboTarget.Monitor(Bot(Instigator.Controller).Enemy);
}

function DoCombo()
{
    if (Vehicle(Instigator) != None && Instigator.Controller != None)
    {
        Instigator.StopWeaponFiring();
        Vehicle(Instigator).bWeaponIsAltFiring = true;
    }
}

state InstantFireMode
{
    simulated function ClientSpawnHitEffects()
    {
    }

    function SpawnHitEffects(Actor HitActor, vector HitLocation, vector HitNormal)
    {
    }

    function AltFire(Controller C)
    {
        local float CurAim, BestAim;
        local int x;
        local Projectile BestMine;

        ShakeView();
        FlashMuzzleFlash();

        if (AmbientEffectEmitter != None)
        {
            AmbientEffectEmitter.SetEmitterStatus(true);
        }

        // Play firing noise
        PlayOwnedSound(AltFireSoundClass, SLOT_None, AltFireSoundVolume/255.0,, AltFireSoundRadius,, False);

    //aiming help for hitting skymines
    BestAim = MinAim;
    for (x = 0; x < Projectiles.length; x++)
    {
        if (Projectiles[x] == None)
        {
            Projectiles.Remove(x, 1);
            x--;
        }
        else
        {
            CurAim = Normal(Projectiles[x].Location - WeaponFireLocation) dot vector(WeaponFireRotation);
            if (CurAim > BestAim)
            {
                BestMine = Projectiles[x];
                BestAim = CurAim;
            }
        }
    }
    if (BestMine != None)
        TraceFire(WeaponFireLocation, rotator(BestMine.Location - WeaponFireLocation));
    else
            TraceFire(WeaponFireLocation, WeaponFireRotation);
    }

    function Fire(Controller C)
    {
        local ONSSkyMine S;

        S = ONSSkyMine(SpawnProjectile(ProjectileClass, False));
        if (S != None && Bot(Instigator.Controller) != None )
            SetComboTarget(S);
    }
}

defaultproperties
{
     BeamEffectClass=Class'XWeapons.ShockBeamEffect'
     MinAim=0.925000
     YawBone="PassengerGunBase"
     PitchBone="PassengerGunBarrel"
     PitchUpLimit=8000
     PitchDownLimit=62500
     WeaponFireAttachmentBone="SideGunFirePointf"
     GunnerAttachmentBone="SideGunAttach"
     bInstantRotation=True
     bInstantFire=True
     bDoOffsetTrace=True
     RedSkin=Texture'ONSBPTextures.Skins.SPMATan'
     BlueSkin=Texture'ONSBPTextures.Skins.SPMAGreen'
     FireInterval=0.400000
     AltFireInterval=0.750000
     FlashEmitterClass=Class'Onslaught.ONSPRVSideGunMuzzleFlash'
     FireSoundClass=Sound'ONSVehicleSounds-S.PRV.PRVFire01'
     AltFireSoundClass=Sound'ONSVehicleSounds-S.PRV.PRVFire02'
     FireForce="PRVSideFire"
     AltFireForce="PRVSideAltFire"
     DamageType=Class'Onslaught.DamTypePRVLaser'
     DamageMin=25
     DamageMax=25
     ProjectileClass=Class'Onslaught.ONSSkyMine'
     ShakeRotMag=(X=60.000000,Y=20.000000)
     ShakeRotRate=(X=1000.000000,Y=1000.000000)
     ShakeRotTime=2.000000
     AIInfo(0)=(bLeadTarget=True,WarnTargetPct=0.200000,RefireRate=1.000000)
     AIInfo(1)=(bInstantHit=True,RefireRate=0.000000)
     CullDistance=3000.000000
     Mesh=SkeletalMesh'ONSBPAnimations.ArtillerySideGunMesh'
     DrawScale=0.800000
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Wed 7/2/2007 19:12:36.000 - Creation time: Wed 7/2/2007 19:16:45.750 - Created with UnCodeX