From 7dadfc65ed7f99ab480f22df216a4278a420b520 Mon Sep 17 00:00:00 2001 From: Marc Robledo Date: Sun, 26 Apr 2020 11:24:22 +0200 Subject: [PATCH] added online only heroic mission unlocker to super kirby clash --- super-kirby-clash/_cache_service_worker.js | 17 +------------ super-kirby-clash/index.html | 13 ++++++++++ super-kirby-clash/super-kirby-clash.js | 29 +++++++++++++++++++--- 3 files changed, 40 insertions(+), 19 deletions(-) diff --git a/super-kirby-clash/_cache_service_worker.js b/super-kirby-clash/_cache_service_worker.js index 9b26e01..308a4f8 100644 --- a/super-kirby-clash/_cache_service_worker.js +++ b/super-kirby-clash/_cache_service_worker.js @@ -14,23 +14,8 @@ */ -/* MOD: fix old caches for mrc */ -caches.keys().then(function(cacheNames){ - for(var i=0; iCrystal shards + +

Online only heroic missions

+
+
+
+
+
+
+
+
+
+
+ diff --git a/super-kirby-clash/super-kirby-clash.js b/super-kirby-clash/super-kirby-clash.js index d89fbbf..a756bf3 100644 --- a/super-kirby-clash/super-kirby-clash.js +++ b/super-kirby-clash/super-kirby-clash.js @@ -1,6 +1,6 @@ /* - Super Kirby Clash savegame editor v20190912 - by Marc Robledo 2019 + Super Kirby Clash savegame editor v20200425 + by Marc Robledo 2019-2020 */ SavegameEditor={ @@ -8,13 +8,23 @@ SavegameEditor={ Filename:'savedata.dat', /* Constants */ + Constants:{ + HEROIC_MISSION_HIDDEN:0x00, + HEROIC_MISSION_VISIBLE:0x01, + HEROIC_MISSION_UNLOCKED_NEW:0x02, + HEROIC_MISSION_UNLOCKED:0x04, + }, Offsets:{ APPLE_GEMS:0x3ef0, BOUGHT_APPLE_GEMS:0x3f00, SHARDS_RED:0x3f20, SHARDS_BLUE:0x3f24, SHARDS_YELLOW:0x3f28, - SHARDS_RARE:0x3f2c + SHARDS_RARE:0x3f2c, + + MISSION_PASSWORDS: 0x3a3c, + MISSION_ESHOP: 0x3a44, + MISSION_ALL_HEROIC_MISSIONS: 0x3aa4 //PROFILE_NAME:0x1bb4, //PROFILE_PLAYED_TIME:0x1b74, //PROFILE_COMPLETED_MISSIONS:0x1b90, @@ -27,6 +37,16 @@ SavegameEditor={ return (tempFile.fileSize===54344) }, + /* heroic missions */ + heroicMissionCheck:function(offset){ + var b=tempFile.readU8(offset); + + return (b!==this.Constants.HEROIC_MISSION_HIDDEN && b!==this.Constants.HEROIC_MISSION_VISIBLE) + }, + heroicMissionUnlock:function(offset){ + tempFile.writeU8(offset, this.Constants.HEROIC_MISSION_UNLOCKED_NEW); + }, + /* preload function */ preload:function(){ setNumericRange('applegems', 0, 99999); @@ -61,6 +81,9 @@ SavegameEditor={ setValue('shards-blue', tempFile.readU16(this.Offsets.SHARDS_BLUE)); setValue('shards-yellow', tempFile.readU16(this.Offsets.SHARDS_YELLOW)); setValue('shards-rare', tempFile.readU16(this.Offsets.SHARDS_RARE)); + + get('button-mission-passwords').disabled=this.heroicMissionCheck(this.Offsets.MISSION_PASSWORDS); + get('button-mission-eshop').disabled=this.heroicMissionCheck(this.Offsets.MISSION_ESHOP); }, /* save function */