public AbstractArena(AbstractPlayerCharacter PC, AbstractMonster enemy, AbstractEnvironment envi) { actionManager = new ActionManager(); PlayerCharacter = PC; Enemy = enemy; Environment = envi; }
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)); } }
public ShowMoveNameAction(AbstractMonster _source) { SetValues(_source, _source); msg = _source.MoveName; _source.MoveName = null; GameActionType = ActionType.Text; }
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")); } } }
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()); }
public void CalculateCardDamage(AbstractMonster _monster) { base.CalculateCardDamage(_monster); RawDescription = Description; RawDescription += UpgradeDescription; InitializeDescription(); }
public CardQueueItem(AbstractCard _card, AbstractMonster _monster, int _setEnergyOnUse) { EnergyOnUse = 0; Card = _card; Monster = _monster; EnergyOnUse = _setEnergyOnUse; }
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); }
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)); }
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(); }
public override bool Equals(AbstractMonster other) { if (this.MonsterName.Equals(other.MonsterName) && other.GetType() == this.GetType()) { return true; } else { return false; } }
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)); } }
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; }
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; }
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); } }
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); }
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); }
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))); } }
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)); }
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); } }
public void OnPlayCard(AbstractCard _card, AbstractMonster _monster) { }
public void OnMonsterDeath(AbstractMonster _monster) { }
public void Use(AbstractPlayer _player, AbstractMonster _monster) { AbstractDungeon.ActionManager.AddToBottom(new ApplyPowerAction(_player, _player, new FeelNoPainPower(_player, MagicNumber), MagicNumber)); }
public void Use(AbstractPlayer _player, AbstractMonster _monster) { //AbstractDungeon.ActionManager.AddToBottom(new ); AbstractDungeon.ActionManager.AddToBottom(new DamageAllEnemiesAction(_player, MultiDamage, DamageTypeForTurn, AttackEffect.None)); }
public void Use(AbstractPlayer _player, AbstractMonster _monster) { AbstractDungeon.ActionManager.AddToBottom(new GainEnergyAction(MagicNumber)); AbstractDungeon.ActionManager.AddToBottom(new LoseHPAction(_player, _player, 3)); }
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); } }
public static void OnMonsterDied(AbstractMonster monster) { QuestItemInteracted?.Invoke(monster); }
public SuicideAction(AbstractMonster _target) : this(_target, true) { }
public static AbstractMonster GetRandomMonster(AbstractMonster _expect) { return(CurMapNode.Room.Monsters.GetRandomMonster(_expect, true)); }
public SuicideAction(AbstractMonster _target, bool _isRelicTrigger) { GameActionType = ActionType.Damage; monster = _target; isRelicTrigger = _isRelicTrigger; }