public void SetPlayerPosition(WorldEncounter encounter) { playerEncounterPosition = encounter; playerColumnPosition = encounter.column; encounter.encounterReached = true; encounter.SetRedXOverlayViewState(true); }
public List <WorldEncounter> GetNextViableEncounters(WorldEncounter positionFrom) { //int currentColumn = positionFrom.column; int currentPosition = positionFrom.position; List <WorldEncounter> viableEncounters = new List <WorldEncounter>(); foreach (WorldEncounter encounter in allWorldEncounters) { if ( (encounter.position == currentPosition || encounter.position == currentPosition + 1) && encounter.column == positionFrom.column + 1 && encounter.column <= 6 ) { viableEncounters.Add(encounter); } else if ( (encounter.position == currentPosition || encounter.position == currentPosition - 1) && encounter.column == positionFrom.column + 1 && encounter.column > 6 ) { viableEncounters.Add(encounter); } } return(viableEncounters); }
public void SetPlayerPosition(WorldEncounter encounter) { playerPosition = encounter; playerColumn = encounter.column; encounter.encounterReached = true; encounter.SetGraphicMaskColour(encounter.occupiedColour); }
public void SetPlayerPosition(int column, int position) { WorldEncounter newLocation = null; foreach (WorldEncounter encounter in allWorldEncounters) { if (encounter.column == column && encounter.position == position) { newLocation = encounter; } } if (newLocation == null) { Debug.Log("WorldMap.SetPlayerPosition() could not find a matching World Encounter location object"); return; } playerPosition = newLocation; newLocation.encounterReached = true; newLocation.SetGraphicMaskColour(newLocation.occupiedColour); }
public List <WorldEncounter> GetNextViableEncounters(WorldEncounter playerPosition = null) { List <WorldEncounter> encountersReturned = new List <WorldEncounter>(); // if we are at the very start of the map if (playerPosition == null) { foreach (WorldEncounter encounter in currentWorld.allEncounters) { if (encounter.column == 1) { encountersReturned.Add(encounter); } } } else if (playerPosition != null) { foreach (WorldEncounter encounter in currentWorld.allEncounters) { // check for viable column if (encounter.column == playerEncounterPosition.column + 1) { // check for viable position if (encounter.position == playerEncounterPosition.position || encounter.position == playerEncounterPosition.position + 1 || encounter.position == playerEncounterPosition.position - 1) { encountersReturned.Add(encounter); } } } } return(encountersReturned); }
public void SetRandomTileType(WorldEncounter encounter) { int randomNumber = Random.Range(1, 101); if (WorldMap.Instance.OnlySpawnBasicEncounters) { encounter.myEncounterType = EncounterType.BasicEnemy; return; } // prevent randomizing the home hexagon location if (myEncounterType == EncounterType.Home) { return; } if (randomNumber >= 1 && randomNumber <= 75) { int randomNumber2 = Random.Range(1, 101); if (randomNumber2 >= 1 && randomNumber2 <= 60) { encounter.myEncounterType = EncounterType.BasicEnemy; } else { encounter.myEncounterType = EncounterType.Mystery; } } else { int randomNumber3 = Random.Range(1, 101); if (randomNumber3 >= 1 && randomNumber3 <= 25) { encounter.myEncounterType = EncounterType.Shop; } else if (randomNumber3 >= 26 && randomNumber3 <= 50) { encounter.myEncounterType = EncounterType.EliteEnemy; } else if (randomNumber3 >= 51 && randomNumber3 <= 90) { encounter.myEncounterType = EncounterType.CampSite; } else { encounter.myEncounterType = EncounterType.Treasure; } } /* * if (randomNumber >= 1 && randomNumber <= 30) * { * encounter.myEncounterType = EncounterType.BasicEnemy; * } * * else if(randomNumber >= 31 && randomNumber<= 40) * { * encounter.myEncounterType = EncounterType.EliteEnemy; * } * * else if (randomNumber >= 41 && randomNumber <= 50) * { * encounter.myEncounterType = EncounterType.Shop; * } * * else if (randomNumber >= 51 && randomNumber <= 60) * { * encounter.myEncounterType = EncounterType.CampSite; * } * * else if (randomNumber >= 61 && randomNumber <= 90) * { * encounter.myEncounterType = EncounterType.Mystery; * } * else if (randomNumber >= 91 && randomNumber <= 100) * { * encounter.myEncounterType = EncounterType.Treasure; * } */ }
// Travelling + World Navigation Logic #region public void SetPlayerAtHomePosition() { playerColumnPosition = 0; playerEncounterPosition = null; }