public void Start()
        {
            shopCraftingSystem = shopCraftingSystemBehaviour.system;
            agentShopSubSystem = shopCraftingSystem.shopSubSubSystem;

            getCurrentShopAgent       = GameObject.FindObjectOfType <GetCurrentShopAgent>();
            getCurrentAdventurerAgent = GameObject.FindObjectOfType <GetCurrentAdventurerAgent>();
        }
Beispiel #2
0
        public void Init()
        {
            adventurerSystemBehaviour = GameObject.FindObjectOfType <AdventurerSystemBehaviour>();
            adventurerSystem          = adventurerSystemBehaviour.system;

            SpawnAgents();

            //Get Adventurer Agent
            getAdventurerAgent = GameObject.FindObjectOfType <GetCurrentAdventurerAgent>();
            adventurerAgent    = getAdventurerAgent.CurrentAgent;

            //Generate travelSubsystem of the adventurerSystem
            travelSubsystem = adventurerSystem.travelSubsystem;
            travelSubsystem.Start();
            adventurerSystem.travelSubsystem = travelSubsystem;

            //Request System
            requestShopSystemBehaviour = GameObject.FindObjectOfType <RequestShopSystemBehaviour>();
            requestShopSystem          = requestShopSystemBehaviour.system;
            requestSystem = requestShopSystem.requestSystem;
            requestSystem.Start();

            //Generate PlayerFighterData of the adventurerAgent
            adventurerAgent.gameObject.GetComponent <AdventurerFighterData>().Start();
            //Generate adventurerInventory of the adventurerAgent
            adventurerInventory = adventurerAgent.adventurerInventory;
            //Generate agentInventory of the adventurerAgent
            adventurerAgentInventory = adventurerAgent.inventory;
            adventurerAgent.ResetEconomyAgent();
            //Generate AdventurerRequestTaker
            adventurerAgent.requestTaker.Start();


            //Get ShopAgent
            getShopAgent = GameObject.FindObjectOfType <GetCurrentShopAgent>();
            shopAgent    = getShopAgent.CurrentAgent;
            shopAgent.shopInput.Awake();
            shopAgent.agentInventory.ResetInventory();
            shopAgent.craftingInventory.ResetInventory();
            shopAgent.wallet.Reset();

            //ShopSystem
            shopCraftingSystemBehaviour = GameObject.FindObjectOfType <ShopCraftingSystemBehaviour>();
            shopCraftingSystemBehaviour.Start();
            agentShopSubSystem = shopCraftingSystemBehaviour.system.shopSubSubSystem;
            craftingSubSystem  = shopCraftingSystemBehaviour.system.craftingSubSubSystem;

            //ResetSystem
            environmentReset = GameObject.FindObjectOfType <EnvironmentReset>();
            environmentReset.Start();

            //Config
            configSystem = GameObject.FindObjectOfType <EconomyProject.Scripts.ConfigSystem>();
            configSystem.Start();
        }
Beispiel #3
0
        /// <summary>
        /// Manage UI
        /// </summary>
        /// <param name="choice">Int associate to a specific UI action</param>
        /// <param name="resourceRequestToTake">Mandatory if choice = TakeResourceRequest</param>
        /// <param name="itemToBuy">Mandatory if choice = PurchaseItem</param>
        public void SetAction(EAdventurerAgentChoices choice, CraftingResourceRequest resourceRequestToTake = null, ShopItemUi?itemToBuy = null)
        {
            agentChoice = choice;
            switch (choice)
            {
            case EAdventurerAgentChoices.None:
                break;

            case EAdventurerAgentChoices.MainMenu:
                adventurerInput.ChangeScreen(this, EAdventurerScreen.Main);
                break;

            case EAdventurerAgentChoices.ResourceRequest:
                adventurerInput.ChangeScreen(this, EAdventurerScreen.Request);
                break;

            case EAdventurerAgentChoices.Shop:
                adventurerInput.ChangeScreen(this, EAdventurerScreen.Shop);
                break;

            case EAdventurerAgentChoices.Adventure:
                adventurerInput.ChangeScreen(this, EAdventurerScreen.Adventurer);
                break;

            case EAdventurerAgentChoices.TakeResourceRequest:
                requestTaker.TakeRequest(resourceRequestToTake);
                break;

            case EAdventurerAgentChoices.PurchaseItem:
                AgentShopSubSystem shopCraftingSystem = GameObject.FindObjectOfType <ShopCraftingSystemBehaviour>().system.shopSubSubSystem;
                shopCraftingSystem.PurchaseItem(itemToBuy.Value.Seller, itemToBuy.Value.Item.itemDetails, this.wallet, this.adventurerInventory.agentInventory);
                break;

            case EAdventurerAgentChoices.AdventureForest:
                adventurerInput.adventurerSystem.system.StartBattle(this, BattleEnvironments.Forest);
                break;

            case EAdventurerAgentChoices.AdventureSea:
                adventurerInput.adventurerSystem.system.StartBattle(this, BattleEnvironments.Sea);
                break;

            case EAdventurerAgentChoices.AdventureMountain:
                adventurerInput.adventurerSystem.system.StartBattle(this, BattleEnvironments.Mountain);
                break;

            case EAdventurerAgentChoices.AdventureVolcano:
                adventurerInput.adventurerSystem.system.StartBattle(this, BattleEnvironments.Volcano);
                break;

            case EAdventurerAgentChoices.BattleAttack:
                adventurerInput.adventurerSystem.system.OnAttackButton(this);
                break;

            case EAdventurerAgentChoices.BattleHeal:
                adventurerInput.adventurerSystem.system.OnHealButton(this);
                break;

            case EAdventurerAgentChoices.BattleFlee:
                adventurerInput.adventurerSystem.system.OnFleeButton(this);
                break;

            default:
                Debug.Log("Wrong EAdventurerAgentChoices : " + choice);
                break;
            }
        }