mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-06 07:30:35 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
8c33eb32dd
1
.github/workflows/push.yml
vendored
1
.github/workflows/push.yml
vendored
@ -34,6 +34,7 @@ jobs:
|
|||||||
git push
|
git push
|
||||||
fi
|
fi
|
||||||
- name: Update JITpack repo
|
- name: Update JITpack repo
|
||||||
|
if: ${{ github.repository == 'Anuken/Mindustry' }}
|
||||||
run: |
|
run: |
|
||||||
cd ../
|
cd ../
|
||||||
cp -r ./Mindustry ./MindustryJitpack
|
cp -r ./Mindustry ./MindustryJitpack
|
||||||
|
@ -277,9 +277,9 @@ public class RtsAI{
|
|||||||
float extraRadius = 50f;
|
float extraRadius = 50f;
|
||||||
|
|
||||||
for(var turret : Vars.indexer.getEnemy(data.team, BlockFlag.turret)){
|
for(var turret : Vars.indexer.getEnemy(data.team, BlockFlag.turret)){
|
||||||
if(Intersector.distanceSegmentPoint(fromX, fromY, x, y, turret.x, turret.y) <= ((TurretBuild)turret).range() + extraRadius){
|
if(turret instanceof TurretBuild t && Intersector.distanceSegmentPoint(fromX, fromY, x, y, t.x, t.y) <= t.range() + extraRadius){
|
||||||
health[0] += turret.health;
|
health[0] += t.health;
|
||||||
dps[0] += ((TurretBuild)turret).estimateDps();
|
dps[0] += t.estimateDps();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,6 +20,8 @@ public class BuildWeapon extends Weapon{
|
|||||||
|
|
||||||
{
|
{
|
||||||
rotate = true;
|
rotate = true;
|
||||||
|
noAttack = true;
|
||||||
|
predictTarget = false;
|
||||||
bullet = new BulletType();
|
bullet = new BulletType();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,9 +32,7 @@ public class BuildWeapon extends Weapon{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(Unit unit, WeaponMount mount){
|
public void update(Unit unit, WeaponMount mount){
|
||||||
//no
|
|
||||||
mount.shoot = false;
|
mount.shoot = false;
|
||||||
//yes
|
|
||||||
mount.rotate = true;
|
mount.rotate = true;
|
||||||
|
|
||||||
//always aim at build plan
|
//always aim at build plan
|
||||||
|
@ -83,6 +83,11 @@ public class ContinuousLiquidTurret extends ContinuousTurret{
|
|||||||
return ammoTypes.get(liquids.current());
|
return ammoTypes.get(liquids.current());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasAmmo(){
|
||||||
|
return ammoTypes.get(liquids.current()) != null && liquids.currentAmount() >= 1f / ammoTypes.get(liquids.current()).ammoMultiplier;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean acceptItem(Building source, Item item){
|
public boolean acceptItem(Building source, Item item){
|
||||||
return false;
|
return false;
|
||||||
|
@ -50,7 +50,7 @@ public class ImpactReactor extends PowerGenerator{
|
|||||||
public void setBars(){
|
public void setBars(){
|
||||||
super.setBars();
|
super.setBars();
|
||||||
|
|
||||||
addBar("poweroutput", (GeneratorBuild entity) -> new Bar(() ->
|
addBar("power", (GeneratorBuild entity) -> new Bar(() ->
|
||||||
Core.bundle.format("bar.poweroutput",
|
Core.bundle.format("bar.poweroutput",
|
||||||
Strings.fixed(Math.max(entity.getPowerProduction() - consPower.usage, 0) * 60 * entity.timeScale(), 1)),
|
Strings.fixed(Math.max(entity.getPowerProduction() - consPower.usage, 0) * 60 * entity.timeScale(), 1)),
|
||||||
() -> Pal.powerBar,
|
() -> Pal.powerBar,
|
||||||
|
@ -47,7 +47,7 @@ public class PowerGenerator extends PowerDistributor{
|
|||||||
public void setBars(){
|
public void setBars(){
|
||||||
super.setBars();
|
super.setBars();
|
||||||
|
|
||||||
if(hasPower && outputsPower && consPower != null){
|
if(hasPower && outputsPower){
|
||||||
addBar("power", (GeneratorBuild entity) -> new Bar(() ->
|
addBar("power", (GeneratorBuild entity) -> new Bar(() ->
|
||||||
Core.bundle.format("bar.poweroutput",
|
Core.bundle.format("bar.poweroutput",
|
||||||
Strings.fixed(entity.getPowerProduction() * 60 * entity.timeScale(), 1)),
|
Strings.fixed(entity.getPowerProduction() * 60 * entity.timeScale(), 1)),
|
||||||
|
@ -130,15 +130,16 @@ public class CoreBlock extends StorageBlock{
|
|||||||
//in the editor, you can place them anywhere for convenience
|
//in the editor, you can place them anywhere for convenience
|
||||||
if(state.isEditor()) return true;
|
if(state.isEditor()) return true;
|
||||||
|
|
||||||
|
CoreBuild core = team.core();
|
||||||
|
//must have all requirements
|
||||||
|
if(core == null || (!state.rules.infiniteResources && !core.items.has(requirements, state.rules.buildCostMultiplier))) return false;
|
||||||
|
|
||||||
//special floor upon which cores can be placed
|
//special floor upon which cores can be placed
|
||||||
tile.getLinkedTilesAs(this, tempTiles);
|
tile.getLinkedTilesAs(this, tempTiles);
|
||||||
if(!tempTiles.contains(o -> !o.floor().allowCorePlacement)){
|
if(!tempTiles.contains(o -> !o.floor().allowCorePlacement)){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
CoreBuild core = team.core();
|
|
||||||
//must have all requirements
|
|
||||||
if(core == null || (!state.rules.infiniteResources && !core.items.has(requirements, state.rules.buildCostMultiplier))) return false;
|
|
||||||
return tile.block() instanceof CoreBlock && size > tile.block().size;
|
return tile.block() instanceof CoreBlock && size > tile.block().size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user