Core.Object | +--Engine.Actor | +--Engine.Inventory | +--Engine.Pickup | +--Botpack.TournamentPickup | +--Botpack.UDamage
sound
EndFireSound
ExtraFireSound
int
FinalCount
Weapon
UDamageWeapon
simulated
FireEffect()
void
SetOwnerLighting()
SetUDamageWeapon()
UsedUp()
BeginState()
EndState()
ChangedWeapon()
SetOwnerDisplay()
Timer()
00001 //============================================================================= 00002 // UDamage. 00003 //============================================================================= 00004 class UDamage extends TournamentPickup; 00005 00006 #exec TEXTURE IMPORT NAME=I_UDamage FILE=TEXTURES\HUD\i_udamage.PCX GROUP="Icons" MIPS=OFF 00007 00008 #exec MESH IMPORT MESH=udamage ANIVFILE=MODELS\udamage_a.3d DATAFILE=MODELS\udamage_d.3d X=0 Y=0 Z=0 00009 #exec MESH LODPARAMS MESH=udamage STRENGTH=0.6 00010 #exec MESH SEQUENCE MESH=udamage SEQ=All STARTFRAME=0 NUMFRAMES=1 00011 #exec MESH SEQUENCE MESH=udamage SEQ=Udamage STARTFRAME=0 NUMFRAMES=1 00012 #exec MESHMAP NEW MESHMAP=udamage MESH=udamage 00013 #exec MESHMAP SCALE MESHMAP=udamage X=0.05 Y=0.05 Z=0.1 00014 00015 #exec AUDIO IMPORT FILE="Sounds\Pickups\MofSFire.WAV" NAME="AmpFire" GROUP="Pickups" 00016 #exec AUDIO IMPORT FILE="Sounds\Pickups\MofSPickup.WAV" NAME="AmpPickup" GROUP="Pickups" 00017 #exec AUDIO IMPORT FILE="Sounds\Pickups\MofSFO1.WAV" NAME="AmpOut" GROUP="Pickups" 00018 #exec AUDIO IMPORT FILE="Sounds\Pickups\MofSRunOut1b.WAV" NAME="AmpFire2b" GROUP="Pickups" 00019 00020 var Weapon UDamageWeapon; 00021 var sound ExtraFireSound; 00022 var sound EndFireSound; 00023 var int FinalCount; 00024 00025 singular function UsedUp() 00026 { 00027 if ( UDamageWeapon != None ) 00028 { 00029 UDamageWeapon.SetDefaultDisplayProperties(); 00030 if ( UDamageWeapon.IsA('TournamentWeapon') ) 00031 TournamentWeapon(UDamageWeapon).Affector = None; 00032 } 00033 if ( Owner != None ) 00034 { 00035 if ( Owner.bIsPawn ) 00036 { 00037 if ( !Pawn(Owner).bIsPlayer || (Pawn(Owner).PlayerReplicationInfo.HasFlag == None) ) 00038 { 00039 Owner.AmbientGlow = Owner.Default.AmbientGlow; 00040 Owner.LightType = LT_None; 00041 } 00042 Pawn(Owner).DamageScaling = 1.0; 00043 } 00044 bActive = false; 00045 if ( Owner.Inventory != None ) 00046 { 00047 Owner.Inventory.SetOwnerDisplay(); 00048 Owner.Inventory.ChangedWeapon(); 00049 } 00050 if (Level.Game.LocalLog != None) 00051 Level.Game.LocalLog.LogItemDeactivate(Self, Pawn(Owner)); 00052 if (Level.Game.WorldLog != None) 00053 Level.Game.WorldLog.LogItemDeactivate(Self, Pawn(Owner)); 00054 } 00055 Destroy(); 00056 } 00057 00058 simulated function FireEffect() 00059 { 00060 if ( (TimerRate - TimerCounter < 5) && (Level.NetMode != NM_Client) ) 00061 Pawn(Owner).Weapon.PlayOwnedSound(EndFireSound, SLOT_Interact, 8); 00062 else 00063 Pawn(Owner).Weapon.PlayOwnedSound(ExtraFireSound, SLOT_Interact, 8); 00064 } 00065 00066 function SetOwnerLighting() 00067 { 00068 if ( Owner.bIsPawn && Pawn(Owner).bIsPlayer 00069 && (Pawn(Owner).PlayerReplicationInfo.HasFlag != None) ) 00070 return; 00071 Owner.AmbientGlow = 254; 00072 Owner.LightEffect=LE_NonIncidence; 00073 Owner.LightBrightness=255; 00074 Owner.LightHue=210; 00075 Owner.LightRadius=10; 00076 Owner.LightSaturation=0; 00077 Owner.LightType=LT_Steady; 00078 } 00079 00080 function SetUDamageWeapon() 00081 { 00082 if ( !bActive ) 00083 return; 00084 00085 SetOwnerLighting(); 00086 00087 // Make old weapon normal again. 00088 if ( UDamageWeapon != None ) 00089 { 00090 UDamageWeapon.SetDefaultDisplayProperties(); 00091 if ( UDamageWeapon.IsA('TournamentWeapon') ) 00092 TournamentWeapon(UDamageWeapon).Affector = None; 00093 } 00094 00095 UDamageWeapon = Pawn(Owner).Weapon; 00096 // Make new weapon cool. 00097 if ( UDamageWeapon != None ) 00098 { 00099 if ( UDamageWeapon.IsA('TournamentWeapon') ) 00100 TournamentWeapon(UDamageWeapon).Affector = self; 00101 if ( Level.bHighDetailMode ) 00102 UDamageWeapon.SetDisplayProperties(ERenderStyle.STY_Translucent, 00103 FireTexture'UnrealShare.Belt_fx.UDamageFX', 00104 true, 00105 true); 00106 else 00107 UDamageWeapon.SetDisplayProperties(ERenderStyle.STY_Normal, 00108 FireTexture'UnrealShare.Belt_fx.UDamageFX', 00109 true, 00110 true); 00111 } 00112 } 00113 00114 // 00115 // Player has activated the item, pump up their damage. 00116 // 00117 state Activated 00118 { 00119 function Timer() 00120 { 00121 if ( FinalCount > 0 ) 00122 { 00123 SetTimer(1.0, true); 00124 Owner.PlaySound(DeActivateSound,, 8); 00125 FinalCount--; 00126 return; 00127 } 00128 UsedUp(); 00129 } 00130 00131 function SetOwnerDisplay() 00132 { 00133 if( Inventory != None ) 00134 Inventory.SetOwnerDisplay(); 00135 00136 SetUDamageWeapon(); 00137 } 00138 00139 function ChangedWeapon() 00140 { 00141 if( Inventory != None ) 00142 Inventory.ChangedWeapon(); 00143 00144 SetUDamageWeapon(); 00145 } 00146 00147 function EndState() 00148 { 00149 UsedUp(); 00150 } 00151 00152 function BeginState() 00153 { 00154 bActive = true; 00155 FinalCount = Min(FinalCount, 0.1 * Charge - 1); 00156 SetTimer(0.1 * Charge - FinalCount,false); 00157 Owner.PlaySound(ActivateSound); 00158 SetOwnerLighting(); 00159 Pawn(Owner).DamageScaling = 3.0; 00160 SetUDamageWeapon(); 00161 } 00162 } 00163 00164 defaultproperties 00165 { 00166 ExtraFireSound=Sound'Botpack.Pickups.AmpFire' 00167 EndFireSound=Sound'Botpack.Pickups.AmpFire2b' 00168 FinalCount=5 00169 bAutoActivate=True 00170 bActivatable=True 00171 bDisplayableInv=True 00172 PickupMessage="You got the Damage Amplifier!" 00173 ItemName="Damage Amplifier" 00174 RespawnTime=120.000000 00175 PickupViewMesh=LodMesh'Botpack.UDamage' 00176 Charge=300 00177 MaxDesireability=2.500000 00178 PickupSound=Sound'Botpack.Pickups.AmpPickup' 00179 DeActivateSound=Sound'Botpack.Pickups.AmpOut' 00180 Icon=Texture'Botpack.Icons.I_UDamage' 00181 Physics=PHYS_Rotating 00182 RemoteRole=ROLE_DumbProxy 00183 Texture=Texture'Botpack.GoldSkin2' 00184 Mesh=LodMesh'Botpack.UDamage' 00185 bMeshEnviroMap=True 00186 }