protected new void Start() { base.Start(); int otherPeople = Random.Range(minNumOfPeople, maxNumOfPeople + 1); for (int i = 0; i < otherPeople; i++) { ShipPosition sp = otherShip.GetVacantPositionByPriority(); CrewMember c = CreateCrewMember(sp.tile); c.ship = otherShip; otherShip.Assign(c, sp, true); } int food = Random.Range(foodMin, foodMax + 1); int wood = Random.Range(woodMin, woodMax + 1); int gold = Random.Range(goldMin, goldMax + 1); otherShip.AddInventory(food, wood, gold); if (PlayerHasRangeAdvantage()) { message.text += "The ship has not yet seen us.\nWhat do we wish to do?"; shipSeesFirstOptions.SetActive(false); playerSeesFirstOptions.SetActive(true); } else { ShipDecision decision = GenerateShipDecision(false); switch (decision) { case ShipDecision.FLEE: otherParleyOptions.SetActive(false); message.text += "The ship is attempting to flee us.\nWe are "; if (!PlayerHasFasterShip()) { engageOptions.SetActive(false); message.text += "not "; } message.text += "faster than them."; break; case ShipDecision.PARLEY: message.text += "The ship wishes to parley with us."; break; case ShipDecision.ENGAGE: message.text += "The ship is engaging us."; continueMessageButton.SetActive(true); shipSeesFirstOptions.SetActive(false); break; } } battleManager.Init(playerShip.GetBoardingTile(), otherShip.GetBoardingTile()); }
public void AttemptSurpriseAttack() { ShipDecision decision = GenerateShipDecision(true); if (decision == ShipDecision.PARLEY) { SurpriseAttack(); return; } else if (decision == ShipDecision.ENGAGE) { message.text = "The ship is engaging us."; continueMessageButton.SetActive(true); playerSeesFirstOptions.SetActive(false); return; } message.text = "They are not accepting our parley."; playerParleyOptions.SetActive(false); }