1
0
Fork 0

Merge branch 'sup39' into deploy

This commit is contained in:
sup39 2022-11-07 20:52:42 +09:00
commit 59619c082a
9 changed files with 53 additions and 18 deletions

View file

@ -1,7 +1,7 @@
{ {
"files": { "files": {
"main.css": "/static/css/main.227156c4.css", "main.css": "/static/css/main.227156c4.css",
"main.js": "/static/js/main.3703e36b.js", "main.js": "/static/js/main.45743cd2.js",
"static/js/984.b2865733.chunk.js": "/static/js/984.b2865733.chunk.js", "static/js/984.b2865733.chunk.js": "/static/js/984.b2865733.chunk.js",
"static/js/941.0c0a870a.chunk.js": "/static/js/941.0c0a870a.chunk.js", "static/js/941.0c0a870a.chunk.js": "/static/js/941.0c0a870a.chunk.js",
"static/js/911.e40081a5.chunk.js": "/static/js/911.e40081a5.chunk.js", "static/js/911.e40081a5.chunk.js": "/static/js/911.e40081a5.chunk.js",
@ -11,7 +11,7 @@
"static/media/Calamity-Regular.otf": "/static/media/Calamity-Regular.cbeefc650e6ac39335b6.otf", "static/media/Calamity-Regular.otf": "/static/media/Calamity-Regular.cbeefc650e6ac39335b6.otf",
"index.html": "/index.html", "index.html": "/index.html",
"main.227156c4.css.map": "/static/css/main.227156c4.css.map", "main.227156c4.css.map": "/static/css/main.227156c4.css.map",
"main.3703e36b.js.map": "/static/js/main.3703e36b.js.map", "main.45743cd2.js.map": "/static/js/main.45743cd2.js.map",
"984.b2865733.chunk.js.map": "/static/js/984.b2865733.chunk.js.map", "984.b2865733.chunk.js.map": "/static/js/984.b2865733.chunk.js.map",
"941.0c0a870a.chunk.js.map": "/static/js/941.0c0a870a.chunk.js.map", "941.0c0a870a.chunk.js.map": "/static/js/941.0c0a870a.chunk.js.map",
"911.e40081a5.chunk.js.map": "/static/js/911.e40081a5.chunk.js.map", "911.e40081a5.chunk.js.map": "/static/js/911.e40081a5.chunk.js.map",
@ -19,6 +19,6 @@
}, },
"entrypoints": [ "entrypoints": [
"static/css/main.227156c4.css", "static/css/main.227156c4.css",
"static/js/main.3703e36b.js" "static/js/main.45743cd2.js"
] ]
} }

View file

@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="for Breath of the Wild"/><meta property="og:site_name" content="itntpiston.app"/><meta property="og:title" content="Inventory Slot Transfer Simulator"><meta property="og:type" content="website"><meta property="og:url" content="https://ist.botw.sup39.dev/#/"><meta property="og:description" content="for Breath of the Wild"><link rel="manifest" href="/manifest.json"/><title>IST Simulator</title><script defer="defer" src="/static/js/main.3703e36b.js"></script><link href="/static/css/main.227156c4.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html> <!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="for Breath of the Wild"/><meta property="og:site_name" content="itntpiston.app"/><meta property="og:title" content="Inventory Slot Transfer Simulator"><meta property="og:type" content="website"><meta property="og:url" content="https://ist.botw.sup39.dev/#/"><meta property="og:description" content="for Breath of the Wild"><link rel="manifest" href="/manifest.json"/><title>IST Simulator</title><script defer="defer" src="/static/js/main.45743cd2.js"></script><link href="/static/css/main.227156c4.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
docs/static/js/main.45743cd2.js.map vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -5,6 +5,8 @@ import { GameData } from "./GameData";
import { Slots } from "./Slots"; import { Slots } from "./Slots";
import { VisibleInventory } from "./VisibleInventory"; import { VisibleInventory } from "./VisibleInventory";
export type EReloadStep = 1|2|3;
export const createSimulationState = (): SimulationState => { export const createSimulationState = (): SimulationState => {
return new SimulationState( return new SimulationState(
new GameData(new Slots([])), new GameData(new Slots([])),
@ -78,30 +80,36 @@ export class SimulationState {
} }
} }
public reload(name?: string) { public reload(name?: string, step?: EReloadStep) {
if(name){ if(name){
if(name in this.namedSaves){ if(name in this.namedSaves){
this.reloadFrom(this.namedSaves[name]); this.reloadFrom(this.namedSaves[name], step);
} }
}else{ }else{
if(this.nextReloadName){ if(this.nextReloadName){
if(this.nextReloadName in this.namedSaves){ if(this.nextReloadName in this.namedSaves){
this.reloadFrom(this.namedSaves[this.nextReloadName]); this.reloadFrom(this.namedSaves[this.nextReloadName], step);
} }
}else{ }else{
const save = this.manualSave; const save = this.manualSave;
if(save){ if(save){
this.reloadFrom(save); this.reloadFrom(save, step);
} }
} }
} }
} }
private reloadFrom(data: GameData) { private reloadFrom(data: GameData, step?: EReloadStep) {
this.gameData = data.deepClone(); if (step == null || step === 1) {
this.pouch.clearForReload(); this.gameData = data.deepClone();
this.gameData.addAllToPouchOnReload(this.pouch); this.pouch.clearForReload();
this.pouch.updateEquipmentDurability(this.gameData); }
if (step == null || step === 2) {
this.gameData.addAllToPouchOnReload(this.pouch);
}
if (step == null || step === 3) {
this.pouch.updateEquipmentDurability(this.gameData);
}
this.isOnEventide = false; this.isOnEventide = false;
} }

View file

@ -1,5 +1,5 @@
import { Item } from "data/item"; import { Item } from "data/item";
import { SimulationState } from "../SimulationState"; import { SimulationState, EReloadStep } from "../SimulationState";
import { joinItemStackString, processWrappers } from "./helper"; import { joinItemStackString, processWrappers } from "./helper";
import { ItemStackCommandWrapper } from "./ItemStackCommandWrapper"; import { ItemStackCommandWrapper } from "./ItemStackCommandWrapper";
import { CommandImpl } from "./type"; import { CommandImpl } from "./type";
@ -59,6 +59,23 @@ export class CommandReload extends CommandImpl {
} }
} }
export class CommandReloadStep extends CommandImpl {
static stepLabels = {
1: "[Step 1] Clear Visible Inventory",
2: "[Step 2] Add All Items in GameData to Visible Inventory",
3: "[Step 3] Update Equipment Durability",
};
constructor(private step: EReloadStep, private name?: string){
super();
}
public execute(state: SimulationState): void {
state.reload(this.name, this.step);
}
public getDisplayString(): string {
return `Reload${this.name?` ${this.name}`:""} ${CommandReloadStep.stepLabels[this.step]}`;
}
}
export class CommandUse extends CommandImpl{ export class CommandUse extends CommandImpl{
private name: string; private name: string;
constructor(name: string){ constructor(name: string){

View file

@ -12,6 +12,7 @@ import {
CommandInitialize, CommandInitialize,
CommandNop, CommandNop,
CommandReload, CommandReload,
CommandReloadStep,
CommandRemove, CommandRemove,
CommandSave, CommandSave,
CommandSaveAs, CommandSaveAs,
@ -263,6 +264,15 @@ const parseSimpleCommands = (tokens: string[]): Command | undefined => {
if(tokens.length===2 && keywordMatch(tokens[0],"reload")){ if(tokens.length===2 && keywordMatch(tokens[0],"reload")){
return new CommandReload(tokens[1]); return new CommandReload(tokens[1]);
} }
for (const step of [1, 2, 3] as const) {
const kw = "reload"+step;
if(tokens.length===1 && keywordMatch(tokens[0],kw)){
return new CommandReloadStep(step);
}
if(tokens.length===2 && keywordMatch(tokens[0],kw)){
return new CommandReloadStep(step, tokens[1]);
}
}
// break // break
if (tokens.length > 2 && keywordMatch(tokens[0],"break") && keywordMatch(tokens[2],"slots") ){ if (tokens.length > 2 && keywordMatch(tokens[0],"break") && keywordMatch(tokens[2],"slots") ){
const slots = parseInt(tokens[1]); const slots = parseInt(tokens[1]);