本文整理汇总了C#中Server.Poison类的典型用法代码示例。如果您正苦于以下问题:C# Poison类的具体用法?C# Poison怎么用?C# Poison使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Poison类属于Server命名空间,在下文中一共展示了Poison类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTemporaryResistChance
public static double GetTemporaryResistChance( Mobile m, Poison poison )
{
if ( !m_Table.ContainsKey( m ) )
return 0.0;
int resistLevel = GetTemporaryResistLevel( m );
double factor = 15.0 / ( poison.Level + 1 );
double chance = factor * resistLevel / 100.0;
return chance / 100.0;
}
示例2: Register
public static void Register( Poison reg )
{
string regName = reg.Name.ToLower();
for ( int i = 0; i < m_Poisons.Count; i++ )
{
if ( reg.Level == m_Poisons[i].Level )
throw new Exception( "A poison with that level already exists." );
else if ( regName == m_Poisons[i].Name.ToLower() )
throw new Exception( "A poison with that name already exists." );
}
m_Poisons.Add( reg );
}
示例3: GetNaturalResistChance
public static double GetNaturalResistChance( Mobile m, Poison poison )
{
double poisoning = m.Skills.Poisoning.Value;
Resilience song = Spellsong.GetEffectSpellsong<Resilience>( m );
if ( song != null )
poisoning += song.CurseReduction; // Guessing here.
double factor = 80.0 / ( poison.Level + 1 );
double chance = factor * poisoning / 100.0;
return chance / 100.0;
}
示例4: ConsumeUse
public void ConsumeUse()
{
if ( m_UsesRemaining < 1 )
return;
--m_UsesRemaining;
if ( m_PoisonCharges > 0 )
{
--m_PoisonCharges;
if ( m_PoisonCharges == 0 )
m_Poison = null;
}
InvalidateProperties();
}
示例5: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
m_UsesRemaining = reader.ReadInt();
m_Poison = Poison.Deserialize( reader );
m_PoisonCharges = reader.ReadInt();
break;
}
}
}
示例6: Aura
// No Effects
public static void Aura(Point3D location, Map map, Mobile from, int min, int max, ResistanceType type, int range,
Poison poison, string text, bool scales, bool allownull)
{
Aura(location, map, from, min, max, type, range, poison, text, scales, allownull, false, 0, 0);
}
示例7: OnCured
/// <summary>
/// Overridable. Virtual event invoked when a call to <see cref="CurePoison" /> succeeded.
/// <seealso cref="CurePoison" />
/// <seealso cref="CheckCure" />
/// <seealso cref="Poison" />
/// </summary>
public virtual void OnCured( Mobile from, Poison oldPoison )
{
}
示例8: Serialize
public static void Serialize( Poison p, GenericWriter writer )
{
if ( p == null )
writer.Write( (byte)0 );
else
{
writer.Write( (byte)1 );
writer.Write( (byte)p.Level );
}
}
示例9: Reload
public void Reload( Mobile from, Shuriken shuriken )
{
int need = ( MaxUses - m_UsesRemaining );
if ( need <= 0 )
{
// You cannot add any more shuriken.
from.SendLocalizedMessage( 1063302 );
}
else if ( shuriken.UsesRemaining > 0 )
{
if ( need > shuriken.UsesRemaining )
need = shuriken.UsesRemaining;
if ( shuriken.Poison != null && shuriken.PoisonCharges > 0 )
{
if ( m_PoisonCharges <= 0 || m_Poison == shuriken.Poison )
{
if ( m_Poison != null && m_Poison.Level < shuriken.Poison.Level )
Unload( from );
if ( need > shuriken.PoisonCharges )
need = shuriken.PoisonCharges;
if ( m_Poison == null || m_PoisonCharges <= 0 )
m_PoisonCharges = need;
else
m_PoisonCharges += need;
m_Poison = shuriken.Poison;
shuriken.PoisonCharges -= need;
if ( shuriken.PoisonCharges <= 0 )
shuriken.Poison = null;
m_UsesRemaining += need;
shuriken.UsesRemaining -= need;
}
else
{
from.SendLocalizedMessage( 1070767 ); // Loaded projectile is stronger, unload it first
}
}
else
{
m_UsesRemaining += need;
shuriken.UsesRemaining -= need;
}
if ( shuriken.UsesRemaining <= 0 )
shuriken.Delete();
InvalidateProperties();
}
}
示例10: CheckPoisonImmunity
public override bool CheckPoisonImmunity( Mobile from, Poison poison )
{
if ( base.CheckPoisonImmunity( from, poison ) )
return true;
Poison p = this.PoisonImmune;
return ( p != null && p.Level >= poison.Level );
}
示例11: IncreaseLevel
public static Poison IncreaseLevel(Poison oldPoison)
{
Poison newPoison = oldPoison == null ? null : GetPoison(oldPoison.Level + 1);
return newPoison ?? oldPoison;
}
示例12: PoisonPlayers
public virtual void PoisonPlayers( Poison poison )
{
List<Mobile> list = GetPoisonableMobiles( null );
foreach ( Mobile m in list )
{
if ( ( m.Poison == null || m.Poison.Level < poison.Level ) )
m.ApplyPoison( null, poison );
}
}
示例13: OnPoison
public virtual void OnPoison( Poison poison, int tick )
{
}
示例14: OnPoisonImmunity
/// <summary>
/// Overridable. Event invoked when a call to <see cref="ApplyPoison" /> failed because <see cref="CheckPoisonImmunity" /> returned false: the Mobile was resistant to the poison. By default, this broadcasts an overhead message: * The poison seems to have no effect. *
/// <seealso cref="CheckPoisonImmunity" />
/// <seealso cref="ApplyPoison" />
/// <seealso cref="Poison" />
/// </summary>
public virtual void OnPoisonImmunity( Mobile from, Poison poison )
{
this.PublicOverheadMessage( MessageType.Emote, 0x3B2, 1005534 ); // * The poison seems to have no effect. *
}
示例15: OnPoisoned
/// <summary>
/// Overridable. Event invoked when a call to <see cref="ApplyPoison" /> succeeded. By default, this broadcasts an overhead message varying by the level of the poison. Example: * Zippy begins to spasm uncontrollably. *
/// <seealso cref="ApplyPoison" />
/// <seealso cref="Poison" />
/// </summary>
public virtual void OnPoisoned( Mobile from, Poison poison, Poison oldPoison )
{
if (poison != null && poison.Level >= 0 && poison.Level <= 4)
{
this.LocalOverheadMessage( MessageType.Regular, 0x22, 1042857 + (poison.Level * 2) );
this.NonlocalOverheadMessage( MessageType.Regular, 0x22, 1042858 + (poison.Level * 2), Name );
}
}