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

Botpack.WarHeadLauncher


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
//=============================================================================
// WarHeadLauncher
//=============================================================================
class WarHeadLauncher extends TournamentWeapon;

#exec MESH IMPORT  MESH=WarHead ANIVFILE=MODELS\war_a.3D DATAFILE=MODELS\war_d.3D X=0 Y=0 Z=0 
#exec MESH ORIGIN MESH=WarHead X=0 Y=-210 Z=-50 YAW=64 PITCH=16  ROLL=-62
#exec MESH SEQUENCE MESH=WarHead SEQ=All         STARTFRAME=0   NUMFRAMES=35
#exec MESH SEQUENCE MESH=WarHead SEQ=Select      STARTFRAME=0   NUMFRAMES=15
#exec MESH SEQUENCE MESH=WarHead SEQ=Still       STARTFRAME=15  NUMFRAMES=1
#exec MESH SEQUENCE MESH=WarHead SEQ=Idle        STARTFRAME=15  NUMFRAMES=5
#exec MESH SEQUENCE MESH=WarHead SEQ=Down        STARTFRAME=20  NUMFRAMES=7
#exec MESH SEQUENCE MESH=WarHead SEQ=Fire        STARTFRAME=28  NUMFRAMES=7
#exec TEXTURE IMPORT NAME=Jwarhead1 FILE=MODELS\warh1.PCX GROUP=Skins LODSET=2
#exec TEXTURE IMPORT NAME=Jwarhead2 FILE=MODELS\warh2.PCX GROUP=Skins LODSET=2
#exec TEXTURE IMPORT NAME=Jwarhead3 FILE=MODELS\warh3.PCX GROUP=Skins LODSET=2
#exec TEXTURE IMPORT NAME=Jwarhead4 FILE=MODELS\warh4.PCX GROUP=Skins LODSET=2
#exec MESHMAP SCALE MESHMAP=WarHead X=0.006 Y=0.006 Z=0.012
#exec MESHMAP SETTEXTURE MESHMAP=WarHead NUM=0 TEXTURE=Jwarhead1
#exec MESHMAP SETTEXTURE MESHMAP=WarHead NUM=1 TEXTURE=Jwarhead2
#exec MESHMAP SETTEXTURE MESHMAP=WarHead NUM=2 TEXTURE=Jwarhead3
#exec MESHMAP SETTEXTURE MESHMAP=WarHead NUM=3 TEXTURE=Jwarhead4

#exec MESH IMPORT MESH=WHPick ANIVFILE=MODELS\WHPick_a.3D DATAFILE=MODELS\WHPick_d.3D X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=WHPick X=150 Y=-10 Z=0 YAW=0 ROLL=-64
#exec MESH SEQUENCE MESH=WHPick SEQ=All         STARTFRAME=0   NUMFRAMES=1
#exec MESH SEQUENCE MESH=WHPick SEQ=Still       STARTFRAME=0   NUMFRAMES=1
#exec TEXTURE IMPORT NAME=Jwhpick1 FILE=MODELS\whpick.PCX GROUP=Skins LODSET=2
#exec MESHMAP SCALE MESHMAP=WHPick X=0.1 Y=0.1 Z=0.2
#exec MESHMAP SETTEXTURE MESHMAP=WHPick NUM=1 TEXTURE=Jwhpick1

#exec MESH IMPORT MESH=WHHand ANIVFILE=MODELS\WHpick_a.3D DATAFILE=MODELS\WHpick_d.3D X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=WHHand X=-150 Y=-110 Z=0 YAW=0 ROLL=-64
#exec MESH SEQUENCE MESH=WHHand SEQ=All         STARTFRAME=0   NUMFRAMES=1
#exec MESH SEQUENCE MESH=WHHand SEQ=Still       STARTFRAME=0   NUMFRAMES=1
#exec MESHMAP SCALE MESHMAP=WHHand X=0.05 Y=0.05 Z=0.1
#exec MESHMAP SETTEXTURE MESHMAP=WHHand NUM=1 TEXTURE=JWHPick1

#exec TEXTURE IMPORT NAME=Readout FILE=MODELS\data.PCX GROUP="Icons" FLAGS=2 MIPS=OFF
#exec TEXTURE IMPORT NAME=GuidedX FILE=MODELS\crshair.PCX GROUP="Icons" FLAGS=2 MIPS=OFF

#exec AUDIO IMPORT FILE="Sounds\Warhead\warheadshot.wav" NAME="WarheadShot" GROUP=Redeemer
#exec AUDIO IMPORT FILE="Sounds\Warhead\warheadpickup.wav" NAME="WarheadPickup" GROUP=Redeemer

#exec TEXTURE IMPORT NAME=IconWarH FILE=TEXTURES\HUD\WpnRdeem.PCX GROUP="Icons" MIPS=OFF
#exec TEXTURE IMPORT NAME=UseWarH FILE=TEXTURES\HUD\UseRdeem.PCX GROUP="Icons" MIPS=OFF

var GuidedWarShell GuidedShell;
var int Scroll;
var PlayerPawn GuidingPawn;
var bool    bGuiding, bCanFire, bShowStatic;
var rotator StartRotation;

replication
{
    // Things the server should send to the client.
    reliable if( bNetOwner && (Role==ROLE_Authority) )
        bGuiding, bShowStatic;
}

function SetWeaponStay()
{
    bWeaponStay = false; // redeemer never stays
}

simulated function PostRender( canvas Canvas )
{
    local int i, numReadouts, OldClipX, OldClipY;
    local float XScale;

    bOwnsCrossHair = ( bGuiding || bShowStatic );

    if ( !bGuiding )
    {
        if ( !bShowStatic )
            return;

        Canvas.SetPos( 0, 0);
        Canvas.Style = ERenderStyle.STY_Normal;
        Canvas.DrawIcon(Texture'LadrStatic.Static_a00', FMax(Canvas.ClipX, Canvas.ClipY)/256.0);
        if ( Owner.IsA('PlayerPawn') )
            PlayerPawn(Owner).ViewTarget = None;
        return;
    }
    GuidedShell.PostRender(Canvas);
    OldClipX = Canvas.ClipX;
    OldClipY = Canvas.ClipY;
    XScale = FMax(0.5, int(Canvas.ClipX/640.0));
    Canvas.SetPos( 0.5 * OldClipX - 128 * XScale, 0.5 * OldClipY - 128 * XScale );
    if ( Level.bHighDetailMode )
        Canvas.Style = ERenderStyle.STY_Translucent;
    else
        Canvas.Style = ERenderStyle.STY_Normal;
    Canvas.DrawIcon(Texture'GuidedX', XScale);

    numReadouts = OldClipY/128 + 2;
    for ( i = 0; i < numReadouts; i++ )
    { 
        Canvas.SetPos(1,Scroll + i * 128);
        Scroll--;
        if ( Scroll < -128 )
            Scroll = 0;
        Canvas.DrawIcon(Texture'Readout', 1.0);
    }
}   

function float RateSelf( out int bUseAltMode )
{
    local Pawn P, E;
    local Bot O;

    O = Bot(Owner);
    if ( (O == None) || (AmmoType.AmmoAmount <=0) || (O.Enemy == None) )
        return -2;

    bUseAltMode = 0;
    E = O.Enemy;

    for ( P=Level.PawnList; P!=None; P=P.NextPawn )
        if ( P.bIsPlayer && (P != O) && (P != E)
            && (!Level.Game.bTeamGame || (O.PlayerReplicationInfo.Team != P.PlayerReplicationInfo.Team))
            && (VSize(E.Location - P.Location) < 650) 
            && (!Level.Game.IsA('TeamGamePlus') || TeamGamePlus(Level.Game).PriorityObjective(O) < 2)
            && FastTrace(P.Location, E.Location) )
        {
            if ( VSize(E.Location - O.Location) > 500 )
                return 2.0;
            else
                return 1.0;
        }

    return 0.35;
}

// return delta to combat style
function float SuggestAttackStyle()
{
    return -1.0;
}

simulated function PlayFiring()
{
    PlayAnim( 'Fire', 0.3 );        
    PlayOwnedSound(FireSound, SLOT_None,4.0*Pawn(Owner).SoundDampening);
}

function setHand(float Hand)
{
    if ( Hand == 2 )
    {
        bHideWeapon = true;
        return;
    }
    else
        bHideWeapon = false;

    PlayerViewOffset.Y = Default.PlayerViewOffset.Y;
    PlayerViewOffset.X = Default.PlayerViewOffset.X;
    PlayerViewOffset.Z = Default.PlayerViewOffset.Z;
    
    PlayerViewOffset *= 100; //scale since network passes vector components as ints
}

function AltFire( float Value )
{
    if ( !Owner.IsA('PlayerPawn') )
    {
        Fire(Value);
        return;
    }

    if (AmmoType.UseAmmo(1))
    {
        PlayerPawn(Owner).ShakeView(ShakeTime, ShakeMag, ShakeVert);
        bPointing=True;
        Pawn(Owner).PlayRecoil(FiringSpeed);
        PlayFiring();
        GuidedShell = GuidedWarShell(ProjectileFire(AltProjectileClass, ProjectileSpeed, bWarnTarget));
        GuidedShell.SetOwner(Owner);
        PlayerPawn(Owner).ViewTarget = GuidedShell;
        GuidedShell.Guider = PlayerPawn(Owner);
        ClientAltFire(0);
        GotoState('Guiding');
    }
}

simulated function bool ClientAltFire( float Value )
{
    if ( bCanClientFire && ((Role == ROLE_Authority) || (AmmoType == None) || (AmmoType.AmmoAmount > 0)) )
    {
        if ( Affector != None )
            Affector.FireEffect();
        PlayOwnedSound(FireSound, SLOT_None,4.0*Pawn(Owner).SoundDampening);
        return true;
    }
    return false;
}

State Guiding
{
    function Fire ( float Value )
    {
        if ( !bCanFire )
            return;
        if ( GuidedShell != None )
            GuidedShell.Explode(GuidedShell.Location,Vect(0,0,1));
        bCanClientFire = true;

        GotoState('Finishing');
    }

    function AltFire ( float Value )
    {
        Fire(Value);
    }

    function BeginState()
    {
        Scroll = 0;
        bGuiding = true;
        bCanFire = false;
        if ( Owner.IsA('PlayerPawn') )
        {
            GuidingPawn = PlayerPawn(Owner);
            StartRotation = PlayerPawn(Owner).ViewRotation;
            PlayerPawn(Owner).ClientAdjustGlow(-0.2,vect(200,0,0));
        }
    }

    function EndState()
    {
        bGuiding = false;
        if ( GuidingPawn != None )
        {
            GuidingPawn.ClientAdjustGlow(0.2,vect(-200,0,0));
            GuidingPawn.ClientSetRotation(StartRotation);
            GuidingPawn = None;
        }
    }


Begin:
    Sleep(1.0);
    bCanFire = true;
}

State Finishing
{
    ignores Fire, AltFire;

    function BeginState()
    {
        bShowStatic = true;
    }

Begin:
    Sleep(0.3);
    bShowStatic = false;
    Sleep(1.0);
    GotoState('Idle');
}

defaultproperties
{
     WeaponDescription="Classification: Thermonuclear Device\n\nPrimary Fire: Launches a huge yet slow moving missile that, upon striking a solid surface, will explode and send out a gigantic shock wave, instantly pulverizing anyone or anything within its colossal radius, including yourself.\n\nSecondary Fire: Take control of the missile and fly it anywhere.  You can press the primary fire button to explode the missile early.\n\nTechniques: Remember that while this rocket is being piloted you are a sitting duck.  If an opponent manages to hit your incoming Redeemer missile while it's in the air, the missile will explode harmlessly."
     InstFlash=-0.400000
     InstFog=(X=950.000000,Y=650.000000,Z=290.000000)
     AmmoName=Class'Botpack.WarHeadAmmo'
     ReloadCount=1
     PickupAmmoCount=1
     bWarnTarget=True
     bAltWarnTarget=True
     bSplashDamage=True
     bSpecialIcon=True
     FiringSpeed=1.000000
     FireOffset=(X=18.000000,Z=-10.000000)
     ProjectileClass=Class'Botpack.WarShell'
     AltProjectileClass=Class'Botpack.GuidedWarshell'
     shakemag=350.000000
     shaketime=0.200000
     shakevert=7.500000
     AIRating=1.000000
     RefireRate=0.250000
     AltRefireRate=0.250000
     FireSound=Sound'Botpack.Redeemer.WarheadShot'
     SelectSound=Sound'Botpack.Redeemer.WarheadPickup'
     DeathMessage="%o was vaporized by %k's %w!!"
     NameColor=(G=128,B=128)
     AutoSwitchPriority=10
     InventoryGroup=10
     PickupMessage="You got the Redeemer."
     ItemName="Redeemer"
     RespawnTime=60.000000
     PlayerViewOffset=(X=1.800000,Y=1.000000,Z=-1.890000)
     PlayerViewMesh=LodMesh'Botpack.WarHead'
     BobDamping=0.975000
     PickupViewMesh=LodMesh'Botpack.WHPick'
     ThirdPersonMesh=LodMesh'Botpack.WHHand'
     StatusIcon=Texture'Botpack.Icons.UseWarH'
     PickupSound=Sound'UnrealShare.Pickups.WeaponPickup'
     Icon=Texture'Botpack.Icons.UseWarH'
     Mesh=LodMesh'Botpack.WHPick'
     bNoSmooth=False
     CollisionRadius=45.000000
     CollisionHeight=23.000000
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Do 19.5.2005 19:42:14.000 - Creation time: Fr 7.6.2013 13:16:27.238 - Created with UnCodeX