diff --git a/card/standard.js b/card/standard.js index 7369fa8fe..26c4a68ac 100644 --- a/card/standard.js +++ b/card/standard.js @@ -155,11 +155,13 @@ game.import('card',function(lib,game,ui,get,ai,_status){ next.set('useShan',(()=>{ if(target.hasSkillTag('noShan',null,event)) return false; if(target.hasSkillTag('useShan',null,event)) return true; - if(event.baseDamage+event.extraDamage<=0 || target.isLinked()&&game.hasNature(event.card)&&get.attitude(target,player._trueMe||player)>0) return false; + if(target.isLinked()&&game.hasNature(event.card)&&get.attitude(target,player._trueMe||player)>0) return false; + if(event.baseDamage+event.extraDamage<=0&&!game.hasNature(event.card,'ice')) return false; + if(target.hasSkillTag('freeShan',false,event,true)) return true; if(event.shanRequired>1&&target.mayHaveShan(target,'use',null,'count')=target.hp+ ((player.hasSkillTag('jueqing',false,target)||target.hasSkill('gangzhi'))?target.hujia:0)) return true; - if(!game.hasNature(event.card, 'ice')&&get.damageEffect(target,player,target,get.nature(event.card))>=0) return false; + if(!game.hasNature(event.card,'ice')&&get.damageEffect(target,player,target,get.nature(event.card))>=0) return false; return true; })()); //next.autochoose=lib.filter.autoRespondShan; @@ -394,7 +396,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){ useful:(card,i)=>{ let player = _status.event.player, basic = [7, 5.1, 2], num = basic[Math.min(2, i)]; if(player.hp>2&&player.hasSkillTag('maixie')) num *= 0.57; - if(player.getEquip('bagua') || player.getEquip('rewrite_bagua') || player.getEquip('renwang') || player.getEquip('rewrite_renwang')) num *= 0.8; + if(player.hasSkillTag('freeShan',false,null,true) || player.getEquip('rewrite_renwang')) num *= 0.8; return num; }, value:[7,5.1,2], @@ -2676,6 +2678,18 @@ game.import('card',function(lib,game,ui,get,ai,_status){ }, ai:{ respondShan:true, + freeShan:true, + skillTagFilter(player,tag,arg){ + if(tag!=='respondShan'&&tag!=='freeShan') return; + if(player.hasSkillTag('unequip2')) return false; + if(!arg||!arg.player) return true; + if(arg.player.hasSkillTag('unequip',false,{ + target:player + })||arg.player.hasSkillTag('unequip_ai',false,{ + target:player + })) return false; + return true; + }, effect:{ target:function(card,player,target,effect){ if(target.hasSkillTag('unequip2')) return; diff --git a/character/gwent.js b/character/gwent.js index 3dc3c055e..c4bfeeee0 100644 --- a/character/gwent.js +++ b/character/gwent.js @@ -2775,7 +2775,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ order:7, result:{ target(player,target){ - if(player.getEquip('tengjia')||player.getEquip('bagua')) return -1; + if(player.getEquip('tengjia')||player.hasSkillTag('freeShan',false,{ + player:target, + card:new lib.element.VCard({name:'sha'}) + })) return -1; if(get.effect(player,{name:'sha'},target,player)>=0) return -1; if(!player.hasShan()){ if(ui.selected.targets.length) return 0; diff --git a/character/huicui.js b/character/huicui.js index 0b8c2f5d8..3fa5db8b7 100644 --- a/character/huicui.js +++ b/character/huicui.js @@ -2346,7 +2346,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){ result:{ target:function(player,target){ if(player.getStorage('dclvecheng_xiongluan').includes(target)) return 0; - if(target.getEquip('bagua')||target.getEquip('rewrite_bagua')) return -0.6; + if(target.hasSkillTag('freeShan',false,{ + player:player + },true)) return -0.6; var hs=player.countCards('h',card=>{ if(!player.canUse(card,target)) return false; return get.name(card)=='sha'&&get.effect(target,card,player,player)>0; diff --git a/character/ow.js b/character/ow.js index 623cf5ab0..daf18f2a7 100644 --- a/character/ow.js +++ b/character/ow.js @@ -2295,7 +2295,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ direct:true, content:function(){ "step 0" - var dis=trigger.target.countCards('h','shan')||trigger.target.getEquip('bagua')||trigger.target.countCards('h')>2; + var dis=trigger.target.countCards('h','shan')||trigger.target.hasSkillTag('freeShan',false,{ + player:player, + card:trigger.card + },true)||trigger.target.countCards('h')>2; var att=get.attitude(player,trigger.target); var next=player.chooseToDiscard(get.prompt('xiandan')); next.ai=function(card){ diff --git a/character/shenhua.js b/character/shenhua.js index c42bdf4c1..7ef5dd7b3 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -1389,7 +1389,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){ order:13, result:{ target:(player,target)=>{ - if(target.getEquip('bagua')||target.getEquip('rewrite_bagua')) return 0; let hs=player.countCards('h',card=>{ if(!get.tag(card,'damage')||get.effect(target,card,player,player)<=0) return 0; if(get.name(card,player)==='sha'){ @@ -5435,6 +5434,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, ai:{ respondShan:true, + freeShan:true, + skillTagFilter(player,tag,arg){ + if(tag!=='respondShan'&&tag!=='freeShan') return; + if(!player.hasEmptySlot(2)||player.hasSkillTag('unequip2')) return false; + if(!arg||!arg.player) return true; + if(arg.player.hasSkillTag('unequip',false,{ + target:player + })||arg.player.hasSkillTag('unequip_ai',false,{ + target:player + })) return false; + return true; + }, effect:{ target:function(card,player,target){ if(player==target&&get.subtype(card)=='equip2'){ diff --git a/character/shiji.js b/character/shiji.js index 4ce0c0283..c813260fc 100644 --- a/character/shiji.js +++ b/character/shiji.js @@ -2413,9 +2413,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ai:{ directHit_ai:true, skillTagFilter:function(player,tag,arg){ - if(!arg||!arg.card||!arg.target||(arg.card.name!='sha'&&arg.card.name!='juedou')) return false; + if(tag!=='directHit_ai'||!arg||!arg.card||!arg.target||(arg.card.name!='sha'&&arg.card.name!='juedou')) return false; if(player.storage.counttrigger&&player.storage.counttrigger.dbquedi&&player.storage.counttrigger.dbquedi>0) return false; - if(arg.target.countCards('h')==1&&(arg.card.name!='sha'||!arg.target.getEquip('bagua')||player.hasSkillTag('unequip',false,{ + if(arg.target.countCards('h')==1&&(arg.card.name!='sha'||!arg.target.hasSkillTag('freeShan',false,{ + player:player, + card:arg.card + })||player.hasSkillTag('unequip',false,{ name:arg.card?arg.card.name:null, target:arg.target, card:arg.card diff --git a/character/sp.js b/character/sp.js index 92cbbdf70..45577449f 100755 --- a/character/sp.js +++ b/character/sp.js @@ -15738,8 +15738,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(get.attitude(player,event.player)>=0) return false; var e2=player.getEquip(2); if(e2){ - if(e2.name=='tengjia') return true; - if(e2.name=='bagua') return true; + if(e2.name=='tengjia'||e2.name=='rewrite_tengjia') return true; + if(e2.name=='bagua'||e2.name=='rewrite_bagua') return true; } return event.player.countCards('h')>event.player.hp; }, @@ -20019,6 +20019,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){ }, ai:{ respondShan:true, + freeShan:true, + skillTagFilter(player,tag,arg){ + if(tag!=='respondShan'&&tag!=='freeShan') return; + if(!player.hasEmptySlot(2)||player.hasSkillTag('unequip2')) return false; + if(!arg||!arg.player) return true; + if(arg.player.hasSkillTag('unequip',false,{ + target:player + })||arg.player.hasSkillTag('unequip_ai',false,{ + target:player + })) return false; + return true; + }, effect:{ target:function(card,player,target){ if(player==target&&get.subtype(card)=='equip2'){ @@ -20477,8 +20489,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(get.attitude(player,event.player)>=0) return false; var e2=player.getEquip(2); if(e2){ - if(e2.name=='tengjia') return true; - if(e2.name=='bagua') return true; + if(e2.name=='tengjia'||e2.name=='rewrite_tengjia') return true; + if(e2.name=='bagua'||e2.name=='rewrite_bagua') return true; } return player.countCards('h','shan')>0; }, diff --git a/character/swd.js b/character/swd.js index bec8cbafa..ff0ae770b 100644 --- a/character/swd.js +++ b/character/swd.js @@ -9528,7 +9528,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ direct:true, content:function(){ "step 0" - var dis=trigger.target.countCards('h','shan')||trigger.target.getEquip('bagua')||trigger.target.countCards('h')>2; + var dis=trigger.target.countCards('h','shan')||trigger.target.hasSkillTag('freeShan',false,{ + player:player, + card:trigger.card + },true)||trigger.target.countCards('h')>2; var next=player.chooseToDiscard(get.prompt('shoulie',trigger.target)); next.ai=function(card){ if(dis) return 7-get.value(card); diff --git a/character/xianding.js b/character/xianding.js index 1309d0f4d..649933d1e 100644 --- a/character/xianding.js +++ b/character/xianding.js @@ -10294,9 +10294,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){ player.chooseTarget(get.prompt2('juetao'),lib.filter.notMe).set('ai',function(target){ let att=-get.attitude(_status.event.player,target); if(att<=0) return att; - if(target.hasSkillTag('nodamage')) return 0.01*att; - if(target.getEquip('tengjia')||target.getEquip('renwang')) return 0.2*att; - if(target.getEquip('bagua')) return 0.3*att; + if(target.hasSkillTag('nodamage')||target.getEquip('qimenbagua')) return 0.01*att; + if(target.getEquip('tengjia')||target.getEquip('renwang')) return 0.3*att; + if(target.getEquip('rewrite_tengjia')||target.getEquip('rewrite_renwang')) return 0.2*att; + if(target.hasSkillTag('freeShan',false,{ + player:_status.event.player + },true)) return 0.3*att; if(target.getEquip(2)) return att/2; return 1.2*att; }); diff --git a/character/yijiang.js b/character/yijiang.js index 5a0d64b22..1ba732af3 100755 --- a/character/yijiang.js +++ b/character/yijiang.js @@ -3692,11 +3692,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){ ai:{ directHit_ai:true, skillTagFilter:function(player,tag,arg){ - if(player._zhuandui_temp) return false; + if(player._zhuandui_temp||tag!=='directHit_ai') return false; player._zhuandui_temp=true; var bool=function(){ if(arg.card.name!='sha'||get.attitude(player,arg.target)>=0||!arg.target.countCards('h')) return false; - if(arg.target.countCards('h')==1&&(!arg.target.getEquip('bagua')||player.hasSkillTag('unequip',false,{ + if(arg.target.countCards('h')==1&&(!arg.target.hasSkillTag('freeShan',false,{ + player:player, + card:arg.card + },true)||player.hasSkillTag('unequip',false,{ name:arg.card?arg.card.name:null, target:arg.target, card:arg.card @@ -7254,7 +7257,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){ var trigger=_status.event.getTrigger(); if(att>0&&eff>=0) return 1; if(att>=0&&eff>0) return 1; - if(att>0&&(trigger.player.hp>=3||trigger.player.getEquip('bagua')||trigger.player.countCards('h','shan'))){ + if(att>0&&(trigger.player.hp>=3||trigger.player.hasSkillTag('freeShan',false,{ + player:_status.event.player, + card:new lib.element.VCard({name:'sha',isCard:true}) + })||trigger.player.countCards('h','shan'))){ if(name=='lebu'&&nh>trigger.player.hp) return 1; if(name=='bingliang'&&nh0&&eff>=0) return 1; if(att>=0&&eff>0) return 1; - if(att>0&&(trigger.player.hp>=3||trigger.player.getEquip('bagua')||trigger.player.countCards('h','shan'))){ + if(att>0&&(trigger.player.hp>=3||trigger.player.hasSkillTag('freeShan',false,{ + player:_status.event.player, + card:new lib.element.VCard({name:'sha',isCard:true}) + })||trigger.player.countCards('h','shan'))){ if(name=='lebu'&&nh>trigger.player.hp) return 1; if(name=='bingliang'&&nh=0) return false; - if(event.target.getEquip('bagua')) return false; + if(event.target.hasSkillTag('freeShan',false,{ + player:player, + card:event.card + },true)) return false; if(event.target.hasSkillTag('respondShan')&&event.target.countCards('h')>=3) return false; return true; }, @@ -2186,7 +2189,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ if(trigger.target.hasSkill('shanguang2')) return 0; var equip=trigger.target.getEquip(2); - if(equip&&equip.name=='bagua') return 1; + if(equip&&(equip.name=='bagua'||equip.name=='rewrite_bagua')) return 1; return trigger.target.countCards('h')<2?0:1; }; "step 1" diff --git a/noname/library/element/player.js b/noname/library/element/player.js index 9b223b5ea..a5c6633e7 100644 --- a/noname/library/element/player.js +++ b/noname/library/element/player.js @@ -2316,11 +2316,11 @@ export class Player extends HTMLDivElement { } /** * 换肤换音:想要支持某个武将更换皮肤,必须在lib.character.characterSubstitute中存在该武将的id(以下以name代指武将id,character代指换肤图片名) - * + * * 如果换肤换音引用本体的image/character素材作为更换的皮肤且不需要使用本体audio/die以外的地方的配音,则你无需在characterSubstitute中书写关于此皮肤的信息 - * + * * 如果lib.character[character]不存在,且想引用其他路径的图片素材或阵亡素材,请以[character,[]]的形式写入lib.character.characterSubstitute[name]中,第二个数组填入形式同lib.character[4]的书写形式 - * + * * @param { string | string } */ changeSkin(skill, character) { @@ -7509,7 +7509,7 @@ export class Player extends HTMLDivElement { this.addSkill(skillsToAdd[i], null, true, true); this.additionalSkills[skill].push(skillsToAdd[i]); } - + this.checkConflict(); _status.event.clearStepCache(); return this; @@ -8834,7 +8834,7 @@ export class Player extends HTMLDivElement { } mayHaveShan(viewer, type, ignore, rvt) { /** - * type: skill tag type 'use', 'respond' + * type: skill tag type 'use', 'respond' or object * ignore: ignore cards, ui.selected.cards added * rvt: return value type 'count', 'odds', 'bool'(default) */