Skip to content

Commit

Permalink
feat: Season 9 changes (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
CactusPuppy authored Feb 18, 2024
1 parent db86d0d commit cfc09ad
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 20 deletions.
118 changes: 109 additions & 9 deletions VS Code Extension/overpy.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,18 @@ const opyConstants = {
"isConstant": true,
return: "unsigned float",
},
"FUCKTON_OF_SPACES": {
"description": "170 Em Spaces (U+2003). Add this to the end of a HUD text to ensure it will always be left-aligned.",
"args": null,
"isConstant": true,
return: "string"
},
"LOTS_OF_SPACES": {
"description": "170 Em Spaces (U+2003). Add this to the end of a HUD text to ensure it will always be left-aligned.",
"args": null,
"isConstant": true,
return: "string"
},
"INFINITY": {
"description": "The number infinity = 9999999999999999999.",
"args": null,
Expand Down Expand Up @@ -49002,7 +49014,7 @@ const heroKw =
},
"pharah": {
"guid": "000000000027",
"secondaryFire": {
"passive": {
"guid": "0000000003B1",
"en-US": "Hover Jets",
"de-DE": "Schwebedüsen",
Expand All @@ -49020,6 +49032,9 @@ const heroKw =
"zh-CN": "悬浮背包",
"zh-TW": "滯空"
},
"secondaryFire": {
"en-US": "Jet Dash"
},
"ability1": {
"guid": "0000000003AF",
"en-US": "Jump Jet",
Expand Down Expand Up @@ -63391,7 +63406,8 @@ const customGameSettingsSchema =
"default": "on",
"include": [
"mercy",
"echo"
"echo",
"pharah"
],
"en-US": "%1$s"
},
Expand Down Expand Up @@ -63436,6 +63452,7 @@ const customGameSettingsSchema =
"junkerQueen",
"lucio",
"orisa",
"pharah",
"reinhardt",
"sigma",
"soldier",
Expand Down Expand Up @@ -63467,8 +63484,7 @@ const customGameSettingsSchema =
"default": 100,
"include": [
"dva",
"roadhog",
"pharah"
"roadhog"
],
"guid": "000000005B45",
"en-US": "%1$s Maximum Time",
Expand Down Expand Up @@ -63496,7 +63512,6 @@ const customGameSettingsSchema =
"brigitte",
"dva",
"roadhog",
"pharah",
"reinhardt",
"sigma"
],
Expand Down Expand Up @@ -64616,7 +64631,7 @@ const customGameSettingsSchema =
"zh-CN": "震荡冲击击退倍率",
"zh-TW": "震盪爆破擊退距離"
},
"enableSecondaryFireUnlimitedFuel": {
"enablePassiveUnlimitedFuel": {
"values": "__boolOnOff__",
"default": "off",
"guid": "000000005B51",
Expand All @@ -64636,7 +64651,7 @@ const customGameSettingsSchema =
"zh-CN": "悬浮背包无限燃料",
"zh-TW": "滯空無限燃料"
},
"secondaryFireVerticalSpeed%": {
"passiveVerticalSpeed%": {
"values": "__percent__",
"min": 25,
"max": 300,
Expand All @@ -64658,6 +64673,28 @@ const customGameSettingsSchema =
"zh-CN": "悬浮背包垂直速度",
"zh-TW": "滯空垂直爬升速度"
},
"passiveMaximumTime%": {
"values": "__percent__",
"min": 20,
"max": 500,
"default": 100,
"guid": "00000000631D",
"en-US": "Hover Jets Maximum Time"
},
"passiveExtraFuel%": {
"values": "__percent__",
"min": 0,
"max": 200,
"default": 100,
"en-US": "Hover Jets Extra Fuel Scalar"
},
"passiveRechargeRate%": {
"values": "__percent__",
"min": 0,
"max": 500,
"default": 100,
"en-US": "Hover Jets Recharge Rate"
},
"ability1Acceleration%": {
"values": "__percent__",
"min": 25,
Expand All @@ -64680,6 +64717,13 @@ const customGameSettingsSchema =
"zh-CN": "推进背包加速",
"zh-TW": "跳躍噴射速度"
},
"ability1RefuelScalar": {
"values": "__percent__",
"min": 0,
"max": 400,
"default": 100,
"en-US": "Jump Jet Refuel Scalar"
},
"primaryFireKb%": {
"values": "__percent__",
"min": 0,
Expand Down Expand Up @@ -67701,6 +67745,19 @@ function getAstForNullVector() {
function getAstForCurrentArrayIndex() {
return new Ast("__currentArrayIndex__");
}
function getAstForCustomString(content, formatArgs = []) {
const [
arg1 = getAstForNull(),
arg2 = getAstForNull(),
arg3 = getAstForNull()
] = formatArgs;
return new Ast("__customString__", [
new Ast(content, [], [], "CustomStringLiteral"),
arg1,
arg2,
arg3
]);
}
/*
* This file is part of OverPy (https://github.com/Zezombye/overpy).
* Copyright (c) 2019 Zezombye.
Expand Down Expand Up @@ -76538,13 +76595,43 @@ astParsingFunctions.victim = function(content) {

"use strict";

astParsingFunctions.wait = function(content) {

if (content.args[0].name === "__number__" && content.args[0].args[0].numvalue === 9999) {
warn("w_wait_9999", "wait(9999) is not enough because a custom game can last up to 16200 seconds. Use Math.INFINITY or 99999.")
}

return content;
}
/*
* This file is part of OverPy (https://github.com/Zezombye/overpy).
* Copyright (c) 2019 Zezombye.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

"use strict";

astParsingFunctions.waitUntil = function(content) {

if (!isTypeSuitable("bool", content.args[0].type, false)) {
warn("w_wait_until", "Wait Until does not consider non-zero numbers as true, which might cause unwanted behavior. It is recommended to explicitly compare to true.")
//Add a "== true" because nonzero numbers are not considered true
//content.args[0] = new Ast("__equals__", [content.args[0], getAstForTrue()]);
}
if (content.args[1].name === "__number__" && content.args[1].args[0].numvalue === 9999) {
warn("w_wait_9999", "waitUntil(9999) is not enough because a custom game can last up to 16200 seconds. Use Math.INFINITY or 99999.")
}

return content;
}
Expand Down Expand Up @@ -78752,8 +78839,19 @@ function parse(content, kwargs={}) {
};

var variable = parse(operands[0]);
var value = parse(operands[1]);
return new Ast("__assignTo__", [variable, new Ast(opToFuncMapping[operator], [variable, value])]);
const opName = opToFuncMapping[operator];
const value = parse(operands[1]);

//Do not de-optimize if the variable is random. Else we get random.choice(A) += 1 transformed to random.choice(A) = random.choice(A) + 1.
if (areAstsEqual(variable, variable)) {
return new Ast("__modifyVar__", [
variable,
new Ast(opName, [], [], "__Operation__"),
value,
])
}

return new Ast("__assignTo__", [variable, new Ast(opName, [variable, value])]);

} else if (["+", "-"].includes(operator)) {

Expand Down Expand Up @@ -79125,6 +79223,8 @@ function parseMember(object, member) {
return getAstForNumber(0.94965);
} else if (name === "RING_EXPLOSION_RADIUS_MULT") {
return getAstForNumber(0.48);
} else if (name === "FUCKTON_OF_SPACES" || name === "LOTS_OF_SPACES") {
return getAstForCustomString(" ".repeat(170));
} else {
error("Unhandled member 'math."+name+"'");
}
Expand Down
8 changes: 4 additions & 4 deletions VS Code Extension/overpy.min.js

Large diffs are not rendered by default.

41 changes: 35 additions & 6 deletions src/data/customGameSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -3831,7 +3831,8 @@ const customGameSettingsSchema =
"default": "on",
"include": [
"mercy",
"echo"
"echo",
"pharah"
],
"en-US": "%1$s"
},
Expand Down Expand Up @@ -3876,6 +3877,7 @@ const customGameSettingsSchema =
"junkerQueen",
"lucio",
"orisa",
"pharah",
"reinhardt",
"sigma",
"soldier",
Expand Down Expand Up @@ -3907,8 +3909,7 @@ const customGameSettingsSchema =
"default": 100,
"include": [
"dva",
"roadhog",
"pharah"
"roadhog"
],
"guid": "000000005B45",
"en-US": "%1$s Maximum Time",
Expand Down Expand Up @@ -3936,7 +3937,6 @@ const customGameSettingsSchema =
"brigitte",
"dva",
"roadhog",
"pharah",
"reinhardt",
"sigma"
],
Expand Down Expand Up @@ -5056,7 +5056,7 @@ const customGameSettingsSchema =
"zh-CN": "震荡冲击击退倍率",
"zh-TW": "震盪爆破擊退距離"
},
"enableSecondaryFireUnlimitedFuel": {
"enablePassiveUnlimitedFuel": {
"values": "__boolOnOff__",
"default": "off",
"guid": "000000005B51",
Expand All @@ -5076,7 +5076,7 @@ const customGameSettingsSchema =
"zh-CN": "悬浮背包无限燃料",
"zh-TW": "滯空無限燃料"
},
"secondaryFireVerticalSpeed%": {
"passiveVerticalSpeed%": {
"values": "__percent__",
"min": 25,
"max": 300,
Expand All @@ -5098,6 +5098,28 @@ const customGameSettingsSchema =
"zh-CN": "悬浮背包垂直速度",
"zh-TW": "滯空垂直爬升速度"
},
"passiveMaximumTime%": {
"values": "__percent__",
"min": 20,
"max": 500,
"default": 100,
"guid": "00000000631D",
"en-US": "Hover Jets Maximum Time"
},
"passiveExtraFuel%": {
"values": "__percent__",
"min": 0,
"max": 200,
"default": 100,
"en-US": "Hover Jets Extra Fuel Scalar"
},
"passiveRechargeRate%": {
"values": "__percent__",
"min": 0,
"max": 500,
"default": 100,
"en-US": "Hover Jets Recharge Rate"
},
"ability1Acceleration%": {
"values": "__percent__",
"min": 25,
Expand All @@ -5120,6 +5142,13 @@ const customGameSettingsSchema =
"zh-CN": "推进背包加速",
"zh-TW": "跳躍噴射速度"
},
"ability1RefuelScalar": {
"values": "__percent__",
"min": 0,
"max": 400,
"default": 100,
"en-US": "Jump Jet Refuel Scalar"
},
"primaryFireKb%": {
"values": "__percent__",
"min": 0,
Expand Down
5 changes: 4 additions & 1 deletion src/data/heroes.js
Original file line number Diff line number Diff line change
Expand Up @@ -1569,7 +1569,7 @@ const heroKw =
},
"pharah": {
"guid": "000000000027",
"secondaryFire": {
"passive": {
"guid": "0000000003B1",
"en-US": "Hover Jets",
"de-DE": "Schwebedüsen",
Expand All @@ -1587,6 +1587,9 @@ const heroKw =
"zh-CN": "悬浮背包",
"zh-TW": "滯空"
},
"secondaryFire": {
"en-US": "Jet Dash"
},
"ability1": {
"guid": "0000000003AF",
"en-US": "Jump Jet",
Expand Down

0 comments on commit cfc09ad

Please sign in to comment.