public AbstractArena(AbstractPlayerCharacter PC, AbstractMonster enemy, AbstractEnvironment envi)
 {
     actionManager   = new ActionManager();
     PlayerCharacter = PC;
     Enemy           = enemy;
     Environment     = envi;
 }
Ejemplo n.º 2
0
    public override void OnEvoke()
    {
        AbstractMonster tWeakestMonster = null;

        for (int i = 0; i < AbstractDungeon.GetMonsters().Monsters.Count; i++)
        {
            AbstractMonster tMonster = AbstractDungeon.GetMonsters().Monsters[i];
            if (!tMonster.IsDeadOrEscaped())
            {
                if (null == tWeakestMonster)
                {
                    tWeakestMonster = tMonster;
                }
                else if (tMonster.CurrentHealth < tWeakestMonster.CurrentHealth)
                {
                    tWeakestMonster = tMonster;
                }
            }
        }

        for (int i = 0; i < AbstractDungeon.GetMonsters().Monsters.Count; i++)
        {
            AbstractMonster tMonster = AbstractDungeon.GetMonsters().Monsters[i];
            if (tMonster.IsHasPower("Lockon") && !tMonster.IsDeadOrEscaped())
            {
                tWeakestMonster = tMonster;
                break;
            }
        }

        if (null != tWeakestMonster)
        {
            AbstractDungeon.ActionManager.AddToTop(new DamageAction(tWeakestMonster, new DamageInfo(AbstractDungeon.Player, EvokeAmount, DamageType.Thorns), AttackEffect.Fire));
        }
    }
Ejemplo n.º 3
0
 public ShowMoveNameAction(AbstractMonster _source)
 {
     SetValues(_source, _source);
     msg = _source.MoveName;
     _source.MoveName = null;
     GameActionType   = ActionType.Text;
 }
Ejemplo n.º 4
0
    public void OnUseCard(AbstractCard _card, UseCardAction _action)
    {
        if (!_card.IsPurgeOnUse && _card.Type == CardType.Attack && Amount > 0)
        {
            //flash
            AbstractMonster tMonster = null;
            if (_action.Target != null)
            {
                tMonster = _action.Target as AbstractMonster;
            }
            AbstractCard tCard = _card.MakeStatEquivalentCopy();
            AbstractDungeon.Player.Limbo.AddToBottom(tCard);
            tCard.IsFreeToPlayOnce = true;
            if (null != tMonster)
            {
                tCard.CalculateCardDamage(tMonster);
            }

            tCard.IsPurgeOnUse = true;
            AbstractDungeon.ActionManager.CardQueue.Add(new CardQueueItem(tCard, tMonster, _card.EnergyOnUse));
            if (tCard.CardID.Equals("Rampage"))
            {
                AbstractDungeon.ActionManager.AddToBottom(new ModifyDamageAction(_card, tCard.MagicNumber));
            }

            Amount--;
            if (Amount == 0)
            {
                AbstractDungeon.ActionManager.AddToBottom(new RemoveSpecificPowerAction(Owner, Owner, "DoubleTap"));
            }
        }
    }
Ejemplo n.º 5
0
    public bool IsCanUse(AbstractPlayer _player, AbstractMonster _monster)
    {
        if (Type == CardType.Status)
        {
            if (AbstractDungeon.Player.HasRelic("MedicalKit"))
            {
                return(true);
            }

            if (!CardID.Equals("Slimed"))
            {
                CantUseMessage = GetCanPlayMessage();
                return(false);
            }
        }

        if (Type == CardType.Curse)
        {
            if (AbstractDungeon.Player.HasRelic("BlueCandle"))
            {
                return(true);
            }

            if (!CardID.Equals("Pride"))
            {
                CantUseMessage = GetCanPlayMessage();
                return(false);
            }
        }

        return(IsCardPlayable(_monster) && IsHasEnoughEnergy());
    }
Ejemplo n.º 6
0
 public void CalculateCardDamage(AbstractMonster _monster)
 {
     base.CalculateCardDamage(_monster);
     RawDescription  = Description;
     RawDescription += UpgradeDescription;
     InitializeDescription();
 }
Ejemplo n.º 7
0
 public CardQueueItem(AbstractCard _card, AbstractMonster _monster, int _setEnergyOnUse)
 {
     EnergyOnUse = 0;
     Card        = _card;
     Monster     = _monster;
     EnergyOnUse = _setEnergyOnUse;
 }
Ejemplo n.º 8
0
    public void AddBlock(int _blockAmount)          //获得格挡
    {
        float tValue = _blockAmount;

        if (IsPlayer)
        {
            AbstractRelic tAbstractRelic;
            for (int i = 0; i < AbstractDungeon.Player.Relics.Count; i++)
            {
                tValue = AbstractDungeon.Player.Relics[i].OnPlayerGainedBlock(tValue);
            }

            if (tValue > 0f)
            {
                for (int i = 0; i < powers.Count; i++)
                {
                    powers[i].OnGainedBlock(tValue);
                }
            }
        }

        bool tIsEffect = false;

        if (CurrentBlock == 0)
        {
            tIsEffect = true;
        }

        for (int i = 0; i < AbstractDungeon.GetCurrRoom().Monsters.Monsters.Count; i++)
        {
            AbstractMonster tMonster = AbstractDungeon.GetCurrRoom().Monsters.Monsters[i];
            for (int j = 0; j < tMonster.powers.Count; j++)
            {
                tMonster.powers[i].OnPlayerGainedBlock(tValue);
            }
        }

        CurrentBlock += (int)Math.Floor(tValue);
        if (CurrentBlock >= 99 && IsPlayer)
        {
        }

        if (CurrentBlock > 999)
        {
            CurrentHealth = 999;
        }

        if (CurrentBlock == 999)
        {
        }

        if (tIsEffect && CurrentBlock > 0)
        {
            GainBlockAnimation();
        }
        else if (_blockAmount > 0)
        {
        }
    }
        public CombatModel(AbstractPlayerCharacter PC, AbstractMonster monster, AbstractEnvironment environment)
        {
            PlayerCharacter      = PC;
            MonsterCharacter     = monster;
            EnvironmentCharacter = environment;

            Arena = new DEBUG_Arena(PC, monster, environment);
        }
Ejemplo n.º 10
0
 public void Use(AbstractPlayer _player, AbstractMonster _monster)
 {
     if (null != _monster)
     {
         //AbstractDungeon.ActionManager.AddToBottom(new VFXAction);
     }
     AbstractDungeon.ActionManager.AddToBottom(new DamageAction(_monster, new DamageInfo(_player, Damage, DamageTypeForTurn), AttackEffect.BluntHeavy));
 }
Ejemplo n.º 11
0
 public void Use(AbstractPlayer _player, AbstractMonster _monster)
 {
     BaseDamage = _player.CurrentBlock;
     CalculateCardDamage(_monster);
     AbstractDungeon.ActionManager.AddToBottom(new DamageAction(_monster, new DamageInfo(_player, Damage, DamageType.Normal), AttackEffect.BluntHeavy));
     RawDescription = Description;
     InitializeDescription();
 }
Ejemplo n.º 12
0
 public override bool Equals(AbstractMonster other)
 {
     if (this.MonsterName.Equals(other.MonsterName) && other.GetType() == this.GetType())
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Ejemplo n.º 13
0
 public SpawnMonsterAction(AbstractMonster _monster, bool _isMinion, int _slot)
 {
     isUsed         = false;
     GameActionType = ActionType.Special;
     monster        = _monster;
     targetSlot     = _slot;
     if (AbstractDungeon.Player.HasRelic("Philosopher'sStone"))
     {
         monster.AddPower(new StrengthPower(monster, 2));
     }
 }
Ejemplo n.º 14
0
 public SetMoveAction(AbstractMonster _monster, string _moveName, byte _nextMove, Intent _intent, int _baseDamage, int _multiplierAmt, bool _isMultiplier)
 {
     isMultiplier = false;
     nextName     = _moveName;
     nextMove     = _nextMove;
     nextIntent   = _intent;
     nextDamage   = _baseDamage;
     monster      = _monster;
     multiplier   = _multiplierAmt;
     isMultiplier = _isMultiplier;
 }
Ejemplo n.º 15
0
    public ReviveMonsterAction(AbstractMonster _target, AbstractCreature _source, bool _isHealEffect)
    {
        isHealingEffect = false;
        SetValues(_target, _source, 0);
        GameActionType = ActionType.Special;
        if (AbstractDungeon.Player.HasRelic("Philosopher'sStone"))
        {
            _target.AddPower(new StrengthPower(_target, 2));
        }

        isHealingEffect = _isHealEffect;
    }
Ejemplo n.º 16
0
 public bool IsCardPlayable(AbstractMonster _monster)
 {
     if ((Target != CardTarget.Enemy && Target != CardTarget.SelfAndEnemy || _monster == null || !_monster.IsDying) && !AbstractDungeon.GetMonsters().AreMonstersBasicallyDead())
     {
         return(true);
     }
     else
     {
         CantUseMessage = null;
         return(false);
     }
 }
Ejemplo n.º 17
0
    public AbstractMonster GetMonster(string _id)
    {
        AbstractMonster tMonster = null;

        for (int i = 0; i < Monsters.Count; i++)
        {
            if (Monsters[i].Id == _id)
            {
                tMonster = Monsters[i];
            }
        }
        return(tMonster);
    }
Ejemplo n.º 18
0
 protected bool IsDeadOrEscaped(AbstractCreature _target)
 {
     if (!_target.IsDying && !_target.HalfDead)
     {
         if (!_target.IsPlayer)
         {
             AbstractMonster tAbstractMonster = (AbstractMonster)_target;
             if (tAbstractMonster.IsEscaping)
             {
                 return(true);
             }
         }
         return(false);
     }
     return(true);
 }
Ejemplo n.º 19
0
    public void Use(AbstractPlayer _player, AbstractMonster _monster)
    {
        bool          tIsPowerExist = false;
        AbstractPower tPower;

        for (int i = 0; i < _player.powers.Count; i++)
        {
            tPower = _player.powers[i];
            if (tPower.ID.Equals("Barricade"))
            {
                tIsPowerExist = true;
                break;
            }
        }

        if (!tIsPowerExist)
        {
            AbstractDungeon.ActionManager.AddToBottom(new ApplyPowerAction(_player, _player, new BarricadePower(_player)));
        }
    }
Ejemplo n.º 20
0
        public void Attack(int x, int y)
        {
            int yPos = Game.PlayerRef.Position.Y + y;
            int xPos = Game.PlayerRef.Position.X + x;

            int      oldPlayerPosX = int.Parse(Game.PlayerRef.Position.X.ToString());
            int      oldPlayerPosY = int.Parse(Game.PlayerRef.Position.Y.ToString());
            Position previousPos   = new Position(oldPlayerPosX, oldPlayerPosY);


            if (Map.MapTiles[yPos][xPos] is EmptySpaceTile)
            {
                return;
            }
            else if (Map.MapTiles[yPos][xPos] is WallTile)
            {
                Map.MapTiles[yPos][xPos] = new EmptySpaceTile();
                Game.PlayerRef.Score    += 1;
            }
            else if (Map.MapTiles[yPos][xPos] is AbstractMonster)
            {
                AbstractMonster monster   = null;
                Position        attackPos = Game.PlayerRef.Position + new Position(x, y);
                monster = AbstractMonster.Monsters.Find(item => item.Position == attackPos);
                if (monster != null)
                {
                    Game.PlayerRef.Attack(attackPos);
                }
                MonsterAttackOnPlayerProximity(yPos, xPos);
            }
            else
            {
                return;
            }

            PlayerAttacked?.Invoke(new Position(xPos, yPos));
        }
Ejemplo n.º 21
0
    public bool IsCanUse(AbstractPlayer _player, AbstractMonster _monster)
    {
        bool tIsCanUse = base.IsCanUse(_player, _monster);

        if (!tIsCanUse)
        {
            return(false);
        }
        else
        {
            AbstractCard tCard;
            for (int i = 0; i < _player.Hand.Group.Count; i++)
            {
                tCard = _player.Hand.Group[i];
                if (tCard.Type != CardType.Attack)
                {
                    tIsCanUse      = false;
                    CantUseMessage = ExtendedDescription[0];
                }
            }

            return(tIsCanUse);
        }
    }
Ejemplo n.º 22
0
 public void OnPlayCard(AbstractCard _card, AbstractMonster _monster)
 {
 }
Ejemplo n.º 23
0
 public void OnMonsterDeath(AbstractMonster _monster)
 {
 }
Ejemplo n.º 24
0
 public void Use(AbstractPlayer _player, AbstractMonster _monster)
 {
     AbstractDungeon.ActionManager.AddToBottom(new ApplyPowerAction(_player, _player, new FeelNoPainPower(_player, MagicNumber), MagicNumber));
 }
Ejemplo n.º 25
0
 public void Use(AbstractPlayer _player, AbstractMonster _monster)
 {
     //AbstractDungeon.ActionManager.AddToBottom(new );
     AbstractDungeon.ActionManager.AddToBottom(new DamageAllEnemiesAction(_player, MultiDamage, DamageTypeForTurn, AttackEffect.None));
 }
Ejemplo n.º 26
0
 public void Use(AbstractPlayer _player, AbstractMonster _monster)
 {
     AbstractDungeon.ActionManager.AddToBottom(new GainEnergyAction(MagicNumber));
     AbstractDungeon.ActionManager.AddToBottom(new LoseHPAction(_player, _player, 3));
 }
Ejemplo n.º 27
0
        private void MonsterAttackOnPlayerProximity(int y, int x)
        {
            Position[] positionsToCheck = new Position[]
            {
                new Position(-1, -1),       // strong
                new Position(1, 1),         // strong
                new Position(1, -1),        // strong
                new Position(-1, 1),        // strong
                new Position(-1, 0),
                new Position(0, -1),
                new Position(0, 1),
                new Position(1, 0),
            };

            AbstractMonster monster = null;

            foreach (Position p in positionsToCheck)
            {
                try
                {
                    monster = AbstractMonster.Monsters.Find(m => m.Position + p == Game.PlayerRef.Position);
                    if (monster != null)
                    {
                        break;
                    }
                }
                catch (ArgumentNullException e)
                {
                    ErrorDisplayService.ShowError(e);
                    return;
                }
            }

            if (monster == null)
            {
                return;
            }

            if (monster is MonsterMediumTile || monster is MonsterWeakTile)
            {
                if (monster.Position + positionsToCheck[0] == Game.PlayerRef.Position ||
                    monster.Position + positionsToCheck[1] == Game.PlayerRef.Position ||
                    monster.Position + positionsToCheck[2] == Game.PlayerRef.Position ||
                    monster.Position + positionsToCheck[3] == Game.PlayerRef.Position)
                {
                    return;
                }
            }

            int monsterDamage = monster.Power;

            // weak = 25% chance     -||    range is {0,1,2,3}  ]
            // medium = 33% chance   -||    range is {0,1,2}    ]---- condition is only true for 0
            // strong = 50% chance   -\/    range is {0,1}      ]
            int    damage      = new Random().Next(0, Constants.MosterDamageChanceProbablitor - monsterDamage);
            string monsterType = monster is MonsterWeakTile ? "Weak" : monster is MonsterMediumTile ? "Medium" : "Strong";

            if (damage % Constants.MosterDamageChanceProbablitor == 0)
            {
                GameMessage.SendMessage($"ATTACKED! : {monsterType} monster hit you and\ncaused {monsterDamage} damage to You!");
                Game.PlayerRef.ApplyDamage(monsterDamage);
            }
        }
Ejemplo n.º 28
0
 public static void OnMonsterDied(AbstractMonster monster)
 {
     QuestItemInteracted?.Invoke(monster);
 }
Ejemplo n.º 29
0
 public SuicideAction(AbstractMonster _target) : this(_target, true)
 {
 }
Ejemplo n.º 30
0
 public static AbstractMonster GetRandomMonster(AbstractMonster _expect)
 {
     return(CurMapNode.Room.Monsters.GetRandomMonster(_expect, true));
 }
Ejemplo n.º 31
0
 public SuicideAction(AbstractMonster _target, bool _isRelicTrigger)
 {
     GameActionType = ActionType.Damage;
     monster        = _target;
     isRelicTrigger = _isRelicTrigger;
 }