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

UnrealI.Minigun


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
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
//=============================================================================
// Minigun.
//=============================================================================
class Minigun expands Weapon;

#exec AUDIO IMPORT FILE="..\UnrealShare\Sounds\General\Bulletr2.WAV" NAME="Bulletr2"  GROUP="General"

#exec MESH IMPORT MESH=minigunM ANIVFILE=MODELS\smini_a.3D DATAFILE=MODELS\smini_d.3D X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=minigunM X=0 Y=0 Z=0 YAW=64 PITCH=-7 ROLL=-62 
#exec MESH SEQUENCE MESH=minigunM SEQ=All     STARTFRAME=0  NUMFRAMES=119
#exec MESH SEQUENCE MESH=minigunM SEQ=Select  STARTFRAME=0  NUMFRAMES=23 RATE=34 GROUP=Select
#exec MESH SEQUENCE MESH=minigunM SEQ=Still   STARTFRAME=23  NUMFRAMES=1
#exec MESH SEQUENCE MESH=minigunM SEQ=Fire    STARTFRAME=24  NUMFRAMES=30
#exec MESH SEQUENCE MESH=minigunM SEQ=Wind    STARTFRAME=24  NUMFRAMES=15
#exec MESH SEQUENCE MESH=minigunM SEQ=Shoot1  STARTFRAME=39  NUMFRAMES=15
#exec MESH SEQUENCE MESH=minigunM SEQ=Shoot2  STARTFRAME=54  NUMFRAMES=20
#exec MESH SEQUENCE MESH=minigunM SEQ=Unwind  STARTFRAME=74  NUMFRAMES=15
#exec MESH SEQUENCE MESH=minigunM SEQ=Cock    STARTFRAME=89  NUMFRAMES=20
#exec MESH SEQUENCE MESH=minigunM SEQ=Down    STARTFRAME=109 NUMFRAMES=10
#exec TEXTURE IMPORT NAME=minigun1 FILE=MODELS\smini.PCX GROUP="Skins" 
#exec OBJ LOAD FILE=..\UnrealShare\Textures\fireeffect13.utx PACKAGE=UNREALI.Effect13
#exec MESHMAP SCALE MESHMAP=minigunM X=0.0055 Y=0.0055 Z=0.011
#exec MESHMAP SETTEXTURE MESHMAP=minigunM NUM=1 TEXTURE=minigun1
#exec MESHMAP SETTEXTURE MESHMAP=minigunM NUM=0 TEXTURE=Unreali.Effect13.FireEffect13

#exec MESH IMPORT MESH=minipick ANIVFILE=MODELS\minipi_a.3D DATAFILE=MODELS\minipi_d.3D X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=minipick X=0 Y=-100 Z=-40 YAW=64 PITCH=0 ROLL=0
#exec MESH SEQUENCE MESH=minipick SEQ=All     STARTFRAME=0  NUMFRAMES=1
#exec TEXTURE IMPORT NAME=minigun1 FILE=MODELS\smini.PCX GROUP="Skins" 
#exec MESHMAP SCALE MESHMAP=minipick X=0.04 Y=0.04 Z=0.08
#exec MESHMAP SETTEXTURE MESHMAP=minipick NUM=1 TEXTURE=minigun1

#exec MESH IMPORT MESH=SMini3 ANIVFILE=MODELS\Smini3_a.3D DATAFILE=MODELS\smini3_d.3D X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=SMini3 X=0 Y=60 Z=0 YAW=64 ROLL=-7
#exec MESH SEQUENCE MESH=SMini3 SEQ=All STARTFRAME=0  NUMFRAMES=11
#exec MESH SEQUENCE MESH=SMini3 SEQ=Fire STARTFRAME=0  NUMFRAMES=10 RATE=20.0
#exec MESH SEQUENCE MESH=SMini3 SEQ=Shoot1  STARTFRAME=0  NUMFRAMES=10 RATE=20.0
#exec MESH SEQUENCE MESH=SMini3 SEQ=Shoot2  STARTFRAME=0  NUMFRAMES=10 RATE=20.0
#exec MESH SEQUENCE MESH=SMini3 SEQ=Still STARTFRAME=10  NUMFRAMES=1
#exec MESH SEQUENCE MESH=SMini3 SEQ=Select STARTFRAME=10  NUMFRAMES=1
#exec MESH SEQUENCE MESH=SMini3 SEQ=Wind STARTFRAME=10  NUMFRAMES=1
#exec MESH SEQUENCE MESH=SMini3 SEQ=UnWind STARTFRAME=10  NUMFRAMES=1
#exec MESH SEQUENCE MESH=SMini3 SEQ=Cock STARTFRAME=10  NUMFRAMES=1
#exec MESH SEQUENCE MESH=SMini3 SEQ=Down STARTFRAME=10  NUMFRAMES=1
#exec TEXTURE IMPORT NAME=minigun1 FILE=MODELS\smini.PCX GROUP="Skins"
#exec OBJ LOAD FILE=..\UnrealShare\textures\FireEffect18.utx PACKAGE=UNREALShare.Effect18
#exec MESHMAP SCALE MESHMAP=SMini3 X=0.30 Y=0.30 Z=0.6
#exec MESHMAP SETTEXTURE MESHMAP=SMini3 NUM=1 TEXTURE=minigun1
#exec MESHMAP SETTEXTURE MESHMAP=SMini3 NUM=0 TEXTURE=UnrealShare.Effect18.FireEffect18

#exec AUDIO IMPORT FILE="Sounds\minigun\MPickup2.WAV" NAME="MiniSelect" GROUP="Minigun"
#exec AUDIO IMPORT FILE="Sounds\minigun\RegF1.WAV" NAME="RegF1" GROUP="Minigun"
#exec AUDIO IMPORT FILE="Sounds\minigun\WindD2.WAV" NAME="WindD2" GROUP="Minigun"
#exec AUDIO IMPORT FILE="Sounds\minigun\AltF1.WAV" NAME="AltF1" GROUP="Minigun"

var float ShotAccuracy, Count;
var bool bOutOfAmmo, bFiredShot;
var OverHeatLight s;

function GenerateBullet()
{
    bFiredShot = true;
    if ( AmmoType.UseAmmo(1) ) 
        TraceFire(ShotAccuracy);
    else
        GotoState('FinishFire');
}

function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
{
    local int rndDam;

    if ( PlayerPawn(Owner) != None )
        PlayerPawn(Owner).ShakeView(ShakeTime, ShakeMag, ShakeVert);
    
    spawn(class'WeaponLight',self,,Owner.Location+CalcDrawOffset()+X*25+Z*15,rot(0,0,0));
    if (Other == Level) 
        Spawn(class'LightWallHitEffect',,, HitLocation+HitNormal*9, Rotator(HitNormal));
    else if ( (Other!=self) && (Other!=Owner) && (Other != None) ) 
    {
        if ( !Other.IsA('Pawn') && !Other.IsA('Carcass') )
            spawn(class'SpriteSmokePuff',,,HitLocation+HitNormal*9);
        if ( Other.IsA('ScriptedPawn') && (FRand() < 0.2) )
            Pawn(Other).WarnTarget(Pawn(Owner), 500, X);
        rndDam = 8 + Rand(6);
        if ( FRand() < 0.2 )
            X *= 2;
        Other.TakeDamage(rndDam, Pawn(Owner), HitLocation, rndDam*500.0*X, 'shot');
    }
}

function Fire( float Value )
{
    Enable('Tick');
    if ( (Count<1) && AmmoType.UseAmmo(1) )
    {
        CheckVisibility();
        if ( PlayerPawn(Owner) != None )
            PlayerPawn(Owner).ShakeView(ShakeTime, ShakeMag, ShakeVert);
        AmbientSound = FireSound;
        SoundVolume = 255*Pawn(Owner).SoundDampening;
        bPointing=True;
        ShotAccuracy = 0.1;
        PlayFiring();
        GotoState('NormalFire');
    }
    else GoToState('Idle');
}

function AltFire( float Value )
{
    Enable('Tick');
    if ( (Count<1) && AmmoType.UseAmmo(1) )
    {
        CheckVisibility();
        bPointing=True;
        ShotAccuracy = 0.8;
        AmbientSound = FireSound;
        SoundVolume = 255*Pawn(Owner).SoundDampening;       
        PlayAltFiring();    
        GoToState('AltFiring');     
    }
    else GoToState('Idle'); 
}


function PlayFiring()
{   
    LoopAnim('Shoot1',0.8, 0.05);
}

function PlayAltFiring()
{
    PlayAnim('Shoot1',0.8, 0.05);
}

////////////////////////////////////////////////////////
state FinishFire
{
    function Fire(float F) {}
    function AltFire(float F) {}

Begin:
    PlayAnim('UnWind',0.8, 0.05);
    FinishAnim();
    Finish();
}

///////////////////////////////////////////////////////
state NormalFire
{
    function Tick( float DeltaTime )
    {
        if (Owner==None) 
            AmbientSound = None;            
    }

    function AnimEnd()
    {
        if (Pawn(Owner).Weapon != self) GotoState('');
        else if (Pawn(Owner).bFire!=0 && AmmoType.AmmoAmount>0)
        {
            if ( (PlayerPawn(Owner) != None) || (FRand() < ReFireRate) )
                Global.Fire(0);
            else 
            {
                Pawn(Owner).bFire = 0;
                GotoState('FinishFire');
            }
        }
        else if ( Pawn(Owner).bAltFire!=0 && AmmoType.AmmoAmount>0)
            Global.AltFire(0);
        else 
            GotoState('FinishFire');
    }

    function EndState()
    {
        local float Damping;

        if ( Pawn(Owner) == None )
            Damping = 1;
        else
            Damping = Pawn(Owner).SoundDampening;

        AmbientSound = None;
        PlaySound(Misc1Sound, SLOT_Misc, 3.0*Damping);  //Finish firing, power down	
        Super.EndState();
    }

Begin:
    SetLocation(Owner.Location);
    Sleep(0.13);
    GenerateBullet();
    Goto('Begin');
}

////////////////////////////////////////////////////////
state AltFiring
{
    function Tick( float DeltaTime )
    {
        if (Owner==None) 
        {
            AmbientSound = None;
            GotoState('Pickup');
        }           
        if ( (PlayerPawn(Owner) == None) && bFiredShot && (FRand() < DeltaTime/AltReFireRate) )
            Pawn(Owner).bAltFire = 0; 
        if  ( bFiredShot && ((pawn(Owner).bAltFire==0) || bOutOfAmmo) ) 
            GoToState('FinishFire');
    }

    function AnimEnd()
    {
        if ( (AnimSequence != 'Shoot2') || !bAnimLoop )
        {   
            AmbientSound = AltFireSound;
            SoundVolume = 255*Pawn(Owner).SoundDampening;
            LoopAnim('Shoot2',0.8);
        }
    }

    function EndState()
    {
        local float Damping;

        if ( Pawn(Owner) == None )
            Damping = 1;
        else
            Damping = Pawn(Owner).SoundDampening;

        AmbientSound = None;
        PlaySound(Misc1Sound, SLOT_Misc, 3.0*Damping);  //Finish firing, power down	
        Super.EndState();
    }

    function BeginState()
    {
        Super.BeginState();
        bFiredShot = false;
    }

Begin:
    SetLocation(Owner.Location);
    Sleep(0.13);
    GenerateBullet();
    if ( AnimSequence == 'Shoot2' )
        Goto('FastShoot');
    Goto('Begin');
FastShoot:
    Sleep(0.07);
    GenerateBullet();
    Goto('FastShoot');
}



///////////////////////////////////////////////////////////
state Idle
{


Begin:
    if (Pawn(Owner).bFire!=0 && AmmoType.AmmoAmount>0) Fire(0.0);
    if (Pawn(Owner).bAltFire!=0 && AmmoType.AmmoAmount>0) AltFire(0.0); 
    PlayAnim('Still');
    bPointing=False;
    if ( (AmmoType != None) && (AmmoType.AmmoAmount<=0) ) 
        Pawn(Owner).SwitchToBestWeapon();  //Goto Weapon that has Ammo
    Disable('AnimEnd');
    PlayIdleAnim();     
}

defaultproperties
{
     AmmoName=Class'UnrealShare.ShellBox'
     PickupAmmoCount=50
     bInstantHit=True
     bAltInstantHit=True
     FireOffset=(Y=-5.000000,Z=-4.000000)
     shakemag=135.000000
     shakevert=8.000000
     AIRating=0.600000
     RefireRate=0.850000
     AltRefireRate=0.900000
     FireSound=Sound'UnrealI.Minigun.RegF1'
     AltFireSound=Sound'UnrealI.Minigun.AltF1'
     SelectSound=Sound'UnrealI.Minigun.MiniSelect'
     Misc1Sound=Sound'UnrealI.Minigun.WindD2'
     DeathMessage="%k's %w turned %o into a leaky piece of meat."
     AutoSwitchPriority=10
     InventoryGroup=10
     PickupMessage="You got the Minigun"
     ItemName="Minigun"
     PlayerViewOffset=(X=5.600000,Y=-1.500000,Z=-1.800000)
     PlayerViewMesh=Mesh'UnrealI.minigunM'
     PickupViewMesh=Mesh'UnrealI.minipick'
     ThirdPersonMesh=Mesh'UnrealI.SMini3'
     PickupSound=Sound'UnrealShare.Pickups.WeaponPickup'
     Mesh=Mesh'UnrealI.minipick'
     bNoSmooth=False
     bMeshCurvy=False
     SoundRadius=64
     SoundVolume=255
     CollisionRadius=28.000000
     CollisionHeight=8.000000
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Sun 21/2/2010 23:48:40.000 - Creation time: Sun 21/2/2010 23:49:52.772 - Created with UnCodeX