Esempio n. 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];
 }
 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);
 }
Esempio n. 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);
        }
Esempio n. 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();
        }
Esempio n. 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();
        }
Esempio n. 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);
        }
Esempio n. 7
0
 public Prism(GameRolePlayPrismInformations informations, Map map)
 {
     Id = informations.contextualId;
     Look = informations.look;
     Position = new ObjectPosition(map, informations.disposition);
 }
        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);
        }
Esempio n. 9
0
 public MountActor(GameRolePlayMountInformations informations, Map map)
 {
     Id = informations.contextualId;
     Look = informations.look;
     Position = new ObjectPosition(map, informations.disposition);
 }