public void CastSpell(SPELL spellName)
 {
     switch (spellName)
     {
         case SPELL.ATTACK:
             Attack();
             break;
         case SPELL.HEAL:
             Heal();
             break;
         case SPELL.TWOATTACKS:
             TwoAttacks();
             break;
         case SPELL.TELEPORTATION:
             Teleportation();
             break;
         case SPELL.REDUCTIONDAMAGE:
             ReductionDamage();
             break;
         case SPELL.ATTACKLONGRANGE:
             AtackLongRange();
             break;
         case SPELL.COUNTERATTACK:
             CounterAttack();
             break;
         case SPELL.STUN:
             Stun();
             break;
         case SPELL.INVOCATION:
             Invocation();
             break;
     }
 }
        private void AcceptDialog(object sender, RoutedEventArgs e)
        {
            if (!Validation.GetHasError(SpellName) && !Validation.GetHasError(School) &&
                !Validation.GetHasError(SubSchool) && !Validation.GetHasError(Level) &&
                !Validation.GetHasError(CastingTime) && !Validation.GetHasError(Components) &&
                !Validation.GetHasError(Range) && !Validation.GetHasError(Area) &&
                !Validation.GetHasError(Effect) && !Validation.GetHasError(Targets) &&
                !Validation.GetHasError(Duration) && !Validation.GetHasError(SavingThrow) &&
                !Validation.GetHasError(SpellDescription) && !Validation.GetHasError(ShortDescription) &&
                !Validation.GetHasError(Domain))
            {
                string spellName   = SpellName.Text;
                string school      = School.Text;
                string subSchool   = SubSchool.Text;
                string effect      = Effect.Text;
                string castingTime = CastingTime.Text;
                string components  = Components.Text;
                string range       = Range.Text;
                string area        = Area.Text;
                string targets     = Targets.Text;
                string duration    = Duration.Text;
                string savingThrow = SavingThrow.Text;
                string spellRes    = SpellResistance.Text;
                string spellDes    = SpellDescription.Text;
                string level       = Level.Text;
                string shortDes    = ShortDescription.Text;
                string domain      = Domain.Text;

                var   forgeDatabase = Global.Instance.ForgeDatabase();
                SPELL spell         = new SPELL()
                {
                    Name             = spellName,
                    School           = school,
                    SubSchool        = subSchool,
                    Effect           = effect,
                    CastingTime      = castingTime,
                    Components       = components,
                    Range            = range,
                    Area             = area,
                    Targets          = targets,
                    Duration         = duration,
                    SavingThrow      = savingThrow,
                    SpellResistance  = spellRes,
                    Description      = spellDes,
                    Level            = level,
                    ShortDescription = shortDes,
                    Domain           = domain
                };

                forgeDatabase.Spells.InsertOnSubmit(spell);
                forgeDatabase.SubmitChanges();

                PopulateSpellCollection();

                IoC.Get <IEventAggregator>().PublishOnUIThread("AcceptAddSpellDialog");
                IoC.Get <IEventAggregator>().PublishOnUIThread("AcceptRootDialog");
            }
        }
Пример #3
0
    public string GetSpellInfo(SPELL _spellID)
    {
        string temp = "";

        SpellInfo spInfo = GameCore.Core.spellRepository.Get(_spellID);

        temp += spInfo.GetSpellDescription();

        return(temp);
    }
Пример #4
0
 public Spell FindSpell(SPELL _spell)
 {
     for (int i = 0; i < spellsAmount; i++)
     {
         if (PlayerSpell[i].ID == _spell)
         {
             return(PlayerSpell[i]);
         }
     }
     return(null);
 }
Пример #5
0
 public SpellInfo Get(SPELL ID)
 {
     try
     {
         return(spellRepo[ID]);
     }
     catch
     {
         Debug.Log(ID);
         return(null);
     }
 }
Пример #6
0
    public CardModel(int cardID, bool isPlayer)
    {
        CardEntity cardEntity = Resources.Load <CardEntity>("CardEntityList/Card" + cardID);

        name    = cardEntity.name;
        hp      = cardEntity.hp;
        at      = cardEntity.at;
        cost    = cardEntity.cost;
        icon    = cardEntity.icon;
        ability = cardEntity.ability;
        spell   = cardEntity.spell;

        isAlive      = true;
        isPlayerCard = isPlayer;
    }
    //コンストラクタを明示的に指定
    public CardModel(int cardID, bool isPlayer)
    {
        CardEntity cardEntity = Resources.Load <CardEntity>("CardEntityList/Card" + cardID);

        this.name         = cardEntity.name;
        this.hp           = cardEntity.hp;
        this.at           = cardEntity.at;
        this.cost         = cardEntity.cost;
        this.icon         = cardEntity.icon;
        this.ability      = cardEntity.ability;
        this.spell        = cardEntity.spell;
        this.isAlive      = true;
        this.isPlayerCard = isPlayer;
        this.canAttack    = false;
    }
Пример #8
0
    public float coeff = 1f; // przelicznik z Mocy na efektywnosc

    // , float _maxCooldown, Sprite _iconSprite, string _name, float _manacost
    public Spell(SPELL _ID)
    {
        ID          = _ID;
        spellInfo   = GameCore.Core.spellRepository.Get(_ID);
        maxCooldown = spellInfo.cooldown;
        cooldown    = maxCooldown;
        iconSprite  = Resources.Load <Sprite>(spellInfo.icon);
        name        = spellInfo.name;
        manacost    = spellInfo.manaCost;
        myIcon      = null;
        mEffect     = GameCore.Core.spellRepository.Get(ID).effect;
        maxCharges  = spellInfo.charges;
        charges     = maxCharges;
        chargeLoad  = spellInfo.chargesGain;
        castTime    = spellInfo.castTime;
    }
Пример #9
0
        public void DeleteSpell()
        {
            try
            {
                int spellID = SpellCollection[SelectedIndex].ID;

                var forgeDatabase = Global.Instance.ForgeDatabase();

                SPELL spell = forgeDatabase.Spells.Single(x => x.ID == spellID);

                forgeDatabase.Spells.DeleteOnSubmit(spell);
                forgeDatabase.SubmitChanges();

                SpellCollection.RemoveAt(SelectedIndex);
                Global.Instance.SpellCollection = new BindableCollection <SpellCollection>(SpellCollection);

                ClearSpellInfo();
                SelectedIndex = -1;
            }
            catch { }
        }
Пример #10
0
 public SpellInfo(SPELL _id, string _name, int _basevalue, float _coeff, int _basevalue2,
                  float _coeff2, int _castTime, int _cooldown, int _charges, int _chargesGain,
                  string _icon, int _HoTgap, int _ticksCount, int _manaCost, HEALTYPE _healtype, bool _channeling, SpellEffect _effect)
 {
     ID          = _id;
     name        = _name;
     baseValue   = _basevalue;
     coeff       = _coeff;
     baseValue2  = _basevalue2;
     coeff2      = _coeff2;
     castTime    = _castTime;
     cooldown    = _cooldown;
     charges     = _charges;
     chargesGain = _chargesGain;
     icon        = _icon;
     HoTgap      = _HoTgap;
     ticksCount  = _ticksCount;
     manaCost    = _manaCost;
     healtype    = _healtype;
     channeling  = _channeling;
     effect      = _effect;
 }
Пример #11
0
    // ------------
    // STATYCZNE //
    // ------------

    public static Spell[] GenerateSpellKit(CHAMPION classID, Caster _mycaster = null)
    {
        SPELL[] _myIDs = new SPELL[5];
        Spell[] _mykit = new Spell[5];

        switch (classID)
        {
        case CHAMPION.PALADIN:
        {
            _myIDs[0] = SPELL.WORD_OF_KINGS_LIGHT;
            _myIDs[1] = SPELL.WORD_OF_KINGS_COURAGE;
            _myIDs[2] = SPELL.WORD_OF_KINGS_FAITH;
            _myIDs[3] = SPELL.WORD_OF_KINGS_LOYALTY;
            _myIDs[4] = SPELL.DIVINE_INTERVENTION;
        }
        break;

        case CHAMPION.SHADOWMANCER:
        {
            _myIDs[0] = SPELL.SOOTHING_VOID;
            _myIDs[1] = SPELL.SHADOWSURGE;
            _myIDs[2] = SPELL.TWILIGHT_BEAM;
            _myIDs[3] = SPELL.SHADOWSONG;
            _myIDs[4] = SPELL.SACRIFICE;
        }
        break;
        }

        for (int i = 0; i < 5; i++)
        {
            _mykit[i] = new Spell(_myIDs[i]);
        }

        // , Spell.GetCooldown(_myIDs[i], _mycaster), Spell.GetIcon(_myIDs[i]), Spell.GetName(_myIDs[i]), Spell.GetManaCost(_myIDs[i])

        return(_mykit);
    }
Пример #12
0
 private void Add(SPELL ID, SpellInfo info)
 {
     spellRepo.Add(ID, info);
 }
 public void SpellSelected()
 {
     currentSpell = spellInDropdown[dropdown.value];
     CastSpell(currentSpell);
 }