fix: 修复怪物技能、朝向和飘字显示问题
1. 修正技能节点缩放逻辑,确保镜像显示正确 2. 修复怪物反向移动时的朝向错误 3. 调整伤害飘字的Y轴偏移,优化显示位置 4. 更新怪物配置的技能ID,修正技能绑定错误
This commit is contained in:
@@ -193,35 +193,35 @@ export const HeroInfo: Record<number, heroInfo> = {
|
||||
|
||||
// 基础怪物
|
||||
6001:{uuid:6001,name:"兽人初阶战士",path:"m1", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:360,hp:360,ap:12,speed:100,
|
||||
skills:{6001:{uuid:6001,lv:1,cd:0.65,ccd:0}},info:""},
|
||||
skills:{6005:{uuid:6005,lv:1,cd:0.65,ccd:0}},info:""},
|
||||
6002:{uuid:6002,name:"兽人高阶战士",path:"m2", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:360,hp:360,ap:12,speed:100,
|
||||
skills:{6001:{uuid:6001,lv:1,cd:0.65,ccd:0}},info:""},
|
||||
skills:{6005:{uuid:6005,lv:1,cd:0.65,ccd:0}},info:""},
|
||||
6003:{uuid:6003,name:"兽人初阶射手",path:"m3", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:360,hp:1050,ap:30,speed:100,
|
||||
skills:{6001:{uuid:6001,lv:1,cd:2,ccd:0}},info:""},
|
||||
skills:{6008:{uuid:6008,lv:1,cd:2,ccd:0}},info:""},
|
||||
6004:{uuid:6004,name:"兽人高阶射手",path:"m4", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Long,hp:720,ap:45,speed:100,
|
||||
skills:{6010:{uuid:6010,lv:1,cd:1.5,ccd:0}},info:""},
|
||||
skills:{6008:{uuid:6008,lv:1,cd:1.5,ccd:0}},info:""},
|
||||
6005:{uuid:6005,name:"兽人刺客",path:"m5", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Long,hp:720,ap:20,speed:100,
|
||||
skills:{6103:{uuid:6103,lv:1,cd:1.5,ccd:0}},info:""},
|
||||
6006:{uuid:6006,name:"骷髅高阶战士",path:"m6", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:360,hp:4500,ap:20,speed:100,
|
||||
skills:{6002:{uuid:6001,lv:1,cd:2,ccd:0}},info:""},
|
||||
skills:{6005:{uuid:6005,lv:1,cd:2,ccd:0}},info:""},
|
||||
6007:{uuid:6007,name:"兽人蓝色法师",path:"m7", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:360,hp:4500,ap:20,speed:100,
|
||||
skills:{6002:{uuid:6001,lv:1,cd:2,ccd:0}},info:""},
|
||||
skills:{6103:{uuid:6103,lv:1,cd:2,ccd:0}},info:""},
|
||||
6008:{uuid:6008,name:"兽人红色法师",path:"m8", fac:FacSet.MON,cards_lv:1,lv:1,type:HType.Melee,dis:360,hp:4500,ap:20,speed:100,
|
||||
skills:{6002:{uuid:6001,lv:1,cd:2,ccd:0}},info:""},
|
||||
skills:{6103:{uuid:6103,lv:1,cd:2,ccd:0}},info:""},
|
||||
|
||||
// BOSS怪物
|
||||
6101:{uuid:6101,name:"兽人首领-双刀战士-蓝边",path:"mb1", fac:FacSet.MON,cards_lv:1,lv:6,type:HType.Long,hp:720,ap:30,speed:100,
|
||||
skills:{6103:{uuid:6103,lv:1,cd:2,ccd:0},6206:{uuid:6206,lv:1,cd:10,ccd:0}},info:""},
|
||||
6102:{uuid:6102,name:"兽人首领-斧头战士-绿边",path:"mb2", fac:FacSet.MON,cards_lv:1,lv:6,type:HType.Melee,dis:360,hp:4500,ap:20,speed:100,
|
||||
skills:{6001:{uuid:6001,lv:1,cd:2,ccd:0},6005:{uuid:6005,lv:1,cd:10,ccd:0}},info:""},
|
||||
skills:{6005:{uuid:6005,lv:1,cd:2,ccd:0},},info:""},
|
||||
6103:{uuid:6103,name:"兽人首领-魔法师-紫边",path:"mb3", fac:FacSet.MON,cards_lv:1,lv:6,type:HType.Long,hp:720,ap:30,speed:100,
|
||||
skills:{6103:{uuid:6103,lv:1,cd:2,ccd:0},6206:{uuid:6206,lv:1,cd:10,ccd:0}},info:""},
|
||||
6104:{uuid:6104,name:"兽人首领-射手-黄边",path:"mb4", fac:FacSet.MON,cards_lv:1,lv:6,type:HType.Melee,dis:360,hp:4500,ap:20,speed:100,
|
||||
skills:{6001:{uuid:6001,lv:1,cd:2,ccd:0},6005:{uuid:6005,lv:1,cd:10,ccd:0}},info:""},
|
||||
skills:{6005:{uuid:6005,lv:1,cd:2,ccd:0},},info:""},
|
||||
6105:{uuid:6105,name:"亡灵首领-法师-红边",path:"mb5", fac:FacSet.MON,cards_lv:1,lv:6,type:HType.Long,hp:720,ap:30,speed:100,
|
||||
skills:{6103:{uuid:6103,lv:1,cd:2,ccd:0},6206:{uuid:6206,lv:1,cd:10,ccd:0}},info:""},
|
||||
6106:{uuid:6106,name:"亡灵首领-骑马战士-红边",path:"mb6", fac:FacSet.MON,cards_lv:1,lv:6,type:HType.Melee,dis:360,hp:4500,ap:20,speed:100,
|
||||
skills:{6001:{uuid:6001,lv:1,cd:2,ccd:0},6005:{uuid:6005,lv:1,cd:10,ccd:0}},info:""},
|
||||
skills:{6005:{uuid:6005,lv:1,cd:2,ccd:0},},info:""},
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -103,7 +103,10 @@ export class SMoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
const dirForAngle = new Vec3();
|
||||
Vec3.subtract(dirForAngle, adjustedTargetPos, adjustedStartPos);
|
||||
if (dirForAngle.length() > 0.01) {
|
||||
const angle = Math.atan2(dirForAngle.y, dirForAngle.x) * (180 / Math.PI);
|
||||
let angle = Math.atan2(dirForAngle.y, dirForAngle.x) * (180 / Math.PI);
|
||||
if (moveComp.scale < 0) {
|
||||
angle += 180;
|
||||
}
|
||||
node.angle = angle;
|
||||
}
|
||||
break;
|
||||
@@ -209,7 +212,10 @@ export class SMoveSystem extends ecs.ComblockSystem implements ecs.ISystemUpdate
|
||||
Vec3.subtract(direction, nextPos, moveComp.currentPos);
|
||||
|
||||
if (direction.length() > 0.01) {
|
||||
const angle = Math.atan2(direction.y, direction.x) * (180 / Math.PI);
|
||||
let angle = Math.atan2(direction.y, direction.x) * (180 / Math.PI);
|
||||
if (moveComp.scale < 0) {
|
||||
angle += 180;
|
||||
}
|
||||
node.angle = angle;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ export class Skill extends ecs.Entity {
|
||||
node.active = true;
|
||||
// 设置节点属性
|
||||
let face=caster.node.scale.x < 0 ? -1 : 1
|
||||
node.setScale(v3(node.scale.x*face,node.scale.y,1))
|
||||
node.setScale(v3(Math.abs(node.scale.x)*face,node.scale.y,1))
|
||||
// 初始视图
|
||||
const SView = node.getComponent(SkillView);
|
||||
if (!SView) {
|
||||
|
||||
@@ -71,8 +71,8 @@ export class TooltipCom extends CCComp {
|
||||
// 设置极高的渲染层级,防止被怪物遮挡
|
||||
const topSiblingIndex = 9999;
|
||||
|
||||
// 临时变量,存储当前Y坐标,方便统一处理
|
||||
let currentY = this.node.position.y;
|
||||
// 临时变量,存储当前Y坐标,方便统一处理。增加60的Y轴基础偏移,防止伤害飘字等遮挡血条
|
||||
let currentY = this.node.position.y + 30;
|
||||
|
||||
switch (this.stype) {
|
||||
case TooltipTypes.life: // 普通伤害
|
||||
@@ -82,11 +82,13 @@ export class TooltipCom extends CCComp {
|
||||
scaleMax = 1.5;
|
||||
break;
|
||||
case TooltipTypes.health: // 治疗
|
||||
this.node.setPosition(v3(this.node.position.x + offsetX, currentY));
|
||||
this.node.setSiblingIndex(topSiblingIndex);
|
||||
this.setupLabel("add_life", "hp", this.value);
|
||||
isHeal = true;
|
||||
break;
|
||||
case TooltipTypes.addmp: // 回蓝
|
||||
this.node.setPosition(v3(this.node.position.x + offsetX, currentY));
|
||||
this.node.setSiblingIndex(topSiblingIndex);
|
||||
this.setupLabel("add_mp", "mp", this.value);
|
||||
isHeal = true;
|
||||
@@ -107,25 +109,26 @@ export class TooltipCom extends CCComp {
|
||||
break;
|
||||
case TooltipTypes.uskill:
|
||||
this.setupLabel("uskill", "name", this.value);
|
||||
this.node.setPosition(v3(this.node.position.x, this.node.position.y + 30));
|
||||
this.node.setPosition(v3(this.node.position.x, currentY + 30));
|
||||
this.node.setSiblingIndex(topSiblingIndex);
|
||||
break;
|
||||
case TooltipTypes.lvup:
|
||||
this.node.getChildByName("lvup").active = true;
|
||||
this.node.setPosition(v3(this.node.position.x, this.node.position.y - 30));
|
||||
this.node.setPosition(v3(this.node.position.x, currentY - 30));
|
||||
this.node.setSiblingIndex(topSiblingIndex);
|
||||
break;
|
||||
case TooltipTypes.apup:
|
||||
this.setupLabel("apup", "num", "+" + this.value);
|
||||
this.node.setPosition(v3(this.node.position.x, this.node.position.y - 60));
|
||||
this.node.setPosition(v3(this.node.position.x, currentY - 60));
|
||||
this.node.setSiblingIndex(topSiblingIndex);
|
||||
break;
|
||||
case TooltipTypes.hpup:
|
||||
this.setupLabel("hpup", "num", "+" + this.value);
|
||||
this.node.setPosition(v3(this.node.position.x, this.node.position.y - 60));
|
||||
this.node.setPosition(v3(this.node.position.x, currentY - 60));
|
||||
this.node.setSiblingIndex(topSiblingIndex);
|
||||
break;
|
||||
case TooltipTypes.shield:
|
||||
this.node.setPosition(v3(this.node.position.x + offsetX, currentY));
|
||||
this.node.setSiblingIndex(topSiblingIndex);
|
||||
this.setupLabel("add_life", "hp", this.value);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user