Implemented mass drivers
This commit is contained in:
@@ -628,6 +628,7 @@ public class Player extends Unit implements BuilderTrait, CarryTrait {
|
||||
if(local){
|
||||
int index = stream.readByte();
|
||||
players[index].readSaveSuper(stream);
|
||||
dead = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
|
||||
private static Vector2 vector = new Vector2();
|
||||
|
||||
private Team team;
|
||||
private Object data;
|
||||
private boolean supressCollision;
|
||||
|
||||
public Timer timer = new Timer(3);
|
||||
@@ -43,9 +44,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){
|
||||
create(type, owner, team, x, y, angle, velocityScl, null);
|
||||
}
|
||||
|
||||
public static void create (BulletType type, Entity owner, Team team, float x, float y, float angle, float velocityScl, Object data){
|
||||
Bullet bullet = Pools.obtain(Bullet.class);
|
||||
bullet.type = type;
|
||||
bullet.owner = owner;
|
||||
bullet.data = data;
|
||||
|
||||
bullet.velocity.set(0, type.speed).setAngle(angle).scl(velocityScl);
|
||||
bullet.velocity.add(owner instanceof VelocityTrait ? ((VelocityTrait)owner).getVelocity() : Vector2.Zero);
|
||||
@@ -90,6 +96,10 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
|
||||
time += add;
|
||||
}
|
||||
|
||||
public Object getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTypeID() {
|
||||
return typeID;
|
||||
@@ -185,6 +195,7 @@ public class Bullet extends BulletEntity<BulletType> implements TeamTrait, SyncT
|
||||
super.reset();
|
||||
timer.clear();
|
||||
team = null;
|
||||
data = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -55,6 +55,11 @@ public class ItemDrop extends SolidEntity implements SyncTrait, DrawTrait, Veloc
|
||||
return drop;
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server, in = In.entities)
|
||||
public static void createItemDrop(Item item, int amount, float x, float y, float velocityX, float velocityY){
|
||||
create(item, amount, x, y, 0).getVelocity().set(velocityX, velocityY);
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server, in = In.entities)
|
||||
public static void onPickup(int itemid){
|
||||
itemGroup.removeByID(itemid);
|
||||
|
||||
Reference in New Issue
Block a user