Skip to content

Commit

Permalink
Added boost considiration
Browse files Browse the repository at this point in the history
  • Loading branch information
pieterbrandsen committed Feb 17, 2024
1 parent 8bdd930 commit 683174d
Show file tree
Hide file tree
Showing 6 changed files with 266 additions and 84 deletions.
4 changes: 2 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["@babel/preset-env"]
}
"presets": ["@babel/preset-env"]
}
103 changes: 51 additions & 52 deletions package-lock.json

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

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"jest": {
"transform": {
"^.+\\.jsx?$": "babel-jest"
},
"automock": false
}
},
"author": "",
"license": "ISC",
Expand All @@ -40,7 +39,7 @@
},
"type": "module",
"devDependencies": {
"@babel/preset-env": "^7.23.7",
"@babel/preset-env": "^7.23.9",
"babel-jest": "^29.7.0"
}
}
41 changes: 32 additions & 9 deletions src/data/converter/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,34 +101,57 @@ export function getIntentEffect(action, originalObject) {
try {
switch (action) {
case "harvest":
return { action, energy: originalObject.groupedBody.work * 2 };
return {
action,
energy: originalObject.groupedBody.work * 2,
effect: originalObject.groupedBodyEffect.harvest
};
case "build":
return { action, energy: originalObject.groupedBody.work * 5 };
return {
action,
energy: originalObject.groupedBody.work * 5,
effect: originalObject.groupedBodyEffect.build
};
case "repair":
if (originalObject.type === "tower") return { action, energy: 10 };
return { action, energy: originalObject.groupedBody.work * 1 };
return { action,
energy: originalObject.groupedBody.work * 1,
effect: originalObject.groupedBodyEffect.repair };
case "upgradeController":
return { action, energy: originalObject.groupedBody.work * 1 };
return { action,
energy: originalObject.groupedBody.work * 1,
effect: originalObject.groupedBodyEffect.upgradeController };
case "dismantle":
return { action, energy: originalObject.groupedBody.work * 0.25 };
return { action,
energy: originalObject.groupedBody.work * 0.25,
effect: originalObject.groupedBodyEffect.dismantle };
case "attack":
if (originalObject.type === "tower")
return { action, energy: 10, damage: 300 };
return { action, damage: originalObject.groupedBody.attack * 30 };
return { action,
damage: originalObject.groupedBody.attack * 30,
effect: originalObject.groupedBodyEffect.attack };
case "rangedAttack":
return {
action,
damage: originalObject.groupedBody.ranged_attack * 10,
effect: originalObject.groupedBodyEffect.rangedAttack
};
case "rangedMassAttack":
return { action, damage: originalObject.groupedBody.ranged_attack * 4 };
return { action,
damage: originalObject.groupedBody.ranged_attack * 4,
effect: originalObject.groupedBodyEffect.ranged_attack };
case "heal":
if (originalObject.type === "tower") {
return { action, energy: 10, damage: 200 };
}
return { action, damage: originalObject.groupedBody.heal * 12 };
return { action,
damage: originalObject.groupedBody.heal * 12,
effect: originalObject.groupedBodyEffect.heal };
case "rangedHeal":
return { action, damage: originalObject.groupedBody.heal * 4 };
return { action,
damage: originalObject.groupedBody.heal * 4,
effect: originalObject.groupedBodyEffect.heal };
case "move":
return { action };
default:
Expand Down
Loading

0 comments on commit 683174d

Please sign in to comment.