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

UnrealI.Amplifier


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
//=============================================================================
// Amplifier.
//=============================================================================
class Amplifier expands Pickup;

#exec AUDIO IMPORT FILE="Sounds\Pickups\HEALTH1.WAV" NAME="HEALTH1" GROUP="Pickups"
#exec AUDIO IMPORT FILE="Sounds\Pickups\ampl1.WAV" NAME="AmpAct" GROUP="Pickups"

#exec TEXTURE IMPORT NAME=I_Amp FILE=TEXTURES\HUD\i_amp.PCX GROUP="Icons" MIPS=OFF

#exec MESH IMPORT MESH=AmplifierM ANIVFILE=MODELS\amp_a.3D DATAFILE=MODELS\amp_d.3D X=0 Y=0 Z=0
#exec MESH ORIGIN MESH=AmplifierM X=0 Y=0 Z=50 YAW=0
#exec MESH SEQUENCE MESH=AmplifierM SEQ=All    STARTFRAME=0  NUMFRAMES=1
#exec TEXTURE IMPORT NAME=JAmplifier1 FILE=MODELS\Amp.PCX GROUP="Skins" 
#exec MESHMAP SCALE MESHMAP=AmplifierM X=0.08 Y=0.08 Z=0.16
#exec MESHMAP SETTEXTURE MESHMAP=AmplifierM NUM=1 TEXTURE=JAmplifier1

var() float AmpMultiplier;
var() sound AmpSound;

event TravelPreAccept()
{
    local inventory w;

    Super.TravelPreAccept();
    w = Pawn(Owner).FindInventoryType(class'DispersionPistol');
    if ( w != None )
        DispersionPistol(w).Amp = self;
    w = Pawn(Owner).FindInventoryType(class'ASMD');
    if ( w != None )
        ASMD(w).Amp = self;
}


function inventory SpawnCopy( pawn Other )
{
    local inventory Copy;
    local Inventory I;

    Copy = Super.SpawnCopy(Other);
    I = Other.FindInventoryType(class'DispersionPistol');
    if ( DispersionPistol(I) != None )
        DispersionPistol(I).amp = Amplifier(Copy);

    I = Other.FindInventoryType(class'ASMD');
    if ( ASMD(I) != None )
        ASMD(I).amp = Amplifier(Copy);

    return Copy;
}

function float UseCharge(float Amount)
{
    Return 1.0;
}

function UsedUp()
{
    local Inventory I;

    I = Pawn(Owner).FindInventoryType(class'DispersionPistol');
    if ( DispersionPistol(I) != None )
        DispersionPistol(I).amp = None;

    I = Pawn(Owner).FindInventoryType(class'ASMD');
    if ( ASMD(I) != None )
        ASMD(I).amp = None;

    Super.UsedUp();
}

state Activated
{

    function float UseCharge(float Amount)
    {
        local float TempCharge;
        if (AmpMultiplier<1.0) AmpMultiplier=1.0;
    
        if (Charge < Amount) {
            TempCharge = Charge;
            Charge=0;
            Return (AmpMultiplier-1.0)*TempCharge/Amount+1.0;
        }
        Charge = Charge - Amount;
        return AmpMultiplier;
    }


    function Timer()
    {
        Charge -= 2;
        if (Charge<=0) 
        {
            UsedUp();       
        }
    }

    function EndState()
    {
        if ( Owner.IsA('PlayerPawn') )
            PlayerPawn(Owner).ClientAdjustGlow(0.1,vect(-100,-20,0));
        Owner.AmbientSound=None;
        Owner.LightType=LT_None;
        Owner.AmbientGlow=0;        
        bActive = false;        
    }
Begin:
    SetTimer(1.0,True);
    PlaySound(ActivateSound);
    Owner.AmbientSound=AmpSound;
    if ( Owner.IsA('PlayerPawn') )
        PlayerPawn(Owner).ClientAdjustGlow(-0.1,vect(100,20,0));
    Owner.LightType=LT_Steady;  
    Owner.LightRadius=6;
    Owner.LightEffect=LE_NonIncidence;
    Owner.LightSaturation=40;
    Owner.LightHue=6;
    Owner.LightBrightness=255;
    Owner.AmbientGlow=255;
}

state DeActivated
{
Begin:

}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: za 22-4-2006 12:52:32.000 - Creation time: za 22-4-2006 12:53:44.359 - Created with UnCodeX