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

UTGameContent.UTInvulnerability


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
/**
 * Copyright 1998-2007 Epic Games, Inc. All Rights Reserved.
 */
class UTInvulnerability extends UTTimedPowerup;

/** ambient sound */
var SoundCue InvulnerabilitySound;
/** sound played when the Invulnerability is running out */
var SoundCue InvulnerabilityFadingSound;
/** overlay material applied to owner */
var MaterialInterface OverlayMaterialInstance;

function GivenTo(Pawn NewOwner, bool bDoNotActivate)
{
	local UTPawn P;

	Super.GivenTo(NewOwner, bDoNotActivate);

	P = UTPawn(NewOwner);
	if (P != None)
	{
		// make invulnerable
		P.bIsInvulnerable = true;

		// apply Invulnerability overlay
		P.SetOverlayMaterial(OverlayMaterialInstance);

		// set ambient sound
		P.SetPawnAmbientSound(InvulnerabilitySound);

		// juggernaut if already has berserk or invulnerability
		if ( ((P.FireRateMultiplier < 1.0) || (P.DamageScaling > 1.0)) && (PlayerController(P.Controller) != None) )
		{
			PlayerController(P.Controller).ReceiveLocalizedMessage( class'UTPowerupRewardMessage', 0 );
		}
	}
	if ( UTGame(WorldInfo.Game) != None )
		UTGame(WorldInfo.Game).bTempForceRespawn = true;

	// set timer for ending sounds
	SetTimer(TimeRemaining - 3.0, false, 'PlayInvulnerabilityFadingSound');
}

reliable client function ClientGivenTo(Pawn NewOwner, bool bDoNotActivate)
{
	Super.ClientGivenTo(NewOwner, bDoNotActivate);

	if (UTPawn(NewOwner) != None)
	{
		UTPawn(NewOwner).RemainingBodyMatDuration = 0.0;
	}
}

function ItemRemovedFromInvManager()
{
	local UTPlayerReplicationInfo UTPRI;
	local UTPawn P;

	P = UTPawn(Owner);
	if (P != None)
	{
		P.bIsInvulnerable = false;
		P.SetOverlayMaterial(none);
		P.SetPawnAmbientSound(None);

		//Stop the timer on the powerup stat
		if (P.DrivenVehicle != None)
		{
			UTPRI = UTPlayerReplicationInfo(P.DrivenVehicle.PlayerReplicationInfo);
		}
		else
		{
			UTPRI = UTPlayerReplicationInfo(P.PlayerReplicationInfo);
		}
		if (UTPRI != None)
		{
			UTPRI.StopPowerupTimeStat(GetPowerupStatName());
		}
	}
	SetTimer(0.0, false, 'PlayInvulnerabilityFadingSound');
	if ( UTGame(WorldInfo.Game) != None )
		UTGame(WorldInfo.Game).bTempForceRespawn = false;
}

/** called on a timer to play Invulnerability ending sound */
function PlayInvulnerabilityFadingSound()
{
	// reset timer if time got added
	if (TimeRemaining > 3.0)
	{
		SetTimer(TimeRemaining - 3.0, false, 'PlayInvulnerabilityFadingSound');
	}
	else
	{
		Instigator.PlaySound(InvulnerabilityFadingSound);
		SetTimer(0.75, false, 'PlayInvulnerabilityFadingSound');
	}
}

defaultproperties
{
   InvulnerabilitySound=SoundCue'A_Pickups_Powerups.Powerups.A_Powerup_Invulnerability_PowerLoopCue'
   InvulnerabilityFadingSound=SoundCue'A_Pickups_Powerups.Powerups.A_Powerup_Invulnerability_WarningCue'
   OverlayMaterialInstance=Material'PICKUPS.Invulnerability.M_Invulnerability_Overlay'
   HudIndex=3
   PowerupOverSound=SoundCue'A_Pickups_Powerups.Powerups.A_Powerup_Invulnerability_EndCue'
   PowerupStatName="POWERUPTIME_INVULNERABILITY"
   IconCoords=(U=779.000000,UL=64.000000,VL=41.000000)
   PP_Scene_HighLights=(X=-0.170000,Y=0.000000,Z=0.000000)
   bRenderOverlays=True
   bReceiveOwnerEvents=True
   RespawnTime=120.000000
   MaxDesireability=5.000000
   PickupMessage="INVULNERABILITY!"
   PickupSound=SoundCue'A_Pickups_Powerups.Powerups.A_Powerup_Invulnerability_PickupCue'
   Begin Object Class=StaticMeshComponent Name=MeshComponentA ObjName=MeshComponentA Archetype=StaticMeshComponent'Engine.Default__StaticMeshComponent'
      StaticMesh=StaticMesh'PICKUPS.Invulnerability.Mesh.S_Pickups_Invulnerability'
      CullDistance=8000.000000
      CachedCullDistance=8000.000000
      bUseAsOccluder=False
      CastShadow=False
      bForceDirectLightMap=True
      bCastDynamicShadow=False
      CollideActors=False
      BlockRigidBody=False
      Translation=(X=0.000000,Y=0.000000,Z=-20.000000)
      Name="MeshComponentA"
      ObjectArchetype=StaticMeshComponent'Engine.Default__StaticMeshComponent'
   End Object
   DroppedPickupMesh=MeshComponentA
   PickupFactoryMesh=MeshComponentA
   Begin Object Class=UTParticleSystemComponent Name=InvulParticles ObjName=InvulParticles Archetype=UTParticleSystemComponent'UTGame.Default__UTParticleSystemComponent'
      Template=ParticleSystem'PICKUPS.Invulnerability.Effects.P_Pickups_Invulnerability_Idle'
      bAutoActivate=False
      Translation=(X=0.000000,Y=0.000000,Z=-20.000000)
      Name="InvulParticles"
      ObjectArchetype=UTParticleSystemComponent'UTGame.Default__UTParticleSystemComponent'
   End Object
   DroppedPickupParticles=InvulParticles
   Begin Object Class=SpriteComponent Name=Sprite ObjName=Sprite Archetype=SpriteComponent'UTGame.Default__UTTimedPowerup:Sprite'
      ObjectArchetype=SpriteComponent'UTGame.Default__UTTimedPowerup:Sprite'
   End Object
   Components(0)=Sprite
   Name="Default__UTInvulnerability"
   ObjectArchetype=UTTimedPowerup'UTGame.Default__UTTimedPowerup'
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: tr 31-1-2018 17:18:56.000 - Creation time: sk 18-3-2018 10:01:21.753 - Created with UnCodeX