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
|
||||
fi
|
||||
- name: Update JITpack repo
|
||||
if: ${{ github.repository == 'Anuken/Mindustry' }}
|
||||
run: |
|
||||
cd ../
|
||||
cp -r ./Mindustry ./MindustryJitpack
|
||||
|
@ -277,9 +277,9 @@ public class RtsAI{
|
||||
float extraRadius = 50f;
|
||||
|
||||
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){
|
||||
health[0] += turret.health;
|
||||
dps[0] += ((TurretBuild)turret).estimateDps();
|
||||
if(turret instanceof TurretBuild t && Intersector.distanceSegmentPoint(fromX, fromY, x, y, t.x, t.y) <= t.range() + extraRadius){
|
||||
health[0] += t.health;
|
||||
dps[0] += t.estimateDps();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,8 @@ public class BuildWeapon extends Weapon{
|
||||
|
||||
{
|
||||
rotate = true;
|
||||
noAttack = true;
|
||||
predictTarget = false;
|
||||
bullet = new BulletType();
|
||||
}
|
||||
|
||||
@ -30,9 +32,7 @@ public class BuildWeapon extends Weapon{
|
||||
|
||||
@Override
|
||||
public void update(Unit unit, WeaponMount mount){
|
||||
//no
|
||||
mount.shoot = false;
|
||||
//yes
|
||||
mount.rotate = true;
|
||||
|
||||
//always aim at build plan
|
||||
|
@ -83,6 +83,11 @@ public class ContinuousLiquidTurret extends ContinuousTurret{
|
||||
return ammoTypes.get(liquids.current());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasAmmo(){
|
||||
return ammoTypes.get(liquids.current()) != null && liquids.currentAmount() >= 1f / ammoTypes.get(liquids.current()).ammoMultiplier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean acceptItem(Building source, Item item){
|
||||
return false;
|
||||
|
@ -50,7 +50,7 @@ public class ImpactReactor extends PowerGenerator{
|
||||
public void setBars(){
|
||||
super.setBars();
|
||||
|
||||
addBar("poweroutput", (GeneratorBuild entity) -> new Bar(() ->
|
||||
addBar("power", (GeneratorBuild entity) -> new Bar(() ->
|
||||
Core.bundle.format("bar.poweroutput",
|
||||
Strings.fixed(Math.max(entity.getPowerProduction() - consPower.usage, 0) * 60 * entity.timeScale(), 1)),
|
||||
() -> Pal.powerBar,
|
||||
|
@ -47,7 +47,7 @@ public class PowerGenerator extends PowerDistributor{
|
||||
public void setBars(){
|
||||
super.setBars();
|
||||
|
||||
if(hasPower && outputsPower && consPower != null){
|
||||
if(hasPower && outputsPower){
|
||||
addBar("power", (GeneratorBuild entity) -> new Bar(() ->
|
||||
Core.bundle.format("bar.poweroutput",
|
||||
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
|
||||
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
|
||||
tile.getLinkedTilesAs(this, tempTiles);
|
||||
if(!tempTiles.contains(o -> !o.floor().allowCorePlacement)){
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user