本文整理汇总了C#中GameLiving.ChangeEndurance方法的典型用法代码示例。如果您正苦于以下问题:C# GameLiving.ChangeEndurance方法的具体用法?C# GameLiving.ChangeEndurance怎么用?C# GameLiving.ChangeEndurance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameLiving
的用法示例。
在下文中一共展示了GameLiving.ChangeEndurance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GiveEndurance
protected virtual void GiveEndurance(GameLiving target, int amount)
{
if (target.Endurance >= amount)
amount = target.MaxEndurance - target.Endurance;
target.ChangeEndurance(target, GameLiving.eEnduranceChangeType.Spell, amount);
MessageToCaster("You transfer " + amount + " life to Endurance!", eChatType.CT_Spell);
}
示例2: Execute
/// <summary>
/// Action
/// </summary>
/// <param name="living"></param>
public override void Execute(GameLiving living)
{
if (CheckPreconditions(living, DEAD | SITTING | MEZZED | STUNNED)) return;
int regged = living.ChangeEndurance(living, GameLiving.eEnduranceChangeType.Spell, living.MaxEndurance);
SendCasterSpellEffectAndCastMessage(living, 7003, regged > 0);
if (regged > 0) DisableSkill(living);
}
示例3: OnDirectEffect
public override void OnDirectEffect(GameLiving target, double effectiveness)
{
if (target == null) return;
if (!target.IsAlive || target.ObjectState != GameLiving.eObjectState.Active) return;
//spell damage should 25;
int end = (int)(Spell.Damage);
target.ChangeEndurance(target, GameLiving.eEnduranceChangeType.Spell, (-end));
if (target is GamePlayer)
((GamePlayer)target).Out.SendMessage(" You lose " + end + " endurance!", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
(m_caster as GamePlayer).Out.SendMessage("" + target.Name + " loses " + end + " endurance!", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
target.StartInterruptTimer(target.SpellInterruptDuration, AttackData.eAttackType.Spell, Caster);
}
示例4: ApplyEffectOnTarget
public override void ApplyEffectOnTarget(GameLiving target, double effectiveness)
{
GameSpellEffect neweffect = CreateSpellEffect(target, effectiveness);
neweffect.Start(target);
if (target == null) return;
if (!target.IsAlive || target.ObjectState != GameLiving.eObjectState.Active) return;
//spell damage should 25;
int end = (int)(Spell.Damage);
target.ChangeEndurance(target, GameLiving.eEnduranceChangeType.Spell, (-end));
if (target is GamePlayer)
((GamePlayer)target).Out.SendMessage(" You lose " + end + " endurance!", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
(m_caster as GamePlayer).Out.SendMessage("" + target.Name + " loses " + end + " endurance!", eChatType.CT_YouWereHit, eChatLoc.CL_SystemWindow);
}
示例5: HealTarget
/// <summary>
/// Heals hit points of one target and sends needed messages, no spell effects
/// </summary>
/// <param name="target"></param>
/// <param name="amount">amount of hit points to heal</param>
/// <returns>true if heal was done</returns>
public virtual bool HealTarget(GameLiving target, int amount)
{
if (target == null || target.ObjectState != GameLiving.eObjectState.Active) return false;
// we can't heal people we can attack
if (GameServer.ServerRules.IsAllowedToAttack(Caster, target, true))
return false;
if (!target.IsAlive)
{
//"You cannot heal the dead!" sshot550.tga
MessageToCaster(target.GetName(0, true) + " is dead!", eChatType.CT_SpellResisted);
return false;
}
int heal = target.ChangeEndurance(Caster, GameLiving.eEnduranceChangeType.Spell, amount);
if (heal == 0)
{
if (Spell.Pulse == 0)
{
if (target == m_caster) MessageToCaster("Your endurance is full.", eChatType.CT_SpellResisted);
else MessageToCaster(target.GetName(0, true) + " endurance is full.", eChatType.CT_SpellResisted);
}
return false;
}
if (m_caster == target)
{
MessageToCaster("You restore " + heal + " endurance points.", eChatType.CT_Spell);
if (heal < amount)
MessageToCaster("Your endurance is full.", eChatType.CT_Spell);
}
else
{
MessageToCaster("You restore " + target.GetName(0, false) + " for " + heal + " ednurance points!", eChatType.CT_Spell);
MessageToLiving(target, "Your endurance was restored by " + m_caster.GetName(0, false) + " for " + heal + " points.", eChatType.CT_Spell);
if (heal < amount)
MessageToCaster(target.GetName(0, true) + " endurance is full.", eChatType.CT_Spell);
}
return true;
}