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

UT2k4AssaultFull.Weapon_SpaceFighter


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
//=============================================================================
// Weapon_SpaceFighter
//=============================================================================
// Created by Laurent Delayen
// © 2003, Epic Games, Inc.  All Rights Reserved
//=============================================================================

class Weapon_SpaceFighter extends Weapon
    config(user)
    HideDropDown
    CacheExempt;

#exec OBJ LOAD FILE=..\StaticMeshes\AS_Vehicles_SM.usx

var Rotator PrevRotation;
var float   LastTimeSeconds;

/* BestMode()
choose between regular or alt-fire
*/
function byte BestMode()
{
    if ( Instigator.Controller.Enemy == None )
        return 0;
    if ( GameObjective(Instigator.Controller.Focus) != None )
        return 0;

    if ( Instigator.Controller.bFire != 0 )
        return 0;
    else if ( Instigator.Controller.bAltFire != 0 )
        return 1;
    if ( FRand() < 0.65 )
        return 1;
    return 0;
}
simulated final function float  CalcInertia(float DeltaTime, float FrictionFactor, float OldValue, float NewValue)
{
    local float Friction;

    Friction = 1.f - FClamp( (0.02*FrictionFactor) ** DeltaTime, 0.f, 1.f);
    return  OldValue*Friction + NewValue;
}

simulated function PreDrawFPWeapon()
{
    local Rotator   DeltaRot, NewRot;
    local float     myDeltaTime;

    PlayerViewOffset = default.PlayerViewOffset;
    SetLocation( Instigator.Location + Instigator.CalcDrawOffset(Self) );

    if ( PrevRotation == rot(0,0,0) )
        PrevRotation = Instigator.Rotation;

    myDeltaTime     = Level.TimeSeconds - LastTimeSeconds;
    LastTimeSeconds = Level.TimeSeconds;
    DeltaRot        = Normalize(Instigator.Rotation - PrevRotation);
    NewRot.Yaw      = CalcInertia(myDeltaTime, 0.0001, DeltaRot.Yaw, PrevRotation.Yaw);
    NewRot.Pitch    = CalcInertia(myDeltaTime, 0.0001, DeltaRot.Pitch, PrevRotation.Pitch);
    NewRot.Roll     = CalcInertia(myDeltaTime, 0.0001, DeltaRot.Roll, PrevRotation.Roll);
    PrevRotation    = NewRot;
    SetRotation( NewRot );
}

simulated function bool HasAmmo()
{
    return true;
}

function float SuggestAttackStyle()
{
    return 1.0;
}
//=============================================================================
// defaultproperties
//=============================================================================

defaultproperties
{
     FireModeClass(0)=Class'UT2k4AssaultFull.FM_SpaceFighter_InstantHitLaser'
     FireModeClass(1)=Class'UT2k4AssaultFull.FM_SpaceFighter_AltFire'
     AIRating=0.680000
     CurrentRating=0.680000
     bCanThrow=False
     bNoInstagibReplace=True
     Priority=1
     SmallViewOffset=(Z=-20.000000)
     PlayerViewOffset=(Z=-20.000000)
     AttachmentClass=Class'UT2k4AssaultFull.WA_SpaceFighter'
     ItemName="SpaceFighter weapon"
     DrawType=DT_StaticMesh
     StaticMesh=StaticMesh'AS_Vehicles_SM.Vehicles.SpaceFighter_Human_FP'
     AmbientGlow=64
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Mon 23/10/2006 20:40:04.000 - Creation time: Wed 7/2/2007 19:16:58.890 - Created with UnCodeX