public Point ProcessStepOn(Point position, ICreatureObject target, Point initialTargetPosition) { var damage = RandomHelper.GetRandomValue(MinDamage, MaxDamage); target.Damage(position, damage, Element.Piercing); CurrentGame.Journal.Write(new DealDamageMessage(this, target, damage, Element.Piercing), target); return(position); }
public static MovementResult MoveCreature(ICreatureObject creature, Point startPoint, Direction direction, bool processStepReaction, bool changeDirection, bool avoidTraps) { if (changeDirection) { creature.Direction = direction; } var endPoint = Point.GetPointInDirection(startPoint, direction); return(MoveObject(creature, startPoint, endPoint, processStepReaction, avoidTraps)); }
public CodeSpell(ICreatureObject caster, string name, string code, int mana) : base(name) { Mana = mana; LightPower = DefaultLightLevel; remainingLightTime = null; lifeTime = 0; casterId = caster.Id; this.code = code; codeExecutor = new SpellCodeExecutor(caster.Id, code); animations = new AnimationsBatchManager(TimeSpan.FromMilliseconds(500), AnimationFrameStrategy.OneByOneStartFromRandom); }
public bool TryMove(ICreatureObject creature, Point position, Point targetPosition) { var possibleMoves = GetPossibleMoves(position, targetPosition); foreach (var possibleMove in possibleMoves) { var movementResult = MovementHelper.MoveCreature(creature, position, possibleMove, true, true, true); if (movementResult.Success) { return(true); } } return(false); }
public static MovementResult MoveCreature(ICreatureObject creature, Point startPoint, Point endPoint, bool processStepReaction, bool changeDirection, bool avoidTraps) { if (changeDirection) { var movementDirection = Point.GetAdjustedPointRelativeDirection(startPoint, endPoint); if (!movementDirection.HasValue) { throw new ApplicationException("Unable to determine movement direction."); } creature.Direction = movementDirection.Value; } return(MoveObject(creature, startPoint, endPoint, processStepReaction, avoidTraps)); }
public AttackDodgedMessage(ICreatureObject source, IDestroyableObject target) { this.source = source; this.target = target; }
public ShieldBlockedDamageMessage(ICreatureObject creature, int damage, Element element) { this.creature = creature; this.damage = damage; this.element = element; }
public CodeSpell CreateCodeSpell(ICreatureObject caster) { return(new CodeSpell(caster, Name, Code, ManaCost)); }