refactor(游戏配置): 调整英雄配置和游戏平衡参数
- 更新英雄配置文档,完善战士技能描述 - 修改英雄升级和合并相关参数 - 移除后退相关逻辑和配置 - 重构卡牌显示逻辑,优化UI组件管理
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -24,14 +24,14 @@ export enum FightSet {
|
||||
MORE_RC=10,//更多次数 广告获取的次数
|
||||
HEARTPOS=-320,//基地位置
|
||||
HERO_MAX_NUM=3,//英雄最大数量
|
||||
MERGE_MAX=2, //英雄最大等级
|
||||
MERGE_NEED=3, //英雄升级需要的英雄数
|
||||
MERGE_MAX=3, //英雄最大等级
|
||||
MERGE_NEED=2, //英雄升级需要的英雄数
|
||||
LVUP_GOLD=50,//升级需要的金币
|
||||
LVUP_GOLD_UP=50,//升级需要的金币
|
||||
CHOU_GOLD=100,//抽卡需要的金币
|
||||
BACK_RANG=30,//后退范围
|
||||
// BACK_RANG=30,//后退范围
|
||||
FiIGHT_TIME=30,//战斗时间
|
||||
BACK_CHANCE=40,//击退概率
|
||||
// BACK_CHANCE=40,//击退概率
|
||||
FROST_TIME=3,//冰冻时间
|
||||
SKILL_CAST_DELAY=0.15,
|
||||
CSKILL_START_X=-340,
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
普通: 近战无
|
||||
普通魔法:水球
|
||||
暴击: 火球 :概率,双倍伤害 默认概率10%
|
||||
穿刺: 旋风 :多个目标 默认概率10%
|
||||
穿刺: 旋风 :多个目标 默认概率10%
|
||||
冰冻:冰系,冻结目标减少 默认概率10%
|
||||
可叠加类型:
|
||||
双击(风怒)概率
|
||||
|
||||
双击(风怒)概率
|
||||
|
||||
特殊效果
|
||||
护盾: 抵挡攻击
|
||||
@@ -26,10 +25,8 @@
|
||||
战斗结束技能触发2次
|
||||
被攻击技能触发2次
|
||||
|
||||
战士1:普通攻击 : 被攻击3次获得3次格挡的护盾
|
||||
战士2: :
|
||||
战士3: :
|
||||
战士4: :
|
||||
战士5: :
|
||||
|
||||
|
||||
战士1:普通攻击 :被攻击3次获得3次格挡的护盾
|
||||
战士2:普通攻击 :就是皮厚,血量普通展示2倍
|
||||
战士3:普通攻击 :
|
||||
战士4:普通攻击 :20%血量复活1次数
|
||||
战士5:普通攻击 :
|
||||
|
||||
@@ -480,30 +480,30 @@ export class HeroViewComp extends CCComp {
|
||||
//后退
|
||||
back(){
|
||||
// 🔥 防止重复调用后退动画
|
||||
if (this.isBackingUp) return;
|
||||
this.isBackingUp = true; // 🔥 设置后退状态
|
||||
// if (this.isBackingUp) return;
|
||||
// this.isBackingUp = true; // 🔥 设置后退状态
|
||||
|
||||
if(this.model.fac==FacSet.MON) {
|
||||
let tx=this.node.position.x+FightSet.BACK_RANG
|
||||
if(tx > 320) tx=320
|
||||
tween(this.node)
|
||||
.to(0.1, { position:v3(tx,this.node.position.y,0)})
|
||||
.call(() => {
|
||||
this.isBackingUp = false; // 🔥 动画完成后重置状态
|
||||
})
|
||||
.start()
|
||||
}
|
||||
// if(this.model.fac==FacSet.MON) {
|
||||
// let tx=this.node.position.x+FightSet.BACK_RANG
|
||||
// if(tx > 320) tx=320
|
||||
// tween(this.node)
|
||||
// .to(0.1, { position:v3(tx,this.node.position.y,0)})
|
||||
// .call(() => {
|
||||
// this.isBackingUp = false; // 🔥 动画完成后重置状态
|
||||
// })
|
||||
// .start()
|
||||
// }
|
||||
|
||||
if(this.model.fac==FacSet.HERO) {
|
||||
let tx=this.node.position.x-5
|
||||
if(tx < -320) tx=-320
|
||||
tween(this.node)
|
||||
.to(0.1, { position:v3(tx,this.node.position.y,0)})
|
||||
.call(() => {
|
||||
this.isBackingUp = false; // 🔥 动画完成后重置状态
|
||||
})
|
||||
.start()
|
||||
}
|
||||
// if(this.model.fac==FacSet.HERO) {
|
||||
// let tx=this.node.position.x-5
|
||||
// if(tx < -320) tx=-320
|
||||
// tween(this.node)
|
||||
// .to(0.1, { position:v3(tx,this.node.position.y,0)})
|
||||
// .call(() => {
|
||||
// this.isBackingUp = false; // 🔥 动画完成后重置状态
|
||||
// })
|
||||
// .start()
|
||||
// }
|
||||
}
|
||||
// 伤害计算和战斗逻辑已迁移到 HeroBattleSystem
|
||||
|
||||
|
||||
@@ -665,33 +665,41 @@ export class CardComp extends CCComp {
|
||||
this.node.setPosition(targetX, targetY, this.restPosition.z);
|
||||
|
||||
// ---- 卡牌种类标识(近战 / 远程 / 辅助等) ----
|
||||
// if (this.Ckind_node) {
|
||||
// const kindName = CKind[this.cardData.kind];
|
||||
// this.Ckind_node.children.forEach(child => {
|
||||
// child.active = (child.name === kindName);
|
||||
// });
|
||||
// }
|
||||
const kindName = CKind[this.cardData.kind];
|
||||
|
||||
// ---- 背景底框(按卡池等级显示对应子节点) ----
|
||||
const cardLvStr = `lv${this.cardData.pool_lv}`;
|
||||
// ---- 背景底框与高级边框(现在按 Ckind 显示对应子节点) ----
|
||||
if (this.BG_node) {
|
||||
this.BG_node.children.forEach(child => {
|
||||
child.active = (child.name === cardLvStr);
|
||||
child.active = (child.name === kindName);
|
||||
});
|
||||
}
|
||||
|
||||
// ---- 品质边框(高级 vs 普通) ----
|
||||
const card_lv_val = this.cardData.card_lv ?? 1;
|
||||
const isHighLevel = (this.cardData.hero_lv ?? 0) > 1 || card_lv_val > 1;
|
||||
if (this.HF_node) this.HF_node.active = isHighLevel;
|
||||
if (this.NF_node) this.NF_node.active = !isHighLevel;
|
||||
this.node.getChildByName("HB").active = isHighLevel;
|
||||
const activeFrameNode = isHighLevel ? this.HF_node : this.NF_node;
|
||||
if (activeFrameNode) {
|
||||
activeFrameNode.children.forEach(child => {
|
||||
child.active = (child.name === cardLvStr);
|
||||
if (this.HF_node) {
|
||||
this.HF_node.active = true;
|
||||
this.HF_node.children.forEach(child => {
|
||||
child.active = (child.name === kindName);
|
||||
});
|
||||
}
|
||||
|
||||
if (this.NF_node) {
|
||||
this.NF_node.active = false;
|
||||
}
|
||||
|
||||
const hbNodeUI = this.node.getChildByName("HB");
|
||||
if (hbNodeUI) hbNodeUI.active = false;
|
||||
|
||||
// ---- 卡牌等级标识 ----
|
||||
const cardLvStr = `lv${this.cardData.pool_lv}`;
|
||||
if (this.lv_node) {
|
||||
this.lv_node.children.forEach(child => {
|
||||
if (child.name === "light") {
|
||||
child.active = false;
|
||||
} else if (child.name === "bg") {
|
||||
child.active = true;
|
||||
} else {
|
||||
child.active = (child.name === cardLvStr);
|
||||
}
|
||||
});
|
||||
if(isHighLevel){activeFrameNode.getChildByName("light").active=true}
|
||||
}
|
||||
|
||||
// ---- 按卡牌类型渲染具体内容 ----
|
||||
@@ -720,6 +728,23 @@ export class CardComp extends CCComp {
|
||||
});
|
||||
}
|
||||
|
||||
if (this.lv_node) {
|
||||
const lvTrans = this.lv_node.getComponent(UITransform);
|
||||
if (lvTrans) {
|
||||
lvTrans.setContentSize(this.isEnlarged ? 230 : 170, this.isEnlarged ? 300 : 230);
|
||||
const widget = this.lv_node.getComponent(Widget);
|
||||
if (widget) widget.updateAlignment();
|
||||
}
|
||||
this.lv_node.children.forEach(child => {
|
||||
const childTrans = child.getComponent(UITransform);
|
||||
if (childTrans) {
|
||||
childTrans.setContentSize(this.isEnlarged ? 230 : 170, this.isEnlarged ? 300 : 230);
|
||||
const widget = child.getComponent(Widget);
|
||||
if (widget) widget.updateAlignment();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (this.HF_node) {
|
||||
const hfTrans = this.HF_node.getComponent(UITransform);
|
||||
if (hfTrans) {
|
||||
@@ -830,7 +855,17 @@ export class CardComp extends CCComp {
|
||||
}
|
||||
|
||||
// ---- 费用标签 ----
|
||||
this.setLabel(this.cost_node, `${this.card_cost}`);
|
||||
if (this.card_type === CardType.Hero) {
|
||||
if (this.cost_node) this.cost_node.active = false;
|
||||
} else {
|
||||
if (this.cost_node) {
|
||||
this.cost_node.active = true;
|
||||
const numNode = this.cost_node.getChildByName("num");
|
||||
if (numNode) {
|
||||
this.setLabel(numNode, `${this.card_cost}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---- 名字节点位置调整 ----
|
||||
if (this.name_node) {
|
||||
@@ -945,6 +980,22 @@ export class CardComp extends CCComp {
|
||||
}
|
||||
});
|
||||
}
|
||||
if (this.lv_node) {
|
||||
const lvTrans = this.lv_node.getComponent(UITransform);
|
||||
if (lvTrans) {
|
||||
lvTrans.setContentSize(170, 230);
|
||||
const widget = this.lv_node.getComponent(Widget);
|
||||
if (widget) widget.updateAlignment();
|
||||
}
|
||||
this.lv_node.children.forEach(child => {
|
||||
const childTrans = child.getComponent(UITransform);
|
||||
if (childTrans) {
|
||||
childTrans.setContentSize(170, 230);
|
||||
const widget = child.getComponent(Widget);
|
||||
if (widget) widget.updateAlignment();
|
||||
}
|
||||
});
|
||||
}
|
||||
if (this.HF_node) {
|
||||
const hfTrans = this.HF_node.getComponent(UITransform);
|
||||
if (hfTrans) {
|
||||
@@ -1002,7 +1053,12 @@ export class CardComp extends CCComp {
|
||||
}
|
||||
this.iconVisualToken += 1;
|
||||
this.setLabel(this.name_node, "");
|
||||
this.setLabel(this.cost_node, "");
|
||||
if (this.cost_node) {
|
||||
const numNode = this.cost_node.getChildByName("num");
|
||||
if (numNode) {
|
||||
this.setLabel(numNode, "");
|
||||
}
|
||||
}
|
||||
if (this.info_node) this.info_node.active = false;
|
||||
if (this.oinfo_node) this.oinfo_node.active = false;
|
||||
// if (this.Ckind_node) {
|
||||
@@ -1013,8 +1069,15 @@ export class CardComp extends CCComp {
|
||||
if (this.BG_node) {
|
||||
this.BG_node.children.forEach(child => child.active = false);
|
||||
}
|
||||
if (this.HF_node) this.HF_node.active = false;
|
||||
if (this.HF_node) {
|
||||
this.HF_node.active = false;
|
||||
this.HF_node.children.forEach(child => child.active = false);
|
||||
}
|
||||
if (this.NF_node) this.NF_node.active = false;
|
||||
if (this.lv_node) {
|
||||
this.lv_node.children.forEach(child => child.active = false);
|
||||
}
|
||||
if (this.cost_node) this.cost_node.active = false;
|
||||
this.clearIconAnimation(this.icon_node as Node);
|
||||
const sprite = this.icon_node?.getComponent(Sprite) || this.icon_node?.getComponentInChildren(Sprite);
|
||||
if (sprite) sprite.spriteFrame = null;
|
||||
|
||||
Reference in New Issue
Block a user