1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2024-09-22 13:57:46 +03:00

Made flak actually flak-like

This commit is contained in:
Anuken 2018-01-08 19:51:36 -05:00
parent 064b8e53f4
commit 530505c3a0
7 changed files with 65 additions and 23 deletions

View File

@ -86,8 +86,6 @@ public class AndroidLauncher extends AndroidApplication{
}
};
Mindustry.platforms.requestWritePerms();
if(doubleScaleTablets && isTablet(this.getContext())){
Unit.dp.addition = 0.5f;
}

View File

@ -226,12 +226,6 @@ public class Control extends Module{
weapons.add(Weapon.blaster);
player.weaponLeft = player.weaponRight = weapons.first();
if(debug){
//weapons.add(Weapon.triblaster, Weapon.clustergun, Weapon.beam, Weapon.vulcan);
//weapons.add(Weapon.shockgun);
player.weaponLeft = player.weaponRight = weapons.peek();
}
lastUpdated = -1;
wave = 1;
extrawavetime = maxwavespace;

View File

@ -124,6 +124,55 @@ public abstract class BulletType extends BaseBulletType<Bullet>{
DamageArea.damage(!(b.owner instanceof Enemy), b.x, b.y, 25f, (int)(damage * 2f/3f));
}
},
flak = new BulletType(3f, 8) {
public void init(Bullet b) {
b.velocity.scl(Mathf.random(0.6f, 1f));
}
public void update(Bullet b){
if(Timers.get(b, "smoke", 7)){
Effects.effect(Fx.smoke, b.x + Mathf.range(2), b.y + Mathf.range(2));
}
}
public void draw(Bullet b) {
Draw.color(Color.GRAY);
Draw.thick(3f);
Draw.lineAngleCenter(b.x, b.y, b.angle(), 2f);
Draw.thick(1.5f);
Draw.lineAngleCenter(b.x, b.y, b.angle(), 5f);
Draw.reset();
}
public void removed(Bullet b) {
despawned(b);
}
public void despawned(Bullet b) {
Effects.effect(shellsmoke, b);
for(int i = 0; i < 3; i ++){
Bullet bullet = new Bullet(flakspark, b.owner, b.x, b.y, b.angle() + Mathf.range(120f));
bullet.add();
}
}
},
flakspark = new BulletType(2f, 2) {
{
drag = 0.05f;
}
public void init(Bullet b) {
b.velocity.scl(Mathf.random(0.6f, 1f));
}
public void draw(Bullet b) {
Draw.color(Color.LIGHT_GRAY, Color.GRAY, b.ifract());
Draw.thick(2f - b.ifract());
Draw.lineAngleCenter(b.x, b.y, b.angle(), 2f);
Draw.reset();
}
},
titanshell = new BulletType(1.8f, 38){
{
lifetime = 70f;

View File

@ -163,7 +163,7 @@ public class ProductionBlocks{
coalgenerator = new ItemPowerGenerator("coalgenerator"){
{
generateItem = Item.coal;
powerOutput = 0.05f;
powerOutput = 0.04f;
powerCapacity = 40f;
}
},
@ -171,7 +171,7 @@ public class ProductionBlocks{
{
generateLiquid = Liquid.lava;
maxLiquidGenerate = 0.5f;
powerPerLiquid = 0.09f;
powerPerLiquid = 0.08f;
powerCapacity = 40f;
generateEffect = Fx.redgeneratespark;
}
@ -180,7 +180,7 @@ public class ProductionBlocks{
{
generateLiquid = Liquid.oil;
maxLiquidGenerate = 0.4f;
powerPerLiquid = 0.13f;
powerPerLiquid = 0.12f;
powerCapacity = 40f;
}
},
@ -188,7 +188,7 @@ public class ProductionBlocks{
{
generateItem = Item.uranium;
powerCapacity = 40f;
powerOutput = 0.04f;
powerOutput = 0.03f;
itemDuration = 240f;
}
},

View File

@ -100,10 +100,12 @@ public class WeaponBlocks{
mortarturret = new Turret("mortarturret"){
{
shootsound = "bigshot";
rotatespeed = 0.1f;
rotatespeed = 0.2f;
range = 120;
reload = 100f;
bullet = BulletType.shell;
reload = 50f;
bullet = BulletType.flak;
shots = 3;
inaccuracy = 8f;
ammo = Item.coal;
ammoMultiplier = 5;
health = 110;

View File

@ -1,12 +1,7 @@
package io.anuke.mindustry.world.blocks.types.production;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.Vars;
import io.anuke.mindustry.entities.TileEntity;
@ -21,6 +16,10 @@ import io.anuke.ucore.core.Timers;
import io.anuke.ucore.util.Mathf;
import io.anuke.ucore.util.Tmp;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
//TODO possibly proken
public class NuclearReactor extends LiquidPowerGenerator{
protected final int timerFuel = timers++;
@ -30,8 +29,8 @@ public class NuclearReactor extends LiquidPowerGenerator{
protected int itemCapacity = 30;
protected Color coolColor = new Color(1, 1, 1, 0f);
protected Color hotColor = Color.valueOf("ff9575a3");
protected int fuelUseTime = 140; //time to consume 1 fuel
protected float powerMultiplier = 0.4f; //power per frame, depends on full capacity
protected int fuelUseTime = 130; //time to consume 1 fuel
protected float powerMultiplier = 0.45f; //power per frame, depends on full capacity
protected float heating = 0.007f; //heating per frame
protected float coolantPower = 0.007f; //how much heat decreases per coolant unit
protected float smokeThreshold = 0.3f; //threshold at which block starts smoking