Tecta buff / Closes Anuken/Mindustry-Suggestions/issues/4427

This commit is contained in:
Anuken
2023-05-18 00:27:01 -04:00
parent f59c439f2f
commit b611e0f9f4
4 changed files with 36 additions and 19 deletions
+6 -5
View File
@@ -3258,7 +3258,7 @@ public class UnitTypes{
drag = 0.1f; drag = 0.1f;
speed = 0.6f; speed = 0.6f;
hitSize = 23f; hitSize = 23f;
health = 6700; health = 7300;
armor = 5f; armor = 5f;
lockLegBase = true; lockLegBase = true;
@@ -3271,13 +3271,14 @@ public class UnitTypes{
abilities.add(new ShieldArcAbility(){{ abilities.add(new ShieldArcAbility(){{
region = "tecta-shield"; region = "tecta-shield";
radius = 34f; radius = 36f;
angle = 82f; angle = 82f;
regen = 0.6f; regen = 0.6f;
cooldown = 60f * 8f; cooldown = 60f * 8f;
max = 1500f; max = 2000f;
y = -20f; y = -20f;
width = 6f; width = 6f;
whenShooting = false;
}}); }});
rotateSpeed = 2.1f; rotateSpeed = 2.1f;
@@ -3319,14 +3320,14 @@ public class UnitTypes{
velocityRnd = 0.33f; velocityRnd = 0.33f;
heatColor = Color.red; heatColor = Color.red;
bullet = new MissileBulletType(4.2f, 47){{ bullet = new MissileBulletType(4.2f, 60){{
homingPower = 0.2f; homingPower = 0.2f;
weaveMag = 4; weaveMag = 4;
weaveScale = 4; weaveScale = 4;
lifetime = 55f; lifetime = 55f;
shootEffect = Fx.shootBig2; shootEffect = Fx.shootBig2;
smokeEffect = Fx.shootSmokeTitan; smokeEffect = Fx.shootSmokeTitan;
splashDamage = 60f; splashDamage = 70f;
splashDamageRadius = 30f; splashDamageRadius = 30f;
frontColor = Color.white; frontColor = Color.white;
hitSound = Sounds.none; hitSound = Sounds.none;
+5 -1
View File
@@ -492,10 +492,14 @@ public class Schematics implements Loadable{
} }
public static void place(Schematic schem, int x, int y, Team team){ public static void place(Schematic schem, int x, int y, Team team){
place(schem, x, y, team, true);
}
public static void place(Schematic schem, int x, int y, Team team, boolean overwrite){
int ox = x - schem.width/2, oy = y - schem.height/2; int ox = x - schem.width/2, oy = y - schem.height/2;
schem.tiles.each(st -> { schem.tiles.each(st -> {
Tile tile = world.tile(st.x + ox, st.y + oy); Tile tile = world.tile(st.x + ox, st.y + oy);
if(tile == null) return; if(tile == null || (!overwrite && !Build.validPlace(st.block, team, tile.x, tile.y, st.rotation))) return;
tile.setBlock(st.block, team, st.rotation); tile.setBlock(st.block, team, st.rotation);
@@ -24,7 +24,8 @@ import static mindustry.Vars.*;
public class BaseGenerator{ public class BaseGenerator{
private static final Vec2 axis = new Vec2(), rotator = new Vec2(); private static final Vec2 axis = new Vec2(), rotator = new Vec2();
private static final int range = 160; private static final int range = 180;
private static final boolean insanity = false;
private Tiles tiles; private Tiles tiles;
private Seq<Tile> cores; private Seq<Tile> cores;
@@ -51,9 +52,9 @@ public class BaseGenerator{
float baseChance = Mathf.lerp(0.7f, 2.1f, difficulty); float baseChance = Mathf.lerp(0.7f, 2.1f, difficulty);
int wallAngle = 70; //180 for full coverage int wallAngle = 70; //180 for full coverage
double resourceChance = 0.5 * baseChance; double resourceChance = 0.5 * baseChance;
double nonResourceChance = 0.0005 * baseChance; double nonResourceChance = 0.002 * baseChance;
BasePart coreschem = bases.cores.getFrac(difficulty); BasePart coreschem = bases.cores.getFrac(difficulty);
int passes = difficulty < 0.4 ? 1 : difficulty < 0.8 ? 2 : 3; int passes = difficulty < 0.4 ? 1 : difficulty < 0.8 ? 3 : 5;
Block wall = getDifficultyWall(1, difficulty), wallLarge = getDifficultyWall(2, difficulty); Block wall = getDifficultyWall(1, difficulty), wallLarge = getDifficultyWall(2, difficulty);
@@ -80,7 +81,7 @@ public class BaseGenerator{
tryPlace(parts.getFrac(difficulty + Mathf.range(bracketRange)), tile.x, tile.y, team); tryPlace(parts.getFrac(difficulty + Mathf.range(bracketRange)), tile.x, tile.y, team);
} }
}else if(Mathf.chance(nonResourceChance)){ }else if(Mathf.chance(nonResourceChance)){
tryPlace(bases.parts.getFrac(difficulty + Mathf.range(bracketRange)), tile.x, tile.y, team); tryPlace(bases.parts.getFrac(Mathf.random(1f)), tile.x, tile.y, team);
} }
}); });
} }
@@ -148,10 +149,13 @@ public class BaseGenerator{
}); });
} }
float coreDst = 10f * 8;
//clear path for ground units //clear path for ground units
for(Tile tile : cores){ for(Tile tile : cores){
Astar.pathfind(tile, spawn, t -> t.team() == state.rules.waveTeam && !t.within(tile, 25f * 8) ? 100000 : t.floor().hasSurface() ? 1 : 10, t -> !t.block().isStatic()).each(t -> { Astar.pathfind(tile, spawn, t -> t.team() == state.rules.waveTeam && !t.within(tile, coreDst) ? 100000 : t.floor().hasSurface() ? 1 : 10, t -> !t.block().isStatic()).each(t -> {
if(!t.within(tile, 25f * 8)){ if(!t.within(tile, coreDst)){
if(t.team() == state.rules.waveTeam){ if(t.team() == state.rules.waveTeam){
t.setBlock(Blocks.air); t.setBlock(Blocks.air);
} }
@@ -208,7 +212,7 @@ public class BaseGenerator{
for(Stile tile : result.tiles){ for(Stile tile : result.tiles){
int realX = tile.x + cx, realY = tile.y + cy; int realX = tile.x + cx, realY = tile.y + cy;
if(isTaken(tile.block, realX, realY)){ if(!insanity && isTaken(tile.block, realX, realY)){
return false; return false;
} }
@@ -219,12 +223,16 @@ public class BaseGenerator{
if(part.required instanceof Item item){ if(part.required instanceof Item item){
for(Stile tile : result.tiles){ for(Stile tile : result.tiles){
if(tile.block instanceof Drill){ //uncomment for extra checks if changed above
if(tile.block instanceof Drill && (!insanity || !isTaken(tile.block, tile.x + cx, tile.y + cy))){
tile.block.iterateTaken(tile.x + cx, tile.y + cy, (ex, ey) -> { tile.block.iterateTaken(tile.x + cx, tile.y + cy, (ex, ey) -> {
Tile placed = world.tiles.get(ex, ey);
if(world.tiles.getn(ex, ey).floor().hasSurface()){ if(placed == null) return;
set(world.tiles.getn(ex, ey), item);
if(placed.floor().hasSurface()){
set(placed, item);
} }
Tile rand = world.tiles.getc(ex + Mathf.range(1), ey + Mathf.range(1)); Tile rand = world.tiles.getc(ex + Mathf.range(1), ey + Mathf.range(1));
@@ -237,16 +245,16 @@ public class BaseGenerator{
} }
} }
Schematics.place(result, cx + result.width/2, cy + result.height/2, team); Schematics.place(result, cx + result.width/2, cy + result.height/2, team, false);
//fill drills with items after placing //fill drills with items after placing
if(part.required instanceof Item item){ if(part.required instanceof Item item){
for(Stile tile : result.tiles){ for(Stile tile : result.tiles){
if(tile.block instanceof Drill){ if(tile.block instanceof Drill){
Building build = world.tile(tile.x + cx, tile.y + cy).build; var build = world.build(tile.x + cx, tile.y + cy);
if(build != null){ if(build != null && build.block == tile.block){
build.items.add(item, build.block.itemCapacity); build.items.add(item, build.block.itemCapacity);
} }
} }
@@ -73,6 +73,10 @@ public class LogicBlock extends Block{
link.name = ""; link.name = "";
link.name = entity.findLinkName(lbuild.block); link.name = entity.findLinkName(lbuild.block);
} }
//disable when unlinking
if(!link.active && lbuild.block.autoResetEnabled && lbuild.lastDisabler == entity){
lbuild.enabled = true;
}
}else{ }else{
entity.links.remove(l -> world.build(l.x, l.y) == lbuild); entity.links.remove(l -> world.build(l.x, l.y) == lbuild);
entity.links.add(new LogicLink(x, y, entity.findLinkName(lbuild.block), true)); entity.links.add(new LogicLink(x, y, entity.findLinkName(lbuild.block), true));