本文整理汇总了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 );
}
示例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 );
}
示例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;
}
示例4: OnBeginSpellCast
public override bool OnBeginSpellCast(Mobile from, ISpell s)
{
if (from.IsPlayer())
from.SendLocalizedMessage(502629); // You cannot cast spells here.
return (from.IsStaff());
}
示例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;
}
示例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;
}
示例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));
}
}
示例8: OnBeginSpellCast
public override bool OnBeginSpellCast( Mobile from, ISpell s )
{
if( from.AccessLevel > AccessLevel.Player )
{
return false;
}
return _BoardGameControlItem.CanCastSpells;
}
示例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;
}
示例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));
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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));
}
}