diff --git a/ChensGradiusMod/Artifacts/Machines/Machines.Setup.cs b/ChensGradiusMod/Artifacts/Machines/Machines.Setup.cs index 07e14b9..114aff4 100644 --- a/ChensGradiusMod/Artifacts/Machines/Machines.Setup.cs +++ b/ChensGradiusMod/Artifacts/Machines/Machines.Setup.cs @@ -1,4 +1,5 @@ using Chen.Helpers.GeneralHelpers; +using R2API; using RoR2; using System.Collections.Generic; using TILER2; @@ -107,6 +108,13 @@ public override void SetupBehavior() AddEnemyDroneType(missileDroneMaster, missileDroneSpawnWeight); AddEnemyDroneType(turret1Master, gunnerTurretSpawnWeight); AddEnemyDroneType(tc280DroneMaster, tc280SpawnWeight); + AddLanguageTokens(); + } + + private void AddLanguageTokens() + { + LanguageAPI.Add("CHENSGRADIUSMOD_MACHINES_NAME_RENDERED", "Artifact of Machines"); + LanguageAPI.Add("CHENSGRADIUSMOD_MACHINES_DESC_RENDERED", GetDescString()); } private bool IsPrototypeCountUncapped(CharacterMaster master) @@ -149,13 +157,23 @@ private void SummonDrone(CharacterBody ownerBody, GameObject droneMasterPrefab, ModelLocator component = bodyObject.GetComponent(); if (component && component.modelTransform) { - TemporaryOverlay temporaryOverlay = component.modelTransform.gameObject.AddComponent(); + var overlay = TemporaryOverlayManager.AddOverlay(component.modelTransform.gameObject); + overlay.duration = 0.5f; + overlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); + overlay.animateShaderAlpha = true; + overlay.destroyComponentOnEnd = true; + overlay.originalMaterial = summonDroneMaterial; + overlay.AddToCharacterModel(component.modelTransform.GetComponent()); + + /*TemporaryOverlay temporaryOverlay = component.modelTransform.gameObject.AddComponent(); temporaryOverlay.duration = 0.5f; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = summonDroneMaterial; - temporaryOverlay.AddToCharacerModel(component.modelTransform.GetComponent()); + temporaryOverlay.AddToCharacerModel(component.modelTransform.GetComponent());*/ + + //this above is outdated and caused NREs so I just used what modding discord suggested via TemporaryOverlayManager } } RepositionGroundedDrones(characterMaster.GetBody(), ownerBody.transform.position); diff --git a/ChensGradiusMod/ChensGradiusMod.csproj b/ChensGradiusMod/ChensGradiusMod.csproj index db5ccd9..7d7b036 100644 --- a/ChensGradiusMod/ChensGradiusMod.csproj +++ b/ChensGradiusMod/ChensGradiusMod.csproj @@ -38,6 +38,12 @@ + + + + + + all @@ -71,7 +77,7 @@ - lib\Aetherium.dll + ..\..\..\aetherium\AetheriumMod-SotS\Aetherium\bin\Debug\netstandard2.1\Aetherium.dll lib\ChensHelpers.dll diff --git a/ChensGradiusMod/Compatibility/Aetherium.cs b/ChensGradiusMod/Compatibility/Aetherium.cs index f2eef62..e6713bf 100644 --- a/ChensGradiusMod/Compatibility/Aetherium.cs +++ b/ChensGradiusMod/Compatibility/Aetherium.cs @@ -1,7 +1,8 @@ using Aetherium; -using Aetherium.Items; using RoR2; -using static Aetherium.Items.EngineersToolbelt; +using Aetherium.Items.Tier2; +using Aetherium.Items.Tier3; +using static Aetherium.Items.Tier2.EngineersToolbelt; using static Chen.GradiusMod.GradiusModPlugin; namespace Chen.GradiusMod.Compatibility diff --git a/ChensGradiusMod/Drones/Drone.cs b/ChensGradiusMod/Drones/Drone.cs index 4dd74ed..01aa00b 100644 --- a/ChensGradiusMod/Drones/Drone.cs +++ b/ChensGradiusMod/Drones/Drone.cs @@ -1,5 +1,5 @@ using BepInEx.Configuration; -using Chen.GradiusMod.Artifacts.Machines; +//using Chen.GradiusMod.Artifacts.Machines; using Chen.GradiusMod.Items.GradiusOption; using System; using UnityEngine; @@ -173,7 +173,7 @@ protected virtual void SetupComponents() protected virtual void SetupBehavior() { if (canHaveOptions) GradiusOption.instance.SupportMinionType(name); - Machines.instance.AddEnemyDroneType(DroneCharacterMasterObject, spawnWeightWithMachinesArtifact); + //Machines.instance.AddEnemyDroneType(DroneCharacterMasterObject, spawnWeightWithMachinesArtifact); if (Compatibility.Aetherium.enabled) { if (canBeInspired) Compatibility.Aetherium.AddInspiredCustomDrone(name); diff --git a/ChensGradiusMod/Drones/DroneDeathState.cs b/ChensGradiusMod/Drones/DroneDeathState.cs index 6b3aa32..a6a1726 100644 --- a/ChensGradiusMod/Drones/DroneDeathState.cs +++ b/ChensGradiusMod/Drones/DroneDeathState.cs @@ -1,4 +1,4 @@ -using Chen.GradiusMod.Artifacts.Machines; +//using Chen.GradiusMod.Artifacts.Machines; using RoR2; using UnityEngine; using VanillaDeathState = EntityStates.Drone.DeathState; @@ -75,7 +75,7 @@ public override void OnEnter() forceAmount = originalState.forceAmount; hardCutoffDuration = maxFallDuration = bodyPreservationDuration = deathDuration = 12f; destroyOnImpact = true; - SpawnInteractable &= !Machines.instance.IsActiveAndEnabled(); + //SpawnInteractable &= !Machines.instance.IsActiveAndEnabled(); if (Compatibility.Aetherium.enabled) SpawnInteractable &= !Compatibility.Aetherium.RevivedByEngineersToolbelt(characterBody); base.OnEnter(); } diff --git a/ChensGradiusMod/Drones/PsyDrone/TwinsSpawn.cs b/ChensGradiusMod/Drones/PsyDrone/TwinsSpawn.cs index 44359d3..c99c0d0 100644 --- a/ChensGradiusMod/Drones/PsyDrone/TwinsSpawn.cs +++ b/ChensGradiusMod/Drones/PsyDrone/TwinsSpawn.cs @@ -29,13 +29,21 @@ private void Awake() ModelLocator component = bodyObject.GetComponent(); if (component && component.modelTransform) { - TemporaryOverlay temporaryOverlay = component.modelTransform.gameObject.AddComponent(); + var overlay = TemporaryOverlayManager.AddOverlay(component.modelTransform.gameObject); + overlay.duration = 0.5f; + overlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); + overlay.animateShaderAlpha = true; + overlay.destroyComponentOnEnd = true; + overlay.originalMaterial = summonDroneMaterial; + overlay.AddToCharacterModel(component.modelTransform.GetComponent()); + + /*TemporaryOverlay temporaryOverlay = component.modelTransform.gameObject.AddComponent(); temporaryOverlay.duration = 0.5f; temporaryOverlay.animateShaderAlpha = true; temporaryOverlay.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); temporaryOverlay.destroyComponentOnEnd = true; temporaryOverlay.originalMaterial = summonDroneMaterial; - temporaryOverlay.AddToCharacerModel(component.modelTransform.GetComponent()); + temporaryOverlay.AddToCharacerModel(component.modelTransform.GetComponent());*/ } body.GetOrAddComponent().twin = bodyObject; bodyObject.GetOrAddComponent().twin = body.gameObject; diff --git a/ChensGradiusMod/Items/GradiusOption/GradiusOption.Setup.cs b/ChensGradiusMod/Items/GradiusOption/GradiusOption.Setup.cs index 530a8b9..6223074 100644 --- a/ChensGradiusMod/Items/GradiusOption/GradiusOption.Setup.cs +++ b/ChensGradiusMod/Items/GradiusOption/GradiusOption.Setup.cs @@ -1,5 +1,6 @@ using Chen.GradiusMod.Items.GradiusOption.Components; using Chen.Helpers.GeneralHelpers; +using R2API; using R2API.Networking; using RoR2; using System.Collections.Generic; @@ -186,6 +187,7 @@ public override void SetupConfig() public override void SetupBehavior() { base.SetupBehavior(); + AddLanguageTokens(); InitializeAssets(); RegisterNetworkMessages(); //if (Compat_ItemStats.enabled) @@ -202,6 +204,14 @@ public override void SetupBehavior() //} } + private void AddLanguageTokens() + { + LanguageAPI.Add("CHENSGRADIUSMOD_GRADIUSOPTION_NAME_RENDERED", "Gradius' Option"); + LanguageAPI.Add("CHENSGRADIUSMOD_GRADIUSOPTION_PICKUP_RENDERED", GetPickupString()); + LanguageAPI.Add("CHENSGRADIUSMOD_GRADIUSOPTION_DESC_RENDERED", GetDescString()); + LanguageAPI.Add("CHENSGRADIUSMOD_GRADIUSOPTION_LORE_RENDERED", GetLoreString()); + } + #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member private void InitializeAssets() diff --git a/ChensGradiusMod/Items/OptionSeed/OptionSeed.Setup.cs b/ChensGradiusMod/Items/OptionSeed/OptionSeed.Setup.cs index 8df8493..10ae721 100644 --- a/ChensGradiusMod/Items/OptionSeed/OptionSeed.Setup.cs +++ b/ChensGradiusMod/Items/OptionSeed/OptionSeed.Setup.cs @@ -1,5 +1,6 @@ using Chen.GradiusMod.Items.GradiusOption.Components; using Chen.GradiusMod.Items.OptionSeed.Components; +using R2API; using RoR2; using System; using System.Collections.Generic; @@ -136,6 +137,7 @@ public override void SetupConfig() public override void SetupBehavior() { base.SetupBehavior(); + AddLanguageTokens(); InitializeAssets(); //if (Compat_ItemStats.enabled) //{ @@ -147,6 +149,14 @@ public override void SetupBehavior() //} } + private void AddLanguageTokens() + { + LanguageAPI.Add("CHENSGRADIUSMOD_OPTIONSEED_NAME_RENDERED", "Gradius' Option Seed"); + LanguageAPI.Add("CHENSGRADIUSMOD_OPTIONSEED_PICKUP_RENDERED", GetPickupString()); + LanguageAPI.Add("CHENSGRADIUSMOD_OPTIONSEED_DESC_RENDERED", GetDescString()); + LanguageAPI.Add("CHENSGRADIUSMOD_OPTIONSEED_LORE_RENDERED", GetLoreString()); + } + #pragma warning restore CS1591 // Missing XML comment for publicly visible type or member private void InitializeAssets() diff --git a/ChensGradiusMod/lib/Aetherium.dll b/ChensGradiusMod/lib/Aetherium.dll deleted file mode 100644 index 311c5e0..0000000 Binary files a/ChensGradiusMod/lib/Aetherium.dll and /dev/null differ diff --git a/docs/06BKrroboYsdkfWNwbWj1A.md b/docs/06BKrroboYsdkfWNwbWj1A.md deleted file mode 100644 index 35febdb..0000000 --- a/docs/06BKrroboYsdkfWNwbWj1A.md +++ /dev/null @@ -1,16 +0,0 @@ -#### [ChensGradiusMod](index 'index') -### [Chen.GradiusMod.Artifacts.Machines](ayrCd5wE1fGIQOox6GFHYA 'Chen.GradiusMod.Artifacts.Machines') -## Machines Class -As artifact class which provides the main API related to the controlling which drones the enemy may spawn with. It is powered by TILER2. -```csharp -public class Machines : TILER2.Artifact -``` - -Inheritance [System.Object](https://docs.microsoft.com/en-us/dotnet/api/System.Object 'System.Object') 🡒 [TILER2.AutoConfigContainer](https://docs.microsoft.com/en-us/dotnet/api/TILER2.AutoConfigContainer 'TILER2.AutoConfigContainer') 🡒 [TILER2.T2Module](https://docs.microsoft.com/en-us/dotnet/api/TILER2.T2Module 'TILER2.T2Module') 🡒 [TILER2.CatalogBoilerplate](https://docs.microsoft.com/en-us/dotnet/api/TILER2.CatalogBoilerplate 'TILER2.CatalogBoilerplate') 🡒 [TILER2.Artifact](https://docs.microsoft.com/en-us/dotnet/api/TILER2.Artifact 'TILER2.Artifact') 🡒 [TILER2.Artifact<](https://docs.microsoft.com/en-us/dotnet/api/TILER2.Artifact-1 'TILER2.Artifact`1')[Machines](06BKrroboYsdkfWNwbWj1A 'Chen.GradiusMod.Artifacts.Machines.Machines')[>](https://docs.microsoft.com/en-us/dotnet/api/TILER2.Artifact-1 'TILER2.Artifact`1') 🡒 Machines - -| Methods | | -| :--- | :--- | -| [AddEnemyDroneType(GameObject, int)](rBlf05VZ6caiITwwVUBbzA 'Chen.GradiusMod.Artifacts.Machines.Machines.AddEnemyDroneType(GameObject, int)') | Adds a drone to the spawn pool for the enemies.
| -| [AssignEnemyDroneAsGrounded(string)](ujVsLUGxMgrFCppqzzg4zQ 'Chen.GradiusMod.Artifacts.Machines.Machines.AssignEnemyDroneAsGrounded(string)') | Assigns a drone as grounded. This will be used to determine if the drone should be repositioned to the ground to avoid floating stationary drones.
| -| [RemoveEnemyDroneType(GameObject)](1LqF8kU18SL6Omn8Y+dMoA 'Chen.GradiusMod.Artifacts.Machines.Machines.RemoveEnemyDroneType(GameObject)') | Removes a drone from the spawn pool for the enemies.
| -| [UnassignEnemyDroneAsGrounded(string)](XJdp1Eubm6eDxnF6IddfZw 'Chen.GradiusMod.Artifacts.Machines.Machines.UnassignEnemyDroneAsGrounded(string)') | Unassigns a drone from being grounded.
| diff --git a/docs/1LqF8kU18SL6Omn8Y+dMoA.md b/docs/1LqF8kU18SL6Omn8Y+dMoA.md deleted file mode 100644 index 2ff4d39..0000000 --- a/docs/1LqF8kU18SL6Omn8Y+dMoA.md +++ /dev/null @@ -1,15 +0,0 @@ -#### [ChensGradiusMod](index 'index') -### [Chen.GradiusMod.Artifacts.Machines](ayrCd5wE1fGIQOox6GFHYA 'Chen.GradiusMod.Artifacts.Machines').[Machines](06BKrroboYsdkfWNwbWj1A 'Chen.GradiusMod.Artifacts.Machines.Machines') -## Machines.RemoveEnemyDroneType(GameObject) Method -Removes a drone from the spawn pool for the enemies. -```csharp -public bool RemoveEnemyDroneType(GameObject masterObject); -``` -#### Parameters - -`masterObject` [UnityEngine.GameObject](https://docs.microsoft.com/en-us/dotnet/api/UnityEngine.GameObject 'UnityEngine.GameObject') -CharacterMaster GameObject of the drone. - -#### Returns -[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') -True if the drone is removed from the pool. False if it is not in the pool. diff --git a/docs/ChensGradiusMod.xml b/docs/ChensGradiusMod.xml index fac17e8..5cb9758 100644 --- a/docs/ChensGradiusMod.xml +++ b/docs/ChensGradiusMod.xml @@ -4,40 +4,6 @@ ChensGradiusMod - - - As artifact class which provides the main API related to the controlling which drones the enemy may spawn with. It is powered by TILER2. - - - - - Adds a drone to the spawn pool for the enemies. - - CharacterMaster GameObject of the drone. - Spawn Weight of the drone. - True if the drone is added to the pool. False if it is already in the pool, or it was not added. - - - - Removes a drone from the spawn pool for the enemies. - - CharacterMaster GameObject of the drone. - True if the drone is removed from the pool. False if it is not in the pool. - - - - Assigns a drone as grounded. This will be used to determine if the drone should be repositioned to the ground to avoid floating stationary drones. - - CharacterBody name of the drone. - True if the drone name is assigned. False if the name already exists. - - - - Unassigns a drone from being grounded. - - CharacterBody name of the drone. - True if the drone name is removed. False if the name did not exist. - A static class that contains compatibility features from Aetherium mod. diff --git a/docs/XJdp1Eubm6eDxnF6IddfZw.md b/docs/XJdp1Eubm6eDxnF6IddfZw.md deleted file mode 100644 index 4748f09..0000000 --- a/docs/XJdp1Eubm6eDxnF6IddfZw.md +++ /dev/null @@ -1,15 +0,0 @@ -#### [ChensGradiusMod](index 'index') -### [Chen.GradiusMod.Artifacts.Machines](ayrCd5wE1fGIQOox6GFHYA 'Chen.GradiusMod.Artifacts.Machines').[Machines](06BKrroboYsdkfWNwbWj1A 'Chen.GradiusMod.Artifacts.Machines.Machines') -## Machines.UnassignEnemyDroneAsGrounded(string) Method -Unassigns a drone from being grounded. -```csharp -public bool UnassignEnemyDroneAsGrounded(string bodyName); -``` -#### Parameters - -`bodyName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') -CharacterBody name of the drone. - -#### Returns -[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') -True if the drone name is removed. False if the name did not exist. diff --git a/docs/ayrCd5wE1fGIQOox6GFHYA.md b/docs/ayrCd5wE1fGIQOox6GFHYA.md deleted file mode 100644 index 693fbe2..0000000 --- a/docs/ayrCd5wE1fGIQOox6GFHYA.md +++ /dev/null @@ -1,6 +0,0 @@ -#### [ChensGradiusMod](index 'index') -## Chen.GradiusMod.Artifacts.Machines Namespace - -| Classes | | -| :--- | :--- | -| [Machines](06BKrroboYsdkfWNwbWj1A 'Chen.GradiusMod.Artifacts.Machines.Machines') | As artifact class which provides the main API related to the controlling which drones the enemy may spawn with. It is powered by TILER2.
| diff --git a/docs/index.md b/docs/index.md index cd7c285..24b648d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -3,7 +3,6 @@ | Namespaces | | | :--- | :--- | | [Chen.GradiusMod](neHTXX+yFsk1RpXqjkv9zg 'Chen.GradiusMod') | | -| [Chen.GradiusMod.Artifacts.Machines](ayrCd5wE1fGIQOox6GFHYA 'Chen.GradiusMod.Artifacts.Machines') | | | [Chen.GradiusMod.Compatibility](F8aFQlqLO5uD9A4izEhK_Q 'Chen.GradiusMod.Compatibility') | | | [Chen.GradiusMod.Drones](Y_iPobZkdIiJ9feSuBjDaQ 'Chen.GradiusMod.Drones') | | | [Chen.GradiusMod.Items.GradiusOption](mfb9nYomeqOwYy2EkL_v0Q 'Chen.GradiusMod.Items.GradiusOption') | | diff --git a/docs/rBlf05VZ6caiITwwVUBbzA.md b/docs/rBlf05VZ6caiITwwVUBbzA.md deleted file mode 100644 index 4751cbb..0000000 --- a/docs/rBlf05VZ6caiITwwVUBbzA.md +++ /dev/null @@ -1,19 +0,0 @@ -#### [ChensGradiusMod](index 'index') -### [Chen.GradiusMod.Artifacts.Machines](ayrCd5wE1fGIQOox6GFHYA 'Chen.GradiusMod.Artifacts.Machines').[Machines](06BKrroboYsdkfWNwbWj1A 'Chen.GradiusMod.Artifacts.Machines.Machines') -## Machines.AddEnemyDroneType(GameObject, int) Method -Adds a drone to the spawn pool for the enemies. -```csharp -public bool AddEnemyDroneType(GameObject masterObject, int spawnWeight); -``` -#### Parameters - -`masterObject` [UnityEngine.GameObject](https://docs.microsoft.com/en-us/dotnet/api/UnityEngine.GameObject 'UnityEngine.GameObject') -CharacterMaster GameObject of the drone. - - -`spawnWeight` [System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') -Spawn Weight of the drone. - -#### Returns -[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') -True if the drone is added to the pool. False if it is already in the pool, or it was not added. diff --git a/docs/ujVsLUGxMgrFCppqzzg4zQ.md b/docs/ujVsLUGxMgrFCppqzzg4zQ.md deleted file mode 100644 index 0f436c6..0000000 --- a/docs/ujVsLUGxMgrFCppqzzg4zQ.md +++ /dev/null @@ -1,15 +0,0 @@ -#### [ChensGradiusMod](index 'index') -### [Chen.GradiusMod.Artifacts.Machines](ayrCd5wE1fGIQOox6GFHYA 'Chen.GradiusMod.Artifacts.Machines').[Machines](06BKrroboYsdkfWNwbWj1A 'Chen.GradiusMod.Artifacts.Machines.Machines') -## Machines.AssignEnemyDroneAsGrounded(string) Method -Assigns a drone as grounded. This will be used to determine if the drone should be repositioned to the ground to avoid floating stationary drones. -```csharp -public bool AssignEnemyDroneAsGrounded(string bodyName); -``` -#### Parameters - -`bodyName` [System.String](https://docs.microsoft.com/en-us/dotnet/api/System.String 'System.String') -CharacterBody name of the drone. - -#### Returns -[System.Boolean](https://docs.microsoft.com/en-us/dotnet/api/System.Boolean 'System.Boolean') -True if the drone name is assigned. False if the name already exists.