diff --git a/Config/TamingConfig.cs b/Config/TamingConfig.cs index 4c9246b..ddb05fc 100644 --- a/Config/TamingConfig.cs +++ b/Config/TamingConfig.cs @@ -35,9 +35,9 @@ public void Awake() if (EnableAllTamableCompatibility.Value) { //Boar - BoarLevelUnlock = base.Config.Bind("3. CreatureLevels: AllTamableCompatibility", "Boar Master Level", 0f, "The level at which you are a Master taming this creature. You tame the creature in 2 minutes time"); + BoarLevelUnlock = base.Config.Bind("3. CreatureLevels: AllTamableCompatibility", "Boar Master Level", 0f, "The level at which you know how to tame this creature."); BoarLevelTamer = base.Config.Bind("3. CreatureLevels: AllTamableCompatibility", "Boar Tamer Level", 5f, "The level at which you are good at taming this creature. Reduces the amount of time by half"); - BoarLevelMaster = base.Config.Bind("3. CreatureLevels: AllTamableCompatibility", "Boar Unlock Level", 15f, "The level at which you know how to tame this creature."); + BoarLevelMaster = base.Config.Bind("3. CreatureLevels: AllTamableCompatibility", "Boar Unlock Level", 15f, "The level at which you are a Master taming this creature. You tame the creature in 2 minutes time."); //Wolf WolfLevelUnlock = base.Config.Bind("3. CreatureLevels: AllTamableCompatibility", "Wolf Unlock Level", 10f, "The level at which you know how to tame this creature."); WolfLevelTamer = base.Config.Bind("3. CreatureLevels: AllTamableCompatibility", "Wolf Tamer Level", 20f, "The level at which you are good at taming this creature. Reduces the amount of time by half"); @@ -50,9 +50,9 @@ public void Awake() else { //Boar - BoarLevelUnlock = base.Config.Bind("3. CreatureLevels: Defaults", "Boar Master Level", 0f, "The level at which you are a Master taming this creature. You tame the creature in 2 minutes time"); + BoarLevelUnlock = base.Config.Bind("3. CreatureLevels: Defaults", "Boar Unlock Level", 0f, "The level at which you know how to tame this creature."); BoarLevelTamer = base.Config.Bind("3. CreatureLevels: Defaults", "Boar Tamer Level", 10f, "The level at which you are good at taming this creature. Reduces the amount of time by half"); - BoarLevelMaster = base.Config.Bind("3. CreatureLevels: Defaults", "Boar Unlock Level", 40f, "The level at which you know how to tame this creature."); + BoarLevelMaster = base.Config.Bind("3. CreatureLevels: Defaults", "Boar Master Level", 40f, "The level at which you are a Master taming this creature. You tame the creature in 2 minutes time."); //Wolf WolfLevelUnlock = base.Config.Bind("3. CreatureLevels: Defaults", "Wolf Unlock Level", 10f, "The level at which you know how to tame this creature."); WolfLevelTamer = base.Config.Bind("3. CreatureLevels: Defaults", "Wolf Tamer Level", 30f, "The level at which you are good at taming this creature. Reduces the amount of time by half"); diff --git a/ModSkills/NewSkills/Hunting.cs b/ModSkills/NewSkills/Hunting.cs index e582ba1..c72d2e7 100644 --- a/ModSkills/NewSkills/Hunting.cs +++ b/ModSkills/NewSkills/Hunting.cs @@ -69,9 +69,10 @@ public static void Postfix(ref CharacterDrop __instance) if (Chance) drop.m_chance = vChance + ((1 - vChance) * level); - Debug.Log("Updated mob: " + __instance.name.Replace("(Clone)", "") + " Level: " + __instance.m_character.GetLevel() + " Item: " + drop.m_prefab.name.Replace("(UnityEngine.GameObject)", "") + " Min: " + drop.m_amountMin + " Max: " + drop.m_amountMax + " Chance: " + drop.m_chance); + //Debug.Log("Updated mob: " + __instance.name.Replace("(Clone)", "") + " Level: " + __instance.m_character.GetLevel() + " Item: " + drop.m_prefab.name.Replace("(UnityEngine.GameObject)", "") + " Min: " + drop.m_amountMin + " Max: " + drop.m_amountMax + " Chance: " + drop.m_chance); } } + Debug.Log("[MoreSkills Hunting]: Updated mob's loot: " + __instance.name.Replace("(Clone)", "") + " Level: " + __instance.m_character.GetLevel()); } } } diff --git a/ModSkills/NewSkills/Taming.cs b/ModSkills/NewSkills/Taming.cs index 78a7477..fa6106f 100644 --- a/ModSkills/NewSkills/Taming.cs +++ b/ModSkills/NewSkills/Taming.cs @@ -4,6 +4,7 @@ using MoreSkills.Utility; using UnityEngine; using System.Linq; +using System; namespace MoreSkills.ModSkills.NewSkills { @@ -16,15 +17,30 @@ public static void Postfix(ref Tameable __instance) { if (MoreSkills_Instances._player != null) { + //Debug.LogWarning("Here 1"); //Debug.LogWarning("ZDOID ANTES: " + Creature1); - if (__instance.GetTameness() <= 10 && !__instance.m_character.IsTamed() && !__instance.m_character.IsPlayer()) + if (__instance.GetTameness() <= 5 && !__instance.m_character.IsTamed() && !__instance.m_character.IsPlayer()) { + Player closestPlayer = null; + ZDOID cPlayer = ZDOID.None; + //Debug.LogWarning("Here 2"); //Debug.LogWarning("Using Slot 1"); - Player closestPlayer = Player.GetClosestPlayer(__instance.transform.position, 30f); - if (closestPlayer.GetZDOID() == MoreSkills_Instances._player.GetZDOID()) + try { + closestPlayer = Player.GetClosestPlayer(__instance.transform.position, 30f); + cPlayer = closestPlayer.GetZDOID(); + } + catch (Exception) + { + closestPlayer = null; + cPlayer = ZDOID.None; + } + if (cPlayer == MoreSkills_Instances._player.GetZDOID()) + { + //Debug.LogWarning("Here 3"); if (MoreSkills_TamingConfig.EnableAllTamableCompatibility.Value) { + //Debug.LogWarning("Here 4"); string sCreature = __instance.name.Replace("(Clone)", ""); switch (__instance.name.Replace("(Clone)","")) { @@ -232,6 +248,7 @@ public static void Postfix(ref Tameable __instance) } else { + //Debug.LogWarning("Here 5"); string sCreature = __instance.name.Replace("(Clone)", ""); switch (__instance.name.Replace("(Clone)", "")) { @@ -253,6 +270,7 @@ public static void Postfix(ref Tameable __instance) } if (tLevels.Find(tLevel => tLevel.Creature == sCreature).Creature != sCreature) { + //Debug.LogWarning("Here 6"); Debug.Log("[MoreSkills]: Saved Taming Levels from : " + __instance.name.Replace("(Clone)", "") + " to the Temporal Database"); tLevels.Add(new Helper.TamingLevels( creature: sCreature, @@ -261,6 +279,7 @@ public static void Postfix(ref Tameable __instance) unlock: Unlocklvl1)); } } + //Debug.LogWarning("Here 7"); //Debug.LogWarning("Nivel Master: " + Masterlvl1); //Debug.LogWarning("Nivel Tamer: " + Tamerlvl1); //Debug.LogWarning("Nivel Unlock: " + Unlocklvl1); @@ -279,11 +298,14 @@ public static void Postfix(ref Tameable __instance) master: Master, tamer: Tamer, unlock: Unlock)); - Debug.Log("[MoreSkills]: You are now taming a " + (__instance.name.Replace("(Clone)", ""))); + //Debug.Log("[MoreSkills]: You are now taming a " + (__instance.name.Replace("(Clone)", ""))); + //Debug.LogWarning("Here 8"); + MoreSkills_Instances._player.Message(MessageHud.MessageType.Center, "You are now taming a " + (__instance.name.Replace("(Clone)", "")), 0, null); } else { - Debug.LogWarning("You are not the tamer, or was the closest one when he first ate or close enough"); + Debug.LogError("You are not the tamer, or was the closest one when he first ate or close enough"); + MoreSkills_Instances._player.Message(MessageHud.MessageType.TopLeft, "You are not the tamer, either you weren't the closest one when he first ate or close enough " + (__instance.name.Replace("(Clone)", "")) + "", 0, null); } } } @@ -393,6 +415,7 @@ public static void Postfix(ref Tameable __instance) gotfar: false)); //Debug.LogWarning("GotFar a: " + GotFar.GotFar); } + MoreSkills_Instances._player.Message(MessageHud.MessageType.TopLeft, "You are close to " + (__instance.name.Replace("(Clone)", "")) + " the tame time back to normal", 0, null); } } else @@ -403,6 +426,7 @@ public static void Postfix(ref Tameable __instance) { float grow = __instance.m_tamingTime * ((__instance.m_nview.GetZDO().GetFloat("TameTimeLeft") * 100) / (__instance.m_tamingTime / 2) / 100); __instance.m_nview.GetZDO().Set("TameTimeLeft", grow); + MoreSkills_Instances._player.Message(MessageHud.MessageType.TopLeft, "You are getting far from " + (__instance.name.Replace("(Clone)", "")) + " this will double the tame time...", 0, null); } tGotFar.Remove(GotFar); tGotFar.Add(new Helper.TamingGotFar( @@ -419,7 +443,7 @@ public static void Postfix(ref Tameable __instance) { __instance.m_tamingTime = tameTimeMath; - while (Fixed.Fixed == false) + if (Fixed.Fixed == false) { if (__instance.GetRemainingTime() != __instance.m_tamingTime) { @@ -449,6 +473,7 @@ public static void Postfix(ref Tameable __instance) gotfar: false)); //Debug.LogWarning("GotFar a: " + GotFar.GotFar); } + MoreSkills_Instances._player.Message(MessageHud.MessageType.TopLeft, "You are close to " + (__instance.name.Replace("(Clone)", "")) + " the tame time back to normal", 0, null); } } else @@ -459,6 +484,7 @@ public static void Postfix(ref Tameable __instance) { float grow = __instance.m_tamingTime * ((__instance.m_nview.GetZDO().GetFloat("TameTimeLeft") * 100) / (__instance.m_tamingTime / 2) / 100); __instance.m_nview.GetZDO().Set("TameTimeLeft", grow); + MoreSkills_Instances._player.Message(MessageHud.MessageType.TopLeft, "You are getting far from " + (__instance.name.Replace("(Clone)", "")) + " this will double the tame time...", 0, null); } tGotFar.Remove(GotFar); tGotFar.Add(new Helper.TamingGotFar( @@ -475,7 +501,7 @@ public static void Postfix(ref Tameable __instance) { __instance.m_tamingTime = tameTimeMath; - while (Fixed.Fixed == false) + if (Fixed.Fixed == false) { if (__instance.GetRemainingTime() != __instance.m_tamingTime) { @@ -483,12 +509,12 @@ public static void Postfix(ref Tameable __instance) } else { - Debug.LogWarning("Fixed b: " + Fixed.Fixed); + //Debug.LogWarning("Fixed b: " + Fixed.Fixed); tFixed.Remove(Fixed); tFixed.Add(new Helper.TamingFix( creaturezdoid: CreatureZDOID, tfixed: true)); - Debug.LogWarning("Fixed a: " + Fixed.Fixed); + //Debug.LogWarning("Fixed a: " + Fixed.Fixed); } } @@ -501,13 +527,14 @@ public static void Postfix(ref Tameable __instance) } else { - Debug.LogWarning("GotFar b: " + GotFar.GotFar); + //Debug.LogWarning("GotFar b: " + GotFar.GotFar); tGotFar.Remove(GotFar); tGotFar.Add(new Helper.TamingGotFar( creaturezdoid: CreatureZDOID, gotfar: false)); - Debug.LogWarning("GotFar a: " + GotFar.GotFar); + //Debug.LogWarning("GotFar a: " + GotFar.GotFar); } + MoreSkills_Instances._player.Message(MessageHud.MessageType.TopLeft, "You are close to " + (__instance.name.Replace("(Clone)", "")) + " the tame time back to normal", 0, null); } } else @@ -518,6 +545,7 @@ public static void Postfix(ref Tameable __instance) { float grow = __instance.m_tamingTime * ((__instance.m_nview.GetZDO().GetFloat("TameTimeLeft") * 100) / (__instance.m_tamingTime / 2) / 100); __instance.m_nview.GetZDO().Set("TameTimeLeft", grow); + MoreSkills_Instances._player.Message(MessageHud.MessageType.TopLeft, "You are getting far from " + (__instance.name.Replace("(Clone)", "")) + " this will double the tame time...", 0, null); } tGotFar.Remove(GotFar); tGotFar.Add(new Helper.TamingGotFar( @@ -534,7 +562,7 @@ public static void Postfix(ref Tameable __instance) { __instance.m_tamingTime = tameTimeMath; - while (Fixed.Fixed == false) + if (Fixed.Fixed == false) { if (__instance.GetRemainingTime() != __instance.m_tamingTime) { @@ -564,6 +592,7 @@ public static void Postfix(ref Tameable __instance) gotfar: false)); //Debug.LogWarning("GotFar a: " + GotFar.GotFar); } + MoreSkills_Instances._player.Message(MessageHud.MessageType.TopLeft, "You are close to " + (__instance.name.Replace("(Clone)", "")) + " the tame time back to normal", 0, null); } } else @@ -574,6 +603,7 @@ public static void Postfix(ref Tameable __instance) { float grow = __instance.m_tamingTime * ((__instance.m_nview.GetZDO().GetFloat("TameTimeLeft") * 100) / (__instance.m_tamingTime / 2) / 100); __instance.m_nview.GetZDO().Set("TameTimeLeft", grow); + MoreSkills_Instances._player.Message(MessageHud.MessageType.TopLeft, "You are getting far from " + (__instance.name.Replace("(Clone)", "")) + " this will double the tame time...", 0, null); } tGotFar.Remove(GotFar); tGotFar.Add(new Helper.TamingGotFar( @@ -617,18 +647,18 @@ public static void Postfix(ref Tameable __instance) { __instance.m_tamingTime = tameTimeMath; - while (Fixed.Fixed == false) + if (Fixed.Fixed == false) { if (__instance.GetRemainingTime() != __instance.m_tamingTime) { __instance.m_nview.GetZDO().Set("TameTimeLeft", __instance.m_tamingTime); } - Debug.LogWarning("Fixed b: " + Fixed.Fixed); + //Debug.LogWarning("Fixed b: " + Fixed.Fixed); tFixed.Remove(Fixed); tFixed.Add(new Helper.TamingFix( creaturezdoid: CreatureZDOID, tfixed: true)); - Debug.LogWarning("Fixed a: " + Fixed.Fixed); + //Debug.LogWarning("Fixed a: " + Fixed.Fixed); } if (GotFar.GotFar == true) @@ -640,13 +670,14 @@ public static void Postfix(ref Tameable __instance) } else { - Debug.LogWarning("GotFar b: " + GotFar.GotFar); + //Debug.LogWarning("GotFar b: " + GotFar.GotFar); tGotFar.Remove(GotFar); tGotFar.Add(new Helper.TamingGotFar( creaturezdoid: CreatureZDOID, gotfar: false)); - Debug.LogWarning("GotFar a: " + GotFar.GotFar); + //Debug.LogWarning("GotFar a: " + GotFar.GotFar); } + MoreSkills_Instances._player.Message(MessageHud.MessageType.TopLeft, "You are close to " + (__instance.name.Replace("(Clone)", "")) + " the tame time back to normal", 0, null); } } else @@ -657,6 +688,7 @@ public static void Postfix(ref Tameable __instance) { float grow = __instance.m_tamingTime * ((__instance.m_nview.GetZDO().GetFloat("TameTimeLeft") * 100) / (__instance.m_tamingTime / 2) / 100); __instance.m_nview.GetZDO().Set("TameTimeLeft", grow); + MoreSkills_Instances._player.Message(MessageHud.MessageType.TopLeft, "You are getting far from " + (__instance.name.Replace("(Clone)", "")) + " this will double the tame time...", 0, null); } tGotFar.Remove(GotFar); tGotFar.Add(new Helper.TamingGotFar( diff --git a/ModSkills/Overhauls/JumpMod.cs b/ModSkills/Overhauls/JumpMod.cs index acc7521..ee867b8 100644 --- a/ModSkills/Overhauls/JumpMod.cs +++ b/ModSkills/Overhauls/JumpMod.cs @@ -41,6 +41,10 @@ public static void Postfix(ref Character __instance) inAir = true; onGround = false; } + else if (Altitude > 8f) + { + inAir = false; + } if (inAir) { @@ -61,6 +65,8 @@ public static void Postfix(ref Character __instance) } } } + + //Debug.LogWarning("Altitud: " + inAir); } } } @@ -79,6 +85,20 @@ public static void Prefix(ref Character __instance, ref HitData hit) float Altitude = Mathf.Max(0f, __instance.m_maxAirAltitude - MoreSkills_Instances._player.transform.position.y); if (Altitude > 4f && Altitude < 8f) + { + if (hit.m_attacker.m_userID == 0) + { + hit.m_damage.m_damage = 0; + } + } + /*if (Altitude > 50f) + { + if (hit.m_attacker.m_userID == 0) + { + hit.m_damage.m_damage /= 999999f; + } + }*/ + else if (Altitude > 8f) { if (hit.m_attacker.m_userID == 0) {