Пример #1
0
        protected BattleIcon(StateOfBattle battle, Combatant receiver)
        {
            X = receiver.X;
            Y = receiver.Y;

            Color = Colors.WHITE;
            AnimationTimer = new Timer(ANIMATION_DURATION);
        }
Пример #2
0
        public AbilityFailEvent(Combatant source, Ability ability, bool resetSourceTurnTimer)
            : base(source, resetSourceTurnTimer)
        {
            Ability = ability.Name;

            if (source is Ally)
            {
                Status = "Not enough MP for " + Ability + "!";
            }
            else // is Enemy
            {
                Status = source.Name + "'s skill power is used up.";
            }
        }
Пример #3
0
        public DamageIcon(StateOfBattle battle, int amount, Combatant receiver, bool mp = false)
            : base(battle, receiver)
        {
            Message = amount.ToString();

            if (mp)
            {
                Message += " MP";
            }

            if (amount < 0)
            {
                Message = Message.Substring(1); // drop minus sign
                Color = Colors.GREEN;
            }
        }
Пример #4
0
        private PetrifyAbility(Combatant source, Combatant target)
        {
            Name = "Petrify";
            Desc = "Petrification as a result of Slow-Numb";

            Type = AttackType.Physical;
            Target = BattleTarget.Combatant;

            Power = 0;
            Hitp = 255;

            HitFormula = PhysicalHit;

            Statuses = new StatusChange[] { new StatusChange(Status.Petrify, 100, StatusChange.Effect.Inflict) };

            #if DEBUG
            Message = String.Format("[ {0} had slow-numbed {1} ]", source, target);
            #else
            Message = String.Empty;
            #endif
        }
Пример #5
0
        private DeathAbility(Combatant source, Combatant target)
        {
            Name = "Death";
            Desc = "Death as a result of Death Sentence";

            Type = AttackType.Physical;
            Target = BattleTarget.Combatant;

            Power = 0;
            Hitp = 255;

            HitFormula = PhysicalHit;

            Statuses = new StatusChange[] { new StatusChange(Status.Death, 100, StatusChange.Effect.Inflict) };

            #if DEBUG
            Message = String.Format("[ {0} reaps {1} ]", source, target);
            #else
            Message = String.Empty;
            #endif
        }
Пример #6
0
        public AbilityEvent(Ability ability, AbilityModifiers modifiers, Combatant source, Combatant[] targets)
            : base(source, modifiers.ResetTurnTimer)
        {
            Hits = new bool[ability.Hits];
            Steals = new string[modifiers.StealAsWell ? targets.Count() : 0];
            TargetHitFlags = new bool[targets.Count()];
            Targets = targets;
            Ability = ability;
            Modifiers = modifiers;

            if (modifiers.StealAsWell)
            {
                if (!(source is Ally))
                {
                    throw new GameDataException("Non-Ally source '{0}' attempted to steal.", source.Name);
                }
                else if (targets.Any(x => !(x is Enemy)))
                {
                    throw new GameDataException("Source '{0}' attempted to steal from a non-Enemy target using ability '{1}'.", source.Name, ability.Name);
                }
            }
        }
Пример #7
0
        private PoisonAbility(Combatant poisoner, Combatant poisonee)
        {
            Name = "Poison";
            Desc = "Damage as a result of the Poison Status";

            Type = AttackType.Physical;
            Target = BattleTarget.Combatant;

            Elements = new Element[] { Element.Poison };

            Power = 1;
            Hitp = 255;

            DamageFormula = MaxHPPercent;
            HitFormula = PhysicalHit;

            #if DEBUG
            Message = String.Format("[ {0} had poisoned {1} ]", poisoner, poisonee);
            #else
            Message = String.Empty;
            #endif
        }
Пример #8
0
        public override bool InflictDeath(Combatant source)
        {
            bool inflicted = false;

            if (!Immune(Status.Death) && !(DeathForce || Peerless || Petrify || Resist))
            {
                if (DeathSentence)
                {
                    CureDeathSentence(source);
                }

                if (!_death)
                {
                    CurrentBattle.AddDeathIcon(this);

                    Kill();

                    _death    = true;
                    inflicted = true;
                }
            }

            return(inflicted);
        }
Пример #9
0
 public bool CurePeerless(Combatant source)
 {
     Peerless        = false;
     PeerlessTimeEnd = -1;
     return(true);
 }
Пример #10
0
 public void AttackX2(Combatant target, bool resetTurnTimer = true)
 {
     PrimaryAttackX2.Use(this, new Combatant[] { target }, new AbilityModifiers { ResetTurnTimer = resetTurnTimer });
 }
Пример #11
0
 public bool CureManipulate(Combatant source)
 {
     return(true);
 }
Пример #12
0
 public override bool CureSadness(Combatant source)
 {
     return(_c.CureSadness());
 }
Пример #13
0
 public static void Use(Combatant poisoner, Combatant poisonee)
 {
     poisonee.CurrentBattle.EnqueueAction(new PoisonEvent(poisoner, poisonee));
 }
Пример #14
0
 public PoisonEvent(Combatant poisoner, Combatant poisonee)
     : base(new PoisonAbility(poisoner, poisonee), MODIFIERS, poisoner, new Combatant[] { poisonee })
 {
     Poisonee = poisonee;
 }
Пример #15
0
        public static void Use(Combatant source, Combatant target)
        {
            DeathAbility ability = new DeathAbility(source, target);

            source.CurrentBattle.EnqueueAction(new AbilityEvent(ability, MODIFIERS, source, new Combatant[] { target }));
        }
Пример #16
0
 public override bool InflictManipulate(Combatant source)
 {
     return false;
 }
Пример #17
0
 public override bool InflictSadness(Combatant source)
 {
     if (_c.Immune(Status.Sadness))
     {
         return false;
     }
     return _c.InflictSadness();
 }
Пример #18
0
        public override bool InflictDeath(Combatant source)
        {
            bool inflicted = false;

            if (!Immune(Status.Death) && !(DeathForce || Peerless || Petrify || Resist))
            {
                if (DeathSentence)
                {
                    CureDeathSentence(source);
                }

                inflicted = _c.InflictDeath();

                if (inflicted)
                {
                    CurrentBattle.AddDeathIcon(this);

                    Kill();
                }
            }

            return inflicted;
        }
Пример #19
0
 public override bool InflictFury(Combatant source)
 {
     if (_c.Immune(Status.Fury))
     {
         return false;
     }
     return _c.InflictFury();
 }
Пример #20
0
 public override bool CureSadness(Combatant source)
 {
     return _c.CureSadness();
 }
Пример #21
0
 public override bool CureFury(Combatant source)
 {
     return _c.CureFury();
 }
Пример #22
0
        public override bool CureDeath(Combatant source)
        {
            bool cured = _c.CureDeath();

            if (cured)
            {
                CureAll(source);
                UnpauseTimers();
            }

            return cured;
        }
Пример #23
0
 public DeathIcon(StateOfBattle battle, Combatant receiver)
     : base(battle, receiver)
 {
     Message = DEATH;
 }
Пример #24
0
        public override void Recover(Combatant source)
        {
            CurrentBattle.AddRecoveryIcon(this);

            if (Death)
            {
                CureDeath(source);
            }

            _c.HP = MaxHP;
            _c.MP = MaxMP;
        }
Пример #25
0
        public static void Use(Combatant source, Combatant target)
        {
            PetrifyAbility ability = new PetrifyAbility(source, target);

            source.CurrentBattle.EnqueueAction(new AbilityEvent(ability, MODIFIERS, source, new Combatant[] { target }));
        }
Пример #26
0
 public override string GetMessage(Combatant source)
 {
     return source.Name + " attacks";
 }
Пример #27
0
 public static void Use(Combatant poisoner, Combatant poisonee)
 {
     poisonee.CurrentBattle.EnqueueAction(new PoisonEvent(poisoner, poisonee));
 }
Пример #28
0
 public override void SetAsControl()
 {
     base.SetAsControl();
     _target = BattleState.Commanding;
 }
Пример #29
0
 public void AttackX2(Combatant target, bool resetTurnTimer = true)
 {
     PrimaryAttackX2.Use(this, new Combatant[] { target }, new AbilityModifiers {
         ResetTurnTimer = resetTurnTimer
     });
 }
Пример #30
0
 public abstract void AcceptMPLoss(Combatant source, int delta);
Пример #31
0
 public MissIcon(StateOfBattle battle, Combatant receiver)
     : base(battle, receiver)
 {
     Message = MISS;
 }
Пример #32
0
 public abstract void Recover(Combatant source);
Пример #33
0
 public override bool InflictManipulate(Combatant source)
 {
     return(false);
 }
Пример #34
0
 public abstract bool InflictDeath(Combatant source);
Пример #35
0
 public bool CureShield(Combatant source)
 {
     Shield        = false;
     ShieldTimeEnd = -1;
     return(true);
 }
Пример #36
0
 public abstract bool InflictFury(Combatant source);
Пример #37
0
 public bool CureBerserk(Combatant source)
 {
     Berserk = false;
     return(true);
 }
Пример #38
0
 public abstract bool InflictSadness(Combatant source);
Пример #39
0
 public bool CureDarkness(Combatant source)
 {
     Darkness = false;
     return(true);
 }
Пример #40
0
 public abstract bool InflictManipulate(Combatant source);
Пример #41
0
        public override void AcceptDamage(Combatant source, int delta, AttackType type = AttackType.None)
        {
            CurrentBattle.AddDamageIcon(delta, this);

            // limit shtuff goes here

            if (type == AttackType.Physical)
            {
                if (Sleep)
                {
                    CureSleep(source);
                }
                if (Confusion)
                {
                    CureConfusion(source);
                }
            }

            int hp = _c.HP - delta;

            if (hp < 0)
            {
                hp = 0;
            }
            else if (hp >= _c.MaxHP)
            {
                hp = _c.MaxHP;
            }

            _c.HP = hp;

            if (HP == 0)
            {
                Kill();
            }

            if (source is Enemy)
            {
                LastAttacker = source;

                switch (type)
                {
                    case AttackType.Physical:
                        LastAttackerPhysical = source;
                        break;
                    case AttackType.Magical:
                        LastAttackerMagical = source;
                        break;
                }
            }
        }
Пример #42
0
 public abstract bool CureDeath(Combatant source);
Пример #43
0
 public override string GetMessage(Combatant source)
 {
     return Message;
 }
Пример #44
0
 public abstract bool CureFury(Combatant source);
Пример #45
0
 public override string GetMessage(Combatant source)
 {
     return source.Name + " casts " + Name;
 }
Пример #46
0
 public abstract bool CureSadness(Combatant source);
Пример #47
0
 public RecoveryIcon(StateOfBattle battle, Combatant receiver)
     : base(battle, receiver)
 {
     Message = RECOVERY;
     Color = Colors.GREEN;
 }
Пример #48
0
 public bool CureConfusion(Combatant source)
 {
     Confusion = false;
     return(true);
 }
Пример #49
0
            public bool Hits(Combatant source, Combatant target, AbilityModifiers modifiers)
            {
                // auto hit conditions

                if (_odds >= 100)
                {
                    return true;
                }
                if (Statuses.Count() == 1 && Statuses.Contains(Status.Frog) && target.Frog)
                {
                    return true;
                }
                if (Statuses.Count() == 1 && Statuses.Contains(Status.Small) && target.Small)
                {
                    return true;
                }
                if (target is Ally && Statuses.Any(s => new Status[] {
                    Status.Haste,
                    Status.Berserk,
                    Status.Shield
                }.Contains(s)))
                {
                    return true;
                }

                int odds = _odds;

                odds = MPTurbo(odds, modifiers);
                odds = Split(odds, modifiers);
                odds -= 1;

                return source.CurrentBattle.Random.Next(99) < odds;
            }
Пример #50
0
 protected int PhysicalDamage(int bd, int power, Combatant ee)
 {
     return (power * (512 - ee.Def) * bd) / (16 * 512);
 }
Пример #51
0
 public override bool CureFury(Combatant source)
 {
     return(_c.CureFury());
 }
Пример #52
0
 public bool CureFrog(Combatant source)
 {
     Frog = false;
     return(true);
 }
Пример #53
0
 public override string GetMessage(Combatant source)
 {
     return(source.Name + " attacks");
 }
Пример #54
0
 public bool CureSmall(Combatant source)
 {
     Small = false;
     return(true);
 }
Пример #55
0
 public PoisonEvent(Combatant poisoner, Combatant poisonee)
     : base(new PoisonAbility(poisoner, poisonee), MODIFIERS, poisoner, new Combatant[] { poisonee })
 {
     Poisonee = poisonee;
 }
Пример #56
0
 public bool CureMBarrier(Combatant source)
 {
     MBarrier        = false;
     MBarrierTimeEnd = -1;
     return(true);
 }
Пример #57
0
 public override string GetMessage(Combatant source)
 {
     return(Message);
 }
Пример #58
0
 public bool CureReflect(Combatant source)
 {
     Reflect = false;
     return(true);
 }
Пример #59
0
 public bool CureSilence(Combatant source)
 {
     Silence = false;
     return(true);
 }
Пример #60
0
        public override void AcceptMPLoss(Combatant source, int delta)
        {
            CurrentBattle.AddDamageIcon(delta, this, true);

            _c.MP -= delta;

            if (source is Enemy)
            {
                LastAttacker = source;
            }
        }