Skip to content

Commit

Permalink
Lasers now hum. Hmmm.
Browse files Browse the repository at this point in the history
  • Loading branch information
Epicguru committed May 30, 2020
1 parent 5594fe0 commit 73b734b
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Defs/Sounds/Lasers.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,22 @@
</subSounds>
</SoundDef>

<SoundDef>
<defName>LaserHum_AA</defName>
<sustain>true</sustain>
<context>MapOnly</context>
<priorityMode>PrioritizeNearest</priorityMode>
<subSounds>
<li>
<grains>
<li Class="AudioGrain_Clip">
<clipPath>AntimatterAnnihilation/LaserHum</clipPath>
</li>
</grains>
<volumeRange>18</volumeRange>
<distRange>10~40</distRange>
</li>
</subSounds>
</SoundDef>

</Defs>
Binary file added Sounds/AntimatterAnnihilation/LaserHum.ogg
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using UnityEngine;
using Verse;
using Verse.Noise;
using Verse.Sound;

namespace AntimatterAnnihilation.Buildings
{
Expand Down Expand Up @@ -124,6 +125,7 @@ public float PowerOutputMultiplier
private long tick;
private Building_AntimatterReactor lastReactor;
private List<(IntVec3 cell, byte weight)> avoidance = new List<(IntVec3 cell, byte weight)>();
private Sustainer humSustainer;

public override void SpawnSetup(Map map, bool respawningAfterLoad)
{
Expand Down Expand Up @@ -191,6 +193,20 @@ public override void Tick()
Beam.BeamVisible = IsRunning;
//CauseRedraw();

if (IsRunning)
{
if (humSustainer != null && humSustainer.Ended)
humSustainer = null;

if (humSustainer == null)
{
SoundInfo info = SoundInfo.InMap(this, MaintenanceType.PerTick);
humSustainer = AADefOf.LaserHum_AA.TrySpawnSustainer(info);
}

humSustainer?.Maintain();
}

Beam.Tick();

if (!IsRunning)
Expand Down
1 change: 1 addition & 0 deletions Source/AntimatterAnnihilation/Utils/AADefOf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ static AADefOf()
public static SoundDef Explosion_Voice_AA;
public static SoundDef LaserStrike_AA;
public static SoundDef RailgunShoot_AA;
public static SoundDef LaserHum_AA;
public static ResearchProjectDef InstantFlick_AA;
public static ThingDef Mote_LargeMuzzleFlash_AA;
public static ThingDef Mote_LargeMuzzleFlashFast_AA;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions Wiki/English/S_UltratechFaction.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ ENDTAGS
#The Ultratech are an inter-planetary conglomerate that posses the knowlege and technology to manipulate antimatter.
All of their members are highly trained and heavily armed, and have orders to destroy anyone who has gains knowlege of antimatter technology.#

$AntimatterAnnihilation/UI/UltratechPawns$

#!How often will they raid me?#
#The ultratech have the same raid weight as any other faction, but are less likely to send strong raids early-game.
If you get tired of waiting for them to attack you, take the fight to them. The Ultratech outposts are heavily guarded but also give the rare tech drops required for advanced crafting.#
Expand Down

0 comments on commit 73b734b

Please sign in to comment.