Rebalance levels, adjustments, etc

pull/1457/head
tobspr 2 years ago
parent dab688cefb
commit 5627d656cc

@ -121,15 +121,16 @@ export class HUDStandaloneAdvantages extends BaseHUDPart {
this.root.app.gameAnalytics.noteMinor("game.std_advg.show"); this.root.app.gameAnalytics.noteMinor("game.std_advg.show");
this.root.app.gameAnalytics.noteMinor("game.std_advg.show-" + (final ? "final" : "nonfinal")); this.root.app.gameAnalytics.noteMinor("game.std_advg.show-" + (final ? "final" : "nonfinal"));
} }
this.lastShown = this.root.time.now(); this.lastShown = this.root.time.now();
this.visible = true; this.visible = true;
this.final = final; this.final = final;
this.root.app.inputMgr.makeSureAttachedAndOnTop(this.inputReciever); this.root.app.inputMgr.makeSureAttachedAndOnTop(this.inputReciever);
if (this.root.time.now() < 120) { if (this.final) {
this.title.innerText = "";
} else if (this.final) {
this.title.innerText = T.ingame.standaloneAdvantages.titleExpiredV2; this.title.innerText = T.ingame.standaloneAdvantages.titleExpiredV2;
} else if (this.root.time.now() < 120) {
this.title.innerText = "";
} else { } else {
this.title.innerText = T.ingame.standaloneAdvantages.titleEnjoyingDemo; this.title.innerText = T.ingame.standaloneAdvantages.titleEnjoyingDemo;
} }

@ -1,3 +1,6 @@
/* typehints:start */
import { Application } from "../../application";
/* typehints:end */
import { WEB_STEAM_SSO_AUTHENTICATED } from "../../core/steam_sso"; import { WEB_STEAM_SSO_AUTHENTICATED } from "../../core/steam_sso";
import { enumHubGoalRewards } from "../tutorial_goals"; import { enumHubGoalRewards } from "../tutorial_goals";
@ -7,73 +10,98 @@ const chinaShapes = G_WEGAME_VERSION || G_CHINA_VERSION;
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
const WEB_DEMO_LEVELS = () => [ /**
// 1 *
// Circle * @param {Application} app
{ * @returns
shape: "CuCuCuCu", // belts t1 */
required: 10, const WEB_DEMO_LEVELS = app => {
reward: enumHubGoalRewards.reward_cutter_and_trash, const variant = app.gameAnalytics.abtVariant;
},
const levels = [
// 2 // 1
// Cutter // Circle
{ {
shape: "----CuCu", // shape: "CuCuCuCu", // belts t1
required: 20, required: 10,
reward: enumHubGoalRewards.no_reward, reward: enumHubGoalRewards.reward_cutter_and_trash,
}, },
// 3 // 2
// Rectangle // Cutter
{ {
shape: "RuRuRuRu", // miners t1 shape: "----CuCu", //
required: 50, required: 20,
reward: enumHubGoalRewards.reward_balancer, reward: enumHubGoalRewards.no_reward,
}, },
// 4 // 3
{ // Rectangle
shape: "RuRu----", // processors t2 {
required: 30, shape: "RuRuRuRu", // miners t1
reward: enumHubGoalRewards.reward_rotater, required: variant === "0" ? 50 : 30,
}, reward: enumHubGoalRewards.reward_balancer,
},
// 4
{
shape: "RuRu----", // processors t2
required: 30,
reward: enumHubGoalRewards.reward_rotater,
},
// 5
// Rotater
{
shape: "Cu----Cu", // belts t2
required: 75,
reward: enumHubGoalRewards.reward_tunnel,
},
];
if (["0", "1", "2", "3"].includes(variant)) {
levels.push(
// 6
// Painter
{
shape: "Cu------", // miners t2
required: variant === "0" ? 75 : 50,
reward: enumHubGoalRewards.reward_painter,
}
);
}
// 5 if (["0", "1", "2"].includes(variant)) {
// Rotater levels.push(
{ // 7
shape: "Cu----Cu", // belts t2 {
required: 75, shape: "CrCrCrCr", // unused
reward: enumHubGoalRewards.reward_tunnel, required: variant === "0" ? 120 : 85,
}, reward: enumHubGoalRewards.reward_rotater_ccw,
}
);
}
// 6 if (["0", "1"].includes(variant)) {
{ levels.push(
shape: "Cu------", // miners t2 // 8
required: 75, {
reward: enumHubGoalRewards.reward_painter, shape: "RbRb----", // painter t2
}, required: variant === "0" ? 170 : 100,
reward: enumHubGoalRewards.reward_mixer,
}
);
}
// 7
// Painter
{
shape: "CrCrCrCr", // unused
required: 120,
reward: enumHubGoalRewards.reward_rotater_ccw,
},
// 8
{
shape: "RbRb----", // painter t2
required: 170,
reward: enumHubGoalRewards.reward_mixer,
},
// End of demo // End of demo
{ levels.push({
shape: "RbRb----", shape: levels[levels.length - 1].shape,
required: 0, required: 0,
reward: enumHubGoalRewards.reward_demo_end, reward: enumHubGoalRewards.reward_demo_end,
}, });
];
return levels;
};
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
@ -354,11 +382,11 @@ const STANDALONE_LEVELS = () => [
/** /**
* Generates the level definitions * Generates the level definitions
*/ */
export function generateLevelsForVariant() { export function generateLevelsForVariant(app) {
if (G_IS_STEAM_DEMO) { if (G_IS_STEAM_DEMO) {
return STEAM_DEMO_LEVELS(); return STEAM_DEMO_LEVELS();
} else if (G_IS_STANDALONE || WEB_STEAM_SSO_AUTHENTICATED) { } else if (G_IS_STANDALONE || WEB_STEAM_SSO_AUTHENTICATED) {
return STANDALONE_LEVELS(); return STANDALONE_LEVELS();
} }
return WEB_DEMO_LEVELS(); return WEB_DEMO_LEVELS(app);
} }

@ -299,11 +299,11 @@ let levelDefinitionsCache = null;
/** /**
* Generates the level definitions * Generates the level definitions
*/ */
export function generateLevelDefinitions() { export function generateLevelDefinitions(app) {
if (levelDefinitionsCache) { if (levelDefinitionsCache) {
return levelDefinitionsCache; return levelDefinitionsCache;
} }
const levelDefinitions = generateLevelsForVariant(); const levelDefinitions = generateLevelsForVariant(app);
MOD_SIGNALS.modifyLevelDefinitions.dispatch(levelDefinitions); MOD_SIGNALS.modifyLevelDefinitions.dispatch(levelDefinitions);
if (G_IS_DEV) { if (G_IS_DEV) {
levelDefinitions.forEach(({ shape }) => { levelDefinitions.forEach(({ shape }) => {
@ -403,7 +403,7 @@ export class RegularGameMode extends GameMode {
* @returns {Array<LevelDefinition>} * @returns {Array<LevelDefinition>}
*/ */
getLevelDefinitions() { getLevelDefinitions() {
return generateLevelDefinitions(); return generateLevelDefinitions(this.root.app);
} }
/** /**

@ -39,7 +39,7 @@ if (G_IS_DEV && IS_DEBUG) {
/* typehints:start */ /* typehints:start */
// @ts-ignore // @ts-ignore
assert(false, "typehints built in, this should never be the case!"); throw new Error("typehints built in, this should never be the case!");
/* typehints:end */ /* typehints:end */
/* dev:start */ /* dev:start */

@ -36,8 +36,8 @@ const analyticsUrl = G_IS_DEV ? "http://localhost:8001" : "https://analytics.sha
// Be sure to increment the ID whenever it changes // Be sure to increment the ID whenever it changes
const analyticsLocalFile = G_IS_STEAM_DEMO ? "shapez_token_steamdemo.bin" : "shapez_token_123.bin"; const analyticsLocalFile = G_IS_STEAM_DEMO ? "shapez_token_steamdemo.bin" : "shapez_token_123.bin";
const CURRENT_ABT = "abt_mmnd"; const CURRENT_ABT = "abt_lvcp";
const CURRENT_ABT_COUNT = 1; const CURRENT_ABT_COUNT = 4;
export class ShapezGameAnalytics extends GameAnalyticsInterface { export class ShapezGameAnalytics extends GameAnalyticsInterface {
constructor(app) { constructor(app) {

Loading…
Cancel
Save