Skip to content

Commit

Permalink
Merge branch 'main' into uuh
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexejhero authored Dec 16, 2023
2 parents 51e15ef + a2824ff commit 3b85966
Show file tree
Hide file tree
Showing 14 changed files with 113 additions and 35 deletions.
5 changes: 5 additions & 0 deletions SCHIZO/Creatures/Components/Carryable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ partial class Carryable
typeof(WorldAmbientSoundPlayer),
typeof(SwimBehaviour),
typeof(Rigidbody),
#if BELOWZERO
typeof(LandCreatureGravity),
#else
typeof(CaveCrawlerGravity),
#endif
typeof(Creature)
];

Expand Down
14 changes: 11 additions & 3 deletions SCHIZO/Creatures/Components/DisableUntilStoryGoal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Pickupable>();
if (pickupable && pickupable.attached) return; // otherwise inventory items swim away
gameObject.SetActive(StoryGoalHelpers.IsCompleted(storyGoal));
}
}
3 changes: 2 additions & 1 deletion SCHIZO/Helpers/StoryGoalHelpers.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Runtime.CompilerServices;
using Story;

Expand All @@ -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));

Expand Down
32 changes: 29 additions & 3 deletions SCHIZO/Items/FumoItem/EvilFumoItemTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand All @@ -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
{
Expand Down Expand Up @@ -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()
{
Expand Down
30 changes: 17 additions & 13 deletions SCHIZO/Items/FumoItem/FumoItemTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion SCHIZO/Jukebox/CustomJukeboxTrack.BelowZero.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ protected override void Register()
return;
}
CustomJukeboxTrackPatches.customTracks[trackId] = this;
RegisterInJukebox(null);
RegisterInJukebox(BZJukebox._main);

if (!Player.main) return;

Expand Down
2 changes: 1 addition & 1 deletion Unity/Assets/Mod/Anneel/Anneel.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
storyGoalSN:
storyGoalBZ: SanctuaryCompleted
storyGoalBZ: DeltaIslandFirstVisit
--- !u!136 &5906089814064505694
CapsuleCollider:
m_ObjectHideFlags: 0
Expand Down
6 changes: 3 additions & 3 deletions Unity/Assets/Mod/Evil Fumo/Evil Fumo Spawns.asset
Original file line number Diff line number Diff line change
Expand Up @@ -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}
4 changes: 2 additions & 2 deletions Unity/Assets/Mod/Evil Fumo/Evil Fumo item data.asset
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
22 changes: 18 additions & 4 deletions Unity/Assets/Mod/Evil Fumo/Evil Fumo item.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
plugOrigin: {fileID: 0}
mainCollider: {fileID: 5495115456470386077}
mainCollider: {fileID: 0}
pickupable: {fileID: 986444971531117965}
renderers: []
ikAimLeftArm: 1
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion Unity/Assets/Mod/Evil Fumo/Materials/evil fumo.mat
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Unity/Assets/Mod/Hiyorifish/Hiyorifish.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
storyGoalSN:
storyGoalBZ: SanctuaryCompleted
storyGoalBZ: MargBaseFirstVisit
--- !u!1 &9000506824905469698
GameObject:
m_ObjectHideFlags: 0
Expand Down
4 changes: 2 additions & 2 deletions Unity/Assets/Mod/Neurofumo/Fumo Item Spawns.asset
Original file line number Diff line number Diff line change
Expand Up @@ -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}
20 changes: 20 additions & 0 deletions Unity/Assets/Mod/Neurofumo/Neurofumo item.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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,
Expand Down

0 comments on commit 3b85966

Please sign in to comment.