@wwawing/engine 3.5.14 → 3.6.0-alpha.3
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/debug/make-debug-pages.ts +3 -0
- package/debug/maps-config.ts +2 -1
- package/lib/wwa.js +3 -3
- package/lib/wwa_data.d.ts +67 -1
- package/lib/wwa_main.d.ts +47 -4
- package/lib/wwa_message.d.ts +39 -6
- package/lib/wwa_parts_player.d.ts +4 -2
- package/lib/wwa_save/WWACompress.d.ts +3 -0
- package/package.json +9 -9
package/lib/wwa_data.d.ts
CHANGED
|
@@ -225,6 +225,36 @@ export declare enum MacroType {
|
|
|
225
225
|
COLOR = 21,
|
|
226
226
|
WAIT = 22,
|
|
227
227
|
SOUND = 23,
|
|
228
|
+
JUMPGATE = 24,
|
|
229
|
+
RECPOSITION = 25,
|
|
230
|
+
JUMPRECPOSITION = 26,
|
|
231
|
+
CONSOLE_LOG = 27,
|
|
232
|
+
COPY_HP_TO = 28,
|
|
233
|
+
SET_HP = 29,
|
|
234
|
+
COPY_HPMAX_TO = 30,
|
|
235
|
+
SET_HPMAX = 31,
|
|
236
|
+
COPY_AT_TO = 32,
|
|
237
|
+
SET_AT = 33,
|
|
238
|
+
COPY_DF_TO = 34,
|
|
239
|
+
SET_DF = 35,
|
|
240
|
+
COPY_MONEY_TO = 36,
|
|
241
|
+
SET_MOENEY = 37,
|
|
242
|
+
COPY_STEP_COUNT_TO = 38,
|
|
243
|
+
VAR_SET_VAL = 39,
|
|
244
|
+
VAR_SET = 40,
|
|
245
|
+
VAR_ADD = 41,
|
|
246
|
+
VAR_SUB = 42,
|
|
247
|
+
VAR_MUL = 43,
|
|
248
|
+
VAR_DIV = 44,
|
|
249
|
+
VAR_SET_RAND = 45,
|
|
250
|
+
SHOW_STR = 46,
|
|
251
|
+
GAME_SPEED = 47,
|
|
252
|
+
IF = 50,
|
|
253
|
+
SET_SPEED = 51,
|
|
254
|
+
COPY_TIME_TO = 52,
|
|
255
|
+
HIDE_STATUS = 53,
|
|
256
|
+
VAR_MAP = 54,
|
|
257
|
+
VAR_MOD = 55,
|
|
228
258
|
GAMEPAD_BUTTON = 100,
|
|
229
259
|
OLDMOVE = 101
|
|
230
260
|
}
|
|
@@ -253,6 +283,36 @@ export declare var macrotable: {
|
|
|
253
283
|
$color: number;
|
|
254
284
|
$wait: number;
|
|
255
285
|
$sound: number;
|
|
286
|
+
$jumpgate: number;
|
|
287
|
+
$rec_pos: number;
|
|
288
|
+
$jump_rec_pos: number;
|
|
289
|
+
$console_log: number;
|
|
290
|
+
$copy_hp_to: number;
|
|
291
|
+
$set_hp: number;
|
|
292
|
+
$copy_hpmax_to: number;
|
|
293
|
+
$set_hpmax: number;
|
|
294
|
+
$copy_at_to: number;
|
|
295
|
+
$set_at: number;
|
|
296
|
+
$copy_df_to: number;
|
|
297
|
+
$set_df: number;
|
|
298
|
+
$copy_money_to: number;
|
|
299
|
+
$set_money: number;
|
|
300
|
+
$copy_step_count_to: number;
|
|
301
|
+
$var_set_val: number;
|
|
302
|
+
$var_set: number;
|
|
303
|
+
$var_add: number;
|
|
304
|
+
$var_sub: number;
|
|
305
|
+
$var_mul: number;
|
|
306
|
+
$var_div: number;
|
|
307
|
+
$var_set_rand: number;
|
|
308
|
+
$show_str: number;
|
|
309
|
+
$game_speed: number;
|
|
310
|
+
$if: number;
|
|
311
|
+
$set_speed: number;
|
|
312
|
+
$copy_time_to: number;
|
|
313
|
+
$hide_status: number;
|
|
314
|
+
$var_map: number;
|
|
315
|
+
$var_mod: number;
|
|
256
316
|
$gamepad_button: number;
|
|
257
317
|
$oldmove: number;
|
|
258
318
|
};
|
|
@@ -280,6 +340,8 @@ export declare enum SystemSound {
|
|
|
280
340
|
}
|
|
281
341
|
export declare var speedList: number[];
|
|
282
342
|
export declare var speedNameList: string[];
|
|
343
|
+
export declare const StatusKind: readonly ["energy", "strength", "defence", "gold"];
|
|
344
|
+
export declare type StatusKind = typeof StatusKind[number];
|
|
283
345
|
export declare class WWAConsts {
|
|
284
346
|
static WWA_HOME: string;
|
|
285
347
|
static ITEMBOX_SIZE: number;
|
|
@@ -356,9 +418,9 @@ export declare class WWAConsts {
|
|
|
356
418
|
static MAP_WINDOW_HEIGHT: number;
|
|
357
419
|
static H_PARTS_NUM_IN_WINDOW: number;
|
|
358
420
|
static V_PARTS_NUM_IN_WINDOW: number;
|
|
359
|
-
static DEFAULT_SPEED_INDEX: number;
|
|
360
421
|
static MIN_SPEED_INDEX: number;
|
|
361
422
|
static MAX_SPEED_INDEX: number;
|
|
423
|
+
static QUICK_BATTLE_SPEED_INDECIES: number[];
|
|
362
424
|
static ANIMATION_REP_HALF_FRAME: number;
|
|
363
425
|
static PLAYER_LOOKING_AROUND_START_FRAME: number;
|
|
364
426
|
static RELATIVE_COORD_BIAS: number;
|
|
@@ -407,6 +469,9 @@ export declare class WWAConsts {
|
|
|
407
469
|
static MSG_STR_WIDTH: number;
|
|
408
470
|
static ITEM_EFFECT_SPEED_PIXEL_PER_FRAME: number;
|
|
409
471
|
static ITEMBOX_TOP_Y: number;
|
|
472
|
+
static USER_VAR_NUM: number;
|
|
473
|
+
static USER_VAR_NUM_MAX_VALUE: number;
|
|
474
|
+
static USET_VAR_NUM_MIN_VALUE: number;
|
|
410
475
|
static CONTROLL_WAIT_FRAME: number;
|
|
411
476
|
}
|
|
412
477
|
export declare class WWASaveConsts {
|
|
@@ -490,3 +555,4 @@ export declare enum IDTable {
|
|
|
490
555
|
BITSHIFT = 16,
|
|
491
556
|
BITMASK = 65535
|
|
492
557
|
}
|
|
558
|
+
export declare type StatusSolutionKind = "all" | "bare" | "equipment";
|
package/lib/wwa_main.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Coord, Position, LoaderProgress, LoadStage, YesNoState, Face, SidebarButton, SpeedChange, PartsType, AppearanceTriggerType, EquipmentStatus, ChangeStyleType, MacroStatusIndex, UserDevice, MacroImgFrameIndex } from "./wwa_data";
|
|
2
|
-
import { MessageWindow,
|
|
1
|
+
import { Coord, Position, LoaderProgress, LoadStage, YesNoState, Face, SidebarButton, SpeedChange, PartsType, AppearanceTriggerType, EquipmentStatus, ChangeStyleType, MacroStatusIndex, UserDevice, MacroImgFrameIndex, StatusKind, StatusSolutionKind } from "./wwa_data";
|
|
2
|
+
import { MessageWindow, ParsedMessage } from "./wwa_message";
|
|
3
3
|
import { ItemMenu } from "./wwa_item_menu";
|
|
4
4
|
import { WWACompress } from "./wwa_save";
|
|
5
5
|
import { IEventEmitter } from "@wwawing/event-emitter";
|
|
@@ -80,7 +80,9 @@ export declare class WWA {
|
|
|
80
80
|
private audioExtension;
|
|
81
81
|
userDevice: UserDevice;
|
|
82
82
|
private soundLoadedCheckTimer;
|
|
83
|
-
|
|
83
|
+
private _startTime;
|
|
84
|
+
private _dumpElement;
|
|
85
|
+
constructor(mapFileName: string, urlgateEnabled: boolean, titleImgName: string, classicModeEnabled: boolean, itemEffectEnabled: boolean, useGoToWWA: boolean, audioDirectory?: string, disallowLoadOldSave?: boolean, dumpElm?: HTMLElement);
|
|
84
86
|
private _setProgressBar;
|
|
85
87
|
private _setLoadingMessage;
|
|
86
88
|
private _setErrorMessage;
|
|
@@ -100,6 +102,7 @@ export declare class WWA {
|
|
|
100
102
|
onpasssuspendsavecalled(): void;
|
|
101
103
|
onitemmenucalled(): void;
|
|
102
104
|
onchangespeed(type: SpeedChange): void;
|
|
105
|
+
isbattleSpeeIndexForQuickBattle(battleSpeedIndex: number): boolean;
|
|
103
106
|
private _checkTurnKeyPressed;
|
|
104
107
|
private _main;
|
|
105
108
|
vibration(isStrong: boolean): void;
|
|
@@ -145,7 +148,7 @@ export declare class WWA {
|
|
|
145
148
|
private _execObjectScoreEvent;
|
|
146
149
|
private _execChoiceWindowRunningEvent;
|
|
147
150
|
setMessageQueue(message: string, showChoice: boolean, isSystemMessage: boolean, partsID?: number, partsType?: PartsType, partsPosition?: Coord, messageDisplayed?: boolean): boolean;
|
|
148
|
-
getMessageQueueByRawMessage(message: string, partsID: number, partsType: PartsType, partsPosition: Coord, isSystemMessage?: boolean):
|
|
151
|
+
getMessageQueueByRawMessage(message: string, partsID: number, partsType: PartsType, partsPosition: Coord, isSystemMessage?: boolean): ParsedMessage[];
|
|
149
152
|
appearParts(pos: Coord, triggerType: AppearanceTriggerType, triggerPartsID?: number): void;
|
|
150
153
|
appearPartsByDirection(distance: number, targetPartsID: number, targetPartsType: PartsType): void;
|
|
151
154
|
appearPartsEval(triggerPartsPos: Coord, xstr: string, ystr: string, targetPartsID: number, targetPartsType: PartsType): void;
|
|
@@ -227,6 +230,44 @@ export declare class WWA {
|
|
|
227
230
|
showMonsterWindow(): void;
|
|
228
231
|
isClassicMode(): boolean;
|
|
229
232
|
isConsoleOutputMode(): boolean;
|
|
233
|
+
forcedJumpGate(jx: number, jy: number): void;
|
|
234
|
+
setUserVar(index: number, value: number): void;
|
|
235
|
+
private toAssignableValue;
|
|
236
|
+
private isValidUserVarIndex;
|
|
237
|
+
private isNotNumberTypeOrNaN;
|
|
238
|
+
getUserVar(no: number): number;
|
|
239
|
+
recUserPosition(x: number, y: number): void;
|
|
240
|
+
jumpRecUserPosition(x: number, y: number): void;
|
|
241
|
+
outputUserVar(num: number): void;
|
|
242
|
+
setUserVarHP(num: number): void;
|
|
243
|
+
setUserVarHPMAX(num: number): void;
|
|
244
|
+
setUserVarAT(num: number, kind: StatusSolutionKind): void;
|
|
245
|
+
setUserVarDF(num: number, kind: StatusSolutionKind): void;
|
|
246
|
+
setUserVarMONEY(num: number): void;
|
|
247
|
+
private toValidStatusValue;
|
|
248
|
+
setHPUserVar(index: number): void;
|
|
249
|
+
setHPMAXUserVar(index: number): void;
|
|
250
|
+
setATUserVar(index: number): void;
|
|
251
|
+
setDFUserVar(index: number): void;
|
|
252
|
+
setMONEYUserVar(index: number): void;
|
|
253
|
+
setUserVarStep(num: number): void;
|
|
254
|
+
setUserVarVal(x: number, num: number): void;
|
|
255
|
+
setUserValOtherUserVal(x: number, y: number): void;
|
|
256
|
+
setUserValAdd(x: number, y: number): void;
|
|
257
|
+
setUserValSub(x: number, y: number): void;
|
|
258
|
+
setUserValMul(x: number, y: number): void;
|
|
259
|
+
setUserValDiv(x: number, y: number): void;
|
|
260
|
+
setUserValMod(x: number, y: number): void;
|
|
261
|
+
setUserValRandNum(x: number, num: number): void;
|
|
262
|
+
private _generateUserValString;
|
|
263
|
+
speedChangeJudge(speedChangeFlag: boolean): void;
|
|
264
|
+
userVarUserIf(_triggerPartsPosition: Coord, args: string[]): void;
|
|
265
|
+
private compareUserVar;
|
|
266
|
+
setPlayerSpeedIndex(speedIndex: number): void;
|
|
267
|
+
setUserVarPlayTime(num: number): void;
|
|
268
|
+
private setNowPlayTime;
|
|
269
|
+
hideStatus(no: number, isHide: boolean): void;
|
|
270
|
+
varMap(triggerPartsPos: Coord, xstr: string, ystr: string, partsID: number, targetPartsType: PartsType): void;
|
|
230
271
|
setItemboxBackgroundPosition(pos: {
|
|
231
272
|
x: number;
|
|
232
273
|
y: number;
|
|
@@ -234,4 +275,6 @@ export declare class WWA {
|
|
|
234
275
|
private _actionGamePadButtonItemMacro;
|
|
235
276
|
setGamePadButtonItemTable(buttonID: number, itemBoxNo: number): void;
|
|
236
277
|
private _checkSaveDataCompatibility;
|
|
278
|
+
isVisibleStatus(statusKind: StatusKind): boolean;
|
|
279
|
+
private _changeStatusVisibility;
|
|
237
280
|
}
|
package/lib/wwa_message.d.ts
CHANGED
|
@@ -3,14 +3,17 @@ import { Coord, PartsType, MacroType, Position, Direction } from "./wwa_data";
|
|
|
3
3
|
import { Monster } from "./wwa_monster";
|
|
4
4
|
import { WWAData } from "./wwa_data";
|
|
5
5
|
import { WWASave } from "./wwa_save";
|
|
6
|
-
export declare
|
|
7
|
-
|
|
6
|
+
export declare type LazyEvaluateValue = () => number;
|
|
7
|
+
export declare type MessageSegments = (string | LazyEvaluateValue)[];
|
|
8
|
+
export declare class ParsedMessage {
|
|
8
9
|
isSystemMessage: boolean;
|
|
9
10
|
isEndOfPartsEvent?: boolean;
|
|
10
11
|
macro?: Macro[];
|
|
11
|
-
|
|
12
|
+
private messageArray;
|
|
13
|
+
constructor(textOrMessageSegments: string | MessageSegments, isSystemMessage: boolean, isEndOfPartsEvent?: boolean, macro?: Macro[]);
|
|
14
|
+
isEmpty(): boolean;
|
|
15
|
+
generatePrintableMessage(): string;
|
|
12
16
|
}
|
|
13
|
-
export declare function strArrayToMessageInfoArray(strArray: string[], isSystemMessage: boolean): MessageInfo[];
|
|
14
17
|
export declare class Macro {
|
|
15
18
|
private _wwa;
|
|
16
19
|
private _triggerPartsID;
|
|
@@ -22,6 +25,36 @@ export declare class Macro {
|
|
|
22
25
|
execute(): void;
|
|
23
26
|
private _concatEmptyArgs;
|
|
24
27
|
private _parseInt;
|
|
28
|
+
private _executeJumpGateMacro;
|
|
29
|
+
private _executeRecPositionMacro;
|
|
30
|
+
private _executeJumpRecPositionMacro;
|
|
31
|
+
private _executeConsoleLogMacro;
|
|
32
|
+
private _executeCopyHpToMacro;
|
|
33
|
+
private _executeCopyHpMaxToMacro;
|
|
34
|
+
private _executeCopyAtToMacro;
|
|
35
|
+
private _executeCopyDfToMacro;
|
|
36
|
+
private _parseStatusKind;
|
|
37
|
+
private _executeCopyMoneyToMacro;
|
|
38
|
+
private _executeSetHPMacro;
|
|
39
|
+
private _executeSetHpMaxMacro;
|
|
40
|
+
private _executeSetAtMacro;
|
|
41
|
+
private _executeSetDfMacro;
|
|
42
|
+
private _executeSetMoneyMacro;
|
|
43
|
+
private _executeSetStepCountMacro;
|
|
44
|
+
private _executeVarSetValMacro;
|
|
45
|
+
private _executeVarSetMacro;
|
|
46
|
+
private _executeVarAddMacro;
|
|
47
|
+
private _executeVarSubMacro;
|
|
48
|
+
private _executeVarMulMacro;
|
|
49
|
+
private _executeVarDivMacro;
|
|
50
|
+
private _executeVarModMacro;
|
|
51
|
+
private _executeVarSetRandMacro;
|
|
52
|
+
private _executeGameSpeedMacro;
|
|
53
|
+
private _executeIfMacro;
|
|
54
|
+
private _executeSetSpeedMacro;
|
|
55
|
+
private _executeCopyTimeToMacro;
|
|
56
|
+
private _hideStatusMacro;
|
|
57
|
+
private _varMapMacro;
|
|
25
58
|
private _executeImgPlayerMacro;
|
|
26
59
|
private _executeImgYesNoMacro;
|
|
27
60
|
private _executeHPMaxMacro;
|
|
@@ -111,11 +144,11 @@ export declare class MessageWindow {
|
|
|
111
144
|
private _save_select_id;
|
|
112
145
|
private _save_counter;
|
|
113
146
|
private _save_close;
|
|
114
|
-
constructor(wwa: WWA, x: number, y: number, width: number, height: number,
|
|
147
|
+
constructor(wwa: WWA, x: number, y: number, width: number, height: number, cgFileName: string, isVisible: boolean, isYesno: boolean, isItemMenu: boolean, parentElement: HTMLElement);
|
|
115
148
|
setPosition(x: number, y: number, width: number, height: number): void;
|
|
116
149
|
setPositionByPlayerPosition(existsFaces: boolean, existsScoreWindow: boolean, displayCenter: boolean, playerPos: Position, cameraPos: Position): void;
|
|
117
150
|
setPositionEasy(pos: Positioning): void;
|
|
118
|
-
|
|
151
|
+
setParsedMessage(message: ParsedMessage): void;
|
|
119
152
|
setYesNoChoice(isYesNo: boolean): boolean;
|
|
120
153
|
isYesNoChoice(): boolean;
|
|
121
154
|
isSaveChoice(): boolean;
|
|
@@ -22,7 +22,8 @@ export declare enum PlayerState {
|
|
|
22
22
|
LOCALGATE_JUMPED = 4,
|
|
23
23
|
BATTLE = 5,
|
|
24
24
|
ESTIMATE_WINDOW_WAITING = 6,
|
|
25
|
-
PASSWORD_WINDOW_WAITING = 7
|
|
25
|
+
PASSWORD_WINDOW_WAITING = 7,
|
|
26
|
+
LOCALGATE_JUMPED_WITH_MESSAGE = 8
|
|
26
27
|
}
|
|
27
28
|
export declare class Player extends PartsObject {
|
|
28
29
|
protected _status: Status;
|
|
@@ -103,6 +104,7 @@ export declare class Player extends PartsObject {
|
|
|
103
104
|
setGold(g: number): number;
|
|
104
105
|
getStatus(): Status;
|
|
105
106
|
getStatusWithoutEquipments(): Status;
|
|
107
|
+
getStatusOfEquipments(): EquipmentStatus;
|
|
106
108
|
updateStatusValueBox(): void;
|
|
107
109
|
readonly itemTransitioningClassName = "item-transitioning";
|
|
108
110
|
readonly overwittenItemClassName = "item-overwritten";
|
|
@@ -163,5 +165,5 @@ export declare class Player extends PartsObject {
|
|
|
163
165
|
getSpeedIndex(): number;
|
|
164
166
|
speedUp(): number;
|
|
165
167
|
speedDown(): number;
|
|
166
|
-
constructor(wwa: WWA, pos: Position, camera: Camera, status: Status, em: number, moves: number);
|
|
168
|
+
constructor(wwa: WWA, pos: Position, camera: Camera, status: Status, em: number, moves: number, gameSpeedIndex: number);
|
|
167
169
|
}
|
|
@@ -12,6 +12,7 @@ export default class WWACompress {
|
|
|
12
12
|
private static _firstRandomMapObjectUtf8Table;
|
|
13
13
|
static compress(wwaData: WWAData): object;
|
|
14
14
|
private static compressObject;
|
|
15
|
+
private static compressUserVars;
|
|
15
16
|
private static compressMapAllObject;
|
|
16
17
|
private static indexListCompress;
|
|
17
18
|
private static idSort;
|
|
@@ -19,6 +20,8 @@ export default class WWACompress {
|
|
|
19
20
|
private static getDecompressArray;
|
|
20
21
|
static decompress(saveObject: object): WWADataWithWorldNameStatus;
|
|
21
22
|
private static decompressObject;
|
|
23
|
+
private static decompressUserVars;
|
|
24
|
+
private static generateEmptyUserVars;
|
|
22
25
|
private static decompressAllMapObject;
|
|
23
26
|
static setRestartData(restartData: WWAData, firstFrameData: WWAData): void;
|
|
24
27
|
private static getChangedUint8Array;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wwawing/engine",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0-alpha.3",
|
|
4
4
|
"description": "World Wide Adventure: an RPG Engine.",
|
|
5
5
|
"main": "./lib/wwa.js",
|
|
6
6
|
"files": [
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
"@types/pug": "^2.0.4",
|
|
46
46
|
"@types/terser-webpack-plugin": "^5.0.3",
|
|
47
47
|
"@types/webpack": "^5.28.0",
|
|
48
|
-
"@wwawing/assets": "^3.
|
|
49
|
-
"@wwawing/common-interface": "^3.
|
|
50
|
-
"@wwawing/debug-server": "^3.
|
|
51
|
-
"@wwawing/event-emitter": "^3.
|
|
52
|
-
"@wwawing/loader": "^3.
|
|
53
|
-
"@wwawing/page-generator": "^3.
|
|
54
|
-
"@wwawing/styles": "^3.
|
|
48
|
+
"@wwawing/assets": "^3.6.0-alpha.3",
|
|
49
|
+
"@wwawing/common-interface": "^3.6.0-alpha.3",
|
|
50
|
+
"@wwawing/debug-server": "^3.6.0-alpha.3",
|
|
51
|
+
"@wwawing/event-emitter": "^3.6.0-alpha.3",
|
|
52
|
+
"@wwawing/loader": "^3.6.0-alpha.3",
|
|
53
|
+
"@wwawing/page-generator": "^3.6.0-alpha.3",
|
|
54
|
+
"@wwawing/styles": "^3.6.0-alpha.3",
|
|
55
55
|
"crypto-js": "4.0.0",
|
|
56
56
|
"npm-run-all": "^4.1.5",
|
|
57
57
|
"pug": "^3.0.2",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"node": ">=14",
|
|
72
72
|
"npm": ">=6"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "a82aa4ec400e6f1f3b3a89aec5678864bcd4eced"
|
|
75
75
|
}
|