本文整理汇总了C#中SpellState类的典型用法代码示例。如果您正苦于以下问题:C# SpellState类的具体用法?C# SpellState怎么用?C# SpellState使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SpellState类属于命名空间,在下文中一共展示了SpellState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartSpell
public void StartSpell () {
//Debug.Log (Name + " START");
InitializeGround ();
InitializeText ();
CenterObjectInitialize ();
ShowWinAnimation (false);
// listening to events really "starts" the spell
ListenToEvents ();
state = SpellState.InProgress;
NotifyStateChange ();
}
示例2: OnSpellOver
private void OnSpellOver (SpellState state, Spell spell) {
//Debug.Log (spell.Name + ": state is " + state);
if (IsSpellOver (spell)) {
StopSpell (spell);
if (OnSpellComplete != null) {
OnSpellComplete (spell);
}
if (state == SpellState.Win)
{
winBox.GetComponent<Canvas>().enabled = true;
}
else if (state == SpellState.Lose)
{
loseBox.GetComponent<Canvas>().enabled = true;
}
// Ref: http://answers.unity3d.com/questions/350721/c-yield-waitforseconds.html
StartCoroutine (WaitThenShowNextInstructions (spell));
}
}
示例3: Cast
public bool Cast()
{
m_StartCastTime = DateTime.Now;
if ( Core.AOS && m_Caster.Spell is Spell && ((Spell)m_Caster.Spell).State == SpellState.Sequencing )
((Spell)m_Caster.Spell).Disturb( DisturbType.NewCast );
if ( !m_Caster.CheckAlive() )
{
return false;
}
else if ( m_Caster.Spell != null && m_Caster.Spell.IsCasting )
{
m_Caster.SendLocalizedMessage( 502642 ); // You are already casting a spell.
}
//else if ( BlockedByHorrificBeast && TransformationSpell.UnderTransformation( m_Caster, typeof( HorrificBeastSpell ) ) )
//{
// m_Caster.SendLocalizedMessage( 1061091 ); // You cannot cast that spell in this form.
//}
else if ( !(m_Scroll is BaseWand) && (m_Caster.Paralyzed || m_Caster.Frozen) )
{
m_Caster.SendLocalizedMessage( 502643 ); // You can not cast a spell while frozen.
}
//else if ( CheckNextSpellTime && DateTime.Now < m_Caster.NextSpellTime )
else if ( DateTime.Now < m_Caster.NextSpellTime )
{
m_Caster.SendLocalizedMessage( 502644 ); // You must wait for that spell to have an effect.
}
else if ( m_Caster.Mana >= ScaleMana( GetMana() ) )
{
if ( m_Caster.Spell == null && m_Caster.CheckSpellCast( this ) && CheckCast() && m_Caster.Region.OnBeginSpellCast( m_Caster, this ) )
{
m_State = SpellState.Casting;
m_Caster.Spell = this;
if ( RevealOnCast )
m_Caster.RevealingAction();
SayMantra();
TimeSpan castDelay = this.GetCastDelay();
// ---- Individual spell timing alterations ----
// For FC ----
if ( m_Info.Name == "Mind Blast" )
castDelay = this.GetCastDelay() + TimeSpan.FromSeconds( 0.45 );
else if ( m_Info.Name == "Cure" )
castDelay = this.GetCastDelay() + TimeSpan.FromSeconds( 0.02 );
// For FCR ----
if ( m_Info.Name == "Heal" )
NextSpellDelay = TimeSpan.FromSeconds( 0.95 );
else
NextSpellDelay = TimeSpan.FromSeconds( 0.80 );
// ----
if ( m_Caster.Body.IsHuman )
{
int count = (int)Math.Ceiling( castDelay.TotalSeconds / AnimateDelay.TotalSeconds );
if ( count != 0 )
{
m_AnimTimer = new AnimTimer( this, count );
m_AnimTimer.Start();
}
if ( m_Info.LeftHandEffect > 0 )
Caster.FixedParticles( 0, 10, 5, m_Info.LeftHandEffect, EffectLayer.LeftHand );
if ( m_Info.RightHandEffect > 0 )
Caster.FixedParticles( 0, 10, 5, m_Info.RightHandEffect, EffectLayer.RightHand );
}
if ( ClearHandsOnCast )
m_Caster.ClearHands();
m_CastTimer = new CastTimer( this, castDelay );
m_CastTimer.Start();
OnBeginCast();
// If the caster is a staffmember, log the spellcasting.
if ( m_Caster.AccessLevel > AccessLevel.Player )
Server.Scripts.Commands.CommandLogging.LogCastSpell( m_Caster, this.Name );
return true;
}
else
{
return false;
}
}
else
{
m_Caster.LocalOverheadMessage( MessageType.Regular, 0x22, 502625 ); // Insufficient mana
}
return false;
}
示例4: Disturb
public void Disturb( DisturbType type, bool firstCircle, bool resistable )
{
if ( !CheckDisturb( type, firstCircle, resistable ) )
return;
if ( m_State == SpellState.Casting )
{
if( !firstCircle && !Core.AOS && this is MagerySpell && ((MagerySpell)this).Circle == SpellCircle.First )
return;
m_State = SpellState.None;
m_Caster.Spell = null;
OnDisturb( type, true );
if ( m_CastTimer != null )
m_CastTimer.Stop();
if ( m_AnimTimer != null )
m_AnimTimer.Stop();
if ( Core.AOS && m_Caster.Player && type == DisturbType.Hurt )
DoHurtFizzle();
m_Caster.NextSpellTime = DateTime.Now + GetDisturbRecovery();
}
else if ( m_State == SpellState.Sequencing )
{
if( !firstCircle && !Core.AOS && this is MagerySpell && ((MagerySpell)this).Circle == SpellCircle.First )
return;
m_State = SpellState.None;
m_Caster.Spell = null;
OnDisturb( type, false );
Targeting.Target.Cancel( m_Caster );
if ( Core.AOS && m_Caster.Player && type == DisturbType.Hurt )
DoHurtFizzle();
}
}
示例5: Cast
public bool Cast()
{
m_StartCastTime = DateTime.Now;
if ( Core.AOS && m_Caster.Spell is Spell && ((Spell)m_Caster.Spell).State == SpellState.Sequencing )
((Spell)m_Caster.Spell).Disturb( DisturbType.NewCast );
if ( !m_Caster.CheckAlive() )
{
return false;
}
#region Mondain's Legacy
else if ( m_Caster is PlayerMobile && ((PlayerMobile) m_Caster).Peaced )
{
m_Caster.SendLocalizedMessage( 1072060 ); // You cannot cast a spell while calmed.
}
#endregion
else if ( m_Caster.Spell != null && m_Caster.Spell.IsCasting )
{
m_Caster.SendLocalizedMessage( 502642 ); // You are already casting a spell.
}
else if ( BlockedByHorrificBeast && TransformationSpellHelper.UnderTransformation( m_Caster, typeof( HorrificBeastSpell ) ) || ( BlockedByAnimalForm && AnimalForm.UnderTransformation( m_Caster ) ))
{
m_Caster.SendLocalizedMessage( 1061091 ); // You cannot cast that spell in this form.
}
else if ( !(m_Scroll is BaseWand) && (m_Caster.Paralyzed || m_Caster.Frozen) )
{
m_Caster.SendLocalizedMessage( 502643 ); // You can not cast a spell while frozen.
}
else if ( CheckNextSpellTime && DateTime.Now < m_Caster.NextSpellTime )
{
m_Caster.SendLocalizedMessage( 502644 ); // You have not yet recovered from casting a spell.
}
else if ( m_Caster.Mana >= ScaleMana( GetMana() ) )
{
if ( m_Caster.Spell == null && m_Caster.CheckSpellCast( this ) && CheckCast() && m_Caster.Region.OnBeginSpellCast( m_Caster, this ) )
{
m_State = SpellState.Casting;
m_Caster.Spell = this;
if ( RevealOnCast )
m_Caster.RevealingAction();
SayMantra();
TimeSpan castDelay = this.GetCastDelay();
if ( ShowHandMovement && m_Caster.Body.IsHuman )
{
int count = (int)Math.Ceiling( castDelay.TotalSeconds / AnimateDelay.TotalSeconds );
if ( count != 0 )
{
m_AnimTimer = new AnimTimer( this, count );
m_AnimTimer.Start();
}
if ( m_Info.LeftHandEffect > 0 )
Caster.FixedParticles( 0, 10, 5, m_Info.LeftHandEffect, EffectLayer.LeftHand );
if ( m_Info.RightHandEffect > 0 )
Caster.FixedParticles( 0, 10, 5, m_Info.RightHandEffect, EffectLayer.RightHand );
}
if ( ClearHandsOnCast )
m_Caster.ClearHands();
m_CastTimer = new CastTimer( this, castDelay );
m_CastTimer.Start();
OnBeginCast();
return true;
}
else
{
return false;
}
}
else
{
m_Caster.LocalOverheadMessage( MessageType.Regular, 0x22, 502625 ); // Insufficient mana
}
return false;
}
示例6: SphereCast
public bool SphereCast(Mobile from, object obj)
{
m_StartCastTime = DateTime.Now;
if (m_PlayerCaster.Paralyzed && !m_PlayerCaster.HasFreeHand())
{
m_Caster.SendAsciiMessage(33, "You must have your hands free to cast while paralyzed!");
return false;
}
if (IsCastPossible())
{
m_SphereSpellTarget = obj;
if (m_Caster.CheckSpellCast(this) && CheckCast() && m_Caster.Region.OnBeginSpellCast(m_Caster, this))
{
if (m_Caster is PlayerMobile && ClearHandsOnCast) //Mobiles don't need to disarm
m_Caster.ClearHands();
m_State = SpellState.Casting;
m_Caster.Spell = this;
m_PlayerCaster.WeaponTimerCheck();
m_PlayerCaster.BandageCheck();
m_PlayerCaster.AbortCurrentPlayerAction();
//Maka
if (RevealOnCast && !m_PlayerCaster.HiddenWithSpell)
m_Caster.RevealingAction();
SayMantra();
var castDelay = GetCastDelay();
var count = (int)Math.Ceiling(castDelay.TotalSeconds / AnimateDelay.TotalSeconds);
if (count != 0)
{
m_AnimTimer = new AnimTimer(this, 1);
m_AnimTimer.Start();
}
if (m_Info.LeftHandEffect > 0)
Caster.FixedParticles(0, 10, 5, m_Info.LeftHandEffect, EffectLayer.LeftHand);
if (m_Info.RightHandEffect > 0)
Caster.FixedParticles(0, 10, 5, m_Info.RightHandEffect, EffectLayer.RightHand);
if (Core.ML)
WeaponAbility.ClearCurrentAbility(m_Caster);
m_CastTimer = new CastTimer(this, castDelay);
m_CastTimer.Start();
OnBeginCast();
return true;
}
return false;
}
return false;
}
示例7: FinishSequence
public virtual void FinishSequence()
{
m_State = SpellState.None;
if (Caster != null)
{
if (Caster is PlayerMobile)
{
if (!((PlayerMobile) Caster).HiddenWithSpell) //Taran: Don't reveal when hidden with spell or pot
Caster.RevealingAction();
}
else
Caster.RevealingAction();
}
if (m_Caster.Spell == this)
m_Caster.Spell = null;
}
示例8: Disturb
public void Disturb(DisturbType type, bool firstCircle, bool resistable)
{
if (!CheckDisturb(type, firstCircle, resistable))
{
return;
}
if (m_State == SpellState.Casting)
{
if (!firstCircle && !Core.AOS && this is MagerySpell && ((MagerySpell)this).Circle == SpellCircle.First)
{
return;
}
m_State = SpellState.None;
m_Caster.Spell = null;
OnDisturb(type, true);
if (m_CastTimer != null)
{
m_CastTimer.Stop();
}
if (m_AnimTimer != null)
{
m_AnimTimer.Stop();
}
if (Core.AOS && m_Caster.Player && type == DisturbType.Hurt)
{
DoHurtFizzle();
}
m_Caster.NextSpellTime = Core.TickCount + (int)GetDisturbRecovery().TotalMilliseconds;
}
else if (m_State == SpellState.Sequencing)
{
if (!firstCircle && !Core.AOS && this is MagerySpell && ((MagerySpell)this).Circle == SpellCircle.First)
{
return;
}
m_State = SpellState.None;
m_Caster.Spell = null;
OnDisturb(type, false);
Target.Cancel(m_Caster);
if (Core.AOS && m_Caster.Player && type == DisturbType.Hurt)
{
DoHurtFizzle();
}
}
}
示例9: Extract
private static object Extract(SpellState state)
{
if (state == null) return null;
return new
{
stateType = state.m_StateType.ToString(),
name = state.name,
tag = state.tag,
};
}
示例10: cast
/**
* Called when the character casts the spell
*/
public virtual bool cast(float x, float y, Unit u = null, int futureProjNetId = 0, int spellNetId = 0)
{
this.x = x;
this.y = y;
this.target = u;
this.futureProjNetId = futureProjNetId;
this.spellNetId = spellNetId;
if (castTime > 0 && flags != (int)SpellFlag.SPELL_FLAG_InstantCast)
{
owner.setPosition(owner.getX(), owner.getY());//stop moving serverside too. TODO: check for each spell if they stop movement or not
state = SpellState.STATE_CASTING;
currentCastTime = castTime;
}
else
{
finishCasting();
}
return true;
}
示例11: Cast
public bool Cast()
{
if ( Core.AOS && m_Caster.Spell is Spell && ((Spell)m_Caster.Spell).State == SpellState.Sequencing )
((Spell)m_Caster.Spell).Disturb( DisturbType.NewCast );
if ( !m_Caster.CheckAlive() )
{
return false;
}
else if ( m_Caster.Spell != null && m_Caster.Spell.IsCasting )
{
m_Caster.SendLocalizedMessage( 502642 ); // You are already casting a spell.
}
else if ( BlockedByHorrificBeast && TransformationSpell.UnderTransformation( m_Caster, typeof( HorrificBeastSpell ) ) )
{
m_Caster.SendLocalizedMessage( 1061091 ); // You cannot cast that spell in this form.
}
else if ( !(m_Scroll is BaseWand) && (m_Caster.Paralyzed || m_Caster.Frozen) )
{
m_Caster.SendLocalizedMessage( 502643 ); // You can not cast a spell while frozen.
}
else if ( !(m_Scroll is BaseWand) && DateTime.Now < m_Caster.NextSpellTime )
{
m_Caster.SendLocalizedMessage( 502642 ); // You must wait for that spell to have an effect.
}
//ADDED FOR STAFF ENDLESS MANA
else if (m_Caster.Mana >= ScaleMana(GetMana()) || m_Caster.AccessLevel > AccessLevel.Player)
{
if ( m_Caster.Spell == null && m_Caster.CheckSpellCast( this ) && CheckCast() && m_Caster.Region.OnBeginSpellCast( m_Caster, this ) )
{
m_State = SpellState.Casting;
m_Caster.Spell = this;
if ( RevealOnCast )
m_Caster.RevealingAction();
SayMantra();
TimeSpan castDelay = this.GetCastDelay();
if ( m_Caster.Body.IsHuman )
{
int count = (int)Math.Ceiling( castDelay.TotalSeconds / AnimateDelay.TotalSeconds );
if ( count != 0 )
{
m_AnimTimer = new AnimTimer( this, count );
m_AnimTimer.Start();
}
if ( m_Info.LeftHandEffect > 0 )
Caster.FixedParticles( 0, 10, 5, m_Info.LeftHandEffect, EffectLayer.LeftHand );
if ( m_Info.RightHandEffect > 0 )
Caster.FixedParticles( 0, 10, 5, m_Info.RightHandEffect, EffectLayer.RightHand );
}
if ( ClearHandsOnCast )
m_Caster.ClearHands();
m_CastTimer = new CastTimer( this, castDelay );
m_CastTimer.Start();
m_CastStartTime = DateTime.Now;
OnBeginCast();
return true;
}
else
{
return false;
}
}
else
{
m_Caster.LocalOverheadMessage( MessageType.Regular, 0x22, 502625 ); // Insufficient mana
}
return false;
}
示例12: Disturb
public void Disturb( DisturbType type, bool firstCircle, bool resistable )
{
if ( !CheckDisturb( type, firstCircle, resistable ) )
return;
if ( m_State == SpellState.Casting )
{
if ( !firstCircle && Circle == SpellCircle.First && !Core.AOS )
return;
m_State = SpellState.None;
//m_Caster.NextSpellTime = DateTime.Now + TimeSpan.FromSeconds(0.20 + (0.20 * (int)Circle) );
try
{
TimeSpan NextSpellDelay = TimeSpan.FromSeconds((0.90 + (0.41 * (int)Circle)) * (1 - CastDelayFinishFactor));
m_Caster.NextSpellTime = DateTime.Now + NextSpellDelay;
}
catch(Exception e)
{
//In case of an exception use old calculation.
m_Caster.NextSpellTime = DateTime.Now + TimeSpan.FromSeconds(0.20 + (0.20 * (int)Circle) );
//and log...
GeneralLogging.WriteLine("CrashDebug", "Exception:\n{0}\n{1}\nCastDelayFinishFactor: {2}\nCircle: {3}", e.Message, e.StackTrace, CastDelayFinishFactor, (int)Circle);
}
//m_Caster.SendMessage("Debug: Disturb, FinishFactor: {0}, NextSpellTime: {1}", CastDelayFinishFactor, NextSpellDelay);
m_Caster.Spell = null;
OnDisturb( type, true );
if ( m_CastTimer != null )
m_CastTimer.Stop();
if ( m_AnimTimer != null )
m_AnimTimer.Stop();
if ( Core.AOS && m_Caster.Player && type == DisturbType.Hurt )
DoHurtFizzle();
}
else if ( m_State == SpellState.Sequencing )
{
if ( !firstCircle && Circle == SpellCircle.First && !Core.AOS )
return;
m_State = SpellState.None;
m_Caster.Spell = null;
OnDisturb( type, false );
Targeting.Target.Cancel( m_Caster );
if ( Core.AOS && m_Caster.Player && type == DisturbType.Hurt )
DoHurtFizzle();
}
}
示例13: Cast
public bool Cast()
{
m_StartCastTime = DateTime.Now;
if ( m_Caster.Spell is Spell && ( (Spell) m_Caster.Spell ).State == SpellState.Sequencing )
( (Spell) m_Caster.Spell ).Disturb( DisturbType.NewCast );
if ( !m_Caster.CheckAlive() )
{
return false;
}
else if ( m_Caster.Spell != null && m_Caster.Spell.IsCasting )
{
m_Caster.SendLocalizedMessage( 502642 ); // You are already casting a spell.
}
else if ( BlockedByHorrificBeast && TransformationSpell.UnderTransformation( m_Caster, typeof( HorrificBeastSpell ) ) )
{
m_Caster.SendLocalizedMessage( 1061091 ); // You cannot cast that spell in this form.
}
else if ( BlockedByAnimalForm && AnimalForm.UnderTransformation( m_Caster ) )
{
m_Caster.SendLocalizedMessage( 1061091 ); // You cannot cast that spell in this form.
}
else if ( !( m_Scroll is BaseWand ) && ( m_Caster.Paralyzed || m_Caster.Frozen ) )
{
m_Caster.SendLocalizedMessage( 502643 ); // You can not cast a spell while frozen.
}
else if ( CheckNextSpellTime && DateTime.Now < m_Caster.NextSpellTime )
{
m_Caster.SendLocalizedMessage( 502644 ); // You have not yet recovered from casting a spell.
}
else if ( BaseBardCreature.IsCalmed( m_Caster ) )
{
m_Caster.SendLocalizedMessage( 1072060 ); // You cannot cast a spell while calmed.
}
else if ( m_Caster.Mana >= ScaleMana( GetMana() ) )
{
if ( m_Caster.Spell == null && m_Caster.CheckSpellCast( this ) && CheckCast() && m_Caster.Region.OnBeginSpellCast( m_Caster, this ) )
{
m_State = SpellState.Casting;
m_Caster.Spell = this;
if ( RevealOnCast )
m_Caster.RevealingAction();
SayMantra();
TimeSpan castDelay = this.GetCastDelay();
/*
* OSI cast delay is computed with a global timer based on ticks. There is
* one tick per 0.25 seconds, so every tick the timer computes all the
* spells ready to cast. This introduces a random additional delay of 0-0.25
* seconds due to fact that the first tick is always incomplete. We add this
* manually here to enhance the gameplay to get the real OSI feeling.
*/
castDelay += TimeSpan.FromSeconds( 0.25 * Utility.RandomDouble() );
if ( ShowHandMovement && m_Caster.Body.IsHuman && !( m_Scroll is SpellStone ) )
{
int count = (int) Math.Ceiling( castDelay.TotalSeconds / AnimateDelay.TotalSeconds );
if ( count != 0 )
{
m_AnimTimer = new AnimTimer( this, count );
m_AnimTimer.Start();
}
if ( m_Info.LeftHandEffect > 0 )
Caster.FixedParticles( 0, 10, 5, m_Info.LeftHandEffect, EffectLayer.LeftHand );
if ( m_Info.RightHandEffect > 0 )
Caster.FixedParticles( 0, 10, 5, m_Info.RightHandEffect, EffectLayer.RightHand );
}
if ( ClearHandsOnCast )
m_Caster.ClearHands();
m_CastTimer = new CastTimer( this, castDelay );
m_CastTimer.Start();
SpecialMove.ClearCurrentMove( m_Caster );
WeaponAbility.ClearCurrentAbility( m_Caster );
OnBeginCast();
return true;
}
else
{
return false;
}
}
else
{
m_Caster.LocalOverheadMessage( MessageType.Regular, 0x22, 502625 ); // Insufficient mana
}
return false;
}
示例14: CheckHSequence
public bool CheckHSequence( Mobile target )
{
try
{
RegionControl regstone = null;
CustomRegion reg = null;
if(target !=null)
reg = CustomRegion.FindDRDTRegion(target);
if(reg !=null )
regstone = reg.GetRegionControler();
//if your in a region area spells will fail if disallowed, prevents the run outside of area precast
//run back into region then release spell ability
if(m_Caster != null && target != null && m_Caster.Spell != null && m_Caster.Region != target.Region && regstone != null && (regstone.IsRestrictedSpell( m_Caster.Spell, m_Caster ) || regstone.IsMagicIsolated) && m_Caster.AccessLevel == AccessLevel.Player && ((m_Caster is BaseCreature && !regstone.RestrictCreatureMagic) || m_Caster is PlayerMobile))
{
m_State = SpellState.None;
if ( m_Caster.Spell == this )
m_Caster.Spell = null;
Targeting.Target.Cancel( m_Caster );
m_Caster.SendMessage( "You cannot cast your spell into that area." );
return false;
}
}
catch(NullReferenceException e)
{
LogHelper.LogException(e);
Console.WriteLine("{0} Caught exception.", e);
}
catch(Exception ex)
{
LogHelper.LogException(ex);
}
if ( !target.Alive )
{
m_Caster.SendLocalizedMessage( 501857 ); // This spell won't work on that!
return false;
}
else if ( Caster.CanBeHarmful( target ) && CheckSequence() )
{
Caster.DoHarmful( target );
return true;
}
else
{
return false;
}
}
示例15: CheckSequence
public virtual bool CheckSequence()
{
try
{
RegionControl regstone = null;
CustomRegion reg = null;
if(m_Caster !=null)
reg = CustomRegion.FindDRDTRegion(m_Caster);
if(reg !=null )
regstone = reg.GetRegionControler();
//if your in a region area spells will fail if disallowed, prevents the run outside of area precast
//run back into region then release spell ability
if(m_Caster != null && m_Caster.Spell != null && regstone != null && regstone.IsRestrictedSpell( m_Caster.Spell , m_Caster) && m_Caster.AccessLevel == AccessLevel.Player && ((m_Caster is BaseCreature && !regstone.RestrictCreatureMagic) || m_Caster is PlayerMobile))
{
m_State = SpellState.None;
if ( m_Caster.Spell == this )
m_Caster.Spell = null;
Targeting.Target.Cancel( m_Caster );
if(regstone.MagicMsgFailure == null)
m_Caster.SendMessage( "You cannot cast that spell here." );
else
m_Caster.SendMessage(regstone.MagicMsgFailure);
}
}
catch(NullReferenceException e)
{
LogHelper.LogException(e);
Console.WriteLine("{0} Caught exception.", e);
}
catch(Exception ex)
{
LogHelper.LogException(ex);
}
int mana = ScaleMana( GetMana() );
if ( m_Caster.Deleted || !m_Caster.Alive || m_Caster.Spell != this || m_State != SpellState.Sequencing )
{
DoFizzle();
}
else if ( m_Scroll != null && !(m_Scroll is Runebook) && (m_Scroll.Amount <= 0 || m_Scroll.Deleted || m_Scroll.RootParent != m_Caster || (m_Scroll is BaseWand && (((BaseWand)m_Scroll).Charges <= 0 || m_Scroll.Parent != m_Caster))) )
{
DoFizzle();
}
else if ( !ConsumeReagents() )
{
m_Caster.LocalOverheadMessage( MessageType.Regular, 0x22, 502630 ); // More reagents are needed for this spell.
}
else if ( m_Caster.Mana < mana )
{
m_Caster.LocalOverheadMessage( MessageType.Regular, 0x22, 502625 ); // Insufficient mana for this spell.
}
else if ( Core.AOS && (m_Caster.Frozen || m_Caster.Paralyzed) )
{
m_Caster.SendLocalizedMessage( 502646 ); // You cannot cast a spell while frozen.
DoFizzle();
}
else if ( CheckFizzle() )
{
m_Caster.Mana -= mana;
if ( m_Scroll is SpellScroll )
m_Scroll.Consume();
else if ( m_Scroll is BaseWand )
((BaseWand)m_Scroll).ConsumeCharge( m_Caster );
if ( m_Scroll is BaseWand )
{
bool m = m_Scroll.Movable;
m_Scroll.Movable = false;
if ( ClearHandsOnCast )
m_Caster.ClearHands();
m_Scroll.Movable = m;
}
else
{
if ( ClearHandsOnCast )
m_Caster.ClearHands();
}
int karma = ComputeKarmaAward();
if ( karma != 0 )
Misc.Titles.AwardKarma( Caster, karma, true );
/*
if ( TransformationSpell.UnderTransformation( m_Caster, typeof( VampiricEmbraceSpell ) ) )
{
bool garlic = false;
for ( int i = 0; !garlic && i < m_Info.Reagents.Length; ++i )
garlic = ( m_Info.Reagents[i] == Reagent.Garlic );
//.........这里部分代码省略.........