Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into auto-impl-pressure
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/omaloon/content/OlUnitTypes.java
#	src/omaloon/entities/comp/MillipedeComp.java
#	src/omaloon/world/blocks/defense/BlastTower.java
#	src/omaloon/world/blocks/defense/ConsumeTurret.java
#	src/omaloon/world/blocks/defense/Shelter.java
#	src/omaloon/world/blocks/liquid/PressureLiquidBridge.java
#	src/omaloon/world/blocks/liquid/PressureLiquidConduit.java
#	src/omaloon/world/blocks/liquid/PressureLiquidGauge.java
#	src/omaloon/world/blocks/liquid/PressureLiquidJunction.java
#	src/omaloon/world/blocks/liquid/PressureLiquidPump.java
#	src/omaloon/world/blocks/liquid/PressureLiquidValve.java
#	src/omaloon/world/blocks/production/PressureCrafter.java
#	src/omaloon/world/blocks/production/PressureDrill.java
#	src/omaloon/world/blocks/sandbox/PressureLiquidSource.java
#	src/omaloon/world/interfaces/HasPressure.java
  • Loading branch information
Zelaux committed Feb 6, 2025
2 parents d51ec23 + 17e08f4 commit cd078af
Show file tree
Hide file tree
Showing 18 changed files with 705 additions and 1,968 deletions.
1 change: 1 addition & 0 deletions revisions/ChainedUnit/0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{fields:[{name:abilities,type:"mindustry.entities.abilities.Ability[]"},{name:ammo,type:float},{name:childID,type:int},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:grown,type:boolean},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:parentID,type:int},{name:plans,type:arc.struct.Queue<mindustry.entities.units.BuildPlan>},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq<mindustry.entities.units.StatusEntry>},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:updateBuilding,type:boolean},{name:vel,type:arc.math.geom.Vec2},{name:x,type:float},{name:y,type:float}]}
1 change: 0 additions & 1 deletion revisions/LegsMillipedeUnit/0.json

This file was deleted.

6 changes: 3 additions & 3 deletions src/omaloon/ai/MillipedeAI.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class MillipedeAI extends GroundAI {

@Override
public void updateWeapons() {
if (!(unit instanceof Millipedec millipedec)) return;
if (!(unit instanceof Chainedc millipedec)) return;
if (!millipedec.isHead()) return;

float rotation = unit.rotation - 90;
Expand All @@ -34,7 +34,7 @@ public void updateWeapons() {

unit.isShooting = false;

cast().distributeActionBack(u -> {
cast().consBackwards(u -> {
for(WeaponMount mount : u.mounts){
Weapon weapon = mount.weapon;
float wrange = weapon.range();
Expand Down Expand Up @@ -116,7 +116,7 @@ public void commandTarget(Teamc moveTo) {
this.commandPosition.setZero();
}

public <T extends Unit & Millipedec> T cast() {
public <T extends Unit & Chainedc> T cast() {
return (T) unit;
}
}
90 changes: 38 additions & 52 deletions src/omaloon/content/OlUnitTypes.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class OlUnitTypes {
public static @EntityDef({Unitc.class, Flyingc.class, Ornitopterc.class}) UnitType effort;

// millipede
public static @EntityDef({Unitc.class, Millipedec.class, Legsc.class}) UnitType collector;
public static @EntityDef({Unitc.class, Chainedc.class}) UnitType collector;

// core
public static UnitType discovery;
Expand All @@ -49,69 +49,55 @@ public class OlUnitTypes {

public static void load() {
collector = new MillipedeUnitType("collector"){{
constructor = LegsMillipedeUnit::create;
constructor = ChainedUnit::create;
aiController = MillipedeAI::new;

omniMovement = false;

speed = 0.6f;
health = 200f;
regenTime = 15f * 60f;
chainable = true;

segmentLength = 5;
maxSegments = 20;

splittable = true;
omniMovement = false;

angleLimit = 65f;
segmentLength = 5;
segmentDamageScl = 8f;
segmentCast = 8;
segmentOffset = 7.3f;
maxSegments = 20;
preventDrifting = true;

hidden = true;

legLength = 8f;
lockLegBase = true;
legContinuousMove = true;
legExtension = -2f;
legBaseOffset = 3f;
legMaxLength = 1.1f;
legMinLength = 0.2f;
legLengthScl = 0.96f;
legForwardScl = 0.7f;
legGroupSize = 2;
rippleScale = 0.7f;
headLegCount = segmentLegCount = tailLegCount = 2;

legMoveSpace = 2f;
allowLegStep = true;
hovering = false;
legPhysicsLayer = true;

Seq<Weapon> weaponSeq = Seq.with(
new Weapon("omaloon-collector-beam") {{
x = 0f;
y = 1f;
rotate = true;
mirror = false;
reload = 60f;
bullet = new ArtilleryBulletType(5f, 7) {{
maxRange = 40f;
collidesTiles = collidesAir = collidesGround = true;
width = height = 11f;
splashDamage = 25f;
splashDamageRadius = 25f;
trailColor = hitColor = lightColor = backColor = Pal.thoriumPink;
frontColor = Pal.thoriumPink;
}};
}}
);
segmentWeapons = new Seq[] {
Seq.with(),
weaponSeq, weaponSeq, weaponSeq,
weaponSeq, weaponSeq, weaponSeq,
weaponSeq, weaponSeq, weaponSeq,
weaponSeq, weaponSeq, weaponSeq,
weaponSeq, weaponSeq, weaponSeq,
weaponSeq, weaponSeq, weaponSeq,
Seq.with()
weaponsIndex = unit -> {
if (unit instanceof Chainedc chain) {
if (chain.isHead() || chain.isTail()) return 0;
return 1;
}
return 0;
};
chainWeapons.add(
Seq.with(),
Seq.with(
new Weapon("omaloon-collector-beam") {{
x = 0f;
y = 1f;
rotate = true;
mirror = false;
reload = 60f;
bullet = new ArtilleryBulletType(5f, 7) {{
maxRange = 40f;
collidesTiles = collidesAir = collidesGround = true;
width = height = 11f;
splashDamage = 25f;
splashDamageRadius = 25f;
trailColor = hitColor = lightColor = backColor = Pal.thoriumPink;
frontColor = Pal.thoriumPink;
}};
}}
)
);
}};

//region core
Expand Down
Loading

0 comments on commit cd078af

Please sign in to comment.