Exemplo n.º 1
0
 void UnregisterEventCallbacks()
 {
     DeathEventInfo.UnregisterListener(OnUnitDied);
     HPChangedEventInfo.UnregisterListener(OnHPChange);
     MPChangedEventInfo.UnregisterListener(OnMPChange);
     UnitSpawnEventInfo.UnregisterListener(OnUnitSpawn);
     CharacterTurnOverEventInfo.UnregisterListener(OnTurnOver);
 }
Exemplo n.º 2
0
        public void UnregisterEventCallbacks()
        {
            SelectedObjectEventInfo.UnregisterListener(OnHighlightSelected);
            CharacterReadyEventInfo.UnregisterListener(OnCharacterReady);

            BattleWonEventInfo.UnregisterListener(OnBattleWon);
            HPChangedEventInfo.UnregisterListener(OnHPChange);
            MPChangedEventInfo.UnregisterListener(OnMPChange);
            HeroDeathEventInfo.UnregisterListener(OnHeroDeath);
            DeathEventInfo.UnregisterListener(OnUnitDied);
            UnitSpawnEventInfo.UnregisterListener(OnUnitSpawn);
        }
Exemplo n.º 3
0
        //TODO... Look into the way HP and Mana is passed on for Hero's monsters.
        // Currently this is required to ensure persistance between battles.
        // I would prefer if this step was removed in favour of it being handled at battle end, like Hero HP and Mana
        // This updates the player's MonsterList info with the new HP for the monsters
        void OnHPChange(HPChangedEventInfo hpChangedEventInfo)
        {
            Debug.Log("CombatManager Alerted to Character HP Change: " + hpChangedEventInfo.UnitGO.name);

            // We only care about freindly monsters at this point
            if (hpChangedEventInfo.UnitGO.GetComponent <Character>().GetTeam == TeamName.Friendly)
            {
                string uID = hpChangedEventInfo.UnitGO.GetComponent <Character>().GetUniqueID;
                // Also, we only care about monsters in our playerMonsterInfoList (i.e NOT the hero) <- this is because the hero damage is tracked differently.
                if (playerMonsterinfoList.ContainsKey(uID))
                {
                    playerMonsterinfoList[hpChangedEventInfo.UnitGO.GetComponent <Character>().GetUniqueID].CurrentHP = hpChangedEventInfo.UnitGO.GetComponent <Character>().GetHP;

                    // Update Summon Menu
                    ActionMenu menu = monsterSpawner.PopulateHeroSummonMenu(GameManager.Instance.GetHeroData.heroWrapper.HeroData.HeroInfo);
                    playerCharacters[GameManager.Instance.GetHeroData.heroWrapper.HeroData.HeroInfo.PlayerName].GetComponent <Hero>().SetMenu(menu);
                }
            }
        }
Exemplo n.º 4
0
        void OnHPChange(HPChangedEventInfo hpChangedEventInfo)
        {
            Debug.Log("BattleUIController Alerted to Character HP Change: " + hpChangedEventInfo.UnitGO.name);

            UpdateCharacterPanelHP(hpChangedEventInfo.UnitGO);
        }