Example #1
0
 public Poison(int strength, ICharacterCore caster)
 {
     m_damagePerInterval = strength / 3;
     if (m_damagePerInterval == 0)
         m_damagePerInterval = 1;
     m_castByPlayer = caster is IPlayer;
 }
Example #2
0
        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;           
        }
Example #3
0
        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;
        }
Example #4
0
 // 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();
     }
 }
Example #5
0
 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);
 }
Example #7
0
 public bool AddEffectToTarget(string effectName, ICharacterCore invoker, int strength, bool longTerm, Point target)
 {
     return AddEffectToTarget(effectName, invoker, strength, longTerm, target, null);
 }
Example #8
0
 internal virtual void Remove(ICharacterCore removedFrom)
 {
 }
Example #9
0
 public WordOfHope(int strength, ICharacterCore caster)
 {
     m_level = strength;
 }
Example #10
0
 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);
 }
Example #13
0
 public ArmorOfLight(int strength, ICharacterCore caster)
 {
     m_level = strength;
 }
 public bool UseSkill(ICharacterCore invoker, MonsterSkillType skill, Point target)
 {
     return UseSkill((Character)invoker, skill, target);
 }
Example #15
0
 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);
 }
Example #18
0
 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);
 }
Example #20
0
 public void Remove(ICharacterCore removedFrom)
 {
     m_effectResult.Remove(removedFrom);
 }
Example #21
0
 public Regeneration(int strength, ICharacterCore caster)
 {
 }
Example #22
0
 internal override void Apply(ICharacterCore appliedTo)
 {
     m_affected = appliedTo;
 }
Example #23
0
 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);
 }
Example #25
0
 internal override void Apply(ICharacterCore appliedTo)
 {
     appliedTo.Heal(BonusStamina, false);
 }
 public bool Wait(ICharacterCore c)
 {
     return m_engine.Wait((Character)c);
 }
Example #27
0
 internal virtual void Apply(ICharacterCore appliedTo)
 { 
 }
Example #28
0
 public Haste(int strength, ICharacterCore caster)
 {
     m_modifier = 1.2 + (.1 * strength);
 }