diff --git a/src/js/game/shape_definition_manager.js b/src/js/game/shape_definition_manager.js index ba4cf4a8..8178e7d3 100644 --- a/src/js/game/shape_definition_manager.js +++ b/src/js/game/shape_definition_manager.js @@ -252,6 +252,7 @@ export class ShapeDefinitionManager extends BasicSerializableObject { } 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.produceMsLogo, definition); this.root.signals.achievementUnlocked.dispatch(ACHIEVEMENTS.produceRocket, definition); diff --git a/src/js/platform/achievement_provider.js b/src/js/platform/achievement_provider.js index 17880936..046f9ecc 100644 --- a/src/js/platform/achievement_provider.js +++ b/src/js/platform/achievement_provider.js @@ -13,8 +13,11 @@ export const ACHIEVEMENTS = { completeLvl26: "completeLvl26", cutShape: "cutShape", darkMode: "darkMode", + irrelevantShape: "irrelevantShape", level100: "level100", level50: "level50", + oldLevel17: "oldLevel17", + openWires: "openWires", paintShape: "paintShape", place5000Wires: "place5000Wires", placeBlueprint: "placeBlueprint", @@ -33,6 +36,7 @@ export const ACHIEVEMENTS = { }; const DARK_MODE = "dark"; +const WIRE_LAYER = "wires"; const HOUR_1 = 3600; // Seconds const HOUR_10 = HOUR_1 * 10; const HOUR_20 = HOUR_1 * 20; @@ -40,6 +44,7 @@ const SHAPE_BLUEPRINT = "CbCbCbRb:CwCwCwCw"; const SHAPE_LOGO = "RuCw--Cw:----Ru--"; const SHAPE_MS_LOGO = "RgRyRbRr"; const SHAPE_ROCKET = "CbCuCbCu:Sr------:--CrSrCr:CwCwCwCw"; +const SHAPE_OLD_LEVEL_17 = "WrRgWrRg:CwCrCwCr:SgSgSgSg"; export class AchievementProviderInterface { /** @param {Application} app */ @@ -144,8 +149,19 @@ export class AchievementCollection { this.createAndSet(ACHIEVEMENTS.darkMode, { isValid: this.isDarkModeValid, }); + /* + *this.createAndSet(ACHIEVEMENTS.irrelevantShape, { + * isValid: this.isIrrelevantShapeValid, + * signal: "shapeDelivered", + *}); + */ this.createAndSet(ACHIEVEMENTS.level100, this.createLevelOptions(100)); 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.place5000Wires, { isValid: this.isPlace5000WiresValid, @@ -346,6 +362,24 @@ export class AchievementCollection { 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 {Entity} entity diff --git a/src/js/platform/electron/steam_achievement_provider.js b/src/js/platform/electron/steam_achievement_provider.js index 428ebc2a..9001b909 100644 --- a/src/js/platform/electron/steam_achievement_provider.js +++ b/src/js/platform/electron/steam_achievement_provider.js @@ -16,8 +16,11 @@ const ACHIEVEMENT_IDS = { [ACHIEVEMENTS.completeLvl26]: "complete_lvl_26", [ACHIEVEMENTS.cutShape]: "cut_shape", [ACHIEVEMENTS.darkMode]: "dark_mode", + [ACHIEVEMENTS.irrelevantShape]: "irrelevant_shape", [ACHIEVEMENTS.level100]: "level_100", [ACHIEVEMENTS.level50]: "level_50", + [ACHIEVEMENTS.openWires]: "open_wires", + [ACHIEVEMENTS.oldLevel17]: "old_level_17", [ACHIEVEMENTS.paintShape]: "paint_shape", [ACHIEVEMENTS.place5000Wires]: "place_5000_wires", [ACHIEVEMENTS.placeBlueprint]: "place_blueprint",