导入资源

master
humingxing 4 hours ago
parent 1d01256442
commit 3be3eead6c
  1. 52
      assets/bundles/battleGame/prefab/BattleGame.prefab
  2. 9
      assets/res/spine/回收.meta
  3. 1
      assets/res/spine/回收/.WeDrive
  4. 55
      assets/res/spine/回收/回收.atlas
  5. 12
      assets/res/spine/回收/回收.atlas.meta
  6. 1
      assets/res/spine/回收/回收.json
  7. 13
      assets/res/spine/回收/回收.json.meta
  8. BIN
      assets/res/spine/回收/回收.png
  9. 134
      assets/res/spine/回收/回收.png.meta
  10. 41
      assets/script/battle/map/MapDigChestHost.ts
  11. 12
      docs/需求-开挖宝箱.md

@ -7744,8 +7744,8 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -172.126,
"y": -45.154,
"x": -196.353,
"y": -64.559,
"z": 0
},
"_lrot": {
@ -7785,22 +7785,22 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 73,
"height": 87
"width": 76,
"height": 95.41999816894531
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
"x": 0.5557894957692999,
"y": 0.30433872849285476
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "3f+Cw6kYBBHJQBWcpK+0VJ"
"fileId": "a4OlN7VkBFFbsH7+S6XUco"
},
{
"__type__": "cc.Sprite",
"__type__": "sp.Skeleton",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
@ -7821,28 +7821,28 @@
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "0368087b-b862-4cd9-960b-a4bd6d76ae24@f9941",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
"_skeletonData": {
"__uuid__": "62ac5441-a2b1-4399-a581-9e7709d873fc",
"__expectedType__": "sp.SkeletonData"
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"defaultSkin": "default",
"defaultAnimation": "animation",
"_premultipliedAlpha": false,
"_timeScale": 1,
"_preCacheMode": 0,
"_cacheMode": 0,
"_sockets": [],
"_useTint": false,
"_debugMesh": false,
"_debugBones": false,
"_debugSlots": false,
"_enableBatch": false,
"loop": true,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "8fydm2JFBD27r8gb1/aTfV"
"fileId": "ddVxtxA+ZGcofzdu685BYD"
},
{
"__type__": "cc.PrefabInfo",
@ -7852,7 +7852,7 @@
"asset": {
"__id__": 0
},
"fileId": "f6O9CMWPRNmLaQvNF5POF0",
"fileId": "487XEdPKBDwqTgfbEITByI",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null

@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "0a0a918d-b943-428e-bdfe-5d2e81121a92",
"files": [],
"subMetas": {},
"userData": {}
}

@ -0,0 +1 @@
D:\WXWork\1688855084654441\WeDrive\中昱智云\抖音游戏\战斗类\【新】2048数字守卫战\动效\回收

@ -0,0 +1,55 @@
回收.png
size: 98,117
format: RGBA8888
filter: Linear,Linear
repeat: none
回收
rotate: false
xy: 0, 0
size: 68, 33
orig: 70, 35
offset: 1, 1
index: -1
图层 641
rotate: false
xy: 0, 35
size: 74, 82
orig: 76, 84
offset: 1, 1
index: -1
眼睛1
rotate: true
xy: 70, 14
size: 19, 22
orig: 21, 24
offset: 1, 1
index: -1
眼睛2
rotate: true
xy: 76, 98
size: 19, 22
orig: 21, 24
offset: 1, 1
index: -1
眼睛4
rotate: true
xy: 76, 77
size: 19, 22
orig: 21, 24
offset: 1, 1
index: -1
眼睛5
rotate: true
xy: 76, 56
size: 19, 22
orig: 21, 24
offset: 1, 1
index: -1
眼睛6
rotate: true
xy: 76, 35
size: 19, 22
orig: 21, 24
offset: 1, 1
index: -1

@ -0,0 +1,12 @@
{
"ver": "1.0.0",
"importer": "*",
"imported": true,
"uuid": "56237c7f-84a9-4e9b-a571-2b2285625d8c",
"files": [
".atlas",
".json"
],
"subMetas": {},
"userData": {}
}

@ -0,0 +1 @@
{"skeleton":{"hash":"RBG1HAvpykaZfSX4W59h1bEbvkY","spine":"3.8.75","x":-42.24,"y":-29.04,"width":76,"height":95.42,"images":"./images/","audio":"E:/工作文件/1项目汇总/5战斗游戏/【新】数字大作战/动效/回收"},"bones":[{"name":"root"},{"name":"图层 641","parent":"root","length":23.21,"rotation":-1.26,"x":-3.55,"y":-15.24},{"name":"眼睛","parent":"图层 641","x":-13.18,"y":66.03},{"name":"眼睛2","parent":"图层 641","x":7.66,"y":69.29},{"name":"回收","parent":"图层 641","length":16.33,"rotation":-90.53,"x":1.42,"y":-6.6}],"slots":[{"name":"图层 641","bone":"图层 641","attachment":"图层 641"},{"name":"眼睛","bone":"眼睛","attachment":"眼睛1"},{"name":"眼睛2","bone":"眼睛2","attachment":"眼睛1"},{"name":"回收","bone":"回收","attachment":"回收"}],"skins":[{"name":"default","attachments":{"图层 641":{"图层 641":{"x":-1.43,"y":33.79,"rotation":1.26,"width":76,"height":84}},"回收":{"回收":{"x":-10.32,"y":-0.3,"rotation":91.79,"width":70,"height":35}},"眼睛":{"眼睛1":{"x":-0.47,"y":0.51,"rotation":1.26,"width":21,"height":24},"眼睛2":{"x":-0.47,"y":0.51,"rotation":1.26,"width":21,"height":24},"眼睛4":{"x":-0.47,"y":0.51,"rotation":1.26,"width":21,"height":24},"眼睛5":{"x":-0.47,"y":0.51,"rotation":1.26,"width":21,"height":24},"眼睛6":{"x":-0.47,"y":0.51,"rotation":1.26,"width":21,"height":24}},"眼睛2":{"眼睛1":{"x":-0.47,"y":0.51,"rotation":1.26,"width":21,"height":24},"眼睛2":{"x":-0.47,"y":0.51,"rotation":1.26,"width":21,"height":24},"眼睛4":{"x":-0.47,"y":0.51,"rotation":1.26,"width":21,"height":24},"眼睛5":{"x":-0.47,"y":0.51,"rotation":1.26,"width":21,"height":24},"眼睛6":{"x":-0.47,"y":0.51,"rotation":1.26,"width":21,"height":24}}}}],"animations":{"animation":{"slots":{"眼睛2":{"attachment":[{"time":1.2333,"name":"眼睛2"},{"time":1.3667,"name":"眼睛4"},{"time":1.4333,"name":"眼睛5"},{"time":1.5,"name":"眼睛6"},{"time":1.5667,"name":"眼睛1"}]},"眼睛":{"attachment":[{"time":1.2333,"name":"眼睛2"},{"time":1.3667,"name":"眼睛4"},{"time":1.4333,"name":"眼睛5"},{"time":1.5,"name":"眼睛6"},{"time":1.5667,"name":"眼睛1"}]}},"bones":{"图层 641":{"scale":[{"curve":0.25,"c3":0.75},{"time":0.8,"x":1.036,"y":1.07,"curve":0.25,"c3":0.75},{"time":1.5,"curve":0.25,"c3":0.75},{"time":2.3,"x":1.036,"y":1.07,"curve":0.25,"c3":0.75},{"time":3}]}}}}}

@ -0,0 +1,13 @@
{
"ver": "1.2.7",
"importer": "spine-data",
"imported": true,
"uuid": "62ac5441-a2b1-4399-a581-9e7709d873fc",
"files": [
".json"
],
"subMetas": {},
"userData": {
"atlasUuid": "56237c7f-84a9-4e9b-a571-2b2285625d8c"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

@ -0,0 +1,134 @@
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "9e44ad1d-32bb-43ec-b294-619a2eddc172",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "9e44ad1d-32bb-43ec-b294-619a2eddc172@6c48a",
"displayName": "回收",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "9e44ad1d-32bb-43ec-b294-619a2eddc172",
"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": "9e44ad1d-32bb-43ec-b294-619a2eddc172@f9941",
"displayName": "回收",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 98,
"height": 117,
"rawWidth": 98,
"rawHeight": 117,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-49,
-58.5,
0,
49,
-58.5,
0,
-49,
58.5,
0,
49,
58.5,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
117,
98,
117,
0,
0,
98,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-49,
-58.5,
0
],
"maxPos": [
49,
58.5,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "9e44ad1d-32bb-43ec-b294-619a2eddc172@6c48a",
"atlasUuid": "",
"trimType": "auto"
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"fixAlphaTransparencyArtifacts": false,
"hasAlpha": true,
"redirect": "9e44ad1d-32bb-43ec-b294-619a2eddc172@6c48a"
}
}

@ -44,23 +44,34 @@ export class MapDigChestHost {
private _dugChestCount = 0;
/**
* 开战埋宝箱(个数读 Const38),并刷新 Dig 皮为默认无皮。
* 开战埋宝箱:Const38 为**每个阵营**固定个数,只在各自 CampArea 的 Dig 格内随机位置。
* @param map 地图
*/
init(map: MapManager): void {
this.clear();
this._map = map;
const digs: MapGrid[] = [];
const digsByCamp: { camp: number; digs: MapGrid[] }[] = [];
for (let i = 0; i < map.mapGrids.length; i++) {
const g = map.mapGrids[i];
if (!g) continue;
g.chestRevealed = false;
if (g.isCanBeDig && !g.isCanPutText && !g.isCanWalk) {
digs.push(g);
g.updateGrid();
if (!(g.isCanBeDig && !g.isCanPutText && !g.isCanWalk)) continue;
g.updateGrid();
const camp = (g.CampAreaID | 0);
let bucket: { camp: number; digs: MapGrid[] } | null = null;
for (let b = 0; b < digsByCamp.length; b++) {
if (digsByCamp[b].camp === camp) {
bucket = digsByCamp[b];
break;
}
}
if (!bucket) {
bucket = { camp, digs: [] };
digsByCamp.push(bucket);
}
bucket.digs.push(g);
}
if (digs.length <= 0) {
if (digsByCamp.length <= 0) {
console.warn('[MapDigChestHost] 无可开挖格,未埋宝箱');
return;
}
@ -69,6 +80,20 @@ export class MapDigChestHost {
console.warn('[MapDigChestHost] Const38 宝箱个数无效,未埋宝箱', want);
return;
}
for (let c = 0; c < digsByCamp.length; c++) {
this._buryInCamp(digsByCamp[c].camp, digsByCamp[c].digs, want);
}
console.log('[MapDigChestHost] 埋宝箱合计', this._slots.length, this._slots.map((s) => s.index));
}
/**
* 在单个阵营 Dig 池内埋固定个数(只随机位置)。
* @param camp CampAreaID
* @param digs 该阵营可开挖格
* @param want Const38 个数
*/
private _buryInCamp(camp: number, digs: MapGrid[], want: number): void {
if (digs.length <= 0) return;
const shuffled = digs.slice();
for (let i = shuffled.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
@ -78,7 +103,7 @@ export class MapDigChestHost {
}
const n = Math.min(want, shuffled.length);
if (shuffled.length < want) {
console.warn('[MapDigChestHost] 可开挖格不足', shuffled.length, '目标', want);
console.warn('[MapDigChestHost] 阵营可开挖格不足', camp, shuffled.length, '目标', want);
}
for (let i = 0; i < n; i++) {
this._slots.push({
@ -88,7 +113,7 @@ export class MapDigChestHost {
tip: null,
});
}
console.log('[MapDigChestHost] 埋宝箱', n, this._slots.map((s) => s.index));
console.log('[MapDigChestHost] 阵营埋宝箱', camp, n, shuffled.slice(0, n).map((g) => g.Index));
}
/** Const38 关卡技能宝箱个数 */

@ -7,7 +7,7 @@
## 目标
1. 可开挖格默认无底皮(露深色地图底)。
2. 开战从全图纯 Dig 格随机埋 **6** 个宝箱(仅逻辑,无表现)。
2. 开战按阵营从各自纯 Dig 格埋宝箱(个数读 Const38,**每阵营固定个数**,只随机位置;仅逻辑,无表现)。
3. 铲子开挖后,若八邻有未揭示宝箱 → 显示「格子锁」+ `waitUnlockedSprite`(待解锁地块)。
4. 铲开宝箱格 → 宝箱飞向屏中放大×10 渐隐 → 弹出三选一(每次都弹;不用 Const27)。
5. AI 铲开宝箱:跳过飞入,直接 `autoPickOne`。
@ -16,8 +16,8 @@
| 项 | 说明 |
|----|------|
| 埋点池 | `isCanBeDig && !isCanPutText && !isCanWalk` |
| 数量 | 固定 6;不足则全埋并 `warn` |
| 埋点池 | 按 `CampAreaID` 分组:`isCanBeDig && !isCanPutText && !isCanWalk` |
| 数量 | Const38 `para`(每阵营固定);本阵营 Dig 不足则全埋并 `warn` |
| 邻域 | 八邻(含对角) |
| 默认 Dig 皮 | `spriteFrame = null` |
| 已揭示宝箱 Dig 皮 | `waitUnlockedSprite` + 预制体 `宝箱`(挂在格子节点上) |
@ -25,8 +25,8 @@
## 验收
- [ ] 开战 Dig 无皮;日志确认埋 6 格
- [ ] 铲邻格八邻:出格子锁 + 待解锁皮
- [ ] 铲宝箱:飞中央×10 渐隐 → PopSelect;一局最多 6 次
- [ ] 开战 Dig 无皮;日志确认**每阵营**埋 Const38 个
- [ ] 铲邻格八邻:出宝箱 tip + 待解锁皮
- [ ] 铲宝箱:飞中央×10 渐隐 → PopSelect;每阵营最多 Const38 次
- [ ] AI 铲宝箱自动选 buff,无面板
- [ ] Const27 不再门闸弹窗

Loading…
Cancel
Save