Add lib.element.player.getHp and change lib.element.player.getDamagedHp.
This commit is contained in:
parent
6295e29f29
commit
d253a27551
|
@ -18468,8 +18468,11 @@
|
||||||
inRangeOf:function(source){
|
inRangeOf:function(source){
|
||||||
return source.inRange(this);
|
return source.inRange(this);
|
||||||
},
|
},
|
||||||
|
getHp:function(){
|
||||||
|
return Math.max(0,this.hp);
|
||||||
|
},
|
||||||
getDamagedHp:function(){
|
getDamagedHp:function(){
|
||||||
return this.maxHp-Math.max(0,this.hp);
|
return this.maxHp-this.getHp();
|
||||||
},
|
},
|
||||||
changeGroup:function(group,log,broadcast){
|
changeGroup:function(group,log,broadcast){
|
||||||
var next=game.createEvent('changeGroup');
|
var next=game.createEvent('changeGroup');
|
||||||
|
|
Loading…
Reference in New Issue