Exemplo n.º 1
0
 private static bool Prefix(UnitProgressionData __instance, int experience)
 {
     if (!settings.toggleAllowMythicPets)
     {
         return(true);
     }
     if (experience < 1)
     {
         PFLog.Default.Error(string.Format("Current mythic level of {0} is {1}, trying to raise to {2}! Aborting", (object)__instance.Owner, (object)__instance.MythicLevel, (object)(__instance.MythicExperience + experience)));
     }
     else
     {
         __instance.MythicExperience += experience;
         if (__instance.MythicExperience > 10)
         {
             PFLog.Default.Error(string.Format("Current mythic level of {0} is {1}, trying to raise to {2}! Can't do this", (object)__instance.Owner, (object)__instance.MythicLevel, (object)(__instance.MythicExperience + experience)));
         }
         var pair = UnitPartDualCompanion.GetPair(__instance.Owner.Unit);
         if (pair != (UnitDescriptor)null)
         {
             pair.Descriptor.Progression.MythicExperience = __instance.MythicExperience;
         }
         EventBus.RaiseEvent <IUnitGainMythicExperienceHandler>((Action <IUnitGainMythicExperienceHandler>)(h => h.HandleUnitGainMythicExperience(__instance.Owner, experience)));
     }
     return(false);
 }
Exemplo n.º 2
0
        public static void InstantRest()
        {
            var escMode = false;

            if (Game.Instance.CurrentMode == GameModeType.EscMode)
            {
                escMode = true;
                Game.Instance.UI.EscManager.OnEscPressed();
                Game.Instance.PauseBind();
            }

            var partyMembers = Game.Instance?.Player.ControllableCharacters;

            foreach (var u in partyMembers)
            {
                ApplyInstantRest(u);
                var pair = UnitPartDualCompanion.GetPair(u);
                if (pair != null)
                {
                    ApplyInstantRest(pair);
                }
            }

            if (escMode)
            {
                Game.Instance.PauseBind();
                Game.Instance.UI.EscManager.OnEscPressed();
            }
        }