Ejemplo n.º 1
0
 public void register_capacity_change(int ID, int sum, int capacity)
 {
     if (TurnPhaser.I.active_disc_ID != ID)
     {
         return;
     }
     MapUI.update_capacity_text(city_capacityT, sum, capacity);
 }
Ejemplo n.º 2
0
    // ---Hire units UI---
    public void update_stat_text(int calling_class, string field, int val, int sum, int capacity)
    {
        TextMeshProUGUI t = null;

        if (calling_class == City.CITY)
        {
            city_inv.TryGetValue(field, out t);
            MapUI.update_capacity_text(city_capacityT, sum, capacity);
        }
        else if (calling_class == TurnPhaser.I.active_disc_ID)
        {
            disc_inv.TryGetValue(field, out t);
            MapUI.update_capacity_text(bat_capacityT, sum, capacity);
        }
        if (t != null)
        {
            t.text = val.ToString();
        }
    }
Ejemplo n.º 3
0
    private void upgrade(int ID)
    {
        if (is_purchased(FORGE2))
        {
            if (is_purchased(STABLE, BARRACKS2))
            {
                unlock_unit_purchase(PlayerUnit.DRAGOON);
            }
            if (is_purchased(CRAFT_SHOP, BARRACKS2))
            {
                unlock_unit_purchase(PlayerUnit.GUARDIAN);
            }
            if (ID == BARRACKS2)
            {
                unlock_unit_purchase(PlayerUnit.SCOUT);
            }
        }
        else if (is_purchased(FORGE))
        {
            if (ID == BARRACKS)
            {
                unlock_unit_purchase(PlayerUnit.GUARDIAN);
                unlock_unit_purchase(PlayerUnit.ARBALEST);
                unlock_unit_purchase(PlayerUnit.SKIRMISHER);
            }
            else if (ID == BARRACKS2)
            {
                unlock_unit_purchase(PlayerUnit.PALADIN);
            }
            else if (ID == TEMPLE2)
            {
                unlock_unit_purchase(PlayerUnit.MENDER);
            }
            else if (ID == STABLE)
            {
                unlock_unit_purchase(PlayerUnit.CARTER);
            }
            if (is_purchased(CRAFT_SHOP2, TEMPLE))
            {
                unlock_unit_purchase(PlayerUnit.DRUMMER);
            }
        }

        if (ID == TEMPLE)
        {
            unlock_unit_purchase(PlayerUnit.SEEKER);
        }
        if (ID == RUNE_PORT)
        {
            Map.I.city_cell.has_rune_gate      = true;
            Map.I.city_cell.restored_rune_gate = true;
        }
        else if (ID == SHARED_WISDOM)
        {
            Controller.I.astra.change_var(Storeable.UNITY, 10);
            Controller.I.endura.change_var(Storeable.UNITY, 10);
            Controller.I.martial.change_var(Storeable.UNITY, 10);
        }
        else if (ID == STOREHOUSE)
        {
            Controller.I.city.capacity += 36;
            MapUI.update_capacity_text(city_capacityT,
                                       Controller.I.city.get_sum_storeable_resources(), 108);
            MapUI.update_capacity_text(MapUI.I.city_capacityT,
                                       Controller.I.city.get_sum_storeable_resources(), 108);
        }
        else if (ID == STOREHOUSE2)
        {
            Controller.I.city.capacity += 36;
            MapUI.update_capacity_text(city_capacityT,
                                       Controller.I.city.get_sum_storeable_resources(), 144);
            MapUI.update_capacity_text(MapUI.I.city_capacityT,
                                       Controller.I.city.get_sum_storeable_resources(), 144);
        }
        else if (ID == FAITHFUL)
        {
            Controller.I.astra.change_var(Storeable.UNITY, 10);
            Controller.I.endura.change_var(Storeable.UNITY, 10);
            Controller.I.martial.change_var(Storeable.UNITY, 10);
        }
        else if (ID == REFINED_STARDUST)
        {
            Controller.I.astra.light_refresh_amount   = 5;
            Controller.I.endura.light_refresh_amount  = 5;
            Controller.I.martial.light_refresh_amount = 5;
        }
        else if (ID == STABLE)
        {
            equimare_transferB.interactable  = true;
            equimare_transferB2.interactable = true;
        }
        else if (ID == RESTORE_GREAT_TORCH)
        {
            Controller.I.city.light_refresh_amount = 11;
        }
        else if (ID == REFINED)
        {
        }
    }