Ejemplo n.º 1
0
 public Ability(LilithAbilities id)
 {
     _abilitySceneScript = AbilitySceneProvider.GetBy(id);
     TextureName = Enum.GetName(typeof(LilithAbilities), id);
     switch (id)
     {
         case LilithAbilities.Attack:
             this.cost = 2;
             break;
         case LilithAbilities.Blizzard:
             this.cost = 1;
             break;
         case LilithAbilities.Fireball:
             this.cost = 4;
             break;
         case LilithAbilities.Heal:
             this.cost = 3;
             IsFriendly = true;
             break;
         case LilithAbilities.ChannelEmpower:
             this.cost = 3;
             IsFriendly = true;
             break;
         case LilithAbilities.HealGroup:
             this.cost = 5;
             IsFriendly = true;
             break;
         default:
             break;
     }
 }
    public static List<SceneActionBase> GetBy(LilithAbilities ability)
    {
        if (!loadedScenes.ContainsKey(ability))
        {
            switch (ability)
            {
                case LilithAbilities.Attack:
                    CreateSwingSword();
                    break;
                case LilithAbilities.Blizzard:
                    CreateBlizzard();
                    break;
                case LilithAbilities.Fireball:
                    CreateFireball();
                    break;
                case LilithAbilities.Heal:
                    CreateHeal();
                    break;
                case LilithAbilities.ChannelEmpower:
                    CreateEmpower();
                    break;
                case LilithAbilities.HealGroup:
                    CreateHealGroup();
                    break;
                default:
                    throw new NotSupportedException();
            }
        }

        return loadedScenes[ability];
    }