Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimultaneousAttack-port v6R5 #222

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions content/productivity/simultaneous-attack/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
//
// attack thing with many thing at the same time

var pg = df.getProcgenUtils();
import {getPlanetName} from "https://cdn.skypack.dev/@darkforest_eth/procedural";
const pg = {getPlanetName: getPlanetName}
Stx69 marked this conversation as resolved.
Show resolved Hide resolved

// removes all the child nodes of an element
var removeAllChildNodes = (parent) => {
Expand Down Expand Up @@ -64,7 +65,7 @@ var simultaneousAttack = (target, sources) => {
// maybe somehow show the plugin user this error?
if (Math.floor(energyArriving) <= 0)
return;
df.move(attacker.locationId, target.locationId, Math.floor(attacker.energy * 0.5), 0);
df.move(attacker.locationId, target.locationId, Math.floor(attacker.energy * 0.5), 0, null, false);
// waits for the duration of the longest move - the duration of the move itself to be sent. * 1k is to convert seconds to ms
}, (longestMove - planetMove.time) * 1e3));
}
Expand Down Expand Up @@ -211,4 +212,4 @@ class SimultaneousAttack {
}
};

export default SimultaneousAttack;
export default SimultaneousAttack;
Stx69 marked this conversation as resolved.
Show resolved Hide resolved