/// <summary> /// Called when the buff is destroyed. /// </summary> public override void OnDestroy() { if (GameControl.control.talente[3]) { if (jumpsLeft > 0) { List <Raider> raiderDict = RaiderDB.GetInstance().GetAllRaidersSortedByHealth(); raiderDict.Remove(GetRaider()); int countRaider = raiderDict.Count; for (int i = 0; i < countRaider; i++) { Raider target = raiderDict.First(); if (!target.GetGameObject().GetComponent <RenewHot>()) { target = raiderDict.First(); RenewHot buff = target.GetGameObject().AddComponent <RenewHot>(); buff.jumpsLeft = jumpsLeft - 1; break; } raiderDict.Remove(target); } } } }
/// <summary> /// Called when the buff is destroyed. /// Decreases jumps by 1 and applies the buff to another raider. /// </summary> public void Jump() { GetRaider().Heal(HEALAMOUNT); if (jumpsLeft > 0) { List <Raider> raiderDict = RaiderDB.GetInstance().GetAllRaidersSortedByHealth(); raiderDict.Remove(GetRaider()); int countRaider = raiderDict.Count; for (int i = 0; i < countRaider; i++) { Raider target = raiderDict.First(); if (!target.GetGameObject().GetComponent <PrayerBuff>()) { target = raiderDict.First(); PrayerBuff buff = target.GetGameObject().AddComponent <PrayerBuff>(); buff.jumpsLeft = jumpsLeft - 1; break; } raiderDict.Remove(target); } } }
/// <summary> /// Called when a cast is sucesfully finished. /// Applys the guardian spirit buff to the current target. /// Applys the guardian spirit invis buff to every other raider if the talent is selected. /// </summary> public override void OnCastSucess() { Raider target = GetTarget(); if (!target.GetGameObject().GetComponent <GuardianSpiritBuff>()) //check if target allready has the buff { GuardianSpiritBuff buff = target.GetGameObject().AddComponent <GuardianSpiritBuff>(); //apply new buff } else { target.GetGameObject().GetComponent <GuardianSpiritBuff>().Reset(); //refresh old buff } if (GameControl.control.talente[8]) //apply invis buff to every other raider if talent is picked { List <Raider> raiderDict = RaiderDB.GetInstance().GetAllRaidersSortedByHealth(); raiderDict.Remove(target); foreach (Raider raider in raiderDict) { GuardianSpiritBuffInvis buff = raider.GetGameObject().AddComponent <GuardianSpiritBuffInvis>(); } } }
private void GenerateBuff(Raider raider) { if (!raider.GetGameObject().GetComponent <FlammeBuff>()) { FlammeBuff buff = raider.GetGameObject().AddComponent <FlammeBuff>(); raider.GetGameObject().GetComponent <BuffManager>().RegisterBuff(buff); } else { raider.GetGameObject().GetComponent <FlammeBuff>().Reset(); } }
/// <summary> /// Called when a cast is sucesfully finished. Applies the PrayerBuff to the target. /// </summary> public override void OnCastSucess() { Raider target = GetTarget(); if (!target.GetGameObject().GetComponent <PrayerBuff>()) { target.GetGameObject().AddComponent <PrayerBuff>(); } else { target.GetGameObject().GetComponent <PrayerBuff>().Reset(); } }
/// <summary> /// Called on every fixed update. /// </summary> void FixedUpdate() { swingTimerCurrent += 0.02f; if (swingTimerCurrent > swingTimer - 2.05f && swingTimerCurrent < swingTimer - 1.95f) { GetComponent <Boss>().SetEmoteText(" " + emoteText); } cooldownOverlay.fillAmount = swingTimerCurrent / swingTimer; if (swingTimerCurrent >= swingTimer) { targetDict = new List <Raider>(RaiderDB.GetInstance().GetAllDDs()); if (target != null && targetDict.Count > 1) { targetDict.Remove(target); } if (targetDict.Count == 0) { targetDict = new List <Raider>(RaiderDB.GetInstance().GetAllRaiders()); } target = targetDict[Random.Range(0, targetDict.Count)]; target.GetGameObject().AddComponent <MarkDebuff>(); swingTimerCurrent = 0f; } }
/// <summary> /// Creates the heal text. /// </summary> /// <param name="position">The position.</param> /// <param name="raider">The raider.</param> /// <param name="amount">The Heal amount.</param> public void CreateHealText(Vector3 position, Raider raider, float amount) { GameObject text = (GameObject)Instantiate(dmgTextPrefab, position, Quaternion.identity); text.transform.SetParent(raider.GetGameObject().GetComponentInChildren <Canvas>().transform); text.GetComponent <CombatText>().Initialize(new Vector3(0.15f, 0.5f, -1), new Color32(0, 255, 0, 255), amount.ToString("F0")); }
public void jump() { targetDict = new List <Raider>(RaiderDB.GetInstance().GetAllRaiders()); for (int i = targetDict.Count - 1; i >= 0; i--) { if (targetDict[i].GetGameObject().GetComponent <DiaDebuff>() != null) { targetDict.RemoveAt(i); } } for (int i = 0; i < numberTargets; i++) { if (target != null && targetDict.Count > 1) { targetDict.Remove(target); } target = targetDict[UnityEngine.Random.Range(0, targetDict.Count)]; DiaDebuff debuff = target.GetGameObject().AddComponent <DiaDebuff>(); target.GetGameObject().GetComponent <BuffManager>().RegisterBuff(debuff); } }
void FixedUpdate() { swingTimerCurrent += 0.02f; if (swingTimerCurrent > swingTimer - 2.05f && swingTimerCurrent < swingTimer - 1.95f) { GetComponent <Boss>().SetEmoteText(" " + emoteText); } if (swingTimerCurrent >= swingTimer && !dotsApplyed) { targetDict = new List <Raider>(RaiderDB.GetInstance().GetAllRaiders()); for (int i = 0; i < numberTargets; i++) { if (target != null && targetDict.Count > 1) { targetDict.Remove(target); } target = targetDict[Random.Range(0, targetDict.Count)]; DiaDebuff debuff = target.GetGameObject().AddComponent <DiaDebuff>(); target.GetGameObject().GetComponent <BuffManager>().RegisterBuff(debuff); dotsApplyed = true; } } if (swingTimerCurrent >= dotDuration) { targetDict = new List <Raider>(RaiderDB.GetInstance().GetAllRaiders()); foreach (Raider target in targetDict) { DiaDebuff debuff = target.GetGameObject().GetComponent <DiaDebuff>(); if (debuff != null) { target.GetGameObject().GetComponent <BuffManager>().DeregisterBuff(debuff); Destroy(debuff); } } dotsApplyed = false; swingTimerCurrent = 0f; } }
/// <summary> /// Called with every fixed update. /// </summary> void FixedUpdate() { swingTimerCurrent += 0.02f; if (swingTimerCurrent > swingTimer - 2.05f && swingTimerCurrent < swingTimer - 1.95f && !healDebuff) { GetComponent <Boss>().SetEmoteText(" " + emoteText); } else if (swingTimerCurrent > swingTimer - 2.05f && swingTimerCurrent < swingTimer - 1.95f && healDebuff) { GetComponent <Boss>().SetEmoteText(" " + emoteText2); } cooldownOverlay.fillAmount = swingTimerCurrent / swingTimer; if (swingTimerCurrent >= swingTimer) { List <Raider> targetDict = new List <Raider>(RaiderDB.GetInstance().GetAllDDs()); if (targetDict.Count <= 0) { targetDict = new List <Raider>(RaiderDB.GetInstance().GetAllRaiders()); } if (target != null && targetDict.Count > 1) { targetDict.Remove(target); } if (healDebuff) { target = targetDict[Random.Range(0, targetDict.Count)]; target.GetGameObject().AddComponent <HealDebuff>(); healDebuff = false; BossModImage.sprite = Resources.Load("Dot_Debuff", typeof(Sprite)) as Sprite; } else if (!healDebuff) { target = targetDict[Random.Range(0, targetDict.Count)]; target.GetGameObject().AddComponent <DotDebuff>(); healDebuff = true; BossModImage.sprite = Resources.Load("Heal_Debuff", typeof(Sprite)) as Sprite; } swingTimerCurrent = 0f; } }
/// <summary> /// Called on every fixed update /// </summary> void FixedUpdate() { swingTimerCurrent += 0.02f; if (swingTimerCurrent > swingTimer - 2.05f && swingTimerCurrent < swingTimer - 1.95f) { GetComponent <Boss>().SetEmoteText(" " + emote); } cooldownOverlay.fillAmount = swingTimerCurrent / swingTimer; cooldownOverlay2.fillAmount = swingTimerCurrent / swingTimer; if (swingTimerCurrent >= swingTimer) { targetDict = new List <Raider>(RaiderDB.GetInstance().GetAllDDsSortedByHealth()); foreach (Raider raider in targetDict) { if (!raider.GetGameObject().GetComponent <StoneOne>() && !raider.GetGameObject().GetComponent <StoneTwo>()) { target = raider; } } if (target == null) { targetDict = new List <Raider>(RaiderDB.GetInstance().GetAllRaidersSortedByHealth()); foreach (Raider raider in targetDict) { if (!raider.GetGameObject().GetComponent <StoneOne>() && !raider.GetGameObject().GetComponent <StoneTwo>()) { target = raider; } } } if (target != null) { target.Damage(dmg1); target.GetGameObject().AddComponent <StoneOne>(); target = null; } targetDict = new List <Raider>(RaiderDB.GetInstance().GetAllDDsSortedByHealth()); foreach (Raider raider in targetDict) { if (!raider.GetGameObject().GetComponent <StoneOne>() && !raider.GetGameObject().GetComponent <StoneTwo>()) { target = raider; } } if (target == null) { targetDict = new List <Raider>(RaiderDB.GetInstance().GetAllRaidersSortedByHealth()); foreach (Raider raider in targetDict) { if (!raider.GetGameObject().GetComponent <StoneOne>() && !raider.GetGameObject().GetComponent <StoneTwo>()) { target = raider; } } } if (target != null) { target.Damage(dmg2); target.GetGameObject().AddComponent <StoneTwo>(); target = null; } swingTimerCurrent = 0f; } }
/// <summary> /// Fire Phase logic. /// </summary> private void FirePhase() { fireDotTimerCurrent += 0.02f; rangeAttackTimerCurrent += 0.02f; cooldownOverlayDebuff.fillAmount = fireDotTimerCurrent / fireDotTimer; if (fireDotTimerCurrent >= fireDotTimer) //apply a new Fire Dot { fireDotTimerCurrent = 0f; List <Raider> targetDict = new List <Raider>(); foreach (Raider raider in new List <Raider>(RaiderDB.GetInstance().GetAllDDs())) { if (!raider.GetGameObject().GetComponent <AlakirFeuerDebuff>()) { targetDict.Add(raider); } } if (targetDict.Count == 0) { foreach (Raider raider in new List <Raider>(RaiderDB.GetInstance().GetAllRaiders())) { if (!raider.GetGameObject().GetComponent <AlakirFeuerDebuff>()) { targetDict.Add(raider); } } } if (targetDict.Count == 0) { targetDict = RaiderDB.GetInstance().GetAllRaiders(); } Raider fireTarget = targetDict[Random.Range(0, targetDict.Count)]; fireTarget.GetGameObject().AddComponent <AlakirFeuerDebuff>(); fireTarget = null; } else if (rangeAttackTimerCurrent >= rangeAttackTimer) //Range AutoAttack { rangeAttackTimerCurrent = 0f; List <Raider> targetDict = new List <Raider>(RaiderDB.GetInstance().GetAllDDs()); if (rangeTarget != null && targetDict.Count > 1 && targetDict.Contains(rangeTarget)) { targetDict.Remove(rangeTarget); } rangeTarget = targetDict[Random.Range(0, targetDict.Count)]; rangeTarget.Damage(rangeAttackDamage); } else if (timeInPhase > phaseduration - 2.05f && timeInPhase < phaseduration - 1.95f) //emote for air phase { GetComponent <Boss>().SetEmoteText(" " + emotePhaseOne); } else if (timeInPhase > phaseduration) //switch to air phase { List <Raider> targetDict = new List <Raider>(RaiderDB.GetInstance().GetAllRaiders()); foreach (Raider target in targetDict) { target.GetGameObject().AddComponent <AlakirWasserDebuff>(); } BossModImagePhase.sprite = Resources.Load("Blizzard", typeof(Sprite)) as Sprite; BossModImageDebuff.sprite = Resources.Load("Luft", typeof(Sprite)) as Sprite; cooldownOverlayDebuff.enabled = false; fireDotTimerCurrent = 0f; phaseID = 2; timeInPhase = 0; } }