mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-08 23:07:33 +07:00
Payload unit destroy on derelict
This commit is contained in:
@ -8,6 +8,7 @@ import arc.struct.*;
|
|||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.*;
|
import mindustry.*;
|
||||||
import mindustry.ai.*;
|
import mindustry.ai.*;
|
||||||
|
import mindustry.annotations.Annotations.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
import mindustry.type.*;
|
import mindustry.type.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
@ -359,6 +360,10 @@ public class Teams{
|
|||||||
//TODO this may cause a lot of packet spam, optimize?
|
//TODO this may cause a lot of packet spam, optimize?
|
||||||
Call.setTeam(build, Team.derelict);
|
Call.setTeam(build, Team.derelict);
|
||||||
|
|
||||||
|
if(build.getPayload() instanceof UnitPayload){
|
||||||
|
Call.destroyPayload(build);
|
||||||
|
}
|
||||||
|
|
||||||
if(Mathf.chance(0.25)){
|
if(Mathf.chance(0.25)){
|
||||||
Time.run(Mathf.random(0f, 60f * 6f), build::kill);
|
Time.run(Mathf.random(0f, 60f * 6f), build::kill);
|
||||||
}
|
}
|
||||||
@ -425,6 +430,14 @@ public class Teams{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Remote(called = Loc.server, unreliable = true)
|
||||||
|
public static void destroyPayload(Building build){
|
||||||
|
if(build != null && build.getPayload() instanceof UnitPayload && build.takePayload() instanceof UnitPayload unit){
|
||||||
|
unit.dump();
|
||||||
|
unit.unit.killed();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Represents a block made by this team that was destroyed somewhere on the map.
|
/** Represents a block made by this team that was destroyed somewhere on the map.
|
||||||
* This does not include deconstructed blocks.*/
|
* This does not include deconstructed blocks.*/
|
||||||
public static class BlockPlan{
|
public static class BlockPlan{
|
||||||
|
Reference in New Issue
Block a user