コード例 #1
0
 public void UpdatePlayerCultText(CultData cd)
 {
     fireCult.text  = cd.GetLevels()[0].ToString();
     waterCult.text = cd.GetLevels()[1].ToString();
     earthCult.text = cd.GetLevels()[2].ToString();
     airCult.text   = cd.GetLevels()[3].ToString();
 }
コード例 #2
0
    // Use this for initialization
    public void SetUp(Faction.FactionType p_faction, int ID, GameObject bossObject)
    {
        //Set ID
        playerID               = ID;
        localPlayerObject      = bossObject;
        publicPlayerAttributes = bossObject.GetComponent <PlayerStatistics>();

        //Create player UI pieces. 7 pieces.
        playerPieces = new PlayerPiece[] { Instantiate(playerPeice).GetComponent <PlayerPiece>(), Instantiate(playerPeice).GetComponent <PlayerPiece>(), Instantiate(playerPeice).GetComponent <PlayerPiece>(), Instantiate(playerPeice).GetComponent <PlayerPiece>(),
                                           Instantiate(playerPeice).GetComponent <PlayerPiece>(), Instantiate(playerPeice).GetComponent <PlayerPiece>() };

        //Set the faction and tell it to set up an income map.
        faction = Faction.GetNewFaction(p_faction);
        faction.SetUp();

        //Setup playerPieces
        SetUpPieces();

        //points
        pk = new PointKeeper();
        publicPlayerAttributes.CmdSetPoints(20);

        //Shipping & terraform upgrade levels
        shipping = faction.GetDefaultShipping();
        current_upgrade_terraform = 0;

        //Starting list of "built upon" coordinates is empty
        buildingLocs = new List <Coordinate>();

        //Starting cult tracks
        cd = new CultData(faction.Get_Default_CultData());
        publicPlayerAttributes.CmdSetCultStandings(cd.GetLevels());

        //Setup UI to start with
        ui = GameObject.Find("UI").GetComponent <UI_Updater>();
        ui.UpdatePlayerBuildingCosts(faction.Get_cost_build_dwelling(), faction.Get_cost_build_TP(), faction.Get_cost_build_temple(), faction.Get_cost_build_sanctuary(), faction.Get_cost_build_stronghold());
        ui.UpdatePlayerCultText(cd);

        //Starting resources and income and update UI resources/income
        publicPlayerAttributes.CmdSetGold(faction.Starting_gold);
        publicPlayerAttributes.CmdSetWorkers(faction.Starting_worker);
        publicPlayerAttributes.CmdSetPriests(faction.Starting_priest);
        shovel_count = faction.Starting_shovels;

        CalculateIncome();

        tierMagic = faction.GetDefaultMagic(); UpdateMagicPublicVariables();

        PointsForTown = 7;

        //Update the UI after setting up all variables
        UpdateResourceText();
    }
コード例 #3
0
    public SingleIncome GetTotalBouns(CultData playersTotal)
    {
        int nankaiDekita = 0;

        if (playersTotal.GetLevels()[0] > 0)
        {
            nankaiDekita = cultCostPer.GetIncome()[0] / playersTotal.GetLevels()[0];
        }                                                                                                                //Fire
        if (playersTotal.GetLevels()[1] > 0)
        {
            nankaiDekita = cultCostPer.GetIncome()[1] / playersTotal.GetLevels()[1];
        }                                                                                                                 //water
        if (playersTotal.GetLevels()[2] > 0)
        {
            nankaiDekita = cultCostPer.GetIncome()[2] / playersTotal.GetLevels()[2];
        }                                                                                                                 //earth
        if (playersTotal.GetLevels()[3] > 0)
        {
            nankaiDekita = cultCostPer.GetIncome()[3] / playersTotal.GetLevels()[3];
        }                                                                                                                 //air

        return(cultPerBonus.Multiply(nankaiDekita));
    }