Skip to content

Commit 71ef1db

Browse files
committed
Buff signal flare turret
+ Slightly better code
1 parent c3d17a0 commit 71ef1db

File tree

3 files changed

+25
-19
lines changed

3 files changed

+25
-19
lines changed

src/progressed/content/PMUnitTypes.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -198,22 +198,22 @@ public static void load(){
198198
}});
199199

200200
flareSmall = EntityRegistry.content("small-flare", SignalFlareUnit.class, name -> new SignalFlareUnitType(name){{
201-
health = 300f;
201+
health = 400f;
202202
hideDetails = false;
203203
attraction = 800f;
204204
flareY = 29f / 4f;
205205
}});
206206

207-
flareMedium = EntityRegistry.content("medium-flare", SignalFlareUnit.class, name -> new SignalFlareUnitType(name, 360f){{
208-
health = 900f;
207+
flareMedium = EntityRegistry.content("medium-flare", SignalFlareUnit.class, name -> new SignalFlareUnitType(name, 8f * 60f){{
208+
health = 1500f;
209209
hideDetails = false;
210210
attraction = 11000f;
211211
flareY = 45f / 4f;
212212
flareEffectSize = 1.5f;
213213
}});
214214

215-
flareLarge = EntityRegistry.content("large-flare", SignalFlareUnit.class, name -> new SignalFlareUnitType(name, 420f){{
216-
health = 2700f;
215+
flareLarge = EntityRegistry.content("large-flare", SignalFlareUnit.class, name -> new SignalFlareUnitType(name, 15f * 60f){{
216+
health = 6000f;
217217
hideDetails = false;
218218
attraction = 26000f;
219219
flareY = 61f / 4f;

src/progressed/content/blocks/PMBlocks.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ public void setStats(){
597597
minRange = 5f * tilesize;
598598
range = 60f * tilesize;
599599
shootY = 23f / 4f;
600-
reload = 900f;
600+
reload = 120f;
601601
inaccuracy = 10f;
602602
velocityRnd = 0.2f;
603603
shootSound = Sounds.shootSnap;

src/progressed/world/blocks/defence/turret/SignalFlareTurret.java

+19-13
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ public void updateTile(){
105105
bullet = null;
106106
}
107107

108+
if(flaresMaxed()) return; //Don't bother with targeting when it can't shoot.
109+
108110
if(hasAmmo()){
109111
if(timer(timerTarget, targetInterval)){
110112
findTarget();
@@ -131,26 +133,26 @@ public void updateTile(){
131133

132134
@Override
133135
protected void updateShooting(){
134-
if(flares.size < flareLimit && bullet == null){
135-
if(reloadCounter >= reload && !charging()){
136-
BulletType type = peekAmmo();
136+
if(bullet != null) return;
137137

138-
shoot(type);
138+
if(reloadCounter >= reload && !charging()){
139+
BulletType type = peekAmmo();
139140

140-
reloadCounter = 0f;
141+
shoot(type);
141142

142-
targetFound = false;
143-
}else{
144-
reloadCounter += delta() * peekAmmo().reloadMultiplier * baseReloadSpeed();
145-
}
143+
reloadCounter = 0f;
144+
145+
targetFound = false;
146+
}else{
147+
reloadCounter += delta() * peekAmmo().reloadMultiplier * baseReloadSpeed();
146148
}
147149
}
148150

149151
@Override
150152
protected void updateCooling(){
151-
if(flares.size < flareLimit && bullet == null){
152-
super.updateCooling();
153-
}
153+
if(bullet != null) return;
154+
155+
super.updateCooling();
154156
}
155157

156158
@Override
@@ -188,7 +190,11 @@ protected void handleBullet(Bullet bullet, float offsetX, float offsetY, float a
188190

189191
@Override
190192
public BlockStatus status(){
191-
return (flares.size >= flareLimit || bullet != null) ? BlockStatus.noOutput : super.status();
193+
return flaresMaxed() ? BlockStatus.noOutput : super.status();
194+
}
195+
196+
public boolean flaresMaxed(){
197+
return flares.size >= flareLimit || bullet != null;
192198
}
193199

194200
public float countf(){

0 commit comments

Comments
 (0)