public void AddLog(EmpireLogEntry Entry = null) { try{ if (Entry != null) { if (Logbook.ContainsKey(Entry.Date)) { Logbook [Entry.Date].Add(Entry); } else { Logbook.Add(Entry.Date, new List <EmpireLogEntry>()); Logbook [Entry.Date].Add(Entry); } } else { if (!Logbook.ContainsKey(StrategicClock.GetDate())) { Logbook.Add(Entry.Date, new List <EmpireLogEntry>()); } } } catch { Debug.Log(Entry.Date + " Key: "); } }
public RelationshipModifier(Character c, int a, string desc) { Other = c; Amount = a; Description = desc; Date = StrategicClock.GetDate(); }
//Use this whenever adding a component to a ship. public ShipComponents CloneProperties() { ShipComponents dest = new ShipComponents(); dest.DesignReference = this; foreach (SubComponent c in SubComponents) { dest.SubComponents.Add(c.Clone()); } dest.Mass = Mass; foreach (Ability a in Abilities.Values) { dest.Abilities.Add(a.AbilityType, a.DeepClone()); } if (emissions != null) { dest.emissions = emissions.Clone(); } dest.CrewRequired = CrewRequired; dest.CrewPresent = CrewRequired; dest.HTK = HTK; dest.Name = Name; dest.Description = Description; dest.Obsolete = Obsolete; dest.Category = Category; dest.BuildDate = StrategicClock.GetDate(); dest.DesignDate = DesignDate; return(dest); }
IEnumerator FuelConsumption() { if (Mode != MoveMode.DOCKED) { Ships.ForEach(x => { x.UseShieldFuel(ShieldStrength); }); float time = 1f; while (StrategicClock.GetPhase() == Phase.GO) { while (StrategicClock.isPaused) { yield return(null); } time += Time.deltaTime; if (time >= 1) { time = 0f; Ships.ForEach(x => { x.UseMovementFuel(Speed); }); CalculateFleetSpeed(); } yield return(null); } } yield return(null); }
public Medal(string na, string desc, int p, int i) { Name = na; Description = desc; Points = p; DateDesigned = StrategicClock.GetDate(); ImageIndex = i; DesignedMedals.Add(this); }
public void JoinsTeam(Team t) { SetAssigned(true); string st = string.Format("{0}: <color=navy>{1}</color> join <color=magenta>{2}</color>.", StrategicClock.GetDate(), CharName, t.TeamName); EmpireLogEntry E = new EmpireLogEntry(LogCategories.DEFAULT, 5, empire, "OFFICER JOINS TEAM", st, new List <Character> { this }); CommissionDate = StrategicClock.GetDate(); AddHistory(st); }
public void ToggleDesignUI() { DesignUI.active = !DesignUI.active; if (!DesignUI.active) { StrategicClock.Unpause(); } else { StrategicClock.RequestPause(); } }
public void ToggleDesignUI() { gameObject.active = !gameObject.active; if (!gameObject.active) { StrategicClock.Unpause(); } else { StrategicClock.RequestPause(); } }
public void ToggleActive() { if (gameObject.active) { StrategicClock.Unpause(); gameObject.active = false; } else { ResetScroll(); StrategicClock.RequestPause(); gameObject.active = true; } }
public void ToggleActive() { if (gameObject.active) { StrategicClock.Unpause(); gameObject.active = false; } else { StrategicClock.RequestPause(); ResetScroll(); UpdateOfficerScroll(RolesDrop.value); gameObject.active = true; } }
void Pause(bool b) { pause = b; if (pause) { AllowMovement(false); } else { if (StrategicClock.GetPhase() == Phase.GO) { AllowMovement(true); } } }
public void Open(StrategicShipyard s) { AssignShipyard(s); ShipyardDropdown.ClearOptions(); List <string> YardNames = new List <string>(); empire.Yards.ForEach(x => { YardNames.Add(x.ShipYardName); }); ShipyardDropdown.AddOptions(YardNames); gameObject.SetActive(true); StrategicClock.RequestPause(); SetupSlipways(); }
public void JoinsUp() { string st = string.Format("{0}: <color=navy><color=navy>{1}</color></color> enlists at the rank of <color=yellow>{2}</color>.", StrategicClock.GetDate(), CharName, GetJobTitle()); CommissionDate = StrategicClock.GetDate(); AddHistory(st); SetAssigned(false); for (int d = 0; d < PersonalityAspects.Count; d++) { PersonalityAspects[d] += rnd.Next(-50, 50); } EmpireLogEntry E = new EmpireLogEntry(LogCategories.MILITARY, 5, empire, "OFFICER RECIEVES COMMISSION", st, new List <Character> { this }); }
public void ToggleActive() { if (gameObject.active) { StrategicClock.Unpause(); gameObject.active = false; } else { gameObject.SetActive(true); Months.value = StrategicClock.month; Years.value = StrategicClock.year; ResetScroll(); StrategicClock.RequestPause(); UpdateLog(); } }
public EmpireLogEntry(LogCategories l, int i, Empire e, string Head, string Descr = "", List <Character> chars = null, List <StrategicShip> ships = null, List <GroundUnit> units = null) { Priority = i; Category = l; if (Priority < 1) { Priority = 1; } if (Priority > 6) { Priority = 6; } Headline = Head; Description = Descr; InvolvedShips = ships; InvolvedGroundUnits = units; InvolvedCharacters = chars; Date = StrategicClock.GetDate(); // Debug.Log (Date); empire = e; e.AddLog(this); }
void Setup(ShipDesign template) { DesignClass = template; foreach (ShipComponents c in template.Components) { ShipComponents copy = c.CloneProperties(); Components.Add(copy); } UpdateComponentStatusStrings(); SetupArmor(template.ArmorLength, template.ArmorLayers, (float)template.ArmorType / 10); if (template.ArmorLayers > 0) { Armored = true; } mCrew = template.CrewMin; ChangeStats(); ArmorType = template.ArmorType; ChangeStats(); UpdateMaint(); AddHistory("Launched", string.Format("{0}: {1} is launched.", StrategicClock.GetDate(), ShipName)); CommissionDate = StrategicClock.GetDate(); Hull = template.Hull.Clone(); }
public void StepDownSeniorOfficer(StrategicShipyard s) { if (Location != s) { MoveTo(s); } NavalRole = NavalCommanderRole.NONE; SetAssigned(false); // shipPosting = null; Location = s; string st = string.Format("{0}: <color=navy>{1}</color> <color=orange>steps down</color> as the <color=cyan>Senior Officer</color> aboard <color=white>{2}</color>.", StrategicClock.GetDate(), GetNameString(), s.ShipYardName); AddHistory(st); }
public void AppointSeniorOfficer(StrategicShipyard s) { if (Location != s) { MoveTo(s); } s.SeniorOfficer = this; NavalRole = NavalCommanderRole.CMD; SetAssigned(true); // shipPosting = null; Location = s; string st = string.Format("{0}: <color=navy>{1}</color> is <color=green>appointed</color> the <color=cyan>Senior Officer</color> aboard <color=white>{2}</color>.", StrategicClock.GetDate(), GetNameString(), s.ShipYardName); AddHistory(st); }
public void StepDownCommander(GroundUnit s) { NavalRole = NavalCommanderRole.NONE; SetAssigned(false); // shipPosting = null; Location = s.Location; string st = string.Format("{0}: <color=navy>{1}</color> <color=orange>steps down</color> as the <color=cyan>Commander</color> of <color=grey>{2}</color?.", StrategicClock.GetDate(), GetNameString(), s.UnitName); AddHistory(st); }
public void AppointCommander(GroundUnit s) { if (Location != s) { MoveTo(s.Location); } NavalRole = NavalCommanderRole.CMD; SetAssigned(true); // shipPosting = null; Location = s.Location; string st = string.Format("{0}: <color=navy>{1}</color> is <color=green>appointed</color> the <color=cyan>Commander</color> of <color=grey>{2}</color>.", StrategicClock.GetDate(), GetNameString(), s.UnitName); AddHistory(st); }
public void StepDownXO(StrategicShip s) { SetAssigned(false); MoveTo(s); // s.AssignOfficer (this, NavalCommanderRole.XO); NavalRole = NavalCommanderRole.NONE; string st = string.Format("{0}: <color=navy>{1}</color> <color=orange>stands down</color> as <color=cyan>Executive Officer</color> of <color=white>{2}</color>.", StrategicClock.GetDate(), GetNameString(), s.ShipName); AddHistory(st); }
public void AppointXO(StrategicShip s) { if (s.Executive == this) { return; } SetAssigned(true); MoveTo(s); // shipPosting = s; s.AssignOfficer(this, NavalCommanderRole.XO); NavalRole = NavalCommanderRole.XO; string st = string.Format("{0}: <color=navy>{1}</color> is <color=green>appointed</color> <color=cyan>Executive Officer</color> of <color=white>{2}</color>.", StrategicClock.GetDate(), GetNameString(), s.ShipName); AddHistory(st); }
public void MoveTo(ILocation loc) { if (Location == loc) { return; } string FormerLoc = "NULL"; if (Location != null) { Location.MoveCharacterFromThis(this); FormerLoc = Location.GetLocationName(); } SetAssigned(false); Location = loc; string st = string.Format("{0}: <color=navy>{1}</color> <color=yellow>transfers</color> from <color=white>{2}</color> to <color=white>{3}</color>.", StrategicClock.GetDate(), GetNameString(true), FormerLoc, Location.GetLocationName()); AddHistory(st); Location.MoveCharacterToThis(this); }
public void Die() { string st = ""; SetAssigned(true); if (GetShipPosting() != null) { st = string.Format("{0}: <color=navy>{1}</color> was <color=red>killed</color> in the destruction of the <color=white>{2}</color>.", StrategicClock.GetDate(), GetNameString(), GetShipPosting().ShipName); } else { st = string.Format("{0}: <color=navy>{1}</color> was <color=red>killed</color> at.", StrategicClock.GetDate(), GetNameString(), Location.GetLocationName()); } AddHistory(st); // shipPosting = null; Alive = false; OutputDeath(); EmpireLogEntry E = new EmpireLogEntry(LogCategories.MILITARY, 3, empire, "OFFICER DEATH", st, new List <Character> { this }); }
public void StepDownGovernor(Colony s) { if (Location != s) { MoveTo(s); } NavalRole = NavalCommanderRole.NONE; SetAssigned(false); // shipPosting = null; Location = s; string st = string.Format("{0}: <color=navy>{1}</color> <color=orange>steps down</color> as the <color=cyan>Governor</color> of <color=white>{2}</color>.", StrategicClock.GetDate(), GetNameString(), s.ColonyName); AddHistory(st); }
public void AppointGovernor(Colony s) { if (Location != s) { MoveTo(s); } s.Governor = this; NavalRole = NavalCommanderRole.CMD; SetAssigned(true); // shipPosting = null; Location = s; string st = string.Format("{0}: <color=navy>{1}</color> is <color=green>appointed</color> the <color=cyan>Governor</color> of <color=white>{2}</color>.", StrategicClock.GetDate(), GetNameString(), s.ColonyName); AddHistory(st); }
public void AppointPoliticalOffice(PoliticalOffice pol, bool appointedNotRemoved = true) { SetAssigned(true); string st = appointedNotRemoved ? string.Format("{0}: <color=navy>{1}</color> is <color=green>appointed</color> the <color=cyan>Director</color> of the <color=white>{2}</color>.", StrategicClock.GetDate(), GetNameString(), pol.OfficeName) : string.Format("{0}: <color=navy>{1}</color> is <color=red>removed</color> as the <color=cyan>Director</color> of the <color=white>{2}</color>.", StrategicClock.GetDate(), GetNameString(), pol.OfficeName); AddHistory(st); }
public void PromoteNoble() { if (NobleRank == NobleRanks.Count - 1) { return; } Noble = true; NobleRank++; string st = string.Format("{0}: <color=navy>{1}</color> is raised to the station of <color=#C9BE62>{2}</color>.", StrategicClock.GetDate(), GetNameString(), GetNobleTitle()); AddHistory(st); }
public void Unassign() { NavalRole = NavalCommanderRole.NONE; SetAssigned(false); // shipPosting = null; string st = string.Format("{0}: <color=navy>{1}</color> has <color=red>no current assignment</color>.", StrategicClock.GetDate(), GetNameString(true)); AddHistory(st); }
public void Retire(bool Forced) { string st = ""; SetAssigned(true); if (Forced) { st = string.Format("{0}: <color=navy>{1}</color> was <color=red>dishonorably discharged</color> from the service.", StrategicClock.GetDate(), GetNameString()); } else { st = string.Format("{0}: <color=navy>{1}</color> {2} has <color=green>retired honorably</color> from the service.", StrategicClock.GetDate(), GetNobleTitle(), GetNameString()); } EmpireLogEntry E = new EmpireLogEntry(LogCategories.MILITARY, 3, empire, "OFFICER RETIRES", st, new List <Character> { this }); AddHistory(st); // shipPosting = null Role = OfficerRoles.Retired; }