@wwawing/engine 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.
Files changed (58) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +11 -0
  3. package/debug/index.pug +22 -0
  4. package/debug/make-debug-pages.ts +88 -0
  5. package/debug/maps-config.ts +14 -0
  6. package/lib/json_api_client/index.d.ts +12 -0
  7. package/lib/wwa.js +21 -0
  8. package/lib/wwa_camera.d.ts +20 -0
  9. package/lib/wwa_cgmanager.d.ts +51 -0
  10. package/lib/wwa_data.d.ts +578 -0
  11. package/lib/wwa_encryption.d.ts +4 -0
  12. package/lib/wwa_estimate_battle.d.ts +13 -0
  13. package/lib/wwa_expression/__tests__/value-assign-operation.d.ts +1 -0
  14. package/lib/wwa_expression/eval.d.ts +5 -0
  15. package/lib/wwa_expression/index.d.ts +11 -0
  16. package/lib/wwa_expression/parsers.d.ts +3 -0
  17. package/lib/wwa_expression/regexp.d.ts +11 -0
  18. package/lib/wwa_expression/typedef.d.ts +57 -0
  19. package/lib/wwa_expression/value-assign-operation.d.ts +22 -0
  20. package/lib/wwa_inject_html.d.ts +2 -0
  21. package/lib/wwa_input.d.ts +129 -0
  22. package/lib/wwa_item_menu.d.ts +20 -0
  23. package/lib/wwa_main.d.ts +331 -0
  24. package/lib/wwa_message.d.ts +241 -0
  25. package/lib/wwa_monster.d.ts +19 -0
  26. package/lib/wwa_motion.d.ts +29 -0
  27. package/lib/wwa_parts_player.d.ts +169 -0
  28. package/lib/wwa_password_window.d.ts +28 -0
  29. package/lib/wwa_play_time.d.ts +8 -0
  30. package/lib/wwa_save/WWACompress.d.ts +36 -0
  31. package/lib/wwa_save/WWASave.d.ts +27 -0
  32. package/lib/wwa_save/WWASaveData.d.ts +20 -0
  33. package/lib/wwa_save/WWASaveDataDB.d.ts +5 -0
  34. package/lib/wwa_save/WWASaveDataDBList.d.ts +31 -0
  35. package/lib/wwa_save/WWASaveDataList.d.ts +6 -0
  36. package/lib/wwa_save/WWASaveDataLog.d.ts +3 -0
  37. package/lib/wwa_save/WWASaveDataLogList.d.ts +14 -0
  38. package/lib/wwa_save/common/definitions.d.ts +11 -0
  39. package/lib/wwa_save/common/index.d.ts +2 -0
  40. package/lib/wwa_save/common/mapDataRevisionKey.d.ts +1 -0
  41. package/lib/wwa_save/index.d.ts +6 -0
  42. package/lib/wwa_save/migrators/index.d.ts +2 -0
  43. package/lib/wwa_save/migrators/migrate-gameover-policy.d.ts +2 -0
  44. package/lib/wwa_sound.d.ts +26 -0
  45. package/lib/wwa_util.d.ts +11 -0
  46. package/lib/wwa_vardump/api.d.ts +8 -0
  47. package/lib/wwa_vardump/index.d.ts +9 -0
  48. package/lib/wwa_vardump/named-user-variable/api.d.ts +1 -0
  49. package/lib/wwa_vardump/named-user-variable/index.d.ts +1 -0
  50. package/lib/wwa_vardump/numbered-user-variable/api.d.ts +3 -0
  51. package/lib/wwa_vardump/numbered-user-variable/index.d.ts +1 -0
  52. package/lib/wwa_vardump/user-variable/user-variable-card/index.d.ts +11 -0
  53. package/lib/wwa_vardump/user-variable/user-variable-label/index.d.ts +3 -0
  54. package/lib/wwa_vardump/user-variable/user-variable-list/index.d.ts +14 -0
  55. package/lib/wwa_vardump/user-variable/user-variable-list-section/header/index.d.ts +13 -0
  56. package/lib/wwa_vardump/user-variable/user-variable-list-section/header/information/index.d.ts +3 -0
  57. package/lib/wwa_vardump/user-variable/user-variable-list-section/index.d.ts +8 -0
  58. package/package.json +83 -0
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/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # WWA Wing
2
+ WWA( http://wwajp.com )のJavaScript実装本体です。
3
+
4
+ ## ライセンス
5
+ - MIT License (Expat)。詳しくは「LICENSE」ファイルを参照。
6
+ - ただし、マニュアル「manual.html」のみ CC BY 4.0。→<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="クリエイティブ・コモンズ・ライセンス" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/80x15.png" /></a>
7
+
8
+ ## その他
9
+ 不具合を発見された場合は、issuesかPull Requestまで。Githubのアカウントを持っていない場合はバグ報告板( http://jbbs.shitaraba.net/netgame/14732/ )まで。
10
+
11
+ WWA Wing - http://wwawing.com
@@ -0,0 +1,22 @@
1
+ doctype html
2
+ html(lang="ja")
3
+ head
4
+ meta(charset="UTF-8")
5
+ title @wwawing/engine 開発メニュー
6
+
7
+ body
8
+ h1 @wwawing/engine 開発メニュー
9
+
10
+ ul
11
+ each map in page.maps
12
+ li
13
+ a(href=(map.outputPageName || map.fileName) + ".html") #{map.title}
14
+
15
+ p
16
+ | Internet RPG &quot;
17
+ a(href="http://www.wwajp.com") World Wide Adventure
18
+ | &quot; &copy; 1996-#{page.thisYear} NAO
19
+ p
20
+ | &quot;
21
+ a(href="http://wwawing.com") WWA Wing
22
+ | &quot; &copy; 2015-#{page.thisYear} WWA Wing Team
@@ -0,0 +1,88 @@
1
+ import { render, InputConfig } from "@wwawing/page-generator";
2
+ import * as fs from "fs";
3
+ import * as pug from "pug";
4
+ import * as path from "path";
5
+ import maps from "./maps-config";
6
+
7
+ const isDev = process.argv.length >= 3 && process.argv[2] === "dev";
8
+
9
+ type Maps = typeof maps;
10
+ interface IndexPageOption {
11
+ page: {
12
+ maps: Maps;
13
+ thisYear: number;
14
+ }
15
+ }
16
+
17
+ const indexPageTemplageFile = path.join(__dirname, "index.pug");
18
+ const compileIndexPage = pug.compileFile(indexPageTemplageFile, { pretty: true });
19
+ const outputDirectory = path.join(__dirname, "..", "lib");
20
+
21
+ Promise.all([
22
+ ...createPlayPagePromises(maps),
23
+ // Netlify でデプロイする場合は wwa-server を使用しないため、トップページを生成する
24
+ ...(!isDev ? [createIndexPage({ page: { maps, thisYear: new Date().getFullYear() } })] : [])
25
+ ])
26
+ .catch(error => {
27
+ console.error("error", error);
28
+ process.exit(1);
29
+ });
30
+
31
+ function createIndexPage(option: IndexPageOption): Promise<void> {
32
+ return createWriteFilePromise(
33
+ path.join(outputDirectory, "index.html"), `${compileIndexPage(option)}\n`);
34
+ }
35
+
36
+ function createPlayPagePromises(maps: Maps): Promise<void>[] {
37
+ return maps
38
+ .map(map => ({
39
+ mapName: map.fileName,
40
+ outputPageName: map.outputPageName || map.fileName,
41
+ html: render(createPlayPageConfig(map.fileName, map.cssName, map.isClassicMode))
42
+ }))
43
+ .map(params => createWriteFilePromise(
44
+ path.join(outputDirectory, `${params.outputPageName}.html`), params.html));
45
+ }
46
+
47
+ function createPlayPageConfig(mapDataName: string, cssName?: string, isClassicMode?: true): InputConfig {
48
+ return {
49
+ page: {
50
+ additionalCssFiles: ["style.css"],
51
+ },
52
+ wwa: {
53
+ gameOption: {
54
+ isClassicMode,
55
+ autoSave: {
56
+ intervalSteps: 200
57
+ },
58
+ userVars: {
59
+ dumpElementId: "vardump",
60
+ canDisplay: true
61
+ },
62
+ virtualPad: {
63
+ enable: true,
64
+ viewportFitEnable: true,
65
+ controllerId: "virtualpad-controller"
66
+ }
67
+ },
68
+ resources: {
69
+ mapData: `${mapDataName}.dat`,
70
+ wwaJs: isDev ? "wwa.long.js" : "wwa.js",
71
+ wwaCss: cssName,
72
+ titleImage: "cover.gif",
73
+ userVarNamesFile: `${mapDataName}-vars.json`
74
+ },
75
+ },
76
+ copyrights: "official-and-wing"
77
+ };
78
+ }
79
+
80
+ function createWriteFilePromise(filePath: string, content: string): Promise<void> {
81
+ return new Promise((resolve, reject) =>
82
+ fs.writeFile(
83
+ filePath,
84
+ content,
85
+ err => (err ? reject(err) : resolve())
86
+ )
87
+ );
88
+ }
@@ -0,0 +1,14 @@
1
+ /**
2
+ * 原則, 出力先のHTMLファイル名はマップデータ名 (fileName) と同じですが,
3
+ * outputPageName を指定することで, 出力先のファイル名をマップデータ名と違うものにできます.
4
+ */
5
+ export default [
6
+ { fileName: "test", title: "テストマップ" },
7
+ { fileName: "wwamap", title: "Standard Map" },
8
+ { fileName: "wwamap", outputPageName: "wwamap-classic", title: "Standard Map (Classic Mode)", cssName: "wwa_classic.css", isClassicMode: true as const },
9
+ { fileName: "island02", title: "Fantasy Island" },
10
+ { fileName: "caves01", title: "Cave Dungeon I" },
11
+ { fileName: "caves02", title: "Cave Dungeon II" },
12
+ { fileName: "g002-302", title: "追尾属性テスト (マップデータバージョン 3.0)" },
13
+ { fileName: "g002-310", title: "追尾属性テスト (マップデータバージョン 3.1)" },
14
+ ];
@@ -0,0 +1,12 @@
1
+ export type JsonResponseErrorKind = "brokenJson" | "httpError" | "connectionError";
2
+ export type JsonResponseKind = JsonResponseErrorKind | "data";
3
+ export type JsonResponseError<ErrorKind = JsonResponseErrorKind> = {
4
+ kind: ErrorKind;
5
+ errorMessage: string;
6
+ };
7
+ export type JsonResponseData = {
8
+ kind: "data";
9
+ data: unknown;
10
+ };
11
+ export type JsonResponse<ResponseKind = JsonResponseKind> = JsonResponseError<Exclude<ResponseKind, "data">> | JsonResponseData;
12
+ export declare const fetchJsonFile: (fileName: string) => Promise<JsonResponse>;