本文整理汇总了C#中ResistanceMod类的典型用法代码示例。如果您正苦于以下问题:C# ResistanceMod类的具体用法?C# ResistanceMod怎么用?C# ResistanceMod使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ResistanceMod类属于命名空间,在下文中一共展示了ResistanceMod类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Target
public void Target( Mobile m )
{
if ( CheckHSequence( m ) )
{
SpellHelper.Turn( Caster, m );
/* Transmogrifies the flesh of the target creature or player to resemble rotted corpse flesh,
* making them more vulnerable to Fire and Poison damage,
* but increasing their resistance to Physical and Cold damage.
*
* The effect lasts for ((Spirit Speak skill level - target's Resist Magic skill level) / 25 ) + 40 seconds.
*
* NOTE: Algorithm above is fixed point, should be:
* ((ss-mr)/2.5) + 40
*
* NOTE: Resistance is not checked if targeting yourself
*/
ExpireTimer timer = (ExpireTimer)m_Table[m];
if ( timer != null )
timer.DoExpire();
else
m.SendLocalizedMessage( 1061689 ); // Your skin turns dry and corpselike.
if ( m.Spell != null )
m.Spell.OnCasterHurt();
m.FixedParticles( 0x373A, 1, 15, 9913, 67, 7, EffectLayer.Head );
m.PlaySound( 0x1BB );
double ss = GetDamageSkill( Caster );
double mr = ( Caster == m ? 0.0 : GetResistSkill( m ) );
m.CheckSkill( SkillName.MagicResist, 0.0, 120.0 ); //Skill check for gain
TimeSpan duration = TimeSpan.FromSeconds( ((ss - mr) / 2.5) + 40.0 );
ResistanceMod[] mods = new ResistanceMod[4]
{
new ResistanceMod( ResistanceType.Fire, -15 ),
new ResistanceMod( ResistanceType.Poison, -15 ),
new ResistanceMod( ResistanceType.Cold, +10 ),
new ResistanceMod( ResistanceType.Physical, +10 )
};
timer = new ExpireTimer( m, mods, duration );
timer.Start();
BuffInfo.AddBuff( m, new BuffInfo( BuffIcon.CorpseSkin, 1075663, duration, m ) );
m_Table[m] = timer;
for ( int i = 0; i < mods.Length; ++i )
m.AddResistanceMod( mods[i] );
HarmfulSpell( m );
}
FinishSequence();
}
示例2: OnGaveMeleeAttack
// TODO: Put this attack shared with Hiryu and Lesser Hiryu in one place
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
if( 0.1 > Utility.RandomDouble() )
{
ExpireTimer timer = (ExpireTimer)m_Table[defender];
if( timer != null )
{
timer.DoExpire();
defender.SendLocalizedMessage( 1070837 ); // The creature lands another blow in your weakened state.
}
else
defender.SendLocalizedMessage( 1070836 ); // The blow from the creature's claws has made you more susceptible to physical attacks.
int effect = -(defender.PhysicalResistance * 15 / 100);
ResistanceMod mod = new ResistanceMod( ResistanceType.Physical, effect );
defender.FixedEffect( 0x37B9, 10, 5 );
defender.AddResistanceMod( mod );
timer = new ExpireTimer( defender, mod, TimeSpan.FromSeconds( 5.0 ) );
timer.Start();
m_Table[defender] = timer;
}
}
示例3: OnHit
public override void OnHit(Mobile attacker, Mobile defender, int damage)
{
if (!this.Validate(attacker) || !this.CheckMana(attacker, true))
return;
ClearCurrentAbility(attacker);
attacker.SendLocalizedMessage(1063353); // You perform a masterful defense!
attacker.FixedParticles(0x375A, 1, 17, 0x7F2, 0x3E8, 0x3, EffectLayer.Waist);
int modifier = (int)(30.0 * ((Math.Max(attacker.Skills[SkillName.Bushido].Value, attacker.Skills[SkillName.Ninjitsu].Value) - 50.0) / 70.0));
DefenseMasteryInfo info = m_Table[attacker] as DefenseMasteryInfo;
if (info != null)
EndDefense((object)info);
ResistanceMod mod = new ResistanceMod(ResistanceType.Physical, 50 + modifier);
attacker.AddResistanceMod(mod);
info = new DefenseMasteryInfo(attacker, 80 - modifier, mod);
info.m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(3.0), new TimerStateCallback(EndDefense), info);
m_Table[attacker] = info;
attacker.Delta(MobileDelta.WeaponDamage);
}
示例4: DoEffect
public override void DoEffect(Mobile m)
{
ResistanceMod[] mods = (ResistanceMod[])m_Table[m];
int otherMod = 0 + (int)(m.Skills[SkillName.Mysticism].Value / 20);
int admod = 1 + (int)(m.Skills[SkillName.Focus].Value / 20);
//int casts = (int)AosAttributes.GetValue(Caster, AosAttribute.CastSpeed - 2);
mods = new ResistanceMod[5]
{
new ResistanceMod( ResistanceType.Physical, otherMod + admod ),
new ResistanceMod( ResistanceType.Fire, otherMod + admod ),
new ResistanceMod( ResistanceType.Cold, otherMod + admod ),
new ResistanceMod( ResistanceType.Poison, otherMod + admod ),
new ResistanceMod( ResistanceType.Energy, otherMod + admod ),
// new ResistanceMod( AosAttribute.CastSpeed, casts )
};
m_Table[m] = mods;
for (int i = 0; i < mods.Length; ++i)
m.AddResistanceMod(mods[i]);
m.PlaySound(0x65B);
m.FixedParticles(0x3728, 1, 13, 9918, 92, 3, EffectLayer.Head);
m.Delta(MobileDelta.WeaponDamage);
m.EndAction(typeof(StoneFormSpell));
}
示例5: ExpireTimer
public ExpireTimer( Mobile m, ResistanceMod mod )
: base( TimeSpan.FromSeconds( 10 ) )
{
m_Mobile = m;
m_Mod = mod;
Priority = TimerPriority.TwoFiftyMS;
}
示例6: Target
public void Target( Mobile m )
{
if ( !Caster.CanSee( m ) )
{
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
else if ( CheckHSequence( m ) )
{
Mobile source = Caster;
SpellHelper.Turn( source, m );
SpellHelper.CheckReflect( (int)this.Circle, ref source, ref m );
m.FixedParticles( 0x374A, 10, 30, 5013, 0x238, 2, EffectLayer.Waist );
int amount = (int)( Caster.Skills[SkillName.Musicianship].Base * 0.17 );
TimeSpan duration = TimeSpan.FromSeconds( Caster.Skills[SkillName.Musicianship].Base * 0.15 );
m.SendMessage( "Your poison resistance has decreased." );
ResistanceMod mod1 = new ResistanceMod( ResistanceType.Cold, - amount );
m.AddResistanceMod( mod1 );
ExpireTimer timer1 = new ExpireTimer( m, mod1, duration );
timer1.Start();
}
FinishSequence();
}
示例7: OnCast
public override void OnCast()
{
if (CheckSequence())
{
if (contemMagia.ContainsKey(Caster))
{
Caster.SendLocalizedMessage(1005559); // This spell is already in effect.
return;
}
Caster.PlaySound(0x1E9);
Caster.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist);
//valor da proteção
int protecao = (int) (Caster.Skills[DamageSkill].Value / 5.0) + Utility.Random(2);
ResistanceMod[] resistencias = new ResistanceMod[5];
resistencias[0] = new ResistanceMod(ResistanceType.Physical, protecao);
resistencias[1] = new ResistanceMod(ResistanceType.Fire, protecao);
resistencias[2] = new ResistanceMod(ResistanceType.Cold, protecao);
resistencias[3] = new ResistanceMod(ResistanceType.Energy, protecao);
resistencias[4] = new ResistanceMod(ResistanceType.Poison, protecao);
Caster.AddResistanceMod(resistencias[0]);
Caster.AddResistanceMod(resistencias[1]);
Caster.AddResistanceMod(resistencias[2]);
Caster.AddResistanceMod(resistencias[3]);
Caster.AddResistanceMod(resistencias[4]);
//marca que ele contem a magia
contemMagia.Add(Caster, Caster);
string args = String.Format("{0}", protecao);
//adiciona o buff de armadura arcana
BuffInfo armaduraArcana = new BuffInfo(BuffIcon.Protection, 1075814, 1075815, args.ToString());
BuffInfo.AddBuff(Caster, armaduraArcana);
//calculo da duracao
int intDuracao = (int) (Caster.Skills[CastSkill].Value / 10) + Utility.Random(2);
TimeSpan duracao = TimeSpan.FromMinutes(intDuracao);
//Tempo para remover
Timer remover = new InternalTimer(Caster, resistencias, armaduraArcana, duracao);
remover.Start();
}
FinishSequence();
}
示例8: OnGaveMeleeAttack
public override void OnGaveMeleeAttack( Mobile defender )
{
base.OnGaveMeleeAttack( defender );
if ( Utility.RandomDouble() < 0.1 )
{
ExpireTimer timer;
if ( m_Table.TryGetValue( defender, out timer ) )
timer.DoExpire();
defender.FixedParticles( 0x3709, 10, 30, 5052, EffectLayer.LeftFoot );
defender.PlaySound( 0x208 );
defender.SendLocalizedMessage( 1070833 ); // The creature fans you with fire, reducing your resistance to fire attacks.
ResistanceMod mod = new ResistanceMod( ResistanceType.Fire, -10 );
defender.AddResistanceMod( mod );
m_Table[defender] = timer = new ExpireTimer( defender, mod );
timer.Start();
}
}
示例9: OnTarget
protected override void OnTarget(Mobile from, object targeted)
{
var pm = from as PlayerMobile;
if (m_Tasty.Deleted)
return;
if (targeted is BaseCreature)
{
var creature = (BaseCreature) targeted;
if ((creature.Controlled || creature.Summoned) && (from == creature.ControlMaster) &&
!(creature.Asleep))
{
creature.FixedParticles(0x373A, 10, 15, 5018, EffectLayer.Waist);
creature.PlaySound(0x1EA);
var mod = new ResistanceMod(ResistanceType.Physical, +15);
var mod1 = new ResistanceMod(ResistanceType.Fire, +10);
var mod2 = new ResistanceMod(ResistanceType.Cold, +10);
var mod3 = new ResistanceMod(ResistanceType.Poison, +10);
var mod4 = new ResistanceMod(ResistanceType.Energy, +10);
creature.AddResistanceMod(mod);
creature.AddResistanceMod(mod1);
creature.AddResistanceMod(mod2);
creature.AddResistanceMod(mod3);
creature.AddResistanceMod(mod4);
from.SendMessage("You have increased the Damage Absorption of your pet by 10% for 10 Minutes !!");
m_Tasty.Used = true;
creature.Asleep = true;
Timer.DelayCall(TimeSpan.FromMinutes(10.0), delegate
{
var mod5 = new ResistanceMod(ResistanceType.Physical, -15);
var mod6 = new ResistanceMod(ResistanceType.Fire, -10);
var mod7 = new ResistanceMod(ResistanceType.Cold, -10);
var mod8 = new ResistanceMod(ResistanceType.Poison, -10);
var mod9 = new ResistanceMod(ResistanceType.Energy, -10);
creature.AddResistanceMod(mod5);
creature.AddResistanceMod(mod6);
creature.AddResistanceMod(mod7);
creature.AddResistanceMod(mod8);
creature.AddResistanceMod(mod9);
creature.PlaySound(0x1EB);
this.m_Tasty.Used = true;
creature.Asleep = false;
from.SendMessage("The effect of Vial of Armor Essence is finish !");
Timer.DelayCall(TimeSpan.FromMinutes(120.0), delegate { this.m_Tasty.Used = false; });
});
}
else if ((creature.Controlled || creature.Summoned) && (from == creature.ControlMaster) &&
(creature.Asleep))
{
from.SendMessage("Pet already under the influence of Vial of Armor Essence !");
}
else
{
from.SendLocalizedMessage(1113049);
}
}
else
{
from.SendLocalizedMessage(500329);
}
}
示例10: DefenseMasteryInfo
public DefenseMasteryInfo(Mobile from, int damageMalus, ResistanceMod mod)
{
this.m_From = from;
this.m_DamageMalus = damageMalus;
this.m_Mod = mod;
}
示例11: MustardBomb
public static void MustardBomb( Mobile from, Mobile to )
{
if ( !Ability.CanUse( to, from, true ) )
return;
Point3D point = to.Location;
for( int i = -3; i < 4; i++ )
{
for( int j = -3; j < 4; j++ )
{
point = new Point3D( to.X + i, to.Y + j, to.Z );
if ( BlueSpell.GetDist( point, to.Location ) < 3.1 )
Effects.SendLocationEffect( point,to.Map, 0x3728, 13, 1283/*Hue*/, 4 );
}
}
ResistanceMod[] mods = new ResistanceMod[]{ new ResistanceMod( ResistanceType.Fire, -300 ),
new ResistanceMod( ResistanceType.Cold, -300 ) };
for ( int i = 0; i < mods.Length; ++i )
to.AddResistanceMod( mods[i] );
TimedResistanceMod.AddMod(
to,
"Mustard Bomb",
mods,
TimeSpan.FromSeconds( 60 )
);
to.AddSkillMod( new TimedSkillMod( SkillName.MagicResist, true, -120.0, TimeSpan.FromSeconds( 60 ) ) );
to.SendMessage( "The intense heat scalds your elemental resistance." );
}
示例12: Target
public void Target( Mobile m )
{
if ( !Caster.CanSee( m ) ) {
Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
}
if ( sobreEfeito( m ) ){
Caster.LocalOverheadMessage( MessageType.Regular, 0x481, false, "O alvo já esta sobre o efeito de magia Proteção Frio." );
}
else if ( CheckBSequence( m, false ) ) {
SpellHelper.Turn( Caster, m );
//proteção
double valorSkill = Caster.Skills[DamageSkill].Value;
int bonus = (int)(valorSkill / 10);
int protecao = Utility.RandomMinMax(Math.Max(1, bonus - 3), bonus + Utility.Random(5));
//duracao
TimeSpan duracao = TimeSpan.FromMinutes(Caster.Skills[CastSkill].Value / 10 + Utility.Random(2));
//adicona a resistencia
ResistanceMod[] resistencias = new ResistanceMod[1];
resistencias[0] = new ResistanceMod(ResistanceType.Cold, protecao);
foreach (ResistanceMod resis in resistencias) {
Caster.AddResistanceMod(resis);
}
//efeito
m.PlaySound( 0x202 );
m.FixedParticles( 0x373A, 10, 15, 5012, 0x450, 3, EffectLayer.Waist );
m.SendMessage( "Você esta sobre o efeito da magia Proteção Frio" );
adicionarEfeito(m);
Timer t = new InternalTimer(m, resistencias, duracao);
t.Start();
}
FinishSequence();
}
示例13: InternalTimer
public InternalTimer(Mobile m, ResistanceMod[] resistencias, TimeSpan delay )
: base(delay)
{
alvo = m;
this.resistencias = resistencias;
bf = new BuffInfo( BuffIcon.Bless, 1075843, new TextDefinition("Proteção Frio"));
BuffInfo.AddBuff( m, bf);
}
示例14: OnGaveMeleeAttack
public override void OnGaveMeleeAttack(Mobile defender)
{
base.OnGaveMeleeAttack(defender);
if (!this.IsFanned(defender) && 0.05 > Utility.RandomDouble())
{
/* Fanning Fire
* Graphic: Type: "3" From: "0x57D4F5B" To: "0x0" ItemId: "0x3709" ItemIdName: "fire column" FromLocation: "(994 325, 16)" ToLocation: "(994 325, 16)" Speed: "10" Duration: "30" FixedDirection: "True" Explode: "False" Hue: "0x0" RenderMode: "0x0" Effect: "0x34" ExplodeEffect: "0x1" ExplodeSound: "0x0" Serial: "0x57D4F5B" Layer: "5" Unknown: "0x0"
* Sound: 0x208
* Start cliloc: 1070833
* Effect: Fire res -10% for 10 seconds
* Damage: 35-45, 100% fire
* End cliloc: 1070834
* Effect does not stack
*/
defender.SendLocalizedMessage(1070833); // The creature fans you with fire, reducing your resistance to fire attacks.
int effect = -(defender.FireResistance / 10);
ResistanceMod mod = new ResistanceMod(ResistanceType.Fire, effect);
defender.FixedParticles(0x37B9, 10, 30, 0x34, EffectLayer.RightFoot);
defender.PlaySound(0x208);
// This should be done in place of the normal attack damage.
//AOS.Damage( defender, this, Utility.RandomMinMax( 35, 45 ), 0, 100, 0, 0, 0 );
defender.AddResistanceMod(mod);
ExpireTimer timer = new ExpireTimer(defender, mod, TimeSpan.FromSeconds(10.0));
timer.Start();
m_Table[defender] = timer;
}
}
示例15: ExpireTimer
public ExpireTimer(Mobile m, ResistanceMod mod, TimeSpan delay)
: base(delay)
{
this.m_Mobile = m;
this.m_Mod = mod;
this.Priority = TimerPriority.TwoFiftyMS;
}