private void CreateNewData() { AssetDatabase.CreateAsset(_statusEffect, "Assets/Scriptable Objects/Status Effects/DOT/" + _name + ".asset"); AssetDatabase.SaveAssets(); _statusEffect = CreateInstance <DamageOverTime>(); }
/// <summary> /// Apply a Damage Over Time effect to the target /// </summary> /// <param name="target">target GameObject.</param> /// <param name="lengthTime">length time.</param> /// <param name="tickTime">tick time.</param> /// <param name="dmgPerTick">damage per tick.</param> /// <param name="cause">source of the damage (burn, bleed, etc).</param> public void dmgApplyingSystem(GameObject target, float lengthTime, float tickTime, int dmgPerTick, BuffsAndBoons.Effects cause) { DamageOverTime dot = null; DamageOverTime[] allDoTs; allDoTs = target.GetComponents <DamageOverTime>(); foreach (DamageOverTime existingDoT in allDoTs) { if (existingDoT.getCause() == cause) { dot = existingDoT; } } if (dot == null) { dot = target.AddComponent <DamageOverTime>(); dot.setCause(cause); } else { dot.stopDoT(); } // A tenth of a second is added to the duration to ensure the last bit of a damage tick // can go off. If the last tick goes off as the DoT destroys itself, it doesn't seem // to apply. dot.setDuration(lengthTime + 0.1f); dot.setTickCooldown(tickTime); dot.setDamagePerTick(dmgPerTick); dot.startDoT(); }
public void ApplyDOT(float amount, int intervals) { DamageOverTime dot = new DamageOverTime(intervals, amount, Damage); StartCoroutine(dot.Start()); dots.Add(dot); }
public SkillStatistics() { Effect = new TimedPassiveEffect(); DamageOverTime = new DamageOverTime(); Damage = new Damage(); ProcEffect = new Rm_ProcEffect(); SpawnForTime = 10; HasDuration = true; LimitSpawnInstances = true; MaxInstances = 1; SkillPointsToLevel = 1; CoolDownTime = 1.0f; LevelReqToLevel = 1; Description = ""; BonusTaunt = 0; ChanceToRemoveStatusEffect = 1.0f; ChanceToApplyStatusEffect = 1.0f; ApplyStatusEffectWithDuration = true; ApplyStatusEffectDuration = 5.0f; RemoveStatusEffectID = ""; StatusEffectID = ""; EventOnHitID = ""; ItemToGiveID = ""; }
void Start() { MusicAndSounds.instance.playSoundFast(soundEffect, 3f); rb = GetComponent <Rigidbody2D> (); rb.velocity = transform.up * speed; dot = GetComponent <DamageOverTime> (); Destroy(gameObject, 3f); }
public void SetDoT(float dot) { DamageOverTime next = new DamageOverTime(); next.DoT = dot; next.DoTTime = 5f; overTime.SetDoT(next); }
public void ApplyEffect(HPModule target) { DamageOverTime myDamage = target.gameObject.AddComponent <DamageOverTime>(); myDamage.DamageSource = damageSource; myDamage.Damage = Damage; myDamage.Duration = Duration; myDamage.DamageInterval = DamageInterval; }
public StatusEffects clone() { DamageOverTime dot = new DamageOverTime(); dot.damage = this.damage; dot.hitsPerSecond = this.hitsPerSecond; dot.duration = this.duration; dot.typeOfDamage = this.typeOfDamage; return dot; }
private void SpawnDoTDamageTick(DamageOverTime dot) { if (!string.IsNullOrEmpty(dot.DamageTickPrefab)) { var prefab = Resources.Load(dot.DamageTickPrefab) as GameObject; var tickPrefab = (GameObject)Instantiate(prefab, transform.position, Quaternion.identity); tickPrefab.transform.parent = transform; tickPrefab.GetComponent <DestroyHelper>().Init(DestroyCondition.Time, DoTTickPrefabTime); } }
public static RPGAction AddDoT(BaseCharacterMono target, DamageOverTime damageOverTime) { var parameters = new Dictionary <string, object>() { { "Target", target }, { "DamageOverTime", damageOverTime } }; return(new RPGAction(RPGActionType.AddDamageOverTime, parameters)); }
public override void DoEffect(GameObject user, Vector2 direction = default, float magnitude = 0, int ignore = 0) { if (direction == default) { return; } Collider2D collider = user.GetComponent <Collider2D>(); RaycastHit2D rayHit; Vector2 start = user.transform.position; collider.enabled = false; GameManager.singleton.DisableCardColliders(); rayHit = Physics2D.Raycast(start, direction); collider.enabled = true; GameManager.singleton.EnableCardColliders(); if (rayHit.transform != null) { Entity ent = rayHit.transform.GetComponent <Entity>(); if (ent) { List <Aura> auras = ent.GetAuras(); DamageOverTime dot = CreateInstance <DamageOverTime>(); float totalDamage = 0; int totalDuration = 0; int numBurns = 0; foreach (Aura aura in auras) { if (aura.effect.damageType == AuraEffect.DamageType.Burn) { totalDamage += (aura.magnitude / aura.initialDuration) * aura.durationRemaining; totalDuration += aura.durationRemaining; numBurns++; aura.durationRemaining = 1; } } var halfDamage = totalDamage * 0.5f; var avgDuration = totalDuration / numBurns; dot.damageType = AuraEffect.DamageType.Burn; dot.icon = dotIcon; ent.ApplyAura(new Aura(ent, dot, halfDamage, avgDuration)); ent.TakeDamage(halfDamage); } } }
public void RemoveDamageOverTimeBySource(GameObject gameObject) { for (int i = activeDOTs.Count - 1; i >= 0; i--) { DamageOverTime DOT = activeDOTs[i]; if (DOT.source == gameObject) { activeDOTs.Remove(DOT); } } }
// Use this for initialization void Start() { laserAnimator = GetComponentInChildren <Animator>(); //Set up the line renderer laserLine = GetComponent <LineRenderer>(); laserLine.startWidth = laserLineWidth; laserLine.endWidth = laserLineWidth; laserLine.enabled = false; //Set up the trigger used for damage over time laserDamageBox = gameObject.AddComponent <BoxCollider>(); laserDamageBox.enabled = false; //Determine how long the laser should be RaycastHit hit; if (Physics.Raycast(laserStartPoint.position, transform.right, out hit, 100f, layerMask)) { laserEndPoint.position = laserStartPoint.position + transform.right * hit.distance; setLaserPositions(); laserDamageBox.isTrigger = true; laserDamageBox.center = new Vector3(hit.distance / 2, 0, 0); laserDamageBox.size = new Vector3(hit.distance, 1, 0.2f); } damgOverTime = GetComponent <DamageOverTime>(); /* * idleSource = gameObject.AddComponent<AudioSource>(); * idleSource.volume = volume; * idleSource.clip = laserIdle; * idleSource.loop = true; * idleSource.spatialBlend = 1.0f; * idleSource.Play(); * * onOffSource = gameObject.AddComponent<AudioSource>(); * onOffSource.loop = false; * onOffSource.volume = volume; * onOffSource.spatialBlend = 1.0f; * * onSource = gameObject.AddComponent<AudioSource>(); * onSource.loop = true; * onSource.clip = laserOn; * onSource.volume = volume; * onSource.spatialBlend = 1.0f; * onSource.Stop(); */ Invoke("StartCharging", startDelay); }
public override void OnEnter(Entity entity) { if (entity.HasIActionComponent <Life>(out Life life)) { //here this entity of type Life just enter //add entity if not already present if (!_damageOverTimePerEntity.TryGetValue(life, out DamageOverTime damage)) { DamageOverTime damageOverTime = new DamageOverTime(); _damageOverTimePerEntity.Add(life, damageOverTime); } } }
public void Action(Ability ability) { this.ability = ability; spawned = true; foreach (AbilityBehaviour ab in ability.Behaviours) { if (ab.AbilityBehaviorInfo.ObjectName == "Damage Over Time") { dot = (DamageOverTime)ab; } } StartCoroutine(WaitAndDestroy(ability.AbilityDuration, this.gameObject)); }
private void TakeDamageFromDOTs() { for (int i = activeDOTs.Count - 1; i >= 0; i--) { DamageOverTime DOT = activeDOTs[i]; if (DOT.CheckTime()) { Debug.Log("damge"); TakeDamage(DOT.damagePerTick, false); } if (!DOT.isActive) { activeDOTs.RemoveAt(i); } } }
public void AddEffectDmgOverTime(int damage, float tickRate, float duration) { DamageOverTime s = (DamageOverTime)listOfEffects.Get(typeof(DamageOverTime)); if (s == null) { s = new DamageOverTime(this.gameObject); if (s.isMissingComponents) { return; } listOfEffects.AddEffect(typeof(DamageOverTime), s); } s.damage = damage; s.tickRate = tickRate; s.cooldownComponent.NextCD(duration); }
void ProcessEffectSelection(int i) { Debug.Log(" processeffect " + i); if (typeof(DamageEffect).Name == EffectNames[i]) { DamageEffect tmp = new GameObject().AddComponent <DamageEffect>(); tmp.transform.SetParent(spell.transform); tmp = new DamageEffect(); return; } if (typeof(DamageOverTime).Name == EffectNames[i]) { DamageOverTime tmp = new GameObject().AddComponent <DamageOverTime>(); tmp.transform.SetParent(spell.transform); tmp = new DamageOverTime(); return; } if (typeof(HealEffect).Name == EffectNames[i]) { HealEffect tmp = new GameObject().AddComponent <HealEffect>(); tmp.transform.SetParent(spell.transform); tmp = new HealEffect(); return; } if (typeof(HealOverTime).Name == EffectNames[i]) { HealOverTime tmp = new GameObject().AddComponent <HealOverTime>(); tmp.transform.SetParent(spell.transform); tmp = new HealOverTime(); return; } if (typeof(BuffEffect).Name == EffectNames[i]) { BuffEffect tmp = new GameObject().AddComponent <BuffEffect>(); tmp.transform.SetParent(spell.transform); tmp = new BuffEffect(); return; } }
IEnumerator RecieveDamageOver(DamageOverTime dmg) { onDot = true; int currentCount = 0; while (currentCount < dmg.damageCount) { hitPoint -= dmg.damageAmount; GameManager.instance.ShowText(dmg.damageAmount.ToString(), 25, Color.red, transform.position, Vector3.zero, 0.5f); if (hitPoint <= 0) { onDot = false; hitPoint = 0; Death(); } yield return(new WaitForSeconds(dmg.time)); currentCount++; } onDot = false; }
public void Setup(LocalBlackboard localBlackboard, AttackRoot attackRoot) { _localBlackboard = localBlackboard; myCollider = _localBlackboard.healthCollider; _attackRoot = attackRoot; if (hitBox.TryGetComponent(out TriggerSensor temp)) { _triggerSensor = temp; _triggerSensor.Setup(this); } else { Debug.LogError(gameObject.name + " is missing a trigger sensor on it's hitbox. Add one or suffer the consequences O_O! ...x_x"); } if (TryGetComponent(out DamageOverTime temp2)) { _damageOverTime = temp2; _damageOverTime.Setup(_attackRoot); } }
protected override void OnCollide(Collider2D coll) { if (coll.name == "Player" || coll.name == "Hitbox" || coll.tag == "Spell") { return; } if (coll.tag == "Fighter") { // Create a new Damage object, then set to fighter that has been hit DamageOverTime dot = new DamageOverTime { damageAmount = spellDamage[spellLevel], origin = transform.position, pushForce = pushForce[spellLevel], time = dmgTime, damageCount = countDmg }; coll.SendMessage("StartSwag", dot); } Destroy(gameObject); }
public void SetDoT(DamageOverTime damageOverTime) { DoT = damageOverTime.DoT; DoTTime = damageOverTime.DoTTime; }
public static bool Prefix(DamageOverTime __instance) { DeathRun.setCause(DeathRun.CAUSE_UNKNOWN_CREATURE); DeathRun.setCauseObject(__instance.gameObject); return(true); }
public void AddDamageOverTime(GameObject source, int damagePerTick, int timeBetweenTicks, bool indefinite) //Worried about a source not being a gameObject here { DamageOverTime DOT = new DamageOverTime(source, damagePerTick, timeBetweenTicks, 1, true); activeDOTs.Add(DOT); }
public void Initialize(MyCharacterController controller) { characterStats.setChar(this); this.topDownController = controller; skillMenu = GameObject.Find("Food Skills").GetComponent<SkillMenu>(); skillMenu.SetCharacter(this); abDB = GameObject.Find("Databases").GetComponent<AbilityDatabase>(); SkillMenu characterSkills = GameObject.Find("Character Skills").GetComponent<SkillMenu>(); characterSkills.SetCharacter(this); for (int i = 0; i < charAbilitiesIndex.Count; i++) addCharAbilities(abDB.getAbilityById(charAbilitiesIndex[i])); tasteTranslater = new SimpleTasteTranslation(); skillMenu.updateSkillList(); characterSkills.updateSkillList(); //to refresh their setter characterStats.MovementSpeed = characterStats.MovementSpeed; characterStats.AttackSpeed = characterStats.AttackSpeed; DamageOverTime dot = new DamageOverTime(); dot.duration = 6; dot.damage = 20; dot.hitsPerSecond = 1; dot.ChanceOfApplying = 25; dot.typeOfDamage = TypeOfEffects.fire; onHitStatusEffects.Add(dot); }
public static async Task <bool> Combat() { if (BotManager.Current.IsAutonomous) { if (Core.Me.HasTarget) { Movement.NavigateToUnitLos(Core.Me.CurrentTarget, 20 + Core.Me.CurrentTarget.CombatReach); } } if (await Casting.TrackSpellCast()) { return(true); } await Casting.CheckForSuccessfulCast(); BardRoutine.RefreshVars(); if (!Core.Me.HasTarget || !Core.Me.CurrentTarget.ThoroughCanAttack()) { return(false); } if (await CustomOpenerLogic.Opener()) { return(true); } if (BardRoutine.GlobalCooldown.CanWeave()) { // Utility if (await Utility.RepellingShot()) { return(true); } if (await Utility.WardensPaean()) { return(true); } if (await Utility.NaturesMinne()) { return(true); } if (await Utility.Troubadour()) { return(true); } if (await PhysicalDps.ArmsLength(BardSettings.Instance)) { return(true); } if (await PhysicalDps.SecondWind(BardSettings.Instance)) { return(true); } if (await PhysicalDps.Interrupt(BardSettings.Instance)) { return(true); } // Damage if (await SingleTarget.LastPossiblePitchPerfectDuringWM()) { return(true); } if (await Songs.LetMeSingYouTheSongOfMyPeople()) { return(true); } if (await Cooldowns.RagingStrikes()) { return(true); } if (await Cooldowns.BattleVoice()) { return(true); } if (await Cooldowns.RadiantFinale()) { return(true); } if (await Cooldowns.Barrage()) { return(true); } if (await SingleTarget.PitchPerfect()) { return(true); } if (await Aoe.RainOfDeathDuringMagesBallard()) { return(true); } if (await SingleTarget.BloodletterInMagesBallard()) { return(true); } if (await SingleTarget.EmpyrealArrow()) { return(true); } if (await SingleTarget.Sidewinder()) { return(true); } if (await Aoe.RainOfDeath()) { return(true); } if (await SingleTarget.Bloodletter()) { return(true); } } if (await DamageOverTime.IronJawsOnCurrentTarget()) { return(true); } if (await DamageOverTime.SnapShotIronJawsOnCurrentTarget()) { return(true); } if (await SingleTarget.StraightShotAfterBarrage()) { return(true); } if (await DamageOverTime.WindbiteOnCurrentTarget()) { return(true); } if (await DamageOverTime.VenomousBiteOnCurrentTarget()) { return(true); } if (await Aoe.BlastArrow()) { return(true); } if (await Aoe.ApexArrow()) { return(true); } if (await Aoe.ShadowBite()) { return(true); } if (await DamageOverTime.IronJawsOnOffTarget()) { return(true); } if (await DamageOverTime.WindbiteOnOffTarget()) { return(true); } if (await DamageOverTime.VenomousBiteOnOffTarget()) { return(true); } if (await Aoe.LadonsBite()) { return(true); } if (await SingleTarget.StraightShot()) { return(true); } return(await SingleTarget.HeavyShot()); }
/// <summary> /// Damages the enemy over time. /// Updates a coroutine that flashes a color over the <see cref="EnemyBase"/> sprite. /// </summary> /// <param name="damage">The total damage.</param> /// <param name="duration">Duration of effect.</param> /// <param name="interval">The interval to inflict damage.</param> /// <param name="status">The status of the enemy.</param> public void DamageOverTime(int damage, float duration, float interval, StatusEffects status) { if (status == StatusEffects.Poison) { IBuff buff = new DamageOverTime(this, duration, damage, interval); this.debuffs.Add(buff); this.StartOrUpdateCoroutine(status, duration); } else if (status == StatusEffects.Burn) { IBuff buff = new DamageOverTime(this, duration, damage, interval); this.debuffs.Add(buff); this.StartOrUpdateCoroutine(status, duration); } }
public static async Task <bool> Execute() { Group.UpdateAllies(); if (Core.Me.IsCasting) { return(true); } if (await Casting.TrackSpellCast()) { return(true); } await Casting.CheckForSuccessfulCast(); Globals.InParty = PartyManager.IsInParty; Globals.PartyInCombat = Globals.InParty && Utilities.Combat.Enemies.Any(r => r.TaggerType == 2) || Core.Me.InCombat; Utilities.Routines.Bard.RefreshVars(); if (!Core.Me.HasTarget || !Core.Me.CurrentTarget.ThoroughCanAttack()) { return(false); } if (await CustomOpenerLogic.Opener()) { return(true); } if (BotManager.Current.IsAutonomous) { if (Core.Me.HasTarget) { Movement.NavigateToUnitLos(Core.Me.CurrentTarget, 20); } } if (Weaving.GetCurrentWeavingCounter() < 2 && Spells.HeavyShot.Cooldown.TotalMilliseconds > 650 + BaseSettings.Instance.UserLatencyOffset) { // Utility if (await Utility.RepellingShot()) { return(true); } if (await Utility.WardensPaean()) { return(true); } if (await Utility.NaturesMinne()) { return(true); } if (await Utility.Troubadour()) { return(true); } if (await PhysicalDps.ArmsLength(BardSettings.Instance)) { return(true); } if (await PhysicalDps.SecondWind(BardSettings.Instance)) { return(true); } if (await Utility.HeadGraze()) { return(true); } // Damage if (await SingleTarget.LastPossiblePitchPerfectDuringWM()) { return(true); } if (await Songs.LetMeSingYouTheSongOfMyPeople()) { return(true); } if (await Cooldowns.BattleVoice()) { return(true); } if (await Cooldowns.RagingStrikes()) { return(true); } if (await Cooldowns.Barrage()) { return(true); } if (await SingleTarget.PitchPerfect()) { return(true); } if (await Aoe.RainOfDeathDuringMagesBallard()) { return(true); } if (await SingleTarget.BloodletterInMagesBallard()) { return(true); } if (await SingleTarget.EmpyrealArrow()) { return(true); } if (await Aoe.ShadowBite()) { return(true); } if (await SingleTarget.Sidewinder()) { return(true); } if (await Aoe.RainOfDeath()) { return(true); } if (await SingleTarget.Bloodletter()) { return(true); } } if (await SingleTarget.StraightShotAfterBarrage()) { return(true); } if (await DamageOverTime.IronJawsOnCurrentTarget()) { return(true); } if (await DamageOverTime.SnapShotIronJawsOnCurrentTarget()) { return(true); } if (await DamageOverTime.WindbiteOnCurrentTarget()) { return(true); } if (await DamageOverTime.VenomousBiteOnCurrentTarget()) { return(true); } if (await Aoe.ApexArrow()) { return(true); } if (await DamageOverTime.IronJawsOnOffTarget()) { return(true); } if (await DamageOverTime.WindbiteOnOffTarget()) { return(true); } if (await DamageOverTime.VenomousBiteOnOffTarget()) { return(true); } if (await Aoe.QuickNock()) { return(true); } if (await SingleTarget.StraightShot()) { return(true); } return(await SingleTarget.HeavyShot()); }
public void TriggerEffect(SkillType type, int rank, bool friendly, uint target, uint owner) { uint eid = Entity.NextEntity(); HealOverTime HoT; TimedEffect time; DamageOverTime DoT; Buff buff; InstantEffect instantEffect; DirectDamage directDamage; InstantEffect instant; switch (type) { #region Vermis Triggered SKills #region ThrownBlade case SkillType.ThrownBlades: if (friendly) return; eid = Entity.NextEntity(); instantEffect = new InstantEffect() { EntityID = eid, isTriggered = true }; DirectDamage damage; switch (rank) { #region Rank 1 case 1: damage = new DirectDamage() { Damage = 10, EntityID = eid, TargetID = target, }; break; #endregion #region Rank 2 case 2: damage = new DirectDamage() { Damage = 10, EntityID = eid, TargetID = target, }; break; #endregion #region Rank 3 case 3: damage = new DirectDamage() { Damage = 11, EntityID = eid, TargetID = target, }; break; #endregion #region Rank 4 case 4: damage = new DirectDamage() { Damage = 11, EntityID = eid, TargetID = target, }; break; #endregion #region Rank 5 case 5: damage = new DirectDamage() { Damage = 12, EntityID = eid, TargetID = target, }; break; #endregion #region Rank 6 case 6: damage = new DirectDamage() { Damage = 12, EntityID = eid, TargetID = target, }; break; #endregion #region Rank 7 case 7: damage = new DirectDamage() { Damage = 13, EntityID = eid, TargetID = target, }; break; #endregion #region Rank 8 case 8: damage = new DirectDamage() { Damage = 13, EntityID = eid, TargetID = target, }; break; #endregion #region Rank 9 case 9: damage = new DirectDamage() { Damage = 14, EntityID = eid, TargetID = target, }; break; #endregion #region Rank 10 case 10: damage = new DirectDamage() { Damage = 15, EntityID = eid, TargetID = target, }; break; #endregion default: throw new Exception("Unimplemented Rank"); } _game.DirectDamageComponent.Add(eid, damage); instant = new InstantEffect() { EntityID = eid, isTriggered = false, }; _game.InstantEffectComponent.Add(eid, instant); break; #endregion //unsure how to properly trigger, left unimplemented #region Caustic Weapons case SkillType.CausticWeapons: switch (rank) { #region Rank 1 case 1: break; #endregion #region Rank 2 case 2: break; #endregion #region Rank 3 case 3: break; #endregion #region Rank 4 case 4: break; #endregion #region Rank 5 case 5: break; #endregion #region Rank 6 case 6: break; #endregion #region Rank 7 case 7: break; #endregion #region Rank 8 case 8: break; #endregion #region Rank 9 case 9: break; #endregion #region Rank 10 case 10: break; #endregion default: throw new Exception("Unimplemented Rank"); } break; #endregion #region BenignParasite case SkillType.BenignParasite: if (!friendly) return; eid = Entity.NextEntity(); switch (rank) { #region Rank 1 case 1: HoT = new HealOverTime() { AmountPerTick = 1, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = target, TickTime = 1, }; _game.HealOverTimeComponent.Add(eid, HoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 10, TotalDuration = 10, }; _game.TimedEffectComponent.Add(eid, time); break; #endregion #region Rank 2 case 2: HoT = new HealOverTime() { AmountPerTick = 1, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = target, TickTime = 1, }; _game.HealOverTimeComponent.Add(eid, HoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 12, TotalDuration = 12, }; _game.TimedEffectComponent.Add(eid, time); break; #endregion #region Rank 3 case 3: HoT = new HealOverTime() { AmountPerTick = 2, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = target, TickTime = 1, }; _game.HealOverTimeComponent.Add(eid, HoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 12, TotalDuration = 12, }; _game.TimedEffectComponent.Add(eid, time); break; #endregion #region Rank 4 case 4: HoT = new HealOverTime() { AmountPerTick = 2, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = target, TickTime = 1, }; _game.HealOverTimeComponent.Add(eid, HoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 14, TotalDuration = 14, }; _game.TimedEffectComponent.Add(eid, time); break; #endregion #region Rank 5 case 5: HoT = new HealOverTime() { AmountPerTick = 3, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = target, TickTime = 1, }; _game.HealOverTimeComponent.Add(eid, HoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 14, TotalDuration = 14, }; _game.TimedEffectComponent.Add(eid, time); break; #endregion #region Rank 6 case 6: HoT = new HealOverTime() { AmountPerTick = 3, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = target, TickTime = 1, }; _game.HealOverTimeComponent.Add(eid, HoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 16, TotalDuration = 16, }; _game.TimedEffectComponent.Add(eid, time); break; #endregion #region Rank 7 case 7: HoT = new HealOverTime() { AmountPerTick = 4, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = target, TickTime = 1, }; _game.HealOverTimeComponent.Add(eid, HoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 16, TotalDuration = 16, }; _game.TimedEffectComponent.Add(eid, time); break; #endregion #region Rank 8 case 8: HoT = new HealOverTime() { AmountPerTick = 4, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = target, TickTime = 1, }; _game.HealOverTimeComponent.Add(eid, HoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 18, TotalDuration = 18, }; _game.TimedEffectComponent.Add(eid, time); break; #endregion #region Rank 9 case 9: HoT = new HealOverTime() { AmountPerTick = 5, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = target, TickTime = 1, }; _game.HealOverTimeComponent.Add(eid, HoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 18, TotalDuration = 18, }; _game.TimedEffectComponent.Add(eid, time); break; #endregion #region Rank 10 case 10: HoT = new HealOverTime() { AmountPerTick = 7, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = target, TickTime = 1, }; _game.HealOverTimeComponent.Add(eid, HoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 20, TotalDuration = 20, }; _game.TimedEffectComponent.Add(eid, time); break; #endregion default: throw new Exception("Unimplemented Rank"); } break; #endregion #region Malicious Parasite case SkillType.MaliciousParasite: if (friendly) return; eid = Entity.NextEntity(); switch (rank) { #region Rank 1 case 1: DoT = new DamageOverTime() { AmountPerTick = 1, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = target, TickTime = 1, }; _game.DamageOverTimeComponent.Add(eid, DoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 10, TotalDuration = 10, }; _game.TimedEffectComponent.Add(eid, time); break; #endregion #region Rank 2 case 2: DoT = new DamageOverTime() { AmountPerTick = 1, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = target, TickTime = 1, }; _game.DamageOverTimeComponent.Add(eid, DoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 10, TotalDuration = 12, }; _game.TimedEffectComponent.Add(eid, time); break; #endregion #region Rank 3 case 3: DoT = new DamageOverTime() { AmountPerTick = 2, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = target, TickTime = 1, }; _game.DamageOverTimeComponent.Add(eid, DoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 12, TotalDuration = 12, }; _game.TimedEffectComponent.Add(eid, time); break; #endregion #region Rank 4 case 4: DoT = new DamageOverTime() { AmountPerTick = 2, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = target, TickTime = 1, }; _game.DamageOverTimeComponent.Add(eid, DoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 14, TotalDuration = 14, }; _game.TimedEffectComponent.Add(eid, time); break; #endregion #region Rank 5 case 5: DoT = new DamageOverTime() { AmountPerTick = 3, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = target, TickTime = 1, }; _game.DamageOverTimeComponent.Add(eid, DoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 14, TotalDuration = 14, }; _game.TimedEffectComponent.Add(eid, time); break; #endregion #region Rank 6 case 6: DoT = new DamageOverTime() { AmountPerTick = 3, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = target, TickTime = 1, }; _game.DamageOverTimeComponent.Add(eid, DoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 16, TotalDuration = 16, }; _game.TimedEffectComponent.Add(eid, time); break; #endregion #region Rank 7 case 7: DoT = new DamageOverTime() { AmountPerTick = 4, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = target, TickTime = 1, }; _game.DamageOverTimeComponent.Add(eid, DoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 16, TotalDuration = 16, }; _game.TimedEffectComponent.Add(eid, time); break; #endregion #region Rank 8 case 8: DoT = new DamageOverTime() { AmountPerTick = 4, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = target, TickTime = 1, }; _game.DamageOverTimeComponent.Add(eid, DoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 18, TotalDuration = 18, }; _game.TimedEffectComponent.Add(eid, time); break; #endregion #region Rank 9 case 9: DoT = new DamageOverTime() { AmountPerTick = 5, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = target, TickTime = 1, }; _game.DamageOverTimeComponent.Add(eid, DoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 18, TotalDuration = 18, }; _game.TimedEffectComponent.Add(eid, time); break; #endregion #region Rank 10 case 10: DoT = new DamageOverTime() { AmountPerTick = 7, CurrentStack = 1, CurrentTime = 0, EntityID = eid, MaxStack = 1, TargetID = target, TickTime = 1, }; _game.DamageOverTimeComponent.Add(eid, DoT); time = new TimedEffect() { EntityID = eid, TimeLeft = 20, TotalDuration = 20, }; _game.TimedEffectComponent.Add(eid, time); break; #endregion default: throw new Exception("Unimplemented Rank"); } break; #endregion #region Mindless Parasite case SkillType.MindlessParasites: int mod; eid = Entity.NextEntity(); if (friendly) mod = 1; else mod = -1; switch (rank) { #region Rank 1 case 1: time = new TimedEffect() { EntityID = eid, TimeLeft = 10, TotalDuration = 10, }; _game.TimedEffectComponent.Add(eid, time); buff = new Buff() { EntityID = eid, MovementSpeed = mod * ((int)(_game.MovementComponent[target].Speed * .1)), DefenseMelee = mod * 1, DefenseRanged = mod * 1, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 0, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = target, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 0, }; _game.BuffComponent.Add(eid, buff); break; #endregion #region Rank 2 case 2: time = new TimedEffect() { EntityID = eid, TimeLeft = 12, TotalDuration = 12, }; _game.TimedEffectComponent.Add(eid, time); buff = new Buff() { EntityID = eid, MovementSpeed = mod * ((int)(_game.MovementComponent[target].Speed * .1)), DefenseMelee = mod * 1, DefenseRanged = mod * 1, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 0, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = target, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 0, }; _game.BuffComponent.Add(eid, buff); break; #endregion #region Rank 3 case 3: time = new TimedEffect() { EntityID = eid, TimeLeft = 12, TotalDuration = 12, }; _game.TimedEffectComponent.Add(eid, time); buff = new Buff() { EntityID = eid, MovementSpeed = mod * ((int)(_game.MovementComponent[target].Speed * .2)), DefenseMelee = mod * 2, DefenseRanged = mod * 2, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 0, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = target, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 0, }; _game.BuffComponent.Add(eid, buff); break; #endregion #region Rank 4 case 4: time = new TimedEffect() { EntityID = eid, TimeLeft = 14, TotalDuration = 14, }; _game.TimedEffectComponent.Add(eid, time); buff = new Buff() { EntityID = eid, MovementSpeed = mod * ((int)(_game.MovementComponent[target].Speed * .2)), DefenseMelee = mod * 2, DefenseRanged = mod * 2, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 0, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = target, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 0, }; _game.BuffComponent.Add(eid, buff); break; #endregion #region Rank 5 case 5: time = new TimedEffect() { EntityID = eid, TimeLeft = 14, TotalDuration = 14, }; _game.TimedEffectComponent.Add(eid, time); buff = new Buff() { EntityID = eid, MovementSpeed = mod * ((int)(_game.MovementComponent[target].Speed * .3)), DefenseMelee = mod * 3, DefenseRanged = mod * 3, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 0, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = target, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 0, }; _game.BuffComponent.Add(eid, buff); break; #endregion #region Rank 6 case 6: time = new TimedEffect() { EntityID = eid, TimeLeft = 16, TotalDuration = 16, }; _game.TimedEffectComponent.Add(eid, time); buff = new Buff() { EntityID = eid, MovementSpeed = mod * ((int)(_game.MovementComponent[target].Speed * .3)), DefenseMelee = mod * 3, DefenseRanged = mod * 3, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 0, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = target, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 0, }; _game.BuffComponent.Add(eid, buff); break; #endregion #region Rank 7 case 7: time = new TimedEffect() { EntityID = eid, TimeLeft = 16, TotalDuration = 16, }; _game.TimedEffectComponent.Add(eid, time); buff = new Buff() { EntityID = eid, MovementSpeed = mod * ((int)(_game.MovementComponent[target].Speed * .4)), DefenseMelee = mod * 4, DefenseRanged = mod * 4, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 0, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = target, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 0, }; _game.BuffComponent.Add(eid, buff); break; #endregion #region Rank 8 case 8: time = new TimedEffect() { EntityID = eid, TimeLeft = 18, TotalDuration = 18, }; _game.TimedEffectComponent.Add(eid, time); buff = new Buff() { EntityID = eid, MovementSpeed = mod * ((int)(_game.MovementComponent[target].Speed * .4)), DefenseMelee = mod * 4, DefenseRanged = mod * 4, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 0, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = target, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 0, }; _game.BuffComponent.Add(eid, buff); break; #endregion #region Rank 9 case 9: time = new TimedEffect() { EntityID = eid, TimeLeft = 18, TotalDuration = 18, }; _game.TimedEffectComponent.Add(eid, time); buff = new Buff() { EntityID = eid, MovementSpeed = mod * ((int)(_game.MovementComponent[target].Speed * .5)), DefenseMelee = mod * 5, DefenseRanged = mod * 5, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 0, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = target, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 0, }; _game.BuffComponent.Add(eid, buff); break; #endregion #region Rank 10 case 10: time = new TimedEffect() { EntityID = eid, TimeLeft = 20, TotalDuration = 20, }; _game.TimedEffectComponent.Add(eid, time); buff = new Buff() { EntityID = eid, MovementSpeed = mod * ((int)(_game.MovementComponent[target].Speed * .7)), DefenseMelee = mod * 7, DefenseRanged = mod * 7, AttackMelee = 0, AttackRanged = 0, AttackSpeed = 0, isPercentAttackMelee = false, isPercentAttackRanged = false, isPercentAttackSpeed = false, isPercentDefenseMelee = false, isPercentDefenseRanged = false, isPercentFatigue = false, isPercentHealth = false, isPercentMovementSpeed = true, Fatigue = 0, Health = 0, isPercentPsi = false, isPercentResistPoison = false, isPercentWeaponAccuracy = false, isPercentWeaponSpeed = false, isPercentWeaponStrength = false, Psi = 0, ResistPoison = 0, TargetID = target, WeaponAccuracy = 0, WeaponSpeed = 0, WeaponStrength = 0, }; _game.BuffComponent.Add(eid, buff); break; #endregion default: throw new Exception("Unimplemented Rank"); } break; #endregion #endregion #region Cultist Triggered Skills #region Psionic Spear case SkillType.PsionicSpear: { #region Skill Variables InstantEffect instant_Effect; DirectDamage direct_damage; Random damageMod = new Random(); int damageValue = 0; #endregion #region Skill Logic switch (rank) { #region Rank 1 case 1: { damageValue = damageMod.Next(10) + 1; //Damage from 1 to 10 break; } #endregion #region Rank 2 case 2: { damageValue = damageMod.Next(20) + 1; //Damage from 1 to 20 break; } #endregion #region Rank 3 case 3: { damageValue = damageMod.Next(35) + 1; //Damage from 1 to 35 break; } #endregion #region Rank 4 case 4: { damageValue = damageMod.Next(50) + 1; //Damage from 1 to 50 break; } #endregion #region Rank 5 case 5: { damageValue = damageMod.Next(75) + 1; //Damage from 1 to 75 break; } #endregion #region Rank 6 case 6: { damageValue = damageMod.Next(100) + 1; //Damage from 1 to 100 break; } #endregion #region Rank 7 case 7: { damageValue = damageMod.Next(150) + 1; //Damage from 1 to 150 break; } #endregion #region Rank 8 case 8: { damageValue = damageMod.Next(200) + 1; //Damage from 1 to 200 break; } #endregion #region Rank 9 case 9: { damageValue = damageMod.Next(300) + 1; //Damage from 1 to 300 break; } #endregion #region Rank 10 case 10: { damageValue = damageMod.Next(400) + 1; //Damage from 1 to 400 break; } #endregion default: { throw new Exception("Unimplemented Rank"); } } eid = Entity.NextEntity(); instant_Effect = new InstantEffect() { EntityID = eid, isTriggered = false, }; _game.InstantEffectComponent.Add(eid, instant_Effect); direct_damage = new DirectDamage() { EntityID = eid, TargetID = target, Damage = damageValue, }; _game.DirectDamageComponent.Add(eid, direct_damage); #endregion break; } #endregion #region Enslave case SkillType.Enslave: { #region Skill Variables TimedEffect timedEffect; Enslave enslaveEffect; uint cts_ID = 0; ChanceToSucceed chanceToSucceed; int percentChance = 0; int maxSlaveNum = 0; float duration = 0; List<uint> chanceToSucceedList = new List<uint>(); #endregion #region Skill Logic switch (rank) { #region Rank 1 case 1: { percentChance = 60; //60% chance to succeed maxSlaveNum = 1; //Can only Enslave 1 enemy duration = 3; //For 3 seconds break; } #endregion #region Rank 2 case 2: { percentChance = 60; //60% chance to succeed maxSlaveNum = 1; //Can only Enslave 1 enemy duration = 5; //For 5 seconds break; } #endregion #region Rank 3 case 3: { percentChance = 65; //65% chance to succeed maxSlaveNum = 1; //Can only Enslave 1 enemy duration = 5; //For 5 seconds break; } #endregion #region Rank 4 case 4: { percentChance = 70; //70% chance to succeed maxSlaveNum = 1; //Can only Enslave 1 enemy duration = 8; //For 8 seconds break; } #endregion #region Rank 5 case 5: { percentChance = 70; //70% chance to succeed maxSlaveNum = 2; //Can only Enslave 2 enemies duration = 8; //For 8 seconds break; } #endregion #region Rank 6 case 6: { percentChance = 75; //75% chance to succeed maxSlaveNum = 2; //Can only Enslave 2 enemies duration = 8; //For 8 seconds break; } #endregion #region Rank 7 case 7: { percentChance = 75; //75% chance to succeed maxSlaveNum = 2; //Can only Enslave 2 enemies duration = 10; //For 10 seconds break; } #endregion #region Rank 8 case 8: { percentChance = 80; //80% chance to succeed maxSlaveNum = 2; //Can only Enslave 2 enemies duration = 10; //For 10 seconds break; } #endregion #region Rank 9 case 9: { percentChance = 85; //85% chance to succeed maxSlaveNum = 2; //Can only Enslave 2 enemies duration = 12; //For 12 seconds break; } #endregion #region Rank 10 case 10: { percentChance = 85; //85% chance to succeed maxSlaveNum = 3; //Can only Enslave 3 enemies duration = 15; //For 15 seconds break; } #endregion default: { break; } } eid = Entity.NextEntity(); timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = duration, TimeLeft = duration, }; _game.TimedEffectComponent.Add(eid, timedEffect); enslaveEffect = new Enslave() { EntityID = eid, OwnerID = owner, TargetID = target, }; _game.EnslaveComponent.Add(eid, enslaveEffect); chanceToSucceedList.Add(eid); cts_ID = Entity.NextEntity(); chanceToSucceed = new ChanceToSucceed() { EntityID = cts_ID, SuccessRateAsPercentage = percentChance, AffectedIDList = chanceToSucceedList, }; _game.ChanceToSucceedComponent.Add(cts_ID, chanceToSucceed); #endregion break; } #endregion #region Fear case SkillType.Fear: { #region Skill Variables TimedEffect timedEffect; Fear fear; uint cts_id = 0; ChanceToSucceed chanceToSucceed; List<uint> chanceToSucceedList = new List<uint>(); int percentChance = 0; float duration = 0; #endregion #region Skill Logic switch (rank) { #region Rank 1 case 1: { percentChance = 60; //60% chance to succeed duration = 2; //lasts 2 seconds break; } #endregion #region Rank 2 case 2: { percentChance = 65; //65% chance to succeed duration = 2; //lasts 2 seconds break; } #endregion #region Rank 3 case 3: { percentChance = 70; //70% chance to succeed duration = 2; //lasts 2 seconds break; } #endregion #region Rank 4 case 4: { percentChance = 70; //70% chance to succeed duration = 3; //lasts 3 seconds break; } #endregion #region Rank 5 case 5: { percentChance = 70; //70% chance to succeed duration = 5; //lasts 5 seconds break; } #endregion #region Rank 6 case 6: { percentChance = 75; //75% chance to succeed duration = 6; //lasts 6 seconds break; } #endregion #region Rank 7 case 7: { percentChance = 75; //75% chance to succeed duration = 8; //lasts 8 seconds break; } #endregion #region Rank 8 case 8: { percentChance = 75; //75% chance to succeed duration = 9; //lasts 9 seconds break; } #endregion #region Rank 9 case 9: { percentChance = 80; //80% chance to succeed duration = 10; //lasts 10 seconds break; } #endregion #region Rank 10 case 10: { percentChance = 85; //85% chance to succeed duration = 12; //lasts 12 seconds break; } #endregion default: { break; } } eid = Entity.NextEntity(); timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = duration, TimeLeft = duration, }; _game.TimedEffectComponent.Add(eid, timedEffect); fear = new Fear() { EntityID = eid, SourceID = owner, TargetID = target, }; _game.FearComponent.Add(eid, fear); chanceToSucceedList.Add(eid); cts_id = Entity.NextEntity(); chanceToSucceed = new ChanceToSucceed() { EntityID = cts_id, AffectedIDList = chanceToSucceedList, SuccessRateAsPercentage = percentChance, }; _game.ChanceToSucceedComponent.Add(cts_id, chanceToSucceed); #endregion break; } #endregion #region Taint case SkillType.Taint: { #region Skill Variables TimedEffect timedEffect; DamageOverTime damageOverTime; float duration = 0; int dps = 0; #endregion #region Skill Logic switch (rank) { #region Rank 1 case 1: { dps = 2; // 2 damage per second duration = 5; // for 5 seconds break; } #endregion #region Rank 2 case 2: { dps = 3; // 3 damage per second duration = 5; // for 5 seconds break; } #endregion #region Rank 3 case 3: { dps = 5; // 5 damage per second duration = 5; // for 5 seconds break; } #endregion #region Rank 4 case 4: { dps = 6; // 6 damage per second duration = 6; // for 6 seconds break; } #endregion #region Rank 5 case 5: { dps = 8; // 8 damage per second duration = 7; // for 7 seconds break; } #endregion #region Rank 6 case 6: { dps = 12; // 12 damage per second duration = 8; // for 8 seconds break; } #endregion #region Rank 7 case 7: { dps = 15; // 15 damage per second duration = 9; // for 9 seconds break; } #endregion #region Rank 8 case 8: { dps = 20; // 20 damage per second duration = 10; // for 10 seconds break; } #endregion #region Rank 9 case 9: { dps = 30; // 30 damage per second duration = 12; // for 12 seconds break; } #endregion #region Rank 10 case 10: { dps = 45; // 45 damage per second duration = 15; // for 15 seconds break; } #endregion default: { break; } } eid = Entity.NextEntity(); timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = duration, TimeLeft = duration, }; _game.TimedEffectComponent.Add(eid, timedEffect); damageOverTime = new DamageOverTime() { EntityID = eid, MaxStack = 1, CurrentStack = 1, AmountPerTick = dps, CurrentTime = 0, TickTime = 1, TargetID = target, }; _game.DamageOverTimeComponent.Add(eid, damageOverTime); #endregion break; } #endregion #region Rot case SkillType.Rot: { #region Skill Variables TimedEffect timedEffect; Buff buffEffect; bool targetTainted = false; int dps = 0; float duration = 0; int staminaDebuff = 0; #endregion #region Skill Logic switch (rank) { #region Rank 1 case 1: { dps = 2; // 2 damage per second duration = 5; // over 5 seconds staminaDebuff = -1; // and -1 to Stamina break; } #endregion #region Rank 2 case 2: { dps = 3; // 3 damage per second duration = 5; // over 5 seconds staminaDebuff = -1; // and -1 to Stamina break; } #endregion #region Rank 3 case 3: { dps = 3; // 3 damage per second duration = 6; // over 6 seconds staminaDebuff = -1; // and -1 to Stamina break; } #endregion #region Rank 4 case 4: { dps = 5; // 5 damage per second duration = 6; // over 6 seconds staminaDebuff = -1; // and -1 to Stamina break; } #endregion #region Rank 5 case 5: { dps = 5; // 5 damage per second duration = 7; // over 7 seconds staminaDebuff = -2; // and -2 to Stamina break; } #endregion #region Rank 6 case 6: { dps = 8; // 8 damage per second duration = 7; // over 7 seconds staminaDebuff = -2; // and -2 to Stamina break; } #endregion #region Rank 7 case 7: { dps = 10; // 10 damage per second duration = 9; // over 9 seconds staminaDebuff = -3; // and -3 to Stamina break; } #endregion #region Rank 8 case 8: { dps = 12; // 12 damage per second duration = 11; // over 11 seconds staminaDebuff = -3; // and -3 to Stamina break; } #endregion #region Rank 9 case 9: { dps = 15; // 15 damage per second duration = 11; // over 11 seconds staminaDebuff = -3; // and -3 to Stamina break; } #endregion #region Rank 10 case 10: { dps = 17; // 17 damage per second duration = 13; // over 13 seconds staminaDebuff = -4; // and -4 to Stamina break; } #endregion default: { break; } } //TODO: check if the target has been tainted targetTainted = true; if (!targetTainted) return; eid = Entity.NextEntity(); timedEffect = new TimedEffect() { EntityID = eid, TotalDuration = duration, TimeLeft = duration, }; _game.TimedEffectComponent.Add(eid, timedEffect); buffEffect = new Buff() { EntityID = eid, Stamina = staminaDebuff, }; _game.BuffComponent.Add(eid, buffEffect); #endregion break; } #endregion #region Push case SkillType.Push: { #region Skill Variables InstantEffect instant_Effect; KnockBack knockBack; DirectDamage direct_damage; Random damageMod = new Random(); int meterConversion = 75; int pushDistance = 0; int damageValue = 0; #endregion #region Skill Logic switch (rank) { #region Rank 1 case 1: { pushDistance = 1; // 1 meter damageValue = 1 + damageMod.Next(2); // Damage between 1 and 2 break; } #endregion #region Rank 2 case 2: { pushDistance = 1; // 1 meter damageValue = 2 + damageMod.Next(4); // Damage between 2 and 5 break; } #endregion #region Rank 3 case 3: { pushDistance = 2; // 2 meters damageValue = 2 + damageMod.Next(4); // Damage between 2 and 5 break; } #endregion #region Rank 4 case 4: { pushDistance = 2; // 2 meters damageValue = 5 + damageMod.Next(6); // Damage between 5 and 10 break; } #endregion #region Rank 5 case 5: { pushDistance = 2; // 2 meters damageValue = 10 + damageMod.Next(6); // Damage between 10 and 15 break; } #endregion #region Rank 6 case 6: { pushDistance = 3; // 3 meters damageValue = 10 + damageMod.Next(6); // Damage between 10 and 15 break; } #endregion #region Rank 7 case 7: { pushDistance = 3; // 3 meters damageValue = 15 + damageMod.Next(6); // Damage between 15 and 20 break; } #endregion #region Rank 8 case 8: { pushDistance = 3; // 3 meters damageValue = 20 + damageMod.Next(6); // Damage between 20 and 25 break; } #endregion #region Rank 9 case 9: { pushDistance = 4; // 4 meters damageValue = 20 + damageMod.Next(6); // Damage between 20 and 25 break; } #endregion #region Rank 10 case 10: { pushDistance = 5; // 5 meters damageValue = 25 + damageMod.Next(6); // Damage between 25 and 30 break; } #endregion default: { break; } } eid = Entity.NextEntity(); instant_Effect = new InstantEffect() { EntityID = eid, isTriggered = false, }; _game.InstantEffectComponent.Add(eid, instant_Effect); knockBack = new KnockBack() { EntityID = eid, Distance = pushDistance * meterConversion, Origin = _game.PositionComponent[owner].Center, TargetID = target, }; _game.KnockBackComponent.Add(eid, knockBack); direct_damage = new DirectDamage() { EntityID = eid, TargetID = target, Damage = damageValue, }; _game.DirectDamageComponent.Add(eid, direct_damage); #endregion break; } #endregion #region Malice case SkillType.Malice: { #region Skill Variables InstantEffect instant_Effect; DirectDamage direct_Damage; Random damageMod = new Random(); int damageValue = 0; #endregion #region Skill Logic switch (rank) { #region Rank 1 case 1: { damageValue = 20 + damageMod.Next(6); //Damage between 20 and 25 break; } #endregion #region Rank 2 case 2: { damageValue = 20 + damageMod.Next(11); //Damage between 20 and 30 break; } #endregion #region Rank 3 case 3: { damageValue = 25 + damageMod.Next(11); //Damage between 25 and 25 break; } #endregion #region Rank 4 case 4: { damageValue = 40 + damageMod.Next(6); //Damage between 40 and 45 break; } #endregion #region Rank 5 case 5: { damageValue = 50 + damageMod.Next(11); //Damage between 50 and 60 break; } #endregion #region Rank 6 case 6: { damageValue = 65 + damageMod.Next(6); //Damage between 65 and 70 break; } #endregion #region Rank 7 case 7: { damageValue = 70 + damageMod.Next(16); //Damage between 70 and 85 break; } #endregion #region Rank 8 case 8: { damageValue = 90 + damageMod.Next(11); //Damage between 90 and 100 break; } #endregion #region Rank 9 case 9: { damageValue = 105 + damageMod.Next(11); //Damage between 105 and 115 break; } #endregion #region Rank 10 case 10: { damageValue = 120 + damageMod.Next(6); //Damage between 120 and 125 break; } #endregion default: { break; } } eid = Entity.NextEntity(); instant_Effect = new InstantEffect() { EntityID = eid, isTriggered = false, }; _game.InstantEffectComponent.Add(eid, instant_Effect); direct_Damage = new DirectDamage() { EntityID = eid, TargetID = target, Damage = damageValue, }; _game.DirectDamageComponent.Add(eid, direct_Damage); #endregion break; } #endregion #endregion case SkillType.SniperShot: instantEffect = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, instantEffect); directDamage = new DirectDamage() { TargetID = target, Damage = 1, EntityID = eid, }; _game.DirectDamageComponent.Add(eid, directDamage); break; case SkillType.BasicRangedAttack: eid = Entity.NextEntity(); instantEffect = new InstantEffect() { EntityID = eid, }; _game.InstantEffectComponent.Add(eid, instantEffect); damage = new DirectDamage() { Damage = rank, EntityID = eid, TargetID = target, }; _game.DirectDamageComponent.Add(eid, damage); break; default: throw new Exception("Unimplemented SKill"); } }
void ShowSpellEffects() { Debug.Log(spell.transform.childCount); for (int i = 0; i < spell.transform.childCount; i++) { var effect = spell.transform.GetChild(i).GetComponent <SpellEffect>(); Debug.Log(effect.spellType); Debug.Log("teeest " + (effect.spellType == SpellEffect.SpellType.DAMAGEEFFECT)); if (effect.spellType == SpellEffect.SpellType.DAMAGEEFFECT) { effect.test(); EditorGUILayout.LabelField("Damage On hit"); var tmp = effect as DamageEffect; Debug.Log(tmp == null); Debug.Log(effect.GetType()); var damage = tmp.SpellEditorDamage; damage = EditorGUILayout.IntField("Damage", damage); if (damage != tmp.SpellEditorDamage) { tmp.SetDamageEffect(damage); } } if (effect.spellType == SpellEffect.SpellType.DAMAGEOVERTIME) { EditorGUILayout.LabelField("Damage Over Time"); DamageOverTime tmp = effect as DamageOverTime; int damage = tmp.SpellEditorDamage; int turn = tmp.SpellEditorTurns; damage = EditorGUILayout.IntField("Damage", damage); turn = EditorGUILayout.IntField("Turn", turn); if (damage != tmp.SpellEditorDamage || turn != tmp.SpellEditorTurns) { tmp.SetDamageOverTime(damage, turn); } } if (effect.spellType == SpellEffect.SpellType.HEAL) { EditorGUILayout.LabelField("Heal On hit"); HealEffect tmp = effect as HealEffect; int heal = tmp.SpellEditorHeal; heal = EditorGUILayout.IntField("Heal", heal); if (heal != tmp.SpellEditorHeal) { tmp.SetHealEffect(heal); } } if (effect.spellType == SpellEffect.SpellType.HEALOVERTIME) { EditorGUILayout.LabelField("Heal Over Time"); HealOverTime tmp = effect as HealOverTime; int heal = tmp.SpellEditorHeal; int turn = tmp.SpellEditorTurns; heal = EditorGUILayout.IntField("Heal", heal); turn = EditorGUILayout.IntField("Turn", turn); if (heal != tmp.SpellEditorHeal || turn != tmp.SpellEditorTurns) { tmp.SetHealOverTime(heal, turn); } } if (effect.spellType == SpellEffect.SpellType.BUFFEFFECT) { EditorGUILayout.LabelField("Buff Effect"); BuffEffect tmp = effect as BuffEffect; int index = tmp.SpellEditorIndex; int amount = tmp.SpellEditorAmount; int turn = tmp.SpellEditorTurn; index = EditorGUILayout.Popup("Choose a stat", index, tmp.stats); amount = EditorGUILayout.IntField("Amount", amount); turn = EditorGUILayout.IntField("Turn", turn); if (index != tmp.SpellEditorIndex || amount != tmp.SpellEditorAmount || turn != tmp.SpellEditorTurn) { tmp.SetBuffEffect(index, amount, turn); } } if (GUILayout.Button("Remove Effect")) { DestroyImmediate(spell.transform.GetChild(i).gameObject); } } }
public void ApplyDOT(float amount, int intervals) { DamageOverTime dot = new DamageOverTime(intervals,amount,Damage); StartCoroutine(dot.Start()); dots.Add(dot); }
public override void Apply(GameObject target) { base.Apply(target); //if (!CheckForSpecificTarget(target)) // return; switch (statusType) { case Constants.StatusEffectType.None: //Status newStatus = target.AddComponent<Status>(); Status newStatus = new Status(); newStatus.Initialize(target, duration, interval, statusType, parentAbility); StatusManager.AddStatus(target.GetComponent <Entity>(), newStatus, this, parentAbility); break; case Constants.StatusEffectType.AffectMovement: //AffectMovement newAffectMovement = target.AddComponent<AffectMovement>(); AffectMovement newAffectMovement = new AffectMovement(); //knockbackVector = TargetingUtilities.DegreeToVector2(knocbackAngle); knockbackVector = TargetingUtilities.DirectionFromAngle(knocbackAngle, false); if (Source.Facing == Constants.EntityFacing.Left) { knockbackVector = new Vector2(-knockbackVector.x, knockbackVector.y); } //Debug.Log(knockbackVector + " is the knockback vector"); newAffectMovement.Initialize(target, duration, interval, statusType, parentAbility, maxStack, onCompleteEffect); newAffectMovement.InitializeAffectMovement(affectMoveType, affectMoveValue, knockbackVector); StatusManager.AddStatus(target.GetComponent <Entity>(), newAffectMovement, this, parentAbility); break; case Constants.StatusEffectType.Stun: Stun newStun = new Stun(); newStun.Initialize(target, duration, interval, statusType, parentAbility); newStun.InitializeStun(); StatusManager.AddStatus(target.GetComponent <Entity>(), newStun, this, parentAbility); break; case Constants.StatusEffectType.DamageOverTime: float damage; if (scaleFromBaseDamage) { damage = damagePerInterval + (parentAbility.source.stats.GetStatModifiedValue(StatCollection.BaseStat.BaseStatType.BaseDamage) * percentOfBaseDamage); } else { damage = damagePerInterval; } //DamageOverTime newDot = target.AddComponent<DamageOverTime>(); DamageOverTime newDot = new DamageOverTime(); newDot.Initialize(target, duration, interval, statusType, parentAbility, maxStack); newDot.InitializeDamageOverTime(damage, parentAbility.source); StatusManager.AddStatus(target.GetComponent <Entity>(), newDot, this, parentAbility); Debug.Log("Applying " + damage + " over time"); break; case Constants.StatusEffectType.StaticStatAdjustment: StatCollection.StatModifer modStatic = new StatCollection.StatModifer(statAdjustmentValue, modType); Debug.Log("Stat " + statType + " is being adjusted by " + statAdjustmentValue); StatAdjustmentManager.ApplyTrackedStatMod(Source, target.GetComponent <Entity>(), statType, modStatic); break; case Constants.StatusEffectType.DurationalStatAdjustment: //StatCollection.StatModifer modDur = new StatCollection.StatModifer(statAdjustmentValue, modType); Debug.Log("Setting durational stuff"); DurationalStatChange newDurationalStatChange = new DurationalStatChange(); newDurationalStatChange.Initialize(target, duration, interval, statusType, parentAbility, maxStack); newDurationalStatChange.InitializeDurationalStatChange(statType, modType, statAdjustmentValue); StatusManager.AddStatus(target.GetComponent <Entity>(), newDurationalStatChange, this, parentAbility); break; } }
protected void StartSwag(DamageOverTime dmg) { StartCoroutine(RecieveDamageOver(dmg)); }