当前位置: 首页>>代码示例>>C#>>正文


C# ISpell类代码示例

本文整理汇总了C#中ISpell的典型用法代码示例。如果您正苦于以下问题:C# ISpell类的具体用法?C# ISpell怎么用?C# ISpell使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ISpell类属于命名空间,在下文中一共展示了ISpell类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnBeginSpellCast

        public override bool OnBeginSpellCast( Mobile m, ISpell s )
        {
            if (!CTFGame.Running)
            {
                m.SendMessage( CTFGame.HuePerson, "You cannot cast spells until the game has started." );
                return false;
            }
            else if( CTFGame.GetFlag( m ) != null && s is InvisibilitySpell)
            {
                m.SendMessage( CTFGame.HuePerson, "You cannot use invisibility spell while carrying a flag." );
                return false;
            }
            else if ( m.AccessLevel == AccessLevel.Player &&
                ( s is MarkSpell || s is RecallSpell || s is GateTravelSpell || s is PolymorphSpell ||
                s is SummonDaemonSpell || s is AirElementalSpell || s is EarthElementalSpell || s is EnergyVortexSpell ||
                s is FireElementalSpell || s is WaterElementalSpell || s is BladeSpiritsSpell || s is SummonCreatureSpell ||
                s is EnergyFieldSpell || s is ResurrectionSpell || s is LichFormSpell || s is HorrificBeastSpell || s is WraithFormSpell ||
                s is VengefulSpiritSpell || s is SummonFamiliarSpell || s is SacredJourneySpell
                ) )
            {
                m.SendMessage( CTFGame.HuePerson, "That spell is not allowed here." );
                return false;
            }

            else if (((Spell)s).Info.Name == "Ethereal Mount")
            {
                m.SendMessage("You cannot mount your ethereal here.");
                return false;
            }

            return base.OnBeginSpellCast( m, s );
        }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:32,代码来源:CTFGameRegion.cs

示例2: OnBeginSpellCast

        public override bool OnBeginSpellCast( Mobile from, ISpell s )
        {
            if ( from.AccessLevel == AccessLevel.Player )
                from.SendLocalizedMessage( 502629 ); // You cannot cast spells here.

            return ( from.AccessLevel > AccessLevel.Player );
        }
开发者ID:Godkong,项目名称:RunUO,代码行数:7,代码来源:Jail.cs

示例3: SpellAllowed

        public bool SpellAllowed(ISpell s)
        {
            Type stype = s.GetType();

            foreach (Type type in m_BeneficialTypes)
                if (type == stype)
                {
                    m_Spell = s.GetType();
                    return true;
                }

            if (s.GetType() == m_Spell)
                m_CastCount++;

            else
            {
                m_Spell = s.GetType();
                m_CastCount = 1;
            }

            if (m_CastCount > 3)
            {
                m_Part.SendMessage("You have already tried to cast that spell three times in a row!");
                return false;
            }

            return true;
        }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:28,代码来源:SpellWatcher.cs

示例4: OnBeginSpellCast

        public override bool OnBeginSpellCast(Mobile from, ISpell s)
        {
            if (from.IsPlayer())
                from.SendLocalizedMessage(502629); // You cannot cast spells here.

            return (from.IsStaff());
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:7,代码来源:Jail.cs

示例5: OnBeginSpellCast

        public override bool OnBeginSpellCast(Mobile from, ISpell s)
        {
            if (s is GateTravelSpell || s is RecallSpell || s is MarkSpell || s is InvisibilitySpell)
                return false;

            return true;
        }
开发者ID:greeduomacro,项目名称:DimensionsNewAge,代码行数:7,代码来源:TheHuntRegion.cs

示例6: ValidateAttack

        protected void ValidateAttack(ISpell spellToCast)
        {
            if (this.Unit.EnergyPoints < spellToCast.EnergyCost)
                throw new NotEnoughEnergyException(string.Format("{0} does not have enough energy to cast {1}", unit.Name, spellToCast.GetType().Name));

            unit.EnergyPoints -= spellToCast.EnergyCost;
        }
开发者ID:LyuboslavLyubenov,项目名称:OOP,代码行数:7,代码来源:CombatHandlerBase.cs

示例7: ValidateEnergy

 public void ValidateEnergy(ISpell attack)
 {
     if (this.Unit.EnergyPoints - attack.EnergyCost < 0)
        {
        throw new NotEnoughEnergyException(String.Format(GlobalMessages.NotEnoughEnergy, this.Unit.Name,
            attack.GetType().Name));
        }
 }
开发者ID:ikolev94,项目名称:Exercises,代码行数:8,代码来源:CombatHandler.cs

示例8: OnBeginSpellCast

 public override bool OnBeginSpellCast( Mobile from, ISpell s )
 {
     if( from.AccessLevel > AccessLevel.Player )
     {
         return false;
     }
     return _BoardGameControlItem.CanCastSpells;
 }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:8,代码来源:BoardGameRegion.cs

示例9: CastSpell

 public bool CastSpell(ISpell spell, Point target)
 {
     m_engine.BeforePlayerAction();
     bool didAnything = m_engine.CastSpell(m_engine.Player, (Spell)spell, target);
     if (didAnything)
         m_engine.AfterPlayerAction();
     return didAnything;
 }
开发者ID:donblas,项目名称:magecrawl,代码行数:8,代码来源:PlayerActionEngine.cs

示例10: ValidateEnergyPoints

 public void ValidateEnergyPoints(IUnit unit, ISpell spell)
 {
     if (unit.EnergyPoints < spell.EnergyCost)
     {
         throw new NotEnoughEnergyException(
             string.Format("{0} does not have enough energy to cast {1}", unit.Name, spell.GetType().Name));
     }
 }
开发者ID:EBojilova,项目名称:CSharp-OOP-June-2015,代码行数:8,代码来源:CombatHandler.cs

示例11: OnBeginSpellCast

 public override bool OnBeginSpellCast(Mobile m, ISpell s)
 {
     if (m.Player && m.AccessLevel < AccessLevel.GameMaster)
     {
         FizzleStrangely(m);
         return false;
     }
     return base.OnBeginSpellCast(m, s);
 }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:9,代码来源:CursedCaveRegion.cs

示例12: OnBeginSpellCast

 public override bool OnBeginSpellCast(Mobile from, ISpell s)
 {
     if (from.AccessLevel == AccessLevel.Player)
     {
         from.SendMessage("You cannot cast spells on a race track.");
         return false;
     }
     return base.OnBeginSpellCast(from, s);
 }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:9,代码来源:CrateRegions.cs

示例13: OnBeginSpellCast

 public override bool OnBeginSpellCast(Mobile m, ISpell s)
 {
     if (s is MarkSpell || s is GateTravelSpell)
     {
         m.SendMessage("You can not cast that here");
         return false;
     }
     return base.OnBeginSpellCast(m, s);
 }
开发者ID:kamronbatman,项目名称:Defiance-AOS-Pre-2012,代码行数:9,代码来源:BaseDoomRegion.cs

示例14: OnBeginSpellCast

 public override bool OnBeginSpellCast(Mobile m, ISpell s)
 {
     if ((s is GateTravelSpell || s is RecallSpell || s is MarkSpell || s is SacredJourneySpell) && m.AccessLevel == AccessLevel.Player)
     {
         m.SendMessage("You cannot cast that spell here.");
         return false;
     }
     return base.OnBeginSpellCast(m, s);
 }
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:9,代码来源:NoRecallRegion.cs

示例15: IsThereEnoughEnergy

 protected void IsThereEnoughEnergy(ISpell attack)
 {
     if (this.Unit.EnergyPoints < attack.EnergyCost)
     {
         throw new NotEnoughEnergyException(string.Format(
             GlobalMessages.NotEnoughEnergy,
             this.Unit.Name,
             attack.GetType().Name));
     }
 }
开发者ID:IskraNikolova,项目名称:Object-oriented-programming,代码行数:10,代码来源:CombatHandler.cs


注:本文中的ISpell类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。