Rebalance levels, adjustments, etc

This commit is contained in:
tobspr 2022-06-22 10:22:20 +02:00
parent dab688cefb
commit 5627d656cc
5 changed files with 98 additions and 69 deletions

View File

@ -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-" + (final ? "final" : "nonfinal"));
}
this.lastShown = this.root.time.now();
this.visible = true;
this.final = final;
this.root.app.inputMgr.makeSureAttachedAndOnTop(this.inputReciever);
if (this.root.time.now() < 120) {
this.title.innerText = "";
} else if (this.final) {
if (this.final) {
this.title.innerText = T.ingame.standaloneAdvantages.titleExpiredV2;
} else if (this.root.time.now() < 120) {
this.title.innerText = "";
} else {
this.title.innerText = T.ingame.standaloneAdvantages.titleEnjoyingDemo;
}

View File

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

View File

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

View File

@ -39,7 +39,7 @@ if (G_IS_DEV && IS_DEBUG) {
/* typehints:start */
// @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 */
/* dev:start */

View File

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