Skip to content

Commit

Permalink
Add clone shenanigans
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterGerrard committed Aug 20, 2024
1 parent 631435c commit 420f974
Show file tree
Hide file tree
Showing 12 changed files with 525 additions and 28 deletions.
4 changes: 3 additions & 1 deletion src/aac/lhw/m1s/Clones.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export const BlackCatClones = () => {
{
jumpSide: pickOne(["Left", "Right"] as const),
storeLocation: storeLocs[1],
}
},
pickOne([true, false]),
pickOne([true, false])
);
},
() =>
Expand Down
2 changes: 1 addition & 1 deletion src/aac/lhw/m1s/getJumpLocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import { Point } from "@flatten-js/core";

export const getJumpLocation = (position: Point, rotation: number, jumpSide: "Left" | "Right") => position
.translate(0, jumpSide === "Left" ? -0.25 : 0.25)
.rotate((Math.PI * rotation) / 180, position);
.rotate(-(Math.PI * rotation) / 180, position);
5 changes: 2 additions & 3 deletions src/aac/lhw/m1s/jumpingOneTwoPaw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
} from "../../../gamestate/Mechanics/DangerPuddles";
import jumpLocPng from "./JumpLocation.png";
import { Tether } from "../../../components/standard-mechanic-elements/Tether";
import { getJumpLocation } from "./getJumpLocation";

const finalPositionMechanic = (
position: Point,
Expand All @@ -41,9 +42,7 @@ export const jumpingOneTwoPaw = (
instant?: boolean
): Mechanic<Player> => {
const rot = rotation + (side === "Left" ? 0 : 180);
const jumpLocation = position
.translate(0, jumpSide === "Left" ? 0.25 : -0.25)
.rotate((Math.PI * rotation) / 180, position);
const jumpLocation = getJumpLocation(position, rotation, jumpSide);
if (instant) {
return oneTwoPawHit1(side, jumpLocation, rotation, character, nextMechanic);
}
Expand Down
7 changes: 3 additions & 4 deletions src/aac/lhw/m1s/jumpingQuadrupleCrossing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export const jumpingQuadrupleCrossing = (
character: (position: Point, rotation: number) => React.ReactElement
): Mechanic<Player> => {
const jumpLocation = getJumpLocation(position, rotation, jumpSide);

return {
applyDamage: () => ZeroDamage,
display: () => (
Expand Down Expand Up @@ -158,7 +159,7 @@ const jumpingQuadrupleCrossingBait1 = (
.sort((p1, p2) => distanceTo(position, p1) - distanceTo(position, p2))
.slice(0, 4)
.map((p) =>
vector(position, position.translate(0, 1)).angleTo(vector(position, p))
vector(1, 0).angleTo(vector(p.x - position.x, p.y - position.y))
);

return sequence2(
Expand Down Expand Up @@ -199,9 +200,7 @@ const jumpingQuadrupleCrossingBait2 = (
.map((p) => p.position)
.sort((p1, p2) => distanceTo(position, p1) - distanceTo(position, p2))
.slice(0, 4)
.map((p) =>
vector(position, position.translate(0, 1)).angleTo(vector(position, p))
);
.map((p) => vector(0, 1).angleTo(vector(position, p)));

return sequence2(
withSafeSpot(
Expand Down
14 changes: 12 additions & 2 deletions src/aac/lhw/m1s/shenanigans/jump1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ export const shenanigans1Jump = (
jump2: {
jumpSide: "Left" | "Right";
storeLocation: "North" | "South";
}
},
tearFirst: boolean,
nailchipperDpsFirst: boolean
) => {
return jumpingOneTwoPaw(
jump1.jumpSide,
Expand All @@ -21,6 +23,14 @@ export const shenanigans1Jump = (
90,
(pos, rot) => <BlackCat position={pos} rotation={rot} />,
(p) =>
shenanigansStore1(jump1.jumpSide, jump1.swipeSide, jump1.storeLocation, p, jump2)
shenanigansStore1(
jump1.jumpSide,
jump1.swipeSide,
jump1.storeLocation,
p,
jump2,
tearFirst,
nailchipperDpsFirst
)
);
};
10 changes: 7 additions & 3 deletions src/aac/lhw/m1s/shenanigans/jump2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ export const shenanigansJump2 = (
jump2: {
jumpSide: "Left" | "Right";
storeLocation: "North" | "South";
}
},
tearFirst: boolean,
nailchipperDpsFirst: boolean
): Mechanic<Player> => {
const bossRot = store1.jumpSide === "Left" ? 180 : 0;
const bossRot = store1.jumpSide === "Left" ? 0 : 180;

return sequence2(
withBackgroundMechanic(
Expand All @@ -43,7 +45,9 @@ export const shenanigansJump2 = (
shenanigansStore2(
jump2.jumpSide,
getJumpLocation(bossPosition, bossRot, jump2.jumpSide),
store1
store1,
tearFirst,
nailchipperDpsFirst
)
);
};
Binary file added src/aac/lhw/m1s/shenanigans/nailchipper.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 420f974

Please sign in to comment.