Skip to content

Commit

Permalink
Merge branch 'master' into docs
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeTwentyThree committed Dec 19, 2023
2 parents d97fbb9 + ac10add commit c1905c0
Show file tree
Hide file tree
Showing 87 changed files with 2,538 additions and 1,051 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build

on:
push:
branches-ignore:
- docs

jobs:
SN1:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: .NET Setup
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.x

- name: Nuget Setup
uses: nuget/setup-nuget@v1

- name: Nuget Restore
run: nuget restore Nautilus.sln

- name: Build Project
run: dotnet build Nautilus.sln -c SN.STABLE
BZ:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: .NET Setup
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.x

- name: Nuget Setup
uses: nuget/setup-nuget@v1

- name: Nuget Restore
run: nuget restore Nautilus.sln

- name: Build Project
run: dotnet build Nautilus.sln -c BZ.STABLE
10 changes: 5 additions & 5 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ We thank all of the following individuals for their contributions to Nautilus. T

| Name | Picture | Commits | Name | Picture | Commits | Name | Picture | Commits |
| ---- | --------------- | ------ | ---- | --------------- | ------ | ---- | --------------- | ------ |
| [MrPurple6411](https://github.com/MrPurple6411) | <img src="https://avatars.githubusercontent.com/u/7858500?v=4" width="50"> | 433 | [PrimeSonic](https://github.com/PrimeSonic) | <img src="https://avatars.githubusercontent.com/u/39146191?v=4" width="50"> | 312 | [Metious](https://github.com/Metious) | <img src="https://avatars.githubusercontent.com/u/71298690?v=4" width="50"> | 287 |
| [MrPurple6411](https://github.com/MrPurple6411) | <img src="https://avatars.githubusercontent.com/u/7858500?v=4" width="50"> | 457 | [Metious](https://github.com/Metious) | <img src="https://avatars.githubusercontent.com/u/71298690?v=4" width="50"> | 314 | [PrimeSonic](https://github.com/PrimeSonic) | <img src="https://avatars.githubusercontent.com/u/39146191?v=4" width="50"> | 312 |
| [toebeann](https://github.com/toebeann) | <img src="https://avatars.githubusercontent.com/u/45315526?v=4" width="50"> | 228 | [ahk1221](https://github.com/ahk1221) | <img src="https://avatars.githubusercontent.com/u/16101353?v=4" width="50"> | 212 | [Alexejhero](https://github.com/Alexejhero) | <img src="https://avatars.githubusercontent.com/u/32238504?v=4" width="50"> | 207 |
| [LeeTwentyThree](https://github.com/LeeTwentyThree) | <img src="https://avatars.githubusercontent.com/u/31892011?v=4" width="50"> | 105 | [zorgesho](https://github.com/zorgesho) | <img src="https://avatars.githubusercontent.com/u/53096970?v=4" width="50"> | 42 | [JKohlman](https://github.com/JKohlman) | <img src="https://avatars.githubusercontent.com/u/2236351?v=4" width="50"> | 37 |
| [LeeTwentyThree](https://github.com/LeeTwentyThree) | <img src="https://avatars.githubusercontent.com/u/31892011?v=4" width="50"> | 129 | [zorgesho](https://github.com/zorgesho) | <img src="https://avatars.githubusercontent.com/u/53096970?v=4" width="50"> | 42 | [JKohlman](https://github.com/JKohlman) | <img src="https://avatars.githubusercontent.com/u/2236351?v=4" width="50"> | 37 |
| [K07H](https://github.com/K07H) | <img src="https://avatars.githubusercontent.com/u/8804812?v=4" width="50"> | 22 | [Vlad-00003](https://github.com/Vlad-00003) | <img src="https://avatars.githubusercontent.com/u/31519848?v=4" width="50"> | 11 | [EckoTheBat](https://github.com/EckoTheBat) | <img src="https://avatars.githubusercontent.com/u/31031556?v=4" width="50"> | 11 |
| [Cattlesquat](https://github.com/Cattlesquat) | <img src="https://avatars.githubusercontent.com/u/3742246?v=4" width="50"> | 5 | [github-actions[bot]](https://github.com/apps/github-actions) | <img src="https://avatars.githubusercontent.com/in/15368?v=4" width="50"> | 5 | [DingoDjango](https://github.com/DingoDjango) | <img src="https://avatars.githubusercontent.com/u/3172881?v=4" width="50"> | 4 |
| [github-actions[bot]](https://github.com/apps/github-actions) | <img src="https://avatars.githubusercontent.com/in/15368?v=4" width="50"> | 9 | [Cattlesquat](https://github.com/Cattlesquat) | <img src="https://avatars.githubusercontent.com/u/3742246?v=4" width="50"> | 5 | [DingoDjango](https://github.com/DingoDjango) | <img src="https://avatars.githubusercontent.com/u/3172881?v=4" width="50"> | 4 |
| [celvro](https://github.com/celvro) | <img src="https://avatars.githubusercontent.com/u/6541615?v=4" width="50"> | 4 | [NeisesMike](https://github.com/NeisesMike) | <img src="https://avatars.githubusercontent.com/u/17013743?v=4" width="50"> | 3 | [VELD-Dev](https://github.com/VELD-Dev) | <img src="https://avatars.githubusercontent.com/u/36549174?v=4" width="50"> | 3 |
| [vlyon](https://github.com/vlyon) | <img src="https://avatars.githubusercontent.com/u/791353?v=4" width="50"> | 3 | [EldritchCarMaker](https://github.com/EldritchCarMaker) | <img src="https://avatars.githubusercontent.com/u/97289845?v=4" width="50"> | 3 | [jonahnm](https://github.com/jonahnm) | <img src="https://avatars.githubusercontent.com/u/61718056?v=4" width="50"> | 3 |
| [brett-taylor](https://github.com/brett-taylor) | <img src="https://avatars.githubusercontent.com/u/3868773?v=4" width="50"> | 2 | [RamuneNeptune](https://github.com/RamuneNeptune) | <img src="https://avatars.githubusercontent.com/u/94365980?v=4" width="50"> | 2 | [DeadMor0z](https://github.com/DeadMor0z) | <img src="https://avatars.githubusercontent.com/u/13347404?v=4" width="50"> | 1 |
| [SamuramongeDev](https://github.com/SamuramongeDev) | <img src="https://avatars.githubusercontent.com/u/76671705?v=4" width="50"> | 1 |
| [brett-taylor](https://github.com/brett-taylor) | <img src="https://avatars.githubusercontent.com/u/3868773?v=4" width="50"> | 2 | [RamuneNeptune](https://github.com/RamuneNeptune) | <img src="https://avatars.githubusercontent.com/u/94365980?v=4" width="50"> | 2 | [tinyhoot](https://github.com/tinyhoot) | <img src="https://avatars.githubusercontent.com/u/78366332?v=4" width="50"> | 2 |
| [DeadMor0z](https://github.com/DeadMor0z) | <img src="https://avatars.githubusercontent.com/u/13347404?v=4" width="50"> | 1 | [Govorunb](https://github.com/Govorunb) | <img src="https://avatars.githubusercontent.com/u/3830522?v=4" width="50"> | 1 | [SamuramongeDev](https://github.com/SamuramongeDev) | <img src="https://avatars.githubusercontent.com/u/76671705?v=4" width="50"> | 1 |

If you notice a problem with this file, feel free to report an issue in the repository.

Expand Down
24 changes: 24 additions & 0 deletions CLA/Signatures.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,30 @@
"created_at": "2023-07-29T17:09:01Z",
"repoId": 123711758,
"pullRequestNo": 439
},
{
"name": "tinyhoot",
"id": 78366332,
"comment_id": 1710014306,
"created_at": "2023-09-07T11:51:20Z",
"repoId": 123711758,
"pullRequestNo": 461
},
{
"name": "MrPurple6411",
"id": 7858500,
"comment_id": 1733771244,
"created_at": "2023-09-25T14:00:10Z",
"repoId": 123711758,
"pullRequestNo": 468
},
{
"name": "Govorunb",
"id": 3830522,
"comment_id": 1825332180,
"created_at": "2023-11-24T08:52:03Z",
"repoId": 123711758,
"pullRequestNo": 505
}
]
}
41 changes: 41 additions & 0 deletions Example mod/BiomeHandlerExample.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using BepInEx;
using Nautilus.Assets;
using Nautilus.Assets.PrefabTemplates;
using Nautilus.Handlers;
using Nautilus.Utility;
using UnityEngine;

namespace Nautilus.Examples;

[BepInPlugin("com.snmodding.nautilus.biomehandler", "Nautilus Biome Example Mod", Nautilus.PluginInfo.PLUGIN_VERSION)]
[BepInDependency("com.snmodding.nautilus")]
public class BiomeHandlerExample : BaseUnityPlugin
{
private void Awake()
{
// Register the new biome into the game
var lilyPadsFogSettings = BiomeUtils.CreateBiomeSettings(new Vector3(20, 5, 6), 0.6f, Color.white, 0.45f,
new Color(0.18f, 0.604f, 0.404f), 0.05f, 20, 1, 1.25f, 20);
#if SUBNAUTICA
BiomeHandler.RegisterBiome("nautilusexamplebiome", lilyPadsFogSettings, new BiomeHandler.SkyReference("SkyKelpForest"));
#elif BELOWZERO
BiomeHandler.RegisterBiome("nautilusexamplebiome", lilyPadsFogSettings, new BiomeHandler.SkyReference("SkyLilyPads"));
#endif

#if SUBNAUTICA
// Add wreck ambience & music
BiomeHandler.AddBiomeMusic("nautilusexamplebiome", AudioUtils.GetFmodAsset("event:/env/music/wreak_ambience_big_music"));
BiomeHandler.AddBiomeAmbience("nautilusexamplebiome", AudioUtils.GetFmodAsset("event:/env/background/wreak_ambience_big"), FMODGameParams.InteriorState.OnlyOutside);
#endif

// Create an atmosphere volume for the biome
PrefabInfo volumePrefabInfo = PrefabInfo.WithTechType("NautilusExampleBiomeSphereVolume");
CustomPrefab volumePrefab = new CustomPrefab(volumePrefabInfo);
AtmosphereVolumeTemplate volumeTemplate = new AtmosphereVolumeTemplate(volumePrefabInfo, AtmosphereVolumeTemplate.VolumeShape.Sphere, "nautilusexamplebiome");
volumePrefab.SetGameObject(volumeTemplate);
volumePrefab.Register();

// Add the biome somewhere to the world
CoordinatedSpawnsHandler.RegisterCoordinatedSpawn(new SpawnInfo(volumePrefabInfo.ClassID, new Vector3(-1400, -80, 600), Quaternion.identity, new Vector3(50, 50, 50)));
}
}
4 changes: 2 additions & 2 deletions Example mod/CreatureEggExample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ private static void AwakePostfix(Creature __instance)
private void Awake()
{
#if SUBNAUTICA
CustomPrefab customEgg = new CustomPrefab("ReaperEgg", "Reaper Leviathan Egg", "Reaper Leviathan Egg that makes me go yes.");
CustomPrefab customEgg = new CustomPrefab("ReaperEggExample", "Reaper Leviathan Egg", "Reaper Leviathan Egg that makes me go yes.");
#else
CustomPrefab customEgg = new CustomPrefab("ChelicerateEgg", "Chelicerate Egg", "Chelicerate Egg that makes me go yes.");
CustomPrefab customEgg = new CustomPrefab("ChelicerateEggExample", "Chelicerate Egg", "Chelicerate Egg that makes me go yes.");
#endif
customEgg.Info.WithSizeInInventory(new Vector2int(3, 3));

Expand Down
89 changes: 45 additions & 44 deletions Example mod/Example mod.csproj
Original file line number Diff line number Diff line change
@@ -1,47 +1,48 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<RootNamespace>Nautilus.Examples</RootNamespace>
<AssemblyName>Nautilus.Example</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>latest</LangVersion>
<Configurations>SN.STABLE;BZ.STABLE</Configurations>
<Platforms>AnyCPU</Platforms>
<Copyright>Copyright © 2023</Copyright>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
</PropertyGroup>
<Import Project="$(SolutionDir)Version.targets" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'SN.STABLE|AnyCPU'">
<OutputPath>bin\SN.STABLE\</OutputPath>
<DefineConstants>SUBNAUTICA;SUBNAUTICA_STABLE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'BZ.STABLE|AnyCPU'">
<OutputPath>bin\BZ.STABLE\</OutputPath>
<DefineConstants>BELOWZERO;BELOWZERO_STABLE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Nautilus\Nautilus.csproj">
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="BepInEx.Core" Version="5.4.21" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.1.0" />
<PackageReference Include="PolySharp" Version="1.13.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<Target Name="CopyToOutputPath" AfterTargets="Build">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\common.props" />
<Import Project="$(SolutionDir)Version.targets" />
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
<RootNamespace>Nautilus.Examples</RootNamespace>
<AssemblyName>Nautilus.Example</AssemblyName>
<BepInExPluginVersion>$(VersionPrefix).$(SuffixNumber)</BepInExPluginVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>latest</LangVersion>
<Configurations>SN.STABLE;BZ.STABLE</Configurations>
<Platforms>AnyCPU</Platforms>
<Copyright>Copyright © 2023</Copyright>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'SN.STABLE|AnyCPU'">
<OutputPath>bin\SN.STABLE\</OutputPath>
<DefineConstants>SUBNAUTICA;SUBNAUTICA_STABLE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'BZ.STABLE|AnyCPU'">
<OutputPath>bin\BZ.STABLE\</OutputPath>
<DefineConstants>BELOWZERO;BELOWZERO_STABLE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<LocalizationFiles Include="Localization\*.*" />
<ProjectReference Include="..\Nautilus\Nautilus.csproj">
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<Copy SourceFiles="@(LocalizationFiles)" DestinationFolder="$(OutDir)\Localization" SkipUnchangedFiles="true" />
</Target>
<ItemGroup>
<PackageReference Include="BepInEx.Core" Version="5.4.21" />
<PackageReference Include="BepInEx.PluginInfoProps" Version="1.1.0" />
<PackageReference Include="PolySharp" Version="1.13.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<Target Name="CopyToOutputPath" AfterTargets="Build">
<ItemGroup>
<LocalizationFiles Include="Localization\*.*" />
</ItemGroup>
<Copy SourceFiles="@(LocalizationFiles)" DestinationFolder="$(OutDir)\Localization" SkipUnchangedFiles="true" />
</Target>
</Project>
4 changes: 3 additions & 1 deletion Nautilus.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5152F028-6D03-43C0-88C5-986313017D4F}"
ProjectSection(SolutionItems) = preProject
common.props = common.props
Directory.Build.props = Directory.Build.props
PostBuild.targets = PostBuild.targets
Version.targets = Version.targets
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UploadHelper", "UploadHelper\UploadHelper.csproj", "{1D6AED20-87CC-4756-8E6A-1E8A10E16EB1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UploadHelper", "UploadHelper\UploadHelper.csproj", "{1D6AED20-87CC-4756-8E6A-1E8A10E16EB1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
12 changes: 7 additions & 5 deletions Nautilus/Assets/Gadgets/CraftingGadget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,8 @@ protected internal override void Build()

CraftDataHandler.SetRecipeData(prefab.Info.TechType, RecipeData);

if (FabricatorType == CraftTree.Type.None)
{
InternalLogger.Log($"Prefab '{prefab.Info.ClassID}' was not automatically registered into a crafting tree.");
}
else

if (FabricatorType is not CraftTree.Type.None)
{
if (StepsToFabricatorTab == null || StepsToFabricatorTab.Length == 0)
{
Expand All @@ -103,6 +100,11 @@ protected internal override void Build()
{
CraftTreeHandler.AddCraftingNode(FabricatorType, prefab.Info.TechType, StepsToFabricatorTab);
}

}
else if (!prefab.TryGetGadget(out ScanningGadget scanningGadget) || !scanningGadget.IsBuildable)
{
InternalLogger.Debug($"Prefab '{prefab.Info.ClassID}' was not automatically registered into a crafting tree.");
}

if (CraftingTime >= 0f)
Expand Down
31 changes: 23 additions & 8 deletions Nautilus/Assets/Gadgets/EggGadget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ namespace Nautilus.Assets.Gadgets;
public class EggGadget : Gadget
{
/// <summary>
/// The total amount of ACU floors required for the egg to be dropped in the ACU. defaulted to 1.
/// The total amount of normal ACU floors required for the egg to be dropped in the ACU. If this is set to 0, the egg will not be accepted in the normal ACU. Defaulted to 1.
/// </summary>
public int RequiredAcuSize { get; set; } = 1;

/// <summary>
/// The total amount of Large ACU floors required for the egg to be dropped in. If this is set to 0, the egg will not be accepted in the large ACU. Defaulted to 1.
/// </summary>
public int RequiredLargeAcuSize { get; set; } = 1;

/// <summary>
/// makes the egg immune to the Lost River's Acidic Brine.
/// </summary>
Expand All @@ -23,23 +28,36 @@ public class EggGadget : Gadget
/// Constructs a Creature egg gadget instance.
/// </summary>
/// <param name="prefab">The custom prefab to operate on.</param>
/// <param name="requiredAcuSize">The total amount of ACU floors required for the egg to be dropped in the ACU.</param>
/// <param name="requiredAcuSize">The total amount of ACU floors required for the egg to be dropped in the ACU. This value is shared between the normal and large ACU.</param>
public EggGadget(ICustomPrefab prefab, int requiredAcuSize = 1) : base(prefab)
{
RequiredAcuSize = requiredAcuSize;
RequiredLargeAcuSize = requiredAcuSize;
}

/// <summary>
/// The total amount of ACU floors required for the egg to be dropped in the ACU.
/// The total amount of normal ACU floors required for the egg to be dropped in the ACU.
/// </summary>
/// <param name="requiredAcuSize">The ACU stacks value.</param>
/// <param name="requiredAcuSize">The ACU stacks value. If this is set to 0, the egg will not be accepted in the normal ACU.</param>
/// <returns>A reference to this instance after the operation has completed.</returns>
public EggGadget WithRequiredAcuSize(int requiredAcuSize)
{
RequiredAcuSize = requiredAcuSize;

return this;
}

/// <summary>
/// The total amount of Large ACU floors required for the egg to be dropped in.
/// </summary>
/// <param name="requiredLargeAcuSize">The large ACU stacks value. If this is set to 0, the egg will not be accepted in the large ACU.</param>
/// <returns>A reference to this instance after the operation has completed.</returns>
public EggGadget WithRequiredLargeAcuSize(int requiredLargeAcuSize)
{
RequiredLargeAcuSize = requiredLargeAcuSize;

return this;
}

/// <summary>
/// makes the egg immune to the Lost River's Acidic Brine.
Expand All @@ -65,9 +83,6 @@ protected internal override void Build()
if (AcidImmune)
DamageSystem.acidImmune.Add(prefab.Info.TechType);

if (RequiredAcuSize > 1)
{
WaterParkPatcher.requiredAcuSize[prefab.Info.TechType] = RequiredAcuSize;
}
WaterParkPatcher.requiredAcuSize[prefab.Info.TechType] = this;
}
}
Loading

0 comments on commit c1905c0

Please sign in to comment.