// Use this for initialization protected override void Awake() { ability = AbilityIDList.getAbility(AbilityID.summonWraith); health = GetComponent <BaseHealth>(); mana = GetComponent <BaseMana>(); if (health) { statBuffs = Comp <StatBuffs> .GetOrAdd(gameObject); tracker = Comp <SummonTracker> .GetOrAdd(gameObject); AbilityEventListener listener = Comp <AbilityEventListener> .GetOrAdd(gameObject); listener.onCritEvent += OnCrit; } // get wraith prefabs if (flameWraithPrefab == null) { Ability wraithAbility = Ability.getAbility(AbilityID.summonFlameWraith); if (wraithAbility && wraithAbility.abilityPrefab) { SummonEntityOnDeath summon = wraithAbility.abilityPrefab.GetComponent <SummonEntityOnDeath>(); if (summon) { flameWraithPrefab = summon.entity; } } wraithAbility = Ability.getAbility(AbilityID.summonPutridWraith); if (wraithAbility && wraithAbility.abilityPrefab) { SummonEntityOnDeath summon = wraithAbility.abilityPrefab.GetComponent <SummonEntityOnDeath>(); if (summon) { putridWraithPrefab = summon.entity; } } wraithAbility = Ability.getAbility(AbilityID.summonBloodWraith); if (wraithAbility && wraithAbility.abilityPrefab) { SummonEntityOnDeath summon = wraithAbility.abilityPrefab.GetComponent <SummonEntityOnDeath>(); if (summon) { bloodWraithPrefab = summon.entity; } } } // spirit escape prefab if (spiritEscapePrefab == null) { spiritEscapePrefab = PrefabList.getPrefab("spiritEscape"); } base.Awake(); }
// Use this for initialization protected override void Awake() { ability = AbilityIDList.getAbility(AbilityID.hammerThrow); base.Awake(); mana = GetComponent <BaseMana>(); health = GetComponent <BaseHealth>(); AbilityEventListener ael = AbilityEventListener.GetOrAdd(gameObject); ael.onHitEvent += OnHit; }
// Use this for initialization protected override void Awake() { ability = AbilityIDList.getAbility(AbilityID.tempest); base.Awake(); AbilityEventListener ael = AbilityEventListener.GetOrAdd(gameObject); ael.onHitEvent += OnHit; aoc = GetComponent <AbilityObjectConstructor>(); weaponInfoHolder = GetComponent <WeaponInfoHolder>(); }
// Use this for initialization protected override void Awake() { ability = AbilityIDList.getAbility(AbilityID.volatileReversal); AbilityEventListener ael = AbilityEventListener.GetOrAdd(gameObject); ael.onKillEvent += OnKill; chargeManager = GetComponent <ChargeManager>(); health = GetComponent <BaseHealth>(); base.Awake(); }
protected override void Awake() { ability = AbilityIDList.getAbility(AbilityID.entanglingRoots); base.Awake(); AbilityEventListener eventListener = GetComponent <AbilityEventListener>(); if (eventListener) { eventListener.onKillEvent += OnKill; } usingAbility = GetComponent <UsingAbility>(); }
public static AbilityEventListener GetOrAdd(GameObject _gameObject) { AbilityEventListener ael = _gameObject.GetComponent <AbilityEventListener>(); if (ael) { return(ael); } else { return(_gameObject.AddComponent <AbilityEventListener>()); } }
// Use this for initialization protected override void Awake() { ability = AbilityIDList.getAbility(AbilityID.glacier); mana = GetComponent <BaseMana>(); AbilityEventListener eventListener = GetComponent <AbilityEventListener>(); if (eventListener) { eventListener.onKillEvent += GainManaOnKill; eventListener.onHitEvent += GainManaOnHit; } base.Awake(); }
// Use this for initialization protected override void Awake() { ability = AbilityIDList.getAbility(AbilityID.serpentStrike); AbilityEventListener listener = GetComponent <AbilityEventListener>(); if (!listener) { listener = gameObject.AddComponent <AbilityEventListener>(); } listener.onKillEvent += onKill; listener.onCritEvent += onCrit; base.Awake(); }
void Start() { Transform parent = transform.parent; if (parent) { abilityEventListener = parent.GetComponent <AbilityEventListener>(); health = parent.GetComponent <BaseHealth>(); if (abilityEventListener) { abilityEventListener.onHitEvent += dealDamage; } } }
// Use this for initialization protected override void Awake() { ability = AbilityIDList.getAbility(AbilityID.staticOrb); base.Awake(); AbilityEventListener eventListener = GetComponent <AbilityEventListener>(); if (eventListener) { eventListener.onKillEvent += OnKill; eventListener.onHitEvent += OnHit; } protectionClass = GetComponent <ProtectionClass>(); mana = GetComponent <BaseMana>(); usingAbility = GetComponent <UsingAbility>(); }
// Use this for initialization protected override void Awake() { ability = AbilityIDList.getAbility(AbilityID.vengeance); base.Awake(); mana = GetComponent <BaseMana>(); health = GetComponent <BaseHealth>(); AbilityEventListener ael = AbilityEventListener.GetOrAdd(gameObject); statBuffs = Comp <StatBuffs> .GetOrAdd(gameObject); ua = GetComponent <UsingAbility>(); ael.onHitEvent += OnHit; ael.onHitEvent += OnKill; }
public void applyDamage(GameObject enemy) { ProtectionClass enemyProtection = enemy.GetComponent <ProtectionClass>(); if (enemyProtection) { List <HitEvents> hitEvents = enemyProtection.ApplyDamage(damageStats, gameObject); // react to the hit events CreationReferences references = GetComponent <CreationReferences>(); if (references && references.creator && references.creator.GetComponent <AbilityEventListener>()) { // get event listeners AbilityEventListener parentEventsListener = references.creator.GetComponent <AbilityEventListener>(); AbilityEventListener localEventsListener = GetComponent <AbilityEventListener>(); // call event methods if (hitEvents.Contains(HitEvents.Hit)) { parentEventsListener.HitEvent(references.thisAbility, enemy); if (localEventsListener) { localEventsListener.HitEvent(references.thisAbility, enemy); } } if (hitEvents.Contains(HitEvents.Crit)) { parentEventsListener.CritEvent(references.thisAbility, enemy); if (localEventsListener) { localEventsListener.CritEvent(references.thisAbility, enemy); } } if (hitEvents.Contains(HitEvents.Kill)) { parentEventsListener.KillEvent(references.thisAbility, enemy); if (localEventsListener) { localEventsListener.KillEvent(references.thisAbility, enemy); } } } } else { Debug.LogError("Enemy " + enemy.name + " has no protection class"); } }
// Use this for initialization protected override void Awake() { ability = AbilityIDList.getAbility(AbilityID.ripBlood); AbilityEventListener listener = Comp <AbilityEventListener> .GetOrAdd(gameObject); listener.onHitEvent += OnHit; listener.onKillEvent += OnKill; statBuffs = Comp <StatBuffs> .GetOrAdd(gameObject); tracker = Comp <SummonTracker> .GetOrAdd(gameObject); aoc = Comp <AbilityObjectConstructor> .GetOrAdd(gameObject); mana = GetComponent <BaseMana>(); baseStats = GetComponent <BaseStats>(); base.Awake(); }
// Use this for initialization protected override void Awake() { ability = AbilityIDList.getAbility(AbilityID.abyssalEchoes); base.Awake(); AbilityEventListener ael = GetComponent <AbilityEventListener>(); if (ael) { ael.onKillEvent += onKill; } aoc = GetComponent <AbilityObjectConstructor>(); statBuffs = Comp <StatBuffs> .GetOrAdd(gameObject); if (statBuffs == null) { statBuffs = gameObject.AddComponent <StatBuffs>(); } }
// Use this for initialization protected override void Awake() { ability = AbilityIDList.getAbility(AbilityID.swipe); AbilityEventListener listener = GetComponent <AbilityEventListener>(); if (!listener) { listener = gameObject.AddComponent <AbilityEventListener>(); } listener.onKillEvent += SummonOnKill; listener.onHitEvent += OnHit; base.Awake(); statBuffs = GetComponent <StatBuffs>(); if (statBuffs == null) { statBuffs = gameObject.AddComponent <StatBuffs>(); } }
// Use this for initialization protected override void Awake() { ability = AbilityIDList.getAbility(AbilityID.thornBurst); base.Awake(); ProtectionClass protectionClass = GetComponent <ProtectionClass>(); if (protectionClass) { GetComponent <ProtectionClass>().detailedDamageEvent += whenHit; } ua = GetComponent <UsingAbility>(); if (ua) { AbilityEventListener listener = GetComponent <AbilityEventListener>(); if (listener) { listener.onKillEvent += OnKill; listener.onHitEvent += OnHit; } } }
// Use this for initialization protected override void Awake() { ability = AbilityIDList.getAbility(AbilityID.manaStrike); base.Awake(); mana = GetComponent <BaseMana>(); AbilityEventListener ael = GetComponent <AbilityEventListener>(); if (ael) { ael.onHitEvent += onHit; ael.onKillEvent += onKill; ael.onCritEvent += onCrit; } aoc = GetComponent <AbilityObjectConstructor>(); lightningDisplacement = new Vector3(0f, 1f, 0f); statBuffs = GetComponent <StatBuffs>(); if (statBuffs == null) { statBuffs = gameObject.AddComponent <StatBuffs>(); } }
// Use this for initialization protected override void Awake() { ability = AbilityIDList.getAbility(AbilityID.sacrifice); dotTag.Add(Tags.AbilityTags.DoT); AbilityEventListener listener = Comp <AbilityEventListener> .GetOrAdd(gameObject); listener.onKillEvent += OnKill; BaseHealth health = GetComponent <BaseHealth>(); if (health) { statBuffs = Comp <StatBuffs> .GetOrAdd(gameObject); tracker = Comp <SummonTracker> .GetOrAdd(gameObject); } aoc = Comp <AbilityObjectConstructor> .GetOrAdd(gameObject); mana = GetComponent <BaseMana>(); baseStats = GetComponent <BaseStats>(); boneNovaOffset = new Vector3(0f, 1.2f, 0f); base.Awake(); }
// Use this for initialization protected override void Awake() { ability = AbilityIDList.getAbility(AbilityID.marrowShards); physTag.Add(Tags.AbilityTags.Physical); AbilityEventListener listener = Comp <AbilityEventListener> .GetOrAdd(gameObject); listener.onKillEvent += OnKill; listener.onCritEvent += OnCrit; health = GetComponent <BaseHealth>(); if (health) { statBuffs = Comp <StatBuffs> .GetOrAdd(gameObject); tracker = Comp <SummonTracker> .GetOrAdd(gameObject); } aoc = Comp <AbilityObjectConstructor> .GetOrAdd(gameObject); mana = GetComponent <BaseMana>(); baseStats = GetComponent <BaseStats>(); boneNovaOffset = new Vector3(0f, 1.2f, 0f); spiritEscapeOffset = new Vector3(0f, 1.1f, 0f); spiritEscapePrefab = PrefabList.getPrefab("spiritEscape"); base.Awake(); }