为八卦阵、八阵、玲珑等增加freeShan标签用以放行,修复杀ai
This commit is contained in:
parent
74bed7b8a1
commit
04783cdf15
|
@ -155,11 +155,13 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
next.set('useShan',(()=>{
|
next.set('useShan',(()=>{
|
||||||
if(target.hasSkillTag('noShan',null,event)) return false;
|
if(target.hasSkillTag('noShan',null,event)) return false;
|
||||||
if(target.hasSkillTag('useShan',null,event)) return true;
|
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')<event.shanRequired-(event.shanIgnored||0)) return false;
|
if(event.shanRequired>1&&target.mayHaveShan(target,'use',null,'count')<event.shanRequired-(event.shanIgnored||0)) return false;
|
||||||
if(event.baseDamage+event.extraDamage>=target.hp+
|
if(event.baseDamage+event.extraDamage>=target.hp+
|
||||||
((player.hasSkillTag('jueqing',false,target)||target.hasSkill('gangzhi'))?target.hujia:0)) return true;
|
((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;
|
return true;
|
||||||
})());
|
})());
|
||||||
//next.autochoose=lib.filter.autoRespondShan;
|
//next.autochoose=lib.filter.autoRespondShan;
|
||||||
|
@ -394,7 +396,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
useful:(card,i)=>{
|
useful:(card,i)=>{
|
||||||
let player = _status.event.player, basic = [7, 5.1, 2], num = basic[Math.min(2, 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.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;
|
return num;
|
||||||
},
|
},
|
||||||
value:[7,5.1,2],
|
value:[7,5.1,2],
|
||||||
|
@ -2676,6 +2678,18 @@ game.import('card',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
ai:{
|
ai:{
|
||||||
respondShan:true,
|
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:{
|
effect:{
|
||||||
target:function(card,player,target,effect){
|
target:function(card,player,target,effect){
|
||||||
if(target.hasSkillTag('unequip2')) return;
|
if(target.hasSkillTag('unequip2')) return;
|
||||||
|
|
|
@ -2775,7 +2775,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
order:7,
|
order:7,
|
||||||
result:{
|
result:{
|
||||||
target(player,target){
|
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(get.effect(player,{name:'sha'},target,player)>=0) return -1;
|
||||||
if(!player.hasShan()){
|
if(!player.hasShan()){
|
||||||
if(ui.selected.targets.length) return 0;
|
if(ui.selected.targets.length) return 0;
|
||||||
|
|
|
@ -2346,7 +2346,9 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
result:{
|
result:{
|
||||||
target:function(player,target){
|
target:function(player,target){
|
||||||
if(player.getStorage('dclvecheng_xiongluan').includes(target)) return 0;
|
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=>{
|
var hs=player.countCards('h',card=>{
|
||||||
if(!player.canUse(card,target)) return false;
|
if(!player.canUse(card,target)) return false;
|
||||||
return get.name(card)=='sha'&&get.effect(target,card,player,player)>0;
|
return get.name(card)=='sha'&&get.effect(target,card,player,player)>0;
|
||||||
|
|
|
@ -2295,7 +2295,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
direct:true,
|
direct:true,
|
||||||
content:function(){
|
content:function(){
|
||||||
"step 0"
|
"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 att=get.attitude(player,trigger.target);
|
||||||
var next=player.chooseToDiscard(get.prompt('xiandan'));
|
var next=player.chooseToDiscard(get.prompt('xiandan'));
|
||||||
next.ai=function(card){
|
next.ai=function(card){
|
||||||
|
|
|
@ -1389,7 +1389,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
order:13,
|
order:13,
|
||||||
result:{
|
result:{
|
||||||
target:(player,target)=>{
|
target:(player,target)=>{
|
||||||
if(target.getEquip('bagua')||target.getEquip('rewrite_bagua')) return 0;
|
|
||||||
let hs=player.countCards('h',card=>{
|
let hs=player.countCards('h',card=>{
|
||||||
if(!get.tag(card,'damage')||get.effect(target,card,player,player)<=0) return 0;
|
if(!get.tag(card,'damage')||get.effect(target,card,player,player)<=0) return 0;
|
||||||
if(get.name(card,player)==='sha'){
|
if(get.name(card,player)==='sha'){
|
||||||
|
@ -5435,6 +5434,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
ai:{
|
ai:{
|
||||||
respondShan:true,
|
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:{
|
effect:{
|
||||||
target:function(card,player,target){
|
target:function(card,player,target){
|
||||||
if(player==target&&get.subtype(card)=='equip2'){
|
if(player==target&&get.subtype(card)=='equip2'){
|
||||||
|
|
|
@ -2413,9 +2413,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
ai:{
|
ai:{
|
||||||
directHit_ai:true,
|
directHit_ai:true,
|
||||||
skillTagFilter:function(player,tag,arg){
|
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(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,
|
name:arg.card?arg.card.name:null,
|
||||||
target:arg.target,
|
target:arg.target,
|
||||||
card:arg.card
|
card:arg.card
|
||||||
|
|
|
@ -15738,8 +15738,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
if(get.attitude(player,event.player)>=0) return false;
|
if(get.attitude(player,event.player)>=0) return false;
|
||||||
var e2=player.getEquip(2);
|
var e2=player.getEquip(2);
|
||||||
if(e2){
|
if(e2){
|
||||||
if(e2.name=='tengjia') return true;
|
if(e2.name=='tengjia'||e2.name=='rewrite_tengjia') return true;
|
||||||
if(e2.name=='bagua') return true;
|
if(e2.name=='bagua'||e2.name=='rewrite_bagua') return true;
|
||||||
}
|
}
|
||||||
return event.player.countCards('h')>event.player.hp;
|
return event.player.countCards('h')>event.player.hp;
|
||||||
},
|
},
|
||||||
|
@ -20019,6 +20019,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
ai:{
|
ai:{
|
||||||
respondShan:true,
|
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:{
|
effect:{
|
||||||
target:function(card,player,target){
|
target:function(card,player,target){
|
||||||
if(player==target&&get.subtype(card)=='equip2'){
|
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;
|
if(get.attitude(player,event.player)>=0) return false;
|
||||||
var e2=player.getEquip(2);
|
var e2=player.getEquip(2);
|
||||||
if(e2){
|
if(e2){
|
||||||
if(e2.name=='tengjia') return true;
|
if(e2.name=='tengjia'||e2.name=='rewrite_tengjia') return true;
|
||||||
if(e2.name=='bagua') return true;
|
if(e2.name=='bagua'||e2.name=='rewrite_bagua') return true;
|
||||||
}
|
}
|
||||||
return player.countCards('h','shan')>0;
|
return player.countCards('h','shan')>0;
|
||||||
},
|
},
|
||||||
|
|
|
@ -9528,7 +9528,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
direct:true,
|
direct:true,
|
||||||
content:function(){
|
content:function(){
|
||||||
"step 0"
|
"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));
|
var next=player.chooseToDiscard(get.prompt('shoulie',trigger.target));
|
||||||
next.ai=function(card){
|
next.ai=function(card){
|
||||||
if(dis) return 7-get.value(card);
|
if(dis) return 7-get.value(card);
|
||||||
|
|
|
@ -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){
|
player.chooseTarget(get.prompt2('juetao'),lib.filter.notMe).set('ai',function(target){
|
||||||
let att=-get.attitude(_status.event.player,target);
|
let att=-get.attitude(_status.event.player,target);
|
||||||
if(att<=0) return att;
|
if(att<=0) return att;
|
||||||
if(target.hasSkillTag('nodamage')) return 0.01*att;
|
if(target.hasSkillTag('nodamage')||target.getEquip('qimenbagua')) return 0.01*att;
|
||||||
if(target.getEquip('tengjia')||target.getEquip('renwang')) return 0.2*att;
|
if(target.getEquip('tengjia')||target.getEquip('renwang')) return 0.3*att;
|
||||||
if(target.getEquip('bagua')) 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;
|
if(target.getEquip(2)) return att/2;
|
||||||
return 1.2*att;
|
return 1.2*att;
|
||||||
});
|
});
|
||||||
|
|
|
@ -3692,11 +3692,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
ai:{
|
ai:{
|
||||||
directHit_ai:true,
|
directHit_ai:true,
|
||||||
skillTagFilter:function(player,tag,arg){
|
skillTagFilter:function(player,tag,arg){
|
||||||
if(player._zhuandui_temp) return false;
|
if(player._zhuandui_temp||tag!=='directHit_ai') return false;
|
||||||
player._zhuandui_temp=true;
|
player._zhuandui_temp=true;
|
||||||
var bool=function(){
|
var bool=function(){
|
||||||
if(arg.card.name!='sha'||get.attitude(player,arg.target)>=0||!arg.target.countCards('h')) return false;
|
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,
|
name:arg.card?arg.card.name:null,
|
||||||
target:arg.target,
|
target:arg.target,
|
||||||
card:arg.card
|
card:arg.card
|
||||||
|
@ -7254,7 +7257,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
var trigger=_status.event.getTrigger();
|
var trigger=_status.event.getTrigger();
|
||||||
if(att>0&&eff>=0) return 1;
|
if(att>0&&eff>=0) return 1;
|
||||||
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=='lebu'&&nh>trigger.player.hp) return 1;
|
||||||
if(name=='bingliang'&&nh<trigger.player.hp) return 1;
|
if(name=='bingliang'&&nh<trigger.player.hp) return 1;
|
||||||
}
|
}
|
||||||
|
@ -7290,7 +7296,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
var trigger=_status.event.getTrigger();
|
var trigger=_status.event.getTrigger();
|
||||||
if(att>0&&eff>=0) return 1;
|
if(att>0&&eff>=0) return 1;
|
||||||
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=='lebu'&&nh>trigger.player.hp) return 1;
|
||||||
if(name=='bingliang'&&nh<trigger.player.hp) return 1;
|
if(name=='bingliang'&&nh<trigger.player.hp) return 1;
|
||||||
}
|
}
|
||||||
|
@ -9895,8 +9904,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
ai:{
|
ai:{
|
||||||
directHit_ai:true,
|
directHit_ai:true,
|
||||||
skillTagFilter:function(player,tag,arg){
|
skillTagFilter:function(player,tag,arg){
|
||||||
if(!arg.target.hasSkill('qianxi2')) return false;
|
if(tag!=='directHit_ai'||!arg.target.hasSkill('qianxi2')) return false;
|
||||||
if(arg.card.name=='sha') return arg.target.storage.qianxi2=='red'&&(!arg.target.getEquip('bagua')||player.hasSkillTag('unequip',false,{
|
if(arg.card.name=='sha') return arg.target.storage.qianxi2=='red'&&(!arg.target.hasSkillTag('freeShan',false,{
|
||||||
|
player:player,
|
||||||
|
card:arg.card
|
||||||
|
},true)||player.hasSkillTag('unequip',false,{
|
||||||
name:arg.card?arg.card.name:null,
|
name:arg.card?arg.card.name:null,
|
||||||
target:arg.target,
|
target:arg.target,
|
||||||
card:arg.card
|
card:arg.card
|
||||||
|
|
|
@ -1066,7 +1066,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
check:function(event,player){
|
check:function(event,player){
|
||||||
if(get.attitude(player,event.target)>=0) return false;
|
if(get.attitude(player,event.target)>=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;
|
if(event.target.hasSkillTag('respondShan')&&event.target.countCards('h')>=3) return false;
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
@ -2186,7 +2189,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
if(trigger.target.hasSkill('shanguang2')) return 0;
|
if(trigger.target.hasSkill('shanguang2')) return 0;
|
||||||
|
|
||||||
var equip=trigger.target.getEquip(2);
|
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;
|
return trigger.target.countCards('h')<2?0:1;
|
||||||
};
|
};
|
||||||
"step 1"
|
"step 1"
|
||||||
|
|
|
@ -8834,7 +8834,7 @@ export class Player extends HTMLDivElement {
|
||||||
}
|
}
|
||||||
mayHaveShan(viewer, type, ignore, rvt) {
|
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
|
* ignore: ignore cards, ui.selected.cards added
|
||||||
* rvt: return value type 'count', 'odds', 'bool'(default)
|
* rvt: return value type 'count', 'odds', 'bool'(default)
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue