public MountActor(GameRolePlayMountInformations informations, Map map) { Id = informations.contextualId; Look = informations.look; Map = map; Update(informations.disposition); }
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(); }
public TaxCollector(GameRolePlayTaxCollectorInformations informations, Map map) { Id = informations.contextualId; Look = informations.look; Map = map; Update(informations.disposition); }
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(); }
public Prism(GameRolePlayPrismInformations informations, Map map) { Id = informations.contextualId; Look = informations.look; Map = map; Update(informations.disposition); }
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; }
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; }
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; }
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]; }
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); }
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); }
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(); }
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); }
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(); }
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(); }
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(); }
public MountActor(GameRolePlayMountInformations informations, Map map) { Id = informations.contextualId; Look = informations.look; Position = new ObjectPosition(map, informations.disposition); }
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(); }
public Npc(GameRolePlayNpcInformations gameRolePlayNpcWithQuestInformations, Map map) { }
public SummonedFighter(GameFightMonsterInformations msg, Map map, Fight fight) : base(msg, map, fight) { }
private void OnMapJoined(PlayedCharacter character, Map map) { m_checkTimer = character.Bot.CallPeriodically(4 * 1000, CheckMonsters); }
private void OnMapJoined(Map map) { MapJoinedHandler handler = MapJoined; if (handler != null) handler(this, map); }
public MapCellInformationProvider(Map map) { m_map = map; }
public Merchant(GameRolePlayMerchantInformations gameRolePlayMerchantWithGuildInformations, Map map) { }
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]); }
public Cell[] GetCells(Cell centerCell, Map map) { return new [] {centerCell}; }
public Mutant(GameRolePlayMutantInformations gameRolePlayMutantInformations, Map map) { }
public Cell[] GetCells(Cell centerCell, Map map) { return m_shape.GetCells(centerCell, map); }
public void EnterMap(Map map) { Map = map; Context = map; Bot.AddFrame(new RolePlayHandler(Bot)); OnMapJoined(map); }
public Prism(GameRolePlayPrismInformations informations, Map map) { Id = informations.contextualId; Look = informations.look; Position = new ObjectPosition(map, informations.disposition); }