Skip to content

Commit

Permalink
Merge pull request #40 from Phreelosu/master
Browse files Browse the repository at this point in the history
bunch of fixes, temporaryoverlay and language tokens
  • Loading branch information
cheeeeeeeeeen authored Sep 7, 2024
2 parents 57cf888 + 97f0d9c commit 9a801fe
Show file tree
Hide file tree
Showing 17 changed files with 64 additions and 132 deletions.
22 changes: 20 additions & 2 deletions ChensGradiusMod/Artifacts/Machines/Machines.Setup.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Chen.Helpers.GeneralHelpers;
using R2API;
using RoR2;
using System.Collections.Generic;
using TILER2;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -149,13 +157,23 @@ private void SummonDrone(CharacterBody ownerBody, GameObject droneMasterPrefab,
ModelLocator component = bodyObject.GetComponent<ModelLocator>();
if (component && component.modelTransform)
{
TemporaryOverlay temporaryOverlay = component.modelTransform.gameObject.AddComponent<TemporaryOverlay>();
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<RoR2.CharacterModel>());

/*TemporaryOverlay temporaryOverlay = component.modelTransform.gameObject.AddComponent<TemporaryOverlay>();
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<CharacterModel>());
temporaryOverlay.AddToCharacerModel(component.modelTransform.GetComponent<CharacterModel>());*/

//this above is outdated and caused NREs so I just used what modding discord suggested via TemporaryOverlayManager
}
}
RepositionGroundedDrones(characterMaster.GetBody(), ownerBody.transform.position);
Expand Down
8 changes: 7 additions & 1 deletion ChensGradiusMod/ChensGradiusMod.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
<EmbeddedResource Include="chensgradiusmod_soundbank.bnk" />
</ItemGroup>

<ItemGroup>
<Compile Remove="Artifacts\Machines\Machines.API.cs" />
<Compile Remove="Artifacts\Machines\Machines.Hooks.cs" />
<Compile Remove="Artifacts\Machines\Machines.Setup.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="DefaultDocumentation" Version="0.7.5">
<PrivateAssets>all</PrivateAssets>
Expand Down Expand Up @@ -71,7 +77,7 @@

<ItemGroup>
<Reference Include="Aetherium">
<HintPath>lib\Aetherium.dll</HintPath>
<HintPath>..\..\..\aetherium\AetheriumMod-SotS\Aetherium\bin\Debug\netstandard2.1\Aetherium.dll</HintPath>
</Reference>
<Reference Include="ChensHelpers">
<HintPath>lib\ChensHelpers.dll</HintPath>
Expand Down
5 changes: 3 additions & 2 deletions ChensGradiusMod/Compatibility/Aetherium.cs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions ChensGradiusMod/Drones/Drone.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions ChensGradiusMod/Drones/DroneDeathState.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Chen.GradiusMod.Artifacts.Machines;
//using Chen.GradiusMod.Artifacts.Machines;
using RoR2;
using UnityEngine;
using VanillaDeathState = EntityStates.Drone.DeathState;
Expand Down Expand Up @@ -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();
}
Expand Down
12 changes: 10 additions & 2 deletions ChensGradiusMod/Drones/PsyDrone/TwinsSpawn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,21 @@ private void Awake()
ModelLocator component = bodyObject.GetComponent<ModelLocator>();
if (component && component.modelTransform)
{
TemporaryOverlay temporaryOverlay = component.modelTransform.gameObject.AddComponent<TemporaryOverlay>();
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<RoR2.CharacterModel>());

/*TemporaryOverlay temporaryOverlay = component.modelTransform.gameObject.AddComponent<TemporaryOverlay>();
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<CharacterModel>());
temporaryOverlay.AddToCharacerModel(component.modelTransform.GetComponent<CharacterModel>());*/
}
body.GetOrAddComponent<TwinsDeath>().twin = bodyObject;
bodyObject.GetOrAddComponent<TwinsDeath>().twin = body.gameObject;
Expand Down
10 changes: 10 additions & 0 deletions ChensGradiusMod/Items/GradiusOption/GradiusOption.Setup.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -186,6 +187,7 @@ public override void SetupConfig()
public override void SetupBehavior()
{
base.SetupBehavior();
AddLanguageTokens();
InitializeAssets();
RegisterNetworkMessages();
//if (Compat_ItemStats.enabled)
Expand All @@ -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()
Expand Down
10 changes: 10 additions & 0 deletions ChensGradiusMod/Items/OptionSeed/OptionSeed.Setup.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -136,6 +137,7 @@ public override void SetupConfig()
public override void SetupBehavior()
{
base.SetupBehavior();
AddLanguageTokens();
InitializeAssets();
//if (Compat_ItemStats.enabled)
//{
Expand All @@ -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()
Expand Down
Binary file removed ChensGradiusMod/lib/Aetherium.dll
Binary file not shown.
16 changes: 0 additions & 16 deletions docs/06BKrroboYsdkfWNwbWj1A.md

This file was deleted.

15 changes: 0 additions & 15 deletions docs/1LqF8kU18SL6Omn8Y+dMoA.md

This file was deleted.

34 changes: 0 additions & 34 deletions docs/ChensGradiusMod.xml

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

15 changes: 0 additions & 15 deletions docs/XJdp1Eubm6eDxnF6IddfZw.md

This file was deleted.

6 changes: 0 additions & 6 deletions docs/ayrCd5wE1fGIQOox6GFHYA.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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') | |
Expand Down
19 changes: 0 additions & 19 deletions docs/rBlf05VZ6caiITwwVUBbzA.md

This file was deleted.

15 changes: 0 additions & 15 deletions docs/ujVsLUGxMgrFCppqzzg4zQ.md

This file was deleted.

0 comments on commit 9a801fe

Please sign in to comment.