@wwawing/engine 3.9.0-alpha.0 → 3.9.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/wwa_data.d.ts CHANGED
@@ -567,4 +567,4 @@ export declare enum IDTable {
567
567
  }
568
568
  export declare type StatusSolutionKind = "all" | "bare" | "equipment";
569
569
  export declare type UserVarNameListRequestErrorKind = JsonResponseErrorKind | "notObject" | "noFileSpecified";
570
- export declare type SetMacroType = 'VARIABLE' | 'NUMBER' | 'HP' | 'HPMAX' | 'AT' | 'DF' | 'GD' | 'TIME' | 'STEP' | 'RAND';
570
+ export declare type ConditionalMacroExecStatus = "outside-ifelse" | "can-execute" | "cannot-execute" | "executed";
package/lib/wwa_main.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Coord, Position, LoaderProgress, LoadStage, YesNoState, Face, SidebarButton, SpeedChange, PartsType, AppearanceTriggerType, EquipmentStatus, ChangeStyleType, MacroStatusIndex, UserDevice, MacroImgFrameIndex, StatusKind, StatusSolutionKind, SetMacroType } from "./wwa_data";
1
+ import { Coord, Position, LoaderProgress, LoadStage, YesNoState, Face, SidebarButton, SpeedChange, PartsType, AppearanceTriggerType, EquipmentStatus, ChangeStyleType, MacroStatusIndex, UserDevice, MacroImgFrameIndex, StatusKind, StatusSolutionKind } from "./wwa_data";
2
2
  import { MessageWindow, ParsedMessage } from "./wwa_message";
3
3
  import { ItemMenu } from "./wwa_item_menu";
4
4
  import { WWACompress } from "./wwa_save";
@@ -77,6 +77,7 @@ export declare class WWA {
77
77
  private _mapObjectIDTable;
78
78
  wwaCustomEventEmitter: IEventEmitter;
79
79
  private _scoreRates?;
80
+ private _conditionalMacroExecStatus;
80
81
  debug: boolean;
81
82
  private hoge;
82
83
  private _loadHandler;
@@ -270,12 +271,10 @@ export declare class WWA {
270
271
  setUserValRandNum(x: number, num: number, bias: number): void;
271
272
  private _generateUserValString;
272
273
  speedChangeJudge(speedChangeFlag: boolean): void;
273
- execIfMacro(macroStr?: string): void;
274
+ switchConditionalExecutionStatus(descriminant?: string): void;
274
275
  execSetMacro(macroStr?: string): void;
275
- parseType(str: string): SetMacroType | null;
276
- parseValue(str: string): number;
277
- checkCondition(macroStr: any): boolean;
278
- ifElseResetStatus(): void;
276
+ private _generateTokenValues;
277
+ resetConditionalMacroExecStaus(): void;
279
278
  userVarUserIf(_triggerPartsPosition: Coord, args: string[]): void;
280
279
  private compareUserVar;
281
280
  setPlayerSpeedIndex(speedIndex: number): void;
@@ -22,7 +22,7 @@ export declare class Macro {
22
22
  macroType: MacroType;
23
23
  macroArgs: string[];
24
24
  constructor(_wwa: WWA, _triggerPartsID: number, _triggerPartsType: number, _triggerPartsPosition: Coord, macroType: MacroType, macroArgs: string[]);
25
- isIFMacro(): boolean;
25
+ isJunction(): boolean;
26
26
  execute(): void;
27
27
  private _concatEmptyArgs;
28
28
  private _parseInt;
@@ -0,0 +1,5 @@
1
+ import { type TokenValues } from "./parsers";
2
+ import { type ValueAssignOperation } from "./value-assign-operation";
3
+ export { TokenValues, ValueAssignOperation };
4
+ export declare function parseSetMacroExpression(macroStr: string, tokenValues: TokenValues): ValueAssignOperation;
5
+ export declare function checkCondition(descriminant: string, tokenValues: TokenValues): boolean;
@@ -0,0 +1,14 @@
1
+ import { Status } from "../wwa_data";
2
+ export interface TokenValues {
3
+ status: Status;
4
+ energyMax: number;
5
+ moveCount: number;
6
+ playTime: number;
7
+ userVars: number[];
8
+ }
9
+ export declare type SetMacroType = 'VARIABLE' | 'NUMBER' | 'HP' | 'HPMAX' | 'AT' | 'DF' | 'GD' | 'TIME' | 'STEP' | 'RAND';
10
+ export declare function calc(operator: string, leftValue: number, rightValue: number): number;
11
+ export declare function parseType(str: string): SetMacroType | null;
12
+ export declare function parseValue(value: string, tokenValues: TokenValues): number;
13
+ export declare function parseVariable(value: string, tokenValues: TokenValues): number;
14
+ export declare function parseNumber(value: string): number;
@@ -0,0 +1,5 @@
1
+ export interface ValueAssignOperation {
2
+ asignee: "energy" | "energyMax" | "strength" | "defence" | "gold" | number;
3
+ rawValue: number;
4
+ }
5
+ export declare function generateValueAssignOperation(calcResult: number, assigneeExpression: string): ValueAssignOperation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wwawing/engine",
3
- "version": "3.9.0-alpha.0",
3
+ "version": "3.9.0-alpha.1",
4
4
  "description": "World Wide Adventure: an RPG Engine.",
5
5
  "main": "./lib/wwa.js",
6
6
  "files": [
@@ -41,28 +41,28 @@
41
41
  },
42
42
  "homepage": "https://github.com/WWAWing/WWAWing#readme",
43
43
  "devDependencies": {
44
- "@types/crypto-js": "^4.0.1",
45
- "@types/pug": "^2.0.4",
46
- "@types/terser-webpack-plugin": "^5.0.3",
44
+ "@types/crypto-js": "^4.1.1",
45
+ "@types/pug": "^2.0.6",
46
+ "@types/terser-webpack-plugin": "^5.2.0",
47
47
  "@types/webpack": "^5.28.0",
48
- "@wwawing/assets": "^3.9.0-alpha.0",
49
- "@wwawing/common-interface": "^3.9.0-alpha.0",
50
- "@wwawing/debug-server": "^3.9.0-alpha.0",
51
- "@wwawing/event-emitter": "^3.9.0-alpha.0",
52
- "@wwawing/loader": "^3.9.0-alpha.0",
53
- "@wwawing/page-generator": "^3.9.0-alpha.0",
54
- "@wwawing/styles": "^3.9.0-alpha.0",
55
- "crypto-js": "4.0.0",
48
+ "@wwawing/assets": "^3.9.0-alpha.1",
49
+ "@wwawing/common-interface": "^3.9.0-alpha.1",
50
+ "@wwawing/debug-server": "^3.9.0-alpha.1",
51
+ "@wwawing/event-emitter": "^3.9.0-alpha.1",
52
+ "@wwawing/loader": "^3.9.0-alpha.1",
53
+ "@wwawing/page-generator": "^3.9.0-alpha.1",
54
+ "@wwawing/styles": "^3.9.0-alpha.1",
55
+ "crypto-js": "^4.1.1",
56
56
  "npm-run-all": "^4.1.5",
57
57
  "pug": "^3.0.2",
58
- "shelljs": "^0.8.4",
59
- "shx": "^0.3.3",
60
- "terser-webpack-plugin": "^5.3.0",
61
- "ts-loader": "^4.3.0",
58
+ "shelljs": "^0.8.5",
59
+ "shx": "^0.3.4",
60
+ "terser-webpack-plugin": "^5.3.3",
61
+ "ts-loader": "^9.3.0",
62
62
  "ts-node": "^10.8.1",
63
63
  "typescript": "^4.7.3",
64
- "webpack": "^5.65.0",
65
- "webpack-cli": "^4.9.1"
64
+ "webpack": "^5.73.0",
65
+ "webpack-cli": "^4.10.0"
66
66
  },
67
67
  "publishConfig": {
68
68
  "access": "public"
@@ -71,5 +71,5 @@
71
71
  "node": ">=16",
72
72
  "npm": ">=8"
73
73
  },
74
- "gitHead": "99b7175f1ec57c4a21809a3faf5d82aba0e81f3c"
74
+ "gitHead": "ef5d59692a13186783dd763d4ad796414fcdd2c8"
75
75
  }