Пример #1
0
        public override void Execute(Player player, Entity entity, Coordinate targetCoordinate, Entity target)
        {
            base.Execute(player, entity, targetCoordinate, target);

            DropAction dropAction = entity.GetAction <DropAction>();

            dropAction.entityToDrop = target;
            mapController.RemoveFromMap(target);
        }
Пример #2
0
        public override bool CanExecute(Player player, Entity entity, Coordinate targetCoordinate, Entity target)
        {
            MapTile    mapTile    = mapController.GetMapTileAtCoordinate(targetCoordinate);
            DropAction dropAction = entity.GetAction <DropAction>();

            return(base.CanExecute(player, entity, targetCoordinate, target) &&
                   dropAction != null &&
                   dropAction.entityToDrop == null &&
                   mapTile.entities.Count > 0 &&
                   player.GetEntity(mapTile.entities[0].Id) != null &&
                   rescuableClasses.Contains(mapTile.entities[0].Type.EntityClass));
        }