feat: 完成数据端数据类型的构建

This commit is contained in:
AncTe committed 2026-09-20 19:11:43 +08:00
1 parent c0a58706d9
commit d12790280a
30 files changed
+885 -52

No files matched your search

+1
View File
@@ -0,0 +1 @@
{}
+47
View File
@@ -0,0 +1,47 @@
// Type: packages-user/data-state/src/types.ts ICoreStateCoreConfig
{
"name": "template",
"title": "魔塔样板",
"version": "Ver 2.C",
"content": {
"mapsDir": "content/maps",
"mapListDir": "content/maps/.list.jsonc",
"enemyDir": "content/enemy.jsonc",
"itemDir": "content/item.jsonc",
"tileDir": "content/tile.jsonc"
},
"init": {
"startEvent": "game-start",
"hero": {
"x": 6,
"y": 6,
"floorId": "MT0",
"equipSlots": ["武器", "盾牌"],
"attribute": {
"name": "阳光",
"level": 0,
"hp": 10000,
"atk": 100,
"def": 100,
"mdef": 0,
"mana": 0,
"manamax": 0,
"money": 0,
"exp": 0
}
}
},
"flag": {
"flyNearStair": false,
"flyRecordPosition": true,
"itemHint": true,
"enableNegativeDamage": false,
"betweenDamageMax": true,
"enablePick": true,
"ignoreChangeFLoor": true,
"allowDeadZone": false,
"enableTeleport": true,
"enableRouteFolding": true,
"enableTeleportMerge": true
}
}
+16
View File
@@ -0,0 +1,16 @@
// Type: packages-user/data-common/src/store/types IEnemyRawData
// "@required" means the property is required.
// For objects, system will compare every properties.
{
"num": "@required",
"attribute": {
"name": "新怪物",
"hp": 0,
"atk": 0,
"def": 0,
"money": 0,
"exp": 0,
"point": 0
},
"special": {}
}
+18
View File
@@ -0,0 +1,18 @@
// Type: packages-user/data-common/src/store/types IItemRawData
// "@required" means the property is required.
// For objects, system will compare every properties.
{
"num": "@required",
"category": 0,
"name": "新道具",
"text": "",
"hideInToolbox": false,
"equip": {
"slots": [],
"animate": null,
"value": {},
"percentage": {},
"loadEvent": null,
"unloadEvent": null
}
}
+10
View File
@@ -0,0 +1,10 @@
// Type: packages-user/data-common/src/store/types IMapRawData
// "@required" means the property is required.
// For objects, system will compare every properties.
{
"floorId": "@required",
"width": 13,
"map": {},
"layerAlias": {},
"events": {}
}
+15
View File
@@ -0,0 +1,15 @@
// Type: packages-user/data-common/src/store/types ITileRawData
// "@required" means the property is required.
// For objects, system will compare every properties.
{
"num": "@required",
"id": "@required",
"events": {},
"type": 0,
"eventPass": false,
"pass": {
"onlyEvents": true,
"outPass": 15,
"inPass": 15
}
}
+20 -1
View File
@@ -1 +1,20 @@
{}
// Type: packages-user/data-common/src/store/types IEnemyRawData
[
{
"num": 100,
"attribute": {
"name": "绿头怪",
"hp": 100,
"atk": 25,
"def": 10,
"money": 5,
"exp": 5,
"point": 3
},
"special": {
"1": null,
"6": 10,
"9": 3
}
}
]
+9 -1
View File
@@ -1,3 +1,11 @@
// Type: packages-user/data-common/src/store/types IItemRawData
// ItemEffect: ./item.ts
{}
[
{
"num": 200,
"category": 1,
"name": "怪物手册",
"text": "蕴含着魔塔中所有怪物的详细信息",
"hideInToolbox": false
}
]
+24
View File
@@ -0,0 +1,24 @@
type HeroAttr = import('@user/data-common').IHeroAttr;
type CoreState = import('@user/data-state').ICoreState;
type ItemEffect = import('@user/data-common').IItemEffect<HeroAttr, CoreState>;
// --- SYSTEM ITEM PREFIX --- //
export const item200: ItemEffect = {
canUse() {
return true;
}
};
// --- SYSTEM ITEM SPLIT --- //
export const item201: ItemEffect = {
canUse(item, state) {
return (
item.text.includes('test') &&
state.flags.getFieldValueDefaults('test', true)
);
}
};
// --- SYSTEM ITEM END --- //
+2
View File
@@ -0,0 +1,2 @@
// Type: string[], without `.jsonc` suffix
["MT0"]
+27 -2
View File
@@ -1,2 +1,27 @@
// Type: packages-user/data-base/src/map/types.ts
{}
// Type: packages-user/data-common/src/store/types IMapRawData
{
"floorId": "MT0",
"width": 13,
"map": {
"0": [
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0
],
"10": [
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1
]
}
}
+2
View File
@@ -0,0 +1,2 @@
// Type: type define required
{}
+10 -1
View File
@@ -1,2 +1,11 @@
// Type: packages-user/data-common/src/store/types ITileRawData
{}
[
{
"num": 1,
"id": "yellowWall",
"events": {},
"type": 2,
"eventPass": false,
"pass": { "onlyEvents": true, "inPass": 0, "outPass": 0 }
}
]
+2
View File
@@ -1,6 +1,8 @@
{
"name": "@user/main",
"dependencies": {
"@user/data-common": "workspace:*",
"@user/data-state": "workspace:*",
"@user/entry-client": "workspace:*",
"@user/entry-data": "workspace:*"
}