基本完成,进入 英雄 和装备设计阶段
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user