示例#1
0
 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: ");
     }
 }
示例#2
0
 public RelationshipModifier(Character c, int a, string desc)
 {
     Other       = c;
     Amount      = a;
     Description = desc;
     Date        = StrategicClock.GetDate();
 }
示例#3
0
    //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);
    }
示例#4
0
 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);
 }
示例#5
0
 public Medal(string na, string desc, int p, int i)
 {
     Name         = na;
     Description  = desc;
     Points       = p;
     DateDesigned = StrategicClock.GetDate();
     ImageIndex   = i;
     DesignedMedals.Add(this);
 }
示例#6
0
    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);
    }
示例#7
0
 public void ToggleDesignUI()
 {
     DesignUI.active = !DesignUI.active;
     if (!DesignUI.active)
     {
         StrategicClock.Unpause();
     }
     else
     {
         StrategicClock.RequestPause();
     }
 }
示例#8
0
 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;
     }
 }
示例#11
0
 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();
    }
示例#13
0
    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();
     }
 }
示例#15
0
    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);
    }
示例#16
0
 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();
 }
示例#17
0
    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);
    }
示例#18
0
    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);
    }
示例#19
0
    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);
    }
示例#20
0
    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);
    }
示例#21
0
    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);
    }
示例#22
0
    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);
    }
示例#23
0
    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);
    }
示例#24
0
    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
        });
    }
示例#25
0
    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);
    }
示例#26
0
    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);
    }
示例#27
0
    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);
    }
示例#28
0
    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);
    }
示例#29
0
    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);
    }
示例#30
0
    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;
    }