Esempio n. 1
0
    /**A function to return spell-related audio clips*/
    public AudioClip getAudioForSpell(SpellName name)
    {
        switch (name)
        {
        case SpellName.Fireball:
            return(fireSpellSound);

        case SpellName.Iceball:
            return(waterCastSound);

        case SpellName.Shield:
            return(shieldCastSound);

        case SpellName.Thunderball:
            return(thunderSpellSound);

        case SpellName.Thunderstorm:
            return(thunderStormSound);            //will change it later

        //Add more as new spells are created
        case SpellName.Tornado:
            return(tornadoCastSound);

        case SpellName.WaterBubble:
            return(waterBubbleCastSound);
        }

        return(shieldCastSound);
    }    //end f'n AudioClip getAudioForSpell(SpellName)
 public Spell(CastRoutine cast,
              AlterCastActionOnSetParams alterCastOnSetParams,
              SpellName name,
              School school,
              TargetingType targetingType,
              IconName icon,
              ClassType classType,
              string description,
              bool isCantrip,
              int rangeInSquares,
              int level,
              SpellScaler scaler)
 {
     this.cast = cast;
     this.alterCastOnSetParams = alterCastOnSetParams;
     this.name           = name;
     this.school         = school;
     this.targetingType  = targetingType;
     this.icon           = icon;
     this.classType      = classType;
     this.description    = description;
     this.isCantrip      = isCantrip;
     this.rangeInSquares = rangeInSquares;
     this.level          = level;
     this.scaler         = scaler;
 }
Esempio n. 3
0
        /// <summary>
        /// Only a wizard can cast a spell, so this method is in the Wizard class
        /// </summary>
        public void CastSpell(SpellName name, Character target)
        {
            // Look up spell
            ISpell spell = Spells.Where(s => s.Name == name).FirstOrDefault();

            if (MannaCount >= spell.MannaCost)
            {
                // Generate the message
                var damageMessage  = $"dealing {spell.HealthPointEffect} damage";
                var healingMessage = $"giving {target.Name} {spell.HealthPointEffect} health points";
                var message        = "";

                switch (spell.Type)
                {
                case SpellType.Attack:
                    message = damageMessage;
                    break;

                case SpellType.Heal:
                    message           = healingMessage;
                    target.HealthBar += spell.HealthPointEffect;
                    break;
                }

                // Decrease our Manna count
                MannaCount -= spell.MannaCost;

                // Cast the spell
                spell.Cast(Name, target.Name);
            }
            else
            {
                Console.WriteLine("Not enough Manna to cast this spell");
            }
        }
Esempio n. 4
0
    /**A function to set the spell to cast in our parent classes*/
    public override void SetSpellToCast(SpellName spell)
    {
        SpellClass spell_instance = new SpellClass();

        this.m_SpellToCast = spell_instance.GenerateInstance(spell);
        this.m_AttackPattern.m_SpellToCast = this.m_SpellToCast;
    }
Esempio n. 5
0
 public SpellInfo(float hitPower, string prefabPath, float speed, SpellName name)
 {
     HitPower   = hitPower;
     PrefabPath = prefabPath;
     Speed      = speed;
     Name       = name;
 }
Esempio n. 6
0
 public SpellBase FindSpell(SpellName name)
 {
     if (spells.ContainsKey(name))
     {
         return(spells[name]);
     }
     return(null);
 }
 public ParticleSystem GetSpellPrefab(SpellName sName)
 {
     if (sName == SpellName.ChaosFlame)
     {
         return(Resources.Load <ParticleSystem>("Prefabs/" + sName.ToString()));
     }
     return(null);
 }
Esempio n. 8
0
 public Spell(SpellName name, SpellAreaType areaType, int spellRange, int manaCost, int damage, bool[] spellRune)
 {
     this.name       = name;
     this.areaType   = areaType;
     this.spellRune  = spellRune;
     this.manaCost   = manaCost;
     this.damage     = damage;
     this.spellRange = spellRange;
 }
Esempio n. 9
0
 public Spell(SpellName id, int cost, int damage, int heal, int armor, int recharge, int duration)
 {
     ID       = id;
     Cost     = cost;
     Damage   = damage;
     Heal     = heal;
     Armor    = armor;
     Recharge = recharge;
     Duration = duration;
 }
Esempio n. 10
0
    }//end f'n void AffectHealth(float)

    /**Function which applies the effect of a spell on the enemy.
     * Should make it abstract when we add a variety of enemies.*/
    public void ApplySpellEffects(SpellName spell_name)
    {
        this.m_SpellHittingEnemy = new SpellClass();
        switch ((int)spell_name)
        {
        case (int)SpellName.Fireball:
        {
            this.AffectHealth(-10.0f);

            this.m_SpellHittingEnemy = this.m_SpellHittingEnemy.GenerateInstance(SpellName.Fireball);
            break;
        }                //end case Fireball

        case (int)SpellName.Iceball:
        {
            this.AffectHealth(-2.0f);

            this.m_SpellHittingEnemy = this.m_SpellHittingEnemy.GenerateInstance(SpellName.Iceball);
            break;
        }    //end case Iceball

        case (int)SpellName.Thunderball:
        {
            this.AffectHealth(-5.0f);
            this.m_ShockTimerIncrementor = 1;

            this.m_SpellHittingEnemy = this.m_SpellHittingEnemy.GenerateInstance(SpellName.Thunderball);
            break;
        }                //end case Thunderball

        case (int)SpellName.Thunderstorm:
        {
            this.AffectHealth(-40.0f);
            if (this.m_ShockTimerIncrementor > 10)
            {
                this.m_ShockTimerIncrementor = 1;
            }

            //No point making a section for thunderstorm; thunderball can be used for the same purpose.
            //We'll make an instance of thunderstorm but let the switch fall through to thunderball
            this.m_SpellHittingEnemy = this.m_SpellHittingEnemy.GenerateInstance(SpellName.Thunderstorm);
            break;
        }

        default:
        {
            //Impossible, right now
            break;
        }
        } //end switch
        this.m_SpellName = this.m_SpellHittingEnemy.m_SpellName;
    }     //end f'n void ApplySpellEffects(SpellName)
Esempio n. 11
0
        public static Spell GetSpell(SpellName spellName)
        {
            switch (spellName)
            {
            case SpellName.DisarmTraps:
                return(new Spell(spellName, "Disarm Traps"));

            case SpellName.CastWater:
                return(new Spell(spellName, "Cast Water"));

            case SpellName.SparkFire:
                return(new Spell(spellName, "Spark Fire"));

            default:
                throw new Exception("UNknowon");
            }
        }
Esempio n. 12
0
        public static String toString(SpellName spellname)
        {
            switch (spellname)
            {
                case SpellName.None: return "<<NO SPELL>>";

                    //WARLOCK
                case SpellName.ChaosBolt: return "Chaos Bolt";
                case SpellName.ChaosBoltBackdraft: return "Chaos Bolt with Backdraft up";
                case SpellName.Conflagrate: return "Conflagrate";
                case SpellName.Corruption: return "Corruption";
                case SpellName.CurseOfAgony: return "Curse of Agony";
                case SpellName.CurseOfDoom: return "Curse of Doom";
                case SpellName.CurseOfTheElements: return "Curse of the Elements";
                case SpellName.CurseOfTongues: return "Curse of Tongues";
                case SpellName.CurseOfWeakness: return "Curse of Weakness";
                case SpellName.DarkPact: return "Dark Pact";
                case SpellName.DemonicEmpowerment: return "Demonic Empowerment";
                case SpellName.DrainLife: return "Drain Life";
                case SpellName.DrainSoul: return "Drain Soul";
                case SpellName.DrainSoulUnder25: return "Drain Soul, target under 25%";
                case SpellName.Haunt: return "Haunt";
                case SpellName.Immolate: return "Immolate";
                case SpellName.ImmolationAura: return "Metamorphosis: Immolation Aura";
                case SpellName.Incinerate: return "Incinerate";
                case SpellName.IncinerateBackdraft: return "Incinerate with Backdraft up";
                case SpellName.IncinerateMoltenCore: return "Incinerate with Molten Core up";
                case SpellName.IncinerateMoltenCoreBackdraft: return "Incinerate with Molten Core and Backdraft up";
                case SpellName.LifeTap: return "Life Tap";
                case SpellName.Metamorphosis: return "Metamorphosis";
                case SpellName.SearingPain: return "Searing Pain";
                case SpellName.SeedOfCorruption: return "Seed of Corruption";
                case SpellName.ShadowBolt: return "Shadow Bolt";
                case SpellName.ShadowboltBackdraft: return "Shadow Bolt with Backdraft up";
                case SpellName.Shadowburn: return "Shadowburn";
                case SpellName.ShadowburnGlyphed: return "Shadowburn with Glyph of Shadowburn";
                case SpellName.ShadowCleave: return "Metamorphosis: Shadow Cleave";
                case SpellName.Shadowflame: return "Shadowflame";
                case SpellName.Shadowfury: return "Shadowfury";
                case SpellName.Soulfire: return "Soulfire";
                case SpellName.SoulfireDecimation: return "Soulfire with Decimation";
                case SpellName.UnstableAffliction: return "Unstable Affliction";
            }
            return "";
        }
Esempio n. 13
0
 public ref int this[SpellName sn]
 {
     get
     {
         if (sn == SpellName.Poison)
         {
             return(ref PoisonTimer);
         }
         else if (sn == SpellName.Shield)
         {
             return(ref ShieldTimer);
         }
         else if (sn == SpellName.Recharge)
         {
             return(ref RechargeTimer);
         }
         throw new System.Exception();
     }
 }
Esempio n. 14
0
 public ExpandibleSpellInfo(float hitPower, string prefabPath, float speed, float increment, float maxHitPower, SpellName name) : base(hitPower, prefabPath, speed, name)
 {
     MaxHitPower = maxHitPower;
     Increment   = increment;
 }
 public Spell SpellByClassAndName(ClassType classType, SpellName spellName)
 {
     return(AllSpells.Where((s) => s.classType == classType && s.name == spellName).Last());
 }
Esempio n. 16
0
    /**A function to set a spell animator with respect to the spell*/
    public void SetSpellAnimator(GameObject spell_default_prefab)
    {
        SpellName     spell_class_name         = spell_default_prefab.GetComponent <SpellMovement>().m_SpellClassToCast.m_SpellName;
        SpellMovement spell_movement_component = spell_default_prefab.GetComponent <SpellMovement> ();

        switch ((int)spell_class_name)
        {
        case (int)SpellName.Fireball:
        {
                                #if TESTING_SUCCESSFUL_ANIMATOR_ASSIGNMENT
            Debug.Log("Fireball animator controller assigned");
                                #endif
            spell_movement_component.SetAnimatorController(this.m_FireballAnimator);
            break;
        }                //end case fireball

        case (int)SpellName.Iceball:
        {
                                #if TESTING_SUCCESSFUL_ANIMATOR_ASSIGNMENT
            Debug.Log("Iceball animator controller assigned");
                                #endif
            spell_movement_component.SetAnimatorController(this.m_IceballAnimator);
            break;
        }

        case (int)SpellName.Shield:
        {
                                #if TESTING_SUCCESSFUL_ANIMATOR_ASSIGNMENT
            Debug.Log("Shield animator controller assigned");
                                #endif
            spell_movement_component.SetAnimatorController(this.m_ShieldAnimator);
            break;
        }

        case (int)SpellName.Thunderball:
        {
                                #if TESTING_SUCCESSFUL_ANIMATOR_ASSIGNMENT
            Debug.Log("Thunderball animator controller assigned");
                                #endif
            spell_movement_component.SetAnimatorController(this.m_ThunderballAnimator);
            break;
        }

        case (int)SpellName.Thunderstorm:
        {
                                #if TESTING_SUCCESSFUL_ANIMATOR_ASSIGNMENT
            Debug.Log("Thunderstorm animator controller assigned");
                                #endif
            spell_movement_component.SetAnimatorController(this.m_ThunderStormAnimator);
            break;
        }

        case (int)SpellName.Heal:
        {
                                #if TESTING_SUCCESSFUL_ANIMATOR_ASSIGNMENT
            Debug.Log("Heal animator controller assigned");
                                #endif
            spell_movement_component.SetAnimatorController(this.m_HealAnimator);
            break;
        }

        case (int)SpellName.Tornado:
        {
                #if TESTING_SUCCESSFUL_ANIMATOR_ASSIGNMENT
            Debug.Log("Tornado animator controller assigned");
                #endif
            spell_movement_component.SetAnimatorController(this.m_TornadoAnimator);
            break;
        }

        case (int)SpellName.WaterBubble:
        {
                #if TESTING_SUCCESSFUL_ANIMATOR_ASSIGNMENT
            Debug.Log("Water bubble animator controller assigned");
                #endif
            spell_movement_component.SetAnimatorController(this.m_WaterBubbleAnimator);
            break;
        }

        default:
        {
            //Impossible
            break;
        }
        } //end switch
    }     //end f'n void SetSpellAnimator(GameObject)
Esempio n. 17
0
//	void Update()
//	{
//		if (this.m_PlayerInventory.m_ActiveSpellClass != null) {
//			this.UpdateActiveSpellSprite ();
//		}
//	}

    /**A function to update the active spell sprite, if any. Will be disabled if there is no active spell.
     * To be called from the player inventory, on [switch spell] input.*/
    public void UpdateActiveSpellSprite(SpellName spell_name)
    {
        switch ((int)spell_name)
        {
        case (int)SpellName.Fireball:
        {
            //Set active spell sprite to fireball
            this.m_ActiveSpellSprite = this.m_FireballSprite;
            break;
        }

        case (int)SpellName.Iceball:
        {
            //Set active spell sprite to iceball
            this.m_ActiveSpellSprite = this.m_IceballSprite;
            break;
        }

        case (int)SpellName.Thunderball:
        {
            //Set active spell sprite to thunderball
            this.m_ActiveSpellSprite = this.m_ThunderballSprite;
            break;
        }

        case (int)SpellName.Thunderstorm:
        {
            //Set active spell sprite to thunderstorm
            this.m_ActiveSpellSprite = this.m_ThunderstormSprite;
            break;
        }

        case (int)SpellName.Shield:
        {
            //Set active spell sprite to shield
            this.m_ActiveSpellSprite = this.m_ShieldSprite;
            break;
        }

        case (int)SpellName.Heal:
        {
            //Set active spell sprite to heal
            this.m_ActiveSpellSprite = this.m_HealSprite;
            break;
        }

        case (int)SpellName.Tornado:
        {
            //Set active spell sprite to heal
            this.m_ActiveSpellSprite = this.m_TornadoSprite;
            break;
        }

        case (int)SpellName.WaterBubble:
        {
            //Set active spell sprite to heal
            this.m_ActiveSpellSprite = this.m_WaterBubbleSprite;
            break;
        }

        default:
        {
            break;
        }
        } //end switch
        this.GetComponent <Image>().sprite = this.m_ActiveSpellSprite;
    }     //end f'n void UpdateActiveSpellSprite()
Esempio n. 18
0
    public void Spawn_Spell(SpellName spell_name, Vector3 position)
    {
                #if TESTING_WHATAMISPAWNING
        Debug.Log("Spawning a " + spell_name.ToString());
                #endif
        SpellClass instance = new SpellClass();
        switch ((int)spell_name)
        {
        case (int)SpellName.Fireball:
        {
            instance = instance.GenerateInstance(SpellName.Fireball);
            this.m_SpriteToBeUsed = this.m_FireballSprite;
            break;
        }

        case (int)SpellName.Iceball:
        {
            instance = instance.GenerateInstance(SpellName.Iceball);
            this.m_SpriteToBeUsed = this.m_IceballSprite;
            break;
        }

        case (int)SpellName.Thunderball:
        {
            instance = instance.GenerateInstance(SpellName.Thunderball);
            this.m_SpriteToBeUsed = this.m_ThunderballSprite;
            break;
        }

        case (int)SpellName.Shield:
        {
            instance = instance.GenerateInstance(SpellName.Shield);
            this.m_SpriteToBeUsed = this.m_ShieldSprite;
            break;
        }

        case (int)SpellName.Thunderstorm:
        {
            instance = instance.GenerateInstance(SpellName.Thunderstorm);
            this.m_SpriteToBeUsed = this.m_ThunderstormSprite;
            break;
        }

        case (int)SpellName.Heal:
        {
            instance = instance.GenerateInstance(SpellName.Heal);
            this.m_SpriteToBeUsed = this.m_HealSprite;
            break;
        }

        case (int)SpellName.Tornado:
        {
            instance = instance.GenerateInstance(SpellName.Tornado);
            this.m_SpriteToBeUsed = this.m_TornadoSprite;
            break;
        }

        case (int)SpellName.WaterBubble:
        {
            instance = instance.GenerateInstance(SpellName.WaterBubble);
            this.m_SpriteToBeUsed = this.m_WaterBubbleSprite;
            break;
        }

        default:
        {
            //impossible
            break;
        }
        }        //end switch

        GameObject obj = GameObject.Instantiate(this.m_DefaultSpellPickupPrefab);

//		Debug.Log ("Spawner:: instance: " + instance.ReturnSpellInstanceInfo ());

        obj.GetComponent <SpellPickup> ().SetSpell(instance);
        obj.transform.GetComponentInChildren <SpriteRenderer> ().sprite = this.m_SpriteToBeUsed;

        obj.transform.position = position;
    }
Esempio n. 19
0
        public static String toString(SpellName spellname)
        {
            switch (spellname)
            {
            case SpellName.None: return("<<NO SPELL>>");

            //WARLOCK
            case SpellName.ChaosBolt: return("Chaos Bolt");

            case SpellName.ChaosBoltBackdraft: return("Chaos Bolt with Backdraft up");

            case SpellName.Conflagrate: return("Conflagrate");

            case SpellName.Corruption: return("Corruption");

            case SpellName.CurseOfAgony: return("Curse of Agony");

            case SpellName.CurseOfDoom: return("Curse of Doom");

            case SpellName.CurseOfTheElements: return("Curse of the Elements");

            case SpellName.CurseOfTongues: return("Curse of Tongues");

            case SpellName.CurseOfWeakness: return("Curse of Weakness");

            case SpellName.DarkPact: return("Dark Pact");

            case SpellName.DemonicEmpowerment: return("Demonic Empowerment");

            case SpellName.DrainLife: return("Drain Life");

            case SpellName.DrainSoul: return("Drain Soul");

            case SpellName.DrainSoulUnder25: return("Drain Soul, target under 25%");

            case SpellName.Haunt: return("Haunt");

            case SpellName.Immolate: return("Immolate");

            case SpellName.ImmolationAura: return("Metamorphosis: Immolation Aura");

            case SpellName.Incinerate: return("Incinerate");

            case SpellName.IncinerateBackdraft: return("Incinerate with Backdraft up");

            case SpellName.IncinerateMoltenCore: return("Incinerate with Molten Core up");

            case SpellName.IncinerateMoltenCoreBackdraft: return("Incinerate with Molten Core and Backdraft up");

            case SpellName.LifeTap: return("Life Tap");

            case SpellName.Metamorphosis: return("Metamorphosis");

            case SpellName.SearingPain: return("Searing Pain");

            case SpellName.SeedOfCorruption: return("Seed of Corruption");

            case SpellName.ShadowBolt: return("Shadow Bolt");

            case SpellName.ShadowboltBackdraft: return("Shadow Bolt with Backdraft up");

            case SpellName.Shadowburn: return("Shadowburn");

            case SpellName.ShadowburnGlyphed: return("Shadowburn with Glyph of Shadowburn");

            case SpellName.ShadowCleave: return("Metamorphosis: Shadow Cleave");

            case SpellName.Shadowflame: return("Shadowflame");

            case SpellName.Shadowfury: return("Shadowfury");

            case SpellName.Soulfire: return("Soulfire");

            case SpellName.SoulfireDecimation: return("Soulfire with Decimation");

            case SpellName.UnstableAffliction: return("Unstable Affliction");
            }
            return("");
        }
Esempio n. 20
0
 public virtual void SetSpellToCast(SpellName spell)
 {
     //To be overridden in children classes
 }
Esempio n. 21
0
    }    //end f'n void GenerateInstance_Iceball(bool)

    /**A function to return a Spell instance representative of the Shield spell.*/
    public void GenerateInstance_Shield()
    {
        this.m_IsMobileSpell = false;
        this.m_SpellName     = SpellName.Shield;
        this.m_SpellEffect   = SpellEffect.Damage_Resistance;
    }    //end f'n void GenerateInstance_Shield()
Esempio n. 22
0
    }    //end f'n void GenerateInstance_Iceball(bool)

    /**A function to return a Spell instance representative of the Iceball spell.*/
    public void GenerateInstance_IceBall()
    {
        this.m_IsMobileSpell = true;
        this.m_SpellName     = SpellName.Iceball;
        this.m_SpellEffect   = SpellEffect.Ice_Freeze;
    }    //end f'n void GenerateInstance_Iceball(bool)
Esempio n. 23
0
    }    //end f'n void GenerateInstance_Fireball(bool)

    /**A function to return a Spell instance representative of the Fireball spell.*/
    public void GenerateInstance_Fireball()
    {
        this.m_IsMobileSpell = true;
        this.m_SpellName     = SpellName.Fireball;
        this.m_SpellEffect   = SpellEffect.Fire_Damage;
    }    //end f'n void GenerateInstance_Fireball()
Esempio n. 24
0
File: Spell.cs Progetto: Marosa/Calc
 public Spell(SpellName spellname,
     SpellTalentSchool talentSchool,
     SpellSchool directSpellSchool = default(SpellSchool),
     SpellSchool DoTSpellSchool = default(SpellSchool),
     double duration = 0,
     bool hasteAffectsDuration = false,
     double baseCasttime = 0,
     double flatCasttimeReduction = 0,
     double percentualCasttimeReduction = 0,
     double hasteFactor = 1,
     double cooldown = 0,
     double manaCostOfBaseMana = 0,
     double manaCostFactor = 1,
     double requiredBuffUptimeFactor = 1,
     Reagent reagent = Reagent.None,
     double averageDirectBaseDamage = 0,
     double averageDoTBaseDamage = 0,
     double SPDirectScaling = 0,
     double SPDoTScaling = 0,
     double APDirectScaling = 0,
     double APDoTScaling = 0,
     bool channeled = false,
     int numOfTicks = 1,
     double directDamageFactor = 1,
     double DoTDamageFactor = 1,
     bool directCanCrit = true,
     bool DoTCanCrit = false,
     double directCritChance = 0,
     double DoTCritChance = 0,
     double directCritDamageFactor = 1.5,
     double DoTCritDamageFactor = 1.5)
 {
     this.spellname = spellname;
     this.talentSchool = talentSchool;
     this.directSpellSchool = directSpellSchool;
     this.duration = duration;
     this.hasteAffectsDuration = hasteAffectsDuration;
     this.baseCasttime = baseCasttime;
     this.flatCasttimeReduction = flatCasttimeReduction;
     this.percentualCasttimeReduction = percentualCasttimeReduction;
     this.effectiveCasttime = ((baseCasttime * (1 - (percentualCasttimeReduction / 100))) - flatCasttimeReduction) / hasteFactor;
     this.hasteFactor = hasteFactor;
     this.cooldown = cooldown;
     this.effectiveCooldown = cooldown;
     this.manaCostOfBaseMana = manaCostOfBaseMana;
     this.manaCostFactor = manaCostFactor;
     this.requiredBuffUptimeFactor = requiredBuffUptimeFactor;
     this.averageDirectBaseDamage = averageDirectBaseDamage;
     this.averageDoTBaseDamage = averageDoTBaseDamage;
     this.SPDirectScaling = SPDirectScaling;
     this.SPDoTScaling = SPDoTScaling;
     this.APDirectScaling = APDirectScaling;
     this.APDoTScaling = APDoTScaling;
     this.reagent = reagent;
     this.channeled = channeled;
     this.numOfTicks = numOfTicks;
     this.directDamageFactor = directDamageFactor;
     this.DoTDamageFactor = DoTDamageFactor;
     this.directCanCrit = directCanCrit;
     this.DoTCanCrit = DoTCanCrit;
     this.directCritChance = directCritChance;
     this.DoTCritChance = DoTCritChance;
     this.directCritDamageFactor = directCritDamageFactor;
     this.DoTCritDamageFactor = DoTCritDamageFactor;
 }
Esempio n. 25
0
 public Spell(SpellName id, string name)
 {
     Id   = id;
     Name = name;
 }
Esempio n. 26
0
    /**A function to return a SpellClass instance based on the spell name, from the SpellName enum, in its enum form.*/
    public SpellClass GenerateInstance(SpellName spell_name)
    {
        SpellClass spellinstance_to_return = new SpellClass();

        switch ((int)spell_name)
        {
        case (int)SpellName.Fireball:
        {
            spellinstance_to_return.m_SpellName      = SpellName.Fireball;
            spellinstance_to_return.m_SpellEffect    = SpellEffect.Fire_Damage;
            spellinstance_to_return.m_SpellType      = SpellType.BASIC_PROJECTILE_ON_TARGET;
            spellinstance_to_return.m_EffectDuration = 0.0f;
            spellinstance_to_return.m_SpellDamage    = FIREBALL_DAMAGE;
            spellinstance_to_return.m_ManaCost       = FIREBALL_MANA_COST;
            spellinstance_to_return.m_SpellVelocity  = FIREBALL_VELOCITY;
            spellinstance_to_return.m_IsPersistent   = false;
            break;
        }                //end case Fireball

        case (int)SpellName.Shield:
        {
            spellinstance_to_return.m_SpellName      = SpellName.Shield;
            spellinstance_to_return.m_SpellEffect    = SpellEffect.Damage_Resistance;
            spellinstance_to_return.m_SpellType      = SpellType.ON_PLAYER;
            spellinstance_to_return.m_EffectDuration = 0.0f;
            //No damage
            spellinstance_to_return.m_ManaCost     = SHIELD_MANA_COST;
            spellinstance_to_return.m_IsPersistent = true;
            break;
        }                //end case Shield

        case (int)SpellName.Iceball:
        {
            spellinstance_to_return.m_SpellName      = SpellName.Iceball;
            spellinstance_to_return.m_SpellEffect    = SpellEffect.Ice_Freeze;
            spellinstance_to_return.m_SpellType      = SpellType.BASIC_PROJECTILE_ON_TARGET;
            spellinstance_to_return.m_EffectDuration = 2.5f;
            spellinstance_to_return.m_SpellDamage    = ICEBALL_DAMAGE;
            spellinstance_to_return.m_SpellVelocity  = ICEBALL_VELOCITY;
            spellinstance_to_return.m_ManaCost       = ICEBALL_MANA_COST;
            spellinstance_to_return.m_IsPersistent   = false;
            break;
        }                //end case Iceball

        case (int)SpellName.Thunderball:
        {
            spellinstance_to_return.m_SpellName      = SpellName.Thunderball;
            spellinstance_to_return.m_SpellEffect    = SpellEffect.Shock_Damage;
            spellinstance_to_return.m_SpellType      = SpellType.BASIC_PROJECTILE_ON_TARGET;
            spellinstance_to_return.m_EffectDuration = 1.25f;
            spellinstance_to_return.m_SpellDamage    = THUNDERBALL_DAMAGE;
            spellinstance_to_return.m_SpellVelocity  = THUNDERBALL_VELOCITY;
            spellinstance_to_return.m_ManaCost       = THUNDERBALL_MANA_COST;
            spellinstance_to_return.m_IsPersistent   = false;
            break;
        }                //end case Thunderball

        case (int)SpellName.Thunderstorm:
        {
            spellinstance_to_return.m_SpellName   = SpellName.Thunderstorm;
            spellinstance_to_return.m_SpellEffect = SpellEffect.AOE_Shock;
            spellinstance_to_return.m_SpellType   = SpellType.AOE_ON_TARGET;
            //While it is true that thunderstorm can be used indefinitely, the effects of this spell are electrocution for a given
            //time; it therefore has a duration value
            spellinstance_to_return.m_EffectDuration = 1.25f;
            spellinstance_to_return.m_SpellDamage    = THUNDERSTORM_DAMAGE;
            spellinstance_to_return.m_ManaCost       = THUNDERSTORM_MANA_COST;
            spellinstance_to_return.m_IsPersistent   = true;
            break;
        }                //end case Thunderstorm

        case (int)SpellName.Heal:
        {
            spellinstance_to_return.m_SpellName      = SpellName.Heal;
            spellinstance_to_return.m_SpellEffect    = SpellEffect.Heal_Player;
            spellinstance_to_return.m_SpellType      = SpellType.ON_PLAYER;
            spellinstance_to_return.m_EffectDuration = 0.0f;
            spellinstance_to_return.m_ManaCost       = HEAL_MANA_COST;
            spellinstance_to_return.m_IsPersistent   = true;
            break;
        }                //end case Heal

        case (int)SpellName.Tornado:
        {
            spellinstance_to_return.m_SpellName      = SpellName.Tornado;
            spellinstance_to_return.m_SpellEffect    = SpellEffect.Knockback;
            spellinstance_to_return.m_SpellType      = SpellType.BASIC_PROJECTILE_ON_TARGET;
            spellinstance_to_return.m_EffectDuration = 0.5f;
            spellinstance_to_return.m_ManaCost       = TORNADO_MANA_COST;
            spellinstance_to_return.m_SpellDamage    = TORNADO_DAMAGE;
            spellinstance_to_return.m_SpellVelocity  = TORNADO_VELOCITY;
            spellinstance_to_return.m_IsPersistent   = false;
            break;
        }    //end case Tornado

        case (int)SpellName.WaterBubble:
        {
            spellinstance_to_return.m_SpellName      = SpellName.WaterBubble;
            spellinstance_to_return.m_SpellEffect    = SpellEffect.Water_Damage;
            spellinstance_to_return.m_SpellType      = SpellType.BASIC_PROJECTILE_ON_TARGET;
            spellinstance_to_return.m_EffectDuration = 0.0f;
            spellinstance_to_return.m_ManaCost       = WATER_BUBBLE_MANA_COST;
            spellinstance_to_return.m_SpellDamage    = WATER_BUBBLE_DAMAGE;
            spellinstance_to_return.m_SpellVelocity  = WATER_BUBBLE_VELOCITY;
            spellinstance_to_return.m_IsPersistent   = false;
            break;
        }    //end case Tornado

        default:
        {
            //Impossible
            break;
        }        //end case default
        }        //end switch

        return(spellinstance_to_return);
    }    //end f'n SpellClass GenerateInstance(SpellName)
Esempio n. 27
0
 public Spell(SpellName spellname,
              SpellTalentSchool talentSchool,
              SpellSchool directSpellSchool = default(SpellSchool),
              SpellSchool DoTSpellSchool    = default(SpellSchool),
              double duration                    = 0,
              bool hasteAffectsDuration          = false,
              double baseCasttime                = 0,
              double flatCasttimeReduction       = 0,
              double percentualCasttimeReduction = 0,
              double hasteFactor                 = 1,
              double cooldown                    = 0,
              double manaCostOfBaseMana          = 0,
              double manaCostFactor              = 1,
              double requiredBuffUptimeFactor    = 1,
              Reagent reagent                    = Reagent.None,
              double averageDirectBaseDamage     = 0,
              double averageDoTBaseDamage        = 0,
              double SPDirectScaling             = 0,
              double SPDoTScaling                = 0,
              double APDirectScaling             = 0,
              double APDoTScaling                = 0,
              bool channeled                = false,
              int numOfTicks                = 1,
              double directDamageFactor     = 1,
              double DoTDamageFactor        = 1,
              bool directCanCrit            = true,
              bool DoTCanCrit               = false,
              double directCritChance       = 0,
              double DoTCritChance          = 0,
              double directCritDamageFactor = 1.5,
              double DoTCritDamageFactor    = 1.5)
 {
     this.spellname                   = spellname;
     this.talentSchool                = talentSchool;
     this.directSpellSchool           = directSpellSchool;
     this.duration                    = duration;
     this.hasteAffectsDuration        = hasteAffectsDuration;
     this.baseCasttime                = baseCasttime;
     this.flatCasttimeReduction       = flatCasttimeReduction;
     this.percentualCasttimeReduction = percentualCasttimeReduction;
     this.effectiveCasttime           = ((baseCasttime * (1 - (percentualCasttimeReduction / 100))) - flatCasttimeReduction) / hasteFactor;
     this.hasteFactor                 = hasteFactor;
     this.cooldown                    = cooldown;
     this.effectiveCooldown           = cooldown;
     this.manaCostOfBaseMana          = manaCostOfBaseMana;
     this.manaCostFactor              = manaCostFactor;
     this.requiredBuffUptimeFactor    = requiredBuffUptimeFactor;
     this.averageDirectBaseDamage     = averageDirectBaseDamage;
     this.averageDoTBaseDamage        = averageDoTBaseDamage;
     this.SPDirectScaling             = SPDirectScaling;
     this.SPDoTScaling                = SPDoTScaling;
     this.APDirectScaling             = APDirectScaling;
     this.APDoTScaling                = APDoTScaling;
     this.reagent                = reagent;
     this.channeled              = channeled;
     this.numOfTicks             = numOfTicks;
     this.directDamageFactor     = directDamageFactor;
     this.DoTDamageFactor        = DoTDamageFactor;
     this.directCanCrit          = directCanCrit;
     this.DoTCanCrit             = DoTCanCrit;
     this.directCritChance       = directCritChance;
     this.DoTCritChance          = DoTCritChance;
     this.directCritDamageFactor = directCritDamageFactor;
     this.DoTCritDamageFactor    = DoTCritDamageFactor;
 }
Esempio n. 28
0
 public CastSpellActivity(SpellName spellName, Character actor, Tile targetTile) :
     base(actor, 10, "Casting " + SpellDb.GetSpell(spellName).Name)
 {
     SpellName = spellName;
     Tile      = targetTile;
 }
Esempio n. 29
0
 public SpellDelegate GetSpellDelegate(SpellName spellName)
 {
     return(SpellDelegates[(int)spellName]);
 }