Skip to content
This repository was archived by the owner on Jan 17, 2026. It is now read-only.

Commit 4c5232d

Browse files
committed
this suckz
1 parent a727c40 commit 4c5232d

8 files changed

Lines changed: 96 additions & 32 deletions

File tree

assets/shaders/vineboom.frag

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#define HIGHP
2+
#define N_SAMPLES 10
3+
4+
uniform sampler2D u_texture;
5+
6+
uniform vec2 u_resolution;
7+
uniform float u_intensity;
8+
9+
varying vec2 v_texCoords;
10+
11+
//https://www.shadertoy.com/view/XsfSDs
12+
void main(){
13+
if(u_intensity < 0.001){
14+
gl_FragColor = texture2D(u_texture, v_texCoords.xy);
15+
return;
16+
}
17+
18+
vec2 center = vec2(0.5);
19+
vec2 c = v_texCoords.xy - center;
20+
21+
float precompute = u_intensity * (1.0 / float(N_SAMPLES - 1));
22+
vec4 color = vec4(0.0);
23+
for(int i = 0; i < N_SAMPLES; i++){
24+
float scale = 1.0 + (float(i - N_SAMPLES / 2) * precompute);
25+
color += texture2D(u_texture, c * scale + center);
26+
}
27+
28+
color /= float(N_SAMPLES);
29+
30+
gl_FragColor = color;
31+
}

src/biotech/BioEventHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package biotech;
22

33
import arc.Events;
4+
import biotech.content.BioUnits;
45
import biotech.type.unit.*;
56
import biotech.ui.dialog.BioResearchDialog;
67
import biotech.world.blocks.enviroment.BiologicalStaticSpawner;
@@ -27,7 +28,7 @@ public static void init() {
2728
});
2829

2930
Events.on(EventType.WaveEvent.class, event -> {
30-
if(Vars.state.rules.spawns.contains( w -> w.type instanceof ShomeretUnitType)) BioVars.shomeretCutscene.begin();
31+
if (Vars.state.rules.spawns.contains( w -> w.type instanceof ShomeretUnitType)) BioVars.shomeretCutscene.begin();
3132
});
3233

3334
Events.on(EventType.WorldLoadEvent.class, you -> BioVars.postInit());

src/biotech/BioVars.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package biotech;
22

3+
import arc.util.Nullable;
34
import biotech.graphics.ShockwaveRenderer;
45
import biotech.ui.*;
56
import mindustry.Vars;
7+
import mindustry.gen.Unit;
68

79
public class BioVars {
810
public static ShomeretCutscene shomeretCutscene = new ShomeretCutscene();

src/biotech/content/BioUnits.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -975,8 +975,7 @@ public static void load() {
975975
top = false;
976976
reload = 5f;
977977
shootCone = 45f;
978-
loopSound = Sounds.spray;
979-
shootSound = Sounds.none;
978+
shootSound = Sounds.spray;
980979
ejectEffect = Fx.none;
981980
range = 1;
982981
mirror = false;

src/biotech/graphics/ShockwaveRenderer.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package biotech.graphics;
22

3-
import arc.Core;
43
import arc.Events;
54
import arc.graphics.g2d.Draw;
65
import arc.graphics.g2d.TextureRegion;
@@ -17,9 +16,6 @@ public class ShockwaveRenderer {
1716
private float boomIntensity,
1817
boomReduction,
1918
boomTime;
20-
private float rockAlpha,
21-
rockReduction;
22-
private final float rockBorder = 32;
2319
private final FrameBuffer buffer;
2420

2521
public ShockwaveRenderer(){
@@ -39,17 +35,13 @@ public void boom(float intensity, float duration){
3935
boomIntensity = Math.max(boomIntensity, Mathf.clamp(intensity, 0, 1));
4036
boomTime = Math.max(boomTime, duration);
4137
boomReduction = boomIntensity / boomTime;
42-
rockAlpha = 0.25f;
43-
rockReduction = rockAlpha / boomTime;
4438
}
4539

4640
private void update(){
4741
if(!Vars.state.isPaused() && boomTime > 0){
4842
boomIntensity -= boomReduction * Time.delta;
49-
rockAlpha -= rockReduction * Time.delta;
5043
boomTime -= Time.delta;
5144
boomIntensity = Mathf.clamp(boomIntensity, 0f, 1f);
52-
rockAlpha = Mathf.clamp(rockAlpha, 0f, 1f);
5345
}
5446
}
5547

@@ -68,19 +60,6 @@ private void draw(){
6860
BioShaders.shockwaveShader.intensity = boomIntensity * intensity();
6961
buffer.blit(BioShaders.shockwaveShader);
7062
}
71-
72-
Draw.alpha(rockAlpha);
73-
TextureRegion region = atlas.find("circle");
74-
float rWidth = region.width, rHeight = region.height;
75-
float sWidth = graphics.getWidth() - 2 * rockBorder,
76-
sHeight = graphics.getHeight() - 2 * rockBorder;
77-
float targetRatio = sHeight / sWidth;
78-
float sourceRatio = rHeight / rWidth;
79-
float scale = targetRatio > sourceRatio ? sWidth / rWidth : sHeight / rHeight;
80-
rWidth *= scale / Vars.renderer.getDisplayScale();
81-
rHeight *= scale / Vars.renderer.getDisplayScale();
82-
Draw.rect(region, camera.position.x, camera.position.y, rWidth, rHeight);
83-
Draw.color();
8463
});
8564
}
8665

src/biotech/type/unit/ShomeretUnitType.java

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package biotech.type.unit;
22

33
import arc.graphics.Color;
4+
import arc.math.geom.Position;
5+
import arc.util.Log;
46
import biotech.BioVars;
57
import biotech.content.BioFx;
68
import biotech.content.BioPal;
@@ -10,11 +12,14 @@
1012
import biotech.type.weapon.ShockwaveWeapon;
1113
import mindustry.content.Fx;
1214
import mindustry.entities.bullet.BasicBulletType;
15+
import mindustry.entities.effect.MultiEffect;
1316
import mindustry.entities.effect.ParticleEffect;
1417
import mindustry.gen.LegsUnit;
1518
import mindustry.gen.MechUnit;
19+
import mindustry.gen.Sounds;
1620
import mindustry.gen.Unit;
1721
import mindustry.graphics.Layer;
22+
import mindustry.graphics.Pal;
1823
import mindustry.type.UnitType;
1924
import mindustry.type.Weapon;
2025

@@ -74,15 +79,39 @@ public ShomeretUnitType(String name) {
7479
weapons.add(
7580
new ShockwaveWeapon("shomeret-shockwave"){{
7681
x = y = 0;
77-
reload = 5 * 60;
82+
reload = 7 * 60;
7883
shoot.shots = 360;
7984
shoot.shotDelay = 0.02f;
8085
rotate = true;
8186
inaccuracy = 320;
87+
88+
boomEffect = new MultiEffect(
89+
new ParticleEffect() {{
90+
layer = Layer.effect;
91+
particles = 8;
92+
colorFrom = Pal.darkestestGray.a(0.5f);
93+
colorTo = Pal.darkestestGray.a(0.5f);
94+
sizeFrom = 35;
95+
sizeTo = 0;
96+
length = 100;
97+
lifetime = 60 * 6;
98+
}},
99+
new ParticleEffect() {{
100+
layer = Layer.effect;
101+
particles = 7;
102+
colorFrom = Pal.darkerGray.a(0.5f);
103+
colorTo = Pal.darkestGray.a(0.5f);
104+
sizeFrom = 10;
105+
sizeTo = 0;
106+
length = 50;
107+
lifetime = 60 * 3;
108+
}}
109+
);
110+
82111
bullet = new BasicBulletType(4, 1){{
83112
shake = 32;
84-
shootEffect = Fx.none;
85-
despawnEffect = hitEffect = Fx.none;
113+
despawnEffect = hitEffect = shootEffect = ejectEffect = Fx.none;
114+
shootSound = Sounds.none;
86115
drag = 0.004f;
87116
lifetime = 9 * 60;
88117
knockback = 20f;
@@ -118,6 +147,7 @@ public void update(Unit unit) {
118147

119148
if (unit.health < unit.maxHealth / 2 && state == 0) state = 1;
120149

150+
121151
//ima shitter
122152
if (spawnCooldown <= 0) {
123153
//ima.spawn(unit.x, unit.y);
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
package biotech.type.weapon;
22

33
import biotech.BioVars;
4+
import mindustry.entities.Effect;
45
import mindustry.entities.Mover;
6+
import mindustry.entities.effect.ParticleEffect;
57
import mindustry.entities.units.WeaponMount;
68
import mindustry.gen.Unit;
79
import mindustry.type.Weapon;
810

911
public class ShockwaveWeapon extends Weapon {
1012
public float boomIntensity = 0.2f, boomDuration = 60f;
13+
public static Effect boomEffect;
1114

1215
public ShockwaveWeapon(String name) {
1316
super(name);
1417
}
1518

1619
@Override
17-
protected void bullet(Unit unit, WeaponMount mount, float xOffset, float yOffset, float angleOffset, Mover mover) {
18-
super.bullet(unit, mount, xOffset, yOffset, angleOffset, mover);
20+
protected void shoot(Unit unit, WeaponMount mount, float shootX, float shootY, float rotation) {
21+
super.shoot(unit, mount, shootX, shootY, rotation);
1922

2023
BioVars.shockwaveRenderer.boom(boomIntensity, boomDuration);
24+
boomEffect.at(unit.x, unit.y);
2125
}
2226
}

src/biotech/ui/BioBossBarFragment.java

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@
55
import arc.graphics.g2d.*;
66
import arc.scene.*;
77
import arc.scene.ui.layout.*;
8+
import arc.struct.Seq;
89
import arc.util.*;
10+
import biotech.BioVars;
11+
import biotech.content.BioUnits;
12+
import biotech.type.unit.ShomeretUnitType;
913
import mindustry.*;
14+
import mindustry.gen.Groups;
15+
import mindustry.gen.Unit;
1016
import mindustry.graphics.*;
1117
import mindustry.ui.*;
1218

@@ -33,22 +39,34 @@ public void load(Group parent){
3339
parent.fill( p -> {
3440
p.name = "biotech-bossbar";
3541
p.align(Align.top).setFillParent(true);
36-
p.add(bossBar).visible(true); //<- replace with the unit detection
42+
p.add(bossBar).visible(true);
3743
});
3844
}
3945

4046
public void build(){
4147
bossBar.clear();
48+
Seq<Unit> bosses = new Seq<>();
49+
final float[] health = {0f};
50+
51+
bosses = Groups.unit.copy().retainAll(unit -> unit.type instanceof ShomeretUnitType);
52+
bosses.forEach( u -> {
53+
health[0] += u.healthf();
54+
});
55+
health[0] = health[0] / bosses.size;
56+
4257
Bar bar = new Bar(
43-
() -> ">m< ow",
58+
() -> "A-16 'SHOMERET'",
4459
() -> Pal.heal,
45-
() -> Vars.player.unit() != null ? Vars.player.unit().healthf() : 0f //<- replace this with the actually unit(s)
60+
() -> health[0] //<- replace this with the actually unit(s)
4661
){
4762
@Override
4863
public void draw(){
4964
//replace this with ur gorry image -rushie
5065
super.draw();
5166
}
67+
{
68+
visible(() -> Groups.unit.copy().allMatch(u -> u.type instanceof ShomeretUnitType));
69+
}
5270
};
5371
bossBar.add(bar).minWidth(Core.graphics.getWidth() * 0.95f).minHeight(50f).pad(5f);
5472
}

0 commit comments

Comments
 (0)