Cleanup
This commit is contained in:
@@ -1328,7 +1328,7 @@ public class Blocks implements ContentList{
|
|||||||
//region storage
|
//region storage
|
||||||
|
|
||||||
coreShard = new CoreBlock("core-shard"){{
|
coreShard = new CoreBlock("core-shard"){{
|
||||||
requirements(Category.effect, BuildVisibility.debugOnly, with(Items.copper, 2000, Items.lead, 1000));
|
requirements(Category.effect, BuildVisibility.editorOnly, with(Items.copper, 2000, Items.lead, 1000));
|
||||||
alwaysUnlocked = true;
|
alwaysUnlocked = true;
|
||||||
|
|
||||||
unitType = UnitTypes.alpha;
|
unitType = UnitTypes.alpha;
|
||||||
|
|||||||
+7
-7
@@ -8,7 +8,7 @@ import mindustry.content.*;
|
|||||||
import mindustry.entities.*;
|
import mindustry.entities.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
|
||||||
public class MovementLightningAbility extends Ability{
|
public class MoveLightningAbility extends Ability{
|
||||||
//Lightning damage
|
//Lightning damage
|
||||||
public float damage = 35f;
|
public float damage = 35f;
|
||||||
//Chance of firing every tick. Set >= 1 to always fire lightning every tick at max speed.
|
//Chance of firing every tick. Set >= 1 to always fire lightning every tick at max speed.
|
||||||
@@ -17,15 +17,15 @@ public class MovementLightningAbility extends Ability{
|
|||||||
public int length = 12;
|
public int length = 12;
|
||||||
//Speeds for when to start lightninging and when to stop getting faster
|
//Speeds for when to start lightninging and when to stop getting faster
|
||||||
public float minSpeed = 0.8f, maxSpeed = 1.2f;
|
public float minSpeed = 0.8f, maxSpeed = 1.2f;
|
||||||
//Lightning Color
|
//Lightning color
|
||||||
public Color color = Color.valueOf("a9d8ff");
|
public Color color = Color.valueOf("a9d8ff");
|
||||||
|
|
||||||
public Effect shootEffect = Fx.sparkShoot;
|
public Effect shootEffect = Fx.sparkShoot;
|
||||||
public Sound shootSound = Sounds.spark;
|
public Sound shootSound = Sounds.spark;
|
||||||
|
|
||||||
MovementLightningAbility(){}
|
MoveLightningAbility(){}
|
||||||
|
|
||||||
public MovementLightningAbility(float damage, int length, float chance, float minSpeed, float maxSpeed, Color color){
|
public MoveLightningAbility(float damage, int length, float chance, float minSpeed, float maxSpeed, Color color){
|
||||||
this.damage = damage;
|
this.damage = damage;
|
||||||
this.length = length;
|
this.length = length;
|
||||||
this.chance = chance;
|
this.chance = chance;
|
||||||
@@ -37,10 +37,10 @@ public class MovementLightningAbility extends Ability{
|
|||||||
@Override
|
@Override
|
||||||
public void update(Unit unit){
|
public void update(Unit unit){
|
||||||
float scl = Mathf.clamp((unit.vel().len() - minSpeed) / (maxSpeed - minSpeed));
|
float scl = Mathf.clamp((unit.vel().len() - minSpeed) / (maxSpeed - minSpeed));
|
||||||
if(Mathf.chance(Time.delta * (chance * scl))){
|
if(Mathf.chance(Time.delta * chance * scl)){
|
||||||
shootEffect.at(unit.x, unit.y, unit.rotation, color);
|
shootEffect.at(unit.x, unit.y, unit.rotation, color);
|
||||||
Lightning.create(unit.team, color, damage, unit.x + unit.vel().x, unit.y + unit.vel().y, unit.rotation, length);
|
Lightning.create(unit.team, color, damage, unit.x + unit.vel.x, unit.y + unit.vel.y, unit.rotation, length);
|
||||||
shootSound.at(unit.x, unit.y);
|
shootSound.at(unit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -141,7 +141,7 @@ public class BlockInventoryFragment extends Fragment{
|
|||||||
Boolp canPick = () -> player.unit().acceptsItem(item) && !state.isPaused() && player.within(tile, itemTransferRange);
|
Boolp canPick = () -> player.unit().acceptsItem(item) && !state.isPaused() && player.within(tile, itemTransferRange);
|
||||||
|
|
||||||
HandCursorListener l = new HandCursorListener();
|
HandCursorListener l = new HandCursorListener();
|
||||||
l.setEnabled(canPick);
|
l.enabled = canPick;
|
||||||
|
|
||||||
Element image = itemImage(item.icon(Cicon.xlarge), () -> {
|
Element image = itemImage(item.icon(Cicon.xlarge), () -> {
|
||||||
if(tile == null || !tile.isValid()){
|
if(tile == null || !tile.isValid()){
|
||||||
|
|||||||
@@ -714,7 +714,17 @@ public class HudFragment extends Fragment{
|
|||||||
t.margin(0);
|
t.margin(0);
|
||||||
|
|
||||||
t.add(new SideBar(() -> player.unit().healthf(), () -> true, true)).width(bw).growY().padRight(pad);
|
t.add(new SideBar(() -> player.unit().healthf(), () -> true, true)).width(bw).growY().padRight(pad);
|
||||||
t.image(() -> player.icon()).scaling(Scaling.bounded).grow().maxWidth(54f);
|
t.image(() -> player.icon()).scaling(Scaling.bounded).grow().maxWidth(54f).with(i -> {
|
||||||
|
if(mobile){
|
||||||
|
//on mobile, cause a respawn on tap
|
||||||
|
i.clicked(() -> {
|
||||||
|
if(!player.unit().spawnedByCore && !player.dead()){
|
||||||
|
Call.unitClear(player);
|
||||||
|
control.input.controlledType = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
t.add(new SideBar(() -> player.dead() ? 0f : player.displayAmmo() ? player.unit().ammof() : player.unit().healthf(), () -> !player.displayAmmo(), false)).width(bw).growY().padLeft(pad).update(b -> {
|
t.add(new SideBar(() -> player.dead() ? 0f : player.displayAmmo() ? player.unit().ammof() : player.unit().healthf(), () -> !player.displayAmmo(), false)).width(bw).growY().padLeft(pad).update(b -> {
|
||||||
b.color.set(player.displayAmmo() ? player.dead() || player.unit() instanceof BlockUnitc ? Pal.ammo : player.unit().type.ammoType.color : Pal.health);
|
b.color.set(player.displayAmmo() ? player.dead() || player.unit() instanceof BlockUnitc ? Pal.ammo : player.unit().type.ammoType.color : Pal.health);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ public enum BuildVisibility{
|
|||||||
hidden(() -> false),
|
hidden(() -> false),
|
||||||
shown(() -> true),
|
shown(() -> true),
|
||||||
debugOnly(() -> false),
|
debugOnly(() -> false),
|
||||||
|
editorOnly(() -> false),
|
||||||
sandboxOnly(() -> Vars.state == null || Vars.state.rules.infiniteResources),
|
sandboxOnly(() -> Vars.state == null || Vars.state.rules.infiniteResources),
|
||||||
campaignOnly(() -> Vars.state == null || Vars.state.isCampaign()),
|
campaignOnly(() -> Vars.state == null || Vars.state.isCampaign()),
|
||||||
lightingOnly(() -> Vars.state == null || Vars.state.rules.lighting || Vars.state.isCampaign()),
|
lightingOnly(() -> Vars.state == null || Vars.state.rules.lighting || Vars.state.isCampaign()),
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=64d0a3b6aee8ac3da5ae0db6e0ec2074349e996a
|
archash=392916100da348316b514af0af19fc48a04255b9
|
||||||
|
|||||||
Reference in New Issue
Block a user