mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-11 11:17:11 +07:00
Removed mech ability key
This commit is contained in:
parent
fc8d9febf6
commit
d5d90bde9a
@ -394,7 +394,6 @@ keybind.zoom.name=Zoom
|
||||
keybind.menu.name=Menu
|
||||
keybind.pause.name=Pause
|
||||
keybind.dash.name=Dash
|
||||
keybind.ability.name=Ability
|
||||
keybind.chat.name=Chat
|
||||
keybind.player_list.name=Player list
|
||||
keybind.console.name=Console
|
||||
|
@ -6,19 +6,17 @@ import com.badlogic.gdx.math.Rectangle;
|
||||
import io.anuke.mindustry.content.fx.BulletFx;
|
||||
import io.anuke.mindustry.content.fx.UnitFx;
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.entities.Unit;
|
||||
import io.anuke.mindustry.entities.Units;
|
||||
import io.anuke.mindustry.entities.effect.Fire;
|
||||
import io.anuke.mindustry.entities.effect.Lightning;
|
||||
import io.anuke.mindustry.entities.units.BaseUnit;
|
||||
import io.anuke.mindustry.entities.units.types.AlphaDrone;
|
||||
import io.anuke.mindustry.game.ContentList;
|
||||
import io.anuke.mindustry.graphics.Palette;
|
||||
import io.anuke.mindustry.graphics.Shaders;
|
||||
import io.anuke.mindustry.maps.TutorialSector;
|
||||
import io.anuke.mindustry.net.Net;
|
||||
import io.anuke.mindustry.type.ContentType;
|
||||
import io.anuke.mindustry.type.Mech;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.ucore.core.Core;
|
||||
import io.anuke.ucore.core.Effects;
|
||||
import io.anuke.ucore.core.Graphics;
|
||||
@ -26,7 +24,7 @@ import io.anuke.ucore.core.Timers;
|
||||
import io.anuke.ucore.graphics.Draw;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
import static io.anuke.mindustry.Vars.*;
|
||||
import static io.anuke.mindustry.Vars.unitGroups;
|
||||
|
||||
public class Mechs implements ContentList{
|
||||
public static Mech alpha, delta, tau, omega, dart, javelin, trident, glaive;
|
||||
@ -39,6 +37,8 @@ public class Mechs implements ContentList{
|
||||
|
||||
alpha = new Mech("alpha-mech", false){
|
||||
int maxDrones = 3;
|
||||
float buildTime = 100f;
|
||||
|
||||
{
|
||||
drillPower = 1;
|
||||
mineSpeed = 1.5f;
|
||||
@ -46,18 +46,14 @@ public class Mechs implements ContentList{
|
||||
boostSpeed = 0.85f;
|
||||
weapon = Weapons.blaster;
|
||||
maxSpeed = 4f;
|
||||
altChargeAlpha = 0.02f;
|
||||
trailColorTo = Color.valueOf("ffd37f");
|
||||
armor = 20f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAlt(Player player){
|
||||
if(getDrones(player) >= maxDrones){
|
||||
player.altHeat = 0f;
|
||||
}
|
||||
|
||||
if(player.altHeat >= 0.91f){
|
||||
if(getDrones(player) < maxDrones && !TutorialSector.supressDrone() && player.timer.get(Player.timerAbility, buildTime)){
|
||||
if(!Net.client()) {
|
||||
AlphaDrone drone = (AlphaDrone) UnitTypes.alphaDrone.create(player.getTeam());
|
||||
drone.leader = player;
|
||||
@ -65,14 +61,6 @@ public class Mechs implements ContentList{
|
||||
drone.add();
|
||||
}
|
||||
Effects.effect(UnitFx.unitLand, player);
|
||||
player.altHeat = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Player player){
|
||||
if(getDrones(player) < maxDrones){
|
||||
player.hitTime = Math.max(player.hitTime, player.altHeat * Unit.hitDuration);
|
||||
}
|
||||
}
|
||||
|
||||
@ -86,6 +74,8 @@ public class Mechs implements ContentList{
|
||||
};
|
||||
|
||||
delta = new Mech("delta-mech", false){
|
||||
float cooldown = 120;
|
||||
|
||||
{
|
||||
drillPower = -1;
|
||||
speed = 0.75f;
|
||||
@ -98,32 +88,26 @@ public class Mechs implements ContentList{
|
||||
weapon = Weapons.shockgun;
|
||||
trailColorTo = Color.valueOf("d3ddff");
|
||||
maxSpeed = 5f;
|
||||
altChargeAlpha = 0.03f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAlt(Player player){
|
||||
if(player.altHeat >= 0.91f){
|
||||
Effects.shake(3f, 3f, player);
|
||||
public void onLand(Player player){
|
||||
if(player.timer.get(Player.timerAbility, cooldown)){
|
||||
Effects.shake(1f, 1f, player);
|
||||
Effects.effect(UnitFx.landShock, player);
|
||||
for(int i = 0; i < 8; i++){
|
||||
Timers.run(Mathf.random(5f), () -> Lightning.create(player.getTeam(), BulletFx.hitLancer, player.getTeam().color, 15f, player.x, player.y, Mathf.random(360f), 20));
|
||||
Timers.run(Mathf.random(8f), () -> Lightning.create(player.getTeam(), BulletFx.hitLancer, player.getTeam().color, 17f, player.x, player.y, Mathf.random(360f), 14));
|
||||
}
|
||||
player.altHeat = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Player player){
|
||||
super.draw(player);
|
||||
player.hitTime = Math.max(player.hitTime, player.altHeat * Unit.hitDuration);
|
||||
}
|
||||
};
|
||||
|
||||
tau = new Mech("tau-mech", false){
|
||||
protected float healRange = 60f;
|
||||
protected float healAmount = 10f;
|
||||
|
||||
protected Rectangle rect = new Rectangle();
|
||||
float healRange = 60f;
|
||||
float healAmount = 10f;
|
||||
float healReload = 160f;
|
||||
Rectangle rect = new Rectangle();
|
||||
boolean wasHeadled;
|
||||
|
||||
{
|
||||
drillPower = 4;
|
||||
@ -137,44 +121,29 @@ public class Mechs implements ContentList{
|
||||
weapon = Weapons.healBlaster;
|
||||
maxSpeed = 5f;
|
||||
armor = 15f;
|
||||
altChargeAlpha = 0.05f;
|
||||
trailColorTo = Palette.heal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Player player){
|
||||
super.draw(player);
|
||||
player.hitTime = Math.max(player.hitTime, player.altHeat * Unit.hitDuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAlt(Player player){
|
||||
|
||||
if(player.altHeat >= 0.91f){
|
||||
Effects.effect(UnitFx.healWave, player);
|
||||
if(player.timer.get(Player.timerAbility, healReload)){
|
||||
wasHeadled = false;
|
||||
|
||||
rect.setSize(healRange*2f).setCenter(player.x, player.y);
|
||||
Units.getNearby(player.getTeam(), rect, unit -> {
|
||||
if(unit.distanceTo(player) <= healRange){
|
||||
if(unit.health < unit.maxHealth()){
|
||||
Effects.effect(UnitFx.heal, unit);
|
||||
wasHeadled = true;
|
||||
}
|
||||
unit.healBy(healAmount);
|
||||
}
|
||||
});
|
||||
|
||||
int blockRange = (int)(healRange/tilesize);
|
||||
int px = world.toTile(player.x), py = world.toTile(player.y);
|
||||
|
||||
for(int x = -blockRange; x <= blockRange; x++){
|
||||
for(int y = -blockRange; y <= blockRange; y++){
|
||||
if(Mathf.dst(x, y) > blockRange) continue;
|
||||
Tile tile = world.tile(px + x, py + y);
|
||||
if(tile != null){
|
||||
Fire.extinguish(tile, 1000f);
|
||||
}
|
||||
}
|
||||
if(wasHeadled){
|
||||
Effects.effect(UnitFx.healWave, player);
|
||||
}
|
||||
player.altHeat = 0f;
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -199,12 +168,12 @@ public class Mechs implements ContentList{
|
||||
|
||||
@Override
|
||||
public float getRotationAlpha(Player player){
|
||||
return 0.6f - player.altHeat * 0.3f;
|
||||
return 0.6f - player.shootHeat * 0.3f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float spreadX(Player player){
|
||||
return player.altHeat*2f;
|
||||
return player.shootHeat*2f;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -215,24 +184,24 @@ public class Mechs implements ContentList{
|
||||
|
||||
@Override
|
||||
public void updateAlt(Player player){
|
||||
float scl = 1f - player.altHeat/2f;
|
||||
float scl = 1f - player.shootHeat/2f;
|
||||
player.getVelocity().scl(scl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExtraArmor(Player player){
|
||||
return player.altHeat * 30f;
|
||||
return player.shootHeat * 30f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(Player player){
|
||||
if(player.altHeat <= 0.01f) return;
|
||||
if(player.shootHeat <= 0.01f) return;
|
||||
|
||||
float alpha = Core.batch.getColor().a;
|
||||
Shaders.build.progress = player.altHeat;
|
||||
Shaders.build.progress = player.shootHeat;
|
||||
Shaders.build.region = armorRegion;
|
||||
Shaders.build.time = Timers.time() / 10f;
|
||||
Shaders.build.color.set(Palette.accent).a = player.altHeat;
|
||||
Shaders.build.color.set(Palette.accent).a = player.shootHeat;
|
||||
Graphics.shader(Shaders.build);
|
||||
Draw.alpha(1f);
|
||||
Draw.rect(armorRegion, player.snappedX(), player.snappedY(), player.rotation);
|
||||
|
@ -208,12 +208,12 @@ public class CraftingBlocks extends BlockList implements ContentList{
|
||||
output = Items.sand;
|
||||
health = 80;
|
||||
craftEffect = BlockFx.pulverize;
|
||||
craftTime = 50f;
|
||||
craftTime = 40f;
|
||||
updateEffect = BlockFx.pulverizeSmall;
|
||||
hasItems = hasPower = true;
|
||||
|
||||
consumes.item(Items.stone, 2);
|
||||
consumes.power(0.1f);
|
||||
consumes.item(Items.stone, 1);
|
||||
consumes.power(0.05f);
|
||||
}};
|
||||
|
||||
solidifier = new GenericCrafter("solidifer"){{
|
||||
|
@ -11,7 +11,7 @@ import io.anuke.ucore.util.Angles;
|
||||
import io.anuke.ucore.util.Mathf;
|
||||
|
||||
public class UnitFx extends FxList implements ContentList{
|
||||
public static Effect vtolHover, unitDrop, unitPickup, unitLand, pickup, healWave, heal;
|
||||
public static Effect vtolHover, unitDrop, unitPickup, unitLand, pickup, healWave, heal, landShock;
|
||||
|
||||
@Override
|
||||
public void load(){
|
||||
@ -47,6 +47,13 @@ public class UnitFx extends FxList implements ContentList{
|
||||
Draw.reset();
|
||||
});
|
||||
|
||||
landShock = new GroundEffect(12, e -> {
|
||||
Draw.color(Palette.lancerLaser);
|
||||
Lines.stroke(e.fout() * 3f);
|
||||
Lines.poly(e.x, e.y, 12, 20f * e.fout());
|
||||
Draw.reset();
|
||||
});
|
||||
|
||||
pickup = new Effect(18, e -> {
|
||||
Draw.color(Palette.lightishGray);
|
||||
Lines.stroke(e.fout() * 2f);
|
||||
|
@ -419,7 +419,7 @@ public class NetClient extends Module{
|
||||
player.pointerX, player.pointerY, player.rotation, player.baseRotation,
|
||||
player.getVelocity().x, player.getVelocity().y,
|
||||
player.getMineTile(),
|
||||
player.isBoosting, player.isShooting, player.isAlt, requests,
|
||||
player.isBoosting, player.isShooting, requests,
|
||||
Core.camera.position.x, Core.camera.position.y,
|
||||
Core.camera.viewportWidth * Core.camera.zoom * viewScale, Core.camera.viewportHeight * Core.camera.zoom * viewScale);
|
||||
}
|
||||
|
@ -296,7 +296,7 @@ public class NetServer extends Module{
|
||||
float rotation, float baseRotation,
|
||||
float xVelocity, float yVelocity,
|
||||
Tile mining,
|
||||
boolean boosting, boolean shooting, boolean alting,
|
||||
boolean boosting, boolean shooting,
|
||||
BuildRequest[] requests,
|
||||
float viewX, float viewY, float viewWidth, float viewHeight
|
||||
){
|
||||
@ -322,7 +322,6 @@ public class NetServer extends Module{
|
||||
player.setMineTile(mining);
|
||||
player.isBoosting = boosting;
|
||||
player.isShooting = shooting;
|
||||
player.isAlt = alting;
|
||||
player.getPlaceQueue().clear();
|
||||
for(BuildRequest req : requests){
|
||||
//auto-skip done requests
|
||||
|
@ -53,8 +53,8 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
public float pointerX, pointerY;
|
||||
public String name = "name";
|
||||
public String uuid, usid;
|
||||
public boolean isAdmin, isTransferring, isShooting, isBoosting, isAlt, isMobile;
|
||||
public float boostHeat, altHeat;
|
||||
public boolean isAdmin, isTransferring, isShooting, isBoosting, isMobile;
|
||||
public float boostHeat, shootHeat;
|
||||
public boolean achievedFlight;
|
||||
public Color color = new Color();
|
||||
public Mech mech;
|
||||
@ -435,8 +435,6 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
|
||||
//region update methods
|
||||
|
||||
float lastx, lasty;
|
||||
|
||||
@Override
|
||||
public void update(){
|
||||
hitTime -= Timers.delta();
|
||||
@ -459,8 +457,8 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
|
||||
Tile tile = world.tileWorld(x, y);
|
||||
|
||||
altHeat = Mathf.lerpDelta(altHeat, isAlt ? 1f : 0f, mech.altChargeAlpha);
|
||||
boostHeat = Mathf.lerpDelta(boostHeat, (tile != null && tile.solid()) || (isBoosting && ((!movement.isZero() && moved) || !isLocal)) ? 1f : 0f, 0.08f);
|
||||
shootHeat = Mathf.lerpDelta(shootHeat, isShooting() ? 1f : 0f, 0.06f);
|
||||
mech.updateAlt(this); //updated regardless
|
||||
|
||||
if(!isLocal){
|
||||
@ -513,11 +511,11 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
}
|
||||
Effects.effect(UnitFx.unitLand, tile.floor().minimapColor, x, y, tile.floor().isLiquid ? 1f : 0.5f);
|
||||
}
|
||||
mech.onLand(this);
|
||||
achievedFlight = false;
|
||||
}
|
||||
|
||||
isBoosting = Inputs.keyDown("dash") && !mech.flying;
|
||||
isAlt = Inputs.keyDown("ability") && !mech.flying && !isBoosting;
|
||||
|
||||
//if player is in solid block
|
||||
if(tile != null && tile.solid()){
|
||||
@ -712,7 +710,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
trail.clear();
|
||||
carrier = null;
|
||||
health = maxHealth();
|
||||
altHeat = boostHeat = drownTime = hitTime = 0f;
|
||||
boostHeat = drownTime = hitTime = 0f;
|
||||
mech = (isMobile ? Mechs.starterMobile : Mechs.starterDesktop);
|
||||
placeQueue.clear();
|
||||
|
||||
@ -794,7 +792,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
public void write(DataOutput buffer) throws IOException{
|
||||
super.writeSave(buffer, !isLocal);
|
||||
buffer.writeUTF(name); //TODO writing strings is very inefficient
|
||||
buffer.writeByte(Bits.toByte(isAdmin) | (Bits.toByte(dead) << 1) | (Bits.toByte(isBoosting) << 2)| (Bits.toByte(isAlt) << 3));
|
||||
buffer.writeByte(Bits.toByte(isAdmin) | (Bits.toByte(dead) << 1) | (Bits.toByte(isBoosting) << 2));
|
||||
buffer.writeInt(Color.rgba8888(color));
|
||||
buffer.writeByte(mech.id);
|
||||
buffer.writeInt(mining == null ? -1 : mining.packedPosition());
|
||||
@ -813,7 +811,6 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
isAdmin = (bools & 1) != 0;
|
||||
dead = (bools & 2) != 0;
|
||||
boolean boosting = (bools & 4) != 0;
|
||||
boolean alt = (bools & 8) != 0;
|
||||
color.set(buffer.readInt());
|
||||
mech = content.getByID(ContentType.mech, buffer.readByte());
|
||||
int mine = buffer.readInt();
|
||||
@ -831,7 +828,6 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra
|
||||
}else{
|
||||
mining = world.tile(mine);
|
||||
isBoosting = boosting;
|
||||
isAlt = alt;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,6 @@ public class DefaultKeybinds{
|
||||
"break", Input.MOUSE_RIGHT,
|
||||
"rotate", new Axis(Input.SCROLL),
|
||||
"dash", Input.SHIFT_LEFT,
|
||||
"ability", Input.E,
|
||||
"drop_unit", Input.SHIFT_LEFT,
|
||||
new Category("view"),
|
||||
"zoom_hold", Input.CONTROL_LEFT,
|
||||
|
@ -23,7 +23,6 @@ public class TutorialSector{
|
||||
private static int droneIndex;
|
||||
|
||||
public static Array<Mission> getMissions(){
|
||||
//int x = sectorSize/2, y = sectorSize/2;
|
||||
|
||||
Array<Mission> missions = Array.with(
|
||||
new ItemMission(Items.copper, 60).setMessage("$tutorial.begin"),
|
||||
@ -153,15 +152,9 @@ public class TutorialSector{
|
||||
private static void generateBase(){
|
||||
int x = sectorSize/2 + sectorSize, y = sectorSize/2;
|
||||
world.setBlock(world.tile(x, y), StorageBlocks.core, waveTeam);
|
||||
// world.setBlock(world.tile(x + 1, y + 2), TurretBlocks.duo, waveTeam);
|
||||
//world.setBlock(world.tile(x + 1, y - 2), TurretBlocks.duo, waveTeam);
|
||||
world.setBlock(world.tile(x - 1, y + 2), UnitBlocks.daggerFactory, waveTeam);
|
||||
world.setBlock(world.tile(x - 1, y - 3), UnitBlocks.daggerFactory, waveTeam);
|
||||
|
||||
//fill turret ammo
|
||||
//world.tile(x + 1, y + 2).block().handleStack(Items.copper, 1, world.tile(x + 1, y + 2), null);
|
||||
//world.tile(x + 1, y - 2).block().handleStack(Items.copper, 1, world.tile(x + 1, y - 2), null);
|
||||
|
||||
//since placed() is not called here, add core manually
|
||||
state.teams.get(waveTeam).cores.add(world.tile(x, y));
|
||||
}
|
||||
|
@ -27,7 +27,6 @@ public class Mech extends UnlockableContent{
|
||||
public float shake = 0f;
|
||||
public float armor = 1f;
|
||||
|
||||
public float altChargeAlpha = 0.1f;
|
||||
public float cellTrnsY = 0f;
|
||||
public float mineSpeed = 1f;
|
||||
public int drillPower = -1;
|
||||
@ -36,7 +35,7 @@ public class Mech extends UnlockableContent{
|
||||
public Color trailColor = Palette.boostFrom;
|
||||
public Color trailColorTo = Palette.boostTo;
|
||||
public int itemCapacity = 30;
|
||||
public boolean turnCursor = true;
|
||||
public boolean turnCursor = true;
|
||||
|
||||
public float weaponOffsetX, weaponOffsetY;
|
||||
public Weapon weapon = Weapons.blaster;
|
||||
@ -71,6 +70,8 @@ public class Mech extends UnlockableContent{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void onLand(Player player){}
|
||||
|
||||
@Override
|
||||
public boolean isHidden() {
|
||||
return !flying && mobile;
|
||||
|
Loading…
Reference in New Issue
Block a user