public Poison(int strength, ICharacterCore caster) { m_damagePerInterval = strength / 3; if (m_damagePerInterval == 0) m_damagePerInterval = 1; m_castByPlayer = caster is IPlayer; }
private bool HandleLongTermEffect(string effectName, ICharacterCore invoker, int strength) { DismissExistingEffect(effectName, invoker); // Check here if mp will bring us under 0 since mp cost of spell hasn't hit yet... invoker.AddEffect(EffectFactory.CreateEffect(invoker, effectName, true, strength)); return true; }
private bool HandleShortTermEffect(string effectName, ICharacterCore invoker, int strength, ICharacterCore targetCharacter) { DismissExistingEffect(effectName, targetCharacter); IStatusEffectCore effect = EffectFactory.CreateEffect(invoker, effectName, false, strength); targetCharacter.AddEffect(effect); if (targetCharacter is IMonster && invoker is IPlayer && !effect.IsPositiveEffect) m_engine.MonsterNoticeRangedAttack(targetCharacter, invoker.Position); return true; }
// For effects that mess with HPs on add/remove, this "works" for now since // We'll call Dismiss on the previous effect, which waits until end of turn to Remove // Then we'll call Add on the new effect, which'll add the HP first, then the remove will remove them // If we ever have an effect that is percentage based, we'll have to redo this... private void DismissExistingEffect(string effectName, ICharacterCore target) { List<IStatusEffectCore> statusList = target.Effects.Where(s => s.Type == effectName).ToList(); if (statusList.Count > 1) throw new System.InvalidOperationException("DismissExistingEffect with more than one effect of the same name on them?"); foreach (StatusEffect s in statusList) { m_engine.SendTextOutput(string.Format("The existing {0} effect fades from {1}.", s.Name, target.Name)); s.Dismiss(); } }
public bool AddEffectToTarget(string effectName, ICharacterCore invoker, int strength, bool longTerm, Point target, string toPrintOnEffectAdd) { ICharacterCore targetCharacter = m_engine.FindTargetAtPosition(target); if (targetCharacter != null) { bool successOnAddEffect; if (longTerm) successOnAddEffect = HandleLongTermEffect(effectName, invoker, strength); else successOnAddEffect = HandleShortTermEffect(effectName, invoker, strength, targetCharacter); if (successOnAddEffect && toPrintOnEffectAdd != null) m_engine.SendTextOutput(toPrintOnEffectAdd); return true; } return false; }
public bool Move(ICharacterCore c, Direction direction) { return m_engine.Move((Character)c, direction); }
public bool AddEffectToTarget(string effectName, ICharacterCore invoker, int strength, bool longTerm, Point target) { return AddEffectToTarget(effectName, invoker, strength, longTerm, target, null); }
internal virtual void Remove(ICharacterCore removedFrom) { }
public WordOfHope(int strength, ICharacterCore caster) { m_level = strength; }
public Light(int strength, ICharacterCore caster) { m_visionBoost = strength / 2; if (m_visionBoost < 2) m_visionBoost = 2; }
public List<ICharacterCore> MonstersInCharactersLOS(ICharacterCore character) { return m_engine.MonstersInCharactersLOS((Character)character).OfType<ICharacterCore>().ToList(); }
public void MonsterNoticeRangedAttack(ICharacterCore monster, Utilities.Point positionAttackCameFrom) { ((Monster)monster).NoticeRangedAttack(positionAttackCameFrom); }
public ArmorOfLight(int strength, ICharacterCore caster) { m_level = strength; }
public bool UseSkill(ICharacterCore invoker, MonsterSkillType skill, Point target) { return UseSkill((Character)invoker, skill, target); }
public Slow(int strength, ICharacterCore caster) { m_modifier = 1.10 + (.1 * strength); }
public bool Attack(ICharacterCore attacker, Point attackTarget) { return m_engine.Attack((Character)attacker, attackTarget); }
public bool Operate(ICharacterCore characterOperating, Point pointToOperateAt) { return m_engine.Operate((Character)characterOperating, pointToOperateAt); }
public void Apply(ICharacterCore appliedTo) { m_effectResult.Apply(appliedTo); }
public List<Point> PathToPoint(ICharacterCore actor, Point dest, bool canOperate, bool usePlayerLOS, bool monstersBlockPath) { return m_engine.PathToPoint((Character)actor, dest, canOperate, usePlayerLOS, monstersBlockPath); }
public void Remove(ICharacterCore removedFrom) { m_effectResult.Remove(removedFrom); }
public Regeneration(int strength, ICharacterCore caster) { }
internal override void Apply(ICharacterCore appliedTo) { m_affected = appliedTo; }
internal override void Remove(ICharacterCore removedFrom) { removedFrom.DamageJustStamina(BonusStamina); }
public void DamageTarget(ICharacterCore attacker, int damage, ICharacterCore target) { m_engine.CombatEngine.DamageTarget((Character)attacker, damage, (Character)target); }
internal override void Apply(ICharacterCore appliedTo) { appliedTo.Heal(BonusStamina, false); }
public bool Wait(ICharacterCore c) { return m_engine.Wait((Character)c); }
internal virtual void Apply(ICharacterCore appliedTo) { }
public Haste(int strength, ICharacterCore caster) { m_modifier = 1.2 + (.1 * strength); }