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

UTGameContent.UTOnslaughtOrbMessage


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

class UTOnslaughtOrbMessage extends UTCarriedObjectMessage;

var SoundNodeWave EnemyIncoming;
var SoundNodeWave EnemyDropped;
var SoundNodeWave EnemyDestroyed;

var(Message) localized string EnemyIncomingString, EnemyDroppedString, EnemyDestroyedString, OrbAutoReturnedString, OrbNoPickupString;

var byte HighlightOrb[17];

static simulated function ClientReceive(
	PlayerController P,
	optional int SwitchIndex,
	optional PlayerReplicationInfo RelatedPRI_1,
	optional PlayerReplicationInfo RelatedPRI_2,
	optional Object OptionalObject
	)
{
	local UTTeamInfo OrbTeam;
	local UTOnslaughtFlag Orb;
	local int BaseSwitch;


	// if enemy orb, either switch to custom message or ignore, depending on whether in sensor range
	// not for "enemy orb carrier incoming" as in that case distance was already checked
	if ( SwitchIndex != 14 && SwitchIndex != 17 && SwitchIndex != 18 )
	{
		OrbTeam = UTTeamInfo(OptionalObject);
		if ( (OrbTeam != None) && (P.PlayerReplicationInfo.Team != OrbTeam) )
		{
			Orb = UTOnslaughtFlag(OrbTeam.TeamFlag);
			if ( Orb != None )
			{
				if ( !LocalPlayer(P.Player).GetActorVisibility(Orb) && (P.PlayerReplicationInfo != RelatedPRI_1) && (P.PlayerReplicationInfo != RelatedPRI_2)
					&& ((Orb.LastNearbyObjective == None)
					|| (VSize(Orb.Location - Orb.LastNearbyObjective.Location) > Orb.LastNearbyObjective.MaxSensorRange)) )
				{
					return;
				}

				BaseSwitch = (SwitchIndex<7) ? SwitchIndex : SwitchIndex-7;
				// switch to custom message
				if ( BaseSwitch == 2 )
				{
					// enemy dropped
					SwitchIndex = 15;
				}
				else if ( (BaseSwitch == 1) || (BaseSwitch == 3) || (BaseSwitch == 5) )
				{
					// enemy destroyed (returned)
					SwitchIndex = 16;
				}
			}
		}
	}
	Super.ClientReceive(P, SwitchIndex, RelatedPRI_1, RelatedPRI_2, OptionalObject);

	if ( RelatedPRI_1 == P.PlayerReplicationInfo )
	{
		if ( (SwitchIndex == 16) )
		{
			UTPlayerController(P).ClientMusicEvent(3);
		}
	}
}

static function SoundNodeWave AnnouncementSound(int MessageIndex, Object OptionalObject, PlayerController PC)
{
	if ( MessageIndex < 14 )
	{
		return super.AnnouncementSound(MessageIndex, OptionalObject, PC);
	}
	else if ( MessageIndex == 14 )
	{
		return Default.EnemyIncoming;
	}
	else if ( MessageIndex == 15 )
	{
		return Default.EnemyDropped;
	}
	else if ( MessageIndex == 16 )
	{
		return Default.EnemyDestroyed;
	}
}

static function string GetString(
	optional int Switch,
	optional bool bPRI1HUD,
	optional PlayerReplicationInfo RelatedPRI_1,
	optional PlayerReplicationInfo RelatedPRI_2,
	optional Object OptionalObject
	)
{
	if ( Switch < 14 )
	{
		return super.GetString(Switch, bPRI1HUD, RelatedPRI_1, RelatedPRI_2, OptionalObject);
	}
	else if ( Switch == 14 )
	{
		return Default.EnemyIncomingString;
	}
	else if ( Switch == 15 )
	{
		return Default.EnemyDroppedString;
	}
	else if ( Switch == 16 )
	{
		return Default.EnemyDestroyedString;
	}
	else if ( Switch == 17 )
	{
		return Default.OrbAutoReturnedString;
	}
	else if ( Switch == 18 )
	{
		return Default.OrbNoPickupString;
	}
}

/**
 * Don't let multiple messages for same flag stack up
 */
static function bool ShouldBeRemoved(UTQueuedAnnouncement MyAnnouncement, class<UTLocalMessage> NewAnnouncementClass, int NewMessageIndex)
{
	// check if message is not a flag status announcement
	if (default.Class != NewAnnouncementClass)
	{
		return false;
	}

	if ( (MyAnnouncement.MessageIndex>13) == (NewMessageIndex>13) )
	{
		return true;
	}
	return Super.ShouldBeRemoved(MyAnnouncement, NewAnnouncementClass, NewMessageIndex);
}

static function color GetColor(
    optional int Switch,
    optional PlayerReplicationInfo RelatedPRI_1,
    optional PlayerReplicationInfo RelatedPRI_2,
	optional Object OptionalObject
    )
{
	local UTTeamInfo T;

	T = UTTeamInfo(OptionalObject);
	if ( (T == None) || (T.TeamIndex > 1) )
	{
		return class'UTOnslaughtMessage'.Default.GoldColor;
	}
	return (T.TeamIndex == 0) ? class'UTOnslaughtMessage'.Default.RedColor : class'UTOnslaughtMessage'.Default.DrawColor;
}

static function bool IsKeyObjectiveMessage( int Switch )
{
	return (Default.HighLightOrb[Switch] != 0);
}

static function int GetFontSize( int Switch, PlayerReplicationInfo RelatedPRI1, PlayerReplicationInfo RelatedPRI2, PlayerReplicationInfo LocalPlayer )
{
	return (Switch < 17) ? default.FontSize : 3;
}

static function float GetPos( int Switch, HUD myHUD )
{
	return UTHUD(myHUD).MessageOffset[(Switch < 17) ? default.MessageArea : 2];
}

defaultproperties
{
   EnemyIncoming=SoundNodeWave'A_Announcer_Status.Status.A_StatusAnnouncer_EnemyOrbCarrierIncoming'
   EnemyDropped=SoundNodeWave'A_Announcer_Status.Status.A_StatusAnnouncer_EnemyOrbDropped'
   EnemyDestroyed=SoundNodeWave'A_Announcer_Status.Status.A_StatusAnnouncer_EnemyOrbDestroyed'
   EnemyIncomingString="Enemy orb carrier incoming!"
   EnemyDroppedString="Enemy orb dropped"
   EnemyDestroyedString="Enemy orb destroyed"
   OrbAutoReturnedString="Orb auto-returned."
   OrbNoPickupString="Orb temporarily unavailable."
   HighlightOrb(2)=1
   HighlightOrb(9)=1
   HighlightOrb(14)=1
   HighlightOrb(15)=1
   ReturnBlue="destroyed the blue orb!"
   ReturnRed="destroyed the red orb!"
   ReturnedBlue="The blue orb was destroyed!"
   ReturnedRed="The red orb was destroyed!"
   CaptureBlue="delivered the blue orb!"
   CaptureRed="delivered the red orb!"
   DroppedBlue="dropped the blue orb!"
   DroppedRed="dropped the red orb!"
   HasBlue="took the blue orb!"
   HasRed="took the red orb!"
   KilledBlue="killed the blue orb carrier!"
   KilledRed="killed the red orb carrier!"
   ReturnSounds(0)=SoundNodeWave'A_Announcer_Status.Status.A_StatusAnnouncer_RedOrbDestroyed'
   ReturnSounds(1)=SoundNodeWave'A_Announcer_Status.Status.A_StatusAnnouncer_BlueOrbDestroyed'
   DroppedSounds(0)=SoundNodeWave'A_Announcer_Status.Status.A_StatusAnnouncer_RedOrbDropped'
   DroppedSounds(1)=SoundNodeWave'A_Announcer_Status.Status.A_StatusAnnouncer_BlueOrbDropped'
   TakenSounds(0)=SoundNodeWave'A_Announcer_Status.Status.A_StatusAnnouncer_RedOrbPickedUp'
   TakenSounds(1)=SoundNodeWave'A_Announcer_Status.Status.A_StatusAnnouncer_BlueOrbPickedUp'
   MessageArea=6
   Name="Default__UTOnslaughtOrbMessage"
   ObjectArchetype=UTCarriedObjectMessage'UTGame.Default__UTCarriedObjectMessage'
}

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:23.257 - Created with UnCodeX