Пример #1
0
 static UtilsInitItem()
 {
     SkillUtils.Initialize();
     UtilsClipboard.Initialize();
     GlobalEvents.Initialize();
     CustomWorldGen.Initialize();
 }
Пример #2
0
 /// <summary>
 /// This Method should override the CreateLevelUpAction() Method of Skills that can be superskilled.
 /// Just place the Example code in the code of superskillable Skills.
 /// </summary>
 /// <example>
 /// <code>
 ///public override IAtomicAction CreateLevelUpAction(Player player)
 ///{
 ///    return SkillUtils.SuperSkillLevelUp(this, player);
 ///}
 /// </code>
 /// </example>
 /// <seealso cref="Skill.CreateLevelUpAction(Player)"/>
 /// <param name="skill"></param>
 /// <param name="player"></param>
 /// <returns></returns>
 public static IAtomicAction SuperSkillLevelUp(Skill skill, Player player)
 {
     if (skill.Level != 5)
     {
         return(SimpleAtomicAction.NoOp);
     }
     if (SkillUtils.SuperSkillCount(player.User) >= REYmodSettings.Obj.Config.Maxsuperskills)
     {
         return(new FailedAtomicAction(Localizer.Do("You already have enough SuperSkills " + SkillUtils.SuperSkillCount(player.User) + "/" + REYmodSettings.Obj.Config.Maxsuperskills)));
     }
     if (CheckSuperskillConfirmation(player.User))
     {
         superskillconfirmed.Remove(player.User.ID);
         return(SimpleAtomicAction.NoOp);
     }
     SkillUtils.ShowSuperSkillInfo(player);
     return(new FailedAtomicAction(Localizer.Do("You need to confirm first")));
 }
Пример #3
0
        /// <summary>
        /// Opens the Infobox about Superskills for the given <see cref="Player"/>
        /// </summary>
        /// <param name="player"></param>
        public static void ShowSuperSkillInfo(Player player)
        {
            string confirmation = "You already unlocked your next superskill";

            if (!CheckSuperskillConfirmation(player.User))
            {
                confirmation = "To confirm that you understood Super Skills and to unlock them please click " + new Button(x => ConfirmSuperskill(x.User), clickdesc: "Click to unlock", content: "HERE".Color("green"), singleuse: true).UILink();
            }
            player.OpenInfoPanel("Super Skills", "Current amount of Super Skills: <b><color=green>" + SkillUtils.SuperSkillCount(player.User) + "</color></b><br>Max amount of Super Skills: <b><color=green>" + ((REYmodSettings.Obj.Config.Maxsuperskills != int.MaxValue) ? REYmodSettings.Obj.Config.Maxsuperskills.ToString() : "Infinite") + "</color></b><br><br>Super Skills are Skills that can be leveled all the way up to level 10.<br><br><color=red>You can only have a limited amount of them.</color><br><br>" + confirmation);
        }