CREATORJD commited on
Commit
5a704fe
·
verified ·
1 Parent(s): 58511fd

v1.32.51 — campaign missions borrow the whole deployment plan

Browse files
Files changed (4) hide show
  1. src/main.js +18 -4
  2. src/story.js +41 -9
  3. src/updater.js +1 -1
  4. update.json +6 -6
src/main.js CHANGED
@@ -1194,14 +1194,28 @@ function wire(){
1194
  mfBindTap($('warBack'),()=>{ sfx('ui');
1195
  renderMetaHead(); showFrontScreen('startScreen'); });
1196
  mfBindTap($('setupBack'),()=>{ sfx('ui');
 
 
 
 
 
 
1197
  if(typeof renderWarRoom==='function') renderWarRoom();
1198
  showFrontScreen('warScr'); });
1199
  mfBindTap($('setupStart'),()=>{
1200
  initAudio();
1201
- META.setup={d:difficulty,t:curTheme,m:curMap,f:aiFactionSel,pf:playerFaction,bs:battlefieldPreset,
1202
- g:goalSel,tl:timeLimit,rp:resPace,cr:crateRate,
1203
- ps:playerStartZone,ais:aiSlots.map(A=>({on:!!A.on,diff:A.diff|0,zone:A.zone})),
1204
- df:defenseFocus,inf:infestationOn?1:0}; metaSave(); // remember loadout
 
 
 
 
 
 
 
 
1205
  hideFrontScreens(); sfx('ui');
1206
  // terrain generation is heavy at this resolution — show it, don't freeze on it
1207
  $('loadScr').style.display='flex';
 
1194
  mfBindTap($('warBack'),()=>{ sfx('ui');
1195
  renderMetaHead(); showFrontScreen('startScreen'); });
1196
  mfBindTap($('setupBack'),()=>{ sfx('ui');
1197
+ /* Battle Setup doubles as an authored mission's brief. Backing out of it is
1198
+ DECLINING the mission, so the borrowed plan comes back here — otherwise
1199
+ the player's next ordinary skirmish quietly ran the mission's map, theme,
1200
+ difficulty and AI slots, and the menu diorama stayed in its biome. */
1201
+ if(typeof storyCampaignRestoreMods==='function'&&storyCampaignRestoreMods()
1202
+ &&typeof storyCampaignSyncSetup==='function') storyCampaignSyncSetup();
1203
  if(typeof renderWarRoom==='function') renderWarRoom();
1204
  showFrontScreen('warScr'); });
1205
  mfBindTap($('setupStart'),()=>{
1206
  initAudio();
1207
+ /* "Remember loadout" means the PLAYER'S loadout. An authored campaign
1208
+ mission borrows every field below for the length of its run, so saving
1209
+ here while a preset was on loan wrote the mission's plan over the
1210
+ player's own — permanently, across restarts. That is how one prologue
1211
+ mission authored on theme:'arctic' made the snow biome the saved
1212
+ default and the menu diorama came up in it every launch. */
1213
+ if(!(typeof storyCampaignPlanBorrowed==='function'&&storyCampaignPlanBorrowed())){
1214
+ META.setup={d:difficulty,t:curTheme,m:curMap,f:aiFactionSel,pf:playerFaction,bs:battlefieldPreset,
1215
+ g:goalSel,tl:timeLimit,rp:resPace,cr:crateRate,
1216
+ ps:playerStartZone,ais:aiSlots.map(A=>({on:!!A.on,diff:A.diff|0,zone:A.zone})),
1217
+ df:defenseFocus,inf:infestationOn?1:0}; metaSave(); // remember loadout
1218
+ }
1219
  hideFrontScreens(); sfx('ui');
1220
  // terrain generation is heavy at this resolution — show it, don't freeze on it
1221
  $('loadScr').style.display='flex';
src/story.js CHANGED
@@ -767,9 +767,13 @@ function storyCampaignOpenMission(missionId){
767
  skirmishes — so an authored prologue mission quietly ran with Brittle
768
  Frames or Iron Enemy attached and nothing on the card admitted it. An
769
  authored mission is authored: it brings its own modifiers or none. */
 
 
 
 
 
 
770
  difficulty=m.diff; defenseFocus=m.defense?1:0; infestationOn=!!m.inf; wcChoice=0;
771
- if(typeof storyCampaignPrevMods==='undefined'||storyCampaignPrevMods===null)
772
- storyCampaignPrevMods=Object.assign({},META.opmods||{});
773
  META.opmods=Object.assign({},m.mods||{});
774
  goalSel=m.goal; timeLimit=m.time; resPace=1; crateRate=crateRateBase=1;
775
  curMap=m.map; curTheme=m.theme; battlefieldPreset=m.scale;
@@ -784,16 +788,44 @@ function storyCampaignOpenMission(missionId){
784
  if(typeof toast==='function') toast(m.code+' · '+m.ttl+' — deployment preset loaded');
785
  }
786
 
787
- /* The player's own modifier set, held while an authored mission borrows the
788
- slot. Restored by the same hook that restores everything else a mission
789
- temporarily owns. */
790
- let storyCampaignPrevMods=null;
791
- function storyCampaignRestoreMods(){
792
- if(storyCampaignPrevMods===null) return false;
793
- META.opmods=storyCampaignPrevMods; storyCampaignPrevMods=null;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
794
  if(typeof metaSave==='function') metaSave();
 
 
 
795
  return true;
796
  }
 
 
 
797
  /* story.js loads after endgame.js, so the wrapper is installed before initOps
798
  binds its tab listener. tutorial.js later wraps this wrapper in turn; both
799
  additions therefore survive without either feature editing the other. */
 
767
  skirmishes — so an authored prologue mission quietly ran with Brittle
768
  Frames or Iron Enemy attached and nothing on the card admitted it. An
769
  authored mission is authored: it brings its own modifiers or none. */
770
+ /* Borrow the WHOLE plan before writing any of it. Only META.opmods used to be
771
+ held, so the other fourteen fields below were a permanent clobber of the
772
+ player's own skirmish setup — and one prologue mission is authored on
773
+ theme:'arctic', which is how a player who opened it once found every
774
+ later battle and the menu diorama frozen in the snow biome. */
775
+ storyCampaignBorrowPlan();
776
  difficulty=m.diff; defenseFocus=m.defense?1:0; infestationOn=!!m.inf; wcChoice=0;
 
 
777
  META.opmods=Object.assign({},m.mods||{});
778
  goalSel=m.goal; timeLimit=m.time; resPace=1; crateRate=crateRateBase=1;
779
  curMap=m.map; curTheme=m.theme; battlefieldPreset=m.scale;
 
788
  if(typeof toast==='function') toast(m.code+' · '+m.ttl+' — deployment preset loaded');
789
  }
790
 
791
+ /* THE PLAYER'S OWN DEPLOYMENT PLAN, held while an authored mission borrows it.
792
+ These are all top-level `let` bindings in the shared scope, not window
793
+ properties, so the snapshot has to name them one at a time — a loop over
794
+ string keys silently reads undefined and hands back a wiped plan. */
795
+ let storyCampaignPrevPlan=null;
796
+ function storyCampaignBorrowPlan(){
797
+ if(storyCampaignPrevPlan) return false; // already borrowed; don't re-snapshot a mission
798
+ storyCampaignPrevPlan={
799
+ difficulty:difficulty, defenseFocus:defenseFocus, infestationOn:infestationOn,
800
+ wcChoice:wcChoice, goalSel:goalSel, timeLimit:timeLimit,
801
+ resPace:resPace, crateRate:crateRate, crateRateBase:crateRateBase,
802
+ curMap:curMap, curTheme:curTheme, battlefieldPreset:battlefieldPreset,
803
+ aiFactionSel:aiFactionSel, playerStartZone:playerStartZone, spawnPick:spawnPick,
804
+ aiSlots:aiSlots.map(A=>({on:A.on,diff:A.diff,zone:A.zone})),
805
+ opmods:Object.assign({},META.opmods||{})
806
+ };
807
+ return true;
808
+ }
809
+ function storyCampaignRestorePlan(){
810
+ const p=storyCampaignPrevPlan;
811
+ if(!p) return false;
812
+ storyCampaignPrevPlan=null;
813
+ difficulty=p.difficulty; defenseFocus=p.defenseFocus; infestationOn=p.infestationOn;
814
+ wcChoice=p.wcChoice; goalSel=p.goalSel; timeLimit=p.timeLimit;
815
+ resPace=p.resPace; crateRate=p.crateRate; crateRateBase=p.crateRateBase;
816
+ curMap=p.curMap; curTheme=p.curTheme; battlefieldPreset=p.battlefieldPreset;
817
+ aiFactionSel=p.aiFactionSel; playerStartZone=p.playerStartZone; spawnPick=p.spawnPick;
818
+ aiSlots.forEach((A,n)=>{ const s=p.aiSlots[n]; if(s){ A.on=s.on; A.diff=s.diff; A.zone=s.zone; } });
819
+ META.opmods=p.opmods;
820
  if(typeof metaSave==='function') metaSave();
821
+ /* The menu diorama caches the built theme, so handing curTheme back is not
822
+ enough on its own — the backdrop has to be told to rebuild. */
823
+ if(typeof applyTheme==='function') applyTheme();
824
  return true;
825
  }
826
+ /* Kept as the name main.js's return-to-menu hook already calls. */
827
+ function storyCampaignRestoreMods(){ return storyCampaignRestorePlan(); }
828
+ function storyCampaignPlanBorrowed(){ return !!storyCampaignPrevPlan; }
829
  /* story.js loads after endgame.js, so the wrapper is installed before initOps
830
  binds its tab listener. tutorial.js later wraps this wrapper in turn; both
831
  additions therefore survive without either feature editing the other. */
src/updater.js CHANGED
@@ -29,7 +29,7 @@
29
  ============================================================================ */
30
 
31
  /* Bumped by the release script. Compared against the manifest's `version`. */
32
- const APP_VERSION = '1.32.50';
33
 
34
  /* Release notes for the PACKAGED build, bumped by the release script beside
35
  APP_VERSION and PACKAGED_REV. A device that has never taken an OTA has no
 
29
  ============================================================================ */
30
 
31
  /* Bumped by the release script. Compared against the manifest's `version`. */
32
+ const APP_VERSION = '1.32.51';
33
 
34
  /* Release notes for the PACKAGED build, bumped by the release script beside
35
  APP_VERSION and PACKAGED_REV. A device that has never taken an OTA has no
update.json CHANGED
@@ -1,13 +1,13 @@
1
  {
2
- "notes": "HUD traffic control. Banners no longer collide: one measured lane owns every mid-battle popup and stacks them by urgency, so nothing overlaps on any screen. A height budget keeps the pile-up down \u2014 coaching drops first, the notice rail second, and a dropped message goes back in the queue instead of vanishing. One priority queue now fronts the notice rail, so a loot pickup can no longer erase an order acknowledgement, repeats collapse to a count, and flavour chatter is suppressed while you are fighting. The level-up chooser stops pausing the game on top of a firefight: it waits as a tappable chip and opens itself when the shooting stops. NO SESSION UI IN THE MENU, EVER \u2014 any front screen now takes down every battlefield surface, so alerts can no longer float over the main menu. Also: Dossier is factions-only and actually shows the codex again (it was hidden behind a dead tab), the mailbox got its unread counts and arc progression back, and newsletters/release log render like every other list.",
3
  "files": [
4
  {
5
- "path": "MASSFRONT-v1.32.50-update.js",
6
- "url": "https://huggingface.co/datasets/CREATORJD/massfront-releases/resolve/e59e969fe0f4c7608ede4322aea8fd58336b90ea/MASSFRONT-v1.32.50-update.js?download=true",
7
- "size": 26973362,
8
- "sha256": "2b8ad029e8531c1c89cae9a0a6b363e5bcc118d8b5f5fce5dec486f19ce8054a"
9
  }
10
  ],
11
  "base": "",
12
- "version": "1.32.50"
13
  }
 
1
  {
2
+ "notes": "The biome that would not leave \u2014 root cause. Opening an authored campaign mission wrote FIFTEEN fields of your own deployment plan (map, biome, difficulty, goal, time limit, AI faction and slots, start zone, spawn pick, scale, defence focus, infestation) and handed back exactly one of them. One prologue mission is authored on the arctic theme, so opening it once made the snow biome yours forever \u2014 and pressing START persisted it into the saved loadout, so it survived restarts. Missions now borrow the whole plan and give every field back by all three exits: declining the brief, quitting the run, finishing it. Remember-loadout no longer saves a plan that is on loan, and the menu diorama is rebuilt for the restored biome instead of staying cached in the mission's. New gate verifytheme.mjs.",
3
  "files": [
4
  {
5
+ "path": "MASSFRONT-v1.32.51-update.js",
6
+ "url": "https://huggingface.co/datasets/CREATORJD/massfront-releases/resolve/1942769a564230974ce1b4f5e51289bb88ae0580/MASSFRONT-v1.32.51-update.js?download=true",
7
+ "size": 26976357,
8
+ "sha256": "a2b0882f7d146b4642fc6fdcb9f43878567f8d15bef84b954b3b6f2f7724f81b"
9
  }
10
  ],
11
  "base": "",
12
+ "version": "1.32.51"
13
  }