예제 #1
0
        public void FaceMapPoint(MapPointInformationData mapPointInformation, bool isAttacker = false)
        {
            attackedPointInformationData = new MapPointInformationData();
            attackedPointInformationData = mapPointInformation;

            isEngagedWithMapPoint = true;
            isPlayerAttacker      = isAttacker;

            LoadScene(SceneType.Battlefield);
            HideTabCover();
        }
    public static BattlefieldCommander ConvertTravellerToCommander(MapPointInformationData thisPoint)
    {
        BattlefieldCommander tmp = new BattlefieldCommander();

        tmp.heroesCarried = new List <BaseHeroInformationData>();

        tmp.unitsCarried = new List <TroopsInformation>();
        tmp.unitsCarried.AddRange(thisPoint.troopsStationed);
        tmp.unitMindset = thisPoint.aiMindset;

        if (thisPoint.leaderUnit != null)
        {
            tmp.heroesCarried.Add(thisPoint.leaderUnit);
        }

        return(tmp);
    }
예제 #3
0
    public void ObtainTerritoryRewards()
    {
        int taxMoney = TransitionManager.GetInstance.attackedPointInformationData.coinTax;

        // Tax Money
        if (playerWon)
        {
            ResourceReward taxPrize = new ResourceReward();
            taxPrize.resourceTitle = "Tax Prize";
            taxPrize.resourceType  = ResourceType.Coin;
            taxPrize.rewardAmount  = taxMoney;
            coinRewards.Add(taxPrize);
            PlayerGameManager.GetInstance.campaignData.totalWeeklyTax += taxMoney;
        }
        else if (TransitionManager.GetInstance.attackedPointInformationData.ownedBy == TerritoryOwners.Player)
        {
            PlayerGameManager.GetInstance.campaignData.totalWeeklyTax -= taxMoney;
        }


        // Obtain Map Point
        if (PlayerGameManager.GetInstance != null && PlayerGameManager.GetInstance.campaignData != null)
        {
            MapPointInformationData tmp = TransitionManager.GetInstance.attackedPointInformationData;

            if (PlayerGameManager.GetInstance.campaignData.mapPointList.Find(x => x.pointName == tmp.pointName) != null)
            {
                if (playerWon)
                {
                    PlayerGameManager.GetInstance.campaignData.mapPointList.Find(x => x.pointName == tmp.pointName).ownedBy = Maps.TerritoryOwners.Player;
                }
                else
                {
                    PlayerGameManager.GetInstance.campaignData.mapPointList.Find(x => x.pointName == tmp.pointName).ownedBy = enemyTerritoryName;
                }
            }

            SaveLoadManager.GetInstance.SaveCurrentCampaignData();
        }
    }