public void ConqueredBy(TerritoryOwners newOwner)
        {
            Debug.Log("New Owner of : " + myPointInformation.pointName + " is : " + newOwner.ToString());
            myPointInformation.ownedBy = newOwner;
            SaveData.SaveLoadManager.GetInstance.SaveCurrentCampaignData();

            StartCoroutine(myAnim.WaitAnimationForAction("Map Point Conquered Animation", UpdateFlagCrest));
        }
Exemple #2
0
    public void ReturnUnitsToEnemyData()
    {
        BattlefieldCommander enemyUnits = new BattlefieldCommander();

        if (TransitionManager.GetInstance.isPlayerAttacker)
        {
            enemyUnits = BattlefieldSpawnManager.GetInstance.defendingCommander;
        }
        else
        {
            enemyUnits = BattlefieldSpawnManager.GetInstance.attackingCommander;
        }


        if (TransitionManager.GetInstance.isEngagedWithTraveller)
        {
            if (!playerWon)
            {
                TransitionManager.GetInstance.attackedTravellerData.troopsCarried = new List <TroopsInformation>();
                TransitionManager.GetInstance.attackedTravellerData.troopsCarried.AddRange(enemyUnits.unitsCarried);
            }
            else
            {
                PlayerGameManager.GetInstance.campaignData.travellerList.Remove(TransitionManager.GetInstance.attackedTravellerData);
            }
        }
        else if (TransitionManager.GetInstance.isEngagedWithMapPoint)
        {
            enemyTerritoryName = TransitionManager.GetInstance.attackedPointInformationData.ownedBy;

            Debug.Log("[Victory While Engaged Against a Map Point]");
            if (!playerWon)
            {
                Debug.Log("[Map Point Still Has Troops Around: " + enemyUnits.CheckTotalTroopsCount() + "]");
                TransitionManager.GetInstance.attackedPointInformationData.troopsStationed = new List <TroopsInformation>();
                TransitionManager.GetInstance.attackedPointInformationData.troopsStationed.AddRange(enemyUnits.unitsCarried);

                TerritoryOwners pastOwner = TransitionManager.GetInstance.attackedPointInformationData.ownedBy;
                TransitionManager.GetInstance.attackedPointInformationData.previousOwner = pastOwner;
                TransitionManager.GetInstance.attackedPointInformationData.ownedBy       = enemyUnits.teamAffiliation;
            }
            else
            {
                TransitionManager.GetInstance.attackedPointInformationData.troopsStationed = new List <TroopsInformation>();

                TerritoryOwners pastOwner = TransitionManager.GetInstance.attackedPointInformationData.ownedBy;
                TransitionManager.GetInstance.attackedPointInformationData.previousOwner = pastOwner;

                TransitionManager.GetInstance.attackedPointInformationData.ownedBy = Maps.TerritoryOwners.Player;
            }
        }

        SaveLoadManager.GetInstance.SaveCurrentCampaignData();
    }
        public void ShowCampaignRewards(bool playerHasWon, List <ResourceReward> rewards, TerritoryOwners enemyOwner, BattlefieldCommander playerCommander)
        {
            CampaignRewardsPanel thisPanel = (playerHasWon) ? winRewardsPanel : defeatRewardsPanel;

            thisPanel.playerCommander = playerCommander;
            if (thisPanel.playerRewards == null)
            {
                thisPanel.playerRewards = new List <ResourceReward>();
            }
            thisPanel.playerRewards = rewards;
            thisPanel.enemyOwner    = enemyOwner;

            if (TransitionManager.GetInstance != null && TransitionManager.GetInstance.attackedPointInformationData != null)
            {
                thisPanel.territoryName.text = TransitionManager.GetInstance.attackedPointInformationData.pointName;
            }

            thisPanel.gameObject.SetActive(true);
        }