public Cruiser() : base(8, 6, 6, 6, 2) { Type = UnitType.Cruiser; Name = "Cruiser"; RequiredTech = new Combustion(); ObsoleteTech = null; SetIcon('C', 0, 1); }
public Ironclad() : base(6, 4, 4, 4) { Type = UnitType.Ironclad; Name = "Ironclad"; RequiredTech = new SteamEngine(); ObsoleteTech = new Combustion(); SetIcon('A', 0, 1); }
// Spread coroutine which is responsible for fire activity on certain Combustible component. // This coroutine is running when Combustion is equals to Burning state and while loop within this function is looping each tick based on WeatherControl windIntervalTick variable. private IEnumerator Burn() { while (combustion == Combustion.Burning) { if (combustibility <= 0) { combustion = Combustion.Burned; } combustibility -= 1; yield return(new WaitForSeconds(weatherControl.GetWindIntervalTick())); } ChangeColor(); }
// Extinguish function stops coroutine for Spreading and set back Combustion to None and color to green, but keeps the combustibility value so it's already "damaged". public void Extinguish() { StopCoroutine(coroutine); combustion = Combustion.None; ChangeColor(); }
// Ignition function public void Ignite() { combustion = Combustion.Burning; ChangeColor(); StartCoroutine(coroutine); }