-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from tinyhoot/v0.10
Update to v0.10
- Loading branch information
Showing
24 changed files
with
284 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using HarmonyLib; | ||
using SubnauticaRandomiser.Interfaces; | ||
using SubnauticaRandomiser.Objects; | ||
using SubnauticaRandomiser.Objects.Enums; | ||
using SubnauticaRandomiser.Patches; | ||
using UnityEngine; | ||
|
||
namespace SubnauticaRandomiser.Logic | ||
{ | ||
/// <summary> | ||
/// Rudimentary module to handle raw materials like eggs in the logic. | ||
/// </summary> | ||
[RequireComponent(typeof(CoreLogic))] | ||
internal class RawMaterialLogic : MonoBehaviour, ILogicModule | ||
{ | ||
private CoreLogic _coreLogic; | ||
private ProgressionManager _manager; | ||
|
||
private void Awake() | ||
{ | ||
_coreLogic = GetComponent<CoreLogic>(); | ||
_manager = GetComponent<ProgressionManager>(); | ||
|
||
_coreLogic.RegisterEntityHandler(EntityType.RawMaterial, this); | ||
} | ||
|
||
public void ApplySerializedChanges(EntitySerializer serializer) { } | ||
|
||
public void RandomiseOutOfLoop(EntitySerializer serializer) { } | ||
|
||
public bool RandomiseEntity(ref LogicEntity entity) | ||
{ | ||
// Simply add this into the logic if prerequisites and depth check out. | ||
return entity.CheckReady(_coreLogic, _manager.ReachableDepth) | ||
&& entity.AccessibleDepth <= _manager.ReachableDepth; | ||
} | ||
|
||
public void SetupHarmonyPatches(Harmony harmony) | ||
{ | ||
// This one is an exception and *can* rely on config values because the patch only has to be applied once | ||
// on game start, and the saved data will carry over from then on. | ||
if (CoreLogic._Serializer.DiscoverEggs) | ||
harmony.PatchAll(typeof(EggPatcher)); | ||
} | ||
} | ||
} |
Oops, something went wrong.