Block Drawer cleanup

This commit is contained in:
Anuke
2022-03-06 13:03:14 -05:00
parent bc0b0b254d
commit fb2b266661
29 changed files with 132 additions and 337 deletions

View File

@@ -39,11 +39,10 @@ public class ItemTurret extends Turret{
/** Makes copies of all bullets and limits their range. */
public void limitRange(float margin){
for(var entry : ammoTypes.copy().entries()){
var copy = entry.value.copy();
float realRange = copy.rangeChange + range;
var bullet = entry.value;
float realRange = bullet.rangeChange + range;
//doesn't handle drag
copy.lifetime = (realRange + margin) / copy.speed;
ammoTypes.put(entry.key, copy);
bullet.lifetime = (realRange + margin) / bullet.speed;
}
}

View File

@@ -42,9 +42,7 @@ public class PayloadTurret extends Turret{
/** Makes copies of all bullets and limits their range. */
public void limitRange(float margin){
for(var entry : ammoTypes.copy().entries()){
var copy = entry.value.copy();
copy.lifetime = (range + margin) / copy.speed;
ammoTypes.put(entry.key, copy);
entry.value.lifetime = (range + margin) / entry.value.speed;
}
}