Skip to content

Commit

Permalink
Merge branch 'dev' into alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
spencers145 committed Sep 6, 2024
2 parents 029756c + a87d0ce commit c0a0923
Show file tree
Hide file tree
Showing 38 changed files with 1,366 additions and 1,118 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

57 changes: 0 additions & 57 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion contributors.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ <h2>SHARK GAME: NEW FRONTIERS</h2>
The above variably-named Shark Game<br />
&copy; <a target="_blank" href="https://cirri.al/">Cirrial</a>, 2014-2016<br />
&copy; <a target="_blank" href="contributors.html">The SharkGame development team</a>, 2020-2024<br />
All rights reserved.
Licensed under <a target="_blank" href="https://opensource.org/license/mit">MIT</a>..
</footer>
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion css/style.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/style.min.css.map

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import neostandard from "neostandard";
import jsPlugin from "@eslint/js";

export default [
jsPlugin.configs.recommended,
neostandard.plugins.promise.configs["flat/recommended"],
...neostandard({
semi: true,
ignores: ["js/lib/**/*", ".pnp*"],
env: ["browser", "commonjs", "worker", "jquery", "es2021"],
globals: {
/* eslint-disable id-length */
_: "readonly",
ascii85: "readonly",
pako: "readonly",
SharkGame: "readonly",
Decimal: "readonly",
DecimalHalfRound: "readonly",
panzoom: "readonly",

res: "readonly",
main: "readonly",
rec: "readonly",
gateway: "readonly",
stats: "readonly",
world: "readonly",
home: "readonly",
tree: "readonly",
log: "readonly",
mem: "readonly",
sharktext: "readonly",
sharkmath: "readonly",
sharkcolor: "readonly",
sharkmisc: "readonly",
sharktime: "readonly",
cad: "readonly",
},
}),
{
rules: {
"no-unused-vars": [
"error",
{
varsIgnorePattern: "^__.+$",
argsIgnorePattern: "^_.+$",
args: "all",
},
],
"func-style": ["error", "declaration"],
"no-inner-declarations": "off",
"prefer-const": "error",
"no-var": "error",
"no-shadow": ["error", { builtinGlobals: true, hoist: "all", allow: ["name", "event"] }],
eqeqeq: ["error", "smart"],
"id-length": ["error", { min: 3, exceptionPatterns: ["i", "id", "to", "dt", "P", "A", "L", "R", "x", "y", "w", "h"] }],
"no-fallthrough": ["error", { commentPattern: "fallthrough", reportUnusedFallthroughComment: true }],
"@stylistic/indent": ["error", 4],
"@stylistic/quotes": ["error", "double", { avoidEscape: true }],
"@stylistic/comma-dangle": ["error", "always-multiline"],
"@stylistic/space-before-function-paren": ["error", { anonymous: "always", named: "never", asyncArrow: "always" }],
},
},
];
Binary file added img/small/actions/getKelpCultivator.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 img/small/actions/getShoveler.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 img/small/actions/getSkimmer.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 img/small/actions/getTirelessCrafter.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 img/sprites.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ <h1>IDLE MODE</h1>
The above variably-named Shark Game<br />
&copy; <a target="_blank" href="https://cirri.al/">Cirrial</a>, 2014-2016<br />
&copy; <a target="_blank" href="contributors.html">The SharkGame development team</a>, 2020-2024<br />
All rights reserved.
Licensed under <a target="_blank" href="https://opensource.org/license/mit">MIT</a>.
</footer>
</div>
</body>
Expand Down
40 changes: 20 additions & 20 deletions js/aspecttree.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ SharkGame.AspectTree = {
drawTable(table = $("<table>")) {
table.html("").attr("id", "aspectTable");

const headerRow = $("<thead>").append($("<th>").html(`Name`).attr("scope", "col"));
headerRow.append($("<th>").html(`Description`).attr("scope", "col"));
headerRow.append($("<th>").html(`Level`).attr("scope", "col"));
headerRow.append($("<th>").html(`Cost`).attr("scope", "col"));
const headerRow = $("<thead>").append($("<th>").html("Name").attr("scope", "col"));
headerRow.append($("<th>").html("Description").attr("scope", "col"));
headerRow.append($("<th>").html("Level").attr("scope", "col"));
headerRow.append($("<th>").html("Cost").attr("scope", "col"));

table.append(headerRow);

Expand Down Expand Up @@ -239,33 +239,33 @@ SharkGame.AspectTree = {
const aspectNameTableData = $("<th>").html(aspectData.name).addClass("aspectTableName").attr("rowspan", "3").attr("scope", "rowgroup");
const specialData = $("<td>").append(basicText + cantBuyText);
const aspectTableDescriptionRow = $("<tr>").append(aspectNameTableData).append(specialData);
aspectTableDescriptionRow.append($(`<td>`));
aspectTableDescriptionRow.append($("<td>"));
aspectTableDescriptionRow.append(
$(`<td>`)
$("<td>")
.html(!reqref.max ? aspectData.getCost(aspectData.level) : "N/A")
.attr("rowspan", "3"),
);

const aspectTableRowCurrent = $("<tr>");

if (aspectData.level > 0) {
aspectTableRowCurrent.append($(`<td>`).html(`CURRENT: ${aspectData.getEffect(aspectData.level)}`));
aspectTableRowCurrent.append($("<td>").html(`CURRENT: ${aspectData.getEffect(aspectData.level)}`));
} else {
aspectTableRowCurrent.append($(`<td>`).html(`CURRENT: Not bought, no effect.`));
aspectTableRowCurrent.append($("<td>").html("CURRENT: Not bought, no effect."));
}
aspectTableRowCurrent.append($(`<td>`).html(aspectData.level));
aspectTableRowCurrent.append($("<td>").html(aspectData.level));

// aspectTableRowCurrent.classList.add("aspect-table-row");
// aspectTableRowCurrent.id = "aspect-table-row-" + aspectId;

const aspectTableRowNext = $("<tr>");
if (!reqref.max) {
// ${aspectData.level + 1}`
aspectTableRowNext.append($(`<td>`).html(`NEXT: ${aspectData.getEffect(aspectData.level + 1)}`));
aspectTableRowNext.append($(`<td>`).html(`${aspectData.level + 1}`));
aspectTableRowNext.append($("<td>").html(`NEXT: ${aspectData.getEffect(aspectData.level + 1)}`));
aspectTableRowNext.append($("<td>").html(`${aspectData.level + 1}`));
} else {
aspectTableRowNext.append($(`<td>`).html(`NEXT: Already at maximum level.`));
aspectTableRowNext.append($(`<td>`).html(`N/A`));
aspectTableRowNext.append($("<td>").html("NEXT: Already at maximum level."));
aspectTableRowNext.append($("<td>").html("N/A"));
}

_.each([aspectTableDescriptionRow, aspectTableRowNext, aspectTableRowCurrent], (row) => {
Expand Down Expand Up @@ -801,10 +801,10 @@ SharkGame.AspectTree = {

let tooltipText = "";
if (button.level === 0) {
let costText = ``;
let costText = "";
if (tree.refundMode) {
if (button.noRefunds) {
costText = `NO REFUNDS`;
costText = "NO REFUNDS";
}
} else {
costText = `COST: <span class='${reqref.affordable ? "can-afford-aspect" : "cant-afford-aspect"}'>${cost} ESSENCE</span>`;
Expand All @@ -821,10 +821,10 @@ SharkGame.AspectTree = {
(tree.debugMode ? "" : "<hr class='hrForTooltipJuxtapositionInGateway'>" + `<span class='bold'>${costText}</span>`);
tooltipBox.addClass("forAspectTreeUnpurchased");
} else if (button.level < button.max) {
let costText = ``;
let costText = "";
if (tree.refundMode) {
if (button.noRefunds) {
costText = `NO REFUNDS`;
costText = "NO REFUNDS";
} else {
costText = `REFUND VALUE: <span class="can-afford-aspect">${refundValue}</span>`;
}
Expand Down Expand Up @@ -857,15 +857,15 @@ SharkGame.AspectTree = {
`<br />${button.getEffect(button.level)}` +
`<br /><span class='littleTooltipText'>${button.description}</span>`;
} else {
let costText = ``;
let costText = "";
if (tree.refundMode) {
if (button.noRefunds) {
costText = `NO REFUNDS`;
costText = "NO REFUNDS";
} else {
costText = `REFUND VALUE: <span class="can-afford-aspect">${refundValue}</span>`;
}
} else {
costText = `MAXIMUM LEVEL.`;
costText = "MAXIMUM LEVEL.";
}

const levelText =
Expand Down
29 changes: 14 additions & 15 deletions js/data/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ SharkGame.Events = {
return "pass";
},
trigger() {
res.changeResource(`sponge`, 1); // sponge should never ever go below one once you have access to farms
res.changeResource("sponge", 1); // sponge should never ever go below one once you have access to farms
return true;
},
},
Expand All @@ -133,21 +133,21 @@ SharkGame.Events = {
return "pass";
},
trigger() {
const underfeeding = SharkGame.ResourceMap.get(`specialResourceOne`);
const underfeeding = SharkGame.ResourceMap.get("specialResourceOne");
if (!underfeeding.baseIncome) {
underfeeding.baseIncome = { sponge: 0 };
underfeeding.income = { sponge: 0 };
}

const sponge = res.getResource(`sponge`);
const algae = res.getResource(`algae`);
const limitRatio = SharkGame.Upgrades.purchased.includes(`feedingTechniques`) ? 4 : 1;
const sponge = res.getResource("sponge");
const algae = res.getResource("algae");
const limitRatio = SharkGame.Upgrades.purchased.includes("feedingTechniques") ? 4 : 1;
if (sponge / algae > limitRatio) {
underfeeding.baseIncome.sponge = -(sponge - algae * limitRatio);
} else {
underfeeding.baseIncome.sponge = 0;
}
res.reapplyModifiers(`specialResourceOne`, `sponge`);
res.reapplyModifiers("specialResourceOne", "sponge");
return true;
},
},
Expand Down Expand Up @@ -178,9 +178,9 @@ SharkGame.Events = {
return "pass";
},
trigger() {
const sponge = res.getResource(`sponge`);
const sand = res.getResource(`sand`);
const vents = SharkGame.ResourceMap.get(`world`);
const sponge = res.getResource("sponge");
const sand = res.getResource("sand");
const vents = SharkGame.ResourceMap.get("world");

vents.baseIncome.sponge = 0;
vents.baseIncome.sand = 0;
Expand All @@ -198,9 +198,9 @@ SharkGame.Events = {
vents.baseIncome.porite = max / 2;
}
}
res.reapplyModifiers(`world`, `sponge`);
res.reapplyModifiers(`world`, `sand`);
res.reapplyModifiers(`world`, `porite`);
res.reapplyModifiers("world", "sponge");
res.reapplyModifiers("world", "sand");
res.reapplyModifiers("world", "porite");
return true;
},
},
Expand Down Expand Up @@ -315,7 +315,7 @@ SharkGame.Events = {
handlingTime: "beforeTick",
priority: 0,
getAction() {
if (world.worldType === `start` && !SharkGame.persistentFlags.revealedButtonTabs) {
if (world.worldType === "start" && !SharkGame.persistentFlags.revealedButtonTabs) {
if (res.getTotalResource("scientist") > 0) {
return "trigger";
}
Expand Down Expand Up @@ -516,8 +516,7 @@ SharkGame.Events = {
if (
SharkGame.flags.tokens[token.attr("id")].includes("chart") ||
SharkGame.flags.tokens[token.attr("id")].includes("billfishExplorer")
)
res.tokens.tryReturnToken(null, false, token);
) { res.tokens.tryReturnToken(null, false, token); }
});
SharkGame.flags.mapSequenceCompleted = true;

Expand Down
Loading

0 comments on commit c0a0923

Please sign in to comment.