コード例 #1
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();
    }
コード例 #2
0
    //Method for local player to choose their faction.
    public void SetChosenFaction(int faction)
    {
        chosenFaction = (Faction.FactionType)faction;
        localPlayer.SetFaction((Faction.FactionType)faction);

        //Now change UI for player to display chosen faction information
        if (currentDisplayedDescription != null)
        {
            currentDisplayedDescription.SetActive(false);
        }
        currentDisplayedDescription = factionDescriptionsObject.GetChild(faction).gameObject;
        currentDisplayedDescription.SetActive(true);
    }
コード例 #3
0
    void Update()
    {
        //Check for changes.
        if (correspondingPlayer.PlayerFaction != currentFaction)
        {
            currentFaction = correspondingPlayer.PlayerFaction;
            UpdateLobbyEntity();
        }

        if (correspondingPlayer.IsReady != isReady)
        {
            isReady = correspondingPlayer.IsReady;
            UpdateReadyAesthetic();
        }
    }
コード例 #4
0
 public void SetCorrespondingPlayer(PlayerNetworked playerNetworked)
 {
     correspondingPlayer = playerNetworked;
     currentFaction      = correspondingPlayer.PlayerFaction;
     UpdateLobbyEntity();
 }
コード例 #5
0
 public void Cmd_SetFaction(Faction.FactionType i)
 {
     PlayerFaction = i;
 }
コード例 #6
0
 public string SetFaction(Faction.FactionType i)
 {
     Cmd_SetFaction(i);
     return(Faction.GetFaction(i));
 }