Skip to content

Commit

Permalink
shields maye crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Feb 15, 2024
1 parent 5844bac commit 7eb1062
Show file tree
Hide file tree
Showing 42 changed files with 383 additions and 173 deletions.
Binary file modified assets/maps/dawn.msav
Binary file not shown.
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/shields/ceno-big-cannon.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/shields/ceno-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 added assets/sprites/units/shields/ceno-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/shields/ceno-leg-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 added assets/sprites/units/shields/ceno-leg.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/shields/ceno-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 added assets/sprites/units/shields/ceno-shield-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 added assets/sprites/units/shields/ceno-shield.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/shields/ceno-side-cannon.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/shields/ceno.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/shields/meso-cannon-heat.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/shields/meso-cannon-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 added assets/sprites/units/shields/meso-cannon.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/shields/meso-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 added assets/sprites/units/shields/meso-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/shields/meso-leg-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 added assets/sprites/units/shields/meso-leg.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/shields/meso-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 added assets/sprites/units/shields/meso-shield-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 added assets/sprites/units/shields/meso-shield.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/shields/meso.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/shields/paleo-cannon-back.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/shields/paleo-cannon-top.png
Binary file added assets/sprites/units/shields/paleo-cell.png
Binary file added assets/sprites/units/shields/paleo-full.png
Binary file added assets/sprites/units/shields/paleo-leg-base.png
Binary file added assets/sprites/units/shields/paleo-leg.png
Binary file added assets/sprites/units/shields/paleo-outline.png
Binary file added assets/sprites/units/shields/paleo-shield.png
Binary file added assets/sprites/units/shields/paleo.png
Binary file modified atlas.sai2
Binary file not shown.
51 changes: 23 additions & 28 deletions src/sw/ai/ShieldAI.java
Original file line number Diff line number Diff line change
@@ -1,34 +1,29 @@
package sw.ai;

import arc.math.*;
import arc.util.*;
import mindustry.entities.part.*;
import mindustry.entities.units.*;
import sw.gen.*;
import sw.type.*;

public class ShieldAI extends AIController {
public float getRotation() {
if (!(unit instanceof TetherUnitc u) || !(u.tetherUnit() instanceof Shieldedc b) || !(b.type() instanceof SWUnitType type)) return 0f;
if (b.mounts().length > 0) {
WeaponMount first = b.mounts()[0];
DrawPart.params.set(first.warmup, first.reload / b.type().weapons.first().reload, first.smoothReload, first.heat, first.recoil, first.charge, u.x(), u.y(), u.rotation());
} else {
DrawPart.params.set(0, 0, 0, 0, 0, 0, u.x(), u.y(), u.rotation());
}
return Mathf.lerp(
type.shieldStartAng + (b.rotation() - 90 + type.shieldEndAng /(type.shields - 1f) * b.units().indexOf(unit)),
type.shieldShootingStartAng + (b.rotation() - 90 + type.shieldShootingEndAng /(type.shields - 1f) * b.units().indexOf(unit)),
type.shieldProgress.get(DrawPart.params)
);
}

@Override
public void updateMovement() {
if (unit instanceof TetherUnitc u && u.tetherUnit() != null && u.tetherUnit().type() instanceof SWUnitType type) {
Tmp.v1.trns(getRotation(), type.shieldSeparateRadius);
u.set(Tmp.v1.add(u.tetherUnit()));
u.rotation(u.angleTo(u.tetherUnit()) + 180f);
}
}
// public float getRotation() {
// if (!(unit instanceof TetherUnitc u) || !(u.tetherUnit() instanceof Shieldedc b) || !(b.type() instanceof SWUnitType type)) return 0f;
// if (b.mounts().length > 0) {
// WeaponMount first = b.mounts()[0];
// DrawPart.params.set(first.warmup, first.reload / b.type().weapons.first().reload, first.smoothReload, first.heat, first.recoil, first.charge, u.x(), u.y(), u.rotation());
// } else {
// DrawPart.params.set(0, 0, 0, 0, 0, 0, u.x(), u.y(), u.rotation());
// }
// return Mathf.lerp(
// type.shieldStartAng + (b.rotation() - 90 + type.shieldEndAng /(type.shields - 1f) * b.units().indexOf(unit)),
// type.shieldShootingStartAng + (b.rotation() - 90 + type.shieldShootingEndAng /(type.shields - 1f) * b.units().indexOf(unit)),
// type.shieldProgress.get(DrawPart.params)
// );
// }
//
// @Override
// public void updateMovement() {
// if (unit instanceof TetherUnitc u && u.tetherUnit() != null && u.tetherUnit().type() instanceof SWUnitType type) {
// Tmp.v1.trns(getRotation(), type.shieldSeparateRadius);
// u.set(Tmp.v1.add(u.tetherUnit()));
// u.rotation(u.angleTo(u.tetherUnit()) + 180f);
// }
// }
}
Loading

0 comments on commit 7eb1062

Please sign in to comment.