本文整理汇总了C#中Mobile.Damage方法的典型用法代码示例。如果您正苦于以下问题:C# Mobile.Damage方法的具体用法?C# Mobile.Damage怎么用?C# Mobile.Damage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mobile
的用法示例。
在下文中一共展示了Mobile.Damage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnBeforeDamage
public override bool OnBeforeDamage( Mobile attacker, Mobile defender )
{
if ( !Validate( attacker ) || !CheckMana( attacker, true ) )
return false;
ClearCurrentAbility( attacker );
attacker.SendLocalizedMessage( 1060165 ); // You have delivered a concussion!
defender.SendLocalizedMessage( 1060166 ); // You feel disoriented!
defender.PlaySound( 0x213 );
defender.FixedParticles( 0x377A, 1, 32, 9949, 1153, 0, EffectLayer.Head );
Effects.SendMovingParticles( new Entity( Serial.Zero, new Point3D( defender.X, defender.Y, defender.Z + 10 ), defender.Map ), new Entity( Serial.Zero, new Point3D( defender.X, defender.Y, defender.Z + 20 ), defender.Map ), 0x36FE, 1, 0, false, false, 1133, 3, 9501, 1, 0, EffectLayer.Waist, 0x100 );
int damage = 10; // Base damage is 10.
if ( defender.HitsMax > 0 )
{
double hitsPercent = ( (double)defender.Hits / (double)defender.HitsMax ) * 100.0;
double manaPercent = 0;
if ( defender.ManaMax > 0 )
manaPercent = ( (double)defender.Mana / (double)defender.ManaMax ) * 100.0;
damage += Math.Min( (int)(Math.Abs( hitsPercent - manaPercent ) / 4), 20 );
}
// Total damage is 10 + (0~20) = 10~30, physical, non-resistable.
defender.Damage( damage, attacker );
return true;
}
示例2: DoBleed
public static void DoBleed( Mobile m, Mobile from, int level )
{
if ( m.Alive )
{
int damage = Utility.RandomMinMax( level, level * 2 );
if ( !m.IsPlayer )
damage *= 2;
m.PlaySound( 0x133 );
m.Damage( damage, from );
Blood blood = new Blood();
blood.ItemID = Utility.Random( 0x122A, 5 );
blood.MoveToWorld( m.Location, m.Map );
BaseWeapon weapon = from.Weapon as BaseWeapon;
if ( weapon != null && weapon.WeaponAttributes[WeaponAttribute.BloodDrinker] != 0 && from.Hits < from.HitsMax )
{
from.FixedParticles( 0x375A, 1, 10, 0x1AE9, 0x21, 0x2, EffectLayer.Head );
from.SendLocalizedMessage( 1113606 ); // The blood drinker effect heals you.
from.Hits += damage;
}
}
else
{
EndBleed( m, false );
}
}
示例3: DoBleed
public static void DoBleed( Mobile m, Mobile from, int level )
{
if ( m.Alive )
{
int damage = Utility.RandomMinMax( level, level * 2 );
if ( !m.Player )
damage *= 2;
m.PlaySound( 0x133 );
m.Damage( damage, from );
//Blood blood = new Blood();
//blood.ItemID = Utility.Random( 0x122A, 5 );
BaseWeapon.CreateBlood( m.Location, m.Map, m.BloodHue, true );
//blood.MoveToWorld( m.Location, m.Map );
}
else
{
EndBleed( m, false );
}
}
示例4: OnBeforeDamage
public override bool OnBeforeDamage(Mobile attacker, Mobile defender)
{
if (!this.Validate(attacker) || !this.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("Your enemy becomes 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;
}
示例5: 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;
defender.Damage( react, attacker );
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;
}
示例6: Damage
public void Damage(Mobile m)
{
int damage = Utility.RandomMinMax(this.m_MinDamage, this.m_MaxDamage);
if (Core.AOS)
AOS.Damage(m, damage, 0, 0, 0, 100, 0);
else
m.Damage(damage);
}
示例7: Target
public void Target( Mobile m )
{
if ( CheckHSequence( m ) )
{
SpellHelper.Turn( Caster, m );
//SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m ); //Irrelevent asfter AoS
/* Temporarily causes intense physical pain to the target, dealing direct damage.
* After 10 seconds the spell wears off, and if the target is still alive,
* some of the Hit Points lost through Pain Spike are restored.
*/
m.FixedParticles( 0x37C4, 1, 8, 9916, 39, 3, EffectLayer.Head );
m.FixedParticles( 0x37C4, 1, 8, 9502, 39, 4, EffectLayer.Head );
m.PlaySound( 0x210 );
double damage = ((GetDamageSkill( Caster ) - GetResistSkill( m )) / 10) + (m.Player ? 18 : 30);
m.CheckSkill( SkillName.MagicResist, 0.0, 120.0 ); //Skill check for gain
if ( damage < 1 )
damage = 1;
TimeSpan buffTime = TimeSpan.FromSeconds( 10.0 );
if( m_Table.Contains( m ) )
{
damage = Utility.RandomMinMax( 3, 7 );
Timer t = m_Table[m] as Timer;
if( t != null )
{
t.Delay += TimeSpan.FromSeconds( 2.0 );
buffTime = t.Next - DateTime.UtcNow;
}
}
else
{
new InternalTimer( m, damage ).Start();
}
BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.PainSpike, 1075667, buffTime, m, Convert.ToString( (int)damage ) ) );
Misc.WeightOverloading.DFA = Misc.DFAlgorithm.PainSpike;
m.Damage( (int) damage, Caster );
SpellHelper.DoLeech( (int)damage, Caster, m );
Misc.WeightOverloading.DFA = Misc.DFAlgorithm.Standard;
//SpellHelper.Damage( this, m, damage, 100, 0, 0, 0, 0, Misc.DFAlgorithm.PainSpike );
HarmfulSpell( m );
}
FinishSequence();
}
示例8: OnGaveMeleeAttack
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
{
DoHarmful( defender );
defender.SendMessage( "Some of your life force has been stolen!" );
int toDrain = Utility.RandomMinMax( 20, 25 );
Hits += toDrain;
defender.Damage( toDrain, this );
}
}
示例9: Attack
public override void Attack(Mobile m)
{
if (m is EnergyVortex)
{
m.Damage(50, this);
}
BeginFlee(TimeSpan.FromSeconds(30));
base.Attack(m);
}
示例10: OnMovement
public override void OnMovement(Mobile m, Point3D oldLocation)
{
base.OnMovement(m, oldLocation);
if (m == null || m.Deleted || m == Beetle || !m.Alive || !m.InRange3D(this, 1, -5, 5) ||
(Beetle != null && !Beetle.CanBeHarmful(m)))
{
return;
}
if (Beetle != null)
{
Beetle.DoHarmful(m, true);
}
if (m is BaseCreature && m.IsControlled())
{
m.Damage(25);
}
else if (m is PlayerMobile)
{
m.Damage(1);
}
if (m.Poisoned)
{
return;
}
if (m is PlayerMobile)
{
m.ApplyPoison(Beetle ?? m, Poison.Deadly);
}
else if (m is BaseCreature)
{
m.ApplyPoison(Beetle ?? m, Poison.Lethal);
}
}
示例11: AggressiveAction
public override void AggressiveAction( Mobile aggressor, bool criminal )
{
base.AggressiveAction( aggressor, criminal );
Item item = aggressor.FindItemOnLayer( Layer.Helm );
if ( item is OrcishKinMask )
{
aggressor.Damage( 50 );
item.Delete();
aggressor.FixedParticles( 0x36BD, 20, 10, 5044, EffectLayer.Head );
aggressor.PlaySound( 0x307 );
}
}
示例12: AggressiveAction
public override void AggressiveAction( Mobile aggressor, bool criminal )
{
base.AggressiveAction( aggressor, criminal );
if ( aggressor.BodyMod == 185 || aggressor.BodyMod == 186 )
{
aggressor.Damage(50);
aggressor.BodyMod = 0;
aggressor.HueMod = -1;
aggressor.FixedParticles( 0x36BD, 20, 10, 5044, EffectLayer.Head );
aggressor.PlaySound( 0x307 );
aggressor.SendMessage( "Your skin is scorched as the undead pirate marks burn away!" );
if ( aggressor is PlayerMobile )
((PlayerMobile)aggressor).SavagePaintExpiration = TimeSpan.Zero;
}
}
示例13: DetermineTarget
public void DetermineTarget(Mobile pm, Item target)
{
if (target is VileTentacles)
{
var tentacles = target as VileTentacles;
tentacles.ChoppedUp = true;
tentacles.Hue = 38;
tentacles.Name = "cut-up vile tentacles";
pm.SendMessage(61, "You chop up the vile tentacles into small pieces.");
}
else if (target is UndyingFlesh)
{
var flesh = target as UndyingFlesh;
flesh.ChoppedUp = true;
flesh.Hue = 38;
flesh.Name = "cut-up undying flesh";
pm.SendMessage(61, "You slice the undying flesh into small strips.");
}
else if (target is FeyWings)
{
var wings = target as FeyWings;
pm.SendMessage(61, "As you cut into the fey wings, they disintegrate in your hands and fall through your fingers onto the ground.");
wings.Consume();
}
else if (target is DaemonClaw)
{
var claw = target as DaemonClaw;
pm.SendMessage(61, "You hack away at the daemon claw with your knife but it doesn't seem to help. The daemon claw appears to be ruined now.");
claw.Consume();
}
else if (target is SpiderCarapace)
{
var spider = target as SpiderCarapace;
pm.Poison = Poison.Lethal;
pm.Damage(10);
pm.SendMessage(61, "You slice into the spider carapace and a bunch of small spiders scurry out of it and bite you.");
spider.Consume();
}
else if (target is SeedofRenewal)
{
var seed = target as SeedofRenewal;
pm.SendMessage(61, "As you slice into the spongy seed, a green wisp of smoke errupts from it. Whatever made this seed special is now gone.");
seed.Consume();
}
}
示例14: Target
public void Target( Mobile m )
{
if ( CheckHSequence( m ) )
{
SpellHelper.Turn( Caster, m );
SpellHelper.CheckReflect( (int)this.Circle, Caster, ref m );
/* Temporarily causes intense physical pain to the target, dealing direct damage.
* After 10 seconds the spell wears off, and if the target is still alive, some of the Hit Points lost through Pain Spike are restored.
* Damage done is ((Spirit Speak skill level - target's Resist Magic skill level) / 100) + 30.
*
* NOTE : Above algorithm must either be typo or using fixed point : really is / 10 :
*
* 100ss-0mr = 40
* 100ss-50mr = 35
* 100ss-75mr = 32
*
* NOTE : If target already has a pain spike in effect, damage dealt /= 10
*/
m.FixedParticles( 0x37C4, 1, 8, 9916, 39, 3, EffectLayer.Head );
m.FixedParticles( 0x37C4, 1, 8, 9502, 39, 4, EffectLayer.Head );
m.PlaySound( 0x210 );
double damage = ((GetDamageSkill( Caster ) - GetResistSkill( m )) / 10) + (m.Player ? 18 : 30);
if ( damage < 1 )
damage = 1;
if ( m_Table.Contains( m ) )
damage /= 10;
else
new InternalTimer( m, damage ).Start();
Misc.WeightOverloading.DFA = Misc.DFAlgorithm.PainSpike;
m.Damage( (int) damage, Caster );
Misc.WeightOverloading.DFA = Misc.DFAlgorithm.Standard;
//SpellHelper.Damage( this, m, damage, 100, 0, 0, 0, 0, Misc.DFAlgorithm.PainSpike );
}
FinishSequence();
}
示例15: DoMountAbility
public override bool DoMountAbility( int damage, Mobile attacker )
{
if( Rider == null || attacker == null ) //sanity
return false;
if( (Rider.Hits - damage) < 30 && Rider.Map == attacker.Map && Rider.InRange( attacker, 18 ) ) //Range and map checked here instead of other base fuction because of abiliites that don't need to check this
{
attacker.BoltEffect( 0 );
// 35~100 damage, unresistable, by the Ki-rin.
attacker.Damage( Utility.RandomMinMax( 35, 100 ), this, false ); //Don't inform mount about this damage, Still unsure wether or not it's flagged as the mount doing damage or the player. If changed to player, without the extra bool it'd be an infinite loop
Rider.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1042534 ); // Your mount calls down the forces of nature on your opponent.
Rider.FixedParticles( 0, 0, 0, 0x13A7, EffectLayer.Waist );
Rider.PlaySound( 0xA9 ); // Ki-rin's whinny.
return true;
}
return false;
}