dd
This commit is contained in:
@@ -73,6 +73,7 @@ export class BuffComp extends Component {
|
|||||||
update_info_hp(){
|
update_info_hp(){
|
||||||
let ihp_node = this.top_node.getChildByName("ihp");
|
let ihp_node = this.top_node.getChildByName("ihp");
|
||||||
ihp_node.getChildByName("num").getComponent(Label)!.string = this.node.getComponent(HeroViewComp).hp.toFixed(0)
|
ihp_node.getChildByName("num").getComponent(Label)!.string = this.node.getComponent(HeroViewComp).hp.toFixed(0)
|
||||||
|
this.hp_show()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -184,38 +184,57 @@ export class HeroViewComp extends CCComp {
|
|||||||
* 增加英雄的攻击(AP)。
|
* 增加英雄的攻击(AP)。
|
||||||
* @param ap 要增加的攻击。
|
* @param ap 要增加的攻击。
|
||||||
*/
|
*/
|
||||||
add_ap(ap: number){
|
add_ap(ap: number,is_num:boolean=false){
|
||||||
|
if(is_num){
|
||||||
this.ap += Math.floor(ap);
|
this.ap += Math.floor(ap);
|
||||||
|
}else{
|
||||||
|
this.ap += Math.floor(ap/100*this.ap);
|
||||||
|
}
|
||||||
this.BUFFCOMP.update_info_ap()
|
this.BUFFCOMP.update_info_ap()
|
||||||
}
|
}
|
||||||
|
|
||||||
de_ap(ap: number){
|
de_ap(ap: number,is_num:boolean=false){
|
||||||
|
if(is_num){
|
||||||
this.ap -= Math.floor(ap);
|
this.ap -= Math.floor(ap);
|
||||||
|
}else{
|
||||||
|
this.ap -= Math.floor(ap/100*this.ap);
|
||||||
|
}
|
||||||
this.BUFFCOMP.update_info_ap()
|
this.BUFFCOMP.update_info_ap()
|
||||||
}
|
}
|
||||||
|
|
||||||
add_hp_max(hprate: number=0){
|
add_hp_max(hp: number=0,is_num:boolean=false){
|
||||||
this.hp_max += Math.floor(hprate) ;
|
if(is_num){
|
||||||
this.hp += Math.floor(hprate) ;
|
this.hp_max += Math.floor(hp) ;
|
||||||
|
this.hp += Math.floor(hp) ;
|
||||||
|
}else{
|
||||||
|
this.hp_max += Math.floor(hp/100*this.hp_max);
|
||||||
|
this.hp += Math.floor(hp/100*this.hp_max);
|
||||||
|
}
|
||||||
this.BUFFCOMP.update_info_hp()
|
this.BUFFCOMP.update_info_hp()
|
||||||
}
|
}
|
||||||
|
|
||||||
de_hp_max(hprate: number=0){
|
de_hp_max(hp: number=0,is_num:boolean=false){
|
||||||
this.hp_max -= Math.floor(hprate) ;
|
if(is_num){
|
||||||
|
this.hp_max -= Math.floor(hp) ;
|
||||||
|
}else{
|
||||||
|
this.hp_max -= Math.floor(hp/100*this.hp_max);
|
||||||
|
}
|
||||||
this.BUFFCOMP.update_info_hp()
|
this.BUFFCOMP.update_info_hp()
|
||||||
}
|
}
|
||||||
|
|
||||||
add_hp(hp: number = 0) {
|
add_hp(hp: number = 0,is_num:boolean=false) {
|
||||||
this.BUFFCOMP.heathed();
|
this.BUFFCOMP.heathed();
|
||||||
|
if(is_num){
|
||||||
this.hp+=Math.floor(hp);
|
this.hp+=Math.floor(hp);
|
||||||
|
}else{
|
||||||
|
this.hp+=Math.floor(hp/100*this.hp_max);
|
||||||
|
}
|
||||||
if(this.hp > this.hp_max){
|
if(this.hp > this.hp_max){
|
||||||
this.hp = this.hp_max;
|
this.hp = this.hp_max;
|
||||||
}
|
}
|
||||||
this.BUFFCOMP.tooltip(2,hp.toFixed(0));
|
this.BUFFCOMP.tooltip(2,hp.toFixed(0));
|
||||||
}
|
}
|
||||||
add_hp2(hprate: number=0){
|
|
||||||
this.hp += Math.floor(hprate/100*this.hp_max) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 静止时间 */
|
/** 静止时间 */
|
||||||
in_stop (dt: number) {
|
in_stop (dt: number) {
|
||||||
|
|||||||
Reference in New Issue
Block a user