diff --git a/src/fos/content/FOSUnitTypes.java b/src/fos/content/FOSUnitTypes.java index 31bcf01e..d90bc618 100644 --- a/src/fos/content/FOSUnitTypes.java +++ b/src/fos/content/FOSUnitTypes.java @@ -868,7 +868,8 @@ public static void load(){ color = Pal.surge; effectRadius = 3f; healPercent = 2f; - healEffect = Fx.blastExplosion; hitEffect = Fx.blastExplosion; damageEffect = Fx.chainLightning; + healEffect = hitEffect = Fx.blastExplosion; + damageEffect = Fx.chainLightning; //buildingDamageMultiplier = 1.25f; }}); @@ -1065,7 +1066,7 @@ public static void load(){ shoot.shots = 5; inaccuracy = 11.25f; shootSound = Sounds.artillery; - bullet = new ArtilleryBulletType(){{ + bullet = new BasicBulletType(){{ width = height = 12; speed = 3f; lifetime = 60f; diff --git a/src/fos/content/FOSWeaponModules.java b/src/fos/content/FOSWeaponModules.java index c03867cc..5ef79aba 100644 --- a/src/fos/content/FOSWeaponModules.java +++ b/src/fos/content/FOSWeaponModules.java @@ -1,7 +1,7 @@ package fos.content; import arc.Events; -import arc.struct.Seq; +import arc.graphics.Color; import fos.type.abilities.UnitResistanceAbility; import fos.type.bullets.SmartBulletType; import fos.type.content.WeaponSet; @@ -30,45 +30,54 @@ public class FOSWeaponModules { public static void load() { // BASIC / ASSAULT RIFLES - standard1 = new WeaponSet("standard1", new Weapon("fos-standard-weapon1"){{ - x = 0; y = 0; - alternate = mirror = false; - rotate = true; - top = true; - recoil = 0.4f; - reload = recoilTime = 20f; - bullet = new BasicBulletType(2.5f, 72){{ - width = 7f; height = 9f; - trailLength = 8; - lifetime = 60f; - }}; - }}).reqs(empty); - standard1.researchCost = with(); - standard2 = new WeaponSet("standard2", new Weapon("fos-standard-weapon2"){{ - x = 0; y = 0; - alternate = mirror = false; - rotate = true; - recoil = 0.3f; - reload = recoilTime = 40f; - bullet = new BasicBulletType(2f, 180){{ - width = 8f; height = 10f; - lifetime = 40f; - shootEffect = Fx.shootSmallSmoke; - trailLength = 6; - fragOnHit = false; - fragBullets = 2; - fragVelocityMin = 1f; - collidesTiles = false; - fragBullet = new SmartBulletType(7f, 60){{ - width = 4f; height = 5f; - lifetime = 20f; - trailLength = 15; - hitEffect = Fx.hitBulletSmall; - collidesTiles = true; - }}; - }}; - }}).reqs(with(tin, 75, silver, 75)); - standard2.researchCost = with(); + standard1 = new WeaponSet("standard1"){{ + weapons.add( + new Weapon("fos-standard-weapon1"){{ + x = 0; y = 0; + alternate = mirror = false; + rotate = true; + top = true; + recoil = 0.4f; + reload = recoilTime = 20f; + bullet = new BasicBulletType(2.5f, 72){{ + width = 7f; height = 9f; + trailLength = 8; + lifetime = 60f; + }}; + }} + ); + reqs = empty; + researchCost = empty; + }}; + standard2 = new WeaponSet("standard2"){{ + weapons.add( + new Weapon("fos-standard-weapon2"){{ + x = 0; y = 0; + alternate = mirror = false; + rotate = true; + recoil = 0.3f; + reload = recoilTime = 40f; + bullet = new BasicBulletType(2f, 180){{ + width = 8f; height = 10f; + lifetime = 40f; + shootEffect = Fx.shootSmallSmoke; + trailLength = 6; + fragOnHit = false; + fragBullets = 2; + fragVelocityMin = 1f; + fragBullet = new SmartBulletType(7f, 60){{ + width = 4f; height = 5f; + lifetime = 20f; + trailLength = 15; + hitEffect = Fx.hitBulletSmall; + collidesTiles = true; + }}; + }}; + }} + ); + reqs = with(tin, 75, silver, 75); + researchCost = empty; + }}; standard3 = new WeaponSet("standard3", new Weapon("fos-standard-weapon3"){{ x = 0; y = 0; alternate = mirror = false; @@ -127,29 +136,33 @@ public static void load() { }}).reqs(with(tin, 500, silver, 500, vanadium, 300, nickel, 250, luminium, 200)); // SHOTGUNS - shotgun1 = new WeaponSet("shotgun1", new Weapon("fos-shotgun-mount1"){{ - x = y = 0; - alternate = mirror = false; - rotate = true; - rotateSpeed = 5f; - inaccuracy = 30f; - shoot.shots = 4; - shoot.shotDelay = 0f; - reload = recoilTime = 90f; - shootSound = Sounds.shotgun; - ejectEffect = Fx.casing2; - bullet = new ShrapnelBulletType(){{ - width = 2f; - length = 48f; - fromColor = Pal.accentBack; - toColor = Pal.accent; - damage = 120; - lifetime = 20f; - hitEffect = Fx.hitBulletSmall; - knockback = 4f; - }}; - }}).reqs(empty); - //TODO: placeholders + shotgun1 = new WeaponSet("shotgun1"){{ + weapons.add( + new Weapon("fos-shotgun-mount1"){{ + x = y = 0; + alternate = mirror = false; + rotate = true; + rotateSpeed = 5f; + inaccuracy = 30f; + shoot.shots = 4; + shoot.shotDelay = 0f; + reload = recoilTime = 90f; + shootSound = Sounds.shotgun; + ejectEffect = Fx.casing2; + bullet = new ShrapnelBulletType(){{ + width = 2f; + length = 48f; + fromColor = Pal.accentBack; + toColor = Pal.accent; + damage = 120; + lifetime = 20f; + hitEffect = Fx.hitBulletSmall; + knockback = 4f; + }}; + }} + ); + reqs = empty; + }}; shotgun2 = new WeaponSet("shotgun2", new Weapon("fos-shotgun-mount2"){{ x = y = 0; alternate = mirror = false; @@ -201,35 +214,78 @@ public static void load() { }}; }}; }}).reqs(with(tin, 200, silver, 50, silicon, 200, vanadium, 100)); + //TODO: placeholders shotgun4 = new WeaponSet("shotgun4", new Weapon()).reqs(with(lead, 1)); shotgun5 = new WeaponSet("shotgun5", new Weapon()).reqs(with(lead, 1)); // SUPPORT MODULES - support1 = new WeaponSet("support1", new BuildWeapon("fos-support-mount1")){{ - Events.on(EventType.ContentInitEvent.class, e -> { - abilities = Seq.with( - new StatusFieldAbility(FOSStatuses.buildBoost, 60, 30, 1){{ - activeEffect = Fx.none; - }} - ); - }); - }}.reqs(empty); + support1 = new WeaponSet("support1"){{ + weapons.add(new BuildWeapon("fos-support-mount1")); + abilities.add( + new StatusFieldAbility(FOSStatuses.buildBoost, 60, 30, 1){{ + activeEffect = Fx.none; + }} + ); + reqs = empty; + }}; + support2 = new WeaponSet("support2", new Weapon("fos-support-mount2"){{ + x = 0; y = 0; + rotate = false; + top = true; + reload = 10f; + mirror = false; + inaccuracy = 4f; + shootCone = 10f; + recoil = 2f; + bullet = new BasicBulletType(){{ + lifetime = 30f; speed = 4f; + + width = 10f; height = 20f; + //sprite = "laser"; + backColor = Pal.heal; + frontColor = Color.white; + shootEffect = Fx.shootHeal; + shootSound = Sounds.lasershoot; + + damage = 0; + collidesTeam = true; + collidesAir = false; + collidesGround = true; + healPercent = 5; + }}; + }}).reqs(with(tin, 50, silver, 100)); + support3 = new WeaponSet("support3"){{ + abilities.add( + new EnergyFieldAbility(80f, 40f, 64f){{ + x = 0; y = 2; + statusDuration = 120f; + maxTargets = 6; + color = Pal.heal; + effectRadius = 2f; + healPercent = 2.5f; + healEffect = Fx.heal; + damageEffect = Fx.chainLightning; + }} + ); + reqs = with(tin, 75, silver, 150, vanadium, 150); + }}; // BOSS WEAPONS - legionFabricator = new WeaponSet("legion-fabricator", - new RepairBeamWeapon("fos-legion-beam-replica"){{ - x = 0; y = 0; - mirror = false; - beamWidth = 0.4f; - repairSpeed = 0.2f; - bullet = new BulletType(){{ - maxRange = 40f; - }}; - }} - ){{ + legionFabricator = new WeaponSet("legion-fabricator"){{ + weapons.add( + new RepairBeamWeapon("fos-legion-beam-replica"){{ + x = 0; y = 0; + mirror = false; + beamWidth = 0.4f; + repairSpeed = 0.2f; + bullet = new BulletType(){{ + maxRange = 40f; + }}; + }} + ); customIcon = true; Events.on(EventType.ContentInitEvent.class, e -> { - abilities = Seq.with( + abilities.add( new UnitResistanceAbility(FOSUnitTypes.legionnaireReplica, 0.05f), new UnitSpawnAbility(FOSUnitTypes.legionnaireReplica, 600, 16, 0) ); diff --git a/src/fos/content/LumoniTechTree.java b/src/fos/content/LumoniTechTree.java index 46962842..0645b91b 100644 --- a/src/fos/content/LumoniTechTree.java +++ b/src/fos/content/LumoniTechTree.java @@ -6,6 +6,7 @@ import static fos.content.FOSBlocks.*; import static fos.content.FOSFluids.tokicite; import static fos.content.FOSItems.*; +import static fos.content.FOSObjectives.*; import static fos.content.FOSSectors.*; import static fos.content.FOSUnitTypes.*; import static fos.content.FOSWeaponModules.*; @@ -215,10 +216,16 @@ public static void load() { */ //TODO: artillery soontm(); - //TODO: support - soontm(); + // SUPPORT + node(support1, Seq.with(new SectorComplete(ruins)), () -> + node(support2, () -> + node(support3, () -> + soontm() + ) + ) + ); // BOSS-SPECIFIC WEAPONS - node(legionFabricator, Seq.with(new FOSObjectives.DefeatBoss(legion)), () -> { + node(legionFabricator, Seq.with(new DefeatBoss(legion)), () -> { //TODO: citadel shotgun? or stickybomb launcher? soontm(); }); @@ -277,6 +284,6 @@ public static void load() { } public static void soontm() { - node(soontm, Seq.with(new FOSObjectives.TBDObjective()), () -> {}); + node(soontm, Seq.with(new TBDObjective()), () -> {}); } } diff --git a/src/fos/type/content/WeaponSet.java b/src/fos/type/content/WeaponSet.java index 5695e744..d09264cd 100644 --- a/src/fos/type/content/WeaponSet.java +++ b/src/fos/type/content/WeaponSet.java @@ -1,5 +1,6 @@ package fos.type.content; +import arc.Core; import arc.math.Mathf; import arc.struct.Seq; import fos.content.FOSUnitTypes; @@ -9,18 +10,19 @@ import mindustry.entities.units.WeaponMount; import mindustry.gen.Unit; import mindustry.type.*; +import mindustry.ui.Styles; import mindustry.world.meta.*; //YES, this looks very cursed lmao /** - * FOR MODDERS: applying this "status effect" will have no effect whatsoever + * FOR MODDERS... AND SCHEME SIZE HACKERS, APPARENTLY: applying this "status effect" will have no effect whatsoever */ public class WeaponSet extends StatusEffect { public static Seq sets = new Seq<>(); public int id; /** Weapons this set contains. */ - public Seq weapons; + public Seq weapons = new Seq<>(); /** Abilities this set contains, if any. */ public Seq abilities = new Seq<>(); /** Items required to produce the set. */ @@ -32,13 +34,16 @@ public class WeaponSet extends StatusEffect { /** Custom research cost. */ public ItemStack[] researchCost; - - public WeaponSet(String name, Weapon... weapons) { + public WeaponSet(String name) { super(name); id = sets.size; sets.add(this); permanent = false; - this.weapons = new Seq<>(weapons); + } + + public WeaponSet(String name, Weapon... weapons) { + this(name); + this.weapons.addAll(weapons); } public WeaponSet(String name, Seq abilities, Weapon... weapons) { @@ -69,20 +74,11 @@ public void load() { public void setStats() { super.setStats(); - stats.add(Stat.buildCost, StatValues.items(reqs)); - stats.add(Stat.weapons, StatValues.weapons(FOSUnitTypes.lord, weapons)); - // stolen from UnitType. TODO: this sucks. -/* + stats.add(Stat.buildCost, reqs.length == 0 ? StatValues.string("[gray]" + Core.bundle.get("none") + "[]") : StatValues.items(reqs)); + stats.add(Stat.weapons, StatValues.weapons(FOSUnitTypes.weaponSetInit, weapons)); if (abilities.any()) { - var unique = new ObjectSet(); - - for(Ability a : abilities){ - if(a.display && unique.add(a.localized())){ - stats.add(Stat.abilities, a.localized()); - } - } + stats.add(Stat.abilities, abilities(this.abilities)); } -*/ } @Override @@ -149,5 +145,33 @@ public WeaponSet produceTime(float ticks) { return this; } + + // Stolen from Mindustry v146 because this mod's annotation processor is outdated as fuck. + // @nekit508 pls fix + public static StatValue abilities(Seq abilities) { + return table -> { + table.row(); + table.table(t -> { + int count = 0; + for(Ability ability : abilities){ + if(ability.display){ + t.table(Styles.grayPanel, a -> { + a.add("[accent]" + ability.localized()).padBottom(4).center().top().expandX(); + a.row(); + a.left().top().defaults().left(); + if(Core.bundle.has(ability.localized() + ".description")){ + a.add(Core.bundle.get(ability.localized() + ".description")).wrap().width(350f); + a.row(); + } + }).pad(5).margin(10).growX().top().uniformX(); + if((++count) == 2){ + count = 0; + t.row(); + } + } + } + }); + }; + } }