Esempio n. 1
0
    public void RegenerateFleetShipNames()
    {
        FleetShipNames = "";
        StringBuilder sb = new StringBuilder();

        if (Ships.Count > 0)
        {
            foreach (StrategicShip s in Ships)
            {
                sb.AppendLine(s.DesignClass.HullDesignation.Prefix + " " + s.ShipName);
                if (s.isDamaged)
                {
                    sb.Append(" [D]");
                }
            }
        }
        else
        {
            for (int i = 1; i < 40; i++)
            {
                sb.AppendLine(HullDes.DesDictionary[HullDes.HullTypes[Random.Range(0, 2)]].Prefix + " " + NameManager.GrabShipName());
            }
        }
        FleetShipNames = sb.ToString();
        StrategicUIManager.UpdateUI();
    }
Esempio n. 2
0
 public void IssueMovementCommand(Vector3 vec)
 {
     try{
         Agent.SetDestination(new Vector3(vec.x, transform.position.y, vec.z));
     }
     catch {
         Debug.Log("No agent assigned");
     }
     StrategicUIManager.UpdateUI();
 }
Esempio n. 3
0
 void HandleShields()
 {
     if (!ShieldsUp)
     {
         ShieldStrength = 0f;
     }
     else if (ShieldStrength < 1f)
     {
         ShieldStrength += 1f / TurnsToRaiseShields;
     }
     //literally impossible but we'll cover for it
     if (ShieldStrength > 1f)
     {
         ShieldStrength = 1f;
     }
     StrategicUIManager.UpdateUI();
 }
Esempio n. 4
0
 void OnTriggerEnter(Collider col)
 {
     if (col.GetComponent <Fleet> ())
     {
         Fleet f = col.GetComponent <Fleet> ();
         if (FactionMatrix.IsHostile(Faction, f.Faction))
         {
             EnemyClose.Add(f);
             if (!pause)
             {
                 PromptAction();
             }
         }
         else if (Faction == f.Faction)
         {
             FriendlyClose.Add(f);
         }
     }
     NearbyGameObjects.Add(col.gameObject);
     StrategicUIManager.UpdateUI();
 }
Esempio n. 5
0
 void PromptAction()
 {
     StrategicUIManager.UpdateUI();
     StrategicClock.RequestPause();
 }
Esempio n. 6
0
 public void SortShipsType()
 {
     RegenerateFleetShipNames();
     Ships = Ships.OrderBy(s => s.DesignClass.HullDesignation.Prefix).ThenBy(s => s.DesignClass.DesignName).ToList();
     StrategicUIManager.UpdateUI();
 }
Esempio n. 7
0
 public void SortShipsMass()
 {
     RegenerateFleetShipNames();
     Ships = Ships.OrderByDescending(s => s.Mass).ThenBy(s => s.DesignClass.DesignName).ToList();
     StrategicUIManager.UpdateUI();
 }
Esempio n. 8
0
 void Awake()
 {
     Manager = this;
     StrategicClock.PhaseChange.AddListener(TurnManagement);
 }