Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into drone-ai-fix
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/omaloon/OmaloonMod.java
#	src/omaloon/ai/drone/UtilityDroneAI.java
#	src/omaloon/content/OlUnitTypes.java
#	src/omaloon/entities/abilities/DroneAbility.java
  • Loading branch information
Zelaux committed Feb 21, 2025
2 parents ac59316 + e116d60 commit 8e3194f
Show file tree
Hide file tree
Showing 89 changed files with 1,940 additions and 1,895 deletions.
4 changes: 4 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified assets/sprites/units/centurion-base.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/units/centurion-cell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/units/centurion-full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/sprites/units/centurion-outline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/units/centurion-weapon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/sprites/units/centurion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions revisions/MechChainedUnit/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:baseRotation,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}]}
95 changes: 40 additions & 55 deletions src/omaloon/OmaloonMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,48 +16,39 @@
import omaloon.net.*;
import omaloon.ui.*;
import omaloon.ui.dialogs.*;
import omaloon.ui.fragments.*;
import omaloon.utils.*;
import omaloon.world.blocks.environment.*;
import omaloon.world.save.OlDelayedItemTransfer;

import static arc.Core.app;
import static omaloon.core.OlUI.*;

public class OmaloonMod extends Mod{
public static EditorListener editorListener;
public static SafeClearer safeClearer;

public static ShapedEnvPlacerFragment shapedEnvPlacerFragment;
public static CliffFragment cliffFragment;

public static OlInputDialog olInputDialog;
public static OlGameDataDialog olGameDataDialog;
public static OlGameDialog olGameDialog;
public static OlEndDialog olEndDialog;

/**
* Buffer radius increase to take splashRadius into account, increase if necessary.
*/
public static float shieldBuffer = 40f;
public static SafeClearer safeClearer;
public static OlUI ui;
public static EditorListener editorListener;

public OmaloonMod(){
super();
OlCall.registerPackets();
new OlDelayedItemTransfer();
if(!Vars.headless)
editorListener = new EditorListener();

ui = new OlUI(OlBinding.values());

Events.on(EventType.ClientLoadEvent.class, e -> {
StartSplash.build(Vars.ui.menuGroup);
StartSplash.show();
if(!Vars.mobile && !Vars.headless){
shapedEnvPlacerFragment.build(Vars.ui.hudGroup);
cliffFragment.build(Vars.ui.hudGroup);
OlBinding.load();
}
Vars.maps.all().removeAll(map -> {
if(map.mod != null && map.mod.name.equals("omaloon")){
Mods.LoadedMod otherMod = Vars.mods.getMod("test-utils");
return otherMod == null || !otherMod.enabled();
if(map.mod == null || !map.mod.name.equals("omaloon")){
return false;
}
return false;
Mods.LoadedMod otherMod = Vars.mods.getMod("test-utils");
return otherMod == null || !otherMod.enabled();
});
Core.app.addListener(new ApplicationListener(){
@Override
Expand All @@ -78,26 +69,42 @@ public void update(){
OlIcons.load();
OlSettings.load();
EventHints.addHints();
CustomShapePropProcess.instance = new CustomShapePropProcess();
Vars.asyncCore.processes.add(CustomShapePropProcess.instance);
CustomShapePropProcess.create();
safeClearer = new SafeClearer();
});

Events.on(EventType.FileTreeInitEvent.class, e ->
app.post(OlShaders::load)
app.post(OlShaders::load)
);

Events.on(EventType.MusicRegisterEvent.class, e ->
OlMusics.load()
OlMusics.load()
);

Events.on(EventType.DisposeEvent.class, e ->
OlShaders.dispose()
OlShaders.dispose()
);


Log.info("Loaded OmaloonMod constructor.");
}
public static void olLog(String string, Object... args){
Log.infoTag("omaloon", Strings.format(string, args));
}

public static void resetSaves(Planet planet){
planet.sectors.each(sector -> {
if(!sector.hasSave()) return;
sector.save.delete();
sector.save = null;
});
}

public static void resetTree(TechNode root){
root.reset();
root.content.clearUnlock();
root.children.each(OmaloonMod::resetTree);
}

@Override
public void registerServerCommands(CommandHandler handler){
Expand All @@ -112,21 +119,14 @@ public void registerClientCommands(CommandHandler handler){
@Override
public void init(){
super.init();
if(!Vars.headless){
shapedEnvPlacerFragment = new ShapedEnvPlacerFragment();
cliffFragment = new CliffFragment();
olInputDialog = new OlInputDialog();
olGameDataDialog = new OlGameDataDialog();
olGameDialog = new OlGameDialog();
olEndDialog = new OlEndDialog();
Events.on(EventType.SectorCaptureEvent.class, e -> {
if(e.sector.preset == OlSectorPresets.deadValley) olEndDialog.show(Core.scene, Actions.sequence(
IconLoader.loadIcons();
if(Vars.headless) return;
Events.on(EventType.SectorCaptureEvent.class, e -> {
if(e.sector.preset == OlSectorPresets.deadValley) olEndDialog.show(Core.scene, Actions.sequence(
Actions.fadeOut(0),
Actions.fadeIn(1)
));
});
}
IconLoader.loadIcons();
));
});
}

@Override
Expand All @@ -144,19 +144,4 @@ public void loadContent(){
OlSchematics.load();
OlTechTree.load();
}

public static void resetSaves(Planet planet){
planet.sectors.each(sector -> {
if(sector.hasSave()){
sector.save.delete();
sector.save = null;
}
});
}

public static void resetTree(TechNode root){
root.reset();
root.content.clearUnlock();
root.children.each(OmaloonMod::resetTree);
}
}
6 changes: 3 additions & 3 deletions src/omaloon/ai/MillipedeAI.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ public void updateWeapons(){
}

float
mountX = u.x + Angles.trnsx(rotation, weapon.x, weapon.y),
mountY = u.y + Angles.trnsy(rotation, weapon.x, weapon.y);
mountX = u.x + Angles.trnsx(rotation, weapon.x, weapon.y),
mountY = u.y + Angles.trnsy(rotation, weapon.x, weapon.y);

if(unit.type.singleTarget){
mount.target = target;
Expand Down Expand Up @@ -99,7 +99,7 @@ public void updateMovement(){
@Override
public Teamc findTarget(float x, float y, float range, boolean air, boolean ground){
Teamc target = commandTarget != null && commandTarget.within(x, y, range) &&
commandTarget.team() == unit.team && commandTarget.isNull() ? commandTarget : null;
commandTarget.team() == unit.team && commandTarget.isNull() ? commandTarget : null;

return target != null ? target : super.findTarget(x, y, range, air, ground);
}
Expand Down
Loading

0 comments on commit 8e3194f

Please sign in to comment.