Project:
conqueredcastles
Code Location:
http://conqueredcastles.googlecode.com/svn/trunk//trunk
conqueredcastles --username virance/
ConGRI.uc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
class ConGRI extends UTGameReplicationInfo config (ConqueredCastles); // Server Side Data var int ElapsedTimeRoundOffset; // Client Side Data var ConPlayerController LocalPlayerController; var int RemainingRoundTime; // Data replicated from server to client var bool bRoundIsOver; var bool bGameIsOver; var bool bKingIsDead; var int ConRespawnTime; var int ConSiegePhase; var int RemainingTimeRoundOffset; var globalconfig int ConRoundLength; var globalconfig int ConReinforcementPulse; replication { if (Role == ROLE_Authority) bRoundIsOver, bGameIsOver, bKingIsDead, ConSiegePhase, RemainingTimeRoundOffset, ConRoundLength, ConReinforcementPulse, ConRespawnTime; } simulated Function Timer() { local byte TimerMessageIndex; local PlayerController PC; Super (GameReplicationInfo).Timer(); //Super.Super if ( WorldInfo.NetMode == NM_Client ) { if ( bWarmupRound && RemainingTime > 0 ) RemainingTime--; } if ( WorldInfo.NetMode != NM_DedicatedServer && MapVoteTimeRemaining > 0) { MapVoteTimeRemaining--; } if (bRoundIsOver) { RemainingRoundTime = 0; } else { RemainingRoundTime = Min (300, Max (-1, RemainingTime - RemainingTimeRoundOffset)); } // check if we should broadcast a time countdown message, subset of UTGameReplicationInfo otherwise it would become annoying if (WorldInfo.NetMode != NM_DedicatedServer && !bRoundIsOver && (bMatchHasBegun || bWarmupRound) && !bStopCountDown && !bMatchIsOver && Winner == None) { // Kyle: Round timer/message switch (RemainingRoundTime) { case 0: if (RemainingTime!=0) TimerMessageIndex = 17; // No double overtime message break; case 30: TimerMessageIndex = 12; break; default: if (RemainingRoundTime <= 5 && RemainingRoundTime > 0) { TimerMessageIndex = RemainingRoundTime; } break; } if (TimerMessageIndex != 0) { foreach LocalPlayerControllers(class'PlayerController', PC) { PC.ReceiveLocalizedMessage(class'ConTimerMessage', TimerMessageIndex); } } if (ConRespawnTime <= 0) ConRespawnTime = ConReinforcementPulse; else ConRespawnTime--; } // Kyle: Check to see if we should end the round ConqueredCastles (WorldInfo.Game).CheckEndSiege(); } DefaultProperties { Name="ConGRI" ConRoundLength=180 ConReinforcementPulse=15 bRoundIsOver=true }
