Skip to content

Commit 2b4a063

Browse files
committed
announcer
1 parent 0d7469f commit 2b4a063

File tree

8 files changed

+84
-7
lines changed

8 files changed

+84
-7
lines changed
340 Bytes
Loading
322 Bytes
Loading
319 Bytes
Loading

assets/sprites/units/announcer.png

885 Bytes
Loading

assets/sprites/units/relayer.png

122 Bytes
Loading
580 Bytes
Loading
197 Bytes
Loading

src/overblocks/content/OBUnitTypes.java

Lines changed: 84 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
package overblocks.content;
22

33
import arc.graphics.*;
4-
import ent.anno.*;
4+
import arc.graphics.g2d.*;
5+
import arc.math.*;
6+
import arc.math.geom.*;
57
import mindustry.content.*;
8+
import mindustry.entities.*;
69
import mindustry.entities.bullet.*;
710
import mindustry.gen.*;
8-
import mindustry.gen.MechUnit;
911
import mindustry.graphics.*;
1012
import mindustry.type.*;
1113
import mindustry.type.ammo.*;
1214
import overblocks.gen.*;
1315
import overblocks.type.*;
1416

17+
import static arc.graphics.g2d.Draw.*;
18+
import static arc.graphics.g2d.Lines.*;
1519
import static ent.anno.Annotations.EntityDef;
1620

1721
@SuppressWarnings("unused")
@@ -36,7 +40,7 @@ public static void load(){
3640
health = 100;
3741
ammoType = new PowerAmmoType(1000);
3842

39-
weapons.add(new Weapon("overblocks-relayer-weapon"){{
43+
weapons.add(new Weapon(name + "-weapon"){{
4044
top = false;
4145
shootY = 2f;
4246
reload = 36f;
@@ -47,15 +51,88 @@ public static void load(){
4751
shootSound = Sounds.lasershoot;
4852

4953
bullet = new LaserBoltBulletType(2.5f, 12){{
50-
smokeEffect = Fx.hitLaser;
51-
hitEffect = Fx.hitLaser;
52-
despawnEffect = Fx.hitLaser;
54+
smokeEffect = Fx.hitLaserColor;
55+
hitEffect = Fx.hitLaserColor;
56+
despawnEffect = Fx.hitLaserColor;
5357

5458
lifetime = 90f;
55-
backColor = lightColor = Pal.lancerLaser;
59+
backColor = lightColor = hitColor = Pal.lancerLaser;
5660
frontColor = Color.white;
5761
}};
5862
}});
5963
}};
64+
65+
announcer = new OBUnitType("announcer", DodgeMechUnit.class){{
66+
speed = 0.5f;
67+
hitSize = 10f;
68+
health = 550;
69+
armor = 4f;
70+
dodge = 0.25f;
71+
ammoType = new ItemAmmoType(Items.graphite);
72+
73+
immunities.add(StatusEffects.shocked);
74+
75+
weapons.add(new Weapon(name + "-weapon"){{
76+
top = false;
77+
shootSound = Sounds.bolt;
78+
shootY = 2f;
79+
reload = 11f;
80+
x = 4.5f;
81+
recoil = 1f;
82+
rotate = true;
83+
rotationLimit = 50;
84+
shootCone = 60f;
85+
ejectEffect = Fx.none;
86+
87+
bullet = new RailBulletType(){{
88+
length = 130f;
89+
damage = 28;
90+
hitColor = Pal.lancerLaser;
91+
hitEffect = endEffect = Fx.hitBulletColor;
92+
93+
smokeEffect = Fx.colorSpark;
94+
status = StatusEffects.shocked;
95+
statusDuration = 10f;
96+
97+
endEffect = new Effect(14f, e -> {
98+
color(e.color);
99+
Drawf.tri(e.x, e.y, e.fout() * 1.5f, 5f, e.rotation);
100+
});
101+
102+
shootEffect = new Effect(10, e -> {
103+
color(e.color);
104+
float w = 1.2f + 7 * e.fout();
105+
106+
Drawf.tri(e.x, e.y, w, 30f * e.fout(), e.rotation);
107+
color(e.color);
108+
109+
for(int i : Mathf.signs){
110+
Drawf.tri(e.x, e.y, w * 0.9f, 18f * e.fout(), e.rotation + i * 90f);
111+
}
112+
113+
Drawf.tri(e.x, e.y, w, 4f * e.fout(), e.rotation + 180f);
114+
});
115+
116+
lineEffect = new Effect(20f, e -> {
117+
if(!(e.data instanceof Vec2 v)) return;
118+
119+
color(e.color);
120+
stroke(e.fout() * 0.9f + 0.6f);
121+
122+
Fx.rand.setSeed(e.id);
123+
for(int i = 0; i < 7; i++){
124+
Fx.v.trns(e.rotation, Fx.rand.random(8f, v.dst(e.x, e.y) - 8f));
125+
Lines.lineAngleCenter(e.x + Fx.v.x, e.y + Fx.v.y, e.rotation + e.finpow(), e.foutpowdown() * 20f * Fx.rand.random(0.5f, 1f) + 0.3f);
126+
}
127+
128+
e.scaled(14f, b -> {
129+
stroke(b.fout() * 1.5f);
130+
color(e.color);
131+
Lines.line(e.x, e.y, v.x, v.y);
132+
});
133+
});
134+
}};
135+
}});
136+
}};
60137
}
61138
}

0 commit comments

Comments
 (0)