本文整理匯總了C#中Server.Mobile.Damage方法的典型用法代碼示例。如果您正苦於以下問題:C# Mobile.Damage方法的具體用法?C# Mobile.Damage怎麽用?C# Mobile.Damage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Server.Mobile
的用法示例。
在下文中一共展示了Mobile.Damage方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AbsorbDamage
public override int AbsorbDamage( Mobile attacker, Mobile defender, int damage )
{
damage = base.AbsorbDamage( attacker, defender, damage );
int absorb = defender.MeleeDamageAbsorb;
if ( absorb > 0 )
{
if ( absorb > damage )
{
int react = damage / 5;
if ( react <= 0 )
react = 1;
defender.MeleeDamageAbsorb -= damage;
damage = 0;
attacker.Damage( react, defender );
attacker.PlaySound( 0x1F1 );
attacker.FixedEffect( 0x374A, 10, 16 );
}
else
{
defender.MeleeDamageAbsorb = 0;
defender.SendLocalizedMessage( 1005556 ); // Your reactive armor spell has been nullified.
DefensiveSpell.Nullify( defender );
}
}
return damage;
}
示例2: OnDamage
public override void OnDamage( int amount, Mobile from, bool willKill )
{
base.OnDamage( amount, from, willKill );
if ( kReflectDamagePercent > 0 && null != from && !(from.Deleted))
from.Damage( (int)(Math.Round( amount / kReflectDamagePercent )), this );
}
示例3: DoAttackEffect
public override void DoAttackEffect( Mobile m )
{
//m.Damage( Utility.Dice( 6, 10, 40 ), m );
//Damage reduced by Blady.
int dmg = Utility.Dice( 10, 6, 20 );
m.Damage( dmg * (100 - m.FireResistance / 2) / 100, m);
}
示例4: ApplyPoison
public override void ApplyPoison( Mobile to, Mobile source, int intensity )
{
int amount = (int)( intensity * Divisor );
if ( amount == 0 )
amount = 1;
switch ( (int)Stat )
{
case (int)Stat.Health:
{
to.Damage( amount, source );
break;
}
case (int)Stat.Stamina:
{
to.Stam-=amount;
break;
}
case (int)Stat.Mana:
{
to.Mana-=amount;
break;
}
}
}
示例5: OnDoubleClick
public override void OnDoubleClick( Mobile from )
{
if( !IsChildOf( from.Backpack ) )
{
from.SendLocalizedMessage( 1042001 ); //That must be in your pack to use it.
}
else
{
if( from.Skills.Magery.Base < 85 )
{
from.SendMessage( "The scroll bursts into flame in your hands!" );
from.FixedParticles( 0x36BD, 20, 10, 5044, EffectLayer.Waist );
from.Damage( Utility.RandomMinMax( 40, 55 ) );
this.Delete();
}
else
{
from.Frozen = true;
from.PublicOverheadMessage( MessageType.Spell, from.SpeechHue, true, "In Kal Quas", false );
if( !from.Mounted && from.Body.IsHuman )
from.Animate( 206, 7, 1, true, false, 0 );
from.BeginTarget( 10, false, TargetFlags.None, new TargetCallback( BlessingOfKhopesh_OnTarget ) );
}
}
}
示例6: OnBeforeDamage
public override bool OnBeforeDamage( Mobile attacker, Mobile defender )
{
if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
return false;
ClearCurrentAbility( attacker );
attacker.SendMessage( "You become one with you weapon, allowing it to guide you hand. The effects of this attack are unpredictable, but effective." );
defender.SendMessage( "You enemie become one with their weapon and the effects of his attack are unpredictable" );
attacker.PlaySound( 0x20C );
attacker.PlaySound( 0x56 );
attacker.FixedParticles( 0x3779, 1, 30, 9964, 3, 3, EffectLayer.Waist );
IEntity from = new Entity( Serial.Zero, new Point3D( attacker.X, attacker.Y, attacker.Z ), attacker.Map );
IEntity to = new Entity( Serial.Zero, new Point3D( attacker.X, attacker.Y, attacker.Z + 50 ), attacker.Map );
Effects.SendMovingParticles( from, to, 0xF5F, 1, 0, false, false, 33, 3, 9501, 1, 0, EffectLayer.Head, 0x100 );
int damage = 10;
damage += Math.Min( 5, (int)(Math.Abs( attacker.Skills[SkillName.Anatomy].Value + attacker.Skills[SkillName.ArmsLore].Value ) / 8));
defender.Damage( damage, attacker );
return true;
}
示例7: OnGotMeleeAttack
public override void OnGotMeleeAttack( Mobile attacker )
{
base.OnGotMeleeAttack( attacker );
attacker.Damage( Utility.Random( 10, 10 ), this );
attacker.Stam -= Utility.Random( 10, 10 );
attacker.Mana -= Utility.Random( 10, 10 );
}
示例8: OnGaveMeleeAttack
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
defender.Damage( Utility.Random( 10, 10 ), this );
defender.Stam -= Utility.Random( 10, 10 );
defender.Mana -= Utility.Random( 10, 10 );
}
示例9: Damage
public void Damage( Mobile m )
{
int damage = Utility.RandomMinMax( m_MinDamage, m_MaxDamage );
if ( Core.AOS )
AOS.Damage( m, damage, 0, 0, 0, 100, 0 );
else
m.Damage( damage );
}
示例10: ExecuteTrap
public override void ExecuteTrap( Mobile from )
{
base.ExecuteTrap( from );
from.Damage( Utility.RandomMinMax( 45, 60 ), this.Owner );
Effects.PlaySound( from.Location, from.Map, 0x207 );
Effects.SendLocationEffect( this.Door.Location, this.Door.Map, Utility.RandomList( 0x36B0, 0x36BD, 0x36CA ), 20 );
}
示例11: OnMoveOver
public override bool OnMoveOver( Mobile m )
{
if( m.Alive && !(IsDeadPet(m)) && !(IsAnt(m)) )
{
m.Damage( Utility.Random( 10, 15 ) );
m.PlaySound(0x1dE);
BurnTimer = new m_Timer( m );
BurnTimer.Start();
}
return true;
}
示例12: OnGaveMeleeAttack
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
{
DoHarmful( defender );
Effects.SendMovingEffect( this, defender, 0x36E4, 7, 0, false, true, 0x480, 0 );
defender.SendMessage( "You are hurt by the coldness of the attack!" );
int toDrain = Utility.RandomMinMax( 20, 25 );
defender.Damage( toDrain );
}
}
示例13: OnDamage
protected void OnDamage( Mobile m, int amount )
{
if ( !m_Damaging && m_DamageChance > Utility.Random( 100 ) )
{
m_Damaging = true;
amount = (int) ( amount * m_DamageFactor / 100 );
m.Damage( amount, Caster );
m_Damaging = false;
}
}
示例14: SurpriseAttack
public void SurpriseAttack(Mobile defender, int damage)
{
if (Level >= PerkLevel.Fifth)
{
if (Player.Hidden)
{
Player.SendMessage("You catch your opponent off-guard!");
defender.SendMessage("Your opponent catches you off-guard!");
defender.Damage(damage, Player);
}
}
}
示例15: Damage
public override void Damage(int amount, Mobile from)
{
MobileObject mo = Support.GetMobileObject(from);
if (mo != null && !mo.CanBeAttackedByEvilSpirit) // If can't be attacked, dish damage back to attacker.
{
from.Damage(amount);
amount = 0;
}
base.Damage(amount, from);
}