Skip to content

Commit

Permalink
M3G_UMIN now has cool particle effects.
Browse files Browse the repository at this point in the history
  • Loading branch information
Epicguru committed May 26, 2020
1 parent 94f0439 commit 5e4fb34
Show file tree
Hide file tree
Showing 8 changed files with 4,832 additions and 46 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -369,3 +369,5 @@ Source/Content/Unity/RimVibes Bundles/AssetBundles/
Source/Content/Unity/RimVibes Bundles/Library/

Source/packages/

Source/Content/Unity/RimVibes Bundles/Temp/
Binary file modified AssetBundles/aa
Binary file not shown.
5 changes: 3 additions & 2 deletions AssetBundles/aa.manifest
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ManifestFileVersion: 0
CRC: 1684284641
CRC: 3074336766
Hashes:
AssetFileHash:
serializedVersion: 2
Hash: 44b8a3b422ac272c36304d8eb1af96f9
Hash: 5b9c09cc23f32928bf42d0bfd3732f87
TypeTreeHash:
serializedVersion: 2
Hash: fb95f860f6de44335a97c1723d17ea56
Expand Down Expand Up @@ -44,6 +44,7 @@ ClassTypes:
Assets:
- Assets/UpBeam.prefab
- Assets/Shaders/OuterPrefab.prefab
- Assets/MegCharge.prefab
- Assets/Shaders/Out Beam.prefab
- Assets/RailgunEffect.prefab
- Assets/Shaders/In Beam.prefab
Expand Down
21 changes: 19 additions & 2 deletions Source/AntimatterAnnihilation/Buildings/Building_Megumin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using UnityEngine;
using Verse;
using Verse.Sound;
using Object = UnityEngine.Object;

namespace AntimatterAnnihilation.Buildings
{
Expand Down Expand Up @@ -98,6 +99,7 @@ protected set
private UpBeam beam;
private LocalTargetInfo localTarget;
private Sustainer soundSustainer;
private ParticleSystem chargeEffect;

public override void SpawnSetup(Map map, bool respawningAfterLoad)
{
Expand All @@ -113,6 +115,16 @@ public override void SpawnSetup(Map map, bool respawningAfterLoad)
beam = new UpBeam(map, this.TrueCenter() + new Vector3(0f, 0f, 1.2f));
beam.IsActive = false;
}

if(chargeEffect == null)
{
chargeEffect = Object.Instantiate(Content.MeguminChargePrefab).GetComponent<ParticleSystem>();
chargeEffect.transform.position = this.TrueCenter() + new Vector3(0f, 0f, 1.1f);
chargeEffect.transform.eulerAngles = new Vector3(90f, 0f, 0f);
}

if (!IsPoweringUp)
chargeEffect.Stop(true, ParticleSystemStopBehavior.StopEmittingAndClear);
}

public override IEnumerable<Gizmo> GetGizmos()
Expand Down Expand Up @@ -217,6 +229,9 @@ private void StartPowerUpSequence()
// Play the long attack sound.
SoundInfo info = SoundInfo.InMap(this, MaintenanceType.PerTick);
soundSustainer = AADefOf.LaserStrike_AA.TrySpawnSustainer(info);

// Do particle effects.
chargeEffect?.Play(true);
}

private void StartRealAttack()
Expand All @@ -230,6 +245,8 @@ private void StartRealAttack()
// Spawn sky beam of death.
AttackVerb.TryStartCastOn(localTarget);

chargeEffect?.Stop(true, ParticleSystemStopBehavior.StopEmitting);

// Put on cooldown.
CooldownTicks = COOLDOWN_TICKS;

Expand All @@ -246,11 +263,11 @@ private void StartRealAttack()

bool canFire = AADefOf.SolarFlare.Worker.CanFireNow(param);
if (!canFire)
Log.Warning($"SolarFare Worker says that it cannot fire under the current conditions - forcing it to anyway, from M3G_UMIN.");
Log.Warning("SolarFare Worker says that it cannot fire under the current conditions - forcing it to anyway, from M3G_UMIN.");

bool worked = AADefOf.SolarFlare.Worker.TryExecute(param);
if (!worked)
Log.Error($"SolarFare Worker failed to execute (returned false), from M3G_UMIN.");
Log.Error("SolarFare Worker failed to execute (returned false), from M3G_UMIN.");
}
}

Expand Down
2 changes: 2 additions & 0 deletions Source/AntimatterAnnihilation/Content.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public static class Content
public static GameObject EnergyBeamInPrefab;
public static GameObject EnergyBeamOutPrefab;
public static GameObject UpBeamPrefab;
public static GameObject MeguminChargePrefab;

public static Texture2D Expand, Collapse;
public static Texture2D PowerNetGraph;
Expand All @@ -26,6 +27,7 @@ static Content()
EnergyBeamInPrefab = bundle.LoadAsset<GameObject>("In Beam");
EnergyBeamOutPrefab = bundle.LoadAsset<GameObject>("Out Beam");
UpBeamPrefab = bundle.LoadAsset<GameObject>("UpBeam");
MeguminChargePrefab = bundle.LoadAsset<GameObject>("MegCharge");
ExplosionEffectManager.Prefab = bundle.LoadAsset<GameObject>("LargeAntimatterExplosion");
RailgunEffectSpawner.Prefab = bundle.LoadAsset<GameObject>("RailgunEffect");

Expand Down
36 changes: 18 additions & 18 deletions Source/Content/Unity/RimVibes Bundles/Assembly-CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -76,58 +76,58 @@
<None Include="Assets\Shaders\ParticleUnlit.shader" />
<None Include="Assets\Shaders\BeamShader.shader" />
<Reference Include="Unity.Timeline.Editor">
<HintPath>D:/Dev/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.Timeline.Editor.dll</HintPath>
<HintPath>D:/Steam Games/steamapps/common/RimWorld/Mods/AntimatterAnnihilation/Source/Content/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.Timeline.Editor.dll</HintPath>
</Reference>
<Reference Include="Unity.VSCode.Editor">
<HintPath>D:/Dev/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.VSCode.Editor.dll</HintPath>
<HintPath>D:/Steam Games/steamapps/common/RimWorld/Mods/AntimatterAnnihilation/Source/Content/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.VSCode.Editor.dll</HintPath>
</Reference>
<Reference Include="Unity.RenderPipelines.Core.Editor">
<HintPath>D:/Dev/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.RenderPipelines.Core.Editor.dll</HintPath>
<HintPath>D:/Steam Games/steamapps/common/RimWorld/Mods/AntimatterAnnihilation/Source/Content/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.RenderPipelines.Core.Editor.dll</HintPath>
</Reference>
<Reference Include="Unity.RenderPipelines.Core.Runtime">
<HintPath>D:/Dev/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.RenderPipelines.Core.Runtime.dll</HintPath>
<HintPath>D:/Steam Games/steamapps/common/RimWorld/Mods/AntimatterAnnihilation/Source/Content/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.RenderPipelines.Core.Runtime.dll</HintPath>
</Reference>
<Reference Include="Unity.TextMeshPro.Editor">
<HintPath>D:/Dev/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.TextMeshPro.Editor.dll</HintPath>
<HintPath>D:/Steam Games/steamapps/common/RimWorld/Mods/AntimatterAnnihilation/Source/Content/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.TextMeshPro.Editor.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>D:/Dev/Unity/RimVibes Bundles/Library/ScriptAssemblies/UnityEngine.UI.dll</HintPath>
<HintPath>D:/Steam Games/steamapps/common/RimWorld/Mods/AntimatterAnnihilation/Source/Content/Unity/RimVibes Bundles/Library/ScriptAssemblies/UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="Unity.Timeline">
<HintPath>D:/Dev/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.Timeline.dll</HintPath>
<HintPath>D:/Steam Games/steamapps/common/RimWorld/Mods/AntimatterAnnihilation/Source/Content/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.Timeline.dll</HintPath>
</Reference>
<Reference Include="Unity.CollabProxy.Editor">
<HintPath>D:/Dev/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.CollabProxy.Editor.dll</HintPath>
<HintPath>D:/Steam Games/steamapps/common/RimWorld/Mods/AntimatterAnnihilation/Source/Content/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.CollabProxy.Editor.dll</HintPath>
</Reference>
<Reference Include="Unity.AssetBundleBrowser.Editor">
<HintPath>D:/Dev/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.AssetBundleBrowser.Editor.dll</HintPath>
<HintPath>D:/Steam Games/steamapps/common/RimWorld/Mods/AntimatterAnnihilation/Source/Content/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.AssetBundleBrowser.Editor.dll</HintPath>
</Reference>
<Reference Include="Unity.Rider.Editor">
<HintPath>D:/Dev/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.Rider.Editor.dll</HintPath>
<HintPath>D:/Steam Games/steamapps/common/RimWorld/Mods/AntimatterAnnihilation/Source/Content/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.Rider.Editor.dll</HintPath>
</Reference>
<Reference Include="Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary">
<HintPath>D:/Dev/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll</HintPath>
<HintPath>D:/Steam Games/steamapps/common/RimWorld/Mods/AntimatterAnnihilation/Source/Content/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll</HintPath>
</Reference>
<Reference Include="Unity.2D.Sprite.Editor">
<HintPath>D:/Dev/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.2D.Sprite.Editor.dll</HintPath>
<HintPath>D:/Steam Games/steamapps/common/RimWorld/Mods/AntimatterAnnihilation/Source/Content/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.2D.Sprite.Editor.dll</HintPath>
</Reference>
<Reference Include="Unity.2D.Tilemap.Editor">
<HintPath>D:/Dev/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.2D.Tilemap.Editor.dll</HintPath>
<HintPath>D:/Steam Games/steamapps/common/RimWorld/Mods/AntimatterAnnihilation/Source/Content/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.2D.Tilemap.Editor.dll</HintPath>
</Reference>
<Reference Include="Unity.VisualStudio.Editor">
<HintPath>D:/Dev/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.VisualStudio.Editor.dll</HintPath>
<HintPath>D:/Steam Games/steamapps/common/RimWorld/Mods/AntimatterAnnihilation/Source/Content/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.VisualStudio.Editor.dll</HintPath>
</Reference>
<Reference Include="Unity.ShaderGraph.Editor">
<HintPath>D:/Dev/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.ShaderGraph.Editor.dll</HintPath>
<HintPath>D:/Steam Games/steamapps/common/RimWorld/Mods/AntimatterAnnihilation/Source/Content/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.ShaderGraph.Editor.dll</HintPath>
</Reference>
<Reference Include="Unity.RenderPipelines.Core.ShaderLibrary">
<HintPath>D:/Dev/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.RenderPipelines.Core.ShaderLibrary.dll</HintPath>
<HintPath>D:/Steam Games/steamapps/common/RimWorld/Mods/AntimatterAnnihilation/Source/Content/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.RenderPipelines.Core.ShaderLibrary.dll</HintPath>
</Reference>
<Reference Include="Unity.TextMeshPro">
<HintPath>D:/Dev/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.TextMeshPro.dll</HintPath>
<HintPath>D:/Steam Games/steamapps/common/RimWorld/Mods/AntimatterAnnihilation/Source/Content/Unity/RimVibes Bundles/Library/ScriptAssemblies/Unity.TextMeshPro.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.UI">
<HintPath>D:/Dev/Unity/RimVibes Bundles/Library/ScriptAssemblies/UnityEditor.UI.dll</HintPath>
<HintPath>D:/Steam Games/steamapps/common/RimWorld/Mods/AntimatterAnnihilation/Source/Content/Unity/RimVibes Bundles/Library/ScriptAssemblies/UnityEditor.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AIModule">
<HintPath>D:/Unity Installs/Unity/Editor/Data/Managed/UnityEngine/UnityEngine.AIModule.dll</HintPath>
Expand Down
Loading

0 comments on commit 5e4fb34

Please sign in to comment.