Compare commits
3 Commits
24c32549c0
...
e24d169161
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e24d169161 | ||
|
|
9363f8f1d7 | ||
|
|
183fe111ef |
6
.trae/rules/git-commit-message.md
Normal file
6
.trae/rules/git-commit-message.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
alwaysApply: true
|
||||
scene: git_message
|
||||
---
|
||||
|
||||
在此处编写规则,自定义 AI 生成提交信息的风格。
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1938,7 +1938,7 @@
|
||||
"__id__": 92
|
||||
}
|
||||
],
|
||||
"_active": true,
|
||||
"_active": false,
|
||||
"_components": [
|
||||
{
|
||||
"__id__": 100
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
可叠加类型:
|
||||
双击(风怒)概率
|
||||
|
||||
|
||||
特殊效果
|
||||
护盾: 抵挡攻击
|
||||
治疗: 回血
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -83,6 +83,9 @@ export class CardComp extends CCComp {
|
||||
@property(Node)
|
||||
HF_node=null!
|
||||
|
||||
@property(Node)
|
||||
lv_node=null!
|
||||
|
||||
// ======================== 运行时状态 ========================
|
||||
|
||||
/** 当前卡牌的金币费用 */
|
||||
@@ -662,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}
|
||||
}
|
||||
|
||||
// ---- 按卡牌类型渲染具体内容 ----
|
||||
@@ -717,6 +728,16 @@ export class CardComp extends CCComp {
|
||||
});
|
||||
}
|
||||
|
||||
if (this.lv_node) {
|
||||
const widget = this.lv_node.getComponent(Widget);
|
||||
if (widget) widget.updateAlignment();
|
||||
|
||||
this.lv_node.children.forEach(child => {
|
||||
const childWidget = child.getComponent(Widget);
|
||||
if (childWidget) childWidget.updateAlignment();
|
||||
});
|
||||
}
|
||||
|
||||
if (this.HF_node) {
|
||||
const hfTrans = this.HF_node.getComponent(UITransform);
|
||||
if (hfTrans) {
|
||||
@@ -827,7 +848,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) {
|
||||
@@ -942,6 +973,15 @@ export class CardComp extends CCComp {
|
||||
}
|
||||
});
|
||||
}
|
||||
if (this.lv_node) {
|
||||
const widget = this.lv_node.getComponent(Widget);
|
||||
if (widget) widget.updateAlignment();
|
||||
|
||||
this.lv_node.children.forEach(child => {
|
||||
const childWidget = child.getComponent(Widget);
|
||||
if (childWidget) childWidget.updateAlignment();
|
||||
});
|
||||
}
|
||||
if (this.HF_node) {
|
||||
const hfTrans = this.HF_node.getComponent(UITransform);
|
||||
if (hfTrans) {
|
||||
@@ -999,7 +1039,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) {
|
||||
@@ -1010,8 +1055,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;
|
||||
|
||||
@@ -53,6 +53,9 @@ export class HInfoComp extends CCComp {
|
||||
@property(Node)
|
||||
HF_node=null!
|
||||
|
||||
@property(Node)
|
||||
lv_node=null!
|
||||
|
||||
/** 绑定的英雄 ECS 实体 ID */
|
||||
private eid: number = 0;
|
||||
/** 绑定的英雄属性数据模型引用 */
|
||||
@@ -96,16 +99,10 @@ export class HInfoComp extends CCComp {
|
||||
refresh() {
|
||||
if (!this.model) return;
|
||||
|
||||
// ---- 品质边框切换 ----
|
||||
const isHighLevel = (this.model.lv ?? 0) > 1;
|
||||
if (this.HF_node) this.HF_node.active = isHighLevel;
|
||||
if (this.NF_node) this.NF_node.active = !isHighLevel;
|
||||
|
||||
// 按卡池等级显示对应子节点
|
||||
const activeFrameNode = isHighLevel ? this.HF_node : this.NF_node;
|
||||
if (activeFrameNode) {
|
||||
// ---- 卡牌等级显示 ----
|
||||
if (this.lv_node) {
|
||||
const cardLvStr = `lv${this.model.pool_lv ?? 1}`;
|
||||
activeFrameNode.children.forEach(child => {
|
||||
this.lv_node.children.forEach(child => {
|
||||
child.active = (child.name === cardLvStr);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user