|
|
@ -330,57 +330,6 @@ public class RacetrackGameMode : GameMode |
|
|
|
protected override void OnPlayerMoved(Character character, ClientData client, Block currentBlock) |
|
|
|
{ |
|
|
|
handleFalling(character, client, currentBlock, character.justMoved); |
|
|
|
|
|
|
|
/*Debug.Log("Moved to square at " + currentBlock.transform.position.x + ", " |
|
|
|
+ currentBlock.transform.position.y + ", " |
|
|
|
+ currentBlock.transform.position.z); |
|
|
|
|
|
|
|
//If a character has fallen in the water or into a pit, we mark that fact, and they lose the rest of their turn
|
|
|
|
character.inWater = currentBlock.isWater; |
|
|
|
character.respawnNeeded = currentBlock.isPit; |
|
|
|
|
|
|
|
if (character.inWater == true || character.respawnNeeded == true) |
|
|
|
{ |
|
|
|
character.stuck = true; |
|
|
|
} |
|
|
|
|
|
|
|
Debug.Log("inWater = " + character.inWater + ", respawnNeeded = " + character.respawnNeeded + ", stuck = " + character.stuck);*/ |
|
|
|
|
|
|
|
//Commented out because we don't do this in the racetrack mode
|
|
|
|
|
|
|
|
/*ClientData OwnedClient; |
|
|
|
Material overlay = null; |
|
|
|
if (isOwned(currentBlock, out OwnedClient)) |
|
|
|
{ |
|
|
|
if (OwnedClient == client) |
|
|
|
return; |
|
|
|
|
|
|
|
BlocksOwned[OwnedClient].Remove(currentBlock); |
|
|
|
|
|
|
|
foreach (Material mat in currentBlock.GetComponent<Renderer>().materials) |
|
|
|
{ |
|
|
|
if (mat.name == OverlayMaterial.name + " (Instance)") |
|
|
|
overlay = mat; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (overlay == null) |
|
|
|
{ |
|
|
|
overlay = new Material(OverlayMaterial); |
|
|
|
List<Material> mats = new List<Material>(currentBlock.GetComponent<Renderer>().materials); |
|
|
|
mats.Add(overlay); |
|
|
|
currentBlock.GetComponent<Renderer>().materials = mats.ToArray(); |
|
|
|
} |
|
|
|
|
|
|
|
overlay.SetColor("_NewColor", client.Color); |
|
|
|
|
|
|
|
if (!BlocksOwned.ContainsKey(client)) |
|
|
|
BlocksOwned.Add(client, new List<Block>()); |
|
|
|
|
|
|
|
BlocksOwned[client].Add(currentBlock); |
|
|
|
|
|
|
|
if (overlay != null) |
|
|
|
currentBlock.StartCoroutine(AnimateBlock(overlay, 0.25f));*/ |
|
|
|
} |
|
|
|
|
|
|
|
protected override void OnRoundStart(PlayerData[] allPlayers) |
|
|
@ -397,11 +346,6 @@ public class RacetrackGameMode : GameMode |
|
|
|
* It's not needed from move to move, so we clear it |
|
|
|
*/ |
|
|
|
player.character.justMoved = false; |
|
|
|
|
|
|
|
/* if (BlocksOwned.ContainsKey(player.client)) |
|
|
|
player.client.SceneScore = BlocksOwned[player.client].Count; |
|
|
|
else |
|
|
|
player.client.SceneScore = 0;*/ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -438,7 +382,6 @@ public class RacetrackGameMode : GameMode |
|
|
|
{ |
|
|
|
character.stuck = true; |
|
|
|
} |
|
|
|
//Debug.Log("inWater = " + character.inWater + ", respawnNeeded = " + character.respawnNeeded + ", stuck = " + character.stuck);
|
|
|
|
} |
|
|
|
|
|
|
|
protected override void OnPlayerKilled(Character character, ClientData client) |
|
|
|