public void Execute()
        {
            var player = SystemContainer.GetSystem <Player.Player>();

            if (player.HasQuest(quest))
            {
                var playerQuest = player.data.quests.First(q => q.name == quest.name);
                playerQuest.SetStage(stage);
            }
        }
Exemple #2
0
 public void Execute()
 {
     if (giveItem)
     {
         SystemContainer.GetSystem <Player.Player>().inventory.AddItem(item.id);
     }
     else if (giveMoney)
     {
         SystemContainer.GetSystem <Player.Player>().data.money += money;
     }
 }
Exemple #3
0
        public Node GetNextNode()
        {
            var player = SystemContainer.GetSystem <Player.Player>();

            if (player.HasQuest(quest))
            {
                var playerQuest = player.data.quests.First(q => q.name == quest.name);
                return(GetOutputPort("stages " + playerQuest.progress.currentStage).Connection.node);
            }
            else
            {
                return(GetOutputPort("doesntHaveQuest").Connection.node);
            }
        }
Exemple #4
0
        private void Start()
        {
            data.position = transform.position;
            data.rotation = transform.rotation;

            for (int i = 0; i < startingInventory.Length; i++)
            {
                inventory.AddItem(startingInventory[i]);
                inventory.items[i].Equipped = true;
            }
            equipment.CheckEquipment();

            player = SystemContainer.GetSystem <Player.Player>();
            base.Start();
        }
Exemple #5
0
        private void OnEnable()
        {
            if (firstRun)
            {
                firstRun = false;
                return;
            }

            var player = SystemContainer.GetSystem <Player.Player>();

            container                = player.inventory;
            container.onItemAdded   += ItemAdded;
            container.onItemRemoved += ItemRemoved;
            moneyAmount.text         = player.data.money.ToString("N0");


            AddButtons();
            AddAllItems();
        }
Exemple #6
0
 protected virtual void Start()
 {
     SystemContainer.GetSystem <SaveGameManager>().Register(this);
 }
 public void Load()
 {
     Debug.Log("Loading saved game");
     Time.timeScale = 1;
     SystemContainer.GetSystem <SaveGameManager>().LoadSaveGame();
 }
 public void NewGame()
 {
     Debug.Log("Starting new game");
     Time.timeScale = 1;
     SystemContainer.GetSystem <SaveGameManager>().LoadGame();
 }
 public void Save()
 {
     SystemContainer.GetSystem <SaveGameManager>().Save();
 }
 public void LoadMainMenu()
 {
     Time.timeScale = 1;
     SystemContainer.GetSystem <SaveGameManager>().LoadMainMenu();
 }
 private void OnDeath()
 {
     SystemContainer.GetSystem <Player.Player>().StartQuest(quest);
 }
 public void Execute()
 {
     SystemContainer.GetSystem <Player.Player>().StartQuest(quest);
 }
Exemple #13
0
 protected override void DeathAnimationFinished()
 {
     disableMovement = false;
     SystemContainer.GetSystem <SaveGameManager>().LoadSaveGame();
 }
Exemple #14
0
 private void OnEnable()
 {
     buttons = new List <Button>();
     quests  = SystemContainer.GetSystem <Player.Player>().data.quests;
     CreateQuestButtons();
 }