本文整理汇总了C#中BaseCreature.AddResistanceMod方法的典型用法代码示例。如果您正苦于以下问题:C# BaseCreature.AddResistanceMod方法的具体用法?C# BaseCreature.AddResistanceMod怎么用?C# BaseCreature.AddResistanceMod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseCreature
的用法示例。
在下文中一共展示了BaseCreature.AddResistanceMod方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnSummon
/**
* Evento invocado quando uma criatura é invocada por um jogador.
*/
public void OnSummon(Jogador caster, BaseCreature creature, ref Point3D p, ref TimeSpan duration)
{
SistemaTalento st = caster.getSistemaTalento();
//Aumenta o duração
if (st.possuiHabilidadeTalento(IdHabilidadeTalento.conjuracaoExtendida))
{
caster.SendMessage("Duracao normal: {0}", duration);
double totalDuracaoSegundos = duration.TotalSeconds * 1.5;
duration = TimeSpan.FromSeconds(totalDuracaoSegundos);
caster.SendMessage("Duracao alterada: {0}", duration);
}
//Aumenta a resistencia das conjurações
if (st.possuiHabilidadeTalento(IdHabilidadeTalento.conjuracaoResistente))
{
creature.AddResistanceMod(new ResistanceMod(ResistanceType.Cold, 5));
creature.AddResistanceMod(new ResistanceMod(ResistanceType.Energy, 5));
creature.AddResistanceMod(new ResistanceMod(ResistanceType.Fire, 5));
creature.AddResistanceMod(new ResistanceMod(ResistanceType.Physical, 5));
creature.AddResistanceMod(new ResistanceMod(ResistanceType.Poison, 5));
caster.SendMessage("Bonus resistencia");
}
//Aumenta os atributos da conjuração
if (st.possuiHabilidadeTalento(IdHabilidadeTalento.conjuracaoResistente))
{
HabilidadeNode node = st.getHabilidades()[IdHabilidadeTalento.conjuracaoResistente];
StatMod statusBonus = new StatMod(StatType.All, "TalentoConjuracaoForte", node.Nivel * 10, TimeSpan.FromDays(99));
creature.AddStatMod(statusBonus);
caster.SendMessage("Bonus Status");
}
}
示例2: OnUsed
public bool OnUsed( Mobile from, BaseCreature pet )
{
if ( m_UnderEffect.Contains( pet ) )
{
from.SendLocalizedMessage( 1113075 ); // Your pet is still under the effect of armor essence.
return false;
}
else if ( DateTime.Now < pet.NextArmorEssence )
{
from.SendLocalizedMessage( 1113076 ); // Your pet is still recovering from the last armor essence it consumed.
return false;
}
else
{
pet.SayTo( from, 1113050 ); // Your pet looks much happier.
pet.FixedEffect( 0x375A, 10, 15 );
pet.PlaySound( 0x1E7 );
List<ResistanceMod> mods = new List<ResistanceMod>();
mods.Add( new ResistanceMod( ResistanceType.Physical, 15 ) );
mods.Add( new ResistanceMod( ResistanceType.Fire, 10 ) );
mods.Add( new ResistanceMod( ResistanceType.Cold, 10 ) );
mods.Add( new ResistanceMod( ResistanceType.Poison, 10 ) );
mods.Add( new ResistanceMod( ResistanceType.Energy, 10 ) );
for ( int i = 0; i < mods.Count; i++ )
pet.AddResistanceMod( mods[i] );
m_UnderEffect.Add( pet );
Timer.DelayCall( Duration, new TimerCallback(
delegate
{
for ( int i = 0; i < mods.Count; i++ )
pet.RemoveResistanceMod( mods[i] );
m_UnderEffect.Remove( pet );
} ) );
pet.NextArmorEssence = DateTime.Now + Duration + Cooldown;
Delete();
return true;
}
}