diff --git a/character/diy.js b/character/diy.js index cff3aa50d..c38772be2 100755 --- a/character/diy.js +++ b/character/diy.js @@ -6035,12 +6035,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'phaseDiscardBegin'}, forced:true, 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(){ var num=0; - if(player.isDamaged()) num++; - if(player.countCards('h')-player.hp>1) num++; + if(player.getDamagedHp()>1) num++; + if(player.countCards('h')-player.getHp()>1) num++; player.addMark('kotori_qunxin_temp',num,false); player.addTempSkill('kotori_qunxin_temp','phaseDiscardEnd'); }, diff --git a/game/game.js b/game/game.js index 2580fa534..e488152aa 100644 --- a/game/game.js +++ b/game/game.js @@ -19047,11 +19047,11 @@ inRangeOf:function(source){ return source.inRange(this); }, - getHp:function(){ - return Math.max(0,this.hp); + getHp:function(raw){ + return raw?this.hp:Math.max(0,this.hp); }, - getDamagedHp:function(){ - return this.maxHp-this.getHp(); + getDamagedHp:function(raw){ + return this.maxHp-this.getHp(raw); }, changeGroup:function(group,log,broadcast){ var next=game.createEvent('changeGroup'); @@ -24832,109 +24832,61 @@ return this.hp=this.maxHp||this.storage.nohp; }, - isMaxHp:function(equal){ - for(var i=0;i=this.hp) return false; - } - else{ - if(game.players[i].hp>this.hp) return false; - } - } - return true; + isMaxHp:function(only,raw){ + return game.players.every(value=>{ + if(value.isOut()||value==this) return true; + return only?value.getHp(raw){ + if(value.isOut()||value==this) return true; + return only?value.getHp(raw)>this.getHp(raw):value.getHp(raw)>=this.getHp(raw); + }); }, - isMaxCard:function(equal){ - var nh=this.countCards('he'); - for(var i=0;i=nh) return false; - } - else{ - if(game.players[i].countCards('he')>nh) return false; - } - } - return true; + isMaxCard:function(only){ + const numberOfCards=this.countCards('he'); + return game.players.every(value=>{ + if(value.isOut()||value==this) return true; + return only?value.countCards('he'){ + if(value.isOut()||value==this) return true; + return only?value.countCards('he')>numberOfCards:value.countCards('he')>=numberOfCards; + }); }, - isMaxHandcard:function(equal){ - var nh=this.countCards('h'); - for(var i=0;i=nh) return false; - } - else{ - if(game.players[i].countCards('h')>nh) return false; - } - } - return true; + isMaxHandcard:function(only){ + const numberOfHandCards=this.countCards('h'); + return game.players.every(value=>{ + if(value.isOut()||value==this) return true; + return only?value.countCards('h'){ + if(value.isOut()||value==this) return true; + return only?value.countCards('h')>numberOfHandCards:value.countCards('h')>=numberOfHandCards; + }); }, - isMaxEquip:function(equal){ - var nh=this.countCards('e'); - for(var i=0;i=nh) return false; - } - else{ - if(game.players[i].countCards('e')>nh) return false; - } - } - return true; + isMaxEquip:function(only){ + const numberOfEquipAreaCards=this.countCards('e'); + return game.players.every(value=>{ + if(value.isOut()||value==this) return true; + return only?value.countCards('e'){ + if(value.isOut()||value==this) return true; + return only?value.countCards('e')>numberOfEquipAreaCards:value.countCards('e')>=numberOfEquipAreaCards; + }); }, isLinked:function(){ if(get.is.linked2(this)){