Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sk7725 committed Feb 19, 2021
1 parent 1e10b25 commit f826927
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 45 deletions.
18 changes: 11 additions & 7 deletions assets/bundles/bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,22 @@ block.betamindy-cloner.description = Clones the [accent]block it is facing[] to
block.betamindy-cloner.details = A perfect way to make piston flying machine factories.
block.betamindy-mynamite.name = Mynamite
block.betamindy-mynamite.description = Blows up, mining nearby ores using the force of the explosion. Mined items will be transferred to nearby blocks, excluding conveyors.\nTap it, or provide power to blow it up. It will also blow up automatically when placed on hot floor.
block.betamindy-mynamitelarge.name = Large Mynamite
block.betamindy-mynamitelarge.description = Blows up, mining nearby ores using the force of the explosion. Mined items will be transferred to nearby blocks, excluding conveyors. Better at mining ores, but items that are too soft will be blown away.\nProvide power to blow it up. It will also blow up automatically when placed on hot floor.
block.betamindy-mynamite-large.name = Large Mynamite
block.betamindy-mynamite-large.description = Blows up, mining nearby ores using the force of the explosion. Mined items will be transferred to nearby blocks, excluding conveyors. Better at mining ores, but items that are too soft will be blown away.\nProvide power to blow it up. It will also blow up automatically when placed on hot floor.

#Power
# Power
block.betamindy-button.name = Button
block.betamindy-button.description = Produces power when clicked.
block.betamindy-buttonbig.name = Large Button
block.betamindy-buttonbig.description = Produces power when clicked. \nNow easier to tap!
block.betamindy-button-large.name = Large Button
block.betamindy-button-large.description = Produces power when clicked. \nNow easier to tap!
block.betamindy-buttonpad.name = Pressure Plate
block.betamindy-buttonpad.description = Produces power when stepped on.
block.betamindy-buttonpadbig.name = Large Pressure Plate
block.betamindy-buttonpadbig.description = Produces power when stepped on. Also can detect flying units on top.\nSpans multiple tiles.
block.betamindy-buttonpad-large.name = Large Pressure Plate
block.betamindy-buttonpad-large.description = Produces power when stepped on. Also can detect flying units on top.\nSpans multiple tiles.

# Units
block.betamindy-repair-turret.name = Repair Turret
block.betamindy-repair-turret.description = Continuously repairs the closest damaged unit or building in its vicinity. Units are prioritized.

# Logic
block.betamindy-linkpin.name = Link Pin
Expand Down
4 changes: 4 additions & 0 deletions assets/bundles/bundle_ko.properties
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ block.betamindy-cloner.name = \uBE14\uB85D \uBCF5\uC0AC\uAE30
block.betamindy-cloner.description = [accent]\uBC14\uB77C\uBCF4\uB294 \uBE14\uB85D[]\uC744 [#a9d8ff]\uC774 \uBE14\uB85D \uB4A4[]\uB85C \uBCF5\uC0AC\uD569\uB2C8\uB2E4. [accent]\uBC14\uB77C\uBCF4\uB294 \uBE14\uB85D[]\uC774 \uD654\uBB3C \uC218\uC1A1 \uBE14\uB85D\uC77C \uACBD\uC6B0, \uD654\uBB3C\uC774 \uBCF5\uC81C\uB418\uBA70 \uC774 \uACBD\uC6B0 \uD06C\uAE30 \uC81C\uD55C\uC5D0 \uC601\uD5A5\uBC1B\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uD50C\uB808\uC774\uC5B4\uAC00 \uC9C1\uC811 \uADF8 \uC704\uCE58\uC5D0 \uB193\uC744 \uC218 \uC788\uB294 \uBE14\uB85D\uB9CC \uBCF5\uC0AC\uAC00 \uAC00\uB2A5\uD569\uB2C8\uB2E4. \uC790\uC6D0\uACFC \uC804\uB825\uC744 \uC18C\uBAA8\uD569\uB2C8\uB2E4.
block.betamindy-cloner.details = \uD53C\uC2A4\uD1A4 \uD0C8\uAC83 \uACF5\uC7A5\uC744 \uB9CC\uB4E4\uAE30\uC5D0 \uC548\uC131\uB9DE\uCDA4\uC774\uB2E4.

# Units
block.betamindy-repair-turret.name = \uC218\uB9AC \uD3EC\uD0D1
block.betamindy-repair-turret.description = \uC778\uADFC\uC5D0 \uAC00\uC7A5 \uAC00\uAE4C\uC6B4 \uC720\uB2DB\uC774\uB098 \uAC74\uBB3C\uC744 \uC9C0\uC18D\uD574\uC11C \uCE58\uB8CC\uD569\uB2C8\uB2E4. \uC720\uB2DB\uC744 \uC6B0\uC120\uC801\uC73C\uB85C \uCE58\uB8CC\uD569\uB2C8\uB2E4.

# Logic
block.betamindy-linkpin.name = \uC5F0\uACB0 \uD540
block.betamindy-linkpin.description = \uC5F0\uACB0\uB41C \uD504\uB85C\uC138\uC11C\uC758 \uBAA8\uB4E0 \uC5F0\uACB0\uC744 \uD45C\uC2DC\uD569\uB2C8\uB2E4. [scarlet]\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 \uC5F0\uACB0[]\uC740 \uBD89\uC740 \uC774\uB984, [lightgray]\uBE44\uD65C\uC131\uD654\uB41C \uC5F0\uACB0[]\uC740 \uAC80\uC740 \uC0AC\uAC01\uD615\uC73C\uB85C \uD45C\uC2DC\uB429\uB2C8\uAC00. \uD53C\uC2A4\uD1A4\uC73C\uB85C \uBC00\uBA74, \uC5F0\uACB0\uB41C \uD504\uB85C\uC138\uC11C\uC758 \uBAA8\uB4E0 \uC5F0\uACB0\uB4E4\uB3C4 \uAC19\uC774 \uBC00\uB9BD\uB2C8\uB2E4.
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repositories {
}

dependencies {
implementation "com.github.Anuken.Mindustry:core:v124"
implementation "com.github.Anuken.Mindustry:core:v125"
}

jar {
Expand Down
20 changes: 13 additions & 7 deletions src/betamindy/content/MindyBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,8 @@ public TextureRegion[] icons(){
repairTurret = new RepairTurret("repair-turret"){{
size = 3;
repairRadius = 100f;
powerUse = 3f;
repairSpeed = 0.95f;
powerUse = 4f;
repairSpeed = 10.5f;
requirements(Category.units, with(Items.lead, 50, Items.copper, 65, Items.silicon, 50, Items.plastanium, 25, Items.phaseFabric, 15));
}};

Expand All @@ -437,49 +437,55 @@ public TextureRegion[] icons(){
button = new ButtonTap("button"){{
requirements(Category.power, with(Items.graphite, 5, Items.silicon, 25));
health = 40;
powerProduction = 1f;
}};

buttonLarge = new ButtonTap("button-large"){{
requirements(Category.power, with(Items.graphite, 25, Items.silicon, 100));
health = 160;
size = 2;
powerProduction = 2f;
}};

pressurePad = new ButtonPad("buttonpad"){{
requirements(Category.power, with(Items.titanium, 10, Items.silicon, 15));
health = 100;

basicPowerProduction = 1;
basicPowerProduction = 1f;
}};

pressurePadLarge = new ButtonPad("buttonpad-large"){{
requirements(Category.power, with(Items.titanium, 50, Items.silicon, 50));
size = 2;
health = 400;

basicPowerProduction = 3;
basicPowerProduction = 2f;
detectAir = true;
}};

mynamite = new Mynamite("mynamite"){{
requirements(Category.production, with(Items.lead, 10, Items.silicon, 20, Items.blastCompound, 25));
health = 60;
mineRadius = 2;
tier = 2;

consumes.power(0.1f);
requirements(Category.production, with(Items.lead, 10, Items.silicon, 20, Items.blastCompound, 25));
}};

mynamiteLarge = new Mynamite("mynamite-large"){{
requirements(Category.production, with(Items.thorium, 45, Items.blastCompound, 100));
health = 60;
size = 2;
mineRadius = 5;
tier = 4;
tier = 6;
minTier = 2;
baseAmount = 3;
canClick = false;

smokeChance = 0.15f;
fireEffect = Fx.burning;

consumes.power(0.4f);
requirements(Category.production, with(Items.thorium, 45, Items.blastCompound, 100));
}};

}
Expand Down
33 changes: 23 additions & 10 deletions src/betamindy/world/blocks/power/ButtonPad.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,35 @@
import mindustry.world.meta.*;

import static arc.Core.atlas;
import static mindustry.Vars.tilesize;

public class ButtonPad extends PowerBlock {
public float pushTime = 16f;
public float basicPowerProduction = 2f;
public boolean detectAir = false;
public TextureRegion trigRegion;

public ButtonPad(String name){
super(name);
quickRotate = false;
rotate = false;
consumesPower = false;
outputsPower = true;
targetable = false;
solid = false;
sync = true;
expanded = true;
group = BlockGroup.transportation;
group = BlockGroup.power;
noUpdateDisabled = false;

flags = EnumSet.of(BlockFlag.generator);
}

@Override
public void load() {
super.load();
trigRegion = atlas.find(name + "-trig");
}

@Override
public void setStats(){
super.setStats();
Expand All @@ -46,7 +55,7 @@ public void setBars(){
bars.add("power", (ButtonPadBuild entity) -> new Bar(
() -> Core.bundle.format("bar.poweroutput", entity.getPowerProduction() * 60 * entity.timeScale()),
() -> Pal.powerBar,
() -> entity.heat/pushTime)
() -> entity.heat / pushTime)
);
}
}
Expand All @@ -58,23 +67,24 @@ public class ButtonPadBuild extends Building {
@Override
public void draw() {
super.draw();
Draw.rect(atlas.find(name + (heat > 0.001f ? "-trig":"")), x, y);
Draw.rect(heat > 0.001f ? trigRegion : region, x, y);
}

@Override
public void updateTile(){
super.updateTile();

if(heat >= 0.001f) heat -= edelta();
if(heat >= 0f) heat -= delta();

if(detectAir) Units.nearby(x, y, size, size, this::unitOn);
if(detectAir && enabled) Units.nearby(x - size * tilesize / 2f, y - size * tilesize / 2f, size * tilesize, size * tilesize, this::unitOn);
}

@Override
public void unitOn(Unit unit){
powerProduction = basicPowerProduction * (unit.hitSize * 1.4f - 8);
if(!enabled) return;
powerProduction = basicPowerProduction * (unit.hitSize * 1.2f - 8); //TODO: figure out how to deal with multiple units on one pad

if(heat <= 0.001) Sounds.place.at(x, y, 1.2f);
if(heat < 0.001f) Sounds.place.at(x, y, 1.2f / size);
heat = pushTime;
}

Expand All @@ -91,8 +101,11 @@ public void placed() {

@Override
public double sense(LAccess sensor){
if(sensor == LAccess.heat) return heat;
return super.sense(sensor);
switch(sensor){
case heat: return heat / pushTime;
case enabled: return heat > 0.001f ? 1 : 0;
default: return super.sense(sensor);
}
}
}
}
52 changes: 37 additions & 15 deletions src/betamindy/world/blocks/power/ButtonTap.java
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
package betamindy.world.blocks.power;

import arc.graphics.g2d.Draw;
import arc.graphics.g2d.*;
import arc.struct.EnumSet;
import arc.struct.Seq;
import arc.util.io.Reads;
import arc.util.io.Writes;
import betamindy.world.blocks.production.*;
import mindustry.gen.Building;
import mindustry.gen.Sounds;
import mindustry.gen.Unit;
import mindustry.logic.*;
import mindustry.world.blocks.power.PowerBlock;
import mindustry.world.meta.BlockFlag;
import mindustry.world.meta.BlockGroup;

import javax.naming.InterruptedNamingException;

import static arc.Core.atlas;

//gk Tkr rkfdjvgodigksp enlwlfurh
//TODO heal shar
public class ButtonTap extends PowerBlock {
public float tapTime = 16f;
public float powerProduction = 2 * 60f;
public TextureRegion trigRegion;

public ButtonTap(String name){
super(name);
Expand All @@ -32,56 +32,78 @@ public ButtonTap(String name){
sync = true;
expanded = true;
configurable = true;
group = BlockGroup.transportation;
saveConfig = false;
noUpdateDisabled = false;
group = BlockGroup.power;

flags = EnumSet.of(BlockFlag.generator);

config(Boolean.class, (ButtonTapBuild build, Boolean b) -> {
if(b && build.enabled && !build.pressed()) build.heat = tapTime;
});
}

@Override
public void load() {
super.load();
trigRegion = atlas.find(name + "-trig");
}

public class ButtonTapBuild extends Building {
public float heat = 0f;
public boolean tapped = false;

@Override
public void draw() {
super.draw();
Draw.rect(atlas.find(name + (heat > 0.001f ? "-trig":"")), x, y);//어떤 약을 빠셨나요 그것이 궁금합니다 4
Draw.rect(pressed() ? trigRegion : region, x, y);
}

public boolean pressed(){
return heat > 0.001f;
}

@Override
public void updateTile(){
super.updateTile();

if(heat >= 0f) heat -= edelta();
if(heat >= 0f) heat -= delta();
}

@Override
public float getPowerProduction(){
return heat > 0.001f ? powerProduction : 0f;
}//어떤 약을 빠셨나요 그것이 궁금합니다 3
}

@Override
public boolean configTapped(){
if(tapped) return false;
if(!enabled || pressed()) return false;

//어떤 약을 빠셨나요 그것이 궁금합니다 // 샤로인요
configure(getPowerProduction());
heat = tapTime;
configure(true);
return false;
}

@Override
public void read(Reads read, byte revision){
super.read(read, revision);

tapped = read.bool();
if(tapped) heat = 1f;//어떤 약을 빠셨나요 그것이 궁금합니다 2
if(read.bool()) heat = tapTime;
}

@Override
public void write(Writes write){
super.write(write);

write.bool(tapped);
write.bool(pressed());
}

@Override
public double sense(LAccess sensor){
switch(sensor){
case heat: return heat / tapTime;
case enabled: return heat > 0.001f ? 1 : 0;
default: return super.sense(sensor);
}
}
}
}
21 changes: 17 additions & 4 deletions src/betamindy/world/blocks/production/Mynamite.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import arc.graphics.g2d.*;
import arc.math.Mathf;
import arc.util.io.*;
import mindustry.content.*;
import mindustry.entities.*;
import mindustry.gen.*;
import mindustry.graphics.*;
Expand All @@ -22,18 +23,23 @@
import betamindy.content.*;
import mindustry.world.meta.values.BlockFilterValue;

import static mindustry.Vars.content;
import static mindustry.Vars.tilesize;

public class Mynamite extends Block {
public int tier = 0, minTier = 0;
public TextureRegion topRegion;
public float fuseTime = 140f;
public int mineRadius = 2;
public float damage = 600f;
public float damageRadius = 4 * 8f;
public float damage = 600f, damageRadius = 4 * 8f;
public int baseAmount = 0;
public boolean canClick = true;

public TextureRegion topRegion;

public Effect smokeEffect = MindyFx.smokeRise;
public Effect fireEffect = Fx.none;
public float smokeChance = 0.08f, fireChance = 0.12f;

public Mynamite(String name){
super(name);

Expand Down Expand Up @@ -64,6 +70,12 @@ public void load(){
topRegion = Core.atlas.find(this.name + "-top");
}

@Override
public void init() {
super.init();
configurable = canClick;
}

@Override
public void setStats(){
super.setStats();
Expand Down Expand Up @@ -118,7 +130,8 @@ public boolean configTapped(){
public void updateTile(){
if(lit){
heat -= delta();
if(Mathf.chance(0.08f)) MindyFx.smokeRise.at(x, y);
if(Mathf.chance(smokeChance)) smokeEffect.at(x + Mathf.range(size * tilesize / 2f), y + Mathf.range(size * tilesize / 2f));
if(fireEffect != Fx.none && Mathf.chance(fireChance)) fireEffect.at(x + Mathf.range(size * tilesize / 2f), y + Mathf.range(size * tilesize / 2f));
if(heat <= 0f) kill();
}
else if(consValid() || tile.floor().attributes.get(Attribute.heat) > 0.01) light();
Expand Down
Loading

0 comments on commit f826927

Please sign in to comment.