New artillery turret bullet patterns
|
Before Width: | Height: | Size: 133 B |
BIN
core/assets-raw/sprites/blocks/units/fortress-pad-top-open.png
Normal file
|
After Width: | Height: | Size: 178 B |
BIN
core/assets-raw/sprites/blocks/units/fortress-pad-top.png
Normal file
|
After Width: | Height: | Size: 170 B |
BIN
core/assets-raw/sprites/blocks/units/fortress-pad.png
Normal file
|
After Width: | Height: | Size: 543 B |
|
Before Width: | Height: | Size: 150 B |
BIN
core/assets-raw/sprites/units/fortress-base.png
Normal file
|
After Width: | Height: | Size: 102 B |
BIN
core/assets-raw/sprites/units/fortress-leg.png
Normal file
|
After Width: | Height: | Size: 104 B |
BIN
core/assets-raw/sprites/units/fortress.png
Normal file
|
After Width: | Height: | Size: 184 B |
|
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 100 KiB |
@@ -8,7 +8,7 @@ import io.anuke.mindustry.game.ContentList;
|
|||||||
import io.anuke.mindustry.type.ContentType;
|
import io.anuke.mindustry.type.ContentType;
|
||||||
|
|
||||||
public class UnitTypes implements ContentList{
|
public class UnitTypes implements ContentList{
|
||||||
public static UnitType drone, alphaDrone, dagger, interceptor, monsoon, titan, fabricator;
|
public static UnitType drone, alphaDrone, dagger, interceptor, monsoon, titan, fortress, fabricator;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(){
|
public void load(){
|
||||||
@@ -58,6 +58,15 @@ public class UnitTypes implements ContentList{
|
|||||||
health = 500;
|
health = 500;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
fortress = new UnitType("fortress", Fortress.class, Fortress::new){{
|
||||||
|
maxVelocity = 0.8f;
|
||||||
|
speed = 0.18f;
|
||||||
|
drag = 0.4f;
|
||||||
|
range = 10f;
|
||||||
|
weapon = Weapons.flamethrower;
|
||||||
|
health = 500;
|
||||||
|
}};
|
||||||
|
|
||||||
interceptor = new UnitType("interceptor", Interceptor.class, Interceptor::new){{
|
interceptor = new UnitType("interceptor", Interceptor.class, Interceptor::new){{
|
||||||
speed = 0.3f;
|
speed = 0.3f;
|
||||||
maxVelocity = 1.9f;
|
maxVelocity = 1.9f;
|
||||||
|
|||||||
@@ -107,6 +107,8 @@ public class TurretBlocks extends BlockList implements ContentList{
|
|||||||
shootType = AmmoTypes.arc;
|
shootType = AmmoTypes.arc;
|
||||||
reload = 30f;
|
reload = 30f;
|
||||||
shootShake = 1f;
|
shootShake = 1f;
|
||||||
|
powerUsed = 5f;
|
||||||
|
powerCapacity = 30f;
|
||||||
range = 60f;
|
range = 60f;
|
||||||
shootEffect = ShootFx.lightningShoot;
|
shootEffect = ShootFx.lightningShoot;
|
||||||
heatColor = Color.RED;
|
heatColor = Color.RED;
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ public class TurretBullets extends BulletList implements ContentList{
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
arc = new BulletType(0.001f, 11){
|
arc = new BulletType(0.001f, 7){
|
||||||
{
|
{
|
||||||
lifetime = 1;
|
lifetime = 1;
|
||||||
despawneffect = Fx.none;
|
despawneffect = Fx.none;
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import io.anuke.ucore.core.Timers;
|
|||||||
import io.anuke.ucore.entities.Entities;
|
import io.anuke.ucore.entities.Entities;
|
||||||
import io.anuke.ucore.entities.EntityGroup;
|
import io.anuke.ucore.entities.EntityGroup;
|
||||||
import io.anuke.ucore.entities.trait.Entity;
|
import io.anuke.ucore.entities.trait.Entity;
|
||||||
|
import io.anuke.ucore.io.ByteBufferOutput;
|
||||||
import io.anuke.ucore.io.CountableByteArrayOutputStream;
|
import io.anuke.ucore.io.CountableByteArrayOutputStream;
|
||||||
import io.anuke.ucore.io.delta.ByteDeltaEncoder;
|
import io.anuke.ucore.io.delta.ByteDeltaEncoder;
|
||||||
import io.anuke.ucore.io.delta.ByteMatcherHash;
|
import io.anuke.ucore.io.delta.ByteMatcherHash;
|
||||||
@@ -39,6 +40,7 @@ import java.io.ByteArrayInputStream;
|
|||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.DataOutputStream;
|
import java.io.DataOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.zip.DeflaterOutputStream;
|
import java.util.zip.DeflaterOutputStream;
|
||||||
|
|
||||||
@@ -64,6 +66,9 @@ public class NetServer extends Module{
|
|||||||
private IntMap<Player> connections = new IntMap<>();
|
private IntMap<Player> connections = new IntMap<>();
|
||||||
private boolean closing = false;
|
private boolean closing = false;
|
||||||
|
|
||||||
|
private ByteBuffer writeBuffer = ByteBuffer.allocate(127);
|
||||||
|
private ByteBufferOutput outputBuffer = new ByteBufferOutput(writeBuffer);
|
||||||
|
|
||||||
/**Stream for writing player sync data to.*/
|
/**Stream for writing player sync data to.*/
|
||||||
private CountableByteArrayOutputStream syncStream = new CountableByteArrayOutputStream();
|
private CountableByteArrayOutputStream syncStream = new CountableByteArrayOutputStream();
|
||||||
/**Data stream for writing player sync data to.*/
|
/**Data stream for writing player sync data to.*/
|
||||||
@@ -174,6 +179,15 @@ public class NetServer extends Module{
|
|||||||
player.color.set(packet.color);
|
player.color.set(packet.color);
|
||||||
player.color.a = 1f;
|
player.color.a = 1f;
|
||||||
|
|
||||||
|
try{
|
||||||
|
writeBuffer.position(0);
|
||||||
|
player.write(outputBuffer);
|
||||||
|
}catch(Throwable t){
|
||||||
|
t.printStackTrace();
|
||||||
|
kick(id, KickReason.nameEmpty);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(state.mode.isPvp){
|
if(state.mode.isPvp){
|
||||||
//find team with minimum amount of players and auto-assign player to that.
|
//find team with minimum amount of players and auto-assign player to that.
|
||||||
Team min = Mathf.findMin(Team.all, team -> {
|
Team min = Mathf.findMin(Team.all, team -> {
|
||||||
|
|||||||
@@ -46,10 +46,14 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void create(BulletType type, Entity owner, Team team, float x, float y, float angle, float velocityScl){
|
public static void create(BulletType type, Entity owner, Team team, float x, float y, float angle, float velocityScl){
|
||||||
create(type, owner, team, x, y, angle, velocityScl, null);
|
create(type, owner, team, x, y, angle, velocityScl, 1f, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void create(BulletType type, Entity owner, Team team, float x, float y, float angle, float velocityScl, Object data){
|
public static void create(BulletType type, Entity owner, Team team, float x, float y, float angle, float velocityScl, float lifetimeScl){
|
||||||
|
create(type, owner, team, x, y, angle, velocityScl, lifetimeScl, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void create(BulletType type, Entity owner, Team team, float x, float y, float angle, float velocityScl, float lifetimeScl, Object data){
|
||||||
Bullet bullet = Pooling.obtain(Bullet.class);
|
Bullet bullet = Pooling.obtain(Bullet.class);
|
||||||
bullet.type = type;
|
bullet.type = type;
|
||||||
bullet.owner = owner;
|
bullet.owner = owner;
|
||||||
@@ -63,6 +67,7 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
|
|||||||
|
|
||||||
bullet.team = team;
|
bullet.team = team;
|
||||||
bullet.type = type;
|
bullet.type = type;
|
||||||
|
bullet.time(type.lifetime() * (1f - lifetimeScl));
|
||||||
|
|
||||||
//translate bullets backwards, purely for visual reasons
|
//translate bullets backwards, purely for visual reasons
|
||||||
float backDelta = Timers.delta();
|
float backDelta = Timers.delta();
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package io.anuke.mindustry.entities.units.types;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.entities.units.GroundUnit;
|
||||||
|
|
||||||
|
public class Fortress extends GroundUnit{
|
||||||
|
}
|
||||||
@@ -38,7 +38,7 @@ public class ArtilleryTurret extends ItemTurret{
|
|||||||
|
|
||||||
for(int i = 0; i < shots; i++){
|
for(int i = 0; i < shots; i++){
|
||||||
Bullet.create(ammo.bullet, tile.entity, tile.getTeam(), tile.drawx() + tr.x, tile.drawy() + tr.y,
|
Bullet.create(ammo.bullet, tile.entity, tile.getTeam(), tile.drawx() + tr.x, tile.drawy() + tr.y,
|
||||||
entity.rotation + Mathf.range(inaccuracy + type.inaccuracy), dst / maxTraveled + Mathf.range(velocityInaccuracy));
|
entity.rotation + Mathf.range(inaccuracy + type.inaccuracy), 1f + Mathf.range(velocityInaccuracy), Mathf.clamp(dst / maxTraveled));
|
||||||
}
|
}
|
||||||
|
|
||||||
effects(tile);
|
effects(tile);
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ public class MassDriver extends Block{
|
|||||||
other.isRecieving = true;
|
other.isRecieving = true;
|
||||||
Bullet.create(TurretBullets.driverBolt, entity, entity.getTeam(),
|
Bullet.create(TurretBullets.driverBolt, entity, entity.getTeam(),
|
||||||
tile.drawx() + Angles.trnsx(angle, driver.translation), tile.drawy() + Angles.trnsy(angle, driver.translation),
|
tile.drawx() + Angles.trnsx(angle, driver.translation), tile.drawy() + Angles.trnsy(angle, driver.translation),
|
||||||
angle, 1f, data);
|
angle, 1f, 1f, data);
|
||||||
|
|
||||||
Effects.effect(driver.shootEffect, tile.drawx() + Angles.trnsx(angle, driver.translation),
|
Effects.effect(driver.shootEffect, tile.drawx() + Angles.trnsx(angle, driver.translation),
|
||||||
tile.drawy() + Angles.trnsy(angle, driver.translation), angle);
|
tile.drawy() + Angles.trnsy(angle, driver.translation), angle);
|
||||||
|
|||||||