Пример #1
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];
 }
Пример #2
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);
 }
Пример #3
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);
        }
Пример #4
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();
        }
Пример #5
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();
        }
Пример #6
0
        public virtual void NotifyStopMoving(bool canceled)
        {
            if (Movement == null)
                throw new InvalidOperationException("Entity was not moving");

            if (canceled)
            {
                Movement.Cancel();

                var element = Movement.TimedPath.GetCurrentElement();
                Position = new ObjectPosition(Map, element.CurrentCell, element.Direction);
            }
            else
                Position = MovementPath.EndPosition.Clone();

            var movement = Movement;
            Movement = null;

            var handler = StopMoving;
            if (handler != null) handler(this, movement, canceled);
        }
Пример #7
0
 public Prism(GameRolePlayPrismInformations informations, Map map)
 {
     Id = informations.contextualId;
     Look = informations.look;
     Position = new ObjectPosition(map, informations.disposition);
 }
Пример #8
0
        public void Update(GameRolePlayCharacterInformations msg)
        {
            if (msg == null) throw new ArgumentNullException("msg");
            Position = new ObjectPosition(Map, Map.Cells[msg.disposition.cellId], (DirectionsEnum) msg.disposition.direction);
            Update(msg.humanoidInfo);

            Name = msg.name;
            Look = msg.look;
            if (Alignement == null)
                Alignement = new AlignmentInformations(msg.alignmentInfos);
            else
                Alignement.Update(msg.alignmentInfos);
        }
Пример #9
0
 public MountActor(GameRolePlayMountInformations informations, Map map)
 {
     Id = informations.contextualId;
     Look = informations.look;
     Position = new ObjectPosition(map, informations.disposition);
 }