Example #1
0
    // Use this for initialization
    void Start()
    {
        Colony = StarSystem.GetSpaceTile(Location);
        StarSystem.TimeController.TimeObjects.Add(this);
        var sp = GetComponent <SpriteRenderer>();

        sp.sprite    = StarSystem.Spritemanager.GetSprite("colony");
        ColonyAction = ColonyAction.Mining;
        Attributes   = GetComponent <ColonyAttributes>();
        init         = true;
    }
Example #2
0
 void Build()
 {
     if (design != null)
     {
         buildLeft -= Buildrate;
         if (buildLeft < 0)
         {
             Empire.CreateEntity(Location, design);
             design       = null;
             ColonyAction = ColonyAction.Mining;
         }
     }
 }
Example #3
0
    public bool BuildShip(ShipDesign design)
    {
        if (ColonyAction != ColonyAction.Building && Empire.Resouces > design.Cost)
        {
            ColonyAction     = ColonyAction.Building;
            this.design      = design;
            buildLeft        = (design.BaseComponents.Count * 10) + design.MaxHp;
            Empire.Resouces -= design.Cost;
            return(true);
        }

        return(false);
    }