Merge branch 'master' of https://github.com/Anuken/Mindustry into schematics
This commit is contained in:
@@ -99,8 +99,7 @@ public class Bullets implements ContentList{
|
||||
collidesTiles = false;
|
||||
splashDamageRadius = 25f;
|
||||
splashDamage = 30f;
|
||||
incendAmount = 4;
|
||||
incendSpread = 11f;
|
||||
status = StatusEffects.burning;
|
||||
frontColor = Pal.lightishOrange;
|
||||
backColor = Pal.lightOrange;
|
||||
trailEffect = Fx.incendTrail;
|
||||
@@ -228,8 +227,7 @@ public class Bullets implements ContentList{
|
||||
splashDamage = 10f;
|
||||
lifetime = 160f;
|
||||
hitEffect = Fx.blastExplosion;
|
||||
incendSpread = 10f;
|
||||
incendAmount = 3;
|
||||
status = StatusEffects.burning;
|
||||
}};
|
||||
|
||||
missileSurge = new MissileBulletType(4.4f, 15, "bullet"){{
|
||||
@@ -342,9 +340,7 @@ public class Bullets implements ContentList{
|
||||
bulletHeight = 12f;
|
||||
frontColor = Pal.lightishOrange;
|
||||
backColor = Pal.lightOrange;
|
||||
incendSpread = 3f;
|
||||
incendAmount = 1;
|
||||
incendChance = 0.3f;
|
||||
status = StatusEffects.burning;
|
||||
inaccuracy = 3f;
|
||||
lifetime = 60f;
|
||||
}};
|
||||
@@ -354,9 +350,7 @@ public class Bullets implements ContentList{
|
||||
bulletHeight = 12f;
|
||||
frontColor = Color.valueOf("feb380");
|
||||
backColor = Color.valueOf("ea8878");
|
||||
incendSpread = 3f;
|
||||
incendAmount = 1;
|
||||
incendChance = 0.3f;
|
||||
status = StatusEffects.burning;
|
||||
lifetime = 60f;
|
||||
}};
|
||||
|
||||
@@ -385,9 +379,7 @@ public class Bullets implements ContentList{
|
||||
bulletHeight = 21f;
|
||||
frontColor = Pal.lightishOrange;
|
||||
backColor = Pal.lightOrange;
|
||||
incendSpread = 3f;
|
||||
incendAmount = 2;
|
||||
incendChance = 0.3f;
|
||||
status = StatusEffects.burning;
|
||||
shootEffect = Fx.shootBig;
|
||||
}};
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public class StatusEffects implements ContentList{
|
||||
none = new StatusEffect();
|
||||
|
||||
burning = new StatusEffect(){{
|
||||
damage = 0.04f;
|
||||
damage = 0.06f;
|
||||
effect = Fx.burning;
|
||||
|
||||
opposite(() -> wet, () -> freezing);
|
||||
|
||||
@@ -47,7 +47,7 @@ public abstract class BulletType extends Content{
|
||||
/** Status effect applied on hit. */
|
||||
public StatusEffect status = StatusEffects.none;
|
||||
/** Intensity of applied status effect in terms of duration. */
|
||||
public float statusDuration = 60 * 1f;
|
||||
public float statusDuration = 60 * 10f;
|
||||
/** Whether this bullet type collides with tiles. */
|
||||
public boolean collidesTiles = true;
|
||||
/** Whether this bullet type collides with tiles that are of the same team. */
|
||||
|
||||
@@ -208,7 +208,7 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
}
|
||||
|
||||
//move all current requests to removal array so they fade out
|
||||
removals.addAll(selectRequests.find(r -> !r.breaking));
|
||||
removals.addAll(selectRequests.select(r -> !r.breaking));
|
||||
selectRequests.clear();
|
||||
selecting = false;
|
||||
}).visible(() -> !selectRequests.isEmpty()).name("confirmplace");
|
||||
|
||||
@@ -34,34 +34,29 @@ public class ContentParser{
|
||||
private static final boolean ignoreUnknownFields = true;
|
||||
private ObjectMap<Class<?>, ContentType> contentTypes = new ObjectMap<>();
|
||||
private ObjectMap<Class<?>, FieldParser> classParsers = new ObjectMap<Class<?>, FieldParser>(){{
|
||||
put(BulletType.class, (type, data) -> field(Bullets.class, data));
|
||||
put(Effect.class, (type, data) -> field(Fx.class, data));
|
||||
put(StatusEffect.class, (type, data) -> field(StatusEffects.class, data));
|
||||
put(Loadout.class, (type, data) -> field(Loadouts.class, data));
|
||||
put(Color.class, (type, data) -> Color.valueOf(data.asString()));
|
||||
put(BulletType.class, (type, data) -> {
|
||||
Class<? extends BulletType> bc = data.has("type") ? resolve(data.getString("type"), "io.anuke.mindustry.entities.bullets") : BasicBulletType.class;
|
||||
if(data.isString()){
|
||||
return field(Bullets.class, data);
|
||||
}
|
||||
Class<? extends BulletType> bc = data.has("type") ? resolve(data.getString("type"), "io.anuke.mindustry.entities.bullet") : BasicBulletType.class;
|
||||
data.remove("type");
|
||||
BulletType result = make(bc);
|
||||
readFields(result, data);
|
||||
return result;
|
||||
});
|
||||
put(Music.class, (type, data) -> {
|
||||
if(fieldOpt(Musics.class, data) != null) return fieldOpt(Musics.class, data);
|
||||
|
||||
String path = "music/" + data.asString() + (Vars.ios ? ".mp3" : ".ogg");
|
||||
Core.assets.load(path, Music.class);
|
||||
Core.assets.finishLoadingAsset(path);
|
||||
return Core.assets.get(path);
|
||||
});
|
||||
put(Sound.class, (type, data) -> {
|
||||
if(fieldOpt(Sounds.class, data) != null) return fieldOpt(Sounds.class, data);
|
||||
|
||||
String path = "sounds/" + data.asString() + (Vars.ios ? ".mp3" : ".ogg");
|
||||
Core.assets.load(path, Sound.class);
|
||||
Core.assets.finishLoadingAsset(path);
|
||||
Log.info(Core.assets.get(path));
|
||||
return Core.assets.get(path);
|
||||
ProxySound sound = new ProxySound();
|
||||
Core.assets.load(path, Sound.class).loaded = result -> {
|
||||
sound.sound = (Sound)result;
|
||||
};
|
||||
return sound;
|
||||
});
|
||||
put(Objective.class, (type, data) -> {
|
||||
Class<? extends Objective> oc = data.has("type") ? resolve(data.getString("type"), "io.anuke.mindustry.game.Objectives") : ZoneWave.class;
|
||||
|
||||
@@ -60,7 +60,7 @@ public class Mods implements Loadable{
|
||||
|
||||
file.copyTo(dest);
|
||||
try{
|
||||
loaded.add(loadMod(file, false));
|
||||
loaded.add(loadMod(dest, false));
|
||||
requiresReload = true;
|
||||
}catch(IOException e){
|
||||
dest.delete();
|
||||
|
||||
135
core/src/io/anuke/mindustry/mod/ProxySound.java
Normal file
135
core/src/io/anuke/mindustry/mod/ProxySound.java
Normal file
@@ -0,0 +1,135 @@
|
||||
package io.anuke.mindustry.mod;
|
||||
|
||||
import io.anuke.arc.audio.*;
|
||||
import io.anuke.arc.audio.mock.*;
|
||||
import io.anuke.arc.math.geom.*;
|
||||
import io.anuke.arc.util.ArcAnnotate.*;
|
||||
|
||||
public class ProxySound implements Sound{
|
||||
public @NonNull Sound sound = new MockSound();
|
||||
|
||||
@Override
|
||||
public float calcPan(float x, float y){
|
||||
return sound.calcPan(x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calcVolume(float x, float y){
|
||||
return sound.calcVolume(x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calcFalloff(float x, float y){
|
||||
return sound.calcFalloff(x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int at(float x, float y, float pitch){
|
||||
return sound.at(x, y, pitch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int at(float x, float y){
|
||||
return sound.at(x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int at(Position pos){
|
||||
return sound.at(pos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int at(Position pos, float pitch){
|
||||
return sound.at(pos, pitch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int play(){
|
||||
return sound.play();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int play(float volume){
|
||||
return sound.play(volume);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int play(float volume, float pitch, float pan){
|
||||
return sound.play(volume, pitch, pan);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int loop(){
|
||||
return sound.loop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int loop(float volume){
|
||||
return sound.loop(volume);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int loop(float volume, float pitch, float pan){
|
||||
return sound.loop(volume, pitch, pan);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop(){
|
||||
sound.stop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pause(){
|
||||
sound.pause();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resume(){
|
||||
sound.resume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose(){
|
||||
sound.dispose();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop(int soundId){
|
||||
sound.stop(soundId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pause(int soundId){
|
||||
sound.pause(soundId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resume(int soundId){
|
||||
sound.resume(soundId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLooping(int soundId, boolean looping){
|
||||
sound.setLooping(soundId, looping);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPitch(int soundId, float pitch){
|
||||
sound.setPitch(soundId, pitch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setVolume(int soundId, float volume){
|
||||
sound.setVolume(soundId, volume);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPan(int soundId, float pan, float volume){
|
||||
sound.setPan(soundId, pan, volume);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDisposed(){
|
||||
return sound.isDisposed();
|
||||
}
|
||||
}
|
||||
@@ -48,6 +48,7 @@ public class LoadoutDialog extends FloatingDialog{
|
||||
|
||||
buttons.addImageTextButton("$settings.reset", Icon.refreshSmall, () -> {
|
||||
resetter.run();
|
||||
reseed();
|
||||
updater.run();
|
||||
setup();
|
||||
}).size(210f, 64f);
|
||||
@@ -55,10 +56,7 @@ public class LoadoutDialog extends FloatingDialog{
|
||||
|
||||
public void show(int capacity, Array<ItemStack> stacks, Runnable reseter, Runnable updater, Runnable hider){
|
||||
this.originalStacks = stacks;
|
||||
this.stacks = stacks.map(ItemStack::copy);
|
||||
this.stacks.addAll(content.items().select(i -> i.type == ItemType.material &&
|
||||
!stacks.contains(stack -> stack.item == i)).map(i -> new ItemStack(i, 0)));
|
||||
this.stacks.sort(Structs.comparingInt(s -> s.item.id));
|
||||
reseed();
|
||||
this.resetter = reseter;
|
||||
this.updater = updater;
|
||||
this.capacity = capacity;
|
||||
@@ -110,6 +108,13 @@ public class LoadoutDialog extends FloatingDialog{
|
||||
}
|
||||
}
|
||||
|
||||
private void reseed(){
|
||||
this.stacks = originalStacks.map(ItemStack::copy);
|
||||
this.stacks.addAll(content.items().select(i -> i.type == ItemType.material &&
|
||||
!stacks.contains(stack -> stack.item == i)).map(i -> new ItemStack(i, 0)));
|
||||
this.stacks.sort(Structs.comparingInt(s -> s.item.id));
|
||||
}
|
||||
|
||||
private int step(int amount){
|
||||
if(amount < 1000){
|
||||
return 100;
|
||||
|
||||
@@ -41,11 +41,11 @@ public class ModsDialog extends FloatingDialog{
|
||||
mods.reloadContent();
|
||||
setup();
|
||||
ui.loadfrag.hide();
|
||||
}catch(Exception e){
|
||||
}catch(Throwable e){
|
||||
ui.showException(e);
|
||||
}
|
||||
});
|
||||
}catch(Exception e){
|
||||
}catch(Throwable e){
|
||||
ui.showException(e);
|
||||
}
|
||||
}, t -> Core.app.post(() -> ui.showException(t)));
|
||||
|
||||
@@ -250,8 +250,9 @@ public class HudFragment extends Fragment{
|
||||
});
|
||||
|
||||
parent.fill(t -> {
|
||||
t.visible(() -> Core.settings.getBool("minimap") && !state.rules.tutorial);
|
||||
//minimap
|
||||
t.add(new Minimap().visible(() -> Core.settings.getBool("minimap") && !state.rules.tutorial));
|
||||
t.add(new Minimap());
|
||||
t.row();
|
||||
//position
|
||||
t.label(() -> world.toTile(player.x) + "," + world.toTile(player.y))
|
||||
|
||||
Reference in New Issue
Block a user