コード例 #1
0
ファイル: MemBaseSpell.cs プロジェクト: narlon/TOMClassic
 public MemBaseSpell(Spell spl)
 {
     spellId = spl.Id;
     Level = spl.Level;
     spellInfo = spl;
     HintWord = "";
 }
コード例 #2
0
ファイル: SpellAssistant.cs プロジェクト: narlon/TOMClassic
        public static void CheckSpellEffect(Spell spell, bool isLeft, LiveMonster target, Point mouse)
        {
            MemBaseSpell spl = new MemBaseSpell(spell);
            spl.CheckSpellEffect(isLeft, target, mouse);
            if (spell.Addon != 0 && (spl.SpellConfig.Cure > 0 || spl.SpellConfig.Damage > 0))
                BattleManager.Instance.FlowWordQueue.Add(new FlowWord(string.Format("{0}倍施法!", 1+spell.Addon), mouse, 0, "Gold", 26, 0, 0, 2, 15), false);

            SpellConfig spellConfig = spell.SpellConfig;
            if (spl.HintWord!="")
                BattleManager.Instance.FlowWordQueue.Add(new FlowWord(spl.HintWord, mouse, 0, "Cyan", 26, 0, 0, 0, 15), false);
            if (!string.IsNullOrEmpty(spellConfig.UnitEffect))
            {
                if (BattleTargetManager.PlayEffectOnMonster(spellConfig.Target))
                    BattleManager.Instance.EffectQueue.Add(new ActiveEffect(EffectBook.GetEffect(spellConfig.UnitEffect), target, false));
                if (BattleTargetManager.PlayEffectOnMouse(spellConfig.Target))
                    BattleManager.Instance.EffectQueue.Add(new ActiveEffect(EffectBook.GetEffect(spellConfig.UnitEffect), mouse, false));
            }
        }
コード例 #3
0
ファイル: InfoWorld.cs プロジェクト: narlon/TOMClassic
 private void ReinstallCardProducts()
 {
     int index = 1;
     foreach (var monsterConfig in ConfigData.MonsterDict.Values)
     {
         if (monsterConfig.IsSpecial > 0)
             continue;
         Monster mon = new Monster(monsterConfig.Id);
         int rate = GetSellRate(monsterConfig.Id);
         CardProductMarkTypes mark = CardProductMarkTypes.Null;
         if (monsterConfig.IsNew > 0)
         {
             rate = 100;
             mark = CardProductMarkTypes.New;
         }
         if (MathTool.GetRandom(100) < rate)
         {
             if (mark == 0)
             {
                 mark = mon.GetSellMark();
             }
             CardProducts.Add(new CardProduct(index++, mon.Id, (int)mark));
         }
     }
     foreach (var weaponConfig in ConfigData.WeaponDict.Values)
     {
         if (weaponConfig.IsSpecial > 0)
             continue;
         Weapon wpn = new Weapon(weaponConfig.Id);
         int rate = GetSellRate(weaponConfig.Id);
         CardProductMarkTypes mark = CardProductMarkTypes.Null;
         if (weaponConfig.IsNew > 0)
         {
             rate = 100;
             mark = CardProductMarkTypes.New;
         }
         if (MathTool.GetRandom(100) < rate)
         {
             if (mark == 0)
             {
                 mark = wpn.GetSellMark();
             }
             CardProducts.Add(new CardProduct(index++, wpn.Id, (int)mark));
         }
     }
     foreach (var spellConfig in ConfigData.SpellDict.Values)
     {
         if (spellConfig.IsSpecial > 0)
             continue;
         Spell spl = new Spell(spellConfig.Id);
         int rate = GetSellRate(spellConfig.Id);
         CardProductMarkTypes mark = CardProductMarkTypes.Null;
         if (spellConfig.IsNew > 0)
         {
             rate = 100;
             mark = CardProductMarkTypes.New;
         }
         if (MathTool.GetRandom(100) < rate)
         {
             if (mark == 0)
             {
                 mark = spl.GetSellMark();
             }
             CardProducts.Add(new CardProduct(index++, spl.Id, (int)mark));
         }
     }
 }
コード例 #4
0
ファイル: Player.cs プロジェクト: narlon/TOMClassic
        public void DoSpell(LiveMonster target, ActiveCard card, Point location)
        {
            if (!CheckUseCard(card))
            {
                return;
            }

            try
            {
                Spell spell = new Spell(card.CardId);
                spell.Addon = SpellEffectAddon;
                spell.UpgradeToLevel(card.Level);
                BattleManager.Instance.BattleInfo.GetPlayer(IsLeft).SpellAdd++;

                SpellAssistant.CheckSpellEffect(spell, IsLeft, target, location);

                if (SpikeManager.HasSpike("mirrorspell"))
                {
                    var rival = IsLeft ? BattleManager.Instance.PlayerManager.RightPlayer : BattleManager.Instance.PlayerManager.LeftPlayer;
                    rival.AddCard(null, card.CardId, card.Level);
                }
            }
            catch (Exception e)
            {
                NLog.Warn(e);
                BattleManager.Instance.FlowWordQueue.Add(new FlowWord("未知错误", location, 0, "Red", 26, 0, 0, 2, 15),false);
                return;
            }
            
            CardManager.DeleteCardAt(SelectId);
        }
コード例 #5
0
ファイル: SpellCard.cs プロジェクト: narlon/TOMClassic
 public SpellCard(Spell spell)
 {
     this.spell = spell;
     card = new DeckCard(spell.Id, 1, 0);
 }