Upload from upload_mods.ps1
This commit is contained in:
115
Harmony/Inactive/Harmony_EntityLootContainer.cs
Normal file
115
Harmony/Inactive/Harmony_EntityLootContainer.cs
Normal file
@@ -0,0 +1,115 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Harmony.EntityLootContainerPatches
|
||||
{
|
||||
/*[HarmonyPatch(typeof(EntityLootContainer))]
|
||||
[HarmonyPatch("OnUpdateEntity")]
|
||||
public class OnUpdateEntityPatch
|
||||
{
|
||||
[HarmonyTranspiler]
|
||||
public static IEnumerable<CodeInstruction> OnUpdateEntity(IEnumerable<CodeInstruction> instructions)
|
||||
{
|
||||
var codes = new List<CodeInstruction>(instructions);
|
||||
|
||||
for (int i = 0; i < codes.Count; i++)
|
||||
{
|
||||
if ((codes[i].opcode == OpCodes.Ldarg_0) && (codes[i+2].opcode == OpCodes.Ldc_I4_1))
|
||||
{
|
||||
codes[i+2].opcode = OpCodes.Ldc_I4_0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return codes;
|
||||
}
|
||||
}*/
|
||||
|
||||
[HarmonyPatch(typeof(EntityLootContainer))]
|
||||
[HarmonyPatch("OnUpdateEntity")]
|
||||
public class OnUpdateEntityPatch
|
||||
{
|
||||
public static bool Prefix(EntityLootContainer __instance)
|
||||
{
|
||||
Log.Out("EntityLootContainerPatches-OnUpdateEntity START");
|
||||
bool isInWater = __instance.isInWater;
|
||||
if (!__instance.isEntityStatic())
|
||||
__instance.TickInWater();
|
||||
if (__instance.isEntityRemote)
|
||||
return false;
|
||||
if (__instance.isInWater)
|
||||
{
|
||||
if (!isInWater && !__instance.firstUpdate && (double)__instance.fallDistance > 1.0)
|
||||
__instance.PlayOneShot("waterfallinginto");
|
||||
__instance.fallDistance = 0.0f;
|
||||
}
|
||||
if (!__instance.RootMotion && !__instance.IsDead() && __instance.CanBePushed())
|
||||
{
|
||||
List<Entity> entitiesInBounds = __instance.world.GetEntitiesInBounds(__instance, BoundsUtils.ExpandBounds(__instance.boundingBox, 0.2f, __instance.GetPushBoundsVertical(), 0.2f));
|
||||
if (entitiesInBounds != null && entitiesInBounds.Count > 0)
|
||||
{
|
||||
for (int index = 0; index < entitiesInBounds.Count; ++index)
|
||||
__instance.OnPushEntity(entitiesInBounds[index]);
|
||||
}
|
||||
}
|
||||
__instance.firstUpdate = false;
|
||||
|
||||
if (!__instance.bMeshCreated)
|
||||
__instance.createMesh();
|
||||
if (__instance.itemWorldData != null)
|
||||
__instance.itemClass.OnDroppedUpdate(__instance.itemWorldData);
|
||||
if ((double)Utils.FastAbs(__instance.position.y - __instance.prevPos.y) < 0.10000000149011612)
|
||||
{
|
||||
++__instance.onGroundCounter;
|
||||
if (__instance.onGroundCounter > 10)
|
||||
__instance.onGround = true;
|
||||
}
|
||||
if (__instance.isPhysicsMaster && !SingletonMonoBehaviour<ConnectionManager>.Instance.IsServer && (__instance.ticksExisted & 1) != 0)
|
||||
__instance.PhysicsMasterSendToServer(__instance.transform);
|
||||
__instance.checkGravitySetting(__instance.isPhysicsMaster);
|
||||
if (__instance.isEntityRemote)
|
||||
return false;
|
||||
if (!(bool)(UnityEngine.Object)__instance.itemTransform)
|
||||
__instance.lifetime = 0.0f;
|
||||
__instance.lifetime -= 0.05f;
|
||||
if ((double)__instance.lifetime <= 0.0)
|
||||
__instance.SetDead();
|
||||
if (__instance.itemClass != null && __instance.itemClass.IsEatDistraction && __instance.distractionLifetime > 0 && __instance.distractionEatTicks <= 0)
|
||||
__instance.SetDead();
|
||||
if ((double)__instance.transform.position.y + (double)Origin.position.y < 0.0)
|
||||
__instance.SetDead();
|
||||
if (__instance.IsDead())
|
||||
return false;
|
||||
__instance.tickDistraction();
|
||||
|
||||
if (__instance.lootContainer != null && __instance.deathUpdateTime > 0)
|
||||
{
|
||||
bool flag = GameManager.Instance.GetEntityIDForLockedTileEntity((TileEntity)__instance.lootContainer) != -1;
|
||||
if (!__instance.bRemoved && !__instance.lootContainer.IsUserAccessing() && !flag && (__instance.lootContainer.bTouched && __instance.lootContainer.IsEmpty() || __instance.deathUpdateTime >= __instance.timeStayAfterDeath - 1))
|
||||
__instance.removeBackpack();
|
||||
}
|
||||
++__instance.deathUpdateTime;
|
||||
if (__instance.world.IsRemote() || !__instance.forceInventoryCreate && __instance.lootContainer != null)
|
||||
return false;
|
||||
__instance.lootContainer = new TileEntityLootContainer((Chunk)null);
|
||||
__instance.lootContainer.bTouched = false;
|
||||
__instance.lootContainer.entityId = __instance.entityId;
|
||||
__instance.lootContainer.lootListName = __instance.GetLootList();
|
||||
__instance.lootContainer.SetContainerSize(LootContainer.GetLootContainer(__instance.lootContainer.lootListName).size, true);
|
||||
if (__instance.isInventory != null)
|
||||
{
|
||||
__instance.lootContainer.bTouched = false;
|
||||
Log.Out("EntityLootContainerPatches-OnUpdateEntity CREATING IVENTORY");
|
||||
for (int index = 0; index < __instance.isInventory.Length; ++index)
|
||||
{
|
||||
if (!__instance.isInventory[index].IsEmpty())
|
||||
__instance.lootContainer.AddItem(__instance.isInventory[index]);
|
||||
}
|
||||
}
|
||||
__instance.lootContainer.SetModified();
|
||||
__instance.forceInventoryCreate = false;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
12
Harmony/Inactive/Harmony_GameModeAbstract.cs
Normal file
12
Harmony/Inactive/Harmony_GameModeAbstract.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace Harmony.GameModeAbstractPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(GameModeAbstract))]
|
||||
[HarmonyPatch("Init")]
|
||||
public class InitPatch
|
||||
{
|
||||
public static void Postfix(GameModeAbstract __instance)
|
||||
{
|
||||
GameStats.Set(EnumGameStats.QuestProgressionDailyLimit, 999);
|
||||
}
|
||||
}
|
||||
}
|
||||
25
Harmony/Inactive/Harmony_GameStageDefinition.cs
Normal file
25
Harmony/Inactive/Harmony_GameStageDefinition.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Audio;
|
||||
using Platform;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Harmony.GameStageDefinitionPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(GameStageDefinition))]
|
||||
[HarmonyPatch("CalcPartyLevel")]
|
||||
public class CalcPartyLevelPatch
|
||||
{
|
||||
public static void Postfix(GameStageDefinition __instance, ref int __result, List<int> playerGameStages)
|
||||
{
|
||||
float num = 0f;
|
||||
for (int i = playerGameStages.Count - 1; i >= 0; i--)
|
||||
{
|
||||
if (playerGameStages[i] > num)
|
||||
{
|
||||
num = playerGameStages[i];
|
||||
}
|
||||
}
|
||||
|
||||
__result = (int)num;
|
||||
}
|
||||
}
|
||||
}
|
||||
37
Harmony/Inactive/Harmony_ItemActionEat.cs
Normal file
37
Harmony/Inactive/Harmony_ItemActionEat.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using Audio;
|
||||
using HarmonyLib;
|
||||
using Platform;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using static ItemActionUseOther;
|
||||
|
||||
namespace Harmony.ItemActionEatPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(ItemActionEat))]
|
||||
[HarmonyPatch("ExecuteAction")]
|
||||
public class ExecuteActionPatch
|
||||
{
|
||||
public static bool Prefix(ItemActionEat __instance, ItemActionData _actionData, bool _bReleased)
|
||||
{
|
||||
//Log.Out("ItemActionEatPatches-ExecuteAction START");
|
||||
if (_actionData.invData.itemValue.ItemClass != null)
|
||||
{
|
||||
if (_actionData.invData.item.HasAnyTags(FastTags<TagGroup.Global>.Parse("medical")))
|
||||
{
|
||||
//Log.Out("ItemActionEatPatches-ExecuteAction MEDICAL");
|
||||
global::EntityAlive holdingEntity = _actionData.invData.holdingEntity;
|
||||
|
||||
string itemName = _actionData.invData.itemValue.ItemClass.GetItemName();
|
||||
|
||||
if (!RebirthUtilities.CanHeal(itemName, _actionData.invData.holdingEntity, _actionData.invData.holdingEntity))
|
||||
{
|
||||
//Log.Out("ItemActionEatPatches-ExecuteAction Cannot heal");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
60
Harmony/Inactive/Harmony_MultiBlockManager.cs
Normal file
60
Harmony/Inactive/Harmony_MultiBlockManager.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
namespace Harmony.MultiBlockManagerPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(MultiBlockManager))]
|
||||
[HarmonyPatch("TryRegisterPOIMultiBlock")]
|
||||
public class TryRegisterPOIMultiBlockPatch
|
||||
{
|
||||
public static bool Prefix(MultiBlockManager __instance, ref bool __result, Vector3i parentWorldPos, BlockValue blockValue)
|
||||
{
|
||||
if (!__instance.CheckFeatures(MultiBlockManager.FeatureFlags.POIMBTracking))
|
||||
return false;
|
||||
using (MultiBlockManager.s_MultiBlockManagerTryAddPOIMultiBlock.Auto())
|
||||
{
|
||||
lock (__instance.lockObj)
|
||||
{
|
||||
MultiBlockManager.TrackedBlockData trackedBlockData1;
|
||||
if (__instance.trackedDataMap.CrossChunkMultiBlocks.TryGetValue(parentWorldPos, out trackedBlockData1))
|
||||
{
|
||||
UnityEngine.Debug.LogError((object)(string.Format("[MultiBlockManager] Failed to register POI multiblock at {0} due to previously registered CrossChunk data.", (object)parentWorldPos) + string.Format("\nOld value: {0} ", (object)trackedBlockData1.rawData) + string.Format("\nNew value: {0}", (object)blockValue.rawData)));
|
||||
__result = false;
|
||||
return false;
|
||||
}
|
||||
MultiBlockManager.TrackedBlockData trackedBlockData2;
|
||||
if (__instance.trackedDataMap.PoiMultiBlocks.TryGetValue(parentWorldPos, out trackedBlockData2))
|
||||
{
|
||||
UnityEngine.Debug.LogError((object)(string.Format("[MultiBlockManager] Duplicate multiblock placement at {0}. New value will not be applied.", (object)parentWorldPos) + string.Format("\nOld value: {0} ", (object)trackedBlockData2.rawData) + string.Format("\nNew value: {0}", (object)blockValue.rawData)));
|
||||
__result = false;
|
||||
return false;
|
||||
}
|
||||
if (blockValue.ischild)
|
||||
{
|
||||
UnityEngine.Debug.LogError((object)"[MultiBlockManager] TryAddPOIMultiBlock failed: target block is not a parent: " + blockValue.Block.blockName);
|
||||
__result = false;
|
||||
return false;
|
||||
}
|
||||
RectInt flatChunkBounds;
|
||||
if (!blockValue.Block.isMultiBlock)
|
||||
{
|
||||
flatChunkBounds = new RectInt((UnityEngine.Vector2Int)World.toChunkXZ(parentWorldPos), UnityEngine.Vector2Int.zero);
|
||||
}
|
||||
else
|
||||
{
|
||||
Vector3i minPos;
|
||||
Vector3i maxPos;
|
||||
MultiBlockManager.GetMinMaxWorldPositions(parentWorldPos, blockValue, out minPos, out maxPos);
|
||||
Vector2i chunkXz1 = World.toChunkXZ(minPos);
|
||||
Vector2i chunkXz2 = World.toChunkXZ(maxPos);
|
||||
flatChunkBounds = new RectInt((UnityEngine.Vector2Int)chunkXz1, (UnityEngine.Vector2Int)(chunkXz2 - chunkXz1));
|
||||
}
|
||||
__instance.trackedDataMap.AddOrMergeTrackedData(parentWorldPos, blockValue.rawData, flatChunkBounds, MultiBlockManager.TrackingTypeFlags.PoiMultiBlock);
|
||||
__instance.isDirty = true;
|
||||
__instance.UpdateProfilerCounters();
|
||||
__result = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
41
Harmony/Inactive/Harmony_Origin.cs
Normal file
41
Harmony/Inactive/Harmony_Origin.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using Unity.Collections;
|
||||
|
||||
public class HarmonyOriginPatches
|
||||
{
|
||||
//[HarmonyPatch(typeof(Origin), nameof(Origin.Awake))]
|
||||
public class AwakePatch
|
||||
{
|
||||
public static bool Prefix(Origin __instance)
|
||||
{
|
||||
Log.Out($"Origin::Awake Prefix");
|
||||
|
||||
if (Origin.Instance == null)
|
||||
{
|
||||
Origin.Instance = __instance;
|
||||
}
|
||||
|
||||
__instance.isAuto = false;
|
||||
__instance.particles = new NativeArray<ParticleSystem.Particle>(512, Allocator.Persistent);
|
||||
__instance.physicsCheckT = __instance.transform.GetChild(0);
|
||||
Origin.Instance.Reposition(Vector3.zero);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//[HarmonyPatch(typeof(Origin), nameof(Origin.FixedUpdate))]
|
||||
public class FixedUpdatePatch
|
||||
{
|
||||
public static bool Prefix(Origin __instance)
|
||||
{
|
||||
if (__instance.isActiveAndEnabled)
|
||||
{
|
||||
Log.Out($"Origin::FixedUpdate - Disabling Origin");
|
||||
__instance.isAuto = false;
|
||||
__instance.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
20
Harmony/Inactive/Harmony_ProgressionClass.cs
Normal file
20
Harmony/Inactive/Harmony_ProgressionClass.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
namespace Harmony.ProgressionClassPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(ProgressionClass))]
|
||||
[HarmonyPatch("ListSortOrder")]
|
||||
[HarmonyPatch(MethodType.Getter)]
|
||||
public class ListSortOrderPatch
|
||||
{
|
||||
public static bool Prefix(ProgressionClass __instance, ref float __result)
|
||||
{
|
||||
if (__instance.IsPerk)
|
||||
{
|
||||
__result = __instance.Parent.ListSortOrder + __instance.listSortOrder * (1f / 1000f);
|
||||
}
|
||||
__result = __instance.IsSkill ? __instance.Parent.ListSortOrder + __instance.listSortOrder : __instance.listSortOrder * 100f;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
171
Harmony/Inactive/Harmony_ProgressionFromXml.cs
Normal file
171
Harmony/Inactive/Harmony_ProgressionFromXml.cs
Normal file
@@ -0,0 +1,171 @@
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Harmony.ProgressionFromXmlPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(ProgressionFromXml))]
|
||||
//[HarmonyPatch(new[] { typeof(XElement), typeof(int), typeof(int), typeof(int), typeof(float), typeof(float), typeof(float) })]
|
||||
[HarmonyPatch("parseProgressionItem")]
|
||||
public class parseProgressionItemPatch
|
||||
{
|
||||
public static bool Prefix(ProgressionFromXml __instance, XElement childElement, int max_level, int min_level, int base_cost, float cost_multiplier_per_level, float max_level_ratio_to_parent, ref float order)
|
||||
{
|
||||
ProgressionType progressionType = ProgressionType.None;
|
||||
if (childElement.Name == (XName)"attribute")
|
||||
progressionType = ProgressionType.Attribute;
|
||||
else if (childElement.Name == (XName)"skill")
|
||||
progressionType = ProgressionType.Skill;
|
||||
else if (childElement.Name == (XName)"perk")
|
||||
progressionType = ProgressionType.Perk;
|
||||
else if (childElement.Name == (XName)"book")
|
||||
progressionType = ProgressionType.Book;
|
||||
else if (childElement.Name == (XName)"book_group")
|
||||
progressionType = ProgressionType.BookGroup;
|
||||
else if (childElement.Name == (XName)"crafting_skill")
|
||||
progressionType = ProgressionType.Crafting;
|
||||
if (progressionType == ProgressionType.None)
|
||||
return false;
|
||||
if (childElement.HasAttribute((XName)nameof(min_level)))
|
||||
min_level = int.Parse(childElement.GetAttribute((XName)nameof(min_level)));
|
||||
if (childElement.HasAttribute((XName)nameof(max_level)))
|
||||
max_level = int.Parse(childElement.GetAttribute((XName)nameof(max_level)));
|
||||
if (childElement.HasAttribute((XName)nameof(max_level_ratio_to_parent)))
|
||||
max_level_ratio_to_parent = StringParsers.ParseFloat(childElement.GetAttribute((XName)nameof(max_level_ratio_to_parent)));
|
||||
if (childElement.HasAttribute((XName)"base_skill_point_cost"))
|
||||
base_cost = int.Parse(childElement.GetAttribute((XName)"base_skill_point_cost"));
|
||||
else if (childElement.HasAttribute((XName)"base_exp_cost"))
|
||||
base_cost = int.Parse(childElement.GetAttribute((XName)"base_exp_cost"));
|
||||
if (childElement.HasAttribute((XName)nameof(cost_multiplier_per_level)))
|
||||
cost_multiplier_per_level = StringParsers.ParseFloat(childElement.GetAttribute((XName)nameof(cost_multiplier_per_level)));
|
||||
if (!childElement.HasAttribute((XName)"name"))
|
||||
return false;
|
||||
|
||||
//Log.Out("ProgressionFromXmlPatches-parseProgressionItem SCENARIO: " + RebirthVariables.customScenario);
|
||||
|
||||
if (RebirthVariables.customScenario == "hive")
|
||||
{
|
||||
if (progressionType == ProgressionType.Attribute && !(childElement.GetAttribute((XName)"name").ToLower() == "attfortitude"))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (progressionType == ProgressionType.Skill)
|
||||
{
|
||||
string skillName = childElement.GetAttribute((XName)"name");
|
||||
|
||||
bool isValid = skillName == "FuriousRamsaySkillStrength" ||
|
||||
skillName == "FuriousRamsaySkillDexterity" ||
|
||||
skillName == "FuriousRamsaySkillConstitution" ||
|
||||
skillName == "FuriousRamsaySkillIntelligence" ||
|
||||
skillName == "FuriousRamsaySkillCharisma";
|
||||
|
||||
if (!isValid)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (progressionType == ProgressionType.Perk && !(childElement.GetAttribute((XName)"name").ToLower().StartsWith("perk")))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
ProgressionClass progressionClass = new ProgressionClass(childElement.GetAttribute((XName)"name").ToLower())
|
||||
{
|
||||
MinLevel = min_level,
|
||||
MaxLevel = max_level,
|
||||
Type = progressionType,
|
||||
BaseCostToLevel = base_cost,
|
||||
CostMultiplier = (double)cost_multiplier_per_level > 0.0 ? cost_multiplier_per_level : 1f,
|
||||
ParentMaxLevelRatio = max_level_ratio_to_parent
|
||||
};
|
||||
progressionClass.ListSortOrder = order;
|
||||
++order;
|
||||
if (childElement.HasAttribute((XName)"parent"))
|
||||
progressionClass.ParentName = childElement.GetAttribute((XName)"parent").ToLower();
|
||||
if (childElement.HasAttribute((XName)"name_key"))
|
||||
progressionClass.NameKey = childElement.GetAttribute((XName)"name_key");
|
||||
if (childElement.HasAttribute((XName)nameof(max_level_ratio_to_parent)))
|
||||
progressionClass.ParentMaxLevelRatio = StringParsers.ParseFloat(childElement.GetAttribute((XName)nameof(max_level_ratio_to_parent)));
|
||||
if (childElement.HasAttribute((XName)"desc_key"))
|
||||
progressionClass.DescKey = childElement.GetAttribute((XName)"desc_key");
|
||||
if (childElement.HasAttribute((XName)"long_desc_key"))
|
||||
progressionClass.LongDescKey = childElement.GetAttribute((XName)"long_desc_key");
|
||||
if (childElement.HasAttribute((XName)"icon"))
|
||||
progressionClass.Icon = childElement.GetAttribute((XName)"icon");
|
||||
foreach (XElement element1 in childElement.Elements())
|
||||
{
|
||||
if (element1.Name == (XName)"level_requirements")
|
||||
{
|
||||
int _level = 0;
|
||||
if (element1.HasAttribute((XName)"level"))
|
||||
_level = StringParsers.ParseSInt32(element1.GetAttribute((XName)"level"));
|
||||
LevelRequirement _lr = new LevelRequirement(_level);
|
||||
if (element1.HasElements)
|
||||
{
|
||||
foreach (XElement element2 in element1.Elements((XName)"requirement"))
|
||||
{
|
||||
IRequirement requirement = RequirementBase.ParseRequirement(element2);
|
||||
if (requirement != null)
|
||||
_lr.AddRequirement(requirement);
|
||||
}
|
||||
}
|
||||
progressionClass.AddLevelRequirement(_lr);
|
||||
}
|
||||
else if (element1.Name == (XName)"display_entry")
|
||||
{
|
||||
string[] strArray1 = element1.GetAttribute((XName)"unlock_level").Split(',', StringSplitOptions.None);
|
||||
int[] _qualityStarts = new int[strArray1.Length];
|
||||
string str = "";
|
||||
string[] _customName = (string[])null;
|
||||
string[] _customIcon = (string[])null;
|
||||
string[] _customIconTint = (string[])null;
|
||||
bool _customHasQuality = false;
|
||||
for (int index = 0; index < strArray1.Length; ++index)
|
||||
_qualityStarts[index] = StringParsers.ParseSInt32(strArray1[index]);
|
||||
if (element1.HasAttribute((XName)"item"))
|
||||
str = element1.GetAttribute((XName)"item");
|
||||
if (element1.HasAttribute((XName)"has_quality"))
|
||||
_customHasQuality = StringParsers.ParseBool(element1.GetAttribute((XName)"has_quality"));
|
||||
if (element1.HasAttribute((XName)"icon"))
|
||||
_customIcon = element1.GetAttribute((XName)"icon").Split(',', StringSplitOptions.None);
|
||||
if (_customIcon != null)
|
||||
_customIconTint = !element1.HasAttribute((XName)"icontint") ? new string[_customIcon.Length] : element1.GetAttribute((XName)"icontint").Split(',', StringSplitOptions.None);
|
||||
if (element1.HasAttribute((XName)"name"))
|
||||
_customName = element1.GetAttribute((XName)"name").Split(',', StringSplitOptions.None);
|
||||
if (element1.HasAttribute((XName)"name_key"))
|
||||
{
|
||||
string[] strArray2 = element1.GetAttribute((XName)"name_key").Split(',', StringSplitOptions.None);
|
||||
for (int index = 0; index < strArray2.Length; ++index)
|
||||
strArray2[index] = Localization.Get(strArray2[index]);
|
||||
_customName = strArray2;
|
||||
}
|
||||
ProgressionClass.DisplayData displayData = progressionClass.AddDisplayData(str, _qualityStarts, _customIcon, _customIconTint, _customName, _customHasQuality);
|
||||
if (displayData.ItemName != "")
|
||||
displayData.AddUnlockData(displayData.ItemName, 0, (string[])null);
|
||||
if (element1.HasElements)
|
||||
{
|
||||
foreach (XElement element3 in element1.Elements((XName)"unlock_entry"))
|
||||
{
|
||||
int unlockTier = 0;
|
||||
if (element3.HasAttribute((XName)"unlock_tier"))
|
||||
unlockTier = StringParsers.ParseSInt32(element3.GetAttribute((XName)"unlock_tier")) - 1;
|
||||
string[] recipeList = (string[])null;
|
||||
if (element3.HasAttribute((XName)"recipes"))
|
||||
recipeList = element3.GetAttribute((XName)"recipes").Split(',', StringSplitOptions.None);
|
||||
if (element3.HasAttribute((XName)"item"))
|
||||
{
|
||||
foreach (string itemName in element3.GetAttribute((XName)"item").Split(',', StringSplitOptions.None))
|
||||
displayData.AddUnlockData(itemName, unlockTier, recipeList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
progressionClass.Effects = MinEffectController.ParseXml(childElement, _type: MinEffectController.SourceParentType.ProgressionClass, _parentPointer: (object)progressionClass.Name);
|
||||
Progression.ProgressionClasses.Add(progressionClass.Name, progressionClass);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
30
Harmony/Inactive/Harmony_SplashScreenScript.cs
Normal file
30
Harmony/Inactive/Harmony_SplashScreenScript.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.Video;
|
||||
|
||||
namespace Harmony.SplashScreenScriptPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(SplashScreenScript))]
|
||||
[HarmonyPatch("Awake")]
|
||||
public class AwakePatch
|
||||
{
|
||||
public static bool Prefix(SplashScreenScript __instance, UnityEngine.Video.VideoPlayer ___videoPlayer)
|
||||
{
|
||||
if (!GameEntrypoint.EntrypointSuccess)
|
||||
return false;
|
||||
if (GameManager.IsDedicatedServer)
|
||||
SceneManager.LoadScene(SplashScreenScript.MainSceneName);
|
||||
else
|
||||
{
|
||||
GameOptionsManager.ApplyTextureQuality();
|
||||
__instance.labelEaWarning.text = Localization.Get("splashMessageEarlyAccessWarning");
|
||||
__instance.videoPlayer.prepareCompleted += new VideoPlayer.EventHandler(__instance.OnVideoPrepared);
|
||||
__instance.videoPlayer.loopPointReached += new VideoPlayer.EventHandler(__instance.OnVideoFinished);
|
||||
__instance.videoPlayer.errorReceived += new VideoPlayer.ErrorEventHandler(__instance.OnVideoErrorReceived);
|
||||
__instance.videoPlayer.url = Application.streamingAssetsPath + "/Video/TFP_Intro.webm";
|
||||
__instance.videoPlayer.Prepare();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
54
Harmony/Inactive/Harmony_XUiC_MapArea.cs
Normal file
54
Harmony/Inactive/Harmony_XUiC_MapArea.cs
Normal file
@@ -0,0 +1,54 @@
|
||||
using Platform;
|
||||
|
||||
namespace Harmony.XUiC_MapAreaPatches
|
||||
{
|
||||
/*[HarmonyPatch(typeof(XUiC_MapArea))]
|
||||
[HarmonyPatch("onMapPressedLeft")]
|
||||
public class onMapPressedLeftPatch
|
||||
{
|
||||
public static bool Prefix(XUiC_MapArea __instance, XUiController _sender, int _mouseButton)
|
||||
{
|
||||
Log.Out("XUiC_MapAreaPatches-onMapPressedLeft START");
|
||||
__instance.closeAllPopups();
|
||||
if (__instance.closestMouseOverNavObject != null)
|
||||
{
|
||||
Log.Out("XUiC_MapAreaPatches-onMapPressedLeft 1");
|
||||
__instance.closestMouseOverNavObject.hiddenOnCompass = !__instance.closestMouseOverNavObject.hiddenOnCompass;
|
||||
if (__instance.closestMouseOverNavObject.hiddenOnCompass)
|
||||
{
|
||||
Log.Out("XUiC_MapAreaPatches-onMapPressedLeft 2");
|
||||
GameManager.ShowTooltip(GameManager.Instance.World.GetPrimaryPlayer(), Localization.Get("compassWaypointHiddenTooltip"));
|
||||
}
|
||||
if (__instance.closestMouseOverNavObject.NavObjectClass.NavObjectClassName == "quick_waypoint")
|
||||
{
|
||||
Log.Out("XUiC_MapAreaPatches-onMapPressedLeft 3");
|
||||
__instance.xui.playerUI.entityPlayer.navMarkerHidden = __instance.closestMouseOverNavObject.hiddenOnCompass;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out("XUiC_MapAreaPatches-onMapPressedLeft 4");
|
||||
Waypoint waypointForNavObject = __instance.xui.playerUI.entityPlayer.Waypoints.GetWaypointForNavObject(__instance.closestMouseOverNavObject);
|
||||
if (waypointForNavObject == null)
|
||||
{
|
||||
Log.Out("XUiC_MapAreaPatches-onMapPressedLeft 5");
|
||||
return false;
|
||||
}
|
||||
waypointForNavObject.hiddenOnCompass = __instance.closestMouseOverNavObject.hiddenOnCompass;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out("XUiC_MapAreaPatches-onMapPressedLeft 6");
|
||||
if (PlatformManager.NativePlatform.Input.CurrentInputStyle == PlayerInputManager.InputStyle.Keyboard)
|
||||
{
|
||||
Log.Out("XUiC_MapAreaPatches-onMapPressedLeft 7");
|
||||
return false;
|
||||
}
|
||||
__instance.OpenWaypointPopup();
|
||||
}
|
||||
|
||||
Log.Out("XUiC_MapAreaPatches-onMapPressedLeft END");
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
70
Harmony/Inactive/Harmony_XUiC_OnScreenIcons.cs
Normal file
70
Harmony/Inactive/Harmony_XUiC_OnScreenIcons.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using static UIPopupList;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
|
||||
namespace Harmony.XUiC_OnScreenIconsPatches
|
||||
{
|
||||
|
||||
/*[HarmonyPatch(typeof(XUiC_OnScreenIcons))]
|
||||
[HarmonyPatch("Instance_OnNavObjectAdded")]
|
||||
public class Instance_OnNavObjectAddedPatch
|
||||
{
|
||||
public static bool Prefix(XUiC_OnScreenIcons __instance, NavObject newNavObject)
|
||||
{
|
||||
Log.Out("XUiC_OnScreenIconsPatches-Instance_OnNavObjectAdded NavObjectClassName: " + newNavObject.NavObjectClass.NavObjectClassName);
|
||||
|
||||
if (!newNavObject.HasOnScreen && !(newNavObject.NavObjectClass.NavObjectClassName == "purge_waypoint"))
|
||||
{
|
||||
Log.Out("XUiC_OnScreenIconsPatches-Instance_OnNavObjectAdded HAS ON SCREEN");
|
||||
return false;
|
||||
}
|
||||
__instance.RegisterIcon(newNavObject);
|
||||
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
|
||||
/*[HarmonyPatch(typeof(XUiC_OnScreenIcons))]
|
||||
[HarmonyPatch("Update")]
|
||||
public class UpdatePatch
|
||||
{
|
||||
public static void Postfix(XUiC_OnScreenIcons __instance, float _dt)
|
||||
{
|
||||
for (int index = __instance.screenIconList.Count - 1; index >= 0; --index)
|
||||
{
|
||||
Log.Out("XUiC_OnScreenIconsPatches-Update screenIconList name[" + index + "]: " + __instance.screenIconList[index].NavObject.name);
|
||||
//Log.Out("XUiC_OnScreenIconsPatches-Update position: " + __instance.screenIconList[index].NavObject.GetPosition());
|
||||
//Log.Out("XUiC_OnScreenIconsPatches-Update NavObjectClassList.Count: " + __instance.screenIconList[index].NavObject.NavObjectClassList.Count);
|
||||
|
||||
if (__instance.screenIconList[index].NavObject.OwnerEntity != null)
|
||||
{
|
||||
Log.Out("XUiC_OnScreenIconsPatches-Update screenIconList owner: " + __instance.screenIconList[index].NavObject.OwnerEntity.name);
|
||||
}
|
||||
|
||||
for (int x = 0; x < __instance.screenIconList[index].NavObject.NavObjectClassList.Count; ++x)
|
||||
{
|
||||
Log.Out("XUiC_OnScreenIconsPatches-Update NavObjectClassName [" + x + "]: " + __instance.screenIconList[index].NavObject.NavObjectClassList[x].NavObjectClassName);
|
||||
}
|
||||
}
|
||||
|
||||
Log.Out("XUiC_OnScreenIconsPatches-Update ================================================");
|
||||
|
||||
for (int index = __instance.disabledIcons.Count - 1; index >= 0; --index)
|
||||
{
|
||||
Log.Out("XUiC_OnScreenIconsPatches-Update disabledIcons name[" + index + "]: " + __instance.disabledIcons[index].NavObject.name);
|
||||
//Log.Out("XUiC_OnScreenIconsPatches-Update position: " + __instance.screenIconList[index].NavObject.GetPosition());
|
||||
//Log.Out("XUiC_OnScreenIconsPatches-Update NavObjectClassList.Count: " + __instance.screenIconList[index].NavObject.NavObjectClassList.Count);
|
||||
|
||||
if (__instance.disabledIcons[index].NavObject.OwnerEntity != null)
|
||||
{
|
||||
Log.Out("XUiC_OnScreenIconsPatches-Update disabledIcons owner: " + __instance.disabledIcons[index].NavObject.OwnerEntity.name);
|
||||
}
|
||||
|
||||
for (int x = 0; x < __instance.disabledIcons[index].NavObject.NavObjectClassList.Count; ++x)
|
||||
{
|
||||
Log.Out("XUiC_OnScreenIconsPatches-Update NavObjectClassName [" + x + "]: " + __instance.disabledIcons[index].NavObject.NavObjectClassList[x].NavObjectClassName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
84
Harmony/Inactive/Harmony_XUiC_PowerSourceSlots.cs
Normal file
84
Harmony/Inactive/Harmony_XUiC_PowerSourceSlots.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace Harmony.XUiC_PowerSourceSlotsPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(XUiC_PowerSourceSlots))]
|
||||
[HarmonyPatch("SetSlots")]
|
||||
public class SetSlotsPatch
|
||||
{
|
||||
public static void Postfix(XUiC_PowerSourceSlots __instance, ItemStack[] stacks)
|
||||
{
|
||||
//Log.Out("XUiC_PowerSourceSlotsPatches-SetSlots __instance.tileEntity.isPlayerPlaced: " + __instance.tileEntity.isPlayerPlaced);
|
||||
if (__instance.tileEntity.isPlayerPlaced)
|
||||
{
|
||||
//Log.Out("XUiC_PowerSourceSlotsPatches-SetSlots IS PLAYER PLACED");
|
||||
return;
|
||||
}
|
||||
|
||||
int numCells = 0;
|
||||
|
||||
for (int i = 0; i < stacks.Length; i++)
|
||||
{
|
||||
if (!stacks[i].IsEmpty())
|
||||
{
|
||||
numCells++;
|
||||
}
|
||||
}
|
||||
|
||||
if (numCells > 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GameRandom gameRandom = GameManager.Instance.World.GetGameRandom();
|
||||
|
||||
ItemValue itemSolarCell = ItemClass.GetItem("solarCell", false);
|
||||
|
||||
int random = gameRandom.RandomRange(1, 7);
|
||||
|
||||
//Log.Out("XUiC_PowerSourceSlotsPatches-SetSlots Quality: " + random);
|
||||
|
||||
itemSolarCell.Quality = (ushort)random;
|
||||
|
||||
random = gameRandom.RandomRange(0, 6);
|
||||
|
||||
//Log.Out("XUiC_PowerSourceSlotsPatches-SetSlots Position: " + random);
|
||||
|
||||
//__instance.tileEntity.ItemSlots[random].itemValue = itemSolarCell;
|
||||
|
||||
stacks[random].itemValue = itemSolarCell;
|
||||
|
||||
//Log.Out("XUiC_PowerSourceSlotsPatches-SetSlots stacks[" + random + "].itemValue.IsEmpty(): " + stacks[random].itemValue.IsEmpty());
|
||||
|
||||
//Log.Out("XUiC_PowerSourceSlotsPatches-SetSlots stacks.Length: " + stacks.Length);
|
||||
//Log.Out("XUiC_PowerSourceSlotsPatches-SetSlots __instance.tileEntity.ItemSlots.Count: " + __instance.tileEntity.ItemSlots.Count());
|
||||
|
||||
/*Log.Out("XUiC_PowerSourceSlotsPatches-SetSlots __instance.tileEntity.activateDirty: " + __instance.tileEntity.activateDirty);
|
||||
|
||||
for (int i = 0; i < stacks.Length; i++)
|
||||
{
|
||||
Log.Out("XUiC_PowerSourceSlotsPatches-SetSlots __instance.tileEntity.ItemSlots[" + i + "].IsEmpty(): " + __instance.tileEntity.ItemSlots[i].IsEmpty());
|
||||
if (!__instance.tileEntity.ItemSlots[i].IsEmpty())
|
||||
{
|
||||
Log.Out("XUiC_PowerSourceSlotsPatches-SetSlots __instance.tileEntity.ItemSlots[" + i + "].itemValue.Quality: " + __instance.tileEntity.ItemSlots[i].itemValue.Quality);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out("XUiC_PowerSourceSlotsPatches-SetSlots __instance.tileEntity.ItemSlots[" + i + "].itemValue.Quality: IS EMPTY");
|
||||
}
|
||||
}*/
|
||||
|
||||
for (int i = 0; i < stacks.Length; i++)
|
||||
{
|
||||
//Log.Out("XUiC_PowerSourceSlotsPatches-SetSlots stacks[" + i + "].itemValue.IsEmpty(): " + stacks[i].itemValue.IsEmpty());
|
||||
if (!stacks[i].itemValue.IsEmpty())
|
||||
{
|
||||
//Log.Out("XUiC_PowerSourceSlotsPatches-SetSlots stacks[" + i + "].itemValue.Quality: " + stacks[i].itemValue.Quality);
|
||||
}
|
||||
}
|
||||
|
||||
__instance.items = stacks;
|
||||
__instance.SetStacks(stacks);
|
||||
}
|
||||
}
|
||||
}
|
||||
17
Harmony/Inactive/Harmony_XUiM_ItemStack.cs
Normal file
17
Harmony/Inactive/Harmony_XUiM_ItemStack.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace Harmony.XUiM_ItemStackPatches
|
||||
{
|
||||
[HarmonyPatch(typeof(XUiM_ItemStack))]
|
||||
[HarmonyPatch("CheckKnown")]
|
||||
public class CheckKnownPatch
|
||||
{
|
||||
public static void Postfix(XUiM_ItemStack __instance, ref bool __result, EntityPlayerLocal player, ItemClass itemClass, ItemValue itemValue)
|
||||
{
|
||||
string itemClassName = itemClass.Name;
|
||||
|
||||
if (player.Buffs.GetCustomVar(itemClassName) == 1f)
|
||||
{
|
||||
__result = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user