public void instantiateSkills() { PassiveSpell passive1 = new PassiveSpell("Increase Attack", "Increases the attack damage by ", ".", 20); PassiveSpell passive2 = new PassiveSpell("Increase Max HP", "Increases the maximum HP by ", "%.", 10); passives.Add(passive1); passives.Add(passive2); ActiveSpell active1 = new ActiveSpell("Heal", "Heals the paladin in ", " health points.", 5, 0, 100, 0, 20, 0); ActiveSpell active2 = new ActiveSpell("Vengeance", "Releases an wave which deals ", " damage to the enemies it passes through.\n" + "[Can't be used while jumping]", 5, 0, 150, -1, 30, 0); ActiveSpell active3 = new ActiveSpell("Judgement", "Creates a explosion of energy around the paladin, dealing ", " damage.\n" + "[Can't be used while jumping]", 25, 300, 100, -5, 60, 0); ActiveSpell active4 = new ActiveSpell("Intervention", "The paladin is immune to all damage during ", " seconds.", 30, 2, 1, 0, 100, 0); actives.Add(active1); actives.Add(active2); actives.Add(active3); actives.Add(active4); }
public void UpdateSpell() { if (Preview) { Reset(); return; } _Casting = false; if (ActiveSpell == null || ActiveSpell != User.Spell) { ActiveSpell = User.Spell as Spell; if (ActiveSpell == null) { return; } if (_CloseTimer != null) { _CloseTimer.Running = false; _CloseTimer = null; } Text = ActiveSpell.Name; CastStart = DateTime.UtcNow; MaxValue = ActiveSpell.GetCastDelay().TotalMilliseconds - 100.0; if (SpellCastBars.CMOptions.ModuleDebug) { SpellCastBars.CMOptions.ToConsole( "'{0}', {1}: [{2}/{3}] ({4})", Text, CastStart, InternalValue, MaxValue, PercentComplete); } _Casting = ActiveSpell.IsCasting; } else { _Casting = true; } if (!_Casting) { return; } InternalValue = (DateTime.UtcNow - CastStart).TotalMilliseconds; if (SpellCastBars.CMOptions.ModuleDebug) { SpellCastBars.CMOptions.ToConsole("[{0} / {1}] ({2})", InternalValue, MaxValue, PercentComplete); } }
public Spell(ActiveSpell activeSpell, int manaCost, Target target, int CR) { castRange = CR; spellType = SpellType.ACTIVE; this.activeSpell = activeSpell; this.manaCost = manaCost; t = target; }
/// <summary> /// Adds an active spell to self icon area. /// </summary> public void AddSelfSpell(int iconIndex, string displayName) { ActiveSpell spell = new ActiveSpell(); spell.iconIndex = iconIndex; spell.displayName = displayName; activeSelfList.Add(spell); Refresh(); }
public static string getSpellName(this ActiveSpell activeSpell) { switch (activeSpell) { case ActiveSpell.BERN_GROUND: return("Bern Ground"); case ActiveSpell.BOOST: return("Boost"); case ActiveSpell.HEAL: return("Heal"); case ActiveSpell.HEX: return("Hex"); case ActiveSpell.PUMPKIN_BOMB: return("Pumpkin BOMB"); case ActiveSpell.RAGE: return("Rage"); case ActiveSpell.SUMMON_BEAR: return("Summon Bear"); case ActiveSpell.BLESSING: return("Blessing"); case ActiveSpell.BAT_ATTACK: return("Bat Attack"); case ActiveSpell.EAGLE_ROAR: return("Eagle Roar"); case ActiveSpell.REGEN_MANA: return("Regen Mana"); case ActiveSpell.ARROW_FALL: return("Arrow fall"); case ActiveSpell.ACID_CLOUD: return("Acid cloud"); default: return("NULL"); } }
public void ActivateSkill(ActiveSpell spell) { if (spell == darkenTheSkiesSpell) { if (pStats.curMagic - darkenTheSkiesSpell.magicRequired >= 0) { if (Time.time > spell1CDTimer) { isActive = ActiveAttack.Spell1; } else { Debug.Log(spell1CDTimer - Time.time + " seconds remaining."); } } else { Debug.Log("Insufficient Magic"); return; } } else if (spell == headShotSpell) { if (pStats.curMagic - headShotSpell.magicRequired >= 0) { if (Time.time > spell2CDTimer) { isActive = ActiveAttack.Spell2; } else { Debug.Log(spell2CDTimer - Time.time + " seconds remaining."); } } else { Debug.Log("Insufficient Magic"); return; } } }
public void instantiateSkills() { PassiveSpell passive1 = new PassiveSpell("Increase Attack", "Increases the attack damage by ", ".", 20); PassiveSpell passive2 = new PassiveSpell("Increase Max HP", "Increases the maximum HP by ", "%.",10); passives.Add(passive1); passives.Add(passive2); ActiveSpell active1 = new ActiveSpell("Heal", "Heals the paladin in ", " health points.", 5, 0, 100, 0, 20, 0); ActiveSpell active2 = new ActiveSpell("Vengeance", "Releases an wave which deals ", " damage to the enemies it passes through.\n" + "[Can't be used while jumping]", 5, 0, 150, -1, 30, 0); ActiveSpell active3 = new ActiveSpell("Judgement", "Creates a explosion of energy around the paladin, dealing ", " damage.\n" + "[Can't be used while jumping]", 25, 300, 100, -5, 60, 0); ActiveSpell active4 = new ActiveSpell("Intervention", "The paladin is immune to all damage during ", " seconds.", 30, 2, 1, 0, 100, 0); actives.Add(active1); actives.Add(active2); actives.Add(active3); actives.Add(active4); }
public void Shoot(Vector2 GunNozzlePosition, WeaponBase ActiveWeapon, int WeaponIndex) { bool CanShoot; if (ActiveWeapon.AmmoPerMagazine > 0) { if (ActiveWeapon.AmmoCurrent > 0) { --ActiveWeapon.AmmoCurrent; CanShoot = true; } else { CanShoot = false; } } else { CanShoot = true; } VisibleTimeline WeaponSlotTimeline; PartialAnimation WeaponAnimation; if (CanShoot) { float OffsetX = GunNozzlePosition.X - AnimationOrigin.Position.X; float OffsetY = GunNozzlePosition.Y - AnimationOrigin.Position.Y; if (ActiveWeapon.CurrentAnimation != null && DicPartialAnimation.TryGetValue(ActiveWeapon.CurrentAnimation.AnimationPath, out WeaponAnimation)) { OffsetX = GunNozzlePosition.X - WeaponAnimation.AnimationOrigin.Position.X; OffsetY = GunNozzlePosition.Y - WeaponAnimation.AnimationOrigin.Position.Y; } float WeaponOffsetX = 0; float WeaponOffsetY = 0; if (DicActiveAnimationObject.TryGetValue("Weapon Slot " + (WeaponIndex + 1), out WeaponSlotTimeline)) { WeaponOffsetX = WeaponSlotTimeline.Position.X - AnimationOrigin.Position.X; WeaponOffsetY = WeaponSlotTimeline.Position.Y - AnimationOrigin.Position.Y; } float Angle = ActiveWeapon.WeaponAngle; if (ActiveSpriteEffects != SpriteEffects.FlipHorizontally) { WeaponOffsetX = -WeaponOffsetX; } double LenghtDirX = Math.Cos(Angle) * OffsetX; double LenghtDirY = Math.Sin(Angle) * OffsetX; double LenghtDirX2 = Math.Cos(Angle + MathHelper.ToRadians(90)) * OffsetY; double LenghtDirY2 = Math.Sin(Angle + MathHelper.ToRadians(90)) * OffsetY; Vector2 RealGunNozzlePosition = Position + new Vector2(WeaponOffsetX, WeaponOffsetY) - new Vector2((float)(LenghtDirX + LenghtDirX2), (float)(LenghtDirY + LenghtDirY2)); SetRobotContext(ActiveWeapon, Angle, RealGunNozzlePosition); foreach (MagicSpell ActiveSpell in ListMagicSpell) { ActiveSpell.ExecuteSpell(); } if (ActiveWeapon.HasSkills) { ActiveWeapon.UpdateSkills("Shoot"); } else { ActiveWeapon.Shoot(this, RealGunNozzlePosition, Angle, new List <BaseAutomaticSkill>()); } CreateNozzleFlashAnimation(ActiveWeapon.NozzleFlashAnimation, RealGunNozzlePosition, Angle); } }