基本完成,进入 英雄 和装备设计阶段
This commit is contained in:
@@ -124,3 +124,13 @@ export const VmInfo = {
|
||||
thorns:0,
|
||||
lifesteal:0,
|
||||
}
|
||||
export const TooltipTypes = {
|
||||
life:1,
|
||||
health:2,
|
||||
skill:3,
|
||||
crit:4,
|
||||
uskill:5,
|
||||
lvup:6,
|
||||
apup:7,
|
||||
hpup:8,
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import { oops } from "db://oops-framework/core/Oops";
|
||||
import { GameEvent } from "../common/config/GameEvent";
|
||||
import { FightConComp } from "../map/FightConComp";
|
||||
import { EquipSpecialAttr } from "../common/config/Equips";
|
||||
import { FightSet } from "../common/config/Mission";
|
||||
import { FightSet, TooltipTypes } from "../common/config/Mission";
|
||||
import { getApIncrease, getHpIncrease, getUpExp, HeroPos } from "../common/config/heroSet";
|
||||
import { FriendModelComp } from "./FriendModel";
|
||||
import { MasterModelComp } from "./MasterModel";
|
||||
@@ -231,6 +231,7 @@ export class HeroViewComp extends CCComp {
|
||||
this.ap -= Math.floor(ap/100*this.ap);
|
||||
}
|
||||
this.BUFFCOMP.vmdata_update()
|
||||
this.BUFFCOMP.tooltip(TooltipTypes.apup,ap.toFixed(0));
|
||||
}
|
||||
update_hp(e:GameEvent,data:any){
|
||||
console.log("[HeroViewComp]:update_hp",data)
|
||||
@@ -248,6 +249,7 @@ export class HeroViewComp extends CCComp {
|
||||
this.hp_max += Math.floor(hp) ;
|
||||
this.hp += Math.floor(hp*(100+this.buff_hp)/100) ;
|
||||
this.BUFFCOMP.vmdata_update(true)
|
||||
this.BUFFCOMP.tooltip(TooltipTypes.hpup,hp.toFixed(0));
|
||||
|
||||
}
|
||||
|
||||
@@ -267,7 +269,7 @@ export class HeroViewComp extends CCComp {
|
||||
if(this.hp > this.hp_max){
|
||||
this.hp = this.hp_max;
|
||||
}
|
||||
this.BUFFCOMP.tooltip(2,hp.toFixed(0));
|
||||
this.BUFFCOMP.tooltip(TooltipTypes.health,hp.toFixed(0));
|
||||
this.BUFFCOMP.vmdata_update(true)
|
||||
}
|
||||
|
||||
@@ -366,7 +368,7 @@ export class HeroViewComp extends CCComp {
|
||||
let n_deR=deR-DEBUFF_DOWN-buff_debuff_down
|
||||
let r=RandomManager.instance.getRandomInt(0,100)
|
||||
if(r > n_deR) {
|
||||
this.BUFFCOMP.tooltip(5,"*抵抗*")
|
||||
this.BUFFCOMP.tooltip(TooltipTypes.uskill,"*抵抗*")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -501,7 +503,7 @@ export class HeroViewComp extends CCComp {
|
||||
check_shield(){
|
||||
if(this.shield>0){
|
||||
this.shield -= 1
|
||||
this.BUFFCOMP.tooltip(5,"*吸收*");
|
||||
this.BUFFCOMP.tooltip(TooltipTypes.uskill,"*吸收*");
|
||||
if (this.shield <= 0) {
|
||||
if(this == null) return;
|
||||
this.BUFFCOMP.show_shield(false);
|
||||
@@ -515,7 +517,7 @@ export class HeroViewComp extends CCComp {
|
||||
if(this.dod > 0){
|
||||
let random = Math.random()*100
|
||||
if(random < this.dod) {
|
||||
this.BUFFCOMP.tooltip(6,"*闪避*");
|
||||
this.BUFFCOMP.tooltip(TooltipTypes.uskill,"*闪避*");
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -603,7 +605,7 @@ export class HeroViewComp extends CCComp {
|
||||
case "max":
|
||||
this.as.max()
|
||||
this.BUFFCOMP.max_show(skill.fname)
|
||||
this.BUFFCOMP.tooltip(3,skill.name,skill_id)
|
||||
this.BUFFCOMP.tooltip(TooltipTypes.skill,skill.name,skill_id)
|
||||
break
|
||||
case "atk":
|
||||
this.as.atk()
|
||||
@@ -625,14 +627,13 @@ export class HeroViewComp extends CCComp {
|
||||
}
|
||||
|
||||
to_update(){
|
||||
console.log("[HeroViewComp]:升级",this.lv)
|
||||
this.add_ap(getApIncrease(this.hero_uuid,this.lv,this.lv+1))
|
||||
this.add_hp_max(getHpIncrease(this.hero_uuid,this.lv,this.lv+1))
|
||||
this.lv+=1
|
||||
this.next_exp=getUpExp(this.lv)
|
||||
console.log("[HeroViewComp]:up ap,hp",getApIncrease(this.hero_uuid,this.lv,this.lv+1),getHpIncrease(this.hero_uuid,this.lv,this.lv+1))
|
||||
this.BUFFCOMP.vmdata_update()
|
||||
this.BUFFCOMP.lv_up()
|
||||
this.BUFFCOMP.tooltip(TooltipTypes.lvup)
|
||||
//@todo 需要添加 升级动画
|
||||
}
|
||||
/** 显示伤害数字 */
|
||||
@@ -674,10 +675,10 @@ export class HeroViewComp extends CCComp {
|
||||
this.BUFFCOMP.in_atked();
|
||||
this.atked_count++;
|
||||
if (isCrit) {
|
||||
this.BUFFCOMP.tooltip(4, damage.toFixed(0), damage);
|
||||
this.BUFFCOMP.tooltip(TooltipTypes.crit, damage.toFixed(0), damage);
|
||||
// console.log("暴击伤害:" + damage);
|
||||
} else {
|
||||
this.BUFFCOMP.tooltip(1, damage.toFixed(0), damage);
|
||||
this.BUFFCOMP.tooltip(TooltipTypes.life, damage.toFixed(0), damage);
|
||||
// console.log("普通伤害:" + damage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { BoxSet } from "../common/config/BoxSet";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { Timer } from "../../../../extensions/oops-plugin-framework/assets/core/common/timer/Timer";
|
||||
import { SkillSet } from "../common/config/SkillSet";
|
||||
import { TooltipTypes } from "../common/config/Mission";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -23,9 +24,10 @@ export class TooltipCom extends CCComp {
|
||||
alive_time:number = 0.3;
|
||||
skill_name_time=0.5;
|
||||
scale:number = 1;
|
||||
|
||||
start() {
|
||||
switch(this.stype){
|
||||
case 1:
|
||||
case TooltipTypes.life:
|
||||
this.node.setPosition(v3(this.node.position.x,this.node.position.y-50))
|
||||
this.node.setSiblingIndex(100);
|
||||
this.node.getChildByName("loss_life").getChildByName("hp").getComponent(Label).string = this.value;
|
||||
@@ -34,7 +36,7 @@ export class TooltipCom extends CCComp {
|
||||
this.ent.destroy()
|
||||
},0.5)
|
||||
break
|
||||
case 2:
|
||||
case TooltipTypes.health:
|
||||
this.node.setSiblingIndex(110);
|
||||
this.node.getChildByName("add_life").getChildByName("hp").getComponent(Label).string = this.value;
|
||||
this.node.getChildByName("add_life").active=true;
|
||||
@@ -42,7 +44,7 @@ export class TooltipCom extends CCComp {
|
||||
this.ent.destroy()
|
||||
},0.5)
|
||||
break
|
||||
case 4:
|
||||
case TooltipTypes.crit:
|
||||
this.node.setPosition(v3(this.node.position.x,this.node.position.y-50))
|
||||
this.node.setSiblingIndex(200);
|
||||
this.node.getChildByName("bloss").getChildByName("hp").getComponent(Label).string = this.value;
|
||||
@@ -51,7 +53,7 @@ export class TooltipCom extends CCComp {
|
||||
this.ent.destroy()
|
||||
},0.5)
|
||||
break
|
||||
case 3:
|
||||
case TooltipTypes.skill:
|
||||
this.node.getChildByName("skill").getChildByName("name").getComponent(Label).string = "<"+SkillSet[this.s_uuid].name+">";
|
||||
this.node.getChildByName("skill").active=true;
|
||||
this.node.setPosition(v3(this.node.position.x,this.node.position.y+30))
|
||||
@@ -59,7 +61,7 @@ export class TooltipCom extends CCComp {
|
||||
this.ent.destroy()
|
||||
},0.5)
|
||||
break
|
||||
case 5:
|
||||
case TooltipTypes.uskill:
|
||||
this.node.getChildByName("uskill").getChildByName("name").getComponent(Label).string = this.value;
|
||||
this.node.getChildByName("uskill").active=true;
|
||||
this.node.setPosition(v3(this.node.position.x,this.node.position.y+30))
|
||||
@@ -67,6 +69,29 @@ export class TooltipCom extends CCComp {
|
||||
this.ent.destroy()
|
||||
},0.5)
|
||||
break
|
||||
case TooltipTypes.lvup:
|
||||
// this.node.getChildByName("lvup").getChildByName("name").getComponent(Label).string = this.value;
|
||||
this.node.getChildByName("lvup").active=true;
|
||||
this.node.setPosition(v3(this.node.position.x,this.node.position.y-30))
|
||||
this.scheduleOnce(()=>{
|
||||
this.ent.destroy()
|
||||
},0.5)
|
||||
break
|
||||
case TooltipTypes.apup:
|
||||
this.node.getChildByName("apup").getChildByName("num").getComponent(Label).string = "+"+this.value;
|
||||
this.node.getChildByName("apup").active=true;
|
||||
this.node.setPosition(v3(this.node.position.x,this.node.position.y-30))
|
||||
this.scheduleOnce(()=>{
|
||||
this.ent.destroy()
|
||||
},0.5)
|
||||
break
|
||||
case TooltipTypes.hpup:
|
||||
this.node.getChildByName("hpup").getChildByName("num").getComponent(Label).string = "+"+this.value;
|
||||
this.node.getChildByName("hpup").active=true;
|
||||
this.node.setPosition(v3(this.node.position.x,this.node.position.y-30))
|
||||
this.scheduleOnce(()=>{
|
||||
this.ent.destroy()
|
||||
},0.5)
|
||||
}
|
||||
// console.log("TooltipView start:",this.node.getSiblingIndex());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user