本文整理匯總了C#中Server.Spells.Spell.DoFizzle方法的典型用法代碼示例。如果您正苦於以下問題:C# Spell.DoFizzle方法的具體用法?C# Spell.DoFizzle怎麽用?C# Spell.DoFizzle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Server.Spells.Spell
的用法示例。
在下文中一共展示了Spell.DoFizzle方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: OnCast
public static bool OnCast( Mobile caster, Spell spell )
{
ITransformationSpell transformSpell = spell as ITransformationSpell;
if( transformSpell == null )
return false;
if( !caster.CanBeginAction( typeof( PolymorphSpell ) ) )
{
caster.SendLocalizedMessage( 1061628 ); // You can't do that while polymorphed.
}
else if ( DisguiseTimers.IsDisguised( caster ) )
{
caster.SendLocalizedMessage( 1061631 ); // You can't do that while disguised.
return false;
}
else if( !caster.CanBeginAction( typeof( IncognitoSpell ) ) || (caster.IsBodyMod && GetContext( caster ) == null) )
{
spell.DoFizzle();
}
else if( spell.CheckSequence() )
{
TransformContext context = GetContext( caster );
Type ourType = spell.GetType();
bool wasTransformed = (context != null);
bool ourTransform = (wasTransformed && context.Type == ourType);
if( wasTransformed )
{
RemoveContext( caster, context, ourTransform );
if( ourTransform )
{
caster.PlaySound( 0xFA );
caster.FixedParticles( 0x3728, 1, 13, 5042, EffectLayer.Waist );
}
}
if( !ourTransform )
{
if( !((Body)transformSpell.Body).IsHuman )
{
Mobiles.IMount mt = caster.Mount;
if( mt != null )
mt.Rider = null;
}
caster.BodyMod = transformSpell.Body;
caster.HueMod = transformSpell.Hue;
transformSpell.DoEffect( caster );
Timer timer = new TransformTimer( caster, transformSpell );
timer.Start();
AddContext( caster, new TransformContext( timer, ourType, transformSpell ) );
return true;
}
}
return false;
}
示例2: OnCast
public static bool OnCast(Mobile caster, Spell spell)
{
ITransformationSpell transformSpell = spell as ITransformationSpell;
if (transformSpell == null)
return false;
if (Factions.Sigil.ExistsOn(caster))
{
caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
}
else if (!caster.CanBeginAction(typeof(PolymorphSpell)))
{
caster.SendLocalizedMessage(1061628); // You can't do that while polymorphed.
}
else if (DisguiseTimers.IsDisguised(caster))
{
caster.SendLocalizedMessage(1061631); // You can't do that while disguised.
return false;
}
else if (AnimalForm.UnderTransformation(caster))
{
caster.SendLocalizedMessage(1061091); // You cannot cast that spell in this form.
}
else if (!caster.CanBeginAction(typeof(IncognitoSpell)) || (caster.IsBodyMod && GetContext(caster) == null))
{
spell.DoFizzle();
}
else if (spell.CheckSequence())
{
TransformContext context = GetContext(caster);
Type ourType = spell.GetType();
bool wasTransformed = (context != null);
bool ourTransform = (wasTransformed && context.Type == ourType);
if (wasTransformed)
{
RemoveContext(caster, context, ourTransform);
if (ourTransform)
{
caster.PlaySound(0xFA);
caster.FixedParticles(0x3728, 1, 13, 5042, EffectLayer.Waist);
}
}
if (!ourTransform)
{
List<ResistanceMod> mods = new List<ResistanceMod>();
if (transformSpell.PhysResistOffset != 0)
mods.Add(new ResistanceMod(ResistanceType.Physical, transformSpell.PhysResistOffset));
if (transformSpell.FireResistOffset != 0)
mods.Add(new ResistanceMod(ResistanceType.Fire, transformSpell.FireResistOffset));
if (transformSpell.ColdResistOffset != 0)
mods.Add(new ResistanceMod(ResistanceType.Cold, transformSpell.ColdResistOffset));
if (transformSpell.PoisResistOffset != 0)
mods.Add(new ResistanceMod(ResistanceType.Poison, transformSpell.PoisResistOffset));
if (transformSpell.NrgyResistOffset != 0)
mods.Add(new ResistanceMod(ResistanceType.Energy, transformSpell.NrgyResistOffset));
if (!((Body)transformSpell.Body).IsHuman)
{
Mobiles.IMount mt = caster.Mount;
if (mt != null)
mt.Rider = null;
}
caster.BodyMod = transformSpell.Body;
caster.HueMod = transformSpell.Hue;
for (int i = 0; i < mods.Count; ++i)
caster.AddResistanceMod(mods[i]);
transformSpell.DoEffect(caster);
Timer timer = new TransformTimer(caster, transformSpell);
timer.Start();
AddContext(caster, new TransformContext(timer, mods, ourType, transformSpell));
return true;
}
}
return false;
}
示例3: RechargeWand
public virtual void RechargeWand(Mobile from, Spell spell)
{
if (m_UsedAfterReCharged)
{
m_MaxCharges--;
m_UsedAfterReCharged = false;
}
if (from.FindItemOnLayer(Layer.OneHanded) != this)
{
from.SendAsciiMessage("You must have your wand equipped to recharge it");
spell.DoFizzle();
}
else if (spell.Name != Name)
{
from.SendAsciiMessage("That is not a {0} wand", spell.Name);
spell.DoFizzle();
}
else if (m_Charges >= m_MaxCharges)
{
from.SendAsciiMessage("That wand is at max charges");
spell.DoFizzle();
}
else if (spell.CheckSequence())
{
m_Charges++;
from.PlaySound(spell.Sound);
}
spell.FinishSequence();
}