@wwawing/common-interface 0.0.0-exe-chousa.based-on.3.12.21

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/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 1996-2025 NAO
4
+ Copyright (c) 2015-2025 WWA Wing Team
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
package/lib/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./wwa_data";
2
+ export * as SystemMessage from "./wwa_system_message";
package/lib/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./wwa_data";
2
+ export * as SystemMessage from "./wwa_system_message";
@@ -0,0 +1,99 @@
1
+ import type { Key } from "./wwa_system_message";
2
+ export interface Coord {
3
+ x: number;
4
+ y: number;
5
+ }
6
+ export type GameOverPolicy = "default" | "never" | "except-macro";
7
+ export interface WWAData {
8
+ version: number;
9
+ gameoverX: number;
10
+ gameoverY: number;
11
+ playerX: number;
12
+ playerY: number;
13
+ mapPartsMax: number;
14
+ objPartsMax: number;
15
+ isOldMap: boolean;
16
+ isOldMove: boolean;
17
+ statusEnergyMax: number;
18
+ statusEnergy: number;
19
+ statusStrength: number;
20
+ statusDefence: number;
21
+ statusGold: number;
22
+ itemBox: number[];
23
+ mapWidth: number;
24
+ messageNum: number;
25
+ map: number[][];
26
+ mapObject: number[][];
27
+ mapCompressed: number[][][];
28
+ mapObjectCompressed: number[][][];
29
+ mapAttribute: number[][];
30
+ objectAttribute: number[][];
31
+ worldPassword: string;
32
+ message: string[];
33
+ worldName: string;
34
+ worldPassNumber: number;
35
+ charCGName: string;
36
+ mapCGName: string;
37
+ systemMessage: string[];
38
+ moves: number;
39
+ yesnoImgPosX: number;
40
+ yesnoImgPosY: number;
41
+ playerImgPosX: number;
42
+ playerImgPosY: number;
43
+ clickableItemSignImgPosX: number;
44
+ clickableItemSignImgPosY: number;
45
+ disableSaveFlag: boolean;
46
+ compatibleForOldMapFlag: boolean;
47
+ objectNoCollapseDefaultFlag: boolean;
48
+ delPlayerFlag: boolean;
49
+ bgm: number;
50
+ effectCoords: Coord[];
51
+ effectWaits: number;
52
+ imgStatusEnergyX: number;
53
+ imgStatusEnergyY: number;
54
+ imgStatusStrengthX: number;
55
+ imgStatusStrengthY: number;
56
+ imgStatusDefenceX: number;
57
+ imgStatusDefenceY: number;
58
+ imgStatusGoldX: number;
59
+ imgStatusGoldY: number;
60
+ imgWideCellX: number;
61
+ imgWideCellY: number;
62
+ imgItemboxX: number;
63
+ imgItemboxY: number;
64
+ imgFrameX: number;
65
+ imgFrameY: number;
66
+ imgBattleEffectX: number;
67
+ imgBattleEffectY: number;
68
+ imgClickX: number;
69
+ imgClickY: number;
70
+ frameColorR: number;
71
+ frameColorG: number;
72
+ frameColorB: number;
73
+ frameOutColorR: number;
74
+ frameOutColorG: number;
75
+ frameOutColorB: number;
76
+ fontColorR: number;
77
+ fontColorG: number;
78
+ fontColorB: number;
79
+ statusColorR: number;
80
+ statusColorG: number;
81
+ statusColorB: number;
82
+ checkOriginalMapString: string;
83
+ checkString: string;
84
+ isItemEffectEnabled: boolean;
85
+ frameCount: number;
86
+ gamePadButtonItemTable: number[];
87
+ userVar: number[];
88
+ permitChangeGameSpeed: boolean;
89
+ gameSpeedIndex: number;
90
+ playTime: number;
91
+ isVisibleStatusEnergy: boolean;
92
+ isVisibleStatusStrength: boolean;
93
+ isVisibleStatusDefence: boolean;
94
+ isVisibleStatusGold: boolean;
95
+ isGameOverDisabled?: boolean;
96
+ gameOverPolicy: GameOverPolicy;
97
+ bgmDelayDurationMs: number;
98
+ customSystemMessages: Partial<Record<Key, string>>;
99
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ export interface Config {
2
+ code: number;
3
+ defaultText: string;
4
+ mapdataParams?: {
5
+ messageArea: "message" | "systemMessage";
6
+ index: number;
7
+ };
8
+ }
9
+ declare const _systemMessage: Readonly<{
10
+ [x: string]: Config;
11
+ }>;
12
+ export declare const keys: Key[];
13
+ export type Key = (keyof typeof _systemMessage) & string;
14
+ export declare const Key: { [K in Key]: Key; };
15
+ export declare const ConfigMap: {
16
+ [KEY in Key]: Config;
17
+ };
18
+ export declare function stringIsKey(rawValue: string): rawValue is Key;
19
+ export declare function findKeyByCode(code: number): Key | undefined;
20
+ export {};
@@ -0,0 +1,93 @@
1
+ const _systemMessage = Object.freeze({
2
+ CONFIRM_LOAD_SOUND: {
3
+ code: 1,
4
+ defaultText: "効果音・BGMデータをロードしますか?",
5
+ mapdataParams: {
6
+ messageArea: "systemMessage",
7
+ index: 2
8
+ }
9
+ },
10
+ NO_MONEY: {
11
+ code: 101,
12
+ defaultText: "所持金がたりない。",
13
+ mapdataParams: {
14
+ messageArea: "message",
15
+ index: 6,
16
+ },
17
+ },
18
+ NO_ITEM: {
19
+ code: 201,
20
+ mapdataParams: {
21
+ messageArea: "message",
22
+ index: 7,
23
+ },
24
+ defaultText: "アイテムを持っていない。",
25
+ },
26
+ ITEM_BOX_FULL: {
27
+ code: 202,
28
+ defaultText: "これ以上、アイテムを持てません。",
29
+ mapdataParams: {
30
+ messageArea: "systemMessage",
31
+ index: 1,
32
+ },
33
+ },
34
+ ITEM_SELECT_TUTORIAL: {
35
+ code: 203,
36
+ defaultText: `このアイテムは%HOW_TO_USE_ITEM%ことで使用できます。
37
+ 使用できるアイテムは色枠で囲まれます。`,
38
+ mapdataParams: {
39
+ messageArea: "systemMessage",
40
+ index: 0,
41
+ }
42
+ },
43
+ CONFIRM_USE_ITEM: {
44
+ code: 204,
45
+ defaultText: `このアイテムを使用します。
46
+ よろしいですか?`,
47
+ mapdataParams: {
48
+ messageArea: "message",
49
+ index: 8,
50
+ },
51
+ },
52
+ CANNOT_DAMAGE_MONSTER: {
53
+ code: 301,
54
+ defaultText: "相手の防御能力が高すぎる!",
55
+ },
56
+ CONFIRM_ENTER_URL_GATE: {
57
+ code: 401,
58
+ defaultText: `他のページにリンクします。
59
+ よろしいですか?`,
60
+ mapdataParams: {
61
+ messageArea: "message",
62
+ index: 5
63
+ }
64
+ },
65
+ GAME_SPEED_CHANGED: {
66
+ code: 501,
67
+ defaultText: `移動速度を【%GAME_SPEED_NAME%】に切り替えました。
68
+ %HIGH_SPEED_MESSAGE%(%MAX_SPEED_INDEX%段階中%GAME_SPEED_INDEX%)
69
+ 速度を落とすには%SPEED_DOWN_BUTTON%, 速度を上げるには%SPEED_UP_BUTTON%を押してください。`,
70
+ },
71
+ GAME_SPEED_CHANGE_DISABLED: {
72
+ code: 502,
73
+ defaultText: `ここでは移動速度を
74
+ 変更できません。`,
75
+ },
76
+ });
77
+ export const keys = Object.keys(_systemMessage);
78
+ export const Key = (keys).reduce((prev, key) => ({
79
+ ...prev,
80
+ [key]: key,
81
+ }), {});
82
+ export const ConfigMap = _systemMessage;
83
+ export function stringIsKey(rawValue) {
84
+ return keys.some((key) => key === rawValue);
85
+ }
86
+ export function findKeyByCode(code) {
87
+ for (let key of keys) {
88
+ if (ConfigMap[key].code === code) {
89
+ return key;
90
+ }
91
+ }
92
+ return undefined;
93
+ }
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@wwawing/common-interface",
3
+ "version": "0.0.0-exe-chousa.based-on.3.12.21",
4
+ "description": "",
5
+ "sideEffects": false,
6
+ "main": "lib/index.js",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/WWAWing/WWAWing.git",
10
+ "directory": "packages/common-interface"
11
+ },
12
+ "files": [
13
+ "lib"
14
+ ],
15
+ "scripts": {
16
+ "test": "echo \"Error: no test specified\" && exit 1",
17
+ "build": "tsc -p ."
18
+ },
19
+ "author": "WWA Wing Team",
20
+ "license": "MIT",
21
+ "devDependencies": {
22
+ "typescript": "^5.8.3"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "engines": {
28
+ "node": ">=22",
29
+ "npm": ">=11"
30
+ },
31
+ "gitHead": "b52982378576ed3ef7223fae8457a7923eba7ace"
32
+ }