Exemplo n.º 1
0
 public MountActor(GameRolePlayMountInformations informations, Map map)
 {
     Id = informations.contextualId;
     Look = informations.look;
     Map = map;
     Update(informations.disposition);
 }
Exemplo n.º 2
0
        public Cell[] GetCells(Cell centerCell, Map map)
        {
            var result = new List<Cell>();

            if (Radius == 0)
            {
                if (MinRadius == 0 && !DiagonalFree)
                    result.Add(centerCell);

                return result.ToArray();
            }

            int x = (int)( centerCell.X - Radius );
            int y;
            while (x <= centerCell.X + Radius)
            {
                y = (int) (centerCell.Y - Radius);
                while (y <= centerCell.Y - Radius)
                {
                    if (MinRadius == 0 || Math.Abs(centerCell.X - x) + Math.Abs(centerCell.Y - y) >= MinRadius)
                        if (!DiagonalFree || Math.Abs(centerCell.X - x) != Math.Abs(centerCell.Y - y))
                             AddCellIfValid(x, y, map, result);

                    y++;
                }

                x++;
            }

            return result.ToArray();
        }
Exemplo n.º 3
0
 public TaxCollector(GameRolePlayTaxCollectorInformations informations, Map map)
 {
     Id = informations.contextualId;
     Look = informations.look;
     Map = map;
     Update(informations.disposition);
 }
Exemplo n.º 4
0
        public Cell[] GetCells(Cell centerCell, Map map)
        {
            var result = new List<Cell>();

            if (MinRadius == 0)
                result.Add(centerCell);

            for (int i = 1; i <= Radius; i++)
            {
                switch (Direction)
                {
                    case DirectionsEnum.DIRECTION_NORTH_WEST:
                        AddCellIfValid(centerCell.X + i, centerCell.Y + i, map, result);
                        AddCellIfValid(centerCell.X + i, centerCell.Y - i, map, result);
                        break;

                    case DirectionsEnum.DIRECTION_NORTH_EAST:
                        AddCellIfValid(centerCell.X - i, centerCell.Y - i, map, result);
                        AddCellIfValid(centerCell.X + i, centerCell.Y - i, map, result);
                        break;

                    case DirectionsEnum.DIRECTION_SOUTH_EAST:
                        AddCellIfValid(centerCell.X - i, centerCell.Y + i, map, result);
                        AddCellIfValid(centerCell.X - i, centerCell.Y - i, map, result);
                        break;

                    case DirectionsEnum.DIRECTION_SOUTH_WEST:
                        AddCellIfValid(centerCell.X - i, centerCell.Y + i, map, result);
                        AddCellIfValid(centerCell.X + i, centerCell.Y + i, map, result);
                        break;
                }
            }

            return result.ToArray();
        }
Exemplo n.º 5
0
 public Prism(GameRolePlayPrismInformations informations, Map map)
 {
     Id = informations.contextualId;
     Look = informations.look;
     Map = map;
     Update(informations.disposition);
 }
Exemplo n.º 6
0
        public ObjectPosition(Map map, Cell cell, DirectionsEnum direction)
        {
            if (map == null) throw new ArgumentNullException("map");
            if (cell == null) throw new ArgumentNullException("cell");

            Map = map;
            Cell = cell;
            Direction = direction;
        }
Exemplo n.º 7
0
 public Cell(Map map, DlmCellData cell)
 {
     Map = map;
     Id = cell.Id;
     Floor = cell.Floor;
     LosMov = cell.LosMov;
     MapChangeData = cell.MapChangeData;
     MoveZone = cell.MoveZone;
     Speed = cell.Speed;
 }
Exemplo n.º 8
0
        public ObjectPosition(Map map, EntityDispositionInformations disposition)
            : this(map, map.Cells[disposition.cellId], (DirectionsEnum) disposition.direction)
        {
            if (map == null) throw new ArgumentNullException("map");
            if (disposition == null) throw new ArgumentNullException("disposition");

            Map = map;
            Cell = map.Cells[disposition.cellId];
            Direction = (DirectionsEnum)disposition.direction;
        }
Exemplo n.º 9
0
 public MonsterFighter(GameFightMonsterInformations msg, Map map, Fight fight)
 {
     Id = msg.contextualId;
     Fight = fight;
     Look = msg.look;
     Position = new ObjectPosition(map, msg.disposition);
     Team = fight.GetTeam((FightTeamColor) msg.teamId);
     IsAlive = msg.alive;
     MonsterTemplate = DataProvider.Instance.Get<Monster>(msg.creatureGenericId);
     MonsterGrade = MonsterTemplate.grades[msg.creatureGrade];
 }
Exemplo n.º 10
0
 public CharacterFighter(GameFightCharacterInformations msg, Map map, Fight fight)
 {
     Id = msg.contextualId;
     Fight = fight;
     Look = msg.look;
     Position = new ObjectPosition(map, msg.disposition);
     Team = fight.GetTeam((FightTeamColor) msg.teamId);
     IsAlive = msg.alive;
     Alignment = new AlignmentInformations(msg.alignmentInfos);
     Breed = DataProvider.Instance.Get<Breed>(msg.breed);
 }
Exemplo n.º 11
0
        public Character(GameRolePlayCharacterInformations characterInformations, Map map)
            : base(characterInformations.humanoidInfo)
        {
            if (characterInformations == null) throw new ArgumentNullException("characterInformations");
            if (map == null) throw new ArgumentNullException("map");

            // do not care about this warnings, this ctor is never called by his inheriter
            Id = characterInformations.contextualId;
            Look = characterInformations.look;
            Position = new ObjectPosition(map, characterInformations.disposition);
            Name = characterInformations.name;
            Alignement = new AlignmentInformations(characterInformations.alignmentInfos);
        }
Exemplo n.º 12
0
        public GroupMonster(GameRolePlayGroupMonsterInformations gameRolePlayGroupMonsterInformations, Map map)
        {
            Id = gameRolePlayGroupMonsterInformations.contextualId;
            Look = gameRolePlayGroupMonsterInformations.look;
            Position = new ObjectPosition(map, gameRolePlayGroupMonsterInformations.disposition);

            // Gets monsters infos.
            List<Monster> monsters = new List<Monster>();
            // Main monster.
            monsters.Add(new Monster(gameRolePlayGroupMonsterInformations.staticInfos.mainCreatureLightInfos.creatureGenericId));
            // Other monsters of the group.
            monsters.AddRange(gameRolePlayGroupMonsterInformations.staticInfos.underlings.Select(entry => new Monster(entry.creatureGenericId)));
            m_monsters = monsters.ToArray();
        }
Exemplo n.º 13
0
        public InteractiveObject(Map map, InteractiveElement interactive)
        {
            if (map == null) throw new ArgumentNullException("map");
            if (interactive == null) throw new ArgumentNullException("interactive");
            Id = interactive.elementId;
            Type = interactive.elementTypeId > 0 ? ObjectDataManager.Instance.Get<Interactive>(interactive.elementTypeId) : null;

            Map = map;

            m_enabledSkills = new ObservableCollectionMT<InteractiveSkill>(interactive.enabledSkills.Select(x => new InteractiveSkill(this, x)));
            m_readOnlyEnabledSkills = new ReadOnlyObservableCollectionMT<InteractiveSkill>(m_enabledSkills);

            m_disabledSkills = new ObservableCollectionMT<InteractiveSkill>(interactive.disabledSkills.Select(x => new InteractiveSkill(this, x)));
            m_readOnlyDisabledSkills = new ReadOnlyObservableCollectionMT<InteractiveSkill>(m_disabledSkills);
        }
Exemplo n.º 14
0
        public GroupMonster(GameRolePlayGroupMonsterInformations informations, Map map)
        {
            Id = informations.contextualId;
            Look = informations.look;
            Position = new ObjectPosition(map, informations.disposition);
            AgeBonus = informations.ageBonus;
            LootShare = informations.lootShare;
            AlignmentSide = informations.alignmentSide;
            KeyRingBonus = informations.keyRingBonus;

            // Gets monsters infos.
            var monsters = new List<Monster>();
            // Main monster, his look correspond to the group monster look
            monsters.Add(Leader = new Monster(informations.staticInfos.mainCreatureLightInfos, informations.look));
            // Other monsters of the group.
            monsters.AddRange(informations.staticInfos.underlings.Select(entry => new Monster(entry)));
            m_monsters = monsters.ToArray();
        }
Exemplo n.º 15
0
        public Cell[] GetCells(Cell centerCell, Map map)
        {
            var result = new List<Cell>();

            if (Radius == 0)
            {
                if (MinRadius == 0)
                    result.Add(centerCell);

                return result.ToArray();
            }

            int x = (int) (centerCell.X - Radius);
            int y = 0;
            int i = 0;
            int j = 1;
            while (x <= centerCell.X + Radius)
            {
                y = -i;

                while (y <= i)
                {
                    if (MinRadius == 0 || Math.Abs(centerCell.X - x) + Math.Abs(y) >= MinRadius)
                        AddCellIfValid(x, y + centerCell.Y, map, result);

                    y++;
                }

                if (i == Radius)
                {
                    j = -j;
                }

                i = i + j;
                x++;
            }

            return result.ToArray();
        }
Exemplo n.º 16
0
        public Cell[] GetCells(Cell centerCell, Map map)
        {
            var result = new List<Cell>();

            if (MinRadius == 0)
                result.Add(centerCell);

            List<DirectionsEnum> disabledDirections = DisabledDirections.ToList();
            if (OnlyPerpendicular)
            {
                switch (Direction)
                {
                    case DirectionsEnum.DIRECTION_SOUTH_EAST:
                    case DirectionsEnum.DIRECTION_NORTH_WEST:
                        {
                            disabledDirections.Add(DirectionsEnum.DIRECTION_SOUTH_EAST);
                            disabledDirections.Add(DirectionsEnum.DIRECTION_NORTH_WEST);
                            break;
                        }
                    case DirectionsEnum.DIRECTION_NORTH_EAST:
                    case DirectionsEnum.DIRECTION_SOUTH_WEST:
                        {
                            disabledDirections.Add(DirectionsEnum.DIRECTION_NORTH_EAST);
                            disabledDirections.Add(DirectionsEnum.DIRECTION_SOUTH_WEST);
                            break;
                        }
                    case DirectionsEnum.DIRECTION_SOUTH:
                    case DirectionsEnum.DIRECTION_NORTH:
                        {
                            disabledDirections.Add(DirectionsEnum.DIRECTION_SOUTH);
                            disabledDirections.Add(DirectionsEnum.DIRECTION_NORTH);
                            break;
                        }
                    case DirectionsEnum.DIRECTION_EAST:
                    case DirectionsEnum.DIRECTION_WEST:
                        {
                            disabledDirections.Add(DirectionsEnum.DIRECTION_EAST);
                            disabledDirections.Add(DirectionsEnum.DIRECTION_WEST);
                            break;
                        }
                }
            }

            for (var i = (int) Radius; i > 0; i--)
            {
                if (i < MinRadius)
                    continue;

                if (!Diagonal)
                {
                    if (!disabledDirections.Contains(DirectionsEnum.DIRECTION_SOUTH_EAST))
                        AddCellIfValid(centerCell.X + i, centerCell.Y, map, result);
                    if (!disabledDirections.Contains(DirectionsEnum.DIRECTION_NORTH_WEST))
                        AddCellIfValid(centerCell.X - i, centerCell.Y, map, result);
                    if (!disabledDirections.Contains(DirectionsEnum.DIRECTION_NORTH_EAST))
                        AddCellIfValid(centerCell.X, centerCell.Y + i, map, result);
                    if (!disabledDirections.Contains(DirectionsEnum.DIRECTION_SOUTH_WEST))
                        AddCellIfValid(centerCell.X, centerCell.Y - i, map, result);
                }

                if (Diagonal || AllDirections)
                {
                    if (!disabledDirections.Contains(DirectionsEnum.DIRECTION_SOUTH))
                        AddCellIfValid(centerCell.X + i, centerCell.Y - i, map, result);
                    if (!disabledDirections.Contains(DirectionsEnum.DIRECTION_NORTH))
                        AddCellIfValid(centerCell.X - i, centerCell.Y + i, map, result);
                    if (!disabledDirections.Contains(DirectionsEnum.DIRECTION_EAST))
                        AddCellIfValid(centerCell.X + i, centerCell.Y + i, map, result);
                    if (!disabledDirections.Contains(DirectionsEnum.DIRECTION_WEST))
                        AddCellIfValid(centerCell.X - i, centerCell.Y - i, map, result);
                }
            }

            return result.ToArray();
        }
Exemplo n.º 17
0
 public MountActor(GameRolePlayMountInformations informations, Map map)
 {
     Id = informations.contextualId;
     Look = informations.look;
     Position = new ObjectPosition(map, informations.disposition);
 }
Exemplo n.º 18
0
        public Cell[] GetCells(Cell centerCell, Map map)
        {
            var result = new List<Cell>();

            if (Radius == 0)
            {
                if (MinRadius == 0)
                    result.Add(centerCell);

                return result.ToArray();
            }

            int i = 0;
            int j = 1;
            int y = 0;
            int x = 0;
            switch (Direction)
            {
                case DirectionsEnum.DIRECTION_NORTH_WEST:
                    x = centerCell.X;
                    while (x >= centerCell.X - Radius)
                    {
                        y = -i;
                        while (y <= i)
                        {
                            if (MinRadius == 0 || Math.Abs(centerCell.X - x) + Math.Abs(y) >= MinRadius)
                                AddCellIfValid(x, y + centerCell.Y, map, result);

                            y++;
                        }
                        i = i + j;
                        x--;
                    }
                    break;
                case DirectionsEnum.DIRECTION_SOUTH_WEST:
                    y = centerCell.Y;
                    while (y >= centerCell.Y - Radius)
                    {
                        x = -i;
                        while (x <= i)
                        {
                            if (MinRadius == 0 || Math.Abs(x) + Math.Abs(centerCell.Y - y) >= MinRadius)
                                AddCellIfValid(x + centerCell.X, y, map, result);

                            x++;
                        }
                        i = i + j;
                        y--;
                    }
                    break;
                case DirectionsEnum.DIRECTION_SOUTH_EAST:
                    x = centerCell.X;
                    while (x <= centerCell.X + Radius)
                    {
                        y = -i;
                        while (y <= i)
                        {
                            if (MinRadius == 0 || Math.Abs(centerCell.X - x) + Math.Abs(y) >= MinRadius)
                                AddCellIfValid(x, y + centerCell.Y, map, result);

                            y++;
                        }
                        i = i + j;
                        x++;
                    }
                    break;
                case DirectionsEnum.DIRECTION_NORTH_EAST:
                    y = centerCell.Y;
                    while (y <= centerCell.Y - Radius)
                    {
                        x = -i;
                        while (x <= i)
                        {
                            if (MinRadius == 0 || Math.Abs(x) + Math.Abs(centerCell.Y - y) >= MinRadius)
                                AddCellIfValid(x + centerCell.X, y, map, result);

                            x++;
                        }
                        i = i + j;
                        y++;
                    }
                    break;

            }

            return result.ToArray();
        }
Exemplo n.º 19
0
 public Npc(GameRolePlayNpcInformations gameRolePlayNpcWithQuestInformations, Map map)
 {
 }
Exemplo n.º 20
0
 public SummonedFighter(GameFightMonsterInformations msg, Map map, Fight fight)
     : base(msg, map, fight)
 {
 }
Exemplo n.º 21
0
 private void OnMapJoined(PlayedCharacter character, Map map)
 {
     m_checkTimer = character.Bot.CallPeriodically(4 * 1000, CheckMonsters);
 }
Exemplo n.º 22
0
 private void OnMapJoined(Map map)
 {
     MapJoinedHandler handler = MapJoined;
     if (handler != null) handler(this, map);
 }
Exemplo n.º 23
0
 public MapCellInformationProvider(Map map)
 {
     m_map = map;
 }
Exemplo n.º 24
0
 public Merchant(GameRolePlayMerchantInformations gameRolePlayMerchantWithGuildInformations, Map map)
 {
 }
Exemplo n.º 25
0
        private static void AddCellIfValid(int x, int y, Map map, IList<Cell> container)
        {
            if (!Cell.IsInMap(x, y))
                return;

            container.Add(map.Cells[x, y]);
        }
Exemplo n.º 26
0
 public Cell[] GetCells(Cell centerCell, Map map)
 {
     return new [] {centerCell};
 }
Exemplo n.º 27
0
 public Mutant(GameRolePlayMutantInformations gameRolePlayMutantInformations, Map map)
 {
 }
Exemplo n.º 28
0
 public Cell[] GetCells(Cell centerCell, Map map)
 {
     return m_shape.GetCells(centerCell, map);
 }
Exemplo n.º 29
0
        public void EnterMap(Map map)
        {
            Map = map;
            Context = map;

            Bot.AddFrame(new RolePlayHandler(Bot));
            OnMapJoined(map);
        }
Exemplo n.º 30
0
 public Prism(GameRolePlayPrismInformations informations, Map map)
 {
     Id = informations.contextualId;
     Look = informations.look;
     Position = new ObjectPosition(map, informations.disposition);
 }