Add the ability to get raw HP, change equal to only, and fix kotori_skill_qun.
This commit is contained in:
parent
3f5f5f61e6
commit
ad8dc4b54b
|
@ -6035,12 +6035,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
trigger:{player:'phaseDiscardBegin'},
|
trigger:{player:'phaseDiscardBegin'},
|
||||||
forced:true,
|
forced:true,
|
||||||
filter:function(event,player){
|
filter:function(event,player){
|
||||||
return (player.isDamaged()||player.countCards('h')-player.hp>1);
|
return (player.getDamagedHp()>1||player.countCards('h')-player.getHp()>1);
|
||||||
},
|
},
|
||||||
content:function(){
|
content:function(){
|
||||||
var num=0;
|
var num=0;
|
||||||
if(player.isDamaged()) num++;
|
if(player.getDamagedHp()>1) num++;
|
||||||
if(player.countCards('h')-player.hp>1) num++;
|
if(player.countCards('h')-player.getHp()>1) num++;
|
||||||
player.addMark('kotori_qunxin_temp',num,false);
|
player.addMark('kotori_qunxin_temp',num,false);
|
||||||
player.addTempSkill('kotori_qunxin_temp','phaseDiscardEnd');
|
player.addTempSkill('kotori_qunxin_temp','phaseDiscardEnd');
|
||||||
},
|
},
|
||||||
|
|
150
game/game.js
150
game/game.js
|
@ -19047,11 +19047,11 @@
|
||||||
inRangeOf:function(source){
|
inRangeOf:function(source){
|
||||||
return source.inRange(this);
|
return source.inRange(this);
|
||||||
},
|
},
|
||||||
getHp:function(){
|
getHp:function(raw){
|
||||||
return Math.max(0,this.hp);
|
return raw?this.hp:Math.max(0,this.hp);
|
||||||
},
|
},
|
||||||
getDamagedHp:function(){
|
getDamagedHp:function(raw){
|
||||||
return this.maxHp-this.getHp();
|
return this.maxHp-this.getHp(raw);
|
||||||
},
|
},
|
||||||
changeGroup:function(group,log,broadcast){
|
changeGroup:function(group,log,broadcast){
|
||||||
var next=game.createEvent('changeGroup');
|
var next=game.createEvent('changeGroup');
|
||||||
|
@ -24832,109 +24832,61 @@
|
||||||
return this.hp<this.maxHp&&!this.storage.nohp;
|
return this.hp<this.maxHp&&!this.storage.nohp;
|
||||||
},
|
},
|
||||||
isHealthy:function(){
|
isHealthy:function(){
|
||||||
return this.hp==this.maxHp||this.storage.nohp;
|
return this.hp>=this.maxHp||this.storage.nohp;
|
||||||
},
|
},
|
||||||
isMaxHp:function(equal){
|
isMaxHp:function(only,raw){
|
||||||
for(var i=0;i<game.players.length;i++){
|
return game.players.every(value=>{
|
||||||
if(game.players[i].isOut()||game.players[i]==this) continue;
|
if(value.isOut()||value==this) return true;
|
||||||
if(equal){
|
return only?value.getHp(raw)<this.getHp(raw):value.getHp(raw)<=this.getHp(raw);
|
||||||
if(game.players[i].hp>=this.hp) return false;
|
});
|
||||||
}
|
|
||||||
else{
|
|
||||||
if(game.players[i].hp>this.hp) return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
},
|
},
|
||||||
isMinHp:function(equal){
|
isMinHp:function(only,raw){
|
||||||
for(var i=0;i<game.players.length;i++){
|
return game.players.every(value=>{
|
||||||
if(game.players[i].isOut()||game.players[i]==this) continue;
|
if(value.isOut()||value==this) return true;
|
||||||
if(equal){
|
return only?value.getHp(raw)>this.getHp(raw):value.getHp(raw)>=this.getHp(raw);
|
||||||
if(game.players[i].hp<=this.hp) return false;
|
});
|
||||||
}
|
|
||||||
else{
|
|
||||||
if(game.players[i].hp<this.hp) return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
},
|
},
|
||||||
isMaxCard:function(equal){
|
isMaxCard:function(only){
|
||||||
var nh=this.countCards('he');
|
const numberOfCards=this.countCards('he');
|
||||||
for(var i=0;i<game.players.length;i++){
|
return game.players.every(value=>{
|
||||||
if(game.players[i].isOut()||game.players[i]==this) continue;
|
if(value.isOut()||value==this) return true;
|
||||||
if(equal){
|
return only?value.countCards('he')<numberOfCards:value.countCards('he')<=numberOfCards;
|
||||||
if(game.players[i].countCards('he')>=nh) return false;
|
});
|
||||||
}
|
|
||||||
else{
|
|
||||||
if(game.players[i].countCards('he')>nh) return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
},
|
},
|
||||||
isMinCard:function(equal){
|
isMinCard:function(only){
|
||||||
var nh=this.countCards('he');
|
const numberOfCards=this.countCards('he');
|
||||||
for(var i=0;i<game.players.length;i++){
|
return game.players.every(value=>{
|
||||||
if(game.players[i].isOut()||game.players[i]==this) continue;
|
if(value.isOut()||value==this) return true;
|
||||||
if(equal){
|
return only?value.countCards('he')>numberOfCards:value.countCards('he')>=numberOfCards;
|
||||||
if(game.players[i].countCards('he')<=nh) return false;
|
});
|
||||||
}
|
|
||||||
else{
|
|
||||||
if(game.players[i].countCards('he')<nh) return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
},
|
},
|
||||||
isMaxHandcard:function(equal){
|
isMaxHandcard:function(only){
|
||||||
var nh=this.countCards('h');
|
const numberOfHandCards=this.countCards('h');
|
||||||
for(var i=0;i<game.players.length;i++){
|
return game.players.every(value=>{
|
||||||
if(game.players[i].isOut()||game.players[i]==this) continue;
|
if(value.isOut()||value==this) return true;
|
||||||
if(equal){
|
return only?value.countCards('h')<numberOfHandCards:value.countCards('h')<=numberOfHandCards;
|
||||||
if(game.players[i].countCards('h')>=nh) return false;
|
});
|
||||||
}
|
|
||||||
else{
|
|
||||||
if(game.players[i].countCards('h')>nh) return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
},
|
},
|
||||||
isMinHandcard:function(equal){
|
isMinHandcard:function(only){
|
||||||
var nh=this.countCards('h');
|
const numberOfHandCards=this.countCards('h');
|
||||||
for(var i=0;i<game.players.length;i++){
|
return game.players.every(value=>{
|
||||||
if(game.players[i].isOut()||game.players[i]==this) continue;
|
if(value.isOut()||value==this) return true;
|
||||||
if(equal){
|
return only?value.countCards('h')>numberOfHandCards:value.countCards('h')>=numberOfHandCards;
|
||||||
if(game.players[i].countCards('h')<=nh) return false;
|
});
|
||||||
}
|
|
||||||
else{
|
|
||||||
if(game.players[i].countCards('h')<nh) return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
},
|
},
|
||||||
isMaxEquip:function(equal){
|
isMaxEquip:function(only){
|
||||||
var nh=this.countCards('e');
|
const numberOfEquipAreaCards=this.countCards('e');
|
||||||
for(var i=0;i<game.players.length;i++){
|
return game.players.every(value=>{
|
||||||
if(game.players[i].isOut()||game.players[i]==this) continue;
|
if(value.isOut()||value==this) return true;
|
||||||
if(equal){
|
return only?value.countCards('e')<numberOfEquipAreaCards:value.countCards('e')<=numberOfEquipAreaCards;
|
||||||
if(game.players[i].countCards('e')>=nh) return false;
|
});
|
||||||
}
|
|
||||||
else{
|
|
||||||
if(game.players[i].countCards('e')>nh) return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
},
|
},
|
||||||
isMinEquip:function(equal){
|
isMinEquip:function(only){
|
||||||
var nh=this.countCards('e');
|
const numberOfEquipAreaCards=this.countCards('e');
|
||||||
for(var i=0;i<game.players.length;i++){
|
return game.players.every(value=>{
|
||||||
if(game.players[i].isOut()||game.players[i]==this) continue;
|
if(value.isOut()||value==this) return true;
|
||||||
if(equal){
|
return only?value.countCards('e')>numberOfEquipAreaCards:value.countCards('e')>=numberOfEquipAreaCards;
|
||||||
if(game.players[i].countCards('e')<=nh) return false;
|
});
|
||||||
}
|
|
||||||
else{
|
|
||||||
if(game.players[i].countCards('e')<nh) return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
},
|
},
|
||||||
isLinked:function(){
|
isLinked:function(){
|
||||||
if(get.is.linked2(this)){
|
if(get.is.linked2(this)){
|
||||||
|
|
Loading…
Reference in New Issue