提交资源

This commit is contained in:
PC-20230316NUNE\Administrator 2024-01-18 18:58:07 +08:00
parent 5a58823b4e
commit bc2ddf1fcd
50 changed files with 6498 additions and 38 deletions

View File

@ -1,38 +1,50 @@
[
{
"id": 90001,
"icon": "90001",
"name": "金币",
"tig": "金币 (目前叫做金币 名称还没有定) 游戏的基础资源 用于升级宠物",
"args": ""
"args": "",
"quality": 1
},
{
"id": 90002,
"icon": "90002",
"name": "锻造石",
"tig": "锻造石 可以锻造装备的石头",
"args": ""
"args": "",
"quality": 1
},
{
"id": 90003,
"icon": "90003",
"name": "通用加速卷",
"tig": "加速卷 用来加速一切需要时间的东西 减少冷却:60s",
"args": "60"
"args": "60",
"quality": 1
},
{
"id": 90004,
"icon": "90004",
"name": "钥匙:金币副本",
"tig": "金币副本的钥匙",
"args": ""
"args": "",
"quality": 1
},
{
"id": 90005,
"icon": "90005",
"name": "钥匙:锻造石副本",
"tig": "锻造石副本的钥匙",
"args": ""
"args": "",
"quality": 1
},
{
"id": 90006,
"icon": "90006",
"name": "魂:一品宠物魂",
"tig": "用于宠物升星",
"args": ""
"args": "",
"quality": 1
}
]

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "3f0ee55f-fcc7-420d-bbca-1340a4c092fc",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,241 @@
[
{
"__type__": "cc.Prefab",
"_name": "玩家资源ICON",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "玩家资源ICON",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
}
],
"_active": true,
"_components": [
{
"__id__": 10
},
{
"__id__": 12
}
],
"_prefab": {
"__id__": 14
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_prefab": {
"__id__": 3
},
"__editorExtras__": {}
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 2
},
"asset": {
"__uuid__": "3cae9ed5-dfa7-4128-b332-3ea99d399121",
"__expectedType__": "cc.Prefab"
},
"fileId": "02c3tqHwFAbp7zhkA22zq9",
"instance": {
"__id__": 4
},
"targetOverrides": null
},
{
"__type__": "cc.PrefabInstance",
"fileId": "ed5tPxTilMA6R3egdw7M/L",
"prefabRootNode": {
"__id__": 1
},
"mountedChildren": [],
"mountedComponents": [],
"propertyOverrides": [
{
"__id__": 5
},
{
"__id__": 7
},
{
"__id__": 8
},
{
"__id__": 9
}
],
"removedComponents": []
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 6
},
"propertyPath": [
"_name"
],
"value": "资源ICON"
},
{
"__type__": "cc.TargetInfo",
"localID": [
"02c3tqHwFAbp7zhkA22zq9"
]
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 6
},
"propertyPath": [
"_lpos"
],
"value": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 6
},
"propertyPath": [
"_lrot"
],
"value": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 6
},
"propertyPath": [
"_euler"
],
"value": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
}
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 11
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "60HDOce21EU4mT/teH3tKt"
},
{
"__type__": "69b49TO9kRI6am69+bhlckt",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 13
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "268KVlguhFv5OIouxO8TjA"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "02c3tqHwFAbp7zhkA22zq9",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": [
{
"__id__": 2
}
]
}
]

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.49",
"importer": "prefab",
"imported": true,
"uuid": "1bc9536b-8271-482d-8330-5bd3ab212cab",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "玩家资源ICON"
}
}

View File

@ -0,0 +1,739 @@
[
{
"__type__": "cc.Prefab",
"_name": "资源ICON",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"data": {
"__id__": 1
},
"optimizationPolicy": 0,
"persistent": false
},
{
"__type__": "cc.Node",
"_name": "资源ICON",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
"_children": [
{
"__id__": 2
},
{
"__id__": 8
},
{
"__id__": 22
}
],
"_active": true,
"_components": [
{
"__id__": 30
},
{
"__id__": 32
}
],
"_prefab": {
"__id__": 34
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "背景",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 3
},
{
"__id__": 5
}
],
"_prefab": {
"__id__": 7
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 4
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "5dXmPodeBIzK9ZudCJ0lyM"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 2
},
"_enabled": true,
"__prefab": {
"__id__": 6
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "7d8f9b89-4fd1-4c9f-a3ab-38ec7cded7ca@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "20sb9VIT5KFIQeKj9xXgfd"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "5fFj0bKJZKHaJ1M3mytw3C",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "资源遮罩",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 9
}
],
"_active": true,
"_components": [
{
"__id__": 15
},
{
"__id__": 17
},
{
"__id__": 19
}
],
"_prefab": {
"__id__": 21
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "Sprite",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 8
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 10
},
{
"__id__": 12
}
],
"_prefab": {
"__id__": 14
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 9
},
"_enabled": true,
"__prefab": {
"__id__": 11
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "25alLvKOtKF50Ax8vwjjXJ"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 9
},
"_enabled": true,
"__prefab": {
"__id__": 13
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": null,
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "70nwIs5DNEdZlxo43eL/ak"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "0bJ3xFlaZFqIQTEe6gKXth",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
},
"_enabled": true,
"__prefab": {
"__id__": 16
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "91h3J1Qo9NKp8P7pZ/ijRa"
},
{
"__type__": "cc.Mask",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
},
"_enabled": true,
"__prefab": {
"__id__": 18
},
"_type": 0,
"_inverted": false,
"_segments": 64,
"_alphaThreshold": 0.1,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "bay7jjytVJP6Fzx/k5RFdU"
},
{
"__type__": "cc.Graphics",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 8
},
"_enabled": true,
"__prefab": {
"__id__": 20
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_lineWidth": 1,
"_strokeColor": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_lineJoin": 2,
"_lineCap": 0,
"_fillColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 0
},
"_miterLimit": 10,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "4fJHZYu41AYIvcwxfCrJ6o"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "fc1fm88XdG0IiJpjOWJQQH",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "数量",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 23
},
{
"__id__": 25
},
{
"__id__": 27
}
],
"_prefab": {
"__id__": 29
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -33.647,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 33554432,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 22
},
"_enabled": true,
"__prefab": {
"__id__": 24
},
"_contentSize": {
"__type__": "cc.Size",
"width": 4,
"height": 54.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "4c5h6T0flJt5JRab2+oYMO"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 22
},
"_enabled": true,
"__prefab": {
"__id__": 26
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_string": "",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 20,
"_fontSize": 20,
"_fontFamily": "Arial",
"_lineHeight": 40,
"_overflow": 0,
"_enableWrapText": true,
"_font": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_isItalic": false,
"_isBold": true,
"_isUnderline": false,
"_underlineHeight": 2,
"_cacheMode": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "62+4SzXqFA8qi5LTvf4hNx"
},
{
"__type__": "cc.LabelOutline",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 22
},
"_enabled": true,
"__prefab": {
"__id__": 28
},
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_width": 2,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "76GD7mt+pBzIkY1rSwIkaJ"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "21MjGY6ndKiZ3M6O5l/pbL",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 31
},
"_contentSize": {
"__type__": "cc.Size",
"width": 100,
"height": 100
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "60HDOce21EU4mT/teH3tKt"
},
{
"__type__": "8f263w3T/9HHYCAD6ZfiOUn",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 1
},
"_enabled": true,
"__prefab": {
"__id__": 33
},
"quality": {
"__id__": 5
},
"icon": {
"__id__": 12
},
"num": {
"__id__": 25
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "92PDN+paRDnawowS6zMYgn"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "02c3tqHwFAbp7zhkA22zq9",
"instance": null,
"targetOverrides": null
}
]

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.49",
"importer": "prefab",
"imported": true,
"uuid": "3cae9ed5-dfa7-4128-b332-3ea99d399121",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "资源ICON"
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "6b10b32e-d2ae-4689-8c0b-1d4d3981d52c",
"files": [],
"subMetas": {},
"userData": {}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
{
"ver": "1.1.49",
"importer": "prefab",
"imported": true,
"uuid": "c14c6748-8114-41f9-9422-e1327884b2d6",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "资源背包页面"
}
}

View File

@ -288,18 +288,26 @@ export class TbGResource {
constructor(_json_: any) {
if (_json_.id === undefined) { throw new Error() }
this.id = _json_.id
if (_json_.icon === undefined) { throw new Error() }
this.icon = _json_.icon
if (_json_.name === undefined) { throw new Error() }
this.name = _json_.name
if (_json_.tig === undefined) { throw new Error() }
this.tig = _json_.tig
if (_json_.args === undefined) { throw new Error() }
this.args = _json_.args
if (_json_.quality === undefined) { throw new Error() }
this.quality = _json_.quality
}
/**
* id
*/
readonly id: number
/**
*
*/
readonly icon: string
/**
*
*/
@ -312,6 +320,10 @@ export class TbGResource {
*
*/
readonly args: string
/**
*
*/
readonly quality: number
resolve(tables:Tables)
{

View File

@ -91,7 +91,7 @@ export interface ResourceOV{
playerId:number; //玩家Id
resourceTbId:number; //资源配置表Id
resourceValue:number; //资源数量
version:number; //版本号
version:number; //版本号
}
export interface ModeOnHookRankingOV{

View File

@ -23,6 +23,8 @@ export enum ResourceUpdateType{
ADD = 2, //添加资源数量
}
//资源信息
//玩家资源数据
export default class ResourceData extends BaseData{

View File

@ -5,6 +5,7 @@ import { Component } from "cc";
export enum IconTypeEnum{
= "品质",
= "宠物装备",
= "资源",
}
export default class TbResource {

View File

@ -0,0 +1,43 @@
import { Label } from 'cc';
import { Sprite } from 'cc';
import { _decorator, Component, Node } from 'cc';
import { TD } from '../../../App';
import TbResource, { IconTypeEnum } from '../../../tools/TbResource';
const { ccclass, property } = _decorator;
@ccclass('ResourceIcon')
export class ResourceIcon extends Component {
//资源品质
@property(Sprite)
quality:Sprite;
//资源图标
@property(Sprite)
icon:Sprite;
//资源数量
@property(Label)
num:Label;
//设置icon
set(id:number,value:number){
let config = TD.TbGResource.get(id);
//设置ICON
TbResource.loadSpriteIcon(IconTypeEnum.,config.icon,this.icon,this);
//设置品质
TbResource.loadSpriteIcon(IconTypeEnum.,config.quality,this.quality,this);
this.num.string = ``;
if(value > 1){
//显示数量
this.num.string = `${value}`;
}
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "8f263c37-4fff-471d-8080-0fa65f88e527",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "c2a043f8-f6d7-41a1-a090-6c52eb12fce8",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,18 @@
import { _decorator, Component, Node } from 'cc';
import { ResourceIcon } from '../ResourceIcon';
const { ccclass, property } = _decorator;
@ccclass('PlayerResourceIcon')
export class PlayerResourceIcon extends Component {
@property(ResourceIcon)
icon:ResourceIcon;
//设置 ( 资源Id )
set(id:number){
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "69b494ce-f644-48e9-a9ba-f7e6e195c92d",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "20b32230-d874-412e-a657-bce1296e932f",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,20 @@
import { _decorator, Component, Node } from 'cc';
import JNLayerBase from '../../../../extensions/ngame/assets/ngame/ui/base/JNLayerBase';
const { ccclass, property } = _decorator;
//背包页面
@ccclass('PacksackView')
export class PacksackView extends JNLayerBase {
onJNLoad(data?: any): void {
super.onJNLoad(data)
}
//更新页面
onUpdateView(){
}
}

View File

@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "e29532d1-b556-4091-848a-7137fd53bdcf",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "31f06088-630f-456d-93e9-46eed123164a",
"files": [],
"subMetas": {},
"userData": {}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,134 @@
{
"ver": "1.0.26",
"importer": "image",
"imported": true,
"uuid": "261e6570-4ad5-4c99-a789-ba78f96b27ed",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "261e6570-4ad5-4c99-a789-ba78f96b27ed@6c48a",
"displayName": "90001",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "261e6570-4ad5-4c99-a789-ba78f96b27ed",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "261e6570-4ad5-4c99-a789-ba78f96b27ed@f9941",
"displayName": "90001",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -1,
"offsetY": -2,
"trimX": 12,
"trimY": 31,
"width": 102,
"height": 70,
"rawWidth": 128,
"rawHeight": 128,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-51,
-35,
0,
51,
-35,
0,
-51,
35,
0,
51,
35,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
12,
97,
114,
97,
12,
27,
114,
27
],
"nuv": [
0.09375,
0.2109375,
0.890625,
0.2109375,
0.09375,
0.7578125,
0.890625,
0.7578125
],
"minPos": [
-51,
-35,
0
],
"maxPos": [
51,
35,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "261e6570-4ad5-4c99-a789-ba78f96b27ed@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "261e6570-4ad5-4c99-a789-ba78f96b27ed@f9941"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,134 @@
{
"ver": "1.0.26",
"importer": "image",
"imported": true,
"uuid": "5d4b4f78-06a0-42a3-98db-3fefb696416a",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "5d4b4f78-06a0-42a3-98db-3fefb696416a@6c48a",
"displayName": "90002",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "5d4b4f78-06a0-42a3-98db-3fefb696416a",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "5d4b4f78-06a0-42a3-98db-3fefb696416a@f9941",
"displayName": "90002",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 128,
"height": 128,
"rawWidth": 128,
"rawHeight": 128,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-64,
-64,
0,
64,
-64,
0,
-64,
64,
0,
64,
64,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
128,
128,
128,
0,
0,
128,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-64,
-64,
0
],
"maxPos": [
64,
64,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "5d4b4f78-06a0-42a3-98db-3fefb696416a@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "5d4b4f78-06a0-42a3-98db-3fefb696416a@f9941"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

View File

@ -0,0 +1,134 @@
{
"ver": "1.0.26",
"importer": "image",
"imported": true,
"uuid": "35920b88-3d9c-4639-be2b-6b33a61a5643",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "35920b88-3d9c-4639-be2b-6b33a61a5643@6c48a",
"displayName": "90003",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "35920b88-3d9c-4639-be2b-6b33a61a5643",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "35920b88-3d9c-4639-be2b-6b33a61a5643@f9941",
"displayName": "90003",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 6,
"offsetY": -1,
"trimX": 24,
"trimY": 19,
"width": 464,
"height": 464,
"rawWidth": 500,
"rawHeight": 500,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-232,
-232,
0,
232,
-232,
0,
-232,
232,
0,
232,
232,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
24,
481,
488,
481,
24,
17,
488,
17
],
"nuv": [
0.048,
0.034,
0.976,
0.034,
0.048,
0.962,
0.976,
0.962
],
"minPos": [
-232,
-232,
0
],
"maxPos": [
232,
232,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "35920b88-3d9c-4639-be2b-6b33a61a5643@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "35920b88-3d9c-4639-be2b-6b33a61a5643@f9941"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

View File

@ -0,0 +1,134 @@
{
"ver": "1.0.26",
"importer": "image",
"imported": true,
"uuid": "daec5462-a349-4bc1-8cf8-f0f119e50b5d",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "daec5462-a349-4bc1-8cf8-f0f119e50b5d@6c48a",
"displayName": "90004",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "daec5462-a349-4bc1-8cf8-f0f119e50b5d",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "daec5462-a349-4bc1-8cf8-f0f119e50b5d@f9941",
"displayName": "90004",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -4,
"offsetY": -0.5,
"trimX": 16,
"trimY": 13,
"width": 80,
"height": 95,
"rawWidth": 120,
"rawHeight": 120,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-40,
-47.5,
0,
40,
-47.5,
0,
-40,
47.5,
0,
40,
47.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
16,
107,
96,
107,
16,
12,
96,
12
],
"nuv": [
0.13333333333333333,
0.1,
0.8,
0.1,
0.13333333333333333,
0.8916666666666667,
0.8,
0.8916666666666667
],
"minPos": [
-40,
-47.5,
0
],
"maxPos": [
40,
47.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "daec5462-a349-4bc1-8cf8-f0f119e50b5d@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "daec5462-a349-4bc1-8cf8-f0f119e50b5d@f9941"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -0,0 +1,134 @@
{
"ver": "1.0.26",
"importer": "image",
"imported": true,
"uuid": "2b95fcd0-80da-4829-8e3b-83b7af96a89f",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "2b95fcd0-80da-4829-8e3b-83b7af96a89f@6c48a",
"displayName": "90005",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "2b95fcd0-80da-4829-8e3b-83b7af96a89f",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "2b95fcd0-80da-4829-8e3b-83b7af96a89f@f9941",
"displayName": "90005",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 1,
"offsetY": -2.5,
"trimX": 14,
"trimY": 6,
"width": 102,
"height": 121,
"rawWidth": 128,
"rawHeight": 128,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-51,
-60.5,
0,
51,
-60.5,
0,
-51,
60.5,
0,
51,
60.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
14,
122,
116,
122,
14,
1,
116,
1
],
"nuv": [
0.109375,
0.0078125,
0.90625,
0.0078125,
0.109375,
0.953125,
0.90625,
0.953125
],
"minPos": [
-51,
-60.5,
0
],
"maxPos": [
51,
60.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "2b95fcd0-80da-4829-8e3b-83b7af96a89f@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "2b95fcd0-80da-4829-8e3b-83b7af96a89f@f9941"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,134 @@
{
"ver": "1.0.26",
"importer": "image",
"imported": true,
"uuid": "9bf9b03c-e983-434f-8d6a-ab04df85ea55",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "9bf9b03c-e983-434f-8d6a-ab04df85ea55@6c48a",
"displayName": "90006",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "9bf9b03c-e983-434f-8d6a-ab04df85ea55",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "9bf9b03c-e983-434f-8d6a-ab04df85ea55@f9941",
"displayName": "90006",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 3,
"trimX": 12,
"trimY": 3,
"width": 104,
"height": 116,
"rawWidth": 128,
"rawHeight": 128,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-52,
-58,
0,
52,
-58,
0,
-52,
58,
0,
52,
58,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
12,
125,
116,
125,
12,
9,
116,
9
],
"nuv": [
0.09375,
0.0703125,
0.90625,
0.0703125,
0.09375,
0.9765625,
0.90625,
0.9765625
],
"minPos": [
-52,
-58,
0
],
"maxPos": [
52,
58,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "9bf9b03c-e983-434f-8d6a-ab04df85ea55@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "9bf9b03c-e983-434f-8d6a-ab04df85ea55@f9941"
}
}

View File

@ -17,9 +17,11 @@ import com.google.gson.JsonObject;
public final class TbGResource extends AbstractBean {
public TbGResource(JsonObject _buf) {
id = _buf.get("id").getAsInt();
icon = _buf.get("icon").getAsString();
name = _buf.get("name").getAsString();
tig = _buf.get("tig").getAsString();
args = _buf.get("args").getAsString();
quality = _buf.get("quality").getAsInt();
}
public static TbGResource deserialize(JsonObject _buf) {
@ -30,6 +32,10 @@ public final class TbGResource extends AbstractBean {
* id
*/
public final int id;
/**
* 资源图片
*/
public final String icon;
/**
* 资源名称
*/
@ -42,6 +48,10 @@ public final class TbGResource extends AbstractBean {
* 额外参数
*/
public final String args;
/**
* 资源品质
*/
public final int quality;
public static final int __ID__ = 1780642599;
@ -52,9 +62,11 @@ public final class TbGResource extends AbstractBean {
public String toString() {
return "{ "
+ "(format_field_name __code_style field.name):" + id + ","
+ "(format_field_name __code_style field.name):" + icon + ","
+ "(format_field_name __code_style field.name):" + name + ","
+ "(format_field_name __code_style field.name):" + tig + ","
+ "(format_field_name __code_style field.name):" + args + ","
+ "(format_field_name __code_style field.name):" + quality + ","
+ "}";
}
}

View File

@ -0,0 +1,117 @@
package cn.jisol.game.controller.game.mode;
import cfg.TB.TbGSysDungeon;
import cfg.TbGEntity.TDungeon;
import cn.jisol.game.controller.argsresolver.CurrentPlayer;
import cn.jisol.game.data.TD;
import cn.jisol.game.entity.mode.ModeDungeonType;
import cn.jisol.game.entity.table.Dungeon;
import cn.jisol.game.entity.table.Player;
import cn.jisol.game.service.DungeonService;
import cn.jisol.game.service.ResourceService;
import cn.jisol.game.table.TableUtil;
import cn.jisol.game.vo.news.NewsResource;
import cn.jisol.game.vo.news.ov.ResourceUpdateOV;
import cn.jisol.ngame.util.NewsContext;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.retry.RetryException;
import org.springframework.retry.annotation.Retryable;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import java.util.*;
import java.util.stream.Collectors;
@Api(value = "JNGameDemo - API", tags = {"副本 - API"})
@RestController
@RequestMapping("/game/mode/dungeon")
@ResponseBody
public class GDungeonController {
@Autowired
ResourceService resourceService;
@Autowired
DungeonService dungeonService;
//获取副本信息
@ApiImplicitParams({})
@ApiOperation(value = "获取副本信息")
@PostMapping("/info")
public NewsContext<Map<Integer,Dungeon>> getInfos(@CurrentPlayer Player player){
//获取所有副本信息
List<Dungeon> list = dungeonService.list(Wrappers.lambdaQuery(Dungeon.class).eq(Dungeon::getPlayerId, player.getPlayerId()));
Map<Integer,Dungeon> dungeons = new HashMap<>();
//获取全部副本
TD.DATA.getTbGSysDungeon().getDataList().forEach(info -> {
Dungeon dungeon = null;
try{
dungeon = list.stream().filter(item -> info.id == item.getDungeonCfgId()).collect(Collectors.toList()).get(0);
}catch (Exception ignored){}
if(Objects.isNull(dungeon)){
//如果没有数据则生成数据
try{
//获取当前副本最小的进度
Object table = Objects.requireNonNull(TableUtil.getDataList(Objects.requireNonNull(TableUtil.getTDObject(info.tigs)))).get(0);
dungeon = Dungeon.builder()
.playerId(player.getPlayerId())
.dungeonCfgId(info.id)
.dungeonCfgItemId(TableUtil.getTableId(table))
.build();
dungeonService.save(dungeon);
}catch (Exception ignored){
assert dungeonService != null;
dungeon = dungeonService.getOne(Wrappers.lambdaQuery(Dungeon.class).eq(Dungeon::getPlayerId,player.getPlayerId()).eq(Dungeon::getDungeonCfgId,info.id));
}
}
dungeons.put(dungeon.getDungeonCfgId(),dungeon);
});
return NewsContext.onSuccess("获取成功",dungeons);
}
//消耗钥匙挑战副本
@ApiImplicitParams({})
@ApiOperation(value = "消耗钥匙挑战普通副本")
@PostMapping("/challenge/dungeon/{dungeonId}/{dungeonItemId}")
@Transactional
public NewsResource<Map<Integer,Dungeon>> challengeDungeon(@CurrentPlayer Player player, @PathVariable Integer dungeonId, @PathVariable Integer dungeonItemId){
TbGSysDungeon tbGSysDungeon = TD.DATA.getTbGSysDungeon().get(dungeonId);
if(Objects.isNull(tbGSysDungeon)) return NewsResource.onFail("不存在该副本");
if(!tbGSysDungeon.type.equals(ModeDungeonType.GDungeonMode)) return NewsResource.onFail("错误副本");
//获取副本信息
Map<Integer, Dungeon> infos = this.getInfos(player).data;
//禁止越级挑战
if(infos.get(dungeonId).getDungeonCfgItemId() < dungeonItemId) return NewsResource.onFail("请不要越级挑战哦");
//获取副本
TableUtil.TableData tableData = Objects.requireNonNull(TableUtil.getTableData(tbGSysDungeon.tigs));
//获取等级数据
TDungeon dungeon = Objects.requireNonNull((TDungeon) tableData.get(dungeonItemId).getData());
//扣除消耗
resourceService.addResourceValue(player.getPlayerId(), tbGSysDungeon.consume.id, (long) -tbGSysDungeon.consume.value);
//更新等级
if(infos.get(dungeonId).getDungeonCfgItemId().equals(dungeonItemId)){
if(Objects.nonNull(tableData.get(dungeonItemId + 1))){
infos.get(dungeonId).setDungeonCfgItemId(dungeonItemId + 1);
dungeonService.saveOrUpdate(infos.get(dungeonId));
}
}
//发放奖励
return NewsResource.onSuccess("挑战成功",infos,resourceService.rewards(player.getPlayerId(), dungeon.rewards));
}
}

View File

@ -0,0 +1,8 @@
package cn.jisol.game.entity.mode;
//副本模式类型
public interface ModeDungeonType {
static String GDungeonMode = "GDungeonMode"; //普通模式
}

View File

@ -0,0 +1,20 @@
package cn.jisol.game.entity.table;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Builder;
import lombok.Data;
@Builder
@Data
@TableName("`dungeon`")
public class Dungeon {
@TableId(type = IdType.AUTO)
private Long dungeonId; //副本唯一Id
private Long playerId; //副本玩家Id
private Integer dungeonCfgId; //副本配置表Id
private Integer dungeonCfgItemId; //副本进度表Id
}

View File

@ -0,0 +1,11 @@
package cn.jisol.game.mapper;
import cn.jisol.game.entity.table.Dungeon;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Component;
@Component
public interface DungeonMapper extends BaseMapper<Dungeon> {
}

View File

@ -0,0 +1,8 @@
package cn.jisol.game.service;
import cn.jisol.game.entity.table.Dungeon;
import com.baomidou.mybatisplus.extension.service.IService;
public interface DungeonService extends IService<Dungeon> {
}

View File

@ -1,11 +1,13 @@
package cn.jisol.game.service;
import cfg.TbGEntity.TResource;
import cn.jisol.game.entity.table.Player;
import cn.jisol.game.entity.table.Resource;
import cn.jisol.game.vo.news.ov.ResourceUpdateOV;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.ArrayList;
import java.util.List;
public interface ResourceService extends IService<Resource> {
@ -25,6 +27,7 @@ public interface ResourceService extends IService<Resource> {
//返回通用加速卷 减少的时间(ms)
public long timeSpeedUp(int type);
//发放奖励
public List<ResourceUpdateOV> rewards(Long playerId,TResource[] rewards);
}

View File

@ -0,0 +1,14 @@
package cn.jisol.game.service.impl;
import cn.jisol.game.entity.table.Dungeon;
import cn.jisol.game.entity.table.EquipForgingBench;
import cn.jisol.game.mapper.DungeonMapper;
import cn.jisol.game.mapper.EquipForgingBenchMapper;
import cn.jisol.game.service.DungeonService;
import cn.jisol.game.service.EquipForgingBenchService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@Service
public class DungeonServiceImpl extends ServiceImpl<DungeonMapper, Dungeon> implements DungeonService {
}

View File

@ -22,7 +22,9 @@ import org.springframework.stereotype.Service;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@Service
public class ResourceServiceImpl extends ServiceImpl<ResourceMapper, Resource> implements ResourceService {
@ -130,5 +132,10 @@ public class ResourceServiceImpl extends ServiceImpl<ResourceMapper, Resource> i
return Integer.parseInt(TD.DATA.getTbGResource().get(type).args) * 1000L;
}
@Override
public List<ResourceUpdateOV> rewards(Long playerId, TResource[] rewards) {
return Arrays.stream(rewards).map(reward -> ResourceUpdateOV.onUpdate(this.addResourceValue(playerId, reward.id, (long) reward.value))).collect(Collectors.toList());
}
}

View File

@ -33,13 +33,7 @@ public class GTbGOnHookLevels {
}
public int getId(){
try {
Field idField = data.getClass().getField("id");
return (int)idField.get(data);
} catch (NoSuchFieldException | IllegalAccessException e) {
e.printStackTrace();
return -1;
}
return TableUtil.getTableId(this.data);
}
public TOnHookLevel getData(){
@ -56,30 +50,20 @@ public class GTbGOnHookLevels {
//通过Id获取关卡
public GTbGOnHookLevel get(int key){
try {
Method method = this.data.getClass().getMethod("get",int.class);
Object data = method.invoke(this.data,key);
if(Objects.isNull(data)) return null;
return new GTbGOnHookLevel(data);
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
return null;
}
Object data = TableUtil.getId(this.data,key);
if(Objects.isNull(data)) return null;
return new GTbGOnHookLevel(data);
}
//获取全部关卡
public List<GTbGOnHookLevel> getDataList(){
try {
Method method = null;
method = this.data.getClass().getMethod("getDataList");
Object data = method.invoke(this.data);
if(Objects.isNull(data) || !(data instanceof ArrayList)){
return null;
}
return (List<GTbGOnHookLevel>) ((ArrayList)data).stream().map((Object i) -> new GTbGOnHookLevel(i)).collect(Collectors.toList());
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
Object data = TableUtil.getDataList(this.data);
if(Objects.isNull(data) || !(data instanceof ArrayList)){
return null;
}
return (List<GTbGOnHookLevel>) ((ArrayList)data).stream().map((Object i) -> new GTbGOnHookLevel(i)).collect(Collectors.toList());
}
}

View File

@ -2,13 +2,59 @@ package cn.jisol.game.table;
import cn.jisol.game.data.TD;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
//文档工具类
public class TableUtil {
public static class TableData{
//表数据
Object data;
public TableData(Object data) {
this.data = data;
}
public Table get(Integer Id){
return new Table(TableUtil.getId(this.data,Id));
}
public List<Table> getDataList(){
return Objects.requireNonNull(TableUtil.getDataList(this.data)).stream().map(Table::new).collect(Collectors.toList());
}
}
public static class Table{
//表行数据
Object data;
public Table(Object data) {
this.data = data;
}
public Integer getId(){
return TableUtil.getTableId(this.data);
}
public Object getData(){
return TableUtil.getTableKey(this.data,"data");
}
}
//获取对象
public static TableData getTableData(String sign){
return new TableData(TableUtil.getTDObject(sign));
}
//获取名字的对象
public static Object getTDObject(String sign){
try {
@ -19,4 +65,57 @@ public class TableUtil {
}
}
//获取配置列表
public static List<Object> getDataList(Object config){
try {
Method method = null;
method = config.getClass().getMethod("getDataList");
Object data = method.invoke(config);
if(Objects.isNull(data) || !(data instanceof ArrayList)){
return null;
}
return (ArrayList<Object>)data;
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
return null;
}
}
//通过Id获取表数据
public static Object getId(Object config,Integer id){
try {
Method method = config.getClass().getMethod("get",int.class);
Object data = method.invoke(config,id);
if(Objects.isNull(data)) return null;
return data;
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
return null;
}
}
//获取数据Id
public static int getTableId(Object table){
Object id = TableUtil.getTableKey(table,"id");
if (Objects.isNull(id)){
return -1;
}
return (int) id;
}
//获取指定Key数据
public static Object getTableKey(Object table,String key){
try {
Field idField = table.getClass().getField(key);
return idField.get(table);
} catch (NoSuchFieldException | IllegalAccessException e) {
e.printStackTrace();
return null;
}
}
}

View File

@ -37,6 +37,9 @@ public class NewsResource<T> extends NewsContext<T> {
public static <T> NewsResource<T> onSuccess(String msg,T data,ResourceUpdateOV... resource){
return onMessage(msg,data,NEWS_STATE_SUCCESS, Arrays.asList(resource));
}
public static <T> NewsResource<T> onSuccess(String msg,T data,List<ResourceUpdateOV> resource){
return onMessage(msg,data,NEWS_STATE_SUCCESS, resource);
}
public static <T> NewsResource<T> onFail(String msg){
return onMessage(msg,null,NEWS_STATE_FAIL,new ArrayList<>());

View File

@ -1,38 +1,50 @@
[
{
"id": 90001,
"icon": "90001",
"name": "金币",
"tig": "金币 (目前叫做金币 名称还没有定) 游戏的基础资源 用于升级宠物",
"args": ""
"args": "",
"quality": 1
},
{
"id": 90002,
"icon": "90002",
"name": "锻造石",
"tig": "锻造石 可以锻造装备的石头",
"args": ""
"args": "",
"quality": 1
},
{
"id": 90003,
"icon": "90003",
"name": "通用加速卷",
"tig": "加速卷 用来加速一切需要时间的东西 减少冷却:60s",
"args": "60"
"args": "60",
"quality": 1
},
{
"id": 90004,
"icon": "90004",
"name": "钥匙:金币副本",
"tig": "金币副本的钥匙",
"args": ""
"args": "",
"quality": 1
},
{
"id": 90005,
"icon": "90005",
"name": "钥匙:锻造石副本",
"tig": "锻造石副本的钥匙",
"args": ""
"args": "",
"quality": 1
},
{
"id": 90006,
"icon": "90006",
"name": "魂:一品宠物魂",
"tig": "用于宠物升星",
"args": ""
"args": "",
"quality": 1
}
]