Skip to content

Commit cfbd962

Browse files
committed
Some Release fixes
- Removed staging Player B states which resulted in possible null pointers - Increased name length limit - Updated Iron Curtain Check to use correct data member - Added explosions for Iron Curtain Hit List when active.
1 parent 989b6fb commit cfbd962

7 files changed

Lines changed: 23 additions & 9 deletions

File tree

Assets/EC2018/CommandLineUtil.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public static class CommandLineUtil
66
{
77
const string RoundStep = "-round-step";
88

9-
const float defaultRoundStep = 1.5f;
9+
const float defaultRoundStep = 1f;
1010

1111
public static float GetRoundStep() {
1212
var args = System.Environment.GetCommandLineArgs ();

Assets/EC2018/CountInDetailPopulator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class CountInDetailPopulator : MonoBehaviour {
88

99
public TextMeshProUGUI tmpPlayerA;
1010
public TextMeshProUGUI tmpPlayerB;
11-
public int MaxLength = 20;
11+
public int MaxLength = 31;
1212

1313
void Start () {
1414
tmpPlayerA.text = GetPlayerName (PlayerType.A);

Assets/EC2018/Entities/Player.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ public class Player
1414
public int Score { get; set; }
1515
public bool IronCurtainAvailable { get; set; }
1616
public int ActiveIronCurtainLifetime { get; set; }
17+
public bool IsIronCurtainActive { get; set; }
1718
}
1819
}

Assets/EC2018/GameStateManager.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,10 @@ public void PlayCurrentState() {
169169
}
170170
}
171171

172-
ProcessIronCurtainHitList(gameState.Players);
172+
if(currentRound > 0) {
173+
ProcessIronCurtainHitList(gameState.Players);
174+
}
175+
173176
if (CanIncrementRound()) {
174177
currentRound++;
175178
} else {
@@ -193,9 +196,14 @@ void ProcessTeslaHitList(List<List<HitList>> hitLists) {
193196

194197
void ProcessIronCurtainHitList(List<Player> players) {
195198
for (int i = 0; i < players.Count; i++) {
196-
var available = players[i].IronCurtainAvailable;
197-
var lifetime = players[i].ActiveIronCurtainLifetime;
198-
if (available && lifetime >= 0) {
199+
if (players[i].IsIronCurtainActive) {
200+
201+
var hitList = gameState.IroncurtainHitList;
202+
203+
for (int h = 0; h < hitList.Count; h++) {
204+
instantiator.InstantiateExplosion(7.5f, hitList[h].Y, hitList[h].PlayerType);
205+
}
206+
199207
instantiator.ActivateIronCurtain(players[i].PlayerType);
200208
} else {
201209
instantiator.DeactivateIronCurtain(players[i].PlayerType);

Assets/EC2018/Instantiator.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ private void InstantiateLightningHit(PlayerType originPlayer, GameObject start,
155155
expObj.transform.localScale = expObj.transform.localScale * 0.5f;
156156
}
157157

158+
public void InstantiateExplosion(float x, float y, PlayerType player) {
159+
var explosionToInstantiate = player == PlayerType.B ? explosionA : explosionB;
160+
var expObj = Instantiate(explosionToInstantiate, new Vector3(x, 0.5f, y), Quaternion.identity);
161+
expObj.transform.localScale = expObj.transform.localScale * 0.5f;
162+
}
163+
158164
public void InstantiateTeslaHit(List<HitList> hitList, Player playerA, Player playerB) {
159165

160166
// if list is empty

Assets/EC2018/ReplayManager.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ void LoadAllRounds() {
2929
for (int roundNumber = 0; roundNumber < numberOfRounds; roundNumber++) {
3030
var roundName = ConvertRoundToFolderName(roundNumber);
3131
var statePlayerA = GetGameStateForPlayer(0, replayPath, roundName);
32-
var statePlayerB = GetGameStateForPlayer(1, replayPath, roundName);
33-
var round = new Round(statePlayerA, statePlayerB);
32+
var round = new Round(statePlayerA, null);
3433
rounds.Add(round);
3534
}
3635
}

Assets/EC2018/UIManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class UIManager : MonoBehaviour {
3434
public BarrierHealth barrierHealthA;
3535
public BarrierHealth barrierHealthB;
3636

37-
public int MaxLength = 20;
37+
public int MaxLength = 31;
3838

3939
GameManager gameManager;
4040

0 commit comments

Comments
 (0)