战斗等级显示需要完善

This commit is contained in:
2025-05-26 16:38:59 +08:00
parent 85856ccc28
commit 3efbf21a14
8 changed files with 159 additions and 109 deletions

View File

@@ -741,7 +741,7 @@
"__id__": 39
}
],
"_active": false,
"_active": true,
"_components": [
{
"__id__": 45
@@ -752,7 +752,7 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": -21.65,
"x": 0,
"y": -12.854,
"z": 0
},
@@ -880,7 +880,7 @@
"a": 255
},
"_spriteFrame": {
"__uuid__": "f87f53f9-2fba-4a5b-968a-79a593311ab2@228f2",
"__uuid__": "f87f53f9-2fba-4a5b-968a-79a593311ab2@008c0",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
@@ -979,8 +979,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 13.123046875,
"height": 27.2
"width": 15.123046875,
"height": 29.2
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -1040,7 +1040,7 @@
"b": 0,
"a": 255
},
"_outlineWidth": 1,
"_outlineWidth": 2,
"_enableShadow": false,
"_shadowColor": {
"__type__": "cc.Color",

View File

@@ -95,9 +95,9 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.1666666716337204,
0.2777777910232544,
0.6666666865348816
0.16666666666666666,
0.2777777777777778,
0.6666666666666666
],
"_values": [
{
@@ -162,9 +162,9 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.1666666716337204,
0.2777777910232544,
0.6666666865348816
0.16666666666666666,
0.2777777777777778,
0.6666666666666666
],
"_values": [
{
@@ -229,9 +229,9 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.1666666716337204,
0.2777777910232544,
0.6666666865348816
0.16666666666666666,
0.2777777777777778,
0.6666666666666666
],
"_values": [
{
@@ -347,9 +347,9 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.1666666716337204,
0.2777777910232544,
0.6666666865348816
0.16666666666666666,
0.2777777777777778,
0.6666666666666666
],
"_values": [
{
@@ -414,9 +414,9 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.1666666716337204,
0.2777777910232544,
0.6666666865348816
0.16666666666666666,
0.2777777777777778,
0.6666666666666666
],
"_values": [
{
@@ -545,9 +545,9 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.1666666716337204,
0.2777777910232544,
0.4444444477558136
0.16666666666666666,
0.2777777777777778,
0.4444444444444444
],
"_values": [
{
@@ -612,9 +612,9 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.1666666716337204,
0.2777777910232544,
0.4444444477558136
0.16666666666666666,
0.2777777777777778,
0.4444444444444444
],
"_values": [
{
@@ -678,8 +678,8 @@
{
"__type__": "cc.RealCurve",
"_times": [
0.1666666716337204,
0.2777777910232544
0.16666666666666666,
0.2777777777777778
],
"_values": [
{
@@ -771,9 +771,9 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.1666666716337204,
0.2777777910232544,
0.6666666865348816
0.16666666666666666,
0.2777777777777778,
0.6666666666666666
],
"_values": [
{
@@ -838,9 +838,9 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.1666666716337204,
0.2777777910232544,
0.6666666865348816
0.16666666666666666,
0.2777777777777778,
0.6666666666666666
],
"_values": [
{
@@ -904,9 +904,9 @@
{
"__type__": "cc.RealCurve",
"_times": [
0.1666666716337204,
0.2777777910232544,
0.6666666865348816
0.16666666666666666,
0.2777777777777778,
0.6666666666666666
],
"_values": [
{
@@ -1010,8 +1010,8 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.2777777910232544,
0.5555555820465088
0.2777777777777778,
0.5555555555555556
],
"_values": [
{
@@ -1064,8 +1064,8 @@
"__type__": "cc.RealCurve",
"_times": [
0,
0.2777777910232544,
0.5555555820465088
0.2777777777777778,
0.5555555555555556
],
"_values": [
{
@@ -1117,7 +1117,7 @@
{
"__type__": "cc.RealCurve",
"_times": [
0.2777777910232544
0.2777777777777778
],
"_values": [
{
@@ -1196,8 +1196,8 @@
{
"__type__": "cc.RealCurve",
"_times": [
0.2777777910232544,
0.6666666865348816
0.2777777777777778,
0.6666666666666666
],
"_values": [
{
@@ -1237,8 +1237,8 @@
{
"__type__": "cc.RealCurve",
"_times": [
0.2777777910232544,
0.6666666865348816
0.2777777777777778,
0.6666666666666666
],
"_values": [
{
@@ -1278,8 +1278,8 @@
{
"__type__": "cc.RealCurve",
"_times": [
0.2777777910232544,
0.6666666865348816
0.2777777777777778,
0.6666666666666666
],
"_values": [
{
@@ -1370,8 +1370,9 @@
{
"__type__": "cc.RealCurve",
"_times": [
0.3333333432674408,
0.6666666865348816
0,
0.3333333333333333,
0.6666666666666666
],
"_values": [
{
@@ -1386,6 +1387,18 @@
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
@@ -1411,10 +1424,23 @@
{
"__type__": "cc.RealCurve",
"_times": [
0.3333333432674408,
0.6666666865348816
0,
0.3333333333333333,
0.6666666666666666
],
"_values": [
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": -20,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
@@ -1452,8 +1478,9 @@
{
"__type__": "cc.RealCurve",
"_times": [
0.3333333432674408,
0.6666666865348816
0,
0.3333333333333333,
0.6666666666666666
],
"_values": [
{
@@ -1468,6 +1495,18 @@
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
"tangentWeightMode": 0,
"value": 0,
"rightTangent": 0,
"rightTangentWeight": 1,
"leftTangent": 0,
"leftTangentWeight": 1,
"easingMethod": 0,
"__editorExtras__": null
},
{
"__type__": "cc.RealKeyframeValue",
"interpolationMode": 0,
@@ -1544,8 +1583,8 @@
{
"__type__": "cc.RealCurve",
"_times": [
0.2777777910232544,
0.6666666865348816
0.2777777777777778,
0.6666666666666666
],
"_values": [
{
@@ -1585,8 +1624,8 @@
{
"__type__": "cc.RealCurve",
"_times": [
0.2777777910232544,
0.6666666865348816
0.2777777777777778,
0.6666666666666666
],
"_values": [
{

View File

@@ -701,8 +701,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 38.30422574344615,
"height": 46.1
"width": 22.745271853397803,
"height": 27.2
},
"_anchorPoint": {
"__type__": "cc.Vec2",
@@ -740,10 +740,10 @@
"_string": "10",
"_horizontalAlign": 1,
"_verticalAlign": 1,
"_actualFontSize": 35,
"_fontSize": 35,
"_actualFontSize": 20,
"_fontSize": 20,
"_fontFamily": "Arial",
"_lineHeight": 35,
"_lineHeight": 20,
"_overflow": 0,
"_enableWrapText": true,
"_font": {

View File

@@ -22102,7 +22102,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 690,
"width": 650,
"height": 60
},
"_anchorPoint": {
@@ -22138,11 +22138,11 @@
"b": 255,
"a": 255
},
"_string": "召唤:登场位置没有存在英雄则为召唤,召唤额外获 得 0 / 0 加成",
"_string": "召唤:召唤新英雄,当前召唤额外获 得 0 / 0 加成",
"_horizontalAlign": 0,
"_verticalAlign": 1,
"_actualFontSize": 21,
"_fontSize": 20,
"_actualFontSize": 26,
"_fontSize": 25,
"_fontFamily": "Arial",
"_lineHeight": 30,
"_overflow": 2,
@@ -22247,7 +22247,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 720,
"width": 680,
"height": 65
},
"_anchorPoint": {
@@ -22431,7 +22431,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 690,
"width": 650,
"height": 60
},
"_anchorPoint": {
@@ -22467,11 +22467,11 @@
"b": 255,
"a": 255
},
"_string": "替换:替换前期位置的英雄,召唤的英雄获得被替换英雄的90%属性值,替换额外获 得0 / 0加成",
"_string": "替换:替换位置上的原英雄,新英雄获得英雄的90%属性值和-1的等级(不小于1级),当前替换额外获 得0 / 0加成",
"_horizontalAlign": 0,
"_verticalAlign": 1,
"_actualFontSize": 20,
"_fontSize": 20,
"_actualFontSize": 25,
"_fontSize": 25,
"_fontFamily": "Arial",
"_lineHeight": 30,
"_overflow": 2,
@@ -22576,7 +22576,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 720,
"width": 680,
"height": 65
},
"_anchorPoint": {
@@ -22760,7 +22760,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 690,
"width": 650,
"height": 60
},
"_anchorPoint": {
@@ -22796,11 +22796,11 @@
"b": 255,
"a": 255
},
"_string": "召唤:选择位置英雄与召唤英雄相同则升级选择位置英雄,获得召唤英雄100%属性值,升级获得 0 / 0 额外加成 ",
"_string": "升级:升级英雄,获得召唤英雄100%属性值,等级+1,当前升级获得 0 / 0 额外加成 ",
"_horizontalAlign": 0,
"_verticalAlign": 1,
"_actualFontSize": 20,
"_fontSize": 20,
"_actualFontSize": 25,
"_fontSize": 25,
"_fontFamily": "Arial",
"_lineHeight": 30,
"_overflow": 2,
@@ -22905,7 +22905,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 720,
"width": 680,
"height": 65
},
"_anchorPoint": {
@@ -22982,7 +22982,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 720,
"width": 680,
"height": 200
},
"_anchorPoint": {
@@ -23010,8 +23010,8 @@
},
"_alignFlags": 42,
"_target": null,
"_left": 0,
"_right": 0,
"_left": 20,
"_right": 20,
"_top": 0,
"_bottom": 200,
"_horizontalCenter": 0,

View File

@@ -44,7 +44,7 @@ export class BuffComp extends Component {
update(deltaTime: number) {
if(smc.mission.pause) return
this.hp_show()
// this.hp_show()
if(this.wind_cd > 0 ) this.wind_cd -= deltaTime;
if(this.wind_cd <= 0 && this.node.getChildByName("wind").active){
this.node.getChildByName("wind").active = false;
@@ -59,6 +59,9 @@ export class BuffComp extends Component {
}
hp_show(){
if(this.node.getComponent(HeroViewComp).fac == 0) {
this.update_info_hp()
}else{
let hp=this.node.getComponent(HeroViewComp).hp;
let hp_max=this.node.getComponent(HeroViewComp).hp_max;
let hp_progress= hp/hp_max;
@@ -66,6 +69,9 @@ export class BuffComp extends Component {
if(this.node.getComponent(HeroViewComp).is_boss) return
this.top_node.getChildByName("hp").active = (hp == hp_max) ? false : true;
}
}
show_shield(val:boolean){
this.node.getChildByName("shielded").active=val
}

View File

@@ -254,6 +254,28 @@ export class HeroViewComp extends CCComp {
}
do_dead(){
}
do_atked(remainingDamage:number){
if (this.shield > 0) {
this.shield -= 1
this.BUFFCOMP.tooltip(5,"*吸收*");
remainingDamage = 0
if (this.shield <= 0) {
if(this == null) return;
this.BUFFCOMP.show_shield(false);
}
}else{
if(this == null) return;
this.hp -= remainingDamage;
if(this.hp <= 0) {
if(this == null) return;
this.BUFFCOMP.dead()
if(this.ent == null) return;
this.ent.destroy();
}
this.BUFFCOMP.hp_show()
this.showDamage(remainingDamage, true);
}
}
dead(){
this.BUFFCOMP.dead()

View File

@@ -108,7 +108,7 @@ export class MissionHeroCompComp extends CCComp {
}
get_info_and_remove(fight_pos:number,uuid:number){
let info:any={ap:0,hp:0}
let info:any={ap:0,hp:0,lv:0}
let heros=ecs.query(ecs.allOf(HeroModelComp))
for(let hero of heros){
if(hero.get(HeroViewComp).fight_pos==fight_pos){
@@ -123,6 +123,7 @@ export class MissionHeroCompComp extends CCComp {
let s_hp_up = (HeroUpInfo[uuid] || {}).hp_up || 0 //替换 升级的英雄额外替换血量增长值
info.ap=Math.floor(hv.ap*(AP_UP_RATE+o_ap_rate+s_ap_rate)/100+o_ap+s_ap)
info.hp=Math.floor(o_hp_up+s_hp_up)
info.lv=hv.lv
hero.destroy()
return info
}

View File

@@ -103,25 +103,7 @@ export class SkillCom extends CCComp {
if(oCol.group!=this.group){
if(target == null) return;
let remainingDamage = this.ap;
if (target.shield > 0) {
target.shield -= 1
target.BUFFCOMP.tooltip(5,"*吸收*");
remainingDamage = 0
if (target.shield <= 0) {
if(target == null) return;
target.BUFFCOMP.show_shield(false);
}
}else{
if(target == null) return;
target.hp -= remainingDamage;
if(target.hp <= 0) {
if(target == null) return;
target.BUFFCOMP.dead()
if(target.ent == null) return;
target.ent.destroy();
}
target.showDamage(remainingDamage, true);
}
target.do_atked(remainingDamage)
this.ent.destroy()
}
}