Beginning work on respawning
This commit is contained in:
@@ -5,6 +5,7 @@ import arc.graphics.*;
|
|||||||
import arc.graphics.g2d.*;
|
import arc.graphics.g2d.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.scene.ui.layout.*;
|
import arc.scene.ui.layout.*;
|
||||||
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import arc.util.ArcAnnotate.*;
|
import arc.util.ArcAnnotate.*;
|
||||||
import arc.util.pooling.*;
|
import arc.util.pooling.*;
|
||||||
@@ -13,10 +14,11 @@ import mindustry.core.*;
|
|||||||
import mindustry.entities.units.*;
|
import mindustry.entities.units.*;
|
||||||
import mindustry.game.*;
|
import mindustry.game.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.net.*;
|
|
||||||
import mindustry.net.Administration.*;
|
import mindustry.net.Administration.*;
|
||||||
|
import mindustry.net.*;
|
||||||
import mindustry.net.Packets.*;
|
import mindustry.net.Packets.*;
|
||||||
import mindustry.ui.*;
|
import mindustry.ui.*;
|
||||||
|
import mindustry.world.blocks.storage.CoreBlock.*;
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -66,16 +68,22 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc{
|
|||||||
x(unit.x());
|
x(unit.x());
|
||||||
y(unit.y());
|
y(unit.y());
|
||||||
unit.team(team);
|
unit.team(team);
|
||||||
|
}else if(!team.cores().isEmpty()){
|
||||||
|
//try to respawn
|
||||||
|
Array<CoreEntity> cores = team.cores();
|
||||||
|
|
||||||
|
if(!cores.isEmpty()){
|
||||||
|
//TODO respawning
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
textFadeTime -= Time.delta() / (60 * 5);
|
textFadeTime -= Time.delta() / (60 * 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void team(Team team){
|
public void team(Team team){
|
||||||
this.team = team;
|
this.team = team;
|
||||||
if(unit != null){
|
|
||||||
unit.team(team);
|
unit.team(team);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void clearUnit(){
|
public void clearUnit(){
|
||||||
unit(Nulls.unit);
|
unit(Nulls.unit);
|
||||||
|
|||||||
@@ -39,14 +39,15 @@ public class CoreBlock extends StorageBlock{
|
|||||||
public static void onUnitRespawn(Tile tile, Playerc player){
|
public static void onUnitRespawn(Tile tile, Playerc player){
|
||||||
if(player == null || tile.entity == null) return;
|
if(player == null || tile.entity == null) return;
|
||||||
|
|
||||||
|
//TODO really fix
|
||||||
CoreEntity entity = tile.ent();
|
CoreEntity entity = tile.ent();
|
||||||
Fx.spawn.at(entity);
|
Fx.spawn.at(entity);
|
||||||
entity.progress = 0;
|
//entity.progress = 0;
|
||||||
entity.spawnPlayer = player;
|
//entity.spawnPlayer = player;
|
||||||
//TODO fix
|
//TODO fix
|
||||||
//entity.spawnPlayer.onRespawn(tile);
|
//entity.spawnPlayer.onRespawn(tile);
|
||||||
//entity.spawnPlayer.applyImpulse(0, 8f);
|
//entity.spawnPlayer.applyImpulse(0, 8f);
|
||||||
entity.spawnPlayer = null;
|
//entity.spawnPlayer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -232,8 +233,8 @@ public class CoreBlock extends StorageBlock{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class CoreEntity extends TileEntity{
|
public class CoreEntity extends TileEntity{
|
||||||
protected Playerc spawnPlayer;
|
// protected Playerc spawnPlayer;
|
||||||
protected float progress;
|
//protected float progress;
|
||||||
protected float time;
|
protected float time;
|
||||||
protected float heat;
|
protected float heat;
|
||||||
protected int storageCapacity;
|
protected int storageCapacity;
|
||||||
|
|||||||
Reference in New Issue
Block a user