Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ency path dropdown + coordinated spawns #41

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions SCHIZO/Creatures/UnityCreaturePrefab.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Diagnostics.CodeAnalysis;
using ECCLibrary;
using Nautilus.Handlers;
Expand Down Expand Up @@ -27,9 +27,9 @@ protected override void SetItemProperties()
if (UnityData.acidImmune) CreatureDataUtils.SetAcidImmune(ModItem);
if (UnityData.bioReactorCharge > 0) CreatureDataUtils.SetBioreactorCharge(ModItem, UnityData.bioReactorCharge);

if (UnityData.PDAEncyclopediaInfo)
if (UnityData.pdaEncyInfo)
{
PDAHandler.AddCustomScannerEntry(ModItem, UnityData.PDAEncyclopediaInfo.scanTime, encyclopediaKey: PrefabInfo.ClassID);
PDAHandler.AddCustomScannerEntry(ModItem, UnityData.pdaEncyInfo.scanTime, encyclopediaKey: PrefabInfo.ClassID);
}

if (UnityData.isPickupable)
Expand Down
1 change: 0 additions & 1 deletion SCHIZO/Items/Data/ItemData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ partial class ItemData
public string[] CraftTreePath => RetargetHelpers.Pick(craftTreePathSN, craftTreePathBZ).Split('/');
public TechGroup TechGroup => (TechGroup) RetargetHelpers.Pick(techGroupSN, techGroupBZ);
public TechCategory TechCategory => (TechCategory) RetargetHelpers.Pick(techCategorySN, techCategoryBZ);
public PDAEncyclopediaInfo PDAEncyclopediaInfo => RetargetHelpers.Pick(pdaEncyclopediaInfoSN, pdaEncyclopediaInfoBZ);
public KnownTechInfo KnownTechInfo => RetargetHelpers.Pick(knownTechInfoSN, knownTechInfoBZ);
public bool UnlockAtStart => RetargetHelpers.Pick(unlockAtStartSN, unlockAtStartBZ);
public TechType RequiredForUnlock => RetargetHelpers.Pick(requiredForUnlockSN, requiredForUnlockBZ).GetTechType();
Expand Down
9 changes: 5 additions & 4 deletions SCHIZO/Items/UnityPrefab.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Nautilus.Assets;
using Nautilus.Handlers;
Expand Down Expand Up @@ -132,11 +132,12 @@ protected virtual void SetItemProperties()
CraftDataHandler.AddToGroup(ModItem.ItemData.TechGroup, ModItem.ItemData.TechCategory, ModItem);
}

if (ModItem.ItemData.PDAEncyclopediaInfo)
if (ModItem.ItemData.pdaEncyInfo)
{
PDAEncyclopediaInfo i = ModItem.ItemData.PDAEncyclopediaInfo;
PDAEncyclopediaInfo i = ModItem.ItemData.pdaEncyInfo;
string encyPath = RetargetHelpers.Pick(i.encyPathSN, i.encyPathBZ);

PDAHandler.AddEncyclopediaEntry(ModItem.PrefabInfo.ClassID, i.encyPath, i.title, i.description.text, i.texture, i.unlockSprite,
PDAHandler.AddEncyclopediaEntry(ModItem.PrefabInfo.ClassID, encyPath, i.title, i.description.text, i.texture, i.unlockSprite,
i.isImportantUnlock ? PDAHandler.UnlockImportant : PDAHandler.UnlockBasic);

if (i.scanSounds) ScanSoundHandler.Register(ModItem, i.scanSounds);
Expand Down
2 changes: 1 addition & 1 deletion SCHIZO/Resources/AssetBundles/Assets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace SCHIZO.Resources;

public static class Assets
{
private const int _rnd = 228879590;
private const int _rnd = -1727900894;

private static readonly UnityEngine.AssetBundle _a = ResourceManager.GetAssetBundle("assets");

Expand Down
Binary file modified SCHIZO/Resources/AssetBundles/assets
Binary file not shown.
21 changes: 21 additions & 0 deletions SCHIZO/Spawns/CoordinatedSpawns.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Nautilus.Handlers;
using SCHIZO.Helpers;
using NSpawnInfo = Nautilus.Handlers.SpawnInfo;

namespace SCHIZO.Spawns;

partial class CoordinatedSpawns
{
protected override void Register()
{
foreach (SpawnInfo spawnInfo in spawns)
{
//if (!spawnInfo.game.HasFlag(GAME)) continue;

//foreach (SpawnInfo.SpawnLocation location in spawnInfo.spawnLocations)
SpawnInfo.SpawnLocation location = RetargetHelpers.Pick(spawnInfo.subnautica, spawnInfo.belowZero);
NSpawnInfo nSpawnInfo = new((TechType)spawnInfo.item.techType, location.position, location.rotation);
CoordinatedSpawnsHandler.RegisterCoordinatedSpawn(nSpawnInfo);
}
}
}
25 changes: 25 additions & 0 deletions Unity/Assets/Coordinated Spawns.asset
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a6ccb8c039e34e44ebdee40c7d89e4a4, type: 3}
m_Name: Coordinated Spawns
m_EditorClassIdentifier:
spawns:
- item:
isCustom: 0
techType: 0
itemData: {fileID: 0}
subnautica:
position: {x: 0, y: 0, z: 0}
rotation: {x: 0, y: 0, z: 0}
belowZero:
position: {x: 0, y: 0, z: 0}
rotation: {x: 0, y: 0, z: 0}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Unity/Assets/Ermfish/Databank/Databank.asset
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ MonoBehaviour:
isImportantUnlock: 0
scanSounds: {fileID: 8990697991671373227, guid: 1138c2d796e81ac43a4f257daf9651b7,
type: 2}
encyPath: Lifeforms/Fauna/SmallHerbivores
encyPathSN: Lifeforms/Fauna/SmallHerbivores
encyPathBZ: Research/Lifeforms/Fauna/SmallHerbivores
Alexejhero marked this conversation as resolved.
Show resolved Hide resolved
title: Ermfish
texture: {fileID: 2800000, guid: d49d9f150a353394d84717884b9d8c8f, type: 3}
description: {fileID: 4900000, guid: a784ad2033ad64a409b8d4ad1cda86a4, type: 3}
5 changes: 1 addition & 4 deletions Unity/Assets/Ermfish/Ermfish regular.asset
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,13 @@ MonoBehaviour:
isBuildable: 0
craftingTime: 2.5
itemSounds: {fileID: 11400000, guid: bfb77f100ed7e6e4fb42c9b05bcb00af, type: 2}
pdaEncyInfo: {fileID: 11400000, guid: 8b76d116f9af8fc499d4c055bf652966, type: 2}
registerInSN: 1
recipeSN: {fileID: 0}
craftTreeTypeSN: 0
craftTreePathSN:
techGroupSN: 14
techCategorySN: 0
pdaEncyclopediaInfoSN: {fileID: 11400000, guid: 8b76d116f9af8fc499d4c055bf652966,
type: 2}
knownTechInfoSN: {fileID: 11400000, guid: 89b8b3505e3ad2e48b2f9b7c378e4bbe, type: 2}
unlockAtStartSN: 1
requiredForUnlockSN:
Expand All @@ -70,8 +69,6 @@ MonoBehaviour:
craftTreePathBZ:
techGroupBZ: 13
techCategoryBZ: 0
pdaEncyclopediaInfoBZ: {fileID: 11400000, guid: 8b76d116f9af8fc499d4c055bf652966,
type: 2}
knownTechInfoBZ: {fileID: 11400000, guid: 89b8b3505e3ad2e48b2f9b7c378e4bbe, type: 2}
soundTypeBZ: 31
unlockAtStartBZ: 1
Expand Down
23 changes: 0 additions & 23 deletions Unity/Assets/Ermshark/Databank/Databank SN.asset

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1160e7f4151348eb97332e6bb0a2a034, type: 3}
m_Name: Databank BZ
m_Name: Databank
m_EditorClassIdentifier:
scanTime: 5
unlockSprite: {fileID: 21300000, guid: 85c36857a3ce21c49b2b3d2d1c09ecb6, type: 3}
isImportantUnlock: 0
scanSounds: {fileID: -2996190608115189883, guid: 935233e4761193a489883563680a8478,
type: 2}
encyPath: Lifeforms/Fauna/Carnivores
encyPathSN: Lifeforms/Fauna/Carnivores
encyPathBZ: Research/Lifeforms/Fauna/Carnivores
title: Ermshark
texture: {fileID: 2800000, guid: cee0542806d2bae418d81f925da9a9fa, type: 3}
description: {fileID: 4900000, guid: fa554e7d1e7ed174981f0e8702f16f2d, type: 3}
8 changes: 4 additions & 4 deletions Unity/Assets/Ermshark/Ermshark.asset
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ MonoBehaviour:
isCraftable: 0
isBuildable: 0
craftingTime: 2.5
itemSounds: {fileID: 0}
pdaEncyInfo: {fileID: 11400000, guid: dbc6837d8eb5b9f42a96dcb82632b52e, type: 2}
registerInSN: 1
recipeSN: {fileID: 0}
craftTreeTypeSN: 0
craftTreePathSN:
techGroupSN: 14
techCategorySN: 0
pdaEncyclopediaInfoSN: {fileID: 11400000, guid: dbc6837d8eb5b9f42a96dcb82632b52e,
type: 2}
knownTechInfoSN: {fileID: 0}
unlockAtStartSN: 0
requiredForUnlockSN:
Expand All @@ -37,13 +37,13 @@ MonoBehaviour:
itemData: {fileID: 0}
registerInBZ: 1
recipeBZ: {fileID: 0}
canBeRecycledBZ: 1
craftTreeTypeBZ: 0
craftTreePathBZ:
techGroupBZ: 13
techCategoryBZ: 0
pdaEncyclopediaInfoBZ: {fileID: 11400000, guid: c07efc17b4a326141b084b80f348be78,
type: 2}
knownTechInfoBZ: {fileID: 0}
soundTypeBZ: 0
unlockAtStartBZ: 0
requiredForUnlockBZ:
isCustom: 0
Expand Down
1 change: 1 addition & 0 deletions Unity/Assets/Registry.asset
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ MonoBehaviour:
- {fileID: 11400000, guid: c28559739ad713b4b8762ab1a05b5ae7, type: 2}
- {fileID: 11400000, guid: 9524b524fdb9ada419fb4f6c3d57fbbc, type: 2}
- {fileID: 11400000, guid: f240113ab1d4a1d42bcd6fc85fda4541, type: 2}
- {fileID: 11400000, guid: e84785f0b1b5820488bdff72c72ebe81, type: 2}
- {fileID: 11400000, guid: 007ce99e929c7f7468c68ebf8977f560, type: 2}
- {fileID: 11400000, guid: 24b80f032226d244e8d8bdd0ceb1cc0f, type: 2}
- {fileID: 11400000, guid: 701583dc8b02d354ea6c2d189ce33872, type: 2}
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,18 @@ private static string GetDropdownListBoth(CraftTree_Type_All type)
private readonly DropdownList<string> _craftTreePaths_SN_Fabricator = new DropdownList<string>()
{
{"(root)", ""},
{"Resources", "Resources"},
{"Resources -> Basic materials", "Resources/BasicMaterials"},
{"Resources -> Advanced materials", "Resources/AdvancedMaterials"},
{"Resources -> Electronics", "Resources/Electronics"},
{"Survival", "Survival"},
{"Survival -> Water", "Survival/Water"},
{"Survival -> Cooked food", "Survival/CookedFood"},
{"Survival -> Cured food", "Survival/CuredFood"},
{"Personal", "Personal"},
{"Personal -> Equipment", "Personal/Equipment"},
{"Personal -> Tools", "Personal/Tools"},
{"Personal -> Deployables", "Machines"},
{"Resources/(root)", "Resources"},
{"Resources/Basic materials", "Resources/BasicMaterials"},
{"Resources/Advanced materials", "Resources/AdvancedMaterials"},
{"Resources/Electronics", "Resources/Electronics"},
{"Survival/(root)", "Survival"},
{"Survival/Water", "Survival/Water"},
{"Survival/Cooked food", "Survival/CookedFood"},
{"Survival/Cured food", "Survival/CuredFood"},
{"Personal/(root)", "Personal"},
{"Personal/Equipment", "Personal/Equipment"},
{"Personal/Tools", "Personal/Tools"},
{"Personal/Deployables", "Machines"},
};

private readonly DropdownList<string> _craftTreePaths_SN_MVB = new DropdownList<string>()
Expand All @@ -156,21 +156,21 @@ private static string GetDropdownListBoth(CraftTree_Type_All type)
private readonly DropdownList<string> _craftTreePaths_BZ_Fabricator = new DropdownList<string>()
{
{"(root)", ""},
{"Resources", "Resources"},
{"Resources -> Basic materials", "Resources/BasicMaterials"},
{"Resources -> Advanced materials", "Resources/AdvancedMaterials"},
{"Resources -> Electronics", "Resources/Electronics"},
{"Survival", "Survival"},
{"Survival -> Water", "Survival/Water"},
{"Survival -> Cooked food", "Survival/CookedFood"},
{"Survival -> Cured food", "Survival/CuredFood"},
{"Personal", "Personal"},
{"Personal -> Equipment", "Personal/Equipment"},
{"Personal -> Tools", "Personal/Tools"},
{"Personal -> Deployables", "Machines"},
{"Upgrades", "Upgrades"},
{"Upgrades -> Prawn Suit Upgrades", "Upgrades/ExosuitUpgrades"},
{"Upgrades -> Seatruck Upgrades", "Upgrades/SeatruckUpgrades"},
{"Resources/(root)", "Resources"},
{"Resources/Basic materials", "Resources/BasicMaterials"},
{"Resources/Advanced materials", "Resources/AdvancedMaterials"},
{"Resources/Electronics", "Resources/Electronics"},
{"Survival/(root)", "Survival"},
{"Survival/Water", "Survival/Water"},
{"Survival/Cooked food", "Survival/CookedFood"},
{"Survival/Cured food", "Survival/CuredFood"},
{"Personal/(root)", "Personal"},
{"Personal/Equipment", "Personal/Equipment"},
{"Personal/Tools", "Personal/Tools"},
{"Personal/Deployables", "Machines"},
{"Upgrades/(root)", "Upgrades"},
{"Upgrades/Prawn Suit Upgrades", "Upgrades/ExosuitUpgrades"},
{"Upgrades/Seatruck Upgrades", "Upgrades/SeatruckUpgrades"},
};

private readonly DropdownList<string> _craftTreePaths_BZ_MVB = new DropdownList<string>()
Expand Down
14 changes: 5 additions & 9 deletions Unity/Assets/Scripts/SCHIZO/Items/Data/ItemData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using SCHIZO.Attributes.Visual;
using SCHIZO.Sounds;
using UnityEngine;
using UnityEngine.Serialization;
using static NaughtyAttributes.EConditionOperator;

namespace SCHIZO.Items.Data
Expand Down Expand Up @@ -45,9 +44,12 @@
[CommonData, ShowIf(nameof(Sounds_ShowIf))]
public ItemSounds itemSounds;

[CommonData, Label("PDA Ency Info")]
public PDAEncyclopediaInfo pdaEncyInfo;

#region Subnautica Data

[SNData, Label("Register"), SerializeField, Careful]
[SNData, Label("Register"), Careful]
public bool registerInSN = true;

[SNData, Label("Recipe"), SerializeField, ShowIf(And, nameof(registerInSN), nameof(IsBuildableOrCraftable)), Careful]
Expand All @@ -65,9 +67,6 @@
[SNData, Label("Tech Category"), SerializeField, ShowIf(And, nameof(registerInSN), nameof(techCategorySN_ShowIf)), UsedImplicitly]
private TechCategory_SN techCategorySN;

[FormerlySerializedAs("databankInfoSN"), SNData, Label("PDA Ency Info"), SerializeField, UsedImplicitly, ShowIf(nameof(registerInSN))]
private PDAEncyclopediaInfo pdaEncyclopediaInfoSN;

[SNData, Label("Known Tech Info"), SerializeField, UsedImplicitly, ShowIf(And, nameof(registerInSN), nameof(ShowPickupableProps))]
private KnownTechInfo knownTechInfoSN;

Expand All @@ -81,7 +80,7 @@

#region Below Zero Data

[BZData, Label("Register"), SerializeField, Careful]
[BZData, Label("Register"), Careful]
public bool registerInBZ = true;

[BZData, Label("Recipe"), SerializeField, ShowIf(And, nameof(registerInBZ), nameof(IsBuildableOrCraftable)), Careful]
Expand All @@ -102,14 +101,11 @@
[BZData, Label("Tech Category"), SerializeField, ShowIf(And, nameof(registerInBZ), nameof(techCategoryBZ_ShowIf)), UsedImplicitly]
private TechCategory_BZ techCategoryBZ;

[FormerlySerializedAs("databankInfoBZ")] [BZData, Label("PDA Ency Info"), SerializeField, UsedImplicitly, ShowIf(nameof(registerInBZ))]
private PDAEncyclopediaInfo pdaEncyclopediaInfoBZ;

[BZData, Label("Known Tech Info"), SerializeField, UsedImplicitly, ShowIf(And, nameof(registerInBZ), nameof(ShowPickupableProps))]
private KnownTechInfo knownTechInfoBZ;

[BZData, Label("Sound Type"), SerializeField, UsedImplicitly, ShowIf(And, nameof(registerInBZ), nameof(Sounds_ShowIf))]
private TechData_SoundType_BZ soundTypeBZ;

Check warning on line 108 in Unity/Assets/Scripts/SCHIZO/Items/Data/ItemData.cs

View workflow job for this annotation

GitHub Actions / build (Subnautica)

The field 'ItemData.soundTypeBZ' is never used

Check warning on line 108 in Unity/Assets/Scripts/SCHIZO/Items/Data/ItemData.cs

View workflow job for this annotation

GitHub Actions / build (Subnautica)

The field 'ItemData.soundTypeBZ' is never used

[BZData, Label("Unlock At Start"), SerializeField, UsedImplicitly, ShowIf(And, nameof(registerInBZ), nameof(IsBuildableOrCraftable)), Careful]
private bool unlockAtStartBZ = true;
Expand Down
Loading
Loading