Merge branch 'sup39' into deploy
This commit is contained in:
commit
59619c082a
9 changed files with 53 additions and 18 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"files": {
|
||||
"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/941.0c0a870a.chunk.js": "/static/js/941.0c0a870a.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",
|
||||
"index.html": "/index.html",
|
||||
"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",
|
||||
"941.0c0a870a.chunk.js.map": "/static/js/941.0c0a870a.chunk.js.map",
|
||||
"911.e40081a5.chunk.js.map": "/static/js/911.e40081a5.chunk.js.map",
|
||||
|
@ -19,6 +19,6 @@
|
|||
},
|
||||
"entrypoints": [
|
||||
"static/css/main.227156c4.css",
|
||||
"static/js/main.3703e36b.js"
|
||||
"static/js/main.45743cd2.js"
|
||||
]
|
||||
}
|
|
@ -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>
|
1
docs/static/js/main.3703e36b.js.map
vendored
1
docs/static/js/main.3703e36b.js.map
vendored
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
1
docs/static/js/main.45743cd2.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -5,6 +5,8 @@ import { GameData } from "./GameData";
|
|||
import { Slots } from "./Slots";
|
||||
import { VisibleInventory } from "./VisibleInventory";
|
||||
|
||||
export type EReloadStep = 1|2|3;
|
||||
|
||||
export const createSimulationState = (): SimulationState => {
|
||||
return new SimulationState(
|
||||
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 in this.namedSaves){
|
||||
this.reloadFrom(this.namedSaves[name]);
|
||||
this.reloadFrom(this.namedSaves[name], step);
|
||||
}
|
||||
}else{
|
||||
if(this.nextReloadName){
|
||||
if(this.nextReloadName in this.namedSaves){
|
||||
this.reloadFrom(this.namedSaves[this.nextReloadName]);
|
||||
this.reloadFrom(this.namedSaves[this.nextReloadName], step);
|
||||
}
|
||||
}else{
|
||||
const save = this.manualSave;
|
||||
if(save){
|
||||
this.reloadFrom(save);
|
||||
this.reloadFrom(save, step);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private reloadFrom(data: GameData) {
|
||||
this.gameData = data.deepClone();
|
||||
this.pouch.clearForReload();
|
||||
this.gameData.addAllToPouchOnReload(this.pouch);
|
||||
this.pouch.updateEquipmentDurability(this.gameData);
|
||||
private reloadFrom(data: GameData, step?: EReloadStep) {
|
||||
if (step == null || step === 1) {
|
||||
this.gameData = data.deepClone();
|
||||
this.pouch.clearForReload();
|
||||
}
|
||||
if (step == null || step === 2) {
|
||||
this.gameData.addAllToPouchOnReload(this.pouch);
|
||||
}
|
||||
if (step == null || step === 3) {
|
||||
this.pouch.updateEquipmentDurability(this.gameData);
|
||||
}
|
||||
this.isOnEventide = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Item } from "data/item";
|
||||
import { SimulationState } from "../SimulationState";
|
||||
import { SimulationState, EReloadStep } from "../SimulationState";
|
||||
import { joinItemStackString, processWrappers } from "./helper";
|
||||
import { ItemStackCommandWrapper } from "./ItemStackCommandWrapper";
|
||||
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{
|
||||
private name: string;
|
||||
constructor(name: string){
|
||||
|
|
|
@ -12,6 +12,7 @@ import {
|
|||
CommandInitialize,
|
||||
CommandNop,
|
||||
CommandReload,
|
||||
CommandReloadStep,
|
||||
CommandRemove,
|
||||
CommandSave,
|
||||
CommandSaveAs,
|
||||
|
@ -263,6 +264,15 @@ const parseSimpleCommands = (tokens: string[]): Command | undefined => {
|
|||
if(tokens.length===2 && keywordMatch(tokens[0],"reload")){
|
||||
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
|
||||
if (tokens.length > 2 && keywordMatch(tokens[0],"break") && keywordMatch(tokens[2],"slots") ){
|
||||
const slots = parseInt(tokens[1]);
|
||||
|
|
Reference in a new issue