Skip to content

Commit

Permalink
Stable 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
WilloIzCitron committed May 16, 2024
1 parent 0635c60 commit 0d273cf
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
Binary file added assets/sounds/units/collaris-attack1.ogg
Binary file not shown.
Binary file added assets/sounds/units/collaris-attack2.ogg
Binary file not shown.
Binary file added assets/sounds/units/collaris-attack3.ogg
Binary file not shown.
2 changes: 1 addition & 1 deletion mod.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
This mod is a fan-made project inspired by Blue Archive and not directly affiliated with it. Copyright remains with the developer and publisher of Blue Archive:
Nexon, Nexon Games and Yostar.
",
version: "1.0",
version: "1.1",
main: bluearchive.ArchiveDustry,
minGameVersion: "146",
dependencies: [],
Expand Down
4 changes: 3 additions & 1 deletion src/bluearchive/ArchiveDustry.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import arc.scene.utils.Elem;
import arc.util.*;
import bluearchive.ui.*;
import mindustry.game.SectorInfo;
import mindustry.gen.*;
import mindustry.game.EventType.*;
import mindustry.mod.*;
Expand Down Expand Up @@ -106,8 +107,9 @@ public ArchiveDustry() {
if(currentPlay != null) {
currentPlay.stop();
}
tree.loadMusic("win").play();
Time.run(306f, () -> {
Reflect.invoke(tree.loadMusic("win"), "silence");
tree.loadMusic("win").stop();
Time.clear();
});
});
Expand Down
19 changes: 15 additions & 4 deletions src/bluearchive/units/UnitSound.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@
import arc.util.Interval;
import arc.util.Log;
import arc.util.Time;
import arc.util.Timer;
import mindustry.content.UnitTypes;
import mindustry.game.EventType;
import mindustry.game.EventType.*;
import mindustry.Vars;
import mindustry.gen.Unit;
import mindustry.gen.Sounds;


public class UnitSound {
public static Seq<Sound> arrivalSound = Seq.with();
public static Seq<Sound> hitSound = Seq.with();
static Interval hitInterval = new Interval(5);
public static Seq<Sound> shootSound = Seq.with();
static Interval interval = new Interval(5);
public static void init() {
// collaris atlas start
Events.on(PayloadDropEvent.class, e -> {
Expand All @@ -33,7 +35,7 @@ public static void init() {
});
Events.on(UnitDamageEvent.class, e -> {
/* Check if the unit is same as intended, hit sound was being interval */
if (e.unit.type == Vars.content.unit("collaris") && hitInterval.get(300)) {
if (e.unit.type == Vars.content.unit("collaris") && interval.get(300)) {
hitSound = Seq.with(new Sound(Vars.tree.get("sounds/units/collaris-hit1.ogg")), new Sound(Vars.tree.get("sounds/units/collaris-hit2.ogg")), new Sound(Vars.tree.get("sounds/units/collaris-hit3.ogg")));
if (!e.unit.dead) {
Time.run(0f, () -> {
Expand All @@ -42,7 +44,16 @@ public static void init() {
}
}
});
UnitTypes.collaris.deathSound = new Sound(Vars.tree.get("sounds/units/collaris-death.ogg"));
Timer.schedule(() -> {
UnitTypes.collaris.deathSound = new Sound(Vars.tree.get("sounds/units/collaris-death.ogg"));
/* 4/1 chance to get unique sound */
shootSound = Seq.with(Sounds.pulseBlast, Sounds.pulseBlast, Sounds.pulseBlast, Sounds.pulseBlast, new Sound(Vars.tree.get("sounds/units/collaris-attack1.ogg")), new Sound(Vars.tree.get("sounds/units/collaris-attack2.ogg")), new Sound(Vars.tree.get("sounds/units/collaris-attack3.ogg")));
Sound assignedSound = shootSound.random();
UnitTypes.collaris.weapons.get(0).shootSound = assignedSound;
UnitTypes.collaris.weapons.get(1).shootSound = assignedSound;
UnitTypes.collaris.weapons.get(0).soundPitchMin = 1f;
UnitTypes.collaris.weapons.get(1).soundPitchMin = 1f;
}, 0, 2.15f);
// collaris atlas end

Log.infoTag("ArchiveDustry", "Unit Sounds Loaded!");
Expand Down

0 comments on commit 0d273cf

Please sign in to comment.