Exemplo n.º 1
0
        // @@@ TODO: 'rules' is placeholder.  Either implement Rules differently (maybe a GameRule class)
        //           or use actual code for their effects in the individual classes! (Karak would prefer)

        /// <summary>Initializes a new instance of the <see cref="Talent"/> class.</summary>
        /// <param name="name">The name.</param>
        /// <param name="description">The description.</param>
        /// <param name="talentType">Type of the talent.</param>
        /// <param name="rules">The rules.</param>
        public Talent(string name, string description, TalentType talentType, params string[] rules)
        {
            this.Name        = name;
            this.Description = description;
            this.TalentType  = talentType;
            this.Rules       = rules.ToList();
        }
Exemplo n.º 2
0
 /// <summary>Initializes a new instance of the <see cref="Talent"/> class.</summary>
 /// <param name="name">The name.</param>
 /// <param name="description">The description.</param>
 /// <param name="talentType">Type of the talent.</param>
 /// <param name="parent">The parent.</param>
 /// <param name="rules">The rules.</param>
 public Talent(string name, string description, TalentType talentType, Thing parent, params string[] rules)
 {
     Name        = name;
     Description = description;
     TalentType  = talentType;
     Rules       = rules.ToList();
     PlayerThing = parent;
 }
Exemplo n.º 3
0
 public override void Read(XmlNode item)
 {
     id           = GetInt(item, "id");
     buff         = GetString(item, "buff");
     introduction = GetString(item, "introduction");
     talentName   = GetString(item, "talentName");
     num          = GetInt(item, "num");
     type         = (TalentType)GetInt(item, "type");
 }
Exemplo n.º 4
0
 public Talent(string name, TalentType type, Aspect primaryAspect, Aspect secondaryAspect = Aspect.None, bool savoir = false)
 {
     Level = 0;
     _name = name;
     _primaryAspect = primaryAspect;
     _secondaryAspect = secondaryAspect;
     _type = type;
     _savoir = savoir;
 }
Exemplo n.º 5
0
        private int TryGetId(TalentType expectedType)
        {
            if (Type != expectedType)
            {
                throw new Exception($"Expected talent to be {expectedType}, but it is {Type}!");
            }

            return(NWScript.GetIdFromTalent(this));
        }
Exemplo n.º 6
0
        public override void HandleMessage(Yupi.Model.Domain.Habbo session, Yupi.Protocol.Buffers.ClientMessage message,
                                           Yupi.Protocol.IRouter router)
        {
            string     trackType = message.GetString();
            TalentType talentType;

            if (TalentType.TryParse(trackType, out talentType))
            {
                List <Talent> talents = TalentRepository.FilterBy(x => x.Type == talentType).ToList();

                router.GetComposer <TalentsTrackMessageComposer>().Compose(session, talentType, talents);
            }
        }
Exemplo n.º 7
0
        public TalentCard GetEquipedTalent(TalentType talent_type)
        {
            TalentCard card = null;

            for (int i = 0; i < (int)EquipSlot.kMax; i++)
            {
                if (m_EquipTalents.TryGetValue((EquipSlot)i, out card))
                {
                    if (card.GetTalentType() == talent_type)
                    {
                        return(card);
                    }
                }
            }
            return(null);
        }
        public void ConstructorParametersTest(TalentType type, Aspect primary, Aspect secondary)
        {
            Talent talent;
            if (secondary == Aspect.None)
                talent = new Talent("Test",
                    type,
                    primary);
            else
            {
                talent = new Talent("Test",
                    type,
                    primary,
                    secondary);
            }

            Assert.Equal("Test", talent.Name);
            Assert.Equal(type, talent.Type);
            Assert.Equal(primary, talent.PrimaryAspect);
            Assert.Equal(secondary, talent.SecondaryAspect);
        }
Exemplo n.º 9
0
        // TODO: Talents and such should not make permanent modifications to base stats. This is being redesigned.
        //       Perhaps we will end up with a system to register class instances to an Active Modifiers list, to
        //       all get called on for turning a "base" value into "current" value any time we're about to use it.
        //       See: https://github.com/DavidRieman/WheelMUD/discussions/31 for starters.

        /// <summary>Initializes a new instance of the <see cref="Talent"/> class.</summary>
        /// <param name="name">The name.</param>
        /// <param name="description">The description.</param>
        /// <param name="talentType">Type of the talent.</param>
        public Talent(string name, string description, TalentType talentType)
        {
            this.Name        = name;
            this.Description = description;
            this.TalentType  = talentType;
        }
Exemplo n.º 10
0
        // TODO: Talents and such should not make permanent modifications to base stats. This is being redesigned.
        //       Perhaps we will end up with a system to register class instances to an Active Modifiers list, to
        //       all get called on for turning a "base" value into "current" value any time we're about to use it.
        //       See: https://github.com/DavidRieman/WheelMUD/discussions/31 for starters.

        /// <summary>Initializes a new instance of the <see cref="Talent"/> class.</summary>
        /// <param name="name">The name.</param>
        /// <param name="description">The description.</param>
        /// <param name="talentType">Type of the talent.</param>
        public Talent(string name, string description, TalentType talentType)
        {
            Name        = name;
            Description = description;
            TalentType  = talentType;
        }
Exemplo n.º 11
0
 public TalentCard(TalentType talent_type)
 {
     m_TalentType       = talent_type;
     m_TalentAttributes = new TalentAttribute[(int)TalentPhase.kMax];
 }
Exemplo n.º 12
0
 public AuroraTalent(AuroraObject owner, int id, TalentType talentType)
 {
     this.owner      = owner;
     this.id         = id;
     this.talentType = talentType;
 }
Exemplo n.º 13
0
 public override void Compose(Yupi.Protocol.ISender session, TalentType trackType, IList <Talent> talents)
 {
     // Do nothing by default.
 }
Exemplo n.º 14
0
 public bool LevelIsCompleted(UserInfo user, TalentType trackType, int talentLevel)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 15
0
        public override void Compose(Yupi.Protocol.ISender session, TalentType trackType, IList <Talent> talents)
        {
            using (ServerMessage message = Pool.GetMessageBuffer(Id))
            {
                message.AppendString(trackType.DisplayName);
                message.AppendInteger(talents.Count);

                int failLevel = -1;

                foreach (Talent current in talents)
                {
                    message.AppendInteger(current.Id);
                    int nm = failLevel == -1 ? 1 : 0; // TODO What does this mean?
                    message.AppendInteger(nm);

                    message.AppendInteger(current.Levels.Count);

                    foreach (TalentLevel child in current.Levels)
                    {
                        /*  UserAchievement achievment = child.Achievement;
                         *
                         *  int num;
                         *  // TODO Refactor What does num mean?!
                         *  if (failLevel != -1 && failLevel < child.Level) {
                         *      num = 0;
                         *  } else if (achievment == null) {
                         *      num = 1;
                         *  } else if (achievment.Level >=
                         *      child.AchievementLevel) {
                         *      num = 2;
                         *  } else {
                         *      num = 1;
                         *  }
                         *
                         *  message.AppendInteger (child.Achievement.Id);
                         *  message.AppendInteger (0); // TODO Magic constant
                         *
                         *  message.AppendString(child.Achievement.GroupName+child.Achievement.DefaultLevel);
                         *  message.AppendInteger(num);
                         *
                         *  message.AppendInteger(achievment != null ? achievment.Progress : 0);
                         *  message.AppendInteger(child.GetAchievement() == null ? 0
                         *      : child.GetAchievement().Levels[child.AchievementLevel].Requirement);
                         *
                         *  if (num != 2 && failLevel == -1)
                         *      failLevel = child.Level;
                         */
                    }

                    throw new NotImplementedException();

                    message.AppendInteger(0); // TODO Magic constant

                    message.AppendInteger(1); // Count
                    message.AppendString(""); // Prize name ( HABBO_CLUB_VIP_7_DAYS )
                    message.AppendInteger(0); // Prize value (7)
                }

                session.Send(message);
            }
        }