diff --git a/SCHIZO/Creatures/Components/Carryable.cs b/SCHIZO/Creatures/Components/Carryable.cs index 9f9ac844..0f984304 100644 --- a/SCHIZO/Creatures/Components/Carryable.cs +++ b/SCHIZO/Creatures/Components/Carryable.cs @@ -27,6 +27,11 @@ partial class Carryable typeof(WorldAmbientSoundPlayer), typeof(SwimBehaviour), typeof(Rigidbody), +#if BELOWZERO + typeof(LandCreatureGravity), +#else + typeof(CaveCrawlerGravity), +#endif typeof(Creature) ]; diff --git a/SCHIZO/Creatures/Components/DisableUntilStoryGoal.cs b/SCHIZO/Creatures/Components/DisableUntilStoryGoal.cs index eac2bb46..5c1ae5be 100644 --- a/SCHIZO/Creatures/Components/DisableUntilStoryGoal.cs +++ b/SCHIZO/Creatures/Components/DisableUntilStoryGoal.cs @@ -17,11 +17,19 @@ private void OnDestroy() StoryGoalManager.main.RemoveListener(this); } - public void NotifyGoalComplete(string key) => UpdateActive(); + public void NotifyGoalComplete(string key) => UpdateActive(key); - public void NotifyGoalReset(string key) => UpdateActive(); + public void NotifyGoalReset(string key) => UpdateActive(key); public void NotifyGoalsDeserialized() => UpdateActive(); - private void UpdateActive() => gameObject.SetActive(StoryGoalHelpers.IsCompleted(storyGoal)); + private void UpdateActive(string key = null) + { + if (key is { } && !StoryGoalHelpers.Matches(key, storyGoal)) + return; + + Pickupable pickupable = GetComponent(); + if (pickupable && pickupable.attached) return; // otherwise inventory items swim away + gameObject.SetActive(StoryGoalHelpers.IsCompleted(storyGoal)); + } } diff --git a/SCHIZO/Helpers/StoryGoalHelpers.cs b/SCHIZO/Helpers/StoryGoalHelpers.cs index 193d2e6c..3f0d684c 100644 --- a/SCHIZO/Helpers/StoryGoalHelpers.cs +++ b/SCHIZO/Helpers/StoryGoalHelpers.cs @@ -1,3 +1,4 @@ +using System; using System.Runtime.CompilerServices; using Story; @@ -15,7 +16,7 @@ public static bool IsStoryEnabled() #endif } - + public static bool Matches(string goal1, string goal2) => string.Equals(goal1, goal2, StringComparison.OrdinalIgnoreCase); public static bool IsCompleted(string goal) => !IsStoryEnabled() || string.IsNullOrEmpty(goal) || (StoryGoalManager.main && StoryGoalManager.main.IsGoalComplete(goal)); diff --git a/SCHIZO/Items/FumoItem/EvilFumoItemTool.cs b/SCHIZO/Items/FumoItem/EvilFumoItemTool.cs index 6d243423..639865bb 100644 --- a/SCHIZO/Items/FumoItem/EvilFumoItemTool.cs +++ b/SCHIZO/Items/FumoItem/EvilFumoItemTool.cs @@ -8,12 +8,19 @@ partial class EvilFumoItemTool public Knife stolenKnife; private static float _knifeScale = 0.9f; + private static float _dmgResetTime = 60f; + private float _timeUntilDamageReset; + private float _currentDamage; + + private void Start() + { + _currentDamage = damageOnPoke; + } protected override void ApplyAltEffect(bool active) { - LOGGER.LogWarning(active); if (active) { - float dmg = damageOnPoke; + float dmg = _currentDamage; if (stealKnife && TryFindKnife(out Knife knife) && Inventory.main.InternalDropItem(knife.pickupable)) { @@ -22,7 +29,7 @@ protected override void ApplyAltEffect(bool active) dmg *= 4; } usingPlayer.liveMixin.TakeDamage(dmg); - damageOnPoke *= 1.25f; // negative reward function + _currentDamage *= 1.25f; // negative reward function } else { @@ -56,6 +63,25 @@ private void YoinkKnife() stolenKnife.transform.SetParent(knifeSocket.Exists() ?? transform, true); stolenKnife.transform.localScale *= _knifeScale; } + protected override void FixedUpdate() + { + base.FixedUpdate(); + UpdateDamageReset(); + } + + private void UpdateDamageReset() + { + if (_currentDamage == damageOnPoke) return; + + if (isAltEffectActive) + _timeUntilDamageReset = _dmgResetTime; + else + { + _timeUntilDamageReset -= Time.fixedDeltaTime; + if (_timeUntilDamageReset < 0) + _currentDamage = damageOnPoke; + } + } protected override void Update() { diff --git a/SCHIZO/Items/FumoItem/FumoItemTool.cs b/SCHIZO/Items/FumoItem/FumoItemTool.cs index 1a65e698..ad7162c5 100644 --- a/SCHIZO/Items/FumoItem/FumoItemTool.cs +++ b/SCHIZO/Items/FumoItem/FumoItemTool.cs @@ -42,24 +42,28 @@ partial class FumoItemTool base.Awake(); } - public void FixedUpdate() + protected virtual void FixedUpdate() { if (!usingPlayer) return; + UpdateAltEffect(); + } - if (_altEffectOnHug) - { - if (_isHugging) - { - _hugTime += Time.fixedDeltaTime; - if (_hugTime > altEffectMinHugTime) SetAltEffect(true); - } - else - { - _hugTime = 0; - } - } + private void UpdateAltEffect() + { _altEffectTimeRemaining -= Time.fixedDeltaTime; if (_altEffectTimeRemaining < 0f) SetAltEffect(false); + + if (!_altEffectOnHug) return; + + if (_isHugging) + { + _hugTime += Time.fixedDeltaTime; + if (_hugTime > altEffectMinHugTime && !isAltEffectActive) SetAltEffect(true); + } + else + { + _hugTime = 0; + } } protected virtual void Update() diff --git a/SCHIZO/Jukebox/CustomJukeboxTrack.BelowZero.cs b/SCHIZO/Jukebox/CustomJukeboxTrack.BelowZero.cs index 4f3a4b96..d6bcd8fd 100644 --- a/SCHIZO/Jukebox/CustomJukeboxTrack.BelowZero.cs +++ b/SCHIZO/Jukebox/CustomJukeboxTrack.BelowZero.cs @@ -69,7 +69,7 @@ protected override void Register() return; } CustomJukeboxTrackPatches.customTracks[trackId] = this; - RegisterInJukebox(null); + RegisterInJukebox(BZJukebox._main); if (!Player.main) return; diff --git a/Unity/Assets/Mod/Anneel/Anneel.prefab b/Unity/Assets/Mod/Anneel/Anneel.prefab index 5a9a6718..c649984a 100644 --- a/Unity/Assets/Mod/Anneel/Anneel.prefab +++ b/Unity/Assets/Mod/Anneel/Anneel.prefab @@ -55,7 +55,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: storyGoalSN: - storyGoalBZ: SanctuaryCompleted + storyGoalBZ: DeltaIslandFirstVisit --- !u!136 &5906089814064505694 CapsuleCollider: m_ObjectHideFlags: 0 diff --git a/Unity/Assets/Mod/Evil Fumo/Evil Fumo Spawns.asset b/Unity/Assets/Mod/Evil Fumo/Evil Fumo Spawns.asset index 8111c7d3..5f7035a2 100644 --- a/Unity/Assets/Mod/Evil Fumo/Evil Fumo Spawns.asset +++ b/Unity/Assets/Mod/Evil Fumo/Evil Fumo Spawns.asset @@ -14,10 +14,10 @@ MonoBehaviour: m_EditorClassIdentifier: spawns: - game: 2 - locations: - - position: {x: -326.8, y: 15, z: 265.4} - rotation: {x: 0, y: 115, z: 0} item: isCustom: 1 techType: 2007 itemData: {fileID: 11400000, guid: 7783c6be943946e49b6d4a4982e601d6, type: 2} + locations: + - position: {x: -1113.33, y: 24.925, z: -267.25} + rotation: {x: 0, y: 160, z: 0} \ No newline at end of file diff --git a/Unity/Assets/Mod/Evil Fumo/Evil Fumo item data.asset b/Unity/Assets/Mod/Evil Fumo/Evil Fumo item data.asset index afc88070..c9a8679c 100644 --- a/Unity/Assets/Mod/Evil Fumo/Evil Fumo item data.asset +++ b/Unity/Assets/Mod/Evil Fumo/Evil Fumo item data.asset @@ -35,7 +35,7 @@ MonoBehaviour: spawnData: {fileID: 0} unlockAtStart: 1 registerInSN: 1 - recipeSN: {fileID: 0} + recipeSN: {fileID: 11400000, guid: b0f11b9cf34116348be77763a163289e, type: 2} craftTreeTypeSN: 1 craftTreePathSN: Personal/Equipment techGroupSN: 2 @@ -47,7 +47,7 @@ MonoBehaviour: equipmentTypeSN: 1 quickSlotTypeSN: 3 registerInBZ: 1 - recipeBZ: {fileID: 0} + recipeBZ: {fileID: 11400000, guid: b0f11b9cf34116348be77763a163289e, type: 2} canBeRecycledBZ: 1 craftTreeTypeBZ: 1 craftTreePathBZ: Personal/Equipment diff --git a/Unity/Assets/Mod/Evil Fumo/Evil Fumo item.prefab b/Unity/Assets/Mod/Evil Fumo/Evil Fumo item.prefab index cf608351..c2942d54 100644 --- a/Unity/Assets/Mod/Evil Fumo/Evil Fumo item.prefab +++ b/Unity/Assets/Mod/Evil Fumo/Evil Fumo item.prefab @@ -76,7 +76,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: plugOrigin: {fileID: 0} - mainCollider: {fileID: 5495115456470386077} + mainCollider: {fileID: 0} pickupable: {fileID: 986444971531117965} renderers: [] ikAimLeftArm: 1 @@ -142,6 +142,19 @@ MonoBehaviour: m_EditorClassIdentifier: propModel: {fileID: 853428788585080163} viewModel: {fileID: 7656616662938203038} +--- !u!65 &4332142020512149085 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3050323588128677620} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 4.0000005, y: 4.3434496, z: 3.2994847} + m_Center: {x: -0, y: 2.1420708, z: -0.17539322} --- !u!1001 &8219148621552729296 PrefabInstance: m_ObjectHideFlags: 0 @@ -252,6 +265,7 @@ PrefabInstance: m_RemovedComponents: - {fileID: 6545938831321695140, guid: 494d51939a4d56f47a65310c2d52e286, type: 3} - {fileID: 2416869583082230119, guid: 494d51939a4d56f47a65310c2d52e286, type: 3} + - {fileID: 4490892002294479181, guid: 494d51939a4d56f47a65310c2d52e286, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 494d51939a4d56f47a65310c2d52e286, type: 3} --- !u!1 &5958827312421353464 stripped GameObject: @@ -265,9 +279,9 @@ GameObject: type: 3} m_PrefabInstance: {fileID: 8219148621552729296} m_PrefabAsset: {fileID: 0} ---- !u!64 &5495115456470386077 stripped -MeshCollider: - m_CorrespondingSourceObject: {fileID: 4490892002294479181, guid: 494d51939a4d56f47a65310c2d52e286, +--- !u!1 &3050323588128677620 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 6360390249657213476, guid: 494d51939a4d56f47a65310c2d52e286, type: 3} m_PrefabInstance: {fileID: 8219148621552729296} m_PrefabAsset: {fileID: 0} diff --git a/Unity/Assets/Mod/Evil Fumo/Materials/evil fumo.mat b/Unity/Assets/Mod/Evil Fumo/Materials/evil fumo.mat index cf20095f..258d108d 100644 --- a/Unity/Assets/Mod/Evil Fumo/Materials/evil fumo.mat +++ b/Unity/Assets/Mod/Evil Fumo/Materials/evil fumo.mat @@ -56,7 +56,7 @@ Material: m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} - _SpecGlossMap: - m_Texture: {fileID: 0} + m_Texture: {fileID: 2800000, guid: a1960a22c37049e4d9f35041668a7f2b, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: diff --git a/Unity/Assets/Mod/Hiyorifish/Hiyorifish.prefab b/Unity/Assets/Mod/Hiyorifish/Hiyorifish.prefab index de46a7bf..672682ca 100644 --- a/Unity/Assets/Mod/Hiyorifish/Hiyorifish.prefab +++ b/Unity/Assets/Mod/Hiyorifish/Hiyorifish.prefab @@ -13,7 +13,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: storyGoalSN: - storyGoalBZ: SanctuaryCompleted + storyGoalBZ: MargBaseFirstVisit --- !u!1 &9000506824905469698 GameObject: m_ObjectHideFlags: 0 diff --git a/Unity/Assets/Mod/Neurofumo/Fumo Item Spawns.asset b/Unity/Assets/Mod/Neurofumo/Fumo Item Spawns.asset index 9c333037..36e221e1 100644 --- a/Unity/Assets/Mod/Neurofumo/Fumo Item Spawns.asset +++ b/Unity/Assets/Mod/Neurofumo/Fumo Item Spawns.asset @@ -19,5 +19,5 @@ MonoBehaviour: techType: 2007 itemData: {fileID: 11400000, guid: b81a466a47b11be4e870eaaa30acf5aa, type: 2} locations: - - position: {x: -327, y: 15, z: 265} - rotation: {x: 0, y: 125, z: 0} + - position: {x: -326.7, y: 15, z: 264.7} + rotation: {x: 0, y: 120, z: 0} diff --git a/Unity/Assets/Mod/Neurofumo/Neurofumo item.prefab b/Unity/Assets/Mod/Neurofumo/Neurofumo item.prefab index 01622d84..51a14fa8 100644 --- a/Unity/Assets/Mod/Neurofumo/Neurofumo item.prefab +++ b/Unity/Assets/Mod/Neurofumo/Neurofumo item.prefab @@ -109,6 +109,19 @@ MonoBehaviour: hugColdResistBuff: 20 fumoModelSN: {fileID: 5699160057072596943} fumoModelBZ: {fileID: 7859187418265201921} +--- !u!65 &2518586707761524305 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7560228998955499274} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 0.44502357, y: 0.4296356, z: 0.30601627} + m_Center: {x: 0.0002747625, y: 0.21236391, z: -0.007984728} --- !u!1001 &5020507161881458003 PrefabInstance: m_ObjectHideFlags: 0 @@ -179,6 +192,7 @@ PrefabInstance: m_RemovedComponents: - {fileID: 8317964624639854247, guid: 5a15aed96d8d1b84592bfbe203825ee4, type: 3} - {fileID: 5866251422976589946, guid: 5a15aed96d8d1b84592bfbe203825ee4, type: 3} + - {fileID: 3622410975456045228, guid: 5a15aed96d8d1b84592bfbe203825ee4, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 5a15aed96d8d1b84592bfbe203825ee4, type: 3} --- !u!1 &5527787040625736568 stripped GameObject: @@ -192,6 +206,12 @@ GameObject: type: 3} m_PrefabInstance: {fileID: 5020507161881458003} m_PrefabAsset: {fileID: 0} +--- !u!1 &7560228998955499274 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 3262638706433378905, guid: 5a15aed96d8d1b84592bfbe203825ee4, + type: 3} + m_PrefabInstance: {fileID: 5020507161881458003} + m_PrefabAsset: {fileID: 0} --- !u!1 &3269361375025024291 stripped GameObject: m_CorrespondingSourceObject: {fileID: 7562518425654818928, guid: 5a15aed96d8d1b84592bfbe203825ee4,