0
0
mirror of https://github.com/marcrobledo/savegame-editors.git synced 2025-04-24 16:35:10 +00:00

added online only heroic mission unlocker to super kirby clash

This commit is contained in:
Marc Robledo 2020-04-26 11:24:22 +02:00
parent e0d77c5b98
commit 7dadfc65ed
3 changed files with 40 additions and 19 deletions

View File

@ -14,23 +14,8 @@
*/ */
/* MOD: fix old caches for mrc */
caches.keys().then(function(cacheNames){
for(var i=0; i<cacheNames.length; i++){
if(
cacheNames[i]==='runtime' ||
/^precache-\w+$/.test(cacheNames[i]) ||
/^precache-editor-([\w\+]+)-\w+$/.test(cacheNames[i]) ||
/^v?\d+\w?$/.test(cacheNames[i])
){
console.log('deleting old cache: '+cacheNames[i]);
caches.delete(cacheNames[i]);
}
}
});
var PRECACHE_ID='super-kirby-clash-editor'; var PRECACHE_ID='super-kirby-clash-editor';
var PRECACHE_VERSION='v1'; var PRECACHE_VERSION='v3';
var PRECACHE_URLS=[ var PRECACHE_URLS=[
'/savegame-editors/super-kirby-clash/','/savegame-editors/super-kirby-clash/index.html', '/savegame-editors/super-kirby-clash/','/savegame-editors/super-kirby-clash/index.html',
'/savegame-editors/super-kirby-clash/favicon.png', '/savegame-editors/super-kirby-clash/favicon.png',

View File

@ -105,6 +105,19 @@
</div> </div>
</div> </div>
<!-- ONLINE MISSIONS -->
<h3 class="blue">Online only heroic missions</h3>
<div class="container">
<div class="row">
<div class="nine columns"><label for="button-mission-passwords">Use a Password</label></div>
<div class="three columns"><button id="button-mission-passwords" onclick="SavegameEditor.heroicMissionUnlock(SavegameEditor.Offsets.MISSION_PASSWORDS);this.disabled=true;">Unlock</button></div>
</div>
<div class="row">
<div class="nine columns"><label for="button-mission-eshop">Access Nintendo eShop from Other Games</label></div>
<div class="three columns"><button id="button-mission-eshop" onclick="SavegameEditor.heroicMissionUnlock(SavegameEditor.Offsets.MISSION_ESHOP);this.disabled=true;">Unlock</button></div>
</div>
</div>
</div> </div>
</body> </body>

View File

@ -1,6 +1,6 @@
/* /*
Super Kirby Clash savegame editor v20190912 Super Kirby Clash savegame editor v20200425
by Marc Robledo 2019 by Marc Robledo 2019-2020
*/ */
SavegameEditor={ SavegameEditor={
@ -8,13 +8,23 @@ SavegameEditor={
Filename:'savedata.dat', Filename:'savedata.dat',
/* Constants */ /* Constants */
Constants:{
HEROIC_MISSION_HIDDEN:0x00,
HEROIC_MISSION_VISIBLE:0x01,
HEROIC_MISSION_UNLOCKED_NEW:0x02,
HEROIC_MISSION_UNLOCKED:0x04,
},
Offsets:{ Offsets:{
APPLE_GEMS:0x3ef0, APPLE_GEMS:0x3ef0,
BOUGHT_APPLE_GEMS:0x3f00, BOUGHT_APPLE_GEMS:0x3f00,
SHARDS_RED:0x3f20, SHARDS_RED:0x3f20,
SHARDS_BLUE:0x3f24, SHARDS_BLUE:0x3f24,
SHARDS_YELLOW:0x3f28, SHARDS_YELLOW:0x3f28,
SHARDS_RARE:0x3f2c SHARDS_RARE:0x3f2c,
MISSION_PASSWORDS: 0x3a3c,
MISSION_ESHOP: 0x3a44,
MISSION_ALL_HEROIC_MISSIONS: 0x3aa4
//PROFILE_NAME:0x1bb4, //PROFILE_NAME:0x1bb4,
//PROFILE_PLAYED_TIME:0x1b74, //PROFILE_PLAYED_TIME:0x1b74,
//PROFILE_COMPLETED_MISSIONS:0x1b90, //PROFILE_COMPLETED_MISSIONS:0x1b90,
@ -27,6 +37,16 @@ SavegameEditor={
return (tempFile.fileSize===54344) 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 */
preload:function(){ preload:function(){
setNumericRange('applegems', 0, 99999); setNumericRange('applegems', 0, 99999);
@ -61,6 +81,9 @@ SavegameEditor={
setValue('shards-blue', tempFile.readU16(this.Offsets.SHARDS_BLUE)); setValue('shards-blue', tempFile.readU16(this.Offsets.SHARDS_BLUE));
setValue('shards-yellow', tempFile.readU16(this.Offsets.SHARDS_YELLOW)); setValue('shards-yellow', tempFile.readU16(this.Offsets.SHARDS_YELLOW));
setValue('shards-rare', tempFile.readU16(this.Offsets.SHARDS_RARE)); 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 */ /* save function */