Further fix.

This commit is contained in:
Tipx-L 2023-08-29 02:46:36 -07:00
parent fc285396d7
commit 87e7bcf0e5
3 changed files with 48 additions and 31 deletions

View File

@ -486,7 +486,7 @@ game.import('card',function(lib,game,ui,get,ai,_status){
var yingbianEffectExecuted=false; var yingbianEffectExecuted=false;
lib.yingbian.effect.forEach((value,key)=>{ lib.yingbian.effect.forEach((value,key)=>{
if(!event.temporaryYingbian.includes(key)&&!get.cardtag(card,`yingbian_${key}`)) return; if(!event.temporaryYingbian.includes(key)&&!get.cardtag(card,`yingbian_${key}`)) return;
value(trigger); game.yingbianEffect(trigger,value);
if(!yingbianEffectExecuted) yingbianEffectExecuted=true; if(!yingbianEffectExecuted) yingbianEffectExecuted=true;
}); });
if(!yingbianEffectExecuted){ if(!yingbianEffectExecuted){

View File

@ -2352,16 +2352,18 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
hina_xingzhi:{ hina_xingzhi:{
groupSkill:true, groupSkill:true,
trigger:{player:'useCardBegin'}, trigger:{player:'useCard1'},
usable:1, usable:1,
filter:(event,player)=>player.group=='key', filter:(event,player)=>player.group=='key'&&!event.card.yingbian&&lib.yingbian.condition.complex.has('zhuzhan'),
content:()=>{ content:()=>{
if(!Array.isArray(trigger.temporaryYingbian)) trigger.temporaryYingbian=[]; 'step 0'
trigger.temporaryYingbian.add('zhuzhan'); trigger.afterYingbianZhuzhan=event=>event.zhuzhanresult.draw(2);
trigger.afterYingbianZhuzhan=(event,trigger)=>{ lib.yingbian.condition.complex.get('zhuzhan')(trigger);
event.zhuzhanresult.draw(2); 'step 1'
trigger.temporaryYingbian.addArray(get.yingbianEffects()); if(!result.bool) return;
}; trigger.card.yingbian=true;
lib.yingbian.effect.forEach(value=>game.yingbianEffect(trigger,value));
player.addTempSkill('yingbian_changeTarget');
} }
}, },
yingba:{ yingba:{

View File

@ -29,7 +29,7 @@
} }
} }
} }
var _status={ const _status={
paused:false, paused:false,
paused2:false, paused2:false,
paused3:false, paused3:false,
@ -65,7 +65,7 @@
prehidden_skills:[], prehidden_skills:[],
postReconnect:{}, postReconnect:{},
}; };
var lib={ const lib={
configprefix:'noname_0.9_', configprefix:'noname_0.9_',
versionOL:27, versionOL:27,
updateURLS:{ updateURLS:{
@ -160,7 +160,7 @@
['force','metal'] ['force','metal']
]), ]),
complex:new Map([ complex:new Map([
['zhuzhan',event=>{ ['zhuzhan',function(event){
const yingbianZhuzhan=game.createEvent('yingbianZhuzhan'); const yingbianZhuzhan=game.createEvent('yingbianZhuzhan');
yingbianZhuzhan.player=event.player; yingbianZhuzhan.player=event.player;
yingbianZhuzhan.card=event.card; yingbianZhuzhan.card=event.card;
@ -272,6 +272,7 @@
bool:false bool:false
}; };
}); });
yingbianZhuzhan._args=Array.from(arguments);
return yingbianZhuzhan; return yingbianZhuzhan;
}] }]
]), ]),
@ -282,24 +283,29 @@
]) ])
}, },
effect:new Map([ effect:new Map([
['add',event=>event.yingbian_addTarget=true], ['add',()=>{
['remove',event=>event.yingbian_removeTarget=true], trigger.yingbian_addTarget=true;
['damage',event=>{
if(typeof event.baseDamage!='number') event.baseDamage=1;
event.baseDamage++;
game.log(event.card,'的伤害值基数+1');
}], }],
['draw',event=>event.player.draw()], ['remove',()=>{
['gain',event=>{ trigger.yingbian_removeTarget=true;
const cardx=event.respondTo;
if(cardx&&cardx[1]&&cardx[1].cards&&cardx[1].cards.filterInD('od').length) event.player.gain(cardx[1].cards.filterInD('od'),'gain2','log');
}], }],
['hit',event=>{ ['damage',()=>{
event.directHit.addArray(game.players).addArray(game.dead); if(typeof trigger.baseDamage!='number') trigger.baseDamage=1;
game.log(event.card,'不可被响应'); trigger.baseDamage++;
game.log(card,'的伤害值基数+1');
}], }],
['all',event=>{ ['draw',()=>{
const card=event.card; player.draw();
}],
['gain',()=>{
const cardx=trigger.respondTo;
if(cardx&&cardx[1]&&cardx[1].cards&&cardx[1].cards.filterInD('od').length) player.gain(cardx[1].cards.filterInD('od'),'gain2');
}],
['hit',()=>{
trigger.directHit.addArray(game.players).addArray(game.dead);
game.log(card,'不可被响应');
}],
['all',()=>{
card.yingbian_all=true; card.yingbian_all=true;
game.log(card,'执行所有选项'); game.log(card,'执行所有选项');
}] }]
@ -31554,9 +31560,18 @@
'妹子,交个朋友吧', '妹子,交个朋友吧',
], ],
}; };
var game={ const game={
//Yingbian //Yingbian
//应变 //应变
yingbianEffect:function(event,content){
const yingbianEffect=game.createEvent('yingbianEffect');
yingbianEffect.player=event.player;
yingbianEffect.card=event.card;
yingbianEffect._trigger=event;
yingbianEffect.setContent(content);
yingbianEffect._args=Array.from(arguments);
return yingbianEffect;
},
setYingbianConditionColor:(yingbianCondition,color)=>game.broadcastAll((yingbianCondition,color)=>lib.yingbian.condition.color.set(yingbianCondition,color),yingbianCondition,color), setYingbianConditionColor:(yingbianCondition,color)=>game.broadcastAll((yingbianCondition,color)=>lib.yingbian.condition.color.set(yingbianCondition,color),yingbianCondition,color),
setComplexYingbianCondition:(yingbianCondition,condition)=>game.broadcastAll((yingbianCondition,condition)=>lib.yingbian.condition.complex.set(yingbianCondition,condition),yingbianCondition,condition), setComplexYingbianCondition:(yingbianCondition,condition)=>game.broadcastAll((yingbianCondition,condition)=>lib.yingbian.condition.complex.set(yingbianCondition,condition),yingbianCondition,condition),
setSimpleYingbianCondition:(yingbianCondition,condition)=>game.broadcastAll((yingbianCondition,condition)=>lib.yingbian.condition.simple.set(yingbianCondition,condition),yingbianCondition,condition), setSimpleYingbianCondition:(yingbianCondition,condition)=>game.broadcastAll((yingbianCondition,condition)=>lib.yingbian.condition.simple.set(yingbianCondition,condition),yingbianCondition,condition),
@ -38806,7 +38821,7 @@
shuffleNumber:0, shuffleNumber:0,
}; };
window['b'+'ann'+'e'+'dE'+'x'+'ten'+'s'+'i'+'o'+'ns']=['\u4fa0\u4e49','\u5168\u6559\u7a0b']; window['b'+'ann'+'e'+'dE'+'x'+'ten'+'s'+'i'+'o'+'ns']=['\u4fa0\u4e49','\u5168\u6559\u7a0b'];
var ui={ const ui={
updates:[], updates:[],
thrown:[], thrown:[],
touchlines:[], touchlines:[],
@ -52909,7 +52924,7 @@
ui._recycle[key]=node; ui._recycle[key]=node;
}, },
}; };
var get={ const get={
//Yingbian //Yingbian
//应变 //应变
//Get the Yingbian conditions (of the card) //Get the Yingbian conditions (of the card)
@ -57520,7 +57535,7 @@
return get.attitude(_status.event.player,to); return get.attitude(_status.event.player,to);
}, },
}; };
var ai={ const ai={
basic:{ basic:{
chooseButton:function(check){ chooseButton:function(check){
var event=_status.event; var event=_status.event;