Beispiel #1
0
    public void DestroyShip()
    {
        //	NameManager.RecycleName (this);
        //TODO
        AddHistory("Contact Lost", string.Format("\n{0}: <color=red>---Contact Lost---</color> ", StrategicClock.GetDate()));
        EmpireLogEntry E = new EmpireLogEntry(LogCategories.MILITARY, 2, Emp, "SHIP DESTROYED", string.Format("Contact has been lost with {0}.\nThe ships logs may contain more detailed information.", ShipName));

        Cargo.ForEach(x => {
            x.DestroyCargo();
        });
        Emp.Ships.Remove(this);
        if (ParentFleet)
        {
            ParentFleet.Ships.Remove(this);
        }
        if (Captain != null)
        {
            Captain.Die();
        }
        if (Executive != null)
        {
            Executive.Die();
        }
        foreach (Character c in CharactersAboard)
        {
            c.Die();
        }
    }
Beispiel #2
0
    public void TakeInternalHit(float damage, int counter = 0)      //skips armor
    {
        ShipComponents c = Components [random.Next(0, Components.Count)];

        if (!c.isDestroyed())
        {
            if (!UseMaintParts(c.MaintReq))
            {
                c.Damage();
                AddHistory("<color=yellow>Maintenance Failure</color>", string.Format("\n{0}: {1} experiences a maintenance failure with the {2}, repairs proved impossible with current supplies.", StrategicClock.GetDate(), ShipName, c.Name));
                EmpireLogEntry E = new EmpireLogEntry(LogCategories.MILITARY, 3, Emp, "MAINTENANCE FAILURE", string.Format("{0} has experienced a maintenance failure.", ShipName));
                ChangeStats();
            }
            else
            {
                AddHistory("<color=red>Maintenance Failure</color>", string.Format("\n{0}: {1} experiences a maintenance failure with the {2}, repairs were made with maintenance supplies.", StrategicClock.GetDate(), ShipName, c.Name));
                EmpireLogEntry E = new EmpireLogEntry(LogCategories.MILITARY, 4, Emp, "MAINTENANCE FAILURE", string.Format("{0} has experienced a maintenance failure. No damage reported.", ShipName), CharactersAboard, new List <StrategicShip> {
                    this
                });
            }
        }
        else
        {
            if (counter >= .85 * Components.Count)
            {
                DestroyShip();
                ShipLog += "\n<color=red>---Loss Resultant from Catastrophic Maintenance Failures---</color>";
            }
            TakeInternalHit(damage, counter++);
        }
    }
Beispiel #3
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: ");
     }
 }
    //Creates the actual strategic ship
    public void CompleteShip(ShipDesign design)
    {
        StrategicShip  s = new StrategicShip(design, empire);
        EmpireLogEntry E = new EmpireLogEntry(LogCategories.MILITARY, 4, empire, "STARSHIP CONSTRUCTED", string.Format("{0} has <color=green>finished construction</color> of a <color=silver>{1}</color>-Class {2}, the {3}.", ShipYardName, s.DesignClass.DesignName, s.DesignClass.HullDesignation.HullType, s.ShipName));

        DockedShips.Add(s);
        //TODO actually make the ship reference for the fleet list.  TODO is this still necessary?
    }
    public void AddSlipway()
    {
        Slipway s = new Slipway();

        s.parent = this;
        Slipways.Add(s);
        EmpireLogEntry E = new EmpireLogEntry(LogCategories.TECH, 5, empire, "SLIPWAY ADDED", string.Format("{0} has <color=green>added</color> a new <color=purple>Slipway</color>, bringing the total count up to {1}.", ShipYardName, Slipways.Count));
    }
Beispiel #6
0
    public void ChangeOwner(Empire newOwner)
    {
        empire.RemoveColony(this);
        newOwner.AddColony(this);
        EmpireLogEntry log  = new EmpireLogEntry(LogCategories.MILITARY, 1, empire, "COLONY LOST", string.Format("{0} on {1} has fallen to the forces of {2}.", ColonyName, planet.PlanetName, newOwner.EmpireName));
        EmpireLogEntry log2 = new EmpireLogEntry(LogCategories.MILITARY, 1, newOwner, "COLONY CONQUERED", string.Format("{0} on {1} has fallen to our forces.", ColonyName, planet.PlanetName));

        empire = newOwner;
    }
 public void MoveCharacterToThis(Character c)
 {
     if (!Explored)
     {
         Explored   = true;
         RegionName = string.Format("{0}'s {1}", c.CharName, RegionType.ToString());
         ChangeOwner(c.empire);
         EmpireLogEntry log2 = new EmpireLogEntry(LogCategories.EXPLORATION, 3, Owner, "REGION EXPLORED", string.Format("{0} on {1} has been explored.", RegionName, Planet.RegionToPlanet[this].PlanetName));
     }
 }
Beispiel #8
0
 public Colony(Empire emp, Race r, int pop, string nam = "Terra")
 {
     empire = emp;
     empire.AddColony(this);
     Population.Add(r, pop);
     ColonyName = nam;
     Empire.AllLocations.Add(this);
     StrategicClock.PhaseChange.AddListener(PhaseManager);
     EmpireLogEntry log = new EmpireLogEntry(LogCategories.DEFAULT, 3, empire, "COLONY ESTABLISHED", string.Format("{0} has been established on {1}.", ColonyName, planet.PlanetName));
 }
    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 DestroyUnit()
    {
        EmpireLogEntry E = new EmpireLogEntry(LogCategories.MILITARY, 3, empire, "Unit Lost", string.Format("<color=orange>{0}</color> has been <color=red>Destroyed</color at <color=blue>{1}</color>.", UnitName, Location.GetLocationName()), new List <Character>()
        {
            Commander
        });

        if (Commander != null)
        {
            Commander.AddHistory(string.Format("<color=orange>{0}</color> was <color=red>Destroyed</color at <color=blue>{1}</color> under the command of {2}.", UnitName, Location.GetLocationName(), Commander.GetNameString(true)));
            Commander.MoveTo(Location);
            CleanseReferences(this);
        }
    }
Beispiel #11
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 ChangeOwner(Empire e)
 {
     if (Owner != null)
     {
         EmpireLogEntry log  = new EmpireLogEntry(LogCategories.MILITARY, 2, Owner, "REGION LOST", string.Format("{0} on {1} has fallen to the forces of {2}.", RegionName, Planet.RegionToPlanet[this].PlanetName, e.EmpireName));
         EmpireLogEntry log2 = new EmpireLogEntry(LogCategories.MILITARY, 2, e, "REGION CONQUERED", string.Format("{0} on {1} has fallen to our forces.", RegionName, Planet.RegionToPlanet[this].PlanetName));
     }
     else
     {
         EmpireLogEntry log = new EmpireLogEntry(LogCategories.MILITARY, 4, e, "REGION CONTROLLED", string.Format("{0} on {1} is now under our control.", RegionName, Planet.RegionToPlanet[this].PlanetName));
     }
     Owner = e;
     if (RegionColony != null)
     {
         RegionColony.ChangeOwner(e);
     }
 }
Beispiel #13
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
        });
    }
Beispiel #14
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;
    }
Beispiel #15
0
    public void DoResearch()
    {
        List <ResearchProject> Completed = new List <ResearchProject> ();

        foreach (ResearchProject r in ResearchProjects)
        {
            if (r.DoResearch(ResearchRate))
            {
                Completed.Add(r);
                AddTech(r.tech);
                r.Scientist.DidResearch(r.tech.Name);
            }
        }
        foreach (ResearchProject rd in Completed)
        {
            EmpireLogEntry E = new EmpireLogEntry(LogCategories.TECH, 3, empire, "RESEARCH COMPLETED", string.Format("{0} has completed research into {1}.\nTech Description Follows:\n\t{2}", rd.Scientist.GetNameString(), rd.tech.Name, rd.tech.Description), new List <Character>()
            {
                rd.Scientist
            });
            ResearchProjects.Remove(rd);
        }
    }
Beispiel #16
0
    // Use this for initialization
    void Start()
    {
        AllEmpires.Add(this);
        for (int i = 0; i < 12; i++)
        {
            if (Logbook.ContainsKey(StrategicClock.strategicClock.GetFutureDate(i)))
            {
                Logbook.Add(StrategicClock.strategicClock.GetFutureDate(i), new List <EmpireLogEntry> ());
            }
        }
        Token = new DesignerToken(EmpireName);
//		Debug.Log (EmpireTechTree.TechByID.Count);
        AvailableTechs = EmpireTechTree.GetAvailableTech();
        //	Debug.Log (AvailableTechs.Count);
        foreach (Tech t in AvailableTechs)
        {
            DebugAvailableTechNames.Add(t.Name);
        }
        EmpireLogEntry E = new EmpireLogEntry(LogCategories.MILITARY, 1, this, "NOTHING BUT THE RAIN", string.Format("**//nothing but the rain-"));

        StartCoroutine(GenerateStartingOfficerCorps());
    }
Beispiel #17
0
    public void Setup(EmpireLogEntry p, EmpireLogManagerUI h)
    {
        e       = p;
        Manager = h;
        GetComponent <Image> ().color = Color.grey;
        r = GetComponent <RectTransform> ();
        t = GetComponentInChildren <Text> ();
        b = GetComponent <Button> ();
        CatColor.Add(LogCategories.DEFAULT, "<color=white>");
        CatColor.Add(LogCategories.ECONOMIC, "<color=green>");
        CatColor.Add(LogCategories.EXPLORATION, "<color=magenta>");
        CatColor.Add(LogCategories.MILITARY, "<color=red>");
        CatColor.Add(LogCategories.TECH, "<color=cyan>");
        t.fontSize = 18;
        t.GetComponent <RectTransform> ().localScale = new Vector3(1.5f, 1f, 1f);
        b.onClick.AddListener(Select);


        t.GetComponent <RectTransform>().offsetMin = new Vector2(130f, t.GetComponent <RectTransform>().offsetMin.y);
        t.alignment = TextAnchor.MiddleLeft;

        t.text = string.Format("{0}[{1}{2}</color>] {3}{4}</color> {5}", "", Colors[e.Priority], e.Priority, CatColor[e.Category], e.Category.ToString(), e.Headline);
    }
Beispiel #18
0
    public void CreateResearch(Character c, Tech t, int labs)
    {
        bool NoPriorProject = true;

        foreach (ResearchProject p in ResearchProjects)
        {
            if (p.tech == t || c == p.Scientist)
            {
                NoPriorProject = false;
            }
        }
        if (NoPriorProject)
        {
            ResearchProjects.Add(new ResearchProject(t, c, labs));
            EmpireLogEntry E = new EmpireLogEntry(LogCategories.TECH, 3, empire, "RESEARCH STARTED", string.Format("{0} has begun research into {1}.\nTech Description Follows:\n\t{2}", c.GetNameString(), t.Name, t.Description), new List <Character>()
            {
                c
            });
        }
        else
        {
            Debug.Log("Project already exists or Scientist is already working on a project.");
        }
    }
 public void SelectEntry(EmpireLogEntry e)
 {
     SelectedEntry = e;
     UpdateReadout();
 }