diff --git a/character/collab.js b/character/collab.js index 6e8431610..d54f2aa17 100644 --- a/character/collab.js +++ b/character/collab.js @@ -410,7 +410,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'damageBegin4'}, usable:1, filter:function(event,player){ - return event.source&&event.source.isAlive(); + return event.source&&event.source.isIn(); }, logTarget:'source', check:function(event,player){ @@ -423,7 +423,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var card=get.cardPile2(function(card){ return get.type(card,null,false)=='equip'; }),source=trigger.source; - if(card&&source&&source.isAlive()) source.gain(card,'gain2'); + if(card&&source&&source.isIn()) source.gain(card,'gain2'); }, ai:{ filterDamage:true, @@ -1139,7 +1139,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 0' player.give(cards,targets[0]); 'step 1' - if(!targets[0].isAlive()||!targets[1].isAlive()){ + if(!targets[0].isIn()||!targets[1].isIn()){ event.finish(); return; } diff --git a/character/diy.js b/character/diy.js index 153c0585a..d75785510 100755 --- a/character/diy.js +++ b/character/diy.js @@ -484,7 +484,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, effect:function(){ var source=cards[0].storage.nsfuzhou_source; - if(!source||!source.isAlive()) return; + if(!source||!source.isIn()) return; source.line(player,'thunder'); if(result.color=='black'){ player.damage(source,source.storage.nsfuzhou_damage?2:1,'thunder'); @@ -2998,7 +2998,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var index=event.player.getHistory('useCard',function(evt){ return evt.targets.contains(player); }).indexOf(event.getParent()); - if(index==2) return event.player.isAlive()&&player.countCards('he')>0; + if(index==2) return event.player.isIn()&&player.countCards('he')>0; return index<2&&index>-1; }, logTarget:'player', @@ -3602,9 +3602,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event,player){ if(!event.card||(event.card.name!='sha'&&event.card.name!='juedou')) return false; var hairi=event.source; - if(hairi&&(hairi==player||player.inRangeOf(hairi))&&hairi.isAlive()&&(hairi.name1!='key_shizuku'&&hairi.name2!='key_shizuku')) return true; + if(hairi&&(hairi==player||player.inRangeOf(hairi))&&hairi.isIn()&&(hairi.name1!='key_shizuku'&&hairi.name2!='key_shizuku')) return true; hairi=event.player; - return (hairi&&(hairi==player||player.inRange(hairi))&&hairi.isAlive()&&(hairi.name1!='key_shizuku'&&hairi.name2!='key_shizuku')); + return (hairi&&(hairi==player||player.inRange(hairi))&&hairi.isIn()&&(hairi.name1!='key_shizuku'&&hairi.name2!='key_shizuku')); }, frequent:true, content:function(){ @@ -5329,7 +5329,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.removeSkill('hiroto_zonglve'); player.removeGaintag('hiroto_huyu2'); var target=player.storage.hiroto_huyu2; - if(target&&target.isAlive()){ + if(target&&target.isIn()){ var cards=[]; player.getHistory('gain',function(evt){ cards.addArray(evt.cards); @@ -5720,7 +5720,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{global:'judge'}, direct:true, filter:function(event,player){ - return player.getExpansions('shiroha_yuzhao').length&&event.player.isAlive(); + return player.getExpansions('shiroha_yuzhao').length&&event.player.isIn(); }, content:function(){ "step 0" @@ -10555,7 +10555,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ nsxuezhu:{ trigger:{player:'damageEnd',source:'damageSource'}, filter:function(event,player){ - return event.player.isAlive(); + return event.player.isIn(); }, logTarget:'player', content:function(){ @@ -11019,7 +11019,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event,player){ if(get.mode()!='identity') return false; if(!player.hasZhuSkill('yuri_wangxi')) return false; - if(event.player.isAlive()) return false; + if(event.player.isIn()) return false; if(event.player.identity=='mingzhong') return false; var evt=event.getParent('yuri_xingdong'); return evt&&evt.name=='yuri_xingdong'&&evt.player==player; @@ -11661,7 +11661,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'useCardToTargeted'}, direct:true, filter:function(event,player){ - return player!=event.target&&event.targets&&event.targets.length==1&&event.target.isAlive() + return player!=event.target&&event.targets&&event.targets.length==1&&event.target.isIn() &&player.isPhaseUsing()&&!player.hasSkill('nsweiyuan2')&&game.hasPlayer(function(current){ return current!=player&¤t!=event.target; }); @@ -12104,7 +12104,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ nsxianhai:{ trigger:{global:'damageSource'}, filter:function(event,player){ - return event.source&&event.source!=player&&event.source.isAlive()&&event.source==_status.currentPhase&& + return event.source&&event.source!=player&&event.source.isIn()&&event.source==_status.currentPhase&& (event.source.getStat('damage')||0)>(player.getLastStat('damage')||0)&& !player.hasSkill('nsxianhai_round'); }, @@ -12184,7 +12184,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'judgeEnd'}, forced:true, filter:function(event,player){ - return _status.currentPhase&&_status.currentPhase.isAlive()&&(!player.storage.nsshengyan2||!player.storage.nsshengyan2.contains(event.result.suit)); + return _status.currentPhase&&_status.currentPhase.isIn()&&(!player.storage.nsshengyan2||!player.storage.nsshengyan2.contains(event.result.suit)); }, logTarget:function(){ return _status.currentPhase; @@ -12495,7 +12495,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event){ if(event._notrigger.contains(event.player)) return false; return event.num&&event.source&&event.player&& - event.player.isAlive()&&event.source.isAlive()&&event.source!=event.player; + event.player.isIn()&&event.source.isIn()&&event.source!=event.player; }, check:function(event,player){ if(player.isPhaseUsing()) return true; @@ -12516,7 +12516,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.count--; 'step 2' var cards=player.getCards('he',(card)=>card.hasGaintag('junkwangxi_tag')); - if(cards.length>0&&target.isAlive()){ + if(cards.length>0&&target.isIn()){ if(cards.length==1) event._result={bool:true,cards:cards}; else player.chooseCard('he','忘隙:交给'+get.translation(target)+'一张牌',true,function(card){ return card.hasGaintag('junkwangxi_tag'); @@ -12529,7 +12529,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } 'step 4' player.removeGaintag('junkwangxi_tag'); - if(event.count&&target.isAlive()){ + if(event.count&&target.isIn()&&player.hasSkill('junkwangxi')){ player.chooseBool(get.prompt2('junkwangxi',target)); } else event.finish(); diff --git a/character/extra.js b/character/extra.js index 12889f2e1..8e3c0a33f 100755 --- a/character/extra.js +++ b/character/extra.js @@ -1122,7 +1122,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event,player,name){ if(event.player==event.source) return false; var target=lib.skill.twwuhun_gain.logTarget(event,player); - if(!target||!target.isAlive()) return false; + if(!target||!target.isIn()) return false; return name=='damageEnd'||target.hasMark('twwuhun'); }, logTarget:function(event,player){ @@ -3069,7 +3069,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ usable:1, filter:function(event,player){ var target=player.storage.zuoxing; - if(!target||!target.isAlive()||target.maxHp<2) return false; + if(!target||!target.isIn()||target.maxHp<2) return false; for(var i of lib.inpile){ if(get.type(i)=='trick'&&event.filterCard({name:i,isCard:true},player,event)) return true; } @@ -3752,7 +3752,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, trigger:{global:'damageEnd'}, filter:function(event,player){ - return event.player.isAlive()&&player.getExpansions('chuyuan').length0&&!target.hasSkillTag('noh')) e2=-1; diff --git a/character/huicui.js b/character/huicui.js index 460070663..784f861c7 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -5585,7 +5585,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(storage.contains(target)){ storage.remove(target); target.removeSkill('dcjiezhen_blocker'); - if(target.isAlive()&&target.countGainableCards(player,'hej')>0) player.gainPlayerCard(target,'hej',true); + if(target.isIn()&&target.countGainableCards(player,'hej')>0) player.gainPlayerCard(target,'hej',true); } if(targets.length>0){ event.redo(); @@ -6198,7 +6198,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ else{ event.finish(); if(cards.length) player.loseToDiscardpile(cards); - if(target.isAlive()&&!target.hasHistory('damage',function(evt){ + if(target.isIn()&&!target.hasHistory('damage',function(evt){ return evt.getParent('lieyi')==event&&evt._dyinged; })) player.loseHp(); } @@ -7268,7 +7268,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ forced:true, logTarget:'player', filter:function(event,player){ - if(!event.player.isAlive()) return false; + if(!event.player.isIn()) return false; var num=player.countCards('h'); if(num>=5) return false; var num2=0; @@ -8759,7 +8759,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ global:"phaseUseBegin", }, filter:function(event,player){ - return event.player!=player&&event.player.isAlive()&&event.player.inRange(player)&&player.countCards('he')>0; + return event.player!=player&&event.player.isIn()&&event.player.inRange(player)&&player.countCards('he')>0; }, direct:true, derivation:["rezhixi"], @@ -9525,7 +9525,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ forced:true, popup:false, filter:function(event,player){ - return event.card&&event.card.cxliushi==true&&event.player.isAlive()&&event.getParent(3).name=='cxliushi'; + return event.card&&event.card.cxliushi==true&&event.player.isIn()&&event.getParent(3).name=='cxliushi'; }, content:function(){ trigger.player.addMark('cxliushi2',1); diff --git a/character/mobile.js b/character/mobile.js index 831320e05..f7eb491e6 100644 --- a/character/mobile.js +++ b/character/mobile.js @@ -3211,7 +3211,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(event.current.countCards('h')0) event.goto(1); + "step 4" + if(event.count>0&&player.hasSkill('rejieming')) event.goto(1); }, ai:{ maixie:true, @@ -4603,7 +4604,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, trigger:{global:'damageEnd'}, filter:function(event,player){ - return event.player.isAlive()&&get.distance(player,event.player)<=1; + return event.player.isIn()&&get.distance(player,event.player)<=1; }, logTarget:'player', check:function(event,player){ @@ -5325,7 +5326,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.addToExpansion(result.cards,player,'give').gaintag.add('quanji'); } "step 4" - if(event.count>0){ + if(event.count>0&&player.hasSkill('requanji')){ player.chooseBool(get.prompt2('requanji')).set('frequentSkill','requanji'); } else event.finish(); @@ -6655,7 +6656,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, filter:function(event,player){ var target=lib.skill.taomie1.logTarget(event,player); - return target&&target.isAlive()&&!target.hasMark('taomie'); + return target&&target.isIn()&&!target.hasMark('taomie'); }, check:function(event,player){ var target=lib.skill.taomie1.logTarget(event,player); @@ -6765,7 +6766,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ popup:false, filter:function(event,player){ return event.card&&event.card.name=='sha'&& - event.player.isAlive()&&event.getParent(2).liyong2==true; + event.player.isIn()&&event.getParent(2).liyong2==true; }, content:function(){ player.loseHp(); @@ -6793,7 +6794,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{global:'phaseJieshuBegin'}, direct:true, filter:function(event,player){ - return player!=event.player&&event.player.isAlive()&&event.player.getHistory('useCard',function(evt){ + return player!=event.player&&event.player.isIn()&&event.player.getHistory('useCard',function(evt){ if(evt.targets&&evt.targets.length){ var targets=evt.targets.slice(0); while(targets.contains(event.player)) targets.remove(event.player); @@ -7272,7 +7273,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var num=event.player.getHistory('useCard',function(evt){ return evt.targets.contains(player); }).length; - return num==0||event.player.isAlive()&&num<=player.countCards('he'); + return num==0||event.player.isIn()&&num<=player.countCards('he'); }, content:function(){ 'step 0' @@ -9306,7 +9307,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }); if(card) player.gain(card,'gain2','log'); 'step 4' - if(event.count>0) event.goto(1); + if(event.count>0&&player.hasSkill('rangjie')) event.goto(1); }, ai:{ maixie:true, @@ -9527,7 +9528,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var num=1-trigger.player.hp; if(num) trigger.player.recover(num); 'step 2' - if(_status.currentPhase&&_status.currentPhase.isAlive()){ + if(_status.currentPhase&&_status.currentPhase.isIn()){ var next=_status.currentPhase.damage(); event.next.remove(next); trigger.after.push(next); @@ -12225,7 +12226,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{global:'phaseJieshuBegin'}, direct:true, filter:function(event,player){ - return player.getExpansions('tunchu').length>0&&event.player.countCards('h')0&&event.player.countCards('h')0&& + return event.player.isIn()&&event.player.countCards('e')>0&& lib.filter.targetEnabled({name:'sha'},player,event.player)&&(player.hasSha()||_status.connectMode&&player.countCards('h')>0); }, content:function(){ diff --git a/character/offline.js b/character/offline.js index bc9da88dd..81b804dc6 100644 --- a/character/offline.js +++ b/character/offline.js @@ -1838,7 +1838,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.gain(result.links,'gain2'); } 'step 4' - if(event.num>0){ + if(event.num>0&&player.hasSkill('jsrgrangjie')){ player.chooseBool(get.prompt2('jsrgrangjie')).set('ai',()=>_status.event.bool).set('bool',lib.skill.jsrgrangjie.check(trigger,player)); } else event.finish(); @@ -6840,7 +6840,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 4' if(cards.length) player.gain(cards,'gain2','log'); 'step 5' - if(event.count>0){ + if(event.count>0&&player.hasSkill('spyinzhi')){ player.chooseBool(get.prompt2('spyinzhi')).set('frequentSkill','spyinzhi'); } else event.finish(); @@ -8007,7 +8007,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ forced:true, locked:false, filter:function(event,player){ - return player.hasSkill('fenyong2')&&event.player.isAlive(); + return player.hasSkill('fenyong2')&&event.player.isIn(); }, content:function(){ 'step 0' @@ -8476,7 +8476,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.finish(); } 'step 3' - if(player.storage.zhaolie.isAlive()){ + if(player.storage.zhaolie.isIn()){ player.storage.zhaolie.gain(event.basic,'gain2','log'); } else{ diff --git a/character/refresh.js b/character/refresh.js index 6aa78f12a..4d1e8b8b7 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -712,7 +712,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event){ if(event._notrigger.contains(event.player)) return false; return event.num&&event.source&&event.player&& - event.player.isAlive()&&event.source.isAlive()&&event.source!=event.player; + event.player.isIn()&&event.source.isIn()&&event.source!=event.player; }, check:function(event,player){ if(player.isPhaseUsing()) return true; @@ -733,7 +733,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.count--; 'step 2' var cards=player.getCards('he'); - if(cards.length>0&&target.isAlive()){ + if(cards.length>0&&target.isIn()){ if(cards.length==1) event._result={bool:true,cards:cards}; else player.chooseCard('he','忘隙:交给'+get.translation(target)+'一张牌',true); } @@ -743,7 +743,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.give(result.cards,target); } 'step 4' - if(event.count&&target.isAlive()){ + if(event.count&&target.isIn()&&player.hasSkill('xinwangxi')){ player.chooseBool(get.prompt2('xinwangxi',target)); } else event.finish(); @@ -2140,7 +2140,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ forceDie:true, filter:function(event,player){ if(event.name=='die') return true; - return player.isAlive(); + return player.isIn(); }, content:function(){ 'step 0' @@ -2179,7 +2179,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var num=target.countCards('h')-Math.min(5,target.maxHp); if(num>0) target.chooseToDiscard('h',true,num); 'step 4' - if(event.count>0&&player.isAlive()) event.goto(1); + if(event.count>0&&player.isIn()&&player.hasSkill('oljieming')) event.goto(1); }, ai:{ expose:0.2, @@ -3999,7 +3999,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, trigger:{global:'phaseJieshuBegin'}, filter:function(event,player){ - return event.player!=player&&event.player.countCards('h')==player.countCards('h')&&event.player.isAlive(); + return event.player!=player&&event.player.countCards('h')==player.countCards('h')&&event.player.isIn(); }, check:function(event,player){ return get.attitude(player,event.player)>=0; @@ -4888,7 +4888,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.addToExpansion(result.cards,'giveAuto',player).gaintag.add('xinquanji'); } 'step 4' - if(event.count>0){ + if(event.count>0&&player.hasSkill('xinquanji')){ player.chooseBool(get.prompt2('xinquanji')).set('frequentSkill','xinquanji'); } else event.finish(); @@ -6103,7 +6103,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.current=event.players.shift(); event.current.animate('target'); player.line(event.current,'green'); - if(event.current.countCards('he')&&target.isAlive()){ + if(event.current.countCards('he')&&target.isIn()){ event.current.chooseToDiscard({subtype:'equip1'},'he','弃置一张武器牌或让'+ get.translation(target)+'摸一张牌').set('ai',function(card){ if(get.attitude(_status.event.player,_status.event.target)<0) return 7-get.value(card); @@ -6322,7 +6322,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.finish(); } 'step 5' - if(player.isAlive()&&event.targets.length){ + if(player.isIn()&&event.targets.length){ player.gainPlayerCard(event.targets.shift(),'he',true); } else event.finish(); @@ -6485,7 +6485,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'damageEnd'}, logTarget:'source', filter:function(event,player){ - return event.source&&event.source!=player&&event.source.isAlive(); + return event.source&&event.source!=player&&event.source.isIn(); }, check:function(event,player){ var att=get.attitude(player,event.source); @@ -6529,7 +6529,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(get.suit(card)!='heart') player.draw(); 'step 4' var target=trigger.source; - if(target.isAlive()&&event.count>0) player.chooseBool(get.prompt('reenyuan',target),'令该角色选择一项:①失去1点体力。②交给你一张手牌。若此牌不为♥,则你摸一张牌。').set('ai',function(){ + if(target.isIn()&&event.count>0&&player.hasSkill('reenyuan')) player.chooseBool(get.prompt('reenyuan',target),'令该角色选择一项:①失去1点体力。②交给你一张手牌。若此牌不为♥,则你摸一张牌。').set('ai',function(){ var evt=_status.event.getTrigger(); return lib.skill.reenyuan2.check(evt,evt.player); }); @@ -7512,7 +7512,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.finish(); } 'step 3' - if(event.count) event.goto(1); + if(event.count&&lib.skill.olbaonue.filter(trigger,player)) event.goto(1); } }, rezishou:{ @@ -10857,7 +10857,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, filter:function (event,player){ if(event._notrigger.contains(event.player)) return false; - return event.card&&event.card.name=='sha'&&event.player!=player&&event.player.isAlive()&&event.player.countGainableCards(player,'hej')>0; + return event.card&&event.card.name=='sha'&&event.player!=player&&event.player.isIn()&&event.player.countGainableCards(player,'hej')>0; }, direct:true, content:function (){ @@ -11025,7 +11025,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ animate:'giveAuto', }).setContent('gaincardMultiple'); 'step 5' - if(event.count>0){ + if(event.count>0&&player.hasSkill('new_reyiji')){ player.chooseBool(get.prompt2('new_reyiji')); } else event.finish(); @@ -11483,7 +11483,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:'new_reyaowu', forced:true, filter:function(event){ - return event.card&&(get.color(event.card)!='red'||event.source&&event.source.isAlive()); + return event.card&&(get.color(event.card)!='red'||event.source&&event.source.isIn()); }, content:function(){ trigger[get.color(trigger.card)!='red'?'player':'source'].draw(); @@ -11497,7 +11497,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, audioname:['sb_huaxiong'], filter:function (event){ - return event.card&&event.card.name=='sha'&&(get.color(event.card)!='red'||event.source&&event.source.isAlive()); + return event.card&&event.card.name=='sha'&&(get.color(event.card)!='red'||event.source&&event.source.isIn()); }, forced:true, check:function (event){ @@ -12122,7 +12122,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ forced:true, filter:function(event,player){ if(event._notrigger.contains(event.player)) return false; - return event.card&&event.card.name=='sha'&&event.player.isAlive()&&event.player.countGainableCards(player,'he')>0; + return event.card&&event.card.name=='sha'&&event.player.isIn()&&event.player.countGainableCards(player,'he')>0; }, check:function(){ return false; @@ -12277,7 +12277,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.count--; player.gainPlayerCard(get.prompt('refankui',trigger.source),trigger.source,get.buttonValue,trigger.source!=player?'he':'e').set('logSkill',[event.name,trigger.source]); "step 2" - if(result.bool&&event.count>0&&trigger.source.countGainableCards(player,trigger.source!=player?'he':'e')>0) event.goto(1); + if(result.bool&&event.count>0&&trigger.source.countGainableCards(player,trigger.source!=player?'he':'e')>0&&player.hasSkill(event.name)) event.goto(1); }, ai:{ maixie_defend:true, @@ -12359,7 +12359,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger.source.damage(); } event.num--; - if(event.num>0){ + if(event.num>0&&player.hasSkill('reganglie')){ player.chooseBool(get.prompt2('reganglie')); } else{ @@ -13236,7 +13236,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{global:'phaseJieshuBegin'}, direct:true, filter:function(event,player){ - return event.player.isAlive()&&event.player.getStat('damage')&& + return event.player.isIn()&&event.player.getStat('damage')&& lib.filter.targetEnabled({name:'sha'},player,event.player)&&(player.hasSha()||_status.connectMode&&player.countCards('h')>0); }, content:function(){ @@ -13497,7 +13497,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event){ if(event._notrigger.contains(event.player)) return false; return event.num&&event.source&&event.player&& - event.player.isAlive()&&event.source.isAlive()&&event.source!=event.player; + event.player.isIn()&&event.source.isIn()&&event.source!=event.player; }, check:function(event,player){ if(player.isPhaseUsing()) return true; @@ -13518,7 +13518,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ "step 2" game.delay(); "step 3" - if(event.count){ + if(event.count&&player.hasSkill('wangxi')){ player.chooseBool(get.prompt2('wangxi',lib.skill.wangxi.logTarget(trigger,player))) } else event.finish(); @@ -13818,7 +13818,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, forceDie:true, filter:function(event,player,name){ - return name=='die'||player.isAlive(); + return name=='die'||player.isIn(); }, direct:true, content:function(){ diff --git a/character/sb.js b/character/sb.js index ee57a1f77..580b1e303 100644 --- a/character/sb.js +++ b/character/sb.js @@ -2043,7 +2043,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ forced:true, popup:false, filter:function(event,player){ - return event.card.storage&&event.card.storage.sbpaoxiao&&event.target.isAlive(); + return event.card.storage&&event.card.storage.sbpaoxiao&&event.target.isIn(); }, content:function(){ trigger.target.addTempSkill('fengyin'); @@ -2055,7 +2055,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{source:'damageSource'}, forced:true, filter:function(event,player){ - return event.card&&event.card.storage&&event.card.storage.sbpaoxiao&&event.player.isAlive(); + return event.card&&event.card.storage&&event.card.storage.sbpaoxiao&&event.player.isIn(); }, content:function(){ 'step 0' diff --git a/character/shenhua.js b/character/shenhua.js index fa9da946f..6553eed05 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -2489,7 +2489,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.give(cards,target); target.damage('nocard'); 'step 1' - if(!target.isAlive()){ + if(!target.isIn()){ player.chooseTarget('令一名角色将手牌摸至四张',function(card,player,target){ return target.countCards('h')<4; }).set('ai',function(target){ @@ -3176,7 +3176,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 2' if(result.control!='cancel2'){ event.num--; - if(event.num>0){ + if(event.num>0&&player.hasSkill('xinkuanggu')){ event.goto(1); } } @@ -4121,7 +4121,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{global:'damageEnd'}, filter:function(event,player){ return (event.card&&event.card.name=='sha'&&event.source&& - event.player.classList.contains('dead')==false&&player.countCards('he')); + event.player.isIn()&&player.countCards('he')); }, direct:true, checkx:function(event,player){ @@ -4528,7 +4528,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(--event.num>0) player.chooseBool(get.prompt2('xinsheng')).set('frequentSkill','xinsheng'); else event.finish(); 'step 3' - if(result.bool){ + if(result.bool&&player.hasSkill('xinsheng')){ player.logSkill('xinsheng'); event.goto(1); } @@ -4670,7 +4670,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event,player){ if(event._notrigger.contains(event.player)) return false; return (event.card&&event.card.name=='sha'&&event.getParent().name=='sha'&& - event.player.isAlive()&& + event.player.isIn()&& player.canCompare(event.player)); }, check:function(event,player){ @@ -5355,13 +5355,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){ mod:{ cardSavable:function(card,player){ if(!_status.currentPhase) return; - if(_status.currentPhase.isAlive()&&_status.currentPhase.hasSkill('wansha')&&_status.currentPhase!=player){ + if(_status.currentPhase.isIn()&&_status.currentPhase.hasSkill('wansha')&&_status.currentPhase!=player){ if(card.name=='tao'&&!player.isDying()) return false; } }, cardEnabled:function(card,player){ if(!_status.currentPhase) return; - if(_status.currentPhase.isAlive()&&_status.currentPhase.hasSkill('wansha')&&_status.currentPhase!=player){ + if(_status.currentPhase.isIn()&&_status.currentPhase.hasSkill('wansha')&&_status.currentPhase!=player){ if(card.name=='tao'&&!player.isDying()) return false; } } @@ -5763,7 +5763,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ for(var i=0;i0; @@ -2733,7 +2733,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.count--; trigger.source.chooseToDiscard('he',true); 'step 2' - if(event.count>0&&result.bool&&lib.skill.spmingshi.filter(trigger,player)) event.goto(1); + if(event.count>0&&result.bool&&lib.skill.spmingshi.filter(trigger,player)&&player.hasSkill('spmingshi')) event.goto(1); }, ai:{ threaten:0.8, @@ -5296,7 +5296,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ charlotte:true, filter:function(event,player){ return event.player!=event.target&&event.player.hasMark('fyjianyux')&& - event.target.hasMark('fyjianyux')&&event.target.isAlive(); + event.target.hasMark('fyjianyux')&&event.target.isIn(); }, logTarget:'target', content:function(){ diff --git a/character/sp.js b/character/sp.js index e528e1fdd..930165d63 100755 --- a/character/sp.js +++ b/character/sp.js @@ -3735,7 +3735,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ global:"useCard", }, filter:function(event,player){ - return get.type(event.card)=='equip'&&event.player.isAlive()&& + return get.type(event.card)=='equip'&&event.player.isIn()&& lib.skill.xindiaodu.isFriendOf(player,event.player)&&(player==event.player||player.hasSkill('xindiaodu'))&&!event.player.hasSkill('xindiaodu_temp'); }, direct:true, @@ -5249,7 +5249,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var list=player.getStorage('tongxie_effect'); if(!list.contains(event.player)) return false; for(var i of list){ - if(i!=event.player&&i.isAlive()&&!i.hasSkill('tongxie_count2',null,null,false)) return true; + if(i!=event.player&&i.isIn()&&!i.hasSkill('tongxie_count2',null,null,false)) return true; } return false; }, @@ -5258,7 +5258,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ 'step 0' event.targets=player.getStorage('tongxie_effect').filter(function(i){ - return i!=trigger.player&&i.isAlive()&&!i.hasSkill('tongxie_count2',null,null,false); + return i!=trigger.player&&i.isIn()&&!i.hasSkill('tongxie_count2',null,null,false); }).sortBySeat(); event.num=0; 'step 1' @@ -6319,7 +6319,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{global:'phaseZhunbeiBegin'}, logTarget:'player', filter:function(event,player){ - return player!=event.player&&event.player.isAlive()&&player.countCards('h')>0&&!player.hasSkill('yuanzi_round',null,null,false); + return player!=event.player&&event.player.isIn()&&player.countCards('h')>0&&!player.hasSkill('yuanzi_round',null,null,false); }, check:function(event,player){ if(get.attitude(player,event.player)<=4) return false; @@ -8832,7 +8832,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'useCardAfter'}, usable:1, filter:function(event,player){ - return event.card.name=='sha'&&event.targets.length==1&&event.targets[0].isAlive(); + return event.card.name=='sha'&&event.targets.length==1&&event.targets[0].isIn(); }, logTarget:'targets', content:function(){ @@ -9045,14 +9045,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'damageEnd'}, direct:true, filter:function(event,player){ - if(event.source&&event.source.isAlive()) return true; + if(event.source&&event.source.isIn()) return true; return game.hasPlayer((current)=>lib.skill.guanxu.filterTarget(null,player,current)); }, content:function(){ 'step 0' event.addIndex=0; var choiceList=[]; - if(trigger.source&&trigger.source.isAlive()){ + if(trigger.source&&trigger.source.isIn()){ choiceList.push('令'+get.translation(trigger.source)+'的所有非锁定技失效'); } else event.addIndex++; @@ -9062,7 +9062,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(game.hasPlayer(function(current){ return current!=player&¤t.countCards('h')>3&&get.attitude(player,current)<0; })) return 1-index; - if(source&&source.isAlive()&&get.attitude(player,source)<0&&!source.hasSkill('fengyin')) return 0; + if(source&&source.isIn()&&get.attitude(player,source)<0&&!source.hasSkill('fengyin')) return 0; if(game.hasPlayer(function(current){ return current!=player&¤t.countCards('h')>0&&get.attitude(player,current)<0; })) return 1-index; @@ -11574,7 +11574,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ global:"phaseUseBegin", }, filter:function (event,player){ - return event.player!=player&&event.player.isAlive()&&player.countCards('he')>0&&event.player.inRange(player); + return event.player!=player&&event.player.isIn()&&player.countCards('he')>0&&event.player.inRange(player); }, direct:true, derivation:["new_zhixi"], @@ -12281,7 +12281,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } } 'step 4' - if(--event.num>0){ + if(--event.num>0&&player.hasSkill('chouce')){ player.chooseBool(get.prompt2('chouce')); } else{ @@ -13036,7 +13036,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ source.addMark('rehengjiang2',1,false); player.addTempSkill('rehengjiang3'); "step 2" - if(event.count){ + if(event.count&&player.hasSkill('rehengjiang')){ player.chooseBool(get.prompt2('rehengjiang',_status.currentPhase)).set('ai',function(){ return lib.skill.rehengjiang.check(_status.event.getTrigger(),_status.event.player); }) @@ -15462,7 +15462,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var nh1=player.countCards('h'); var nh2=event.source.countCards('h'); var eh=player.countCards('e'); - if((nh1+eh)>nh2&&event.source.isAlive()) return true; + if((nh1+eh)>nh2&&event.source.isIn()) return true; if(nh1num2&&trigger.source.isAlive()) bool2=true; + if(eh>num2&&trigger.source.isIn()) bool2=true; if(bool1&&bool2){ event.chosen=true; player.chooseControl('cancel2').set('prompt',get.prompt('benyu',trigger.source)).set('choiceList',[ @@ -15561,7 +15561,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{source:'damageSource'}, filter:function(event,player){ if(event._notrigger.contains(event.player)) return false; - return _status.currentPhase==player&&event.player.isAlive()&& + return _status.currentPhase==player&&event.player.isIn()&& event.player.countCards('hej')>0&&event.player!=player&&!player.hasSkill('zhidao2'); }, forced:true, @@ -16236,7 +16236,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.finish(); } 'step 4' - if(event.target&&event.target.isAlive()){ + if(event.target&&event.target.isIn()){ var es=event.target.getCards('e'); if(es.length){ event.target.discard(es); @@ -17358,7 +17358,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'damageEnd',source:'damageEnd'}, filter:function(event,player){ if(event._notrigger.contains(event.player)) return false; - return event.player.isAlive()&&player.getExpansions('yishe').length>0; + return event.player.isIn()&&player.getExpansions('yishe').length>0; }, direct:true, content:function(){ @@ -17374,7 +17374,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } else event.finish(); 'step 3' - if(event.count>0&&player.getExpansions('yishe').length) event.goto(1); + if(event.count>0&&player.getExpansions('yishe').length&&player.hasSkill('bushi')){ + event.goto(1); + } }, ai:{combo:'yishe'}, }, @@ -17383,7 +17385,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{global:'judge'}, direct:true, filter:function(event,player){ - return player.getExpansions('yishe').length&&event.player.isAlive(); + return player.getExpansions('yishe').length&&event.player.isIn(); }, content:function(){ "step 0" @@ -17565,7 +17567,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, trigger:{global:'phaseJieshuBegin'}, filter:function(event,player){ - return event.player.isAlive()&&event.player!=player&&get.distance(event.player,player,'attack')>1; + return event.player.isIn()&&event.player!=player&&get.distance(event.player,player,'attack')>1; }, forced:true, content:function(){ @@ -17655,7 +17657,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:'lixia', trigger:{global:'phaseJieshuBegin'}, filter:function(event,player){ - return event.player.isAlive()&&event.player!=player&&!player.inRangeOf(event.player); + return event.player.isIn()&&event.player!=player&&!player.inRangeOf(event.player); }, forced:true, content:function(){ @@ -18969,7 +18971,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, trigger:{global:'phaseUseBegin'}, filter:function(event,player){ - return /*(get.mode()!='guozhan'||event.player!=player)&&*/event.player.isAlive()&&player.countCards('h')>0&&event.player.hasUseTarget({name:'jiu'},null,true); + return /*(get.mode()!='guozhan'||event.player!=player)&&*/event.player.isIn()&&player.countCards('h')>0&&event.player.hasUseTarget({name:'jiu'},null,true); }, direct:true, preHidden:true, @@ -19132,7 +19134,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ "step 1" var target=event.list.shift(); event.target=target; - if(target.isAlive()&&target.countCards('h')==0){ + if(target.isIn()&&target.countCards('h')==0){ player.chooseBool(get.prompt2('shoucheng',target)).set('ai',function(){ return get.attitude(_status.event.player,_status.event.getParent().target)>0; }); @@ -19380,7 +19382,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, trigger:{global:'phaseJieshuBegin'}, filter:function(event,player){ - return event.player.isAlive()&&event.player!=player&&player.countCards('h',function(card){ + return event.player.isIn()&&event.player!=player&&player.countCards('h',function(card){ if(_status.connectMode) return true; return get.type(card)=='basic'; }); @@ -20270,7 +20272,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ popup:false, charlotte:true, filter:function(event,player){ - return event.player.isAlive()&&event.reason&&event.reason.getParent().name=='duwu'; + return event.player.isIn()&&event.reason&&event.reason.getParent().name=='duwu'; }, content:function(){ player.loseHp(); @@ -20383,7 +20385,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, content:function(){ "step 0" - if(player.storage.bifa2[1].isAlive()&&player.countCards('h')){ + if(player.storage.bifa2[1].isIn()&&player.countCards('h')){ player.chooseCard(get.translation(player.storage.bifa2[1])+'的笔伐牌为:',function(card){ return get.type(card,'trick')==_status.event.type; }).set('ai',function(card){ @@ -21657,7 +21659,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ global:"damageEnd", }, filter:function (event,player){ - return event.lianhuanable==true&&event.player.isAlive(); + return event.lianhuanable==true&&event.player.isIn(); }, frequent:true, content:function(){ @@ -22622,7 +22624,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ shanjia_info:'出牌阶段开始时,你可以摸X张牌,然后弃置等量的牌。若你以此法弃置了装备区内的牌,则你可以视为使用一张【杀】。(X为你于本局游戏内使用过的装备牌数且最大为7)', tuifeng:'推锋', tuifeng2:'推锋', - tuifeng_info:'1.当你受到1点伤害后,你可以将一张牌置于武将牌上,称为“锋”。2.准备阶段开始时,若你的武将牌上有“锋”,你移去所有“锋”,摸2X张牌,然后你于此回合的出牌阶段内使用【杀】的次数上限+X。(X为你此次移去的“锋”数)', + tuifeng_info:'1.当你受到伤害后,你可以将至多X张牌置于武将牌上(X为伤害值),称为“锋”。2.准备阶段开始时,若你的武将牌上有“锋”,你移去所有“锋”,摸2X张牌,然后你于此回合的出牌阶段内使用【杀】的次数上限+X。(X为你此次移去的“锋”数)', ziyuan:'资援', ziyuan_info:'出牌阶段限一次,你可以将任意张点数之和为13的手牌交给一名其他角色,然后该角色回复1点体力。', jugu:'巨贾', diff --git a/character/sp2.js b/character/sp2.js index 7dcb1a852..87f1447bd 100644 --- a/character/sp2.js +++ b/character/sp2.js @@ -3393,7 +3393,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ limited:true, forceDie:true, filter:function(event,player){ - return player.isDamaged()&&(event.name=='die'||player.isAlive()); + return player.isDamaged()&&(event.name=='die'||player.isIn()); }, skillAnimation:true, animationColor:'gray', @@ -4313,7 +4313,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.addIndex=0; if(trigger.cards.filterInD().length>0) list.push('获得'+get.translation(trigger.cards.filterInD())); else event.addIndex++; - if(trigger.player.isAlive()) list.push('令'+get.translation(trigger.player)+'本回合不能使用或打出【杀】'); + if(trigger.player.isIn()) list.push('令'+get.translation(trigger.player)+'本回合不能使用或打出【杀】'); player.chooseControl('cancel2').set('choiceList',list).set('prompt',get.prompt('redaoji',trigger.player)).set('ai',function(){ var evt=_status.event.getParent(),player=evt.player,evt2=evt._trigger; if(evt.addIndex==0){ @@ -5199,7 +5199,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event,player){ var target=event.player,source=event.source; if(player!=source&&!player.hasSkill('yangzhong')) return false; - if(!target||!source||!target.isAlive()||!source.isAlive()) return false; + if(!target||!source||!target.isIn()||!source.isIn()) return false; return source.countCards('he')>1; }, content:function(){ @@ -5355,7 +5355,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ 'step 0' player.addTempSkill('weipo3',{player:'phaseBegin'}); - if(player.countCards('h')&&trigger.player.isAlive()){ + if(player.countCards('h')&&trigger.player.isIn()){ player.chooseCard('h',true,'将一张手牌交给'+get.translation(trigger.player)); } else event.finish(); @@ -5768,12 +5768,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{global:'damageSource'}, forced:true, filter:function(event,player){ - return event.source&&event.source.isAlive()&&!player.hasSkill('xianshuai2'); + return event.source&&event.source.isIn()&&!player.hasSkill('xianshuai2'); }, content:function(){ player.addTempSkill('xianshuai2','roundStart'); player.draw(); - if(player==trigger.source&&trigger.player.isAlive()){ + if(player==trigger.source&&trigger.player.isIn()){ player.line(trigger.player,'green'); trigger.player.damage(); } @@ -5920,7 +5920,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 0' player.disableEquip(lib.skill.yujue_backup.position); 'step 1' - if(player.isAlive()&&game.hasPlayer(function(current){ + if(player.isIn()&&game.hasPlayer(function(current){ return current!=player&¤t.countCards('h'); })){ player.chooseTarget(true,'选择一名角色交给你一张牌并获得技能〖执笏〗',function(card,player,target){ @@ -6756,7 +6756,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ 'step 2' var target=targets.shift(); event.target=target; - if(target.isAlive()) target.chooseToDiscard('he','弃置一张牌,或本回合内不能使用或打出牌').set('ai',function(card){ + if(target.isIn()) target.chooseToDiscard('he','弃置一张牌,或本回合内不能使用或打出牌').set('ai',function(card){ var player=_status.event.player; var source=_status.event.getTrigger().player; if(get.attitude(source,player)>0) return -1; @@ -6764,7 +6764,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ return -1; }); 'step 3' - if(target.isAlive()&&!result.bool) target.addTempSkill('xiying2'); + if(target.isIn()&&!result.bool) target.addTempSkill('xiying2'); if(targets.length) event.goto(2); }, ai:{ @@ -7262,7 +7262,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, trigger:{global:'useCardToPlayered'}, filter:function(event,player){ - if(!(event.isFirstTarget&&event.targets&&event.targets.length>1&&event.player.isAlive())) return false; + if(!(event.isFirstTarget&&event.targets&&event.targets.length>1&&event.player.isIn())) return false; var enemy=0; var friend=0; for(var i of game.players){ @@ -7564,7 +7564,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ next.target=trigger.player; next.num=num; next.setContent(function(){ - if(target.isAlive()) player.chooseToDiscard(num,true,'he'); + if(target.isIn()) player.chooseToDiscard(num,true,'he'); }); }, }, @@ -8748,7 +8748,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{global:'damageEnd'}, forced:true, filter:function(event,player){ - return event.player!=player&&event.player.isAlive()&&event.player.hasMark('zongkui_mark'); + return event.player!=player&&event.player.isIn()&&event.player.hasMark('zongkui_mark'); }, content:function(){ 'step 0' @@ -8756,7 +8756,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.storage.guju++; player.markSkill('guju'); 'step 1' - if(player.hasZhuSkill('bingzhao',trigger.player)&&trigger.player.group==player.storage.bingzhao&&trigger.player.isAlive()){ + if(player.hasZhuSkill('bingzhao',trigger.player)&&trigger.player.group==player.storage.bingzhao&&trigger.player.isIn()){ trigger.player.chooseBool('是否对'+get.translation(player)+'发动【秉诏】?').ai=function(){ return get.attitude(trigger.player,player)>1; }; diff --git a/character/standard.js b/character/standard.js index 7ec30c7bd..f73668cd2 100755 --- a/character/standard.js +++ b/character/standard.js @@ -623,9 +623,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){ giver:player, animate:'draw', }).setContent('gaincardMultiple'); - if(event.count<=0) event.finish(); 'step 6' - player.chooseBool(get.prompt2(event.name)).set('frequentSkill',event.name); + if(event.count>0&&player.hasSkill(event.name)){ + player.chooseBool(get.prompt2(event.name)).set('frequentSkill',event.name); + } + else event.finish(); 'step 7' if(result.bool){ player.logSkill(event.name); diff --git a/character/tw.js b/character/tw.js index 07c871d2b..d7431e1d4 100644 --- a/character/tw.js +++ b/character/tw.js @@ -2184,7 +2184,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, trigger:{global:'damageEnd'}, filter:function(event,player){ - return event.player.isAlive()&&get.distance(player,event.player)<=1; + return event.player.isIn()&&get.distance(player,event.player)<=1; }, logTarget:'player', check:function(event,player){ @@ -4603,7 +4603,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ trigger:{player:'damageEnd'}, logTarget:'source', filter:function(event,player){ - return event.source&&event.source.isAlive(); + return event.source&&event.source.isIn(); }, check:function(event,player){ var att=get.attitude(player,event.source); @@ -4648,7 +4648,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(get.suit(card)!='heart') player.draw(); 'step 4' var target=trigger.source; - if(target.isAlive()&&event.count>0) player.chooseBool(get.prompt('twenyuan',target),lib.skill.twenyuan2.prompt2).set('ai',function(){ + if(target.isIn()&&event.count>0&&player.hasSkill('twenyuan')) player.chooseBool(get.prompt('twenyuan',target),lib.skill.twenyuan2.prompt2).set('ai',function(){ var evt=_status.event.getTrigger(); return lib.skill.twenyuan2.check(evt,evt.player); }); @@ -8252,7 +8252,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event,player){ if(!player.countCards('he')) return false; var evt=player.storage.twgongge_buff2; - if(evt.card==event.card&&evt.target.isAlive()&&evt.target.hp>=player.hp) return true; + if(evt.card==event.card&&evt.target.isIn()&&evt.target.hp>=player.hp) return true; return false; }, direct:true, @@ -8276,7 +8276,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ filter:function(event,player){ if(!event.card) return false; var evt=player.storage.twgongge_buff3; - if(evt.card==event.card&&evt.target.isAlive()&&(event.name=='useCard'||event.player==evt.target)) return true; + if(evt.card==event.card&&evt.target.isIn()&&(event.name=='useCard'||event.player==evt.target)) return true; return false; }, direct:true, @@ -8284,7 +8284,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ content:function(){ var evt=player.storage.twgongge_buff3; if(trigger.name=='damage') trigger.num+=evt.num; - else if(evt.target.isAlive()) evt.target.recover(evt.num); + else if(evt.target.isIn()) evt.target.recover(evt.num); }, }, buff1_mark:{ @@ -12503,7 +12503,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }); if(card) player.gain(card,'gain2'); } - if(event.count>0) event.goto(1); + if(event.count>0&&player.hasSkill('twmiaolve')) event.goto(1); } }, }, @@ -12953,7 +12953,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ charlotte:true, filter:function(event,player){ var evt=event.getParent(2); - return evt.name=='twrangyi'&&evt.player.isAlive()&&player.countCards('h',function(card){ + return evt.name=='twrangyi'&&evt.player.isIn()&&player.countCards('h',function(card){ return card.hasGaintag('twrangyi'); })>0; }, diff --git a/character/xianding.js b/character/xianding.js index 9d75158cb..101641ebe 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -8646,7 +8646,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(card) player.chooseUseTarget(card,true).nopopup=true; 'step 2' event.num++; - if(event.num<=5&&target.isAlive()&&player.countCards('e')1; + return current.isIn()&¤t.hp>1; }); }, content:function(){ @@ -735,7 +735,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.targets=targets.sortBySeat(); 'step 1' var target=targets.shift(); - if(target.isAlive()&&target.hp>1){ + if(target.isIn()&&target.hp>1){ event._delay=true; var num=target.hp-1; player.markAuto('xinfu_weilu_recover',[[target,num]]); @@ -778,7 +778,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }); 'step 1' var group=event.list.shift(); - if(group[0].isAlive()&&group[0].isDamaged()){ + if(group[0].isIn()&&group[0].isDamaged()){ group[0].recover(group[1]); event._delay=true; } diff --git a/character/yijiang.js b/character/yijiang.js index 1f699b0b6..c9d857f12 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -4086,7 +4086,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(!player.storage.shouxi) player.storage.shouxi=[]; }, filter:function(event,player){ - return event.card.name=='sha'&&event.player.isAlive(); + return event.card.name=='sha'&&event.player.isIn(); }, content:function(){ 'step 0' @@ -4330,7 +4330,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.useCard(card,trigger.player,false); } 'step 2' - if(event.total>0&&!event.washed&&ui.cardPile.childElementCount<=player.hp*10&&trigger.player.isAlive()) event.goto(1); + if(event.total>0&&!event.washed&&ui.cardPile.childElementCount<=player.hp*10&&trigger.player.isIn()) event.goto(1); 'step 3' lib.onwash.remove(lib.skill.fuzhu.onWash); var cards=get.cards(ui.cardPile.childElementCount+1); @@ -4961,7 +4961,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:false, content:function(){ "step 0" - if(player.storage.xinsidi4.isAlive()&&!player.getHistory('useCard',function(evt){ + if(player.storage.xinsidi4.isIn()&&!player.getHistory('useCard',function(evt){ return evt.card.name=='sha'; }).length&&player.storage.xinsidi4.canUse({name:'sha',isCard:true},player,false)){ player.storage.xinsidi4.logSkill('xinsidi',player); @@ -5915,7 +5915,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(storage.length){ for(var i=0;i0) player.loseHp(); delete card.nature; @@ -7562,7 +7562,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.finish(); } 'step 5' - if(player.isAlive()&&event.targets.length){ + if(player.isIn()&&event.targets.length){ player.gainPlayerCard(event.targets.shift(),'he',true); } else event.finish(); @@ -7757,7 +7757,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } else event.finish(); 'step 4' - if(target.isAlive()&&target.countCards('h')&&target.countCards('h')>target.hp) target.chooseCard('he',true,'将一张牌置于牌堆顶'); + if(target.isIn()&&target.countCards('h')&&target.countCards('h')>target.hp) target.chooseCard('he',true,'将一张牌置于牌堆顶'); else event.goto(3); 'step 5' if(result&&result.cards){ @@ -9156,7 +9156,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, trigger:{global:'phaseJieshuBegin'}, filter:function(event,player){ - return event.player!=player&&event.player.countCards('h')==player.countCards('h')&&event.player.isAlive(); + return event.player!=player&&event.player.countCards('h')==player.countCards('h')&&event.player.isIn(); }, check:function(event,player){ return get.attitude(player,event.player)>=0; @@ -9537,7 +9537,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ event.current=event.players.shift(); event.current.animate('target'); player.line(event.current,'green'); - if(event.current.countCards('he')&&target.isAlive()){ + if(event.current.countCards('he')&&target.isIn()){ event.current.chooseToDiscard({subtype:'equip1'},'he','弃置一张武器牌或让'+ get.translation(target)+'摸一张牌').set('ai',function(card){ if(get.attitude(_status.event.player,_status.event.target)<0) return 7-get.value(card); @@ -10621,7 +10621,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.addToExpansion(result.cards,player,'giveAuto').gaintag.add('quanji'); } "step 4" - if(event.count>0){ + if(event.count>0&&player.hasSkill('quanji')){ player.chooseBool(get.prompt2('quanji')).set('frequentSkill','quanji'); } else event.finish(); @@ -10820,7 +10820,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:2, trigger:{global:'phaseEnd'}, filter:function(event,player){ - if(event.player==player||!event.player.isAlive()) return false; + if(event.player==player||!event.player.isIn()) return false; var history=event.player.getHistory('useCard'); for(var i=0;i0&&event.source.isAlive(); + return event.source&&event.source!=player&&event.num>0&&event.source.isIn(); }, + logTarget:'source', content:function(){ "step 0" event.num=trigger.num; @@ -12506,7 +12507,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ else{ trigger.source.loseHp(); } - if(event.num>1){ + if(event.num>1&&player.hasSkill('xinenyuan')&&trigger.source&&trigger.source.isIn()){ + player.logSkill('xinenyuan',trigger.source) event.num--; event.goto(1); } @@ -12527,7 +12529,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ audio:true, trigger:{player:'gainEnd'}, filter:function(event,player){ - return event.source&&event.source.isAlive()&&event.source!=player&&event.cards.length>=2; + return event.source&&event.source.isIn()&&event.source!=player&&event.cards.length>=2; }, logTarget:'source', check:function(event,player){ @@ -12781,7 +12783,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, filter:function(event){ if(event._notrigger.contains(event.player)) return false; - return event.card&&event.card.name=='sha'&&event.player.isAlive(); + return event.card&&event.card.name=='sha'&&event.player.isIn(); }, logTarget:'player', content:function(){ diff --git a/game/game.js b/game/game.js index af2b38b6c..17039c5a1 100644 --- a/game/game.js +++ b/game/game.js @@ -17591,9 +17591,9 @@ } } if(_status.characterlist){ - if(lib.character[player.name]&&player.name.indexOf('gz_shibing')!=0) _status.characterlist.add(player.name); - if(lib.character[player.name1]&&player.name1.indexOf('gz_shibing')!=0) _status.characterlist.add(player.name1); - if(lib.character[player.name2]&&player.name2.indexOf('gz_shibing')!=0) _status.characterlist.add(player.name2); + if(lib.character[player.name]&&player.name.indexOf('gz_shibing')!=0&&player.name.indexOf('gz_jun_')!=0) _status.characterlist.add(player.name); + if(lib.character[player.name1]&&player.name1.indexOf('gz_shibing')!=0&&player.name1.indexOf('gz_jun_')!=0) _status.characterlist.add(player.name1); + if(lib.character[player.name2]&&player.name2.indexOf('gz_shibing')!=0&&player.name2.indexOf('gz_jun_')!=0) _status.characterlist.add(player.name2); } event.cards=player.getCards('hejsx'); if(event.cards.length){ diff --git a/mode/guozhan.js b/mode/guozhan.js index ca2d58f1f..6d5c8aa2d 100644 --- a/mode/guozhan.js +++ b/mode/guozhan.js @@ -18,12 +18,12 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } for(var i in lib.character){ if(lib.character[i][1]=='shen'){ - if(lib.character[i][4]&&(lib.group.contains(lib.character[i][4][0])||lib.character[i][4][0]=='key')){ - lib.character[i][1]=lib.character[i][4][0]; - } - else{ - lib.character[i][1]='qun'; + if(lib.character[i][4]){ + var group=lib.character[i][4].find(group=>lib.group.contains(group)||group=='key'); + if(group) lib.character[i][1]=group; + else lib.character[i][1]='qun'; } + else lib.character[i][1]='qun'; } } }, @@ -40,12 +40,12 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } for(var i in lib.character){ if(lib.character[i][1]=='shen'){ - if(lib.character[i][4]&&(lib.group.contains(lib.character[i][4][0])||lib.character[i][4][0]=='key')){ - lib.character[i][1]=lib.character[i][4][0]; - } - else{ - lib.character[i][1]='qun'; + if(lib.character[i][4]){ + var group=lib.character[i][4].find(group=>lib.group.contains(group)||group=='key'); + if(group) lib.character[i][1]=group; + else lib.character[i][1]='qun'; } + else lib.character[i][1]='qun'; } } }, @@ -136,12 +136,12 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } for(var i in lib.character){ if(lib.character[i][1]=='shen'){ - if(lib.character[i][4]&&(lib.group.contains(lib.character[i][4][0])||lib.character[i][4][0]=='key')){ - lib.character[i][1]=lib.character[i][4][0]; - } - else{ - lib.character[i][1]='qun'; + if(lib.character[i][4]){ + var group=lib.character[i][4].find(group=>lib.group.contains(group)||group=='key'); + if(group) lib.character[i][1]=group; + else lib.character[i][1]='qun'; } + else lib.character[i][1]='qun'; } } lib.characterReplace={}; @@ -564,7 +564,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ gz_zhugejin:['male','wu',3,['gzhuanshi','gzhongyuan','gzmingzhe']], gz_yangxiu:['male','wei',3,['gzdanlao','gzjilei']], gz_zumao:['male','wu',4,['yinbing','juedi']], - gz_fuwan:['male','qun',4,['twmoukui']], + gz_fuwan:['male','qun',4,['moukui']], gz_chendao:["male","shu",4,["drlt_wanglie"],[]], gz_tw_tianyu:['male','wei',4,['gzzhenxi','gzjiansu'],[]], gz_tw_liufuren:['female','qun',3,['gzzhuidu','gzshigong'],[]], @@ -654,15 +654,15 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ return !player.getExpansions('gzremidao').length; }, content:function(){ - 'step 0' - player.draw(2); - 'step 1' - var cards=player.getCards('he'); - if(!cards.length) event.finish(); - else if(cards.length<=2) event._result={bool:true,cards:cards}; - else player.chooseCard(2,'he',true,'选择两张牌作为“米”'); - 'step 2' - if(result.bool) player.addToExpansion(result.cards,player,'give').gaintag.add('gzremidao'); + 'step 0' + player.draw(2); + 'step 1' + var cards=player.getCards('he'); + if(!cards.length) event.finish(); + else if(cards.length<=2) event._result={bool:true,cards:cards}; + else player.chooseCard(2,'he',true,'选择两张牌作为“米”'); + 'step 2' + if(result.bool) player.addToExpansion(result.cards,player,'give').gaintag.add('gzremidao'); }, marktext:'米', intro:{ @@ -838,7 +838,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ charlotte:true, mod:{ targetEnabled:function(card,player,target){ - if(card.name=='tao'&&target.isDying()&&player.isFriendOf(target)) return false; + if(card.name=='tao'&&target.isDying()&&player.isFriendOf(target)&&target!=player) return false; }, }, }, @@ -1979,7 +1979,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ group:['gzzhaosong_dying','gzzhaosong_sha'], subSkill:{ dying:{ - audio:'gzzhaosong', + audio:'zhaosong', trigger:{global:'dying'}, logTarget:'player', filter:function(event,player){ @@ -1997,7 +1997,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, }, sha:{ - audio:'gzzhaosong', + audio:'zhaosong', trigger:{global:'useCard2'}, direct:true, filter:function(event,player){ @@ -2034,7 +2034,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }, }, gzlisi:{ - audio:2, + audio:'lisi', trigger:{global:'dieAfter'}, filter:function(event,player){ return event.player.isFriendOf(player)&&player.getStorage('gzzhaosong').length>0; @@ -5727,6 +5727,27 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ if(event.list.length) event.goto(1); }, }, + fengyang_old:{ + audio:'fengyang', + zhenfa:'inline', + global:'fengyang_old_nogain', + subSkill:{ + nogain:{ + mod:{ + canBeDiscarded:function(card,player,target){ + if(get.position(card)=='e'&&player.identity!=target.identity&&game.hasPlayer(function(current){ + return current.hasSkill('fengyang_old')&&(current==target||target.inline(current)); + })) return false; + }, + canBeGained:function(card,player,target){ + if(get.position(card)=='e'&&player.identity!=target.identity&&game.hasPlayer(function(current){ + return current.hasSkill('fengyang_old')&&(current==target||target.inline(current)); + })) return false; + }, + }, + }, + }, + }, gzrekuangcai:{ audio:'gzkuangcai', forced:true, @@ -10303,10 +10324,10 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ event.num=zhu.getExpansions('yuanjiangfenghuotu').length; 'step 1' var list=[]; - if(event.num>=1&&!player.hasSkill('reyingzi')) list.push('reyingzi'); - if(event.num>=2&&!player.hasSkill('haoshi')) list.push('haoshi'); - if(event.num>=3&&!player.hasSkill('shelie')) list.push('shelie'); - if(event.num>=4&&!player.hasSkill('duoshi')) list.push('duoshi'); + if(event.num>=1&&!player.hasSkill('jiahe_reyingzi')) list.push('reyingzi'); + if(event.num>=2&&!player.hasSkill('jiahe_haoshi')) list.push('haoshi'); + if(event.num>=3&&!player.hasSkill('jiahe_shelie')) list.push('shelie'); + if(event.num>=4&&!player.hasSkill('jiahe_duoshi')) list.push('duoshi'); if(!list.length){ event.finish(); return; @@ -10346,9 +10367,10 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ }); 'step 2' if(result.control!='cancel2'){ - player.addTempSkill(result.control); + var skill='jiahe_'+result.control; + player.addTempSkill(skill); if(!event.done) player.logSkill('jiahe_put'); - game.log(player,'获得了技能','【'+get.translation(result.control)+'】'); + game.log(player,'获得了技能','【'+get.translation(skill)+'】'); if(event.num>=5&&!event.done){ event.done=true; event.goto(1); @@ -10356,6 +10378,18 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ } } }, + jiahe_reyingzi:{ + inherit:'reyingzi', + }, + jiahe_haoshi:{ + inherit:'haoshi', + }, + jiahe_shelie:{ + inherit:'shelie', + }, + jiahe_duoshi:{ + inherit:'duoshi', + }, yuanjiangfenghuotu:{ unique:true, forceunique:true, @@ -13269,18 +13303,10 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ event.choosen=[name1,name2]; if(get.is.double(name1,true)){ if(!get.is.double(name2,true)) event._result={control:lib.character[name2][1]}; - else if(get.is.double(name1,true).removeArray(get.is.double(name2,true)).length==0||get.is.double(name2,true).removeArray(get.is.double(name1,true)).length==0){ - var listg=get.is.double(name2,true).filter(group=>get.is.double(name1,true).contains(group)); - listg.sort((a,b)=>lib.group.indexOf(a)-lib.group.indexOf(b)) - game.me.chooseControl(listg).set('prompt','请选择你代表的势力').set('ai',()=>_status.event.controls.randomGet()); - } + else if(get.is.double(name1,true).removeArray(get.is.double(name2,true)).length==0||get.is.double(name2,true).removeArray(get.is.double(name1,true)).length==0) game.me.chooseControl(get.is.double(name2,true).filter(group=>get.is.double(name1,true).contains(group))).set('prompt','请选择你代表的势力').set('ai',()=>_status.event.controls.randomGet()); else event._result={control:get.is.double(name1,true).find(group=>get.is.double(name2,true).contains(group))}; } - else if(lib.character[name1][1]=='ye'&&get.is.double(name2,true)){ - var listg=get.is.double(name2,true); - listg.sort((a,b)=>lib.group.indexOf(a)-lib.group.indexOf(b)) - game.me.chooseControl(listg).set('prompt','请选择副将代表的势力').set('ai',()=>_status.event.controls.randomGet()); - } + else if(lib.character[name1][1]=='ye'&&get.is.double(name2,true)) game.me.chooseControl(get.is.double(name2,true)).set('prompt','请选择副将代表的势力').set('ai',()=>_status.event.controls.randomGet()); } 'step 2' if(result&&result.control) game.me.trueIdentity=result.control; @@ -13820,6 +13846,8 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ donggui_info:'出牌阶段限一次,你可以暗置武将牌均明置的一名其他角色一张武将牌,视为对其使用【调虎离山】,且其本回合不能明置此武将牌。若因此形成队列,你摸X张牌(X为该队列中的角色数)。', fengyang:'风扬', fengyang_info:'阵法技,结束阶段,你所在队列的角色可以依次弃置一张装备区里的牌,然后摸两张牌。', + fengyang_old:'风扬', + fengyang_old_info:'阵法技,与你势力不同的角色不能弃置或获得与你处于同一队列的角色的装备区里的牌。', dongzhao:'董昭', quanjin:'劝进', quanjin_info:'出牌阶段限一次,你可将一张手牌交给一名本回合内受到过伤害其他角色,然后令其执行一项“军令”。若其执行,则你摸一张牌。若其不执行,则你将手牌摸至与全场最多相等(至多摸五张)。', @@ -14204,6 +14232,10 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ gzrebushi_info:'①回合结束后,你获得X个“义舍”标记(X为你的体力值)。②其他角色的准备阶段,你可以失去1个“义舍”标记,交给其一张牌并摸两张牌。③准备阶段,你须弃置Y张牌,然后失去所有“义舍”标记(Y为场上存活人数-你的体力值-2)。', gzremidao:'米道', gzremidao_info:'①结束阶段开始时,若你的武将牌上没有“米”,则你可以摸两张牌。若如此做,你将两张牌置于武将牌上,称为“米”。②一名角色的判定牌生效前,你可以打出一张“米”作为新的判定牌,然后你获得原判定牌。', + jiahe_reyingzi:'英姿', + jiahe_haoshi:'好施', + jiahe_shelie:'涉猎', + jiahe_duoshi:'度势', gz_key_ushio:'冈崎汐', ushio_huanxin:'幻心', @@ -14798,6 +14830,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ _status.characterlist.randomSort(); event.tochange=[] for(var i=0;i<_status.characterlist.length;i++){ + if(_status.characterlist[i].indexOf('gz_jun_')==0) continue; var goon=false,group2=lib.character[_status.characterlist[i]][1]; if(group=='ye'){ if(group2!='ye') goon=true; @@ -15602,10 +15635,18 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ return Math.sign(att1)*eff1+Math.sign(att2)*eff2; }, realAttitude:function(from,to,difficulty,toidentity){ - if(from.identity==toidentity&&toidentity!='ye'){ + var getIdentity=function(player){ + if(player.isUnseen()){ + if(!player.wontYe()) return 'ye'; + return player.getGuozhanGroup(0); + } + return player.identity; + }; + var fid=getIdentity(from); + if(fid==toidentity&&toidentity!='ye'){ return 4+difficulty; } - if(from.identity=='unknown'&&lib.character[from.name1][1]==toidentity){ + if(from.identity=='unknown'&&fid==toidentity){ if(from.wontYe()) return 4+difficulty; } var groups=[]; @@ -15634,7 +15675,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ var max=Math.max.apply(this,groups); if(max<=1) return -3; var from_p; - if(from.identity=='unknown'&&from.wontYe()) from_p=get.population(lib.character[from.name1][1]); + if(from.identity=='unknown'&&from.wontYe()) from_p=get.population(fid); else from_p=game.countPlayer(function(current){ return current.isFriendOf(from); }); @@ -15655,25 +15696,24 @@ game.import('mode',function(lib,game,ui,get,ai,_status){ return -0.5; }, rawAttitude:function(from,to){ + var getIdentity=function(player){ + if(player.isUnseen()){ + if(!player.wontYe()) return 'ye'; + return player.getGuozhanGroup(0); + } + return player.identity; + }; + var fid=getIdentity(from),tid=getIdentity(to); if(to.identity=='unknown'&&game.players.length==2) return -5; - if(_status.currentPhase==from&&from.ai.tempIgnore&& - from.ai.tempIgnore.contains(to)&&to.identity=='unknown'&& - (!from.storage.zhibi||!from.storage.zhibi.contains(to))) return 0; + if(_status.currentPhase==from&&from.ai.tempIgnore&&from.ai.tempIgnore.contains(to)&&to.identity=='unknown'&&(!from.storage.zhibi||!from.storage.zhibi.contains(to))) return 0; var difficulty=0; if(to==game.me) difficulty=(2-get.difficulty())*1.5; if(from==to) return 5+difficulty; if(from.isFriendOf(to)) return 5+difficulty; - if(from.identity=='unknown'&&lib.character[from.name1][1]==to.identity){ + if(from.identity=='unknown'&&fid==to.identity){ if(from.wontYe()) return 4+difficulty; } - var toidentity=to.identity; - if(toidentity=='unknown'){ - toidentity=lib.character[to.name1][1]; - if(!to.wontYe()){ - toidentity='ye'; - } - } - var att=get.realAttitude(from,to,difficulty,toidentity); + var att=get.realAttitude(from,to,difficulty,tid); if(from.storage.zhibi&&from.storage.zhibi.contains(to)){ return att; }