紧急修复锁定技失效bug,部分key武将修改,chooseToDiscard函数增加chooseonly参数
This commit is contained in:
parent
1a2b0c6191
commit
e3cc7775c8
149
character/diy.js
149
character/diy.js
|
@ -1479,30 +1479,27 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
minagi_huanliu:{
|
minagi_huanliu:{
|
||||||
trigger:{player:'phaseZhunbeiBegin'},
|
trigger:{player:'phaseZhunbeiBegin'},
|
||||||
direct:true,
|
async cost(event,trigger,player){
|
||||||
|
event.result = await player.chooseTarget(lib.filter.notMe,get.prompt('minagi_huanliu'),'和一名其他角色进行“协力”,并获得“远野小满”的所有对应技能').set('ai',function(target){
|
||||||
|
return get.threaten(target)*Math.sqrt(1+target.countCards('h'))*((target.isTurnedOver()||target.hasJudge('lebu'))?0.1:1);
|
||||||
|
}).forResult();
|
||||||
|
},
|
||||||
content(){
|
content(){
|
||||||
'step 0'
|
'step 0'
|
||||||
player.chooseTarget(lib.filter.notMe,get.prompt('minagi_huanliu'),'和一名其他角色进行“协力”,并获得“远野小满”的所有对应技能').set('ai',function(target){
|
var target=result.targets[0];
|
||||||
return get.threaten(target)*Math.sqrt(1+target.countCards('h'))*((target.isTurnedOver()||target.hasJudge('lebu'))?0.1:1);
|
player.logSkill('minagi_huanliu',target);
|
||||||
|
player.chooseCooperationFor(target,'minagi_huanliu').set('ai',function(button){
|
||||||
|
var base=0;
|
||||||
|
switch(button.link){
|
||||||
|
case 'cooperation_damage':base=0.1;break;
|
||||||
|
case 'cooperation_draw':base=0.6;break;
|
||||||
|
case 'cooperation_discard':base=0.1;break;
|
||||||
|
case 'cooperation_use':base=0.3;break;
|
||||||
|
}
|
||||||
|
return base+Math.random();
|
||||||
});
|
});
|
||||||
|
player.addAdditionalSkill('cooperation',['minagi_huanliu_effect','michiru_sheyuan']);
|
||||||
'step 1'
|
'step 1'
|
||||||
if(result.bool){
|
|
||||||
var target=result.targets[0];
|
|
||||||
player.logSkill('minagi_huanliu',target);
|
|
||||||
player.chooseCooperationFor(target,'minagi_huanliu').set('ai',function(button){
|
|
||||||
var base=0;
|
|
||||||
switch(button.link){
|
|
||||||
case 'cooperation_damage':base=0.1;break;
|
|
||||||
case 'cooperation_draw':base=0.6;break;
|
|
||||||
case 'cooperation_discard':base=0.1;break;
|
|
||||||
case 'cooperation_use':base=0.3;break;
|
|
||||||
}
|
|
||||||
return base+Math.random();
|
|
||||||
});
|
|
||||||
player.addAdditionalSkill('cooperation',['minagi_huanliu_effect','michiru_sheyuan']);
|
|
||||||
}
|
|
||||||
else event.finish();
|
|
||||||
'step 2'
|
|
||||||
game.delayx();
|
game.delayx();
|
||||||
},
|
},
|
||||||
subSkill:{
|
subSkill:{
|
||||||
|
@ -1671,6 +1668,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
combo:{
|
combo:{
|
||||||
trigger:{global:'useCardAfter'},
|
trigger:{global:'useCardAfter'},
|
||||||
direct:true,
|
direct:true,
|
||||||
|
//chooseToUse类技能暂时没办法改
|
||||||
filter(event,player){
|
filter(event,player){
|
||||||
return event.card.name=='shan'&&player.inRangeOf(event.player)&&player.canUse('sha',event.player,false);
|
return event.card.name=='shan'&&player.inRangeOf(event.player)&&player.canUse('sha',event.player,false);
|
||||||
},
|
},
|
||||||
|
@ -1686,13 +1684,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
tomoyo_zhengfeng:{
|
tomoyo_zhengfeng:{
|
||||||
dutySkill:true,
|
dutySkill:true,
|
||||||
trigger:{player:'phaseZhunbeiBegin'},
|
trigger:{player:'phaseZhunbeiBegin'},
|
||||||
direct:true,
|
|
||||||
filter(event,player){
|
filter(event,player){
|
||||||
return game.hasPlayer((current)=>player.inRange(current));
|
return game.hasPlayer((current)=>player.inRange(current));
|
||||||
},
|
},
|
||||||
content(){
|
async cost(event, trigger, player){
|
||||||
'step 0'
|
event.result = await player.chooseTarget(get.prompt('tomoyo_zhengfeng'),'令一名攻击范围内的角色进行判定。其于你的下回合开始前使用与判定结果颜色相同的牌时,你摸一张牌。',function(card,player,target){
|
||||||
player.chooseTarget(get.prompt('tomoyo_zhengfeng'),'令一名攻击范围内的角色进行判定。其于你的下回合开始前使用与判定结果颜色相同的牌时,你摸一张牌。',function(card,player,target){
|
|
||||||
return player.inRange(target);
|
return player.inRange(target);
|
||||||
}).set('ai',function(target){
|
}).set('ai',function(target){
|
||||||
var player=_status.event.player;
|
var player=_status.event.player;
|
||||||
|
@ -1700,15 +1696,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
var hs=target.countCards('h'),thr=get.threaten(target);
|
var hs=target.countCards('h'),thr=get.threaten(target);
|
||||||
if(target.hasJudge('lebu')) return 0;
|
if(target.hasJudge('lebu')) return 0;
|
||||||
return Math.sqrt(1+hs)*Math.sqrt(Math.max(1,1+thr));
|
return Math.sqrt(1+hs)*Math.sqrt(Math.max(1,1+thr));
|
||||||
});
|
}).forResult()
|
||||||
|
},
|
||||||
|
content(){
|
||||||
|
'step 0'
|
||||||
|
var target = targets[0];
|
||||||
|
event.target = target;
|
||||||
|
target.judge();
|
||||||
'step 1'
|
'step 1'
|
||||||
if(result.bool){
|
|
||||||
var target=result.targets[0];
|
|
||||||
event.target=target;
|
|
||||||
player.logSkill('tomoyo_zhengfeng',target);
|
|
||||||
target.judge();
|
|
||||||
}
|
|
||||||
'step 2'
|
|
||||||
player.addTempSkill('tomoyo_zhengfeng_tomoyo',{player:'phaseBeginStart'});
|
player.addTempSkill('tomoyo_zhengfeng_tomoyo',{player:'phaseBeginStart'});
|
||||||
player.markAuto('tomoyo_zhengfeng_tomoyo',[{
|
player.markAuto('tomoyo_zhengfeng_tomoyo',[{
|
||||||
target:target,
|
target:target,
|
||||||
|
@ -1852,22 +1847,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
return evt.getParent('phaseUse')==event;
|
return evt.getParent('phaseUse')==event;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
direct:true,
|
async cost(event, trigger, player){
|
||||||
content(){
|
const history=player.getHistory('useCard',function(evt){
|
||||||
'step 0'
|
|
||||||
var history=player.getHistory('useCard',function(evt){
|
|
||||||
var type=get.type(evt.card);
|
var type=get.type(evt.card);
|
||||||
if(type!='basic'&&type!='trick') return false;
|
if(type!='basic'&&type!='trick') return false;
|
||||||
return evt.getParent('phaseUse')==trigger;
|
return evt.getParent('phaseUse')==trigger;
|
||||||
});
|
});
|
||||||
var list=[];
|
const list=[];
|
||||||
event.list=list;
|
|
||||||
for(var i=0;i<Math.min(history.length,3);i++){
|
for(var i=0;i<Math.min(history.length,3);i++){
|
||||||
var card=history[i].card;
|
var card=history[i].card;
|
||||||
list.push({name:card.name,isCard:true});
|
list.push({name:card.name,isCard:true});
|
||||||
if(card.nature) list[i].nature=card.nature;
|
if(card.nature) list[i].nature=card.nature;
|
||||||
}
|
}
|
||||||
player.chooseTarget(
|
const {result} = await player.chooseTarget(
|
||||||
get.prompt('kiyu_rexianyu'),
|
get.prompt('kiyu_rexianyu'),
|
||||||
'将以下使用结果告知于一名其他角色:'+get.translation(list),
|
'将以下使用结果告知于一名其他角色:'+get.translation(list),
|
||||||
function(card,player,target){
|
function(card,player,target){
|
||||||
|
@ -1876,20 +1868,25 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
).set('ai',function(target){
|
).set('ai',function(target){
|
||||||
return get.attitude(_status.event.player,target)*get.threaten(target)*Math.sqrt(1+target.countCards('h'))*((target.isTurnedOver()||target.hasJudge('lebu'))?0.1:1);
|
return get.attitude(_status.event.player,target)*get.threaten(target)*Math.sqrt(1+target.countCards('h'))*((target.isTurnedOver()||target.hasJudge('lebu'))?0.1:1);
|
||||||
});
|
});
|
||||||
'step 1'
|
|
||||||
if(result.bool){
|
if(result.bool){
|
||||||
player.addTempSkill('kiyu_rexianyu_round','roundStart');
|
event.result = {
|
||||||
var tabito=result.targets[0];
|
bool: result.bool,
|
||||||
player.logSkill('kiyu_rexianyu',tabito);
|
targets: result.targets,
|
||||||
game.delayx();
|
cost_data: {list},
|
||||||
tabito.storage.kiyu_rexianyu_lastrun=event.list;
|
}
|
||||||
tabito.storage.amamiya_kiyu=player;
|
|
||||||
tabito.addTempSkill('kiyu_rexianyu_lastrun',{
|
|
||||||
player:['phaseUseAfter'],
|
|
||||||
global:['roundStart'],
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async content(event, trigger, player){
|
||||||
|
player.addTempSkill('kiyu_rexianyu_round','roundStart');
|
||||||
|
const tabito = targets[0];
|
||||||
|
tabito.storage.kiyu_rexianyu_lastrun = event.cost_data.list;
|
||||||
|
tabito.storage.amamiya_kiyu = player;
|
||||||
|
tabito.addTempSkill('kiyu_rexianyu_lastrun',{
|
||||||
|
player:['phaseUseAfter'],
|
||||||
|
global:['roundStart'],
|
||||||
|
});
|
||||||
|
game.asyncDelayx();
|
||||||
|
},
|
||||||
subSkill:{
|
subSkill:{
|
||||||
round:{charlotte:true},
|
round:{charlotte:true},
|
||||||
lastrun:{
|
lastrun:{
|
||||||
|
@ -2364,18 +2361,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
},
|
},
|
||||||
nshanlang:{
|
nshanlang:{
|
||||||
trigger:{player:'phaseZhunbeiBegin'},
|
trigger:{player:'phaseZhunbeiBegin'},
|
||||||
direct:true,
|
|
||||||
filter(event,player){
|
filter(event,player){
|
||||||
return player.countCards('h')>0&&game.hasPlayer(
|
return player.countCards('h')>0&&game.hasPlayer(
|
||||||
(current)=>player!=current&&player.canCompare(current)
|
(current)=>player!=current&&player.canCompare(current)
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
content(){
|
async cost(event, trigger, player){
|
||||||
'step 0'
|
const goon=player.hasCard(function(card){
|
||||||
var goon=player.hasCard(function(card){
|
|
||||||
return get.value(card)<=7;
|
return get.value(card)<=7;
|
||||||
},'h');
|
},'h');
|
||||||
player.chooseTarget([1,3],get.prompt('nshanlang'),'和至多三名角色进行拼点',function(card,player,target){
|
event.result = await player.chooseTarget([1,3],get.prompt('nshanlang'),'和至多三名角色进行拼点',function(card,player,target){
|
||||||
return target!=player&&player.canCompare(target);
|
return target!=player&&player.canCompare(target);
|
||||||
}).set('ai',function(target){
|
}).set('ai',function(target){
|
||||||
if(!_status.event.goon) return false;
|
if(!_status.event.goon) return false;
|
||||||
|
@ -2383,21 +2378,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
if(att>=0) return 0;
|
if(att>=0) return 0;
|
||||||
if(target.hasSkillTag('noh')) att/=3;
|
if(target.hasSkillTag('noh')) att/=3;
|
||||||
return -att/Math.sqrt(target.countCards('h'));
|
return -att/Math.sqrt(target.countCards('h'));
|
||||||
}).set('goon',goon);
|
}).set('goon',goon).forResult();
|
||||||
|
},
|
||||||
|
content(){
|
||||||
|
'step 0'
|
||||||
|
event.max_num=0;
|
||||||
|
targets.sortBySeat();
|
||||||
|
player.chooseToCompare(targets).callback=lib.skill.nshanlang.callback;
|
||||||
'step 1'
|
'step 1'
|
||||||
if(result.bool){
|
|
||||||
event.max_num=0;
|
|
||||||
var targets=result.targets.sortBySeat();
|
|
||||||
player.logSkill('nshanlang',targets);
|
|
||||||
player.chooseToCompare(targets).callback=lib.skill.nshanlang.callback;
|
|
||||||
}
|
|
||||||
else event.finish();
|
|
||||||
'step 2'
|
|
||||||
if(event.target){
|
if(event.target){
|
||||||
player.chooseBool('是否令'+get.translation(target)+'获得一张牌?').set('goon',get.attitude(player,target)>0).set('ai',()=>_status.event.goon);
|
player.chooseBool('是否令'+get.translation(target)+'获得一张牌?').set('goon',get.attitude(player,target)>0).set('ai',()=>_status.event.goon);
|
||||||
}
|
}
|
||||||
else event.finish();
|
else event.finish();
|
||||||
'step 3'
|
'step 2'
|
||||||
if(result.bool){
|
if(result.bool){
|
||||||
var card=get.cardPile2(function(card){
|
var card=get.cardPile2(function(card){
|
||||||
return !lib.skill.nsxingyun.getSixiang(card);
|
return !lib.skill.nsxingyun.getSixiang(card);
|
||||||
|
@ -2446,7 +2439,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
effect:{
|
effect:{
|
||||||
trigger:{player:'phaseDiscardEnd'},
|
trigger:{player:'phaseDiscardEnd'},
|
||||||
charlotte:true,
|
charlotte:true,
|
||||||
direct:true,
|
popup:false,
|
||||||
filter(event,player){
|
filter(event,player){
|
||||||
return player.hasHistory('lose',function(evt){
|
return player.hasHistory('lose',function(evt){
|
||||||
if(evt.type!='discard'||evt.getParent('phaseDiscard')!=event) return false;
|
if(evt.type!='discard'||evt.getParent('phaseDiscard')!=event) return false;
|
||||||
|
@ -2675,19 +2668,17 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
nsshizui:{
|
nsshizui:{
|
||||||
trigger:{target:'useCardToTargeted'},
|
trigger:{target:'useCardToTargeted'},
|
||||||
usable:1,
|
usable:1,
|
||||||
direct:true,
|
|
||||||
filter(event,player){
|
filter(event,player){
|
||||||
var type=get.type(event.card,null,false);
|
var type=get.type(event.card,null,false);
|
||||||
return (type=='basic'||type=='trick')&&player.countCards('he')>0&&player.hasUseTarget({name:'jiu'},null,true);
|
return (type=='basic'||type=='trick')&&player.countCards('he')>0&&player.hasUseTarget({name:'jiu'},null,true);
|
||||||
},
|
},
|
||||||
content(){
|
async cost(event,trigger,player){
|
||||||
'step 0'
|
|
||||||
var suit=get.suit(trigger.card),cards=trigger.cards.filterInD();
|
var suit=get.suit(trigger.card),cards=trigger.cards.filterInD();
|
||||||
var str='弃置一张牌并视为使用一张【酒】';
|
var str='弃置一张牌并视为使用一张【酒】';
|
||||||
if(lib.suit.includes(suit)) str+=(';若弃置'+get.translation(suit)+'牌,则'+get.translation(trigger.card)+'对你无效');
|
if(lib.suit.includes(suit)) str+=(';若弃置'+get.translation(suit)+'牌,则'+get.translation(trigger.card)+'对你无效');
|
||||||
if(cards.length) str+=(';若弃置♣牌则获得'+get.translation(cards));
|
if(cards.length) str+=(';若弃置♣牌则获得'+get.translation(cards));
|
||||||
str+='。';
|
str+='。';
|
||||||
var next=player.chooseToDiscard('he',get.prompt('nsshizui'),str);
|
var next=player.chooseToDiscard('he', get.prompt('nsshizui'), str, 'chooseonly');
|
||||||
next.set('val1',cards.length?get.value(cards,player):0);
|
next.set('val1',cards.length?get.value(cards,player):0);
|
||||||
next.set('val2',-get.effect(player,trigger.card,trigger.player,player));
|
next.set('val2',-get.effect(player,trigger.card,trigger.player,player));
|
||||||
next.set('suit',suit);
|
next.set('suit',suit);
|
||||||
|
@ -2696,17 +2687,15 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
if(suit=='club') base+=_status.event.val1;
|
if(suit=='club') base+=_status.event.val1;
|
||||||
if(suit==_status.event.suit) base+=_status.event.val2;
|
if(suit==_status.event.suit) base+=_status.event.val2;
|
||||||
return base-get.value(card);
|
return base-get.value(card);
|
||||||
}).logSkill='nsshizui';
|
});
|
||||||
|
event.result = await next.forResult();
|
||||||
|
},
|
||||||
|
content(){
|
||||||
|
'step 0'
|
||||||
|
event.suit1=get.suit(cards[0],player);
|
||||||
|
player.discard(cards);
|
||||||
|
player.chooseUseTarget('jiu',true);
|
||||||
'step 1'
|
'step 1'
|
||||||
if(result.bool){
|
|
||||||
event.suit1=get.suit(result.cards[0],player);
|
|
||||||
player.chooseUseTarget('jiu',true);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
player.storage.counttrigger.nsshizui--;
|
|
||||||
event.finish();
|
|
||||||
}
|
|
||||||
'step 2'
|
|
||||||
var suit1=event.suit1,suit2=get.suit(trigger.card,false);
|
var suit1=event.suit1,suit2=get.suit(trigger.card,false);
|
||||||
if(suit1==suit2&&lib.suit.includes(suit1)) trigger.excluded.add(player);
|
if(suit1==suit2&&lib.suit.includes(suit1)) trigger.excluded.add(player);
|
||||||
if(suit1=='club'){
|
if(suit1=='club'){
|
||||||
|
|
|
@ -2176,10 +2176,10 @@ export const Content = {
|
||||||
event.doing.doneList.push(event.current);
|
event.doing.doneList.push(event.current);
|
||||||
event.doing.todoList.remove(event.current);
|
event.doing.todoList.remove(event.current);
|
||||||
const result = await game.createTrigger(event.triggername, event.current.skill, event.current.player, trigger, event.current.indexedData).forResult();
|
const result = await game.createTrigger(event.triggername, event.current.skill, event.current.player, trigger, event.current.indexedData).forResult();
|
||||||
if (result === 'cancelled'){
|
if (get.itemtype(event.doing.player) === 'player' && result === 'cancelled'){
|
||||||
for (let i = 0; i < event.doing.todoList.length; i++) {
|
for (let i = 0; i < event.doing.todoList.length; i++) {
|
||||||
if (event.current.skill === event.doing.todoList[i].skill) {
|
if (event.current.skill === event.doing.todoList[i].skill) {
|
||||||
event.doing.todoList.splice(i--, 1);
|
event.doing.doneList.push(event.doing.todoList.splice(i--, 1)[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2209,7 +2209,10 @@ export const Content = {
|
||||||
"step 1";
|
"step 1";
|
||||||
if (event.cancelled) return event.finish();
|
if (event.cancelled) return event.finish();
|
||||||
var info = get.info(event.skill);
|
var info = get.info(event.skill);
|
||||||
if (event.revealed || info.forced) return;
|
if (event.revealed || info.forced) {
|
||||||
|
event._result = { bool: true };
|
||||||
|
return;
|
||||||
|
}
|
||||||
const checkFrequent = function (info) {
|
const checkFrequent = function (info) {
|
||||||
if (player.hasSkillTag('nofrequent', false, event.skill)) return false;
|
if (player.hasSkillTag('nofrequent', false, event.skill)) return false;
|
||||||
if (typeof info.frequent == 'boolean') return info.frequent;
|
if (typeof info.frequent == 'boolean') return info.frequent;
|
||||||
|
@ -3760,7 +3763,7 @@ export const Content = {
|
||||||
player.logSkill.apply(player, event.logSkill);
|
player.logSkill.apply(player, event.logSkill);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!game.online) {
|
if (!game.online && !event.chooseonly) {
|
||||||
if (typeof event.delay == 'boolean') {
|
if (typeof event.delay == 'boolean') {
|
||||||
event.done = player.discard(event.result.cards).set('delay', event.delay);
|
event.done = player.discard(event.result.cards).set('delay', event.delay);
|
||||||
}
|
}
|
||||||
|
|
|
@ -791,7 +791,7 @@ export class GameEvent {
|
||||||
|
|
||||||
const info = lib.skill[skill];
|
const info = lib.skill[skill];
|
||||||
const list = info.firstDo ? firstDo.todoList : info.lastDo ? lastDo.todoList : this.todoList;
|
const list = info.firstDo ? firstDo.todoList : info.lastDo ? lastDo.todoList : this.todoList;
|
||||||
if(info.getIndex){
|
if (typeof info.getIndex === 'function') {
|
||||||
const indexedResult = info.getIndex(event, player, name);
|
const indexedResult = info.getIndex(event, player, name);
|
||||||
if(Array.isArray(indexedResult)){
|
if(Array.isArray(indexedResult)){
|
||||||
indexedResult.forEach(indexedData => {
|
indexedResult.forEach(indexedData => {
|
||||||
|
|
|
@ -4188,7 +4188,8 @@ export class Player extends HTMLDivElement {
|
||||||
next.filterCard = get.filter(arguments[i]);
|
next.filterCard = get.filter(arguments[i]);
|
||||||
}
|
}
|
||||||
else if (typeof arguments[i] == 'string') {
|
else if (typeof arguments[i] == 'string') {
|
||||||
get.evtprompt(next, arguments[i]);
|
if (arguments[i]=='chooseonly') next.chooseonly=true;
|
||||||
|
else get.evtprompt(next, arguments[i]);
|
||||||
}
|
}
|
||||||
if (arguments[i] === null) {
|
if (arguments[i] === null) {
|
||||||
for (var i = 0; i < arguments.length; i++) {
|
for (var i = 0; i < arguments.length; i++) {
|
||||||
|
|
Loading…
Reference in New Issue