2 Commits

Author SHA1 Message Date
walkpan
d3126df601 refactor(game): 将技能触发逻辑从回合制改为全局次数制
移除技能卡的持续回合数(d_rds)和当前回合计数(current_round),改为仅使用全局触发次数(current_trigger_times)控制技能生命周期
更新UI显示从剩余回合改为剩余触发次数,技能在达到总触发次数后立即销毁而非等待回合结束
2026-04-07 09:47:59 +08:00
walkpan
a958a22c29 refactor(map): 移除未使用的预置体实例并重新映射组件ID
清理地图预置体文件,删除未引用的预置体实例(mskills节点)及其相关覆盖属性。
同时调整剩余组件的内部引用ID,保持文件结构一致性。
2026-04-06 23:20:02 +08:00
4 changed files with 1293 additions and 1368 deletions

View File

@@ -28,17 +28,17 @@
"_active": true,
"_components": [
{
"__id__": 136
"__id__": 120
},
{
"__id__": 138
"__id__": 122
},
{
"__id__": 140
"__id__": 124
}
],
"_prefab": {
"__id__": 142
"__id__": 126
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -197,17 +197,17 @@
"_active": true,
"_components": [
{
"__id__": 129
"__id__": 113
},
{
"__id__": 131
"__id__": 115
},
{
"__id__": 133
"__id__": 117
}
],
"_prefab": {
"__id__": 135
"__id__": 119
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -257,17 +257,17 @@
"__id__": 70
},
{
"__id__": 120
"__id__": 104
}
],
"_active": true,
"_components": [
{
"__id__": 126
"__id__": 110
}
],
"_prefab": {
"__id__": 128
"__id__": 112
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -1721,22 +1721,19 @@
},
{
"__id__": 95
},
{
"__id__": 99
}
],
"_active": true,
"_components": [
{
"__id__": 115
"__id__": 99
},
{
"__id__": 117
"__id__": 101
}
],
"_prefab": {
"__id__": 119
"__id__": 103
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -2383,212 +2380,6 @@
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_objFlags": 0,
"_parent": {
"__id__": 70
},
"_prefab": {
"__id__": 100
},
"__editorExtras__": {}
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 99
},
"asset": {
"__uuid__": "0f2aeee0-d590-4c36-9f20-a93b058d5b91",
"__expectedType__": "cc.Prefab"
},
"fileId": "5622mxbS1PNqMFP0FH5Mir",
"instance": {
"__id__": 101
},
"targetOverrides": null
},
{
"__type__": "cc.PrefabInstance",
"fileId": "f99PWIj1JPJqRhcUsVZf3M",
"prefabRootNode": {
"__id__": 1
},
"mountedChildren": [],
"mountedComponents": [],
"propertyOverrides": [
{
"__id__": 102
},
{
"__id__": 104
},
{
"__id__": 105
},
{
"__id__": 106
},
{
"__id__": 107
},
{
"__id__": 109
},
{
"__id__": 110
},
{
"__id__": 111
},
{
"__id__": 112
},
{
"__id__": 114
}
],
"removedComponents": []
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 103
},
"propertyPath": [
"_name"
],
"value": "mskills"
},
{
"__type__": "cc.TargetInfo",
"localID": [
"5622mxbS1PNqMFP0FH5Mir"
]
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 103
},
"propertyPath": [
"_lpos"
],
"value": {
"__type__": "cc.Vec3",
"x": -180,
"y": 314.571,
"z": 0
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 103
},
"propertyPath": [
"_lrot"
],
"value": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 103
},
"propertyPath": [
"_euler"
],
"value": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
}
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 108
},
"propertyPath": [
"_alignFlags"
],
"value": 10
},
{
"__type__": "cc.TargetInfo",
"localID": [
"baKsIzXktAyqqNBZKVQXO+"
]
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 108
},
"propertyPath": [
"_left"
],
"value": -360
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 108
},
"propertyPath": [
"_right"
],
"value": -130
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 108
},
"propertyPath": [
"_originalWidth"
],
"value": 360
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 113
},
"propertyPath": [
"_contentSize"
],
"value": {
"__type__": "cc.Size",
"width": 360,
"height": 100
}
},
{
"__type__": "cc.TargetInfo",
"localID": [
"4dNsDtN3ZGiZ+om9xELLFQ"
]
},
{
"__type__": "CCPropertyOverrideInfo",
"targetInfo": {
"__id__": 108
},
"propertyPath": [
"_verticalCenter"
],
"value": 264.571
},
{
"__type__": "cc.UITransform",
"_name": "",
@@ -2599,7 +2390,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 116
"__id__": 100
},
"_contentSize": {
"__type__": "cc.Size",
@@ -2627,7 +2418,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 118
"__id__": 102
},
"_id": ""
},
@@ -2660,14 +2451,14 @@
"_active": true,
"_components": [
{
"__id__": 121
"__id__": 105
},
{
"__id__": 123
"__id__": 107
}
],
"_prefab": {
"__id__": 125
"__id__": 109
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -2704,11 +2495,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 120
"__id__": 104
},
"_enabled": true,
"__prefab": {
"__id__": 122
"__id__": 106
},
"_contentSize": {
"__type__": "cc.Size",
@@ -2732,11 +2523,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 120
"__id__": 104
},
"_enabled": true,
"__prefab": {
"__id__": 124
"__id__": 108
},
"light": null,
"_id": ""
@@ -2768,7 +2559,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 127
"__id__": 111
},
"_contentSize": {
"__type__": "cc.Size",
@@ -2809,7 +2600,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 130
"__id__": 114
},
"_contentSize": {
"__type__": "cc.Size",
@@ -2837,7 +2628,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 132
"__id__": 116
},
"camera": {
"__id__": 3
@@ -2852,10 +2643,10 @@
"__id__": 66
},
"entityLayer": {
"__id__": 117
"__id__": 101
},
"SkillLayer": {
"__id__": 123
"__id__": 107
},
"isFollowPlayer": true,
"_id": ""
@@ -2874,7 +2665,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 134
"__id__": 118
},
"_id": ""
},
@@ -2905,7 +2696,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 137
"__id__": 121
},
"_contentSize": {
"__type__": "cc.Size",
@@ -2933,7 +2724,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 139
"__id__": 123
},
"_cameraComponent": {
"__id__": 3
@@ -2955,7 +2746,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 141
"__id__": 125
},
"_alignFlags": 45,
"_target": null,
@@ -2991,11 +2782,6 @@
},
"fileId": "32qENLKwZHV5S2IyZfpNx2",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": [
{
"__id__": 99
}
]
"targetOverrides": null
}
]

File diff suppressed because it is too large Load Diff

View File

@@ -43,7 +43,6 @@ export interface CardConfig {
is_inst?: boolean // 是否即时起效
t_times?: number // 触发次数
t_inv?: number // 触发间隔(秒)
d_rds?: number // 持续回合数
}
export const CardsUpSet: Record<number, number> = {
1: 50,
@@ -89,14 +88,14 @@ export const CardPoolList: CardConfig[] = [
{ uuid: 5304, type: CardType.Hero, cost: 3, weight: 25, pool_lv: 5, kind: CKind.Hero, hero_lv: 1 },
// 技能卡牌 (以增益/辅助为主,因为在备战期没有敌人)
{ uuid: 6401, type: CardType.Skill, cost: 2, weight: 20, pool_lv: 1, kind: CKind.Skill, card_lv: 1, name: "单体攻击", info: "随机1个友方+5攻击", is_inst: true, t_times: 1, t_inv: 0, d_rds: 1 },
{ uuid: 6402, type: CardType.Skill, cost: 2, weight: 20, pool_lv: 1, kind: CKind.Skill, card_lv: 1, name: "单体生命", info: "随机1个友方+20最大生命值", is_inst: true, t_times: 1, t_inv: 0, d_rds: 1 },
{ uuid: 6403, type: CardType.Skill, cost: 3, weight: 20, pool_lv: 2, kind: CKind.Skill, card_lv: 1, name: "单体全能", info: "随机1个友方+2攻击,+10最大生命值", is_inst: true, t_times: 1, t_inv: 0, d_rds: 1 },
{ uuid: 6404, type: CardType.Skill, cost: 4, weight: 20, pool_lv: 3, kind: CKind.Skill, card_lv: 1, name: "群体攻击", info: "随机3个友方+2攻击", is_inst: true, t_times: 1, t_inv: 0, d_rds: 1 },
{ uuid: 6405, type: CardType.Skill, cost: 4, weight: 20, pool_lv: 3, kind: CKind.Skill, card_lv: 1, name: "群体生命", info: "随机3个友方+10最大生命值", is_inst: true, t_times: 1, t_inv: 0, d_rds: 1 },
{ uuid: 6406, type: CardType.Skill, cost: 5, weight: 20, pool_lv: 4, kind: CKind.Skill, card_lv: 1, name: "群体全能", info: "为随机3个友方单位增加攻击力和生命上限", is_inst: true, t_times: 1, t_inv: 0, d_rds: 1 },
{ uuid: 6304, type: CardType.Skill, cost: 3, weight: 20, pool_lv: 2, kind: CKind.Skill, card_lv: 1, name: "神圣治疗", info: "恢复场上随机3个友方单位的生命值", is_inst: true, t_times: 1, t_inv: 0, d_rds: 1 },
{ uuid: 6305, type: CardType.Skill, cost: 4, weight: 20, pool_lv: 4, kind: CKind.Skill, card_lv: 1, name: "群体护盾", info: "随机3个友方获得2次伤害免疫", is_inst: true, t_times: 1, t_inv: 0, d_rds: 1 },
{ uuid: 6401, type: CardType.Skill, cost: 2, weight: 20, pool_lv: 1, kind: CKind.Skill, card_lv: 1, name: "单体攻击", info: "随机1个友方+5攻击", is_inst: true, t_times: 1, t_inv: 0 },
{ uuid: 6402, type: CardType.Skill, cost: 2, weight: 20, pool_lv: 1, kind: CKind.Skill, card_lv: 1, name: "单体生命", info: "随机1个友方+20最大生命值", is_inst: true, t_times: 1, t_inv: 0 },
{ uuid: 6403, type: CardType.Skill, cost: 3, weight: 20, pool_lv: 2, kind: CKind.Skill, card_lv: 1, name: "单体全能", info: "随机1个友方+2攻击,+10最大生命值", is_inst: true, t_times: 1, t_inv: 0 },
{ uuid: 6404, type: CardType.Skill, cost: 4, weight: 20, pool_lv: 3, kind: CKind.Skill, card_lv: 1, name: "群体攻击", info: "随机3个友方+2攻击", is_inst: true, t_times: 1, t_inv: 0 },
{ uuid: 6405, type: CardType.Skill, cost: 4, weight: 20, pool_lv: 3, kind: CKind.Skill, card_lv: 1, name: "群体生命", info: "随机3个友方+10最大生命值", is_inst: true, t_times: 1, t_inv: 0 },
{ uuid: 6406, type: CardType.Skill, cost: 5, weight: 20, pool_lv: 4, kind: CKind.Skill, card_lv: 1, name: "群体全能", info: "为随机3个友方单位增加攻击力和生命上限", is_inst: true, t_times: 1, t_inv: 0 },
{ uuid: 6304, type: CardType.Skill, cost: 3, weight: 20, pool_lv: 2, kind: CKind.Skill, card_lv: 1, name: "神圣治疗", info: "恢复场上随机3个友方单位的生命值", is_inst: true, t_times: 1, t_inv: 0 },
{ uuid: 6305, type: CardType.Skill, cost: 4, weight: 20, pool_lv: 4, kind: CKind.Skill, card_lv: 1, name: "群体护盾", info: "随机3个友方获得2次伤害免疫", is_inst: true, t_times: 1, t_inv: 0 },
{ uuid: 7001, type: CardType.SpecialUpgrade, cost: 6, weight: 16, pool_lv: 1 ,kind: CKind.Card },
{ uuid: 7002, type: CardType.SpecialUpgrade, cost: 6, weight: 14, pool_lv: 2 ,kind: CKind.Card },

View File

@@ -24,9 +24,7 @@ export class SkillBoxComp extends CCComp {
private is_instant: boolean = true;
private trigger_times: number = 1;
private trigger_interval: number = 0;
private duration_rounds: number = 1;
private current_round: number = 0;
private current_trigger_times: number = 0;
private timer: number = 0;
private in_combat: boolean = false;
@@ -56,10 +54,8 @@ export class SkillBoxComp extends CCComp {
this.is_instant = config.is_inst ?? true;
this.trigger_times = config.t_times ?? 1;
this.trigger_interval = config.t_inv ?? 0;
this.duration_rounds = config.d_rds ?? 1;
}
this.current_round = 0;
this.current_trigger_times = 0;
this.timer = 0;
this.initialized = true;
@@ -93,7 +89,8 @@ export class SkillBoxComp extends CCComp {
if (this.info_label) {
if (!this.is_instant) {
this.info_label.string = `${this.duration_rounds - this.current_round}`;
const remain = Math.max(0, this.trigger_times - this.current_trigger_times);
this.info_label.string = `${remain}`;
} else {
this.info_label.string = "";
}
@@ -107,8 +104,6 @@ export class SkillBoxComp extends CCComp {
if (!this.is_instant) {
// 战斗开始时计时归0重新计时
this.timer = 0;
// 如果这个技能每回合都可以触发 t_times 次,则在每回合开始时重置当前回合触发次数
this.current_trigger_times = 0;
}
}
@@ -125,9 +120,8 @@ export class SkillBoxComp extends CCComp {
this.in_combat = false;
if (!this.is_instant) {
this.current_round++;
this.updateUI();
if (this.current_round >= this.duration_rounds) {
// 每回合不再重置次数,由全局次数进行控制
if (this.current_trigger_times >= this.trigger_times) {
this.node.destroy();
}
}
@@ -147,6 +141,15 @@ export class SkillBoxComp extends CCComp {
this.timer = 0; // 触发后重新计时
this.triggerSkill();
this.current_trigger_times++;
this.updateUI(); // 触发后更新界面显示的剩余次数
// 如果在战斗中就达到触发次数上限,则可以在此回合战斗结束或者立即销毁
if (this.current_trigger_times >= this.trigger_times) {
// 可以选择直接销毁,不等到下一回合
this.scheduleOnce(() => {
if (this.node.isValid) this.node.destroy();
}, 0.5);
}
}
}
}