Exemplo 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();
    }
Exemplo 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();
 }
Exemplo 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();
 }
Exemplo 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();
 }
Exemplo n.º 5
0
 void PromptAction()
 {
     StrategicUIManager.UpdateUI();
     StrategicClock.RequestPause();
 }
Exemplo n.º 6
0
 public void SortShipsType()
 {
     RegenerateFleetShipNames();
     Ships = Ships.OrderBy(s => s.DesignClass.HullDesignation.Prefix).ThenBy(s => s.DesignClass.DesignName).ToList();
     StrategicUIManager.UpdateUI();
 }
Exemplo n.º 7
0
 public void SortShipsMass()
 {
     RegenerateFleetShipNames();
     Ships = Ships.OrderByDescending(s => s.Mass).ThenBy(s => s.DesignClass.DesignName).ToList();
     StrategicUIManager.UpdateUI();
 }