Even more commands added to server; net bugfixes

This commit is contained in:
Anuken
2018-01-28 23:18:51 -05:00
parent 3562a70669
commit fabc02f6ef
16 changed files with 151 additions and 35 deletions

View File

@@ -164,7 +164,7 @@ public class Player extends SyncEntity{
boolean shooting = !Inputs.keyDown("dash") && Inputs.keyDown("shoot") && control.input().recipe == null
&& !ui.hasMouse() && !control.input().onConfigurable();
if(shooting){
weaponLeft.update(player, true);
weaponRight.update(player, false);

View File

@@ -71,7 +71,7 @@ public class Enemy extends SyncEntity {
@Override
public void onDeath(){
type.onDeath(this);
type.onDeath(this, false);
}
@Override

View File

@@ -236,16 +236,18 @@ public class EnemyType {
public void onShoot(Enemy enemy, BulletType type, float rotation){}
public void onDeath(Enemy enemy){
public void onDeath(Enemy enemy, boolean force){
if(Net.server()){
NetEvents.handleEnemyDeath(enemy);
}
Effects.effect(Fx.explosion, enemy);
Effects.shake(3f, 4f, enemy);
Effects.sound("bang2", enemy);
enemy.remove();
enemy.dead = true;
if(!Net.client() || force) {
Effects.effect(Fx.explosion, enemy);
Effects.shake(3f, 4f, enemy);
Effects.sound("bang2", enemy);
enemy.remove();
enemy.dead = true;
}
}
public void removed(Enemy enemy){

View File

@@ -40,8 +40,8 @@ public class BlastType extends EnemyType {
}
@Override
public void onDeath(Enemy enemy){
super.onDeath(enemy);
public void onDeath(Enemy enemy, boolean force){
super.onDeath(enemy, force);
explode(enemy);
}

View File

@@ -50,8 +50,8 @@ public class TargetType extends EnemyType {
}
@Override
public void onDeath(Enemy enemy){
super.onDeath(enemy);
public void onDeath(Enemy enemy, boolean force){
super.onDeath(enemy, force);
Timers.run(100f, ()->{
new Enemy(EnemyTypes.target).set(enemy.x, enemy.y).add();
});