mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-06-13 13:04:03 +00:00
[WIP] Add more achievements
This commit is contained in:
parent
311a620527
commit
dc2ae5504c
@ -252,6 +252,7 @@ export class ShapeDefinitionManager extends BasicSerializableObject {
|
|||||||
}
|
}
|
||||||
this.shapeKeyToDefinition[id] = definition;
|
this.shapeKeyToDefinition[id] = definition;
|
||||||
|
|
||||||
|
this.root.signals.achievementUnlocked.dispatch(ACHIEVEMENTS.oldLevel17, definition);
|
||||||
this.root.signals.achievementUnlocked.dispatch(ACHIEVEMENTS.produceLogo, definition);
|
this.root.signals.achievementUnlocked.dispatch(ACHIEVEMENTS.produceLogo, definition);
|
||||||
this.root.signals.achievementUnlocked.dispatch(ACHIEVEMENTS.produceMsLogo, definition);
|
this.root.signals.achievementUnlocked.dispatch(ACHIEVEMENTS.produceMsLogo, definition);
|
||||||
this.root.signals.achievementUnlocked.dispatch(ACHIEVEMENTS.produceRocket, definition);
|
this.root.signals.achievementUnlocked.dispatch(ACHIEVEMENTS.produceRocket, definition);
|
||||||
|
@ -13,8 +13,11 @@ export const ACHIEVEMENTS = {
|
|||||||
completeLvl26: "completeLvl26",
|
completeLvl26: "completeLvl26",
|
||||||
cutShape: "cutShape",
|
cutShape: "cutShape",
|
||||||
darkMode: "darkMode",
|
darkMode: "darkMode",
|
||||||
|
irrelevantShape: "irrelevantShape",
|
||||||
level100: "level100",
|
level100: "level100",
|
||||||
level50: "level50",
|
level50: "level50",
|
||||||
|
oldLevel17: "oldLevel17",
|
||||||
|
openWires: "openWires",
|
||||||
paintShape: "paintShape",
|
paintShape: "paintShape",
|
||||||
place5000Wires: "place5000Wires",
|
place5000Wires: "place5000Wires",
|
||||||
placeBlueprint: "placeBlueprint",
|
placeBlueprint: "placeBlueprint",
|
||||||
@ -33,6 +36,7 @@ export const ACHIEVEMENTS = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const DARK_MODE = "dark";
|
const DARK_MODE = "dark";
|
||||||
|
const WIRE_LAYER = "wires";
|
||||||
const HOUR_1 = 3600; // Seconds
|
const HOUR_1 = 3600; // Seconds
|
||||||
const HOUR_10 = HOUR_1 * 10;
|
const HOUR_10 = HOUR_1 * 10;
|
||||||
const HOUR_20 = HOUR_1 * 20;
|
const HOUR_20 = HOUR_1 * 20;
|
||||||
@ -40,6 +44,7 @@ const SHAPE_BLUEPRINT = "CbCbCbRb:CwCwCwCw";
|
|||||||
const SHAPE_LOGO = "RuCw--Cw:----Ru--";
|
const SHAPE_LOGO = "RuCw--Cw:----Ru--";
|
||||||
const SHAPE_MS_LOGO = "RgRyRbRr";
|
const SHAPE_MS_LOGO = "RgRyRbRr";
|
||||||
const SHAPE_ROCKET = "CbCuCbCu:Sr------:--CrSrCr:CwCwCwCw";
|
const SHAPE_ROCKET = "CbCuCbCu:Sr------:--CrSrCr:CwCwCwCw";
|
||||||
|
const SHAPE_OLD_LEVEL_17 = "WrRgWrRg:CwCrCwCr:SgSgSgSg";
|
||||||
|
|
||||||
export class AchievementProviderInterface {
|
export class AchievementProviderInterface {
|
||||||
/** @param {Application} app */
|
/** @param {Application} app */
|
||||||
@ -144,8 +149,19 @@ export class AchievementCollection {
|
|||||||
this.createAndSet(ACHIEVEMENTS.darkMode, {
|
this.createAndSet(ACHIEVEMENTS.darkMode, {
|
||||||
isValid: this.isDarkModeValid,
|
isValid: this.isDarkModeValid,
|
||||||
});
|
});
|
||||||
|
/*
|
||||||
|
*this.createAndSet(ACHIEVEMENTS.irrelevantShape, {
|
||||||
|
* isValid: this.isIrrelevantShapeValid,
|
||||||
|
* signal: "shapeDelivered",
|
||||||
|
*});
|
||||||
|
*/
|
||||||
this.createAndSet(ACHIEVEMENTS.level100, this.createLevelOptions(100));
|
this.createAndSet(ACHIEVEMENTS.level100, this.createLevelOptions(100));
|
||||||
this.createAndSet(ACHIEVEMENTS.level50, this.createLevelOptions(50));
|
this.createAndSet(ACHIEVEMENTS.level50, this.createLevelOptions(50));
|
||||||
|
this.createAndSet(ACHIEVEMENTS.oldLevel17, this.createShapeOptions(SHAPE_OLD_LEVEL_17));
|
||||||
|
this.createAndSet(ACHIEVEMENTS.openWires, {
|
||||||
|
isValid: this.isOpenWiresValid,
|
||||||
|
signal: "editModeChanged",
|
||||||
|
});
|
||||||
this.createAndSet(ACHIEVEMENTS.paintShape);
|
this.createAndSet(ACHIEVEMENTS.paintShape);
|
||||||
this.createAndSet(ACHIEVEMENTS.place5000Wires, {
|
this.createAndSet(ACHIEVEMENTS.place5000Wires, {
|
||||||
isValid: this.isPlace5000WiresValid,
|
isValid: this.isPlace5000WiresValid,
|
||||||
@ -346,6 +362,24 @@ export class AchievementCollection {
|
|||||||
return this.root.app.settings.currentData.settings.theme === DARK_MODE;
|
return this.root.app.settings.currentData.settings.theme === DARK_MODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} key
|
||||||
|
* @param {ShapeDefinition} definition
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
isIrrelevantShapeValid(key, definition) {
|
||||||
|
//return definition.cachedHash !== this.hubGoals.currentGoal.definition.cachedHash
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} key
|
||||||
|
* @param {string} currentLayer
|
||||||
|
* @returns {boolean}
|
||||||
|
*/
|
||||||
|
isOpenWiresValid(key, currentLayer) {
|
||||||
|
return currentLayer === WIRE_LAYER;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} key
|
* @param {string} key
|
||||||
* @param {Entity} entity
|
* @param {Entity} entity
|
||||||
|
@ -16,8 +16,11 @@ const ACHIEVEMENT_IDS = {
|
|||||||
[ACHIEVEMENTS.completeLvl26]: "complete_lvl_26",
|
[ACHIEVEMENTS.completeLvl26]: "complete_lvl_26",
|
||||||
[ACHIEVEMENTS.cutShape]: "cut_shape",
|
[ACHIEVEMENTS.cutShape]: "cut_shape",
|
||||||
[ACHIEVEMENTS.darkMode]: "dark_mode",
|
[ACHIEVEMENTS.darkMode]: "dark_mode",
|
||||||
|
[ACHIEVEMENTS.irrelevantShape]: "irrelevant_shape",
|
||||||
[ACHIEVEMENTS.level100]: "level_100",
|
[ACHIEVEMENTS.level100]: "level_100",
|
||||||
[ACHIEVEMENTS.level50]: "level_50",
|
[ACHIEVEMENTS.level50]: "level_50",
|
||||||
|
[ACHIEVEMENTS.openWires]: "open_wires",
|
||||||
|
[ACHIEVEMENTS.oldLevel17]: "old_level_17",
|
||||||
[ACHIEVEMENTS.paintShape]: "paint_shape",
|
[ACHIEVEMENTS.paintShape]: "paint_shape",
|
||||||
[ACHIEVEMENTS.place5000Wires]: "place_5000_wires",
|
[ACHIEVEMENTS.place5000Wires]: "place_5000_wires",
|
||||||
[ACHIEVEMENTS.placeBlueprint]: "place_blueprint",
|
[ACHIEVEMENTS.placeBlueprint]: "place_blueprint",
|
||||||
|
Loading…
Reference in New Issue
Block a user