예제 #1
0
    private void showCheatSheet()
    {
        cheatSheetPanel.SetActive(true);
        // int otherIndex = Int32.Parse(SelectionButton.transform.parent.parent.name);
        //State.setCurrentSelectedNationDiplomacy(otherIndex);
        Nation chosenNation = State.getNations()[State.getCurrentSlectedNationDiplomacy()];

        nationName.text = chosenNation.nationName.ToString();

        AP.text        = chosenNation.getAP().ToString();
        PP.text        = chosenNation.getDP().ToString();
        IP.text        = chosenNation.getIP().ToString();
        railroads.text = PlayerCalculator.getNumberProvRailRoads(chosenNation).ToString();
        trains.text    = chosenNation.industry.getNumberOfTrains().ToString();
        units.text     = chosenNation.landForces.Strength.ToString();
        numberProvDevelopments.text = PlayerCalculator.getNumberProvDevelopments(chosenNation).ToString();
        shipyard.text        = chosenNation.GetShipyardLevel().ToString();
        fort.text            = chosenNation.getFortLevel().ToString();
        warehouse.text       = chosenNation.GetCurrentWarehouseCapacity().ToString();
        colonialPoints.text  = chosenNation.ColonialPoints.ToString();
        infulencePoints.text = chosenNation.InfulencePoints.ToString();

        wheat.text  = chosenNation.getNumberResource(MyEnum.Resources.wheat).ToString("0,0");
        meat.text   = chosenNation.getNumberResource(MyEnum.Resources.meat).ToString("0,0");
        fruit.text  = chosenNation.getNumberResource(MyEnum.Resources.fruit).ToString("0,0");
        iron.text   = chosenNation.getNumberResource(MyEnum.Resources.iron).ToString("0,0");
        cotton.text = chosenNation.getNumberResource(MyEnum.Resources.cotton).ToString("0,0");;
        wood.text   = chosenNation.getNumberResource(MyEnum.Resources.wood).ToString("0,0");
        coal.text   = chosenNation.getNumberResource(MyEnum.Resources.coal).ToString("0,0");
        spice.text  = chosenNation.getNumberResource(MyEnum.Resources.spice).ToString("0,0");
        dyes.text   = chosenNation.getNumberResource(MyEnum.Resources.dyes).ToString("0,0");
        rubber.text = chosenNation.getNumberResource(MyEnum.Resources.rubber).ToString("0,0");
        oil.text    = chosenNation.getNumberResource(MyEnum.Resources.oil).ToString("0,0");

        steel.text     = chosenNation.getNumberGood(MyEnum.Goods.steel).ToString("0,0");
        lumber.text    = chosenNation.getNumberGood(MyEnum.Goods.lumber).ToString("0,0");
        fabric.text    = chosenNation.getNumberGood(MyEnum.Goods.fabric).ToString("0,0");
        parts.text     = chosenNation.getNumberGood(MyEnum.Goods.parts).ToString("0,0");
        arms.text      = chosenNation.getNumberGood(MyEnum.Goods.arms).ToString("0,0");
        clothing.text  = chosenNation.getNumberGood(MyEnum.Goods.clothing).ToString("0,0");
        furniture.text = chosenNation.getNumberGood(MyEnum.Goods.furniture).ToString("0,0");
        paper.text     = chosenNation.getNumberGood(MyEnum.Goods.paper).ToString("0,0");
        chemicals.text = chosenNation.getNumberGood(MyEnum.Goods.chemicals).ToString("0,0");
        telephone.text = chosenNation.getNumberGood(MyEnum.Goods.telephone).ToString("0,0");
        auto.text      = chosenNation.getNumberGood(MyEnum.Goods.auto).ToString("0,0");
        gear.text      = chosenNation.getNumberGood(MyEnum.Goods.gear).ToString("0.0");

        AdminAI admin = chosenNation.getAI().GetAdmin();

        ap_adds.text = admin.ApAdds.ToString();
        pp_adds.text = admin.PpAdds.ToString();
        ip_adds.text = admin.IpAdds.ToString();
        rp_adds.text = admin.IpAdds.ToString();
        turns.text   = chosenNation.getAI().numberOfTurns.ToString();

        WorldBank bank = State.bank;
        int       chosenNationIndex = chosenNation.getIndex();
        int       bondSize          = bank.BondSize;

        savings.text = (bank.getDeposits(chosenNation) * bondSize).ToString();
        debt.text    = (bank.getDebt(chosenNation) * bondSize).ToString();
    }
예제 #2
0
    public void UpdateDevelopmentPriorities(Nation player)
    {
        AdminAI admin        = player.getAI().GetAdmin();
        int     turn         = State.turn;
        int     numFactories = PlayerCalculator.getNumberOfFactories(player);
        //  int d = 5 - this.metaProgressPriorities[MyEnum.progressPriorities.investment];
        int possFact = admin.getPotentialFactoryUpgradeOptions(player).Count;

        if (possFact > 0)
        {
            adjustDevelopmentPriorityInLightOfPotential(player);
        }
        else
        {
            this.developmentPriorities[MyEnum.developmentPriorities.buildFactory]--;
        }

        if (numFactories / turn > 5 && possFact > 0)
        {
            this.developmentPriorities[MyEnum.developmentPriorities.buildFactory]++;
            this.metaPriorities[MyEnum.metaPriorities.development]++;
        }

        int provDevOpts = admin.getProviceDevelopmentOptions(player).Count;

        if (provDevOpts > 0)
        {
            adjustDevelopmentPriorityInLightOfPotential(player);
            this.developmentPriorities[MyEnum.developmentPriorities.developProvince]++;
            this.metaPriorities[MyEnum.metaPriorities.development]++;


            if (this.topPriority == MyEnum.staticPriorities.industry)
            {
                this.developmentPriorities[MyEnum.developmentPriorities.developProvince]++;
            }
            else if (this.secondPriory == MyEnum.staticPriorities.industry)
            {
                this.developmentPriorities[MyEnum.developmentPriorities.developProvince]++;
            }
        }
        else
        {
            this.developmentPriorities[MyEnum.developmentPriorities.developProvince]--;
        }


        if (PlayerCalculator.canUpgradeFort(player))
        {
            {
                this.developmentPriorities[MyEnum.developmentPriorities.fortification]++;
                this.metaPriorities[MyEnum.metaPriorities.development]++;
            }
        }
        else
        {
            this.developmentPriorities[MyEnum.developmentPriorities.fortification]--;
        }
        if (player.GetTechnologies().Contains("steam_locomotive"))
        {
            adjustDevelopmentPriorityInLightOfPotential(player);
            int numberRailroads = PlayerCalculator.getNumberProvRailRoads(player);
            if (numberRailroads < (player.getProvinces().Count + player.getColonies().Count))
            {
                this.metaPriorities[MyEnum.metaPriorities.development]++;
            }
            {
                this.developmentPriorities[MyEnum.developmentPriorities.railroad]++;
                if (this.topPriority == MyEnum.staticPriorities.industry)
                {
                    this.developmentPriorities[MyEnum.developmentPriorities.railroad]++;
                }
                else if (this.secondPriory == MyEnum.staticPriorities.industry)
                {
                    this.developmentPriorities[MyEnum.developmentPriorities.railroad]++;
                }
            }
        }

        if (PlayerCalculator.canUpgradeShipyard(player))
        {
            this.developmentPriorities[MyEnum.developmentPriorities.shipyard]++;
            if (this.topPriority == MyEnum.staticPriorities.colonies)
            {
                this.developmentPriorities[MyEnum.developmentPriorities.shipyard]++;
            }
        }

        if ((PlayerCalculator.calculateTotalResourceProduction(player) - (player.getProvinces().Count + player.getColonies().Count)) > player.industry.getNumberOfTrains())
        {
            this.developmentPriorities[MyEnum.developmentPriorities.trains]++;
            if (this.topPriority == MyEnum.staticPriorities.industry)
            {
                this.developmentPriorities[MyEnum.developmentPriorities.trains]++;
            }
            else if (this.secondPriory == MyEnum.staticPriorities.industry)
            {
                this.developmentPriorities[MyEnum.developmentPriorities.trains]++;
            }
        }


        if (player.numberOfResourcesAndGoods() + PlayerCalculator.calculateTotalResourceProduction(player) > player.GetCurrentWarehouseCapacity())
        {
            this.developmentPriorities[MyEnum.developmentPriorities.warehouse] += 3;
        }
        else
        {
            this.developmentPriorities[MyEnum.developmentPriorities.warehouse]--;
        }
    }