public PointOfInterest(string name, HexCell hexCell, PointOfInterestHandler pointOfInterestHandler, Type type) { this.Name = name; IsKnown = false; OnPlayableUnitArrived += pointOfInterestHandler; MyType = type; Hexcell = hexCell; }
public Harbor(string name, HexCell hexCell, PointOfInterestHandler pointOfInterestHandler, bool hasMerchant, bool hasTavern) : base(name, hexCell, pointOfInterestHandler, Type.Harbor) { //TEMP VALUES merchantData.woolValue = UnityEngine.Random.Range(1, 11); merchantData.tobaccoValue = UnityEngine.Random.Range(2, 12); merchantData.coffeeValue = UnityEngine.Random.Range(3, 13); merchantData.silkValue = UnityEngine.Random.Range(4, 14); merchantData.oreValue = UnityEngine.Random.Range(5, 15); this.hasMerchant = hasMerchant; this.hasTavern = hasTavern; foodCost = UnityEngine.Random.Range(5, 15); }
// Update is called once per frame void LateUpdate() { bool flag = false; // POI Check foreach (PointOfInterestHandler poi in pois) { if (poi.playerIsCloseEnough) { flag = true; currentPOI = poi; } } usePOI = flag; // Movement and Zoom if (!frogCamOverride) { //if (!usePOI) //{ // mainCam.orthographicSize = Mathf.Lerp(mainCam.orthographicSize, standardSize, lerpSpeed * Time.deltaTime); // targetPos = new Vector3((goblin.transform.position + (goblinVelocity * forwardOffset)).x, goblin.transform.position.y, -21); // Vector2 forwardPos = Vector2.Lerp(transform.position, targetPos, lerpSpeed * Time.deltaTime); // new Vector2(Mathf.Lerp(transform.position.x, targetPos.x, lerpSpeed * Time.deltaTime), goblin.transform.position.y, -21); // Vector2 currentPos = Vector2.Lerp(transform.position, goblin.transform.position, lerpSpeed * Time.deltaTime); // new Vector3(Mathf.Lerp(transform.position.x, goblin.transform.position.x, lerpSpeed * Time.deltaTime), goblin.transform.position.y, -21); // transform.position = (Vector3)(goblin.canMove ? forwardPos : currentPos) + Vector3.back * 21; //} //else if (usePOI && currentPOI) //{ // mainCam.orthographicSize = Mathf.Lerp(mainCam.orthographicSize, currentPOI.camSize, lerpSpeed * Time.deltaTime); // Vector2 poiPos = Vector2.Lerp(transform.position, currentPOI.useOffset ? currentPOI.offset : (Vector2)currentPOI.transform.position, lerpSpeed * Time.deltaTime); // transform.position = (Vector3)poiPos + Vector3.back * 21; //} MovementStateMachine(); } else { FrogScript frog = goblin.mount.GetComponent <FrogScript>(); mainCam.orthographicSize = Mathf.Lerp(mainCam.orthographicSize, frog.jumpDistance * sizePerDistance, Time.deltaTime); transform.position = Vector3.Lerp(transform.position, frog.arc.avgPosition + Vector3.back * 21, Time.deltaTime); } }
public Stronghold(string name, HexCell hexCell, DifficultySettings difficultySettings, PointOfInterestHandler pointOfInterestHandler) : base(name, hexCell, pointOfInterestHandler, Type.Stronghold) { challenges = new List <Challenge>(); int numberOfChallenges = Random.Range(difficultySettings.strongholdMinChallenges, difficultySettings.strongholdMaxChallenges + 1); int combatIndex = Random.Range(0, numberOfChallenges); for (int i = 0; i < numberOfChallenges; i++) { if (i == combatIndex) { challenges.Add(new Challenge(Challenge.Type.Combat, CharacterStatType.NONE, 5)); } else { challenges.Add(new Challenge(Challenge.Type.SkillcheckChallenge, (CharacterStatType)Random.Range(0, (int)CharacterStatType.Charisma) + 1, 5)); } } Debug.Log("Stronghold made"); }