Merge branch 'master' into patch-3
@@ -4,6 +4,7 @@ alpha=0
|
|||||||
arkyid=37
|
arkyid=37
|
||||||
atrax=38
|
atrax=38
|
||||||
block=1
|
block=1
|
||||||
|
bryde=40
|
||||||
cix=2
|
cix=2
|
||||||
draug=3
|
draug=3
|
||||||
flare=36
|
flare=36
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
{version:1,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{version:2,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:deactivated,type:boolean,size:1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{version:1,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:baseRotation,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{version:2,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:baseRotation,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:deactivated,type:boolean,size:1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{version:1,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{version:2,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:deactivated,type:boolean,size:1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{version:1,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:baseRotation,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{version:2,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:baseRotation,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:deactivated,type:boolean,size:1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{version:1,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:payloads,type:arc.struct.Seq<mindustry.world.blocks.payloads.Payload>,size:-1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{version:2,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:deactivated,type:boolean,size:1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:payloads,type:arc.struct.Seq<mindustry.world.blocks.payloads.Payload>,size:-1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{version:1,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{version:2,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:deactivated,type:boolean,size:1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{version:1,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{version:2,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:deactivated,type:boolean,size:1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{fields:[{name:ammo,type:int,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:payloads,type:arc.struct.Seq<mindustry.world.blocks.payloads.Payload>,size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{version:1,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{version:2,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:deactivated,type:boolean,size:1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
1
annotations/src/main/resources/revisions/LegsUnit/1.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{version:1,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
1
annotations/src/main/resources/revisions/LegsUnit/2.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{version:2,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:deactivated,type:boolean,size:1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
1
annotations/src/main/resources/revisions/MechUnit/1.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{version:1,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:baseRotation,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
1
annotations/src/main/resources/revisions/MechUnit/2.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{version:2,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:baseRotation,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:deactivated,type:boolean,size:1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{version:1,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{version:2,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:deactivated,type:boolean,size:1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mineTile,type:mindustry.world.Tile,size:-1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{version:1,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{version:2,fields:[{name:ammo,type:float,size:4},{name:armor,type:float,size:4},{name:controller,type:mindustry.entities.units.UnitController,size:-1},{name:deactivated,type:boolean,size:1},{name:elevation,type:float,size:4},{name:health,type:float,size:4},{name:isShooting,type:boolean,size:1},{name:mounts,type:"mindustry.entities.units.WeaponMount[]",size:-1},{name:rotation,type:float,size:4},{name:shield,type:float,size:4},{name:spawnedByCore,type:boolean,size:1},{name:stack,type:mindustry.type.ItemStack,size:-1},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>,size:-1},{name:team,type:mindustry.game.Team,size:-1},{name:type,type:mindustry.type.UnitType,size:-1},{name:x,type:float,size:4},{name:y,type:float,size:4}]}
|
||||||
|
Before Width: | Height: | Size: 316 B After Width: | Height: | Size: 568 B |
|
Before Width: | Height: | Size: 321 B After Width: | Height: | Size: 562 B |
|
Before Width: | Height: | Size: 311 B After Width: | Height: | Size: 531 B |
@@ -599,7 +599,8 @@ bar.poweramount = Power: {0}
|
|||||||
bar.poweroutput = Power Output: {0}
|
bar.poweroutput = Power Output: {0}
|
||||||
bar.items = Items: {0}
|
bar.items = Items: {0}
|
||||||
bar.capacity = Capacity: {0}
|
bar.capacity = Capacity: {0}
|
||||||
bar.units = Units: {0}/{1}
|
bar.unitcap = {0} {1}/{2}
|
||||||
|
bar.limitreached = [scarlet] {0} / {1}[white] {2}\n[lightgray][[unit disabled]
|
||||||
bar.liquid = Liquid
|
bar.liquid = Liquid
|
||||||
bar.heat = Heat
|
bar.heat = Heat
|
||||||
bar.power = Power
|
bar.power = Power
|
||||||
|
|||||||
@@ -982,7 +982,7 @@ block.liquid-void.name = Рідинний вакуум
|
|||||||
block.power-void.name = Енергетичний вакуум
|
block.power-void.name = Енергетичний вакуум
|
||||||
block.power-source.name = Нескінченне джерело енергії
|
block.power-source.name = Нескінченне джерело енергії
|
||||||
block.unloader.name = Розвантажувач
|
block.unloader.name = Розвантажувач
|
||||||
block.vault.name = Сховище
|
block.vault.name = Вмістилище
|
||||||
block.wave.name = Хвиля
|
block.wave.name = Хвиля
|
||||||
block.swarmer.name = Роєвик
|
block.swarmer.name = Роєвик
|
||||||
block.salvo.name = Залп
|
block.salvo.name = Залп
|
||||||
@@ -1013,7 +1013,7 @@ block.phase-conduit.name = Фазовий трубопровід
|
|||||||
block.liquid-router.name = Рідинний маршрутизатор
|
block.liquid-router.name = Рідинний маршрутизатор
|
||||||
block.liquid-tank.name = Рідинний резервуар
|
block.liquid-tank.name = Рідинний резервуар
|
||||||
block.liquid-junction.name = Рідинне перехрестя
|
block.liquid-junction.name = Рідинне перехрестя
|
||||||
block.bridge-conduit.name = Мостовий водопровід
|
block.bridge-conduit.name = Мостовий трубопровід
|
||||||
block.rotary-pump.name = Роторний насос
|
block.rotary-pump.name = Роторний насос
|
||||||
block.thorium-reactor.name = Торієвий реактор
|
block.thorium-reactor.name = Торієвий реактор
|
||||||
block.mass-driver.name = Електромагнітна катапульта
|
block.mass-driver.name = Електромагнітна катапульта
|
||||||
|
|||||||
@@ -253,3 +253,28 @@
|
|||||||
63491=tetrative-reconstructor|block-tetrative-reconstructor-medium
|
63491=tetrative-reconstructor|block-tetrative-reconstructor-medium
|
||||||
63490=resupply-point|block-resupply-point-medium
|
63490=resupply-point|block-resupply-point-medium
|
||||||
63489=parallax|block-parallax-medium
|
63489=parallax|block-parallax-medium
|
||||||
|
63488=dagger|unit-dagger-medium
|
||||||
|
63487=mace|unit-mace-medium
|
||||||
|
63486=fortress|unit-fortress-medium
|
||||||
|
63485=nova|unit-nova-medium
|
||||||
|
63484=pulsar|unit-pulsar-medium
|
||||||
|
63483=quasar|unit-quasar-medium
|
||||||
|
63482=crawler|unit-crawler-medium
|
||||||
|
63481=atrax|unit-atrax-medium
|
||||||
|
63480=spiroct|unit-spiroct-medium
|
||||||
|
63479=arkyid|unit-arkyid-medium
|
||||||
|
63478=flare|unit-flare-medium
|
||||||
|
63477=horizon|unit-horizon-medium
|
||||||
|
63476=zenith|unit-zenith-medium
|
||||||
|
63475=antumbra|unit-antumbra-medium
|
||||||
|
63474=eclipse|unit-eclipse-medium
|
||||||
|
63473=mono|unit-mono-medium
|
||||||
|
63472=poly|unit-poly-medium
|
||||||
|
63471=mega|unit-mega-medium
|
||||||
|
63470=risse|unit-risse-medium
|
||||||
|
63469=minke|unit-minke-medium
|
||||||
|
63468=bryde|unit-bryde-medium
|
||||||
|
63467=alpha|unit-alpha-medium
|
||||||
|
63466=beta|unit-beta-medium
|
||||||
|
63465=gamma|unit-gamma-medium
|
||||||
|
63464=block|unit-block-medium
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 590 KiB After Width: | Height: | Size: 608 KiB |
|
Before Width: | Height: | Size: 1023 KiB After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 181 KiB After Width: | Height: | Size: 187 KiB |
|
Before Width: | Height: | Size: 300 KiB After Width: | Height: | Size: 307 KiB |
|
Before Width: | Height: | Size: 376 KiB After Width: | Height: | Size: 386 KiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 1.8 MiB |
|
Before Width: | Height: | Size: 182 KiB After Width: | Height: | Size: 188 KiB |
|
Before Width: | Height: | Size: 294 KiB After Width: | Height: | Size: 302 KiB |
|
Before Width: | Height: | Size: 380 KiB After Width: | Height: | Size: 391 KiB |
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.3 MiB |
@@ -25,7 +25,7 @@ public class BaseAI{
|
|||||||
private static final float step = 5;
|
private static final float step = 5;
|
||||||
private static final int attempts = 5;
|
private static final int attempts = 5;
|
||||||
private static final float emptyChance = 0.01f;
|
private static final float emptyChance = 0.01f;
|
||||||
private final static int timerStep = 0, timerSpawn = 1;
|
private static final int timerStep = 0, timerSpawn = 1;
|
||||||
|
|
||||||
private static int correct = 0, incorrect = 0;
|
private static int correct = 0, incorrect = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public class BaseRegistry{
|
|||||||
|
|
||||||
//calculate averages
|
//calculate averages
|
||||||
if(tile.block instanceof Drill || tile.block instanceof Pump){
|
if(tile.block instanceof Drill || tile.block instanceof Pump){
|
||||||
Tmp.v1.add(tile.x*tilesize + tile.block.offset(), tile.y*tilesize + tile.block.offset());
|
Tmp.v1.add(tile.x*tilesize + tile.block.offset, tile.y*tilesize + tile.block.offset);
|
||||||
drills ++;
|
drills ++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import static mindustry.Vars.*;
|
|||||||
/** Class used for indexing special target blocks for AI. */
|
/** Class used for indexing special target blocks for AI. */
|
||||||
public class BlockIndexer{
|
public class BlockIndexer{
|
||||||
/** Size of one quadrant. */
|
/** Size of one quadrant. */
|
||||||
private final static int quadrantSize = 16;
|
private static final int quadrantSize = 16;
|
||||||
|
|
||||||
/** Set of all ores that are being scanned. */
|
/** Set of all ores that are being scanned. */
|
||||||
private final ObjectSet<Item> scanOres = new ObjectSet<>();
|
private final ObjectSet<Item> scanOres = new ObjectSet<>();
|
||||||
@@ -181,7 +181,7 @@ public class BlockIndexer{
|
|||||||
for(int y = -tileRange + ty; y <= tileRange + ty; y++){
|
for(int y = -tileRange + ty; y <= tileRange + ty; y++){
|
||||||
if(!Mathf.within(x * tilesize, y * tilesize, wx, wy, range)) continue;
|
if(!Mathf.within(x * tilesize, y * tilesize, wx, wy, range)) continue;
|
||||||
|
|
||||||
Building other = world.ent(x, y);
|
Building other = world.build(x, y);
|
||||||
|
|
||||||
if(other == null) continue;
|
if(other == null) continue;
|
||||||
|
|
||||||
@@ -247,7 +247,7 @@ public class BlockIndexer{
|
|||||||
|
|
||||||
for(int tx = rx * quadrantSize; tx < (rx + 1) * quadrantSize && tx < world.width(); tx++){
|
for(int tx = rx * quadrantSize; tx < (rx + 1) * quadrantSize && tx < world.width(); tx++){
|
||||||
for(int ty = ry * quadrantSize; ty < (ry + 1) * quadrantSize && ty < world.height(); ty++){
|
for(int ty = ry * quadrantSize; ty < (ry + 1) * quadrantSize && ty < world.height(); ty++){
|
||||||
Building e = world.ent(tx, ty);
|
Building e = world.build(tx, ty);
|
||||||
|
|
||||||
if(e == null) continue;
|
if(e == null) continue;
|
||||||
|
|
||||||
@@ -388,7 +388,7 @@ public class BlockIndexer{
|
|||||||
outer:
|
outer:
|
||||||
for(int x = quadrantX * quadrantSize; x < world.width() && x < (quadrantX + 1) * quadrantSize; x++){
|
for(int x = quadrantX * quadrantSize; x < world.width() && x < (quadrantX + 1) * quadrantSize; x++){
|
||||||
for(int y = quadrantY * quadrantSize; y < world.height() && y < (quadrantY + 1) * quadrantSize; y++){
|
for(int y = quadrantY * quadrantSize; y < world.height() && y < (quadrantY + 1) * quadrantSize; y++){
|
||||||
Building result = world.ent(x, y);
|
Building result = world.build(x, y);
|
||||||
//when a targetable block is found, mark this quadrant as occupied and stop searching
|
//when a targetable block is found, mark this quadrant as occupied and stop searching
|
||||||
if(result != null && result.team() == team){
|
if(result != null && result.team() == team){
|
||||||
bits.set(quadrantX, quadrantY);
|
bits.set(quadrantX, quadrantY);
|
||||||
|
|||||||
@@ -167,12 +167,12 @@ public class Pathfinder implements Runnable{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Tile getTargetTile(Tile tile, Team team, Position target){
|
public @Nullable Tile getTargetTile(Tile tile, Team team, Position target){
|
||||||
return getTargetTile(tile, team, getTarget(target));
|
return getTargetTile(tile, team, getTarget(target));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Gets next tile to travel to. Main thread only. */
|
/** Gets next tile to travel to. Main thread only. */
|
||||||
public Tile getTargetTile(Tile tile, Team team, PathTarget target){
|
public @Nullable Tile getTargetTile(Tile tile, Team team, PathTarget target){
|
||||||
if(tile == null) return null;
|
if(tile == null) return null;
|
||||||
|
|
||||||
if(fieldMap[team.id] == null){
|
if(fieldMap[team.id] == null){
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class BuilderAI extends AIController{
|
|||||||
|
|
||||||
float length = circleLength <= 0.001f ? 1f : Mathf.clamp((unit.dst(target) - circleLength) / 100f, -1f, 1f);
|
float length = circleLength <= 0.001f ? 1f : Mathf.clamp((unit.dst(target) - circleLength) / 100f, -1f, 1f);
|
||||||
|
|
||||||
vec.setLength(unit.type().speed * Time.delta() * length);
|
vec.setLength(unit.type().speed * Time.delta * length);
|
||||||
if(length < -0.5f){
|
if(length < -0.5f){
|
||||||
vec.rotate(180f);
|
vec.rotate(180f);
|
||||||
}else if(length < 0){
|
}else if(length < 0){
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class FlyingAI extends AIController{
|
|||||||
vec.rotate((circleLength - vec.len()) / circleLength * 180f);
|
vec.rotate((circleLength - vec.len()) / circleLength * 180f);
|
||||||
}
|
}
|
||||||
|
|
||||||
vec.setLength(speed * Time.delta());
|
vec.setLength(speed * Time.delta);
|
||||||
|
|
||||||
unit.moveAt(vec);
|
unit.moveAt(vec);
|
||||||
}
|
}
|
||||||
@@ -73,7 +73,7 @@ public class FlyingAI extends AIController{
|
|||||||
|
|
||||||
float length = circleLength <= 0.001f ? 1f : Mathf.clamp((unit.dst(target) - circleLength) / 100f, -1f, 1f);
|
float length = circleLength <= 0.001f ? 1f : Mathf.clamp((unit.dst(target) - circleLength) / 100f, -1f, 1f);
|
||||||
|
|
||||||
vec.setLength(unit.type().speed * Time.delta() * length);
|
vec.setLength(unit.type().speed * Time.delta * length);
|
||||||
if(length < -0.5f){
|
if(length < -0.5f){
|
||||||
vec.rotate(180f);
|
vec.rotate(180f);
|
||||||
}else if(length < 0){
|
}else if(length < 0){
|
||||||
@@ -95,7 +95,7 @@ public class FlyingAI extends AIController{
|
|||||||
vec.setAngle(Mathf.slerpDelta(unit.vel().angle(), vec.angle(), 0.6f));
|
vec.setAngle(Mathf.slerpDelta(unit.vel().angle(), vec.angle(), 0.6f));
|
||||||
}
|
}
|
||||||
|
|
||||||
vec.setLength(unit.type().speed * Time.delta());
|
vec.setLength(unit.type().speed * Time.delta);
|
||||||
|
|
||||||
unit.moveAt(vec);
|
unit.moveAt(vec);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,8 +35,10 @@ public class FormationAI extends AIController implements FormationMember{
|
|||||||
if(leader.isShooting){
|
if(leader.isShooting){
|
||||||
unit.aimLook(leader.aimX(), leader.aimY());
|
unit.aimLook(leader.aimX(), leader.aimY());
|
||||||
}else{
|
}else{
|
||||||
if(!unit.moving()){
|
if(!leader.moving() || !unit.type().rotateShooting){
|
||||||
unit.lookAt(unit.vel.angle());
|
if(unit.moving()){
|
||||||
|
unit.lookAt(unit.vel.angle());
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
unit.lookAt(leader.rotation);
|
unit.lookAt(leader.rotation);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import arc.math.geom.*;
|
|||||||
import mindustry.*;
|
import mindustry.*;
|
||||||
import mindustry.game.*;
|
import mindustry.game.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
import mindustry.type.*;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@@ -11,6 +12,8 @@ import java.util.*;
|
|||||||
public class TeamIndexProcess implements AsyncProcess{
|
public class TeamIndexProcess implements AsyncProcess{
|
||||||
private QuadTree<Unit>[] trees = new QuadTree[Team.all.length];
|
private QuadTree<Unit>[] trees = new QuadTree[Team.all.length];
|
||||||
private int[] counts = new int[Team.all.length];
|
private int[] counts = new int[Team.all.length];
|
||||||
|
private int[][] typeCounts = new int[Team.all.length][0];
|
||||||
|
private int[][] activeCounts = new int[Team.all.length][0];
|
||||||
|
|
||||||
public QuadTree<Unit> tree(Team team){
|
public QuadTree<Unit> tree(Team team){
|
||||||
if(trees[team.id] == null) trees[team.id] = new QuadTree<>(Vars.world.getQuadBounds(new Rect()));
|
if(trees[team.id] == null) trees[team.id] = new QuadTree<>(Vars.world.getQuadBounds(new Rect()));
|
||||||
@@ -22,8 +25,27 @@ public class TeamIndexProcess implements AsyncProcess{
|
|||||||
return counts[team.id];
|
return counts[team.id];
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateCount(Team team, int amount){
|
public int countType(Team team, UnitType type){
|
||||||
|
return typeCounts[team.id].length <= type.id ? 0 : typeCounts[team.id][type.id];
|
||||||
|
}
|
||||||
|
|
||||||
|
public int countActive(Team team, UnitType type){
|
||||||
|
return activeCounts[team.id].length <= type.id ? 0 : activeCounts[team.id][type.id];
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateCount(Team team, UnitType type, int amount){
|
||||||
counts[team.id] += amount;
|
counts[team.id] += amount;
|
||||||
|
if(typeCounts[team.id].length <= type.id){
|
||||||
|
typeCounts[team.id] = new int[Vars.content.units().size];
|
||||||
|
}
|
||||||
|
typeCounts[team.id][type.id] += amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateActiveCount(Team team, UnitType type, int amount){
|
||||||
|
if(activeCounts[team.id].length <= type.id){
|
||||||
|
activeCounts[team.id] = new int[Vars.content.units().size];
|
||||||
|
}
|
||||||
|
activeCounts[team.id][type.id] += amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -39,13 +61,18 @@ public class TeamIndexProcess implements AsyncProcess{
|
|||||||
if(trees[team.id] != null){
|
if(trees[team.id] != null){
|
||||||
trees[team.id].clear();
|
trees[team.id].clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Arrays.fill(typeCounts[team.id], 0);
|
||||||
|
Arrays.fill(activeCounts[team.id], 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
Arrays.fill(counts, 0);
|
Arrays.fill(counts, 0);
|
||||||
|
|
||||||
for(Unit unit : Groups.unit){
|
for(Unit unit : Groups.unit){
|
||||||
tree(unit.team).insert(unit);
|
tree(unit.team).insert(unit);
|
||||||
counts[unit.team.id] ++;
|
|
||||||
|
updateCount(unit.team, unit.type(), 1);
|
||||||
|
if(!unit.deactivated) updateActiveCount(unit.team, unit.type(), 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -136,10 +136,10 @@ public class MusicControl{
|
|||||||
silenced = false;
|
silenced = false;
|
||||||
}else if(current == music && music != null){
|
}else if(current == music && music != null){
|
||||||
//fade in the playing track
|
//fade in the playing track
|
||||||
fade = Mathf.clamp(fade + Time.delta()/finTime);
|
fade = Mathf.clamp(fade + Time.delta /finTime);
|
||||||
}else if(current != null){
|
}else if(current != null){
|
||||||
//fade out the current track
|
//fade out the current track
|
||||||
fade = Mathf.clamp(fade - Time.delta()/foutTime);
|
fade = Mathf.clamp(fade - Time.delta /foutTime);
|
||||||
|
|
||||||
if(fade <= 0.01f){
|
if(fade <= 0.01f){
|
||||||
//stop current track when it hits 0 volume
|
//stop current track when it hits 0 volume
|
||||||
|
|||||||
@@ -27,9 +27,9 @@ public class SoundLoop{
|
|||||||
}else{
|
}else{
|
||||||
//fade the sound in or out
|
//fade the sound in or out
|
||||||
if(play){
|
if(play){
|
||||||
volume = Mathf.clamp(volume + fadeSpeed * Time.delta());
|
volume = Mathf.clamp(volume + fadeSpeed * Time.delta);
|
||||||
}else{
|
}else{
|
||||||
volume = Mathf.clamp(volume - fadeSpeed * Time.delta());
|
volume = Mathf.clamp(volume - fadeSpeed * Time.delta);
|
||||||
if(volume <= 0.001f){
|
if(volume <= 0.001f){
|
||||||
sound.stop(id);
|
sound.stop(id);
|
||||||
id = -1;
|
id = -1;
|
||||||
|
|||||||
@@ -1004,17 +1004,17 @@ public class Blocks implements ContentList{
|
|||||||
|
|
||||||
rotaryPump = new Pump("rotary-pump"){{
|
rotaryPump = new Pump("rotary-pump"){{
|
||||||
requirements(Category.liquid, with(Items.copper, 70, Items.metaglass, 50, Items.silicon, 20, Items.titanium, 35));
|
requirements(Category.liquid, with(Items.copper, 70, Items.metaglass, 50, Items.silicon, 20, Items.titanium, 35));
|
||||||
pumpAmount = 0.8f;
|
pumpAmount = 0.2f;
|
||||||
consumes.power(0.15f);
|
consumes.power(0.3f);
|
||||||
liquidCapacity = 30f;
|
liquidCapacity = 30f;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
size = 2;
|
size = 2;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
thermalPump = new Pump("thermal-pump"){{
|
thermalPump = new Pump("thermal-pump"){{
|
||||||
requirements(Category.liquid, with(Items.copper, 80, Items.metaglass, 70, Items.silicon, 30, Items.titanium, 40, Items.thorium, 35));
|
requirements(Category.liquid, with(Items.copper, 80, Items.metaglass, 90, Items.silicon, 30, Items.titanium, 40, Items.thorium, 35));
|
||||||
pumpAmount = 1.5f;
|
pumpAmount = 0.22f;
|
||||||
consumes.power(0.30f);
|
consumes.power(1.3f);
|
||||||
liquidCapacity = 40f;
|
liquidCapacity = 40f;
|
||||||
hasPower = true;
|
hasPower = true;
|
||||||
size = 3;
|
size = 3;
|
||||||
@@ -1228,6 +1228,9 @@ public class Blocks implements ContentList{
|
|||||||
rotateSpeed = 6f;
|
rotateSpeed = 6f;
|
||||||
warmupSpeed = 0.01f;
|
warmupSpeed = 0.01f;
|
||||||
|
|
||||||
|
//more than the laser drill
|
||||||
|
liquidBoostIntensity = 1.8f;
|
||||||
|
|
||||||
consumes.power(3f);
|
consumes.power(3f);
|
||||||
consumes.liquid(Liquids.water, 0.1f).boost();
|
consumes.liquid(Liquids.water, 0.1f).boost();
|
||||||
}};
|
}};
|
||||||
@@ -1284,6 +1287,8 @@ public class Blocks implements ContentList{
|
|||||||
health = 1100;
|
health = 1100;
|
||||||
itemCapacity = 4000;
|
itemCapacity = 4000;
|
||||||
size = 3;
|
size = 3;
|
||||||
|
|
||||||
|
unitCapModifier = 8;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
coreFoundation = new CoreBlock("core-foundation"){{
|
coreFoundation = new CoreBlock("core-foundation"){{
|
||||||
@@ -1293,6 +1298,8 @@ public class Blocks implements ContentList{
|
|||||||
health = 2000;
|
health = 2000;
|
||||||
itemCapacity = 9000;
|
itemCapacity = 9000;
|
||||||
size = 4;
|
size = 4;
|
||||||
|
|
||||||
|
unitCapModifier = 16;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
coreNucleus = new CoreBlock("core-nucleus"){{
|
coreNucleus = new CoreBlock("core-nucleus"){{
|
||||||
@@ -1302,6 +1309,8 @@ public class Blocks implements ContentList{
|
|||||||
health = 4000;
|
health = 4000;
|
||||||
itemCapacity = 13000;
|
itemCapacity = 13000;
|
||||||
size = 5;
|
size = 5;
|
||||||
|
|
||||||
|
unitCapModifier = 24;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
vault = new StorageBlock("vault"){{
|
vault = new StorageBlock("vault"){{
|
||||||
@@ -1411,7 +1420,6 @@ public class Blocks implements ContentList{
|
|||||||
Liquids.cryofluid, Bullets.cryoShot,
|
Liquids.cryofluid, Bullets.cryoShot,
|
||||||
Liquids.oil, Bullets.oilShot
|
Liquids.oil, Bullets.oilShot
|
||||||
);
|
);
|
||||||
targetAir = false;
|
|
||||||
size = 2;
|
size = 2;
|
||||||
recoilAmount = 0f;
|
recoilAmount = 0f;
|
||||||
reloadTime = 2f;
|
reloadTime = 2f;
|
||||||
@@ -1679,11 +1687,11 @@ public class Blocks implements ContentList{
|
|||||||
//region units
|
//region units
|
||||||
|
|
||||||
groundFactory = new UnitFactory("ground-factory"){{
|
groundFactory = new UnitFactory("ground-factory"){{
|
||||||
requirements(Category.units, with(Items.copper, 30, Items.lead, 70));
|
requirements(Category.units, with(Items.copper, 50, Items.lead, 120, Items.silicon, 80));
|
||||||
plans = new UnitPlan[]{
|
plans = new UnitPlan[]{
|
||||||
new UnitPlan(UnitTypes.dagger, 200f, with(Items.silicon, 10, Items.lead, 10)),
|
new UnitPlan(UnitTypes.dagger, 60f * 20, with(Items.silicon, 10, Items.lead, 10)),
|
||||||
new UnitPlan(UnitTypes.crawler, 200f, with(Items.silicon, 10, Items.blastCompound, 10)),
|
new UnitPlan(UnitTypes.crawler, 60f * 15, with(Items.silicon, 10, Items.blastCompound, 10)),
|
||||||
new UnitPlan(UnitTypes.nova, 200f, with(Items.silicon, 20, Items.lead, 20, Items.titanium, 20)),
|
new UnitPlan(UnitTypes.nova, 60f * 40, with(Items.silicon, 30, Items.lead, 20, Items.titanium, 20)),
|
||||||
};
|
};
|
||||||
size = 3;
|
size = 3;
|
||||||
consumes.power(1.2f);
|
consumes.power(1.2f);
|
||||||
@@ -1692,8 +1700,8 @@ public class Blocks implements ContentList{
|
|||||||
airFactory = new UnitFactory("air-factory"){{
|
airFactory = new UnitFactory("air-factory"){{
|
||||||
requirements(Category.units, with(Items.copper, 30, Items.lead, 70));
|
requirements(Category.units, with(Items.copper, 30, Items.lead, 70));
|
||||||
plans = new UnitPlan[]{
|
plans = new UnitPlan[]{
|
||||||
new UnitPlan(UnitTypes.flare, 200f, with(Items.silicon, 10)),
|
new UnitPlan(UnitTypes.flare, 60f * 15, with(Items.silicon, 10)),
|
||||||
new UnitPlan(UnitTypes.mono, 200f, with(Items.silicon, 15, Items.lead, 15)),
|
new UnitPlan(UnitTypes.mono, 60f * 35, with(Items.silicon, 30, Items.lead, 15)),
|
||||||
};
|
};
|
||||||
size = 3;
|
size = 3;
|
||||||
consumes.power(1.2f);
|
consumes.power(1.2f);
|
||||||
@@ -1702,7 +1710,7 @@ public class Blocks implements ContentList{
|
|||||||
navalFactory = new UnitFactory("naval-factory"){{
|
navalFactory = new UnitFactory("naval-factory"){{
|
||||||
requirements(Category.units, with(Items.copper, 30, Items.lead, 70));
|
requirements(Category.units, with(Items.copper, 30, Items.lead, 70));
|
||||||
plans = new UnitPlan[]{
|
plans = new UnitPlan[]{
|
||||||
new UnitPlan(UnitTypes.risse, 200f, with(Items.silicon, 20, Items.metaglass, 25)),
|
new UnitPlan(UnitTypes.risse, 60f * 30f, with(Items.silicon, 20, Items.metaglass, 25)),
|
||||||
};
|
};
|
||||||
size = 3;
|
size = 3;
|
||||||
requiresWater = true;
|
requiresWater = true;
|
||||||
@@ -1716,7 +1724,7 @@ public class Blocks implements ContentList{
|
|||||||
consumes.power(3f);
|
consumes.power(3f);
|
||||||
consumes.items(with(Items.silicon, 40, Items.graphite, 40));
|
consumes.items(with(Items.silicon, 40, Items.graphite, 40));
|
||||||
|
|
||||||
constructTime = 60f * 5f;
|
constructTime = 60f * 10f;
|
||||||
|
|
||||||
upgrades = new UnitType[][]{
|
upgrades = new UnitType[][]{
|
||||||
{UnitTypes.nova, UnitTypes.quasar},
|
{UnitTypes.nova, UnitTypes.quasar},
|
||||||
@@ -1735,7 +1743,7 @@ public class Blocks implements ContentList{
|
|||||||
consumes.power(6f);
|
consumes.power(6f);
|
||||||
consumes.items(with(Items.silicon, 130, Items.titanium, 80, Items.metaglass, 30));
|
consumes.items(with(Items.silicon, 130, Items.titanium, 80, Items.metaglass, 30));
|
||||||
|
|
||||||
constructTime = 60f * 15f;
|
constructTime = 60f * 30f;
|
||||||
|
|
||||||
upgrades = new UnitType[][]{
|
upgrades = new UnitType[][]{
|
||||||
{UnitTypes.horizon, UnitTypes.zenith},
|
{UnitTypes.horizon, UnitTypes.zenith},
|
||||||
@@ -1755,7 +1763,8 @@ public class Blocks implements ContentList{
|
|||||||
consumes.items(with(Items.silicon, 200, Items.titanium, 200, Items.surgealloy, 240));
|
consumes.items(with(Items.silicon, 200, Items.titanium, 200, Items.surgealloy, 240));
|
||||||
consumes.liquid(Liquids.cryofluid, 1f);
|
consumes.liquid(Liquids.cryofluid, 1f);
|
||||||
|
|
||||||
constructTime = 60f * 60f;
|
constructTime = 60f * 60f * 1.5f;
|
||||||
|
liquidCapacity = 30f;
|
||||||
|
|
||||||
upgrades = new UnitType[][]{
|
upgrades = new UnitType[][]{
|
||||||
{UnitTypes.zenith, UnitTypes.antumbra},
|
{UnitTypes.zenith, UnitTypes.antumbra},
|
||||||
@@ -1770,7 +1779,8 @@ public class Blocks implements ContentList{
|
|||||||
consumes.items(with(Items.silicon, 300, Items.plastanium, 300, Items.surgealloy, 300, Items.phasefabric, 250));
|
consumes.items(with(Items.silicon, 300, Items.plastanium, 300, Items.surgealloy, 300, Items.phasefabric, 250));
|
||||||
consumes.liquid(Liquids.cryofluid, 3f);
|
consumes.liquid(Liquids.cryofluid, 3f);
|
||||||
|
|
||||||
constructTime = 60f * 60f * 3;
|
constructTime = 60f * 60f * 4;
|
||||||
|
liquidCapacity = 60f;
|
||||||
|
|
||||||
upgrades = new UnitType[][]{
|
upgrades = new UnitType[][]{
|
||||||
{UnitTypes.antumbra, UnitTypes.eclipse},
|
{UnitTypes.antumbra, UnitTypes.eclipse},
|
||||||
|
|||||||
@@ -416,18 +416,18 @@ public class Bullets implements ContentList{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Bullet b){
|
public void update(Bullet b){
|
||||||
if(Mathf.chance(0.04 * Time.delta())){
|
if(Mathf.chance(0.04 * Time.delta)){
|
||||||
Tile tile = world.tileWorld(b.x, b.y);
|
Tile tile = world.tileWorld(b.x, b.y);
|
||||||
if(tile != null){
|
if(tile != null){
|
||||||
Fires.create(tile);
|
Fires.create(tile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Mathf.chance(0.1 * Time.delta())){
|
if(Mathf.chance(0.1 * Time.delta)){
|
||||||
Fx.fireballsmoke.at(b.x, b.y);
|
Fx.fireballsmoke.at(b.x, b.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Mathf.chance(0.1 * Time.delta())){
|
if(Mathf.chance(0.1 * Time.delta)){
|
||||||
Fx.ballfire.at(b.x, b.y);
|
Fx.ballfire.at(b.x, b.y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,14 @@ public class Fx{
|
|||||||
|
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
unitCapKill = new Effect(80f, e -> {
|
||||||
|
color(Color.scarlet);
|
||||||
|
alpha(e.fout(Interp.pow4Out));
|
||||||
|
|
||||||
|
float size = 10f + e.fout(Interp.pow10In) * 25f;
|
||||||
|
Draw.rect(Icon.warning.getRegion(), e.x, e.y, size, size);
|
||||||
|
}),
|
||||||
|
|
||||||
unitControl = new Effect(30f, e -> {
|
unitControl = new Effect(30f, e -> {
|
||||||
if(!(e.data instanceof Unit)) return;
|
if(!(e.data instanceof Unit)) return;
|
||||||
|
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ public class UnitTypes implements ContentList{
|
|||||||
despawnEffect = Fx.none;
|
despawnEffect = Fx.none;
|
||||||
width = 0.54f;
|
width = 0.54f;
|
||||||
lifetime = 35f;
|
lifetime = 35f;
|
||||||
knockback = -1f;
|
knockback = -1.2f;
|
||||||
}};
|
}};
|
||||||
}});
|
}});
|
||||||
|
|
||||||
@@ -368,7 +368,7 @@ public class UnitTypes implements ContentList{
|
|||||||
despawnEffect = Fx.none;
|
despawnEffect = Fx.none;
|
||||||
width = 0.4f;
|
width = 0.4f;
|
||||||
lifetime = 25f;
|
lifetime = 25f;
|
||||||
knockback = -0.5f;
|
knockback = -0.6f;
|
||||||
}};
|
}};
|
||||||
}});
|
}});
|
||||||
}};
|
}};
|
||||||
@@ -569,6 +569,8 @@ public class UnitTypes implements ContentList{
|
|||||||
mineTier = 1;
|
mineTier = 1;
|
||||||
mineSpeed = 2.5f;
|
mineSpeed = 2.5f;
|
||||||
|
|
||||||
|
//no weapon, mining only
|
||||||
|
/*
|
||||||
weapons.add(new Weapon(){{
|
weapons.add(new Weapon(){{
|
||||||
y = 1.5f;
|
y = 1.5f;
|
||||||
x = 0f;
|
x = 0f;
|
||||||
@@ -582,7 +584,7 @@ public class UnitTypes implements ContentList{
|
|||||||
bullet = new HealBulletType(5.2f, 10){{
|
bullet = new HealBulletType(5.2f, 10){{
|
||||||
healPercent = 4f;
|
healPercent = 4f;
|
||||||
}};
|
}};
|
||||||
}});
|
}});*/
|
||||||
}};
|
}};
|
||||||
|
|
||||||
poly = new UnitType("poly"){{
|
poly = new UnitType("poly"){{
|
||||||
@@ -678,6 +680,8 @@ public class UnitTypes implements ContentList{
|
|||||||
immunities = ObjectSet.with(StatusEffects.wet);
|
immunities = ObjectSet.with(StatusEffects.wet);
|
||||||
trailLength = 20;
|
trailLength = 20;
|
||||||
|
|
||||||
|
armor = 2f;
|
||||||
|
|
||||||
weapons.add(new Weapon("mount-weapon"){{
|
weapons.add(new Weapon("mount-weapon"){{
|
||||||
reload = 12f;
|
reload = 12f;
|
||||||
x = 4f;
|
x = 4f;
|
||||||
@@ -796,7 +800,7 @@ public class UnitTypes implements ContentList{
|
|||||||
hitEffect = Fx.massiveExplosion;
|
hitEffect = Fx.massiveExplosion;
|
||||||
knockback = 1.5f;
|
knockback = 1.5f;
|
||||||
lifetime = 140f;
|
lifetime = 140f;
|
||||||
height = 17f;
|
height = 15.5f;
|
||||||
width = 15f;
|
width = 15f;
|
||||||
collidesTiles = false;
|
collidesTiles = false;
|
||||||
ammoMultiplier = 4f;
|
ammoMultiplier = 4f;
|
||||||
|
|||||||
@@ -416,19 +416,12 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
|
|
||||||
//just a regular reminder
|
//just a regular reminder
|
||||||
if(!OS.prop("user.name").equals("anuke") && !OS.hasEnv("iknowwhatimdoing")){
|
if(!OS.prop("user.name").equals("anuke") && !OS.hasEnv("iknowwhatimdoing")){
|
||||||
if(mobile){
|
ui.showInfo("[scarlet]6.0 is not supposed to be played.[] Go do something else.");
|
||||||
Runnable[] run = {null};
|
|
||||||
run[0] = () -> {
|
|
||||||
ui.showInfo("[scarlet]6.0 doesn't work on mobile.[] Don't play it.", run[0]);
|
|
||||||
};
|
|
||||||
}else{
|
|
||||||
ui.showInfo("[scarlet]6.0 is not supposed to be played.[] Go do something else.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//play tutorial on stop
|
//play tutorial on stop
|
||||||
if(!settings.getBool("playedtutorial", false)){
|
if(!settings.getBool("playedtutorial", false)){
|
||||||
Core.app.post(() -> Core.app.post(this::playTutorial));
|
//Core.app.post(() -> Core.app.post(this::playTutorial));
|
||||||
}
|
}
|
||||||
|
|
||||||
//display UI scale changed dialog
|
//display UI scale changed dialog
|
||||||
@@ -449,7 +442,7 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
if(countdown[0] <= 0){
|
if(countdown[0] <= 0){
|
||||||
exit.run();
|
exit.run();
|
||||||
}
|
}
|
||||||
return Core.bundle.format("uiscale.reset", (int)((countdown[0] -= Time.delta()) / 60f));
|
return Core.bundle.format("uiscale.reset", (int)((countdown[0] -= Time.delta) / 60f));
|
||||||
}).pad(10f).expand().center();
|
}).pad(10f).expand().center();
|
||||||
|
|
||||||
dialog.buttons.defaults().size(200f, 60f);
|
dialog.buttons.defaults().size(200f, 60f);
|
||||||
@@ -486,7 +479,6 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
|
|
||||||
music.update();
|
music.update();
|
||||||
loops.update();
|
loops.update();
|
||||||
Time.updateGlobal();
|
|
||||||
|
|
||||||
if(Core.input.keyTap(Binding.fullscreen)){
|
if(Core.input.keyTap(Binding.fullscreen)){
|
||||||
boolean full = settings.getBool("fullscreen");
|
boolean full = settings.getBool("fullscreen");
|
||||||
@@ -528,6 +520,7 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
|
//this runs in the menu
|
||||||
if(!state.isPaused()){
|
if(!state.isPaused()){
|
||||||
Time.update();
|
Time.update();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ public class Logic implements ApplicationListener{
|
|||||||
|
|
||||||
for(WeatherEntry entry : state.rules.weather){
|
for(WeatherEntry entry : state.rules.weather){
|
||||||
//update cooldown
|
//update cooldown
|
||||||
entry.cooldown -= Time.delta();
|
entry.cooldown -= Time.delta;
|
||||||
|
|
||||||
//create new event when not active
|
//create new event when not active
|
||||||
if(entry.cooldown < 0 && !entry.weather.isActive()){
|
if(entry.cooldown < 0 && !entry.weather.isActive()){
|
||||||
@@ -356,7 +356,7 @@ public class Logic implements ApplicationListener{
|
|||||||
|
|
||||||
if(state.rules.waves && state.rules.waveTimer && !state.gameOver){
|
if(state.rules.waves && state.rules.waveTimer && !state.gameOver){
|
||||||
if(!isWaitingWave()){
|
if(!isWaitingWave()){
|
||||||
state.wavetime = Math.max(state.wavetime - Time.delta(), 0);
|
state.wavetime = Math.max(state.wavetime - Time.delta, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ import java.util.zip.*;
|
|||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class NetClient implements ApplicationListener{
|
public class NetClient implements ApplicationListener{
|
||||||
private final static float dataTimeout = 60 * 18;
|
private static final float dataTimeout = 60 * 18;
|
||||||
private final static float playerSyncTime = 2;
|
private static final float playerSyncTime = 2;
|
||||||
public final static float viewScale = 2f;
|
public final static float viewScale = 2f;
|
||||||
|
|
||||||
private long ping;
|
private long ping;
|
||||||
@@ -476,7 +476,7 @@ public class NetClient implements ApplicationListener{
|
|||||||
}else if(!connecting){
|
}else if(!connecting){
|
||||||
net.disconnect();
|
net.disconnect();
|
||||||
}else{ //...must be connecting
|
}else{ //...must be connecting
|
||||||
timeoutTime += Time.delta();
|
timeoutTime += Time.delta;
|
||||||
if(timeoutTime > dataTimeout){
|
if(timeoutTime > dataTimeout){
|
||||||
Log.err("Failed to load data!");
|
Log.err("Failed to load data!");
|
||||||
ui.loadfrag.hide();
|
ui.loadfrag.hide();
|
||||||
|
|||||||
@@ -34,13 +34,13 @@ import static arc.util.Log.*;
|
|||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
|
|
||||||
public class NetServer implements ApplicationListener{
|
public class NetServer implements ApplicationListener{
|
||||||
private final static int maxSnapshotSize = 430, timerBlockSync = 0;
|
private static final int maxSnapshotSize = 430, timerBlockSync = 0;
|
||||||
private final static float serverSyncTime = 12, blockSyncTime = 60 * 8;
|
private static final float serverSyncTime = 12, blockSyncTime = 60 * 8;
|
||||||
private final static FloatBuffer fbuffer = FloatBuffer.allocate(20);
|
private static final FloatBuffer fbuffer = FloatBuffer.allocate(20);
|
||||||
private final static Vec2 vector = new Vec2();
|
private static final Vec2 vector = new Vec2();
|
||||||
private final static Rect viewport = new Rect();
|
private static final Rect viewport = new Rect();
|
||||||
/** If a player goes away of their server-side coordinates by this distance, they get teleported back. */
|
/** If a player goes away of their server-side coordinates by this distance, they get teleported back. */
|
||||||
private final static float correctDist = 16f;
|
private static final float correctDist = 16f;
|
||||||
|
|
||||||
public final Administration admins = new Administration();
|
public final Administration admins = new Administration();
|
||||||
public final CommandHandler clientCommands = new CommandHandler("/");
|
public final CommandHandler clientCommands = new CommandHandler("/");
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class Renderer implements ApplicationListener{
|
|||||||
camerascale = Mathf.lerpDelta(camerascale, targetscale, 0.1f);
|
camerascale = Mathf.lerpDelta(camerascale, targetscale, 0.1f);
|
||||||
|
|
||||||
if(landTime > 0){
|
if(landTime > 0){
|
||||||
landTime -= Time.delta();
|
landTime -= Time.delta;
|
||||||
landscale = Interp.pow5In.apply(minZoomScl, Scl.scl(4f), 1f - landTime / Fx.coreLand.lifetime);
|
landscale = Interp.pow5In.apply(minZoomScl, Scl.scl(4f), 1f - landTime / Fx.coreLand.lifetime);
|
||||||
camerascale = landscale;
|
camerascale = landscale;
|
||||||
weatherAlpha = 0f;
|
weatherAlpha = 0f;
|
||||||
@@ -172,8 +172,8 @@ public class Renderer implements ApplicationListener{
|
|||||||
if(shaketime > 0){
|
if(shaketime > 0){
|
||||||
float intensity = shakeIntensity * (settings.getInt("screenshake", 4) / 4f) * scale;
|
float intensity = shakeIntensity * (settings.getInt("screenshake", 4) / 4f) * scale;
|
||||||
camera.position.add(Mathf.range(intensity), Mathf.range(intensity));
|
camera.position.add(Mathf.range(intensity), Mathf.range(intensity));
|
||||||
shakeIntensity -= 0.25f * Time.delta();
|
shakeIntensity -= 0.25f * Time.delta;
|
||||||
shaketime -= Time.delta();
|
shaketime -= Time.delta;
|
||||||
shakeIntensity = Mathf.clamp(shakeIntensity, 0f, 100f);
|
shakeIntensity = Mathf.clamp(shakeIntensity, 0f, 100f);
|
||||||
}else{
|
}else{
|
||||||
shakeIntensity = 0f;
|
shakeIntensity = 0f;
|
||||||
|
|||||||
@@ -110,14 +110,14 @@ public class World{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public Building ent(int x, int y){
|
public Building build(int x, int y){
|
||||||
Tile tile = tile(x, y);
|
Tile tile = tile(x, y);
|
||||||
if(tile == null) return null;
|
if(tile == null) return null;
|
||||||
return tile.build;
|
return tile.build;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public Building ent(int pos){
|
public Building build(int pos){
|
||||||
Tile tile = tile(pos);
|
Tile tile = tile(pos);
|
||||||
if(tile == null) return null;
|
if(tile == null) return null;
|
||||||
return tile.build;
|
return tile.build;
|
||||||
@@ -134,8 +134,8 @@ public class World{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public Building entWorld(float x, float y){
|
public Building buildWorld(float x, float y){
|
||||||
return ent(Math.round(x / tilesize), Math.round(y / tilesize));
|
return build(Math.round(x / tilesize), Math.round(y / tilesize));
|
||||||
}
|
}
|
||||||
|
|
||||||
public int toTile(float coord){
|
public int toTile(float coord){
|
||||||
|
|||||||
@@ -112,14 +112,14 @@ public class MapRenderer implements Disposable{
|
|||||||
|
|
||||||
if(wall.rotate){
|
if(wall.rotate){
|
||||||
mesh.draw(idxWall, region,
|
mesh.draw(idxWall, region,
|
||||||
wx * tilesize + wall.offset(), wy * tilesize + wall.offset(),
|
wx * tilesize + wall.offset, wy * tilesize + wall.offset,
|
||||||
region.getWidth() * Draw.scl, region.getHeight() * Draw.scl, tile.rotdeg() - 90);
|
region.getWidth() * Draw.scl, region.getHeight() * Draw.scl, tile.rotdeg() - 90);
|
||||||
}else{
|
}else{
|
||||||
float width = region.getWidth() * Draw.scl, height = region.getHeight() * Draw.scl;
|
float width = region.getWidth() * Draw.scl, height = region.getHeight() * Draw.scl;
|
||||||
|
|
||||||
mesh.draw(idxWall, region,
|
mesh.draw(idxWall, region,
|
||||||
wx * tilesize + wall.offset() + (tilesize - width) / 2f,
|
wx * tilesize + wall.offset + (tilesize - width) / 2f,
|
||||||
wy * tilesize + wall.offset() + (tilesize - height) / 2f,
|
wy * tilesize + wall.offset + (tilesize - height) / 2f,
|
||||||
width, height);
|
width, height);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package mindustry.editor;
|
|||||||
import arc.struct.Seq;
|
import arc.struct.Seq;
|
||||||
|
|
||||||
public class OperationStack{
|
public class OperationStack{
|
||||||
private final static int maxSize = 10;
|
private static final int maxSize = 10;
|
||||||
private Seq<DrawOperation> stack = new Seq<>();
|
private Seq<DrawOperation> stack = new Seq<>();
|
||||||
private int index = 0;
|
private int index = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import static mindustry.Vars.*;
|
|||||||
import static mindustry.game.SpawnGroup.never;
|
import static mindustry.game.SpawnGroup.never;
|
||||||
|
|
||||||
public class WaveInfoDialog extends BaseDialog{
|
public class WaveInfoDialog extends BaseDialog{
|
||||||
private final static int displayed = 20;
|
private static final int displayed = 20;
|
||||||
private Seq<SpawnGroup> groups = new Seq<>();
|
private Seq<SpawnGroup> groups = new Seq<>();
|
||||||
|
|
||||||
private Table table, preview;
|
private Table table, preview;
|
||||||
@@ -104,7 +104,7 @@ public class WaveInfoDialog extends BaseDialog{
|
|||||||
m.button("-", () -> {
|
m.button("-", () -> {
|
||||||
}).update(t -> {
|
}).update(t -> {
|
||||||
if(t.getClickListener().isPressed()){
|
if(t.getClickListener().isPressed()){
|
||||||
updateTimer += Time.delta();
|
updateTimer += Time.delta;
|
||||||
if(updateTimer >= updatePeriod){
|
if(updateTimer >= updatePeriod){
|
||||||
start = Math.max(start - 1, 0);
|
start = Math.max(start - 1, 0);
|
||||||
updateTimer = 0f;
|
updateTimer = 0f;
|
||||||
@@ -118,7 +118,7 @@ public class WaveInfoDialog extends BaseDialog{
|
|||||||
m.button("+", () -> {
|
m.button("+", () -> {
|
||||||
}).update(t -> {
|
}).update(t -> {
|
||||||
if(t.getClickListener().isPressed()){
|
if(t.getClickListener().isPressed()){
|
||||||
updateTimer += Time.delta();
|
updateTimer += Time.delta;
|
||||||
if(updateTimer >= updatePeriod){
|
if(updateTimer >= updatePeriod){
|
||||||
start++;
|
start++;
|
||||||
updateTimer = 0f;
|
updateTimer = 0f;
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ public class Damage{
|
|||||||
collidedBlocks.clear();
|
collidedBlocks.clear();
|
||||||
tr.trns(angle, length);
|
tr.trns(angle, length);
|
||||||
Intc2 collider = (cx, cy) -> {
|
Intc2 collider = (cx, cy) -> {
|
||||||
Building tile = world.ent(cx, cy);
|
Building tile = world.build(cx, cy);
|
||||||
if(tile != null && !collidedBlocks.contains(tile.pos()) && tile.team() != team && tile.collide(hitter)){
|
if(tile != null && !collidedBlocks.contains(tile.pos()) && tile.team() != team && tile.collide(hitter)){
|
||||||
tile.collision(hitter);
|
tile.collision(hitter);
|
||||||
collidedBlocks.add(tile.pos());
|
collidedBlocks.add(tile.pos());
|
||||||
@@ -159,7 +159,7 @@ public class Damage{
|
|||||||
tmpBuilding = null;
|
tmpBuilding = null;
|
||||||
|
|
||||||
world.raycastEachWorld(x, y, x + tr.x, y + tr.y, (cx, cy) -> {
|
world.raycastEachWorld(x, y, x + tr.x, y + tr.y, (cx, cy) -> {
|
||||||
Building tile = world.ent(cx, cy);
|
Building tile = world.build(cx, cy);
|
||||||
if(tile != null && tile.team != hitter.team){
|
if(tile != null && tile.team != hitter.team){
|
||||||
tmpBuilding = tile;
|
tmpBuilding = tile;
|
||||||
//TODO return tile
|
//TODO return tile
|
||||||
|
|||||||
@@ -62,6 +62,9 @@ public class Effects{
|
|||||||
public static void decal(TextureRegion region, float x, float y, float rotation, float lifetime, Color color){
|
public static void decal(TextureRegion region, float x, float y, float rotation, float lifetime, Color color){
|
||||||
if(headless || region == null || !Core.atlas.isFound(region)) return;
|
if(headless || region == null || !Core.atlas.isFound(region)) return;
|
||||||
|
|
||||||
|
Tile tile = world.tileWorld(x, y);
|
||||||
|
if(tile == null || tile.floor().isLiquid) return;
|
||||||
|
|
||||||
Decal decal = Decal.create();
|
Decal decal = Decal.create();
|
||||||
decal.set(x, y);
|
decal.set(x, y);
|
||||||
decal.rotation(rotation);
|
decal.rotation(rotation);
|
||||||
@@ -74,22 +77,15 @@ public class Effects{
|
|||||||
public static void scorch(float x, float y, int size){
|
public static void scorch(float x, float y, int size){
|
||||||
if(headless) return;
|
if(headless) return;
|
||||||
|
|
||||||
Tile tile = world.tileWorld(x, y);
|
|
||||||
if(tile == null || tile.floor().isLiquid) return;
|
|
||||||
|
|
||||||
size = Mathf.clamp(size, 0, 9);
|
size = Mathf.clamp(size, 0, 9);
|
||||||
|
|
||||||
TextureRegion region = Core.atlas.find("scorch-" + size + "-" + Mathf.random(2));
|
TextureRegion region = Core.atlas.find("scorch-" + size + "-" + Mathf.random(2));
|
||||||
decal(region, x, y, Mathf.random(4) * 90, 3600, Pal.rubble);
|
decal(region, x, y, Mathf.random(4) * 90, 3600, Pal.rubble);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void rubble(float x, float y, int blockSize){
|
public static void rubble(float x, float y, int blockSize){
|
||||||
if(headless) return;
|
if(headless) return;
|
||||||
|
|
||||||
Tile tile = world.tileWorld(x, y);
|
|
||||||
if(tile == null || tile.floor().isLiquid) return;
|
|
||||||
|
|
||||||
TextureRegion region = Core.atlas.find("rubble-" + blockSize + "-" + (Core.atlas.has("rubble-" + blockSize + "-1") ? Mathf.random(0, 1) : "0"));
|
TextureRegion region = Core.atlas.find("rubble-" + blockSize + "-" + (Core.atlas.has("rubble-" + blockSize + "-1") ? Mathf.random(0, 1) : "0"));
|
||||||
decal(region, x, y, Mathf.random(4) * 90, 3600, Pal.rubble);
|
decal(region, x, y, Mathf.random(4) * 90, 3600, Pal.rubble);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,9 +52,9 @@ public class Fires{
|
|||||||
public static void extinguish(Tile tile, float intensity){
|
public static void extinguish(Tile tile, float intensity){
|
||||||
if(tile != null && map.containsKey(tile.pos())){
|
if(tile != null && map.containsKey(tile.pos())){
|
||||||
Fire fire = map.get(tile.pos());
|
Fire fire = map.get(tile.pos());
|
||||||
fire.time(fire.time() + intensity * Time.delta());
|
fire.time(fire.time + intensity * Time.delta);
|
||||||
Fx.steam.at(fire);
|
Fx.steam.at(fire);
|
||||||
if(fire.time() >= fire.lifetime()){
|
if(fire.time >= fire.lifetime){
|
||||||
Events.fire(Trigger.fireExtinguish);
|
Events.fire(Trigger.fireExtinguish);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ public class Predict{
|
|||||||
* @return the intercept location
|
* @return the intercept location
|
||||||
*/
|
*/
|
||||||
public static Vec2 intercept(float srcx, float srcy, float dstx, float dsty, float dstvx, float dstvy, float v){
|
public static Vec2 intercept(float srcx, float srcy, float dstx, float dsty, float dstvx, float dstvy, float v){
|
||||||
dstvx /= Time.delta();
|
dstvx /= Time.delta;
|
||||||
dstvy /= Time.delta();
|
dstvy /= Time.delta;
|
||||||
float tx = dstx - srcx,
|
float tx = dstx - srcx,
|
||||||
ty = dsty - srcy;
|
ty = dsty - srcy;
|
||||||
|
|
||||||
@@ -58,8 +58,8 @@ public class Predict{
|
|||||||
ddy += ((Hitboxc)dst).deltaY();
|
ddy += ((Hitboxc)dst).deltaY();
|
||||||
}
|
}
|
||||||
if(src instanceof Hitboxc){
|
if(src instanceof Hitboxc){
|
||||||
ddx -= ((Hitboxc)src).deltaX()/(Time.delta());
|
ddx -= ((Hitboxc)src).deltaX()/(Time.delta);
|
||||||
ddy -= ((Hitboxc)src).deltaY()/(Time.delta());
|
ddy -= ((Hitboxc)src).deltaY()/(Time.delta);
|
||||||
}
|
}
|
||||||
return intercept(src.getX(), src.getY(), dst.getX(), dst.getY(), ddx, ddy, v);
|
return intercept(src.getX(), src.getY(), dst.getX(), dst.getY(), ddx, ddy, v);
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ public class Predict{
|
|||||||
* See {@link #intercept(float, float, float, float, float, float, float)}.
|
* See {@link #intercept(float, float, float, float, float, float, float)}.
|
||||||
*/
|
*/
|
||||||
public static Vec2 intercept(Hitboxc src, Hitboxc dst, float v){
|
public static Vec2 intercept(Hitboxc src, Hitboxc dst, float v){
|
||||||
return intercept(src.getX(), src.getY(), dst.getX(), dst.getY(), dst.deltaX() - src.deltaX()/(2f*Time.delta()), dst.deltaY() - src.deltaX()/(2f*Time.delta()), v);
|
return intercept(src.getX(), src.getY(), dst.getX(), dst.getY(), dst.deltaX() - src.deltaX()/(2f* Time.delta), dst.deltaY() - src.deltaX()/(2f* Time.delta), v);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Vec2 quad(float a, float b, float c){
|
private static Vec2 quad(float a, float b, float c){
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import mindustry.annotations.Annotations.*;
|
|||||||
import mindustry.content.*;
|
import mindustry.content.*;
|
||||||
import mindustry.game.*;
|
import mindustry.game.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
import mindustry.type.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
@@ -29,11 +30,15 @@ public class Units{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** @return whether a new instance of a unit of this team can be created. */
|
/** @return whether a new instance of a unit of this team can be created. */
|
||||||
public static boolean canCreate(Team team){
|
public static boolean canCreate(Team team, UnitType type){
|
||||||
return teamIndex.count(team) < getCap(team);
|
return teamIndex.countType(team, type) < getCap(team);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getCap(Team team){
|
public static int getCap(Team team){
|
||||||
|
//wave team has no cap
|
||||||
|
if((team == state.rules.waveTeam && state.rules.waves) || (state.isCampaign() && team == state.rules.waveTeam)){
|
||||||
|
return Integer.MAX_VALUE;
|
||||||
|
}
|
||||||
return state.rules.unitCap + indexer.getExtraUnits(team);
|
return state.rules.unitCap + indexer.getExtraUnits(team);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class ForceFieldAbility implements Ability{
|
|||||||
@Override
|
@Override
|
||||||
public void update(Unit unit){
|
public void update(Unit unit){
|
||||||
if(unit.shield < max){
|
if(unit.shield < max){
|
||||||
unit.shield += Time.delta() * regen;
|
unit.shield += Time.delta * regen;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(unit.shield > 0){
|
if(unit.shield > 0){
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public class HealFieldAbility implements Ability{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Unit unit){
|
public void update(Unit unit){
|
||||||
unit.timer1 += Time.delta();
|
unit.timer1 += Time.delta;
|
||||||
|
|
||||||
if(unit.timer1 >= reload){
|
if(unit.timer1 >= reload){
|
||||||
wasHealed = false;
|
wasHealed = false;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class ShieldFieldAbility implements Ability{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Unit unit){
|
public void update(Unit unit){
|
||||||
unit.timer1 += Time.delta();
|
unit.timer1 += Time.delta;
|
||||||
|
|
||||||
if(unit.timer1 >= reload){
|
if(unit.timer1 >= reload){
|
||||||
applied = false;
|
applied = false;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class StatusFieldAbility implements Ability{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Unit unit){
|
public void update(Unit unit){
|
||||||
unit.timer2 += Time.delta();
|
unit.timer2 += Time.delta;
|
||||||
|
|
||||||
if(unit.timer2 >= reload){
|
if(unit.timer2 >= reload){
|
||||||
|
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ public abstract class BulletType extends Content{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(weaveMag > 0){
|
if(weaveMag > 0){
|
||||||
b.vel.rotate(Mathf.sin(Mathf.randomSeed(b.id, 10f) + b.time, weaveScale, weaveMag) * Time.delta());
|
b.vel.rotate(Mathf.sin(Mathf.randomSeed(b.id, 10f) + b.time, weaveScale, weaveMag) * Time.delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(trailChance > 0){
|
if(trailChance > 0){
|
||||||
@@ -241,7 +241,7 @@ public abstract class BulletType extends Content{
|
|||||||
bullet.owner = owner;
|
bullet.owner = owner;
|
||||||
bullet.team = team;
|
bullet.team = team;
|
||||||
bullet.vel.trns(angle, speed * velocityScl);
|
bullet.vel.trns(angle, speed * velocityScl);
|
||||||
bullet.set(x - bullet.vel.x * Time.delta(), y - bullet.vel.y * Time.delta());
|
bullet.set(x - bullet.vel.x * Time.delta, y - bullet.vel.y * Time.delta);
|
||||||
bullet.lifetime = lifetime * lifetimeScl;
|
bullet.lifetime = lifetime * lifetimeScl;
|
||||||
bullet.data = data;
|
bullet.data = data;
|
||||||
bullet.drag = drag;
|
bullet.drag = drag;
|
||||||
|
|||||||
@@ -114,9 +114,9 @@ abstract class BuilderComp implements Unitc{
|
|||||||
BuildEntity entity = tile.bc();
|
BuildEntity entity = tile.bc();
|
||||||
|
|
||||||
if(current.breaking){
|
if(current.breaking){
|
||||||
entity.deconstruct(base(), core, 1f / entity.buildCost * Time.delta() * type().buildSpeed * state.rules.buildSpeedMultiplier);
|
entity.deconstruct(base(), core, 1f / entity.buildCost * Time.delta * type().buildSpeed * state.rules.buildSpeedMultiplier);
|
||||||
}else{
|
}else{
|
||||||
if(entity.construct(base(), core, 1f / entity.buildCost * Time.delta() * type().buildSpeed * state.rules.buildSpeedMultiplier, current.hasConfig)){
|
if(entity.construct(base(), core, 1f / entity.buildCost * Time.delta * type().buildSpeed * state.rules.buildSpeedMultiplier, current.hasConfig)){
|
||||||
if(current.hasConfig){
|
if(current.hasConfig){
|
||||||
Call.tileConfig(null, tile.build, current.config);
|
Call.tileConfig(null, tile.build, current.config);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,14 +201,14 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Building nearby(int dx, int dy){
|
public Building nearby(int dx, int dy){
|
||||||
return world.ent(tile.x + dx, tile.y + dy);
|
return world.build(tile.x + dx, tile.y + dy);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Building nearby(int rotation){
|
public Building nearby(int rotation){
|
||||||
if(rotation == 0) return world.ent(tile.x + 1, tile.y);
|
if(rotation == 0) return world.build(tile.x + 1, tile.y);
|
||||||
if(rotation == 1) return world.ent(tile.x, tile.y + 1);
|
if(rotation == 1) return world.build(tile.x, tile.y + 1);
|
||||||
if(rotation == 2) return world.ent(tile.x - 1, tile.y);
|
if(rotation == 2) return world.build(tile.x - 1, tile.y);
|
||||||
if(rotation == 3) return world.ent(tile.x, tile.y - 1);
|
if(rotation == 3) return world.build(tile.x, tile.y - 1);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,7 +290,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
|
|
||||||
/** Scaled delta. */
|
/** Scaled delta. */
|
||||||
public float delta(){
|
public float delta(){
|
||||||
return Time.delta() * timeScale;
|
return Time.delta * timeScale;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Efficiency * delta. */
|
/** Efficiency * delta. */
|
||||||
@@ -305,7 +305,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
|
|
||||||
/** Call when nothing is happening to the entity. This increments the internal sleep timer. */
|
/** Call when nothing is happening to the entity. This increments the internal sleep timer. */
|
||||||
public void sleep(){
|
public void sleep(){
|
||||||
sleepTime += Time.delta();
|
sleepTime += Time.delta;
|
||||||
if(!sleeping && sleepTime >= timeToSleep){
|
if(!sleeping && sleepTime >= timeToSleep){
|
||||||
remove();
|
remove();
|
||||||
sleeping = true;
|
sleeping = true;
|
||||||
@@ -518,14 +518,14 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
|
|
||||||
Liquid other = next.liquids().current();
|
Liquid other = next.liquids().current();
|
||||||
if((other.flammability > 0.3f && liquid.temperature > 0.7f) || (liquid.flammability > 0.3f && other.temperature > 0.7f)){
|
if((other.flammability > 0.3f && liquid.temperature > 0.7f) || (liquid.flammability > 0.3f && other.temperature > 0.7f)){
|
||||||
damage(1 * Time.delta());
|
damage(1 * Time.delta);
|
||||||
next.damage(1 * Time.delta());
|
next.damage(1 * Time.delta);
|
||||||
if(Mathf.chance(0.1 * Time.delta())){
|
if(Mathf.chance(0.1 * Time.delta)){
|
||||||
Fx.fire.at(fx, fy);
|
Fx.fire.at(fx, fy);
|
||||||
}
|
}
|
||||||
}else if((liquid.temperature > 0.7f && other.temperature < 0.55f) || (other.temperature > 0.7f && liquid.temperature < 0.55f)){
|
}else if((liquid.temperature > 0.7f && other.temperature < 0.55f) || (other.temperature > 0.7f && liquid.temperature < 0.55f)){
|
||||||
liquids.remove(liquid, Math.min(liquids.get(liquid), 0.7f * Time.delta()));
|
liquids.remove(liquid, Math.min(liquids.get(liquid), 0.7f * Time.delta));
|
||||||
if(Mathf.chance(0.2f * Time.delta())){
|
if(Mathf.chance(0.2f * Time.delta)){
|
||||||
Fx.steam.at(fx, fy);
|
Fx.steam.at(fx, fy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -539,6 +539,10 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
return base();
|
return base();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public @Nullable Payload getPayload(){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/** Tries to take the payload. Returns null if no payload is present. */
|
/** Tries to take the payload. Returns null if no payload is present. */
|
||||||
public @Nullable Payload takePayload(){
|
public @Nullable Payload takePayload(){
|
||||||
return null;
|
return null;
|
||||||
@@ -793,7 +797,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
int range = 10;
|
int range = 10;
|
||||||
tempTiles.clear();
|
tempTiles.clear();
|
||||||
Geometry.circle(tileX(), tileY(), range, (x, y) -> {
|
Geometry.circle(tileX(), tileY(), range, (x, y) -> {
|
||||||
Building other = world.ent(x, y);
|
Building other = world.build(x, y);
|
||||||
if(other != null && other.block instanceof PowerNode && ((PowerNode)other.block).linkValid(other, base()) && !PowerNode.insulated(other, base())
|
if(other != null && other.block instanceof PowerNode && ((PowerNode)other.block).linkValid(other, base()) && !PowerNode.insulated(other, base())
|
||||||
&& !other.proximity().contains(this.<Building>base()) &&
|
&& !other.proximity().contains(this.<Building>base()) &&
|
||||||
!(block.outputsPower && proximity.contains(p -> p.power() != null && p.power().graph == other.power().graph))){
|
!(block.outputsPower && proximity.contains(p -> p.power() != null && p.power().graph == other.power().graph))){
|
||||||
@@ -922,60 +926,63 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
|
|
||||||
table.row();
|
table.row();
|
||||||
|
|
||||||
table.table(bars -> {
|
//only display everything else if the team is the same
|
||||||
bars.defaults().growX().height(18f).pad(4);
|
if(team == player.team()){
|
||||||
|
table.table(bars -> {
|
||||||
|
bars.defaults().growX().height(18f).pad(4);
|
||||||
|
|
||||||
displayBars(bars);
|
displayBars(bars);
|
||||||
}).growX();
|
}).growX();
|
||||||
table.row();
|
table.row();
|
||||||
table.table(this::displayConsumption).growX();
|
table.table(this::displayConsumption).growX();
|
||||||
|
|
||||||
boolean displayFlow = (block.category == Category.distribution || block.category == Category.liquid) && Core.settings.getBool("flow");
|
boolean displayFlow = (block.category == Category.distribution || block.category == Category.liquid) && Core.settings.getBool("flow");
|
||||||
|
|
||||||
if(displayFlow){
|
if(displayFlow){
|
||||||
String ps = " " + StatUnit.perSecond.localized();
|
String ps = " " + StatUnit.perSecond.localized();
|
||||||
|
|
||||||
if(items != null){
|
if(items != null){
|
||||||
table.row();
|
table.row();
|
||||||
table.left();
|
table.left();
|
||||||
table.table(l -> {
|
table.table(l -> {
|
||||||
Bits current = new Bits();
|
Bits current = new Bits();
|
||||||
|
|
||||||
Runnable rebuild = () -> {
|
Runnable rebuild = () -> {
|
||||||
l.clearChildren();
|
l.clearChildren();
|
||||||
|
l.left();
|
||||||
|
for(Item item : content.items()){
|
||||||
|
if(items.hasFlowItem(item)){
|
||||||
|
l.image(item.icon(Cicon.small)).padRight(3f);
|
||||||
|
l.label(() -> items.getFlowRate(item) < 0 ? "..." : Strings.fixed(items.getFlowRate(item), 1) + ps).color(Color.lightGray);
|
||||||
|
l.row();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
rebuild.run();
|
||||||
|
l.update(() -> {
|
||||||
|
for(Item item : content.items()){
|
||||||
|
if(items.hasFlowItem(item) && !current.get(item.id)){
|
||||||
|
current.set(item.id);
|
||||||
|
rebuild.run();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}).left();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(liquids != null){
|
||||||
|
table.row();
|
||||||
|
table.table(l -> {
|
||||||
l.left();
|
l.left();
|
||||||
for(Item item : content.items()){
|
l.image(() -> liquids.current().icon(Cicon.small)).padRight(3f);
|
||||||
if(items.hasFlowItem(item)){
|
l.label(() -> liquids.getFlowRate() < 0 ? "..." : Strings.fixed(liquids.getFlowRate(), 2) + ps).color(Color.lightGray);
|
||||||
l.image(item.icon(Cicon.small)).padRight(3f);
|
}).left();
|
||||||
l.label(() -> items.getFlowRate(item) < 0 ? "..." : Strings.fixed(items.getFlowRate(item), 1) + ps).color(Color.lightGray);
|
}
|
||||||
l.row();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
rebuild.run();
|
|
||||||
l.update(() -> {
|
|
||||||
for(Item item : content.items()){
|
|
||||||
if(items.hasFlowItem(item) && !current.get(item.id)){
|
|
||||||
current.set(item.id);
|
|
||||||
rebuild.run();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}).left();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(liquids != null){
|
table.marginBottom(-5);
|
||||||
table.row();
|
|
||||||
table.table(l -> {
|
|
||||||
l.left();
|
|
||||||
l.image(() -> liquids.current().icon(Cicon.small)).padRight(3f);
|
|
||||||
l.label(() -> liquids.getFlowRate() < 0 ? "..." : Strings.fixed(liquids.getFlowRate(), 2) + ps).color(Color.lightGray);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
table.marginBottom(-5);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void displayConsumption(Table table){
|
public void displayConsumption(Table table){
|
||||||
@@ -1061,7 +1068,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
|
|
||||||
Point2[] nearby = Edges.getEdges(block.size);
|
Point2[] nearby = Edges.getEdges(block.size);
|
||||||
for(Point2 point : nearby){
|
for(Point2 point : nearby){
|
||||||
Building other = world.ent(tile.x + point.x, tile.y + point.y);
|
Building other = world.build(tile.x + point.x, tile.y + point.y);
|
||||||
//remove this tile from all nearby tile's proximities
|
//remove this tile from all nearby tile's proximities
|
||||||
if(other != null){
|
if(other != null){
|
||||||
tmpTiles.add(other);
|
tmpTiles.add(other);
|
||||||
@@ -1080,7 +1087,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
|
|
||||||
Point2[] nearby = Edges.getEdges(block.size);
|
Point2[] nearby = Edges.getEdges(block.size);
|
||||||
for(Point2 point : nearby){
|
for(Point2 point : nearby){
|
||||||
Building other = world.ent(tile.x + point.x, tile.y + point.y);
|
Building other = world.build(tile.x + point.x, tile.y + point.y);
|
||||||
|
|
||||||
if(other == null || !(other.tile.interactable(team))) continue;
|
if(other == null || !(other.tile.interactable(team))) continue;
|
||||||
|
|
||||||
@@ -1171,7 +1178,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
|
|||||||
@Final
|
@Final
|
||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
timeScaleDuration -= Time.delta();
|
timeScaleDuration -= Time.delta;
|
||||||
if(timeScaleDuration <= 0f || !block.canOverdrive){
|
if(timeScaleDuration <= 0f || !block.canOverdrive){
|
||||||
timeScale = 1f;
|
timeScale = 1f;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ abstract class BulletComp implements Timedc, Damagec, Hitboxc, Teamc, Posc, Draw
|
|||||||
if(type.collidesTiles && type.collides && type.collidesGround){
|
if(type.collidesTiles && type.collides && type.collidesGround){
|
||||||
world.raycastEach(world.toTile(lastX()), world.toTile(lastY()), tileX(), tileY(), (x, y) -> {
|
world.raycastEach(world.toTile(lastX()), world.toTile(lastY()), tileX(), tileY(), (x, y) -> {
|
||||||
|
|
||||||
Building tile = world.ent(x, y);
|
Building tile = world.build(x, y);
|
||||||
if(tile == null) return false;
|
if(tile == null) return false;
|
||||||
|
|
||||||
if(tile.collide(base()) && type.collides(base(), tile) && !tile.dead() && (type.collidesTeam || tile.team != team)){
|
if(tile.collide(base()) && type.collides(base(), tile) && !tile.dead() && (type.collidesTeam || tile.team != team)){
|
||||||
|
|||||||
@@ -26,19 +26,19 @@ abstract class FireComp implements Timedc, Posc, Firec{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
if(Mathf.chance(0.1 * Time.delta())){
|
if(Mathf.chance(0.1 * Time.delta)){
|
||||||
Fx.fire.at(x + Mathf.range(4f), y + Mathf.range(4f));
|
Fx.fire.at(x + Mathf.range(4f), y + Mathf.range(4f));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Mathf.chance(0.05 * Time.delta())){
|
if(Mathf.chance(0.05 * Time.delta)){
|
||||||
Fx.fireSmoke.at(x + Mathf.range(4f), y + Mathf.range(4f));
|
Fx.fireSmoke.at(x + Mathf.range(4f), y + Mathf.range(4f));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Mathf.chance(0.001 * Time.delta())){
|
if(Mathf.chance(0.001 * Time.delta)){
|
||||||
Sounds.fire.at(this);
|
Sounds.fire.at(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
time = Mathf.clamp(time + Time.delta(), 0, lifetime());
|
time = Mathf.clamp(time + Time.delta, 0, lifetime());
|
||||||
|
|
||||||
if(Vars.net.client()){
|
if(Vars.net.client()){
|
||||||
return;
|
return;
|
||||||
@@ -55,7 +55,7 @@ abstract class FireComp implements Timedc, Posc, Firec{
|
|||||||
float flammability = baseFlammability + puddleFlammability;
|
float flammability = baseFlammability + puddleFlammability;
|
||||||
|
|
||||||
if(!damage && flammability <= 0){
|
if(!damage && flammability <= 0){
|
||||||
time += Time.delta() * 8;
|
time += Time.delta * 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(baseFlammability < 0 || block != tile.block()){
|
if(baseFlammability < 0 || block != tile.block()){
|
||||||
@@ -64,20 +64,20 @@ abstract class FireComp implements Timedc, Posc, Firec{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(damage){
|
if(damage){
|
||||||
lifetime += Mathf.clamp(flammability / 8f, 0f, 0.6f) * Time.delta();
|
lifetime += Mathf.clamp(flammability / 8f, 0f, 0.6f) * Time.delta;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flammability > 1f && Mathf.chance(spreadChance * Time.delta() * Mathf.clamp(flammability / 5f, 0.3f, 2f))){
|
if(flammability > 1f && Mathf.chance(spreadChance * Time.delta * Mathf.clamp(flammability / 5f, 0.3f, 2f))){
|
||||||
Point2 p = Geometry.d4[Mathf.random(3)];
|
Point2 p = Geometry.d4[Mathf.random(3)];
|
||||||
Tile other = world.tile(tile.x + p.x, tile.y + p.y);
|
Tile other = world.tile(tile.x + p.x, tile.y + p.y);
|
||||||
Fires.create(other);
|
Fires.create(other);
|
||||||
|
|
||||||
if(Mathf.chance(fireballChance * Time.delta() * Mathf.clamp(flammability / 10f))){
|
if(Mathf.chance(fireballChance * Time.delta * Mathf.clamp(flammability / 10f))){
|
||||||
Bullets.fireball.createNet(Team.derelict, x, y, Mathf.random(360f), -1f, 1, 1);
|
Bullets.fireball.createNet(Team.derelict, x, y, Mathf.random(360f), -1f, 1, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Mathf.chance(0.1 * Time.delta())){
|
if(Mathf.chance(0.1 * Time.delta)){
|
||||||
Puddlec p = Puddles.get(tile);
|
Puddlec p = Puddles.get(tile);
|
||||||
puddleFlammability = p != null ? p.getFlammability() / 3f : 0;
|
puddleFlammability = p != null ? p.getFlammability() / 3f : 0;
|
||||||
|
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void wobble(){
|
void wobble(){
|
||||||
x += Mathf.sin(Time.time() + id() * 99, 25f, 0.05f) * Time.delta() * elevation;
|
x += Mathf.sin(Time.time() + id() * 99, 25f, 0.05f) * Time.delta * elevation;
|
||||||
y += Mathf.cos(Time.time() + id() * 99, 25f, 0.05f) * Time.delta() * elevation;
|
y += Mathf.cos(Time.time() + id() * 99, 25f, 0.05f) * Time.delta * elevation;
|
||||||
}
|
}
|
||||||
|
|
||||||
void moveAt(Vec2 vector, float acceleration){
|
void moveAt(Vec2 vector, float acceleration){
|
||||||
@@ -81,7 +81,7 @@ abstract class FlyingComp implements Posc, Velc, Healthc, Hitboxc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(canDrown() && floor.isLiquid && floor.drownTime > 0){
|
if(canDrown() && floor.isLiquid && floor.drownTime > 0){
|
||||||
drownTime += Time.delta() * 1f / floor.drownTime;
|
drownTime += Time.delta * 1f / floor.drownTime;
|
||||||
drownTime = Mathf.clamp(drownTime);
|
drownTime = Mathf.clamp(drownTime);
|
||||||
if(Mathf.chanceDelta(0.05f)){
|
if(Mathf.chanceDelta(0.05f)){
|
||||||
floor.drownUpdateEffect.at(x, y, 1f, floor.mapColor);
|
floor.drownUpdateEffect.at(x, y, 1f, floor.mapColor);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ abstract class HealthComp implements Entityc{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
hitTime -= Time.delta() / hitDuration;
|
hitTime -= Time.delta / hitDuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
void killed(){
|
void killed(){
|
||||||
@@ -82,11 +82,11 @@ abstract class HealthComp implements Entityc{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void damageContinuous(float amount){
|
void damageContinuous(float amount){
|
||||||
damage(amount * Time.delta(), hitTime <= -10 + hitDuration);
|
damage(amount * Time.delta, hitTime <= -10 + hitDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
void damageContinuousPierce(float amount){
|
void damageContinuousPierce(float amount){
|
||||||
damagePierce(amount * Time.delta(), hitTime <= -20 + hitDuration);
|
damagePierce(amount * Time.delta, hitTime <= -20 + hitDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
void clampHealth(){
|
void clampHealth(){
|
||||||
|
|||||||
@@ -14,6 +14,6 @@ abstract class MechComp implements Posc, Flyingc, Hitboxc, Unitc, Mechc, Elevati
|
|||||||
public void update(){
|
public void update(){
|
||||||
float len = deltaLen();
|
float len = deltaLen();
|
||||||
baseRotation = Angles.moveToward(baseRotation, deltaAngle(), type().baseRotateSpeed * Mathf.clamp(len / type().speed));
|
baseRotation = Angles.moveToward(baseRotation, deltaAngle(), type().baseRotateSpeed * Mathf.clamp(len / type().speed));
|
||||||
walkTime += Time.delta()*len;
|
walkTime += Time.delta *len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc, Unitc{
|
|||||||
}else{
|
}else{
|
||||||
Item item = mineTile.drop();
|
Item item = mineTile.drop();
|
||||||
rotation(Mathf.slerpDelta(rotation(), angleTo(mineTile.worldx(), mineTile.worldy()), 0.4f));
|
rotation(Mathf.slerpDelta(rotation(), angleTo(mineTile.worldx(), mineTile.worldy()), 0.4f));
|
||||||
mineTimer += Time.delta()*type.mineSpeed;
|
mineTimer += Time.delta *type.mineSpeed;
|
||||||
|
|
||||||
if(mineTimer >= 50f + item.hardness*10f){
|
if(mineTimer >= 50f + item.hardness*10f){
|
||||||
mineTimer = 0;
|
mineTimer = 0;
|
||||||
@@ -76,7 +76,7 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc, Unitc{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Mathf.chance(0.06 * Time.delta())){
|
if(Mathf.chance(0.06 * Time.delta)){
|
||||||
Fx.pulverizeSmall.at(mineTile.worldx() + Mathf.range(tilesize / 2f), mineTile.worldy() + Mathf.range(tilesize / 2f), 0f, item.color);
|
Fx.pulverizeSmall.at(mineTile.worldx() + Mathf.range(tilesize / 2f), mineTile.worldy() + Mathf.range(tilesize / 2f), 0f, item.color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import mindustry.world.blocks.payloads.*;
|
|||||||
|
|
||||||
/** An entity that holds a payload. */
|
/** An entity that holds a payload. */
|
||||||
@Component
|
@Component
|
||||||
abstract class PayloadComp implements Posc, Rotc{
|
abstract class PayloadComp implements Posc, Rotc, Hitboxc{
|
||||||
@Import float x, y, rotation;
|
@Import float x, y, rotation;
|
||||||
|
|
||||||
Seq<Payload> payloads = new Seq<>();
|
Seq<Payload> payloads = new Seq<>();
|
||||||
@@ -87,7 +87,7 @@ abstract class PayloadComp implements Posc, Rotc{
|
|||||||
/** @return whether the tile has been successfully placed. */
|
/** @return whether the tile has been successfully placed. */
|
||||||
boolean dropBlock(BlockPayload payload){
|
boolean dropBlock(BlockPayload payload){
|
||||||
Building tile = payload.entity;
|
Building tile = payload.entity;
|
||||||
int tx = Vars.world.toTile(x - tile.block().offset()), ty = Vars.world.toTile(y - tile.block().offset());
|
int tx = Vars.world.toTile(x - tile.block().offset), ty = Vars.world.toTile(y - tile.block().offset);
|
||||||
Tile on = Vars.world.tile(tx, ty);
|
Tile on = Vars.world.tile(tx, ty);
|
||||||
if(on != null && Build.validPlace(tile.block(), tile.team(), tx, ty, tile.rotation())){
|
if(on != null && Build.validPlace(tile.block(), tile.team(), tx, ty, tile.rotation())){
|
||||||
int rot = (int)((rotation + 45f) / 90f) % 4;
|
int rot = (int)((rotation + 45f) / 90f) % 4;
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Dra
|
|||||||
}else if(core != null){
|
}else if(core != null){
|
||||||
//have a small delay before death to prevent the camera from jumping around too quickly
|
//have a small delay before death to prevent the camera from jumping around too quickly
|
||||||
//(this is not for balance)
|
//(this is not for balance)
|
||||||
deathTimer += Time.delta();
|
deathTimer += Time.delta;
|
||||||
if(deathTimer >= deathDelay){
|
if(deathTimer >= deathDelay){
|
||||||
//request spawn - this happens serverside only
|
//request spawn - this happens serverside only
|
||||||
core.requestSpawn(base());
|
core.requestSpawn(base());
|
||||||
@@ -127,7 +127,7 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Dra
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
textFadeTime -= Time.delta() / (60 * 5);
|
textFadeTime -= Time.delta / (60 * 5);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,13 +43,13 @@ abstract class PuddleComp implements Posc, Puddlec, Drawc{
|
|||||||
//update code
|
//update code
|
||||||
float addSpeed = accepting > 0 ? 3f : 0f;
|
float addSpeed = accepting > 0 ? 3f : 0f;
|
||||||
|
|
||||||
amount -= Time.delta() * (1f - liquid.viscosity) / (5f + addSpeed);
|
amount -= Time.delta * (1f - liquid.viscosity) / (5f + addSpeed);
|
||||||
|
|
||||||
amount += accepting;
|
amount += accepting;
|
||||||
accepting = 0f;
|
accepting = 0f;
|
||||||
|
|
||||||
if(amount >= maxLiquid / 1.5f && generation < maxGeneration){
|
if(amount >= maxLiquid / 1.5f && generation < maxGeneration){
|
||||||
float deposited = Math.min((amount - maxLiquid / 1.5f) / 4f, 0.3f) * Time.delta();
|
float deposited = Math.min((amount - maxLiquid / 1.5f) / 4f, 0.3f) * Time.delta;
|
||||||
for(Point2 point : Geometry.d4){
|
for(Point2 point : Geometry.d4){
|
||||||
Tile other = world.tile(tile.x + point.x, tile.y + point.y);
|
Tile other = world.tile(tile.x + point.x, tile.y + point.y);
|
||||||
if(other != null && other.block() == Blocks.air){
|
if(other != null && other.block() == Blocks.air){
|
||||||
@@ -87,7 +87,7 @@ abstract class PuddleComp implements Posc, Puddlec, Drawc{
|
|||||||
updateTime = 40f;
|
updateTime = 40f;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateTime -= Time.delta();
|
updateTime -= Time.delta;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ abstract class ShieldComp implements Healthc, Posc{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
shieldAlpha -= Time.delta() / 15f;
|
shieldAlpha -= Time.delta / 15f;
|
||||||
if(shieldAlpha < 0) shieldAlpha = 0f;
|
if(shieldAlpha < 0) shieldAlpha = 0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ abstract class StatusComp implements Posc, Flyingc{
|
|||||||
while(index < statuses.size){
|
while(index < statuses.size){
|
||||||
StatusEntry entry = statuses.get(index++);
|
StatusEntry entry = statuses.get(index++);
|
||||||
|
|
||||||
entry.time = Math.max(entry.time - Time.delta(), 0);
|
entry.time = Math.max(entry.time - Time.delta, 0);
|
||||||
applied.set(entry.effect.id);
|
applied.set(entry.effect.id);
|
||||||
|
|
||||||
if(entry.time <= 0 && !entry.effect.permanent){
|
if(entry.time <= 0 && !entry.effect.permanent){
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ abstract class TimedComp implements Entityc, Scaled{
|
|||||||
@MethodPriority(100)
|
@MethodPriority(100)
|
||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
time = Math.min(time + Time.delta(), lifetime);
|
time = Math.min(time + Time.delta, lifetime);
|
||||||
|
|
||||||
if(time >= lifetime){
|
if(time >= lifetime){
|
||||||
remove();
|
remove();
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
|
|
||||||
private UnitController controller;
|
private UnitController controller;
|
||||||
private UnitType type;
|
private UnitType type;
|
||||||
boolean spawnedByCore;
|
boolean spawnedByCore, deactivated;
|
||||||
|
|
||||||
transient float timer1, timer2;
|
transient float timer1, timer2;
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void lookAt(float angle){
|
public void lookAt(float angle){
|
||||||
rotation = Angles.moveToward(rotation, angle, type.rotateSpeed * Time.delta());
|
rotation = Angles.moveToward(rotation, angle, type.rotateSpeed * Time.delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void lookAt(Position pos){
|
public void lookAt(Position pos){
|
||||||
@@ -118,6 +118,14 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
return controller instanceof AIController;
|
return controller instanceof AIController;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int count(){
|
||||||
|
return teamIndex.countType(team, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int cap(){
|
||||||
|
return Units.getCap(team);
|
||||||
|
}
|
||||||
|
|
||||||
private void setStats(UnitType type){
|
private void setStats(UnitType type){
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.maxHealth = type.health;
|
this.maxHealth = type.health;
|
||||||
@@ -147,12 +155,19 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void add(){
|
public void add(){
|
||||||
teamIndex.updateCount(team, 1);
|
teamIndex.updateCount(team, type, 1);
|
||||||
|
|
||||||
|
//check if over unit cap
|
||||||
|
if(count() > cap() && !spawnedByCore){
|
||||||
|
deactivated = true;
|
||||||
|
}else{
|
||||||
|
teamIndex.updateActiveCount(team, type, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void remove(){
|
public void remove(){
|
||||||
teamIndex.updateCount(team, -1);
|
teamIndex.updateCount(team, type, -1);
|
||||||
controller.removed(base());
|
controller.removed(base());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,7 +182,13 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
type.update(base());
|
//activate the unit when possible
|
||||||
|
if(!net.client() && deactivated && teamIndex.countActive(team, type) < Units.getCap(team)){
|
||||||
|
teamIndex.updateActiveCount(team, type, 1);
|
||||||
|
deactivated = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!deactivated) type.update(base());
|
||||||
|
|
||||||
drag = type.drag * (isGrounded() ? (floorOn().dragMultiplier) : 1f);
|
drag = type.drag * (isGrounded() ? (floorOn().dragMultiplier) : 1f);
|
||||||
|
|
||||||
@@ -176,7 +197,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
float relativeSize = state.rules.dropZoneRadius + bounds()/2f + 1f;
|
float relativeSize = state.rules.dropZoneRadius + bounds()/2f + 1f;
|
||||||
for(Tile spawn : spawner.getSpawns()){
|
for(Tile spawn : spawner.getSpawns()){
|
||||||
if(within(spawn.worldx(), spawn.worldy(), relativeSize)){
|
if(within(spawn.worldx(), spawn.worldy(), relativeSize)){
|
||||||
vel().add(Tmp.v1.set(this).sub(spawn.worldx(), spawn.worldy()).setLength(0.1f + 1f - dst(spawn) / relativeSize).scl(0.45f * Time.delta()));
|
vel().add(Tmp.v1.set(this).sub(spawn.worldx(), spawn.worldy()).setLength(0.1f + 1f - dst(spawn) / relativeSize).scl(0.45f * Time.delta));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -204,7 +225,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
}
|
}
|
||||||
|
|
||||||
//move down
|
//move down
|
||||||
elevation -= type.fallSpeed * Time.delta();
|
elevation -= type.fallSpeed * Time.delta;
|
||||||
|
|
||||||
if(isGrounded()){
|
if(isGrounded()){
|
||||||
destroy();
|
destroy();
|
||||||
@@ -227,10 +248,15 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
}
|
}
|
||||||
|
|
||||||
//AI only updates on the server
|
//AI only updates on the server
|
||||||
if(!net.client() && !dead){
|
if(!net.client() && !dead && !deactivated){
|
||||||
controller.updateUnit();
|
controller.updateUnit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//do not control anything when deactivated
|
||||||
|
if(deactivated){
|
||||||
|
controlWeapons(false, false);
|
||||||
|
}
|
||||||
|
|
||||||
//remove units spawned by the core
|
//remove units spawned by the core
|
||||||
if(spawnedByCore && !isPlayer()){
|
if(spawnedByCore && !isPlayer()){
|
||||||
Call.unitDespawn(base());
|
Call.unitDespawn(base());
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ abstract class VelComp implements Posc{
|
|||||||
@MethodPriority(-1)
|
@MethodPriority(-1)
|
||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
move(vel.x * Time.delta(), vel.y * Time.delta());
|
move(vel.x * Time.delta, vel.y * Time.delta);
|
||||||
vel.scl(1f - drag * Time.delta());
|
vel.scl(1f - drag * Time.delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean moving(){
|
boolean moving(){
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ abstract class WaterMoveComp implements Posc, Velc, Hitboxc, Flyingc, Unitc{
|
|||||||
|
|
||||||
Floor floor = floorOn();
|
Floor floor = floorOn();
|
||||||
Color color = Tmp.c1.set(floor.mapColor).mul(1.5f);
|
Color color = Tmp.c1.set(floor.mapColor).mul(1.5f);
|
||||||
trailColor.lerp(color, Mathf.clamp(Time.delta() * 0.04f));
|
trailColor.lerp(color, Mathf.clamp(Time.delta * 0.04f));
|
||||||
|
|
||||||
tleft.draw(trailColor, type.trailScl);
|
tleft.draw(trailColor, type.trailScl);
|
||||||
tright.draw(trailColor, type.trailScl);
|
tright.draw(trailColor, type.trailScl);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ abstract class WeaponsComp implements Teamc, Posc, Rotc{
|
|||||||
@ReadOnly transient float range, aimX, aimY;
|
@ReadOnly transient float range, aimX, aimY;
|
||||||
@ReadOnly transient boolean isRotate;
|
@ReadOnly transient boolean isRotate;
|
||||||
boolean isShooting;
|
boolean isShooting;
|
||||||
int ammo;
|
float ammo;
|
||||||
|
|
||||||
void setWeaponRotation(float rotation){
|
void setWeaponRotation(float rotation){
|
||||||
for(WeaponMount mount : mounts){
|
for(WeaponMount mount : mounts){
|
||||||
@@ -47,6 +47,10 @@ abstract class WeaponsComp implements Teamc, Posc, Rotc{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void controlWeapons(boolean rotateShoot){
|
||||||
|
controlWeapons(rotateShoot, rotateShoot);
|
||||||
|
}
|
||||||
|
|
||||||
void controlWeapons(boolean rotate, boolean shoot){
|
void controlWeapons(boolean rotate, boolean shoot){
|
||||||
for(WeaponMount mount : mounts){
|
for(WeaponMount mount : mounts){
|
||||||
mount.rotate = rotate;
|
mount.rotate = rotate;
|
||||||
@@ -82,11 +86,11 @@ abstract class WeaponsComp implements Teamc, Posc, Rotc{
|
|||||||
public void update(){
|
public void update(){
|
||||||
for(WeaponMount mount : mounts){
|
for(WeaponMount mount : mounts){
|
||||||
Weapon weapon = mount.weapon;
|
Weapon weapon = mount.weapon;
|
||||||
mount.reload = Math.max(mount.reload - Time.delta() * reloadMultiplier, 0);
|
mount.reload = Math.max(mount.reload - Time.delta * reloadMultiplier, 0);
|
||||||
|
|
||||||
//flip weapon shoot side for alternating weapons at half reload
|
//flip weapon shoot side for alternating weapons at half reload
|
||||||
if(weapon.otherSide != -1 && weapon.alternate && mount.side == weapon.flipSprite &&
|
if(weapon.otherSide != -1 && weapon.alternate && mount.side == weapon.flipSprite &&
|
||||||
mount.reload + Time.delta() > weapon.reload/2f && mount.reload <= weapon.reload/2f){
|
mount.reload + Time.delta > weapon.reload/2f && mount.reload <= weapon.reload/2f){
|
||||||
mounts[weapon.otherSide].side = !mounts[weapon.otherSide].side;
|
mounts[weapon.otherSide].side = !mounts[weapon.otherSide].side;
|
||||||
mount.side = !mount.side;
|
mount.side = !mount.side;
|
||||||
}
|
}
|
||||||
@@ -97,7 +101,7 @@ abstract class WeaponsComp implements Teamc, Posc, Rotc{
|
|||||||
axisY = this.y + Angles.trnsy(rotation - 90, weapon.x, weapon.y);
|
axisY = this.y + Angles.trnsy(rotation - 90, weapon.x, weapon.y);
|
||||||
|
|
||||||
mount.targetRotation = Angles.angle(axisX, axisY, mount.aimX, mount.aimY) - rotation;
|
mount.targetRotation = Angles.angle(axisX, axisY, mount.aimX, mount.aimY) - rotation;
|
||||||
mount.rotation = Angles.moveToward(mount.rotation, mount.targetRotation, weapon.rotateSpeed * Time.delta());
|
mount.rotation = Angles.moveToward(mount.rotation, mount.targetRotation, weapon.rotateSpeed * Time.delta);
|
||||||
}else{
|
}else{
|
||||||
mount.rotation = 0;
|
mount.rotation = 0;
|
||||||
mount.targetRotation = angleTo(mount.aimX, mount.aimY);
|
mount.targetRotation = angleTo(mount.aimX, mount.aimY);
|
||||||
|
|||||||
@@ -117,11 +117,11 @@ public class BuildPlan{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public float drawx(){
|
public float drawx(){
|
||||||
return x*tilesize + block.offset();
|
return x*tilesize + block.offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float drawy(){
|
public float drawy(){
|
||||||
return y*tilesize + block.offset();
|
return y*tilesize + block.offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BuildPlan configure(Object config){
|
public BuildPlan configure(Object config){
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ public class Saves{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(state.isGame() && !state.gameOver && current != null && current.isAutosave() && !state.rules.tutorial){
|
if(state.isGame() && !state.gameOver && current != null && current.isAutosave() && !state.rules.tutorial){
|
||||||
time += Time.delta();
|
time += Time.delta;
|
||||||
if(time > Core.settings.getInt("saveinterval") * 60){
|
if(time > Core.settings.getInt("saveinterval") * 60){
|
||||||
saving = true;
|
saving = true;
|
||||||
|
|
||||||
|
|||||||
@@ -345,7 +345,7 @@ public class Schematics implements Loadable{
|
|||||||
boolean found = false;
|
boolean found = false;
|
||||||
for(int cx = x; cx <= x2; cx++){
|
for(int cx = x; cx <= x2; cx++){
|
||||||
for(int cy = y; cy <= y2; cy++){
|
for(int cy = y; cy <= y2; cy++){
|
||||||
Building linked = world.ent(cx, cy);
|
Building linked = world.build(cx, cy);
|
||||||
|
|
||||||
if(linked != null &&linked.block().isVisible() && !(linked.block() instanceof BuildBlock)){
|
if(linked != null &&linked.block().isVisible() && !(linked.block() instanceof BuildBlock)){
|
||||||
int top = linked.block().size/2;
|
int top = linked.block().size/2;
|
||||||
@@ -373,7 +373,7 @@ public class Schematics implements Loadable{
|
|||||||
IntSet counted = new IntSet();
|
IntSet counted = new IntSet();
|
||||||
for(int cx = ox; cx <= ox2; cx++){
|
for(int cx = ox; cx <= ox2; cx++){
|
||||||
for(int cy = oy; cy <= oy2; cy++){
|
for(int cy = oy; cy <= oy2; cy++){
|
||||||
Building tile = world.ent(cx, cy);
|
Building tile = world.build(cx, cy);
|
||||||
|
|
||||||
if(tile != null && !counted.contains(tile.pos()) && !(tile.block() instanceof BuildBlock)
|
if(tile != null && !counted.contains(tile.pos()) && !(tile.block() instanceof BuildBlock)
|
||||||
&& (tile.block().isVisible() || (tile.block() instanceof CoreBlock))){
|
&& (tile.block().isVisible() || (tile.block() instanceof CoreBlock))){
|
||||||
@@ -601,7 +601,7 @@ public class Schematics implements Loadable{
|
|||||||
});
|
});
|
||||||
|
|
||||||
//rotate actual request, centered on its multiblock position
|
//rotate actual request, centered on its multiblock position
|
||||||
float wx = (req.x - ox) * tilesize + req.block.offset(), wy = (req.y - oy) * tilesize + req.block.offset();
|
float wx = (req.x - ox) * tilesize + req.block.offset, wy = (req.y - oy) * tilesize + req.block.offset;
|
||||||
float x = wx;
|
float x = wx;
|
||||||
if(direction >= 0){
|
if(direction >= 0){
|
||||||
wx = -wy;
|
wx = -wy;
|
||||||
@@ -610,8 +610,8 @@ public class Schematics implements Loadable{
|
|||||||
wx = wy;
|
wx = wy;
|
||||||
wy = -x;
|
wy = -x;
|
||||||
}
|
}
|
||||||
req.x = (short)(world.toTile(wx - req.block.offset()) + ox);
|
req.x = (short)(world.toTile(wx - req.block.offset) + ox);
|
||||||
req.y = (short)(world.toTile(wy - req.block.offset()) + oy);
|
req.y = (short)(world.toTile(wy - req.block.offset) + oy);
|
||||||
req.rotation = (byte)Mathf.mod(req.rotation + direction, 4);
|
req.rotation = (byte)Mathf.mod(req.rotation + direction, 4);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||