调整神华佗结算为官方结算

This commit is contained in:
copcap 2023-11-22 17:24:03 +08:00
parent 1a5cc0c3ba
commit 45f180696e
No known key found for this signature in database
GPG Key ID: 30E7AB6699451AEE
2 changed files with 64 additions and 37 deletions

View File

@ -111,27 +111,42 @@ game.import('character',function(lib,game,ui,get,ai,_status){
['',[lib.skill.wuling.wuqinxi,(item,type,position,noclick,node)=>{ ['',[lib.skill.wuling.wuqinxi,(item,type,position,noclick,node)=>{
node=ui.create.buttonPresets.vcard(item,type,position,noclick); node=ui.create.buttonPresets.vcard(item,type,position,noclick);
node._customintro=[ node._customintro=[
node=>{ node=>`五禽戏:${node.link[2]}`,
return `五禽戏:${node.link[2]}`; node=>lib.skill.wuling.wuqinxiMap[lib.skill.wuling.wuqinxi.indexOf(node.link[2])].slice(2)
},
node=>{
return lib.skill.wuling.wuqinxiMap[lib.skill.wuling.wuqinxi.indexOf(node.link[2])].slice(2);
}
]; ];
return node; return node;
}]] }]]
]); ]);
next.set('processAI',()=>{ next.set('processAI',()=>{
const event=get.event().getParent(),player=event.player,target=event.target; const event=get.event().getParent(),player=event.player,target=event.target;
let first; const spirits=[];
if(get.recoverEffect(target,player,player)>0) first=['鹿','熊'].randomGet(); let nextPlayer=player;
else first='熊'; do{
return [[first].concat(lib.skill.wuling.wuqinxi.slice().remove(first).randomSort()).map(i=>['','',i])]; nextPlayer=nextPlayer.getNext();
if(get.attitude(player,nextPlayer)<0){
spirits.add('熊');
break;
}
}
while(nextPlayer!=target);
if(!spirits.length) spirits.add('猿');
if(get.recoverEffect(target,player,player)>0||target.hasCard(card=>{
return get.effect(target,{
name:card.viewAs||card.name,
cards:[card],
},target,target)<-1;
},'j')) spirits.add('鹿');
const others=lib.skill.wuling.wuqinxi.slice().removeArray(spirits);
do{
others.randomSort();
}
while(others.length>1&&others[0]=='鹿');
return [spirits.concat(others).map(i=>['','',i])];
}) })
'step 1' 'step 1'
var sortedWuqinxi=result.moved[0].map(i=>i[2]); var sortedWuqinxi=result.moved[0].map(i=>i[2]);
game.log(target,'习得的五禽戏顺序为','#g'+sortedWuqinxi.join('、')); game.log(target,'习得的五禽戏顺序为','#g'+sortedWuqinxi.join('、'));
sortedWuqinxi.unshift(sortedWuqinxi.pop()); sortedWuqinxi.unshift(sortedWuqinxi[0]);
target.storage.wuling_wuqinxi=sortedWuqinxi; target.storage.wuling_wuqinxi=sortedWuqinxi;
lib.skill.wuling.updateMark(target); lib.skill.wuling.updateMark(target);
}, },
@ -147,8 +162,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
var wuqinxi=player.storage.wuling_wuqinxi; var wuqinxi=player.storage.wuling_wuqinxi;
if(!wuqinxi) return; if(!wuqinxi) return;
var prevMark=wuqinxi.shift(); var prevMark=wuqinxi.shift();
wuqinxi.push(prevMark); // wuqinxi.push(prevMark);
var curMark=wuqinxi[0]; var curMark=wuqinxi[0];
if(!curMark){
for(var skill in player.additionalSkills){
if(!skill.startsWith('wuling_')) continue;
player.removeAdditionalSkill(skill);
}
game.log(player,'完成了五禽戏的操练');
return;
}
game.log(player,'获得了','#g【'+curMark+'】','标记'); game.log(player,'获得了','#g【'+curMark+'】','标记');
player.markSkill('wuling_wuqinxi'); player.markSkill('wuling_wuqinxi');
game.broadcastAll(function(player,curMark){ game.broadcastAll(function(player,curMark){
@ -178,8 +201,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
dialog.addText(str,false); dialog.addText(str,false);
const str2='<div class="text center">“五禽戏”顺序:<br>'+storage.join(' ')+'</div>'; const str2='<div class="text center">“五禽戏”顺序:<br>'+storage.join(' ')+'</div>';
dialog.addText(str2); dialog.addText(str2);
if(storage.length>1){
const str3=`<div class="text" style="font-size:10px; ">[下一效果] ${wuqinxiMap.find(str=>storage[1]==str[0])}<br></div>`; const str3=`<div class="text" style="font-size:10px; ">[下一效果] ${wuqinxiMap.find(str=>storage[1]==str[0])}<br></div>`;
dialog.add(str3); dialog.add(str3);
}
}, },
}, },
mod:{ mod:{
@ -209,6 +234,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
}, },
forced:true, forced:true,
onremove:true,
content:function(){ content:function(){
'step 0' 'step 0'
var wuqinxi=player.storage.wuling_wuqinxi[0]; var wuqinxi=player.storage.wuling_wuqinxi[0];
@ -259,8 +285,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
ai:{ ai:{
effect:{ effect:{
target:function(card,player,target){ target:function(card,player,target){
var wuqinxi=target.storage.wuling_wuqinxi&&target.storage.wuling_wuqinxi[0]; const wuqinxi=target.storage.wuling_wuqinxi;
if(!wuqinxi||wuqinxi!='熊') return; if(!wuqinxi||!wuqinxi.length) return;
const curWuqinxi=wuqinxi[0];
const nextWuqinxi=wuqinxi[1];
if(nextWuqinxi=='鹿'&&get.type(card)=='delay') return 'zerotarget';
if(curWuqinxi!='熊') return;
if(player.hasSkillTag('jueqing',false,target)) return; if(player.hasSkillTag('jueqing',false,target)) return;
var num=get.tag(card,'damage'); var num=get.tag(card,'damage');
if(num){ if(num){
@ -7845,7 +7875,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
shen_huatuo:'神华佗', shen_huatuo:'神华佗',
shen_huatuo_prefix:'神', shen_huatuo_prefix:'神',
wuling:'五灵', wuling:'五灵',
wuling_info:'①出牌阶段限一次。你可以选择一名没有“五禽戏”的角色,按照你选择的顺序向其传授“五禽戏”,且其获得你选择的第一种“五禽戏”的效果,并在其每个准备阶段切换为下一种。②当你死亡时,你令场上的角色失去你传授的“五禽戏”。', wuling_info:'①出牌阶段限一次。你可以选择一名没有“五禽戏”的角色,按照你选择的顺序向其传授“五禽戏”,且其获得如下效果:其获得你选择的第一种“五禽戏”的效果,并在其每个准备阶段移除当前“五禽戏”的效果并切换为下一种。②当你死亡时,你令场上的角色失去你传授的“五禽戏”。',
wuling_wuqinxi:'五禽戏', wuling_wuqinxi:'五禽戏',
wuling_wuqinxi_info:'<br><li>“五禽戏”分为“虎、鹿、熊、猿、鹤”五个不同的效果:'+ wuling_wuqinxi_info:'<br><li>“五禽戏”分为“虎、鹿、熊、猿、鹤”五个不同的效果:'+
'<br><li>虎:当你使用指定唯一目标的牌对目标角色造成伤害时,此伤害+1。'+ '<br><li>虎:当你使用指定唯一目标的牌对目标角色造成伤害时,此伤害+1。'+

View File

@ -395,7 +395,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
button.classList.remove('selected'); button.classList.remove('selected');
const counterNode=button.querySelector('.caption'); const counterNode=button.querySelector('.caption');
if(counterNode){ if(counterNode){
counterNode.innerText=``; counterNode.childNodes[0].innerHTML=``;
} }
} }
ui.selected.buttons.length=0; ui.selected.buttons.length=0;
@ -410,22 +410,19 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}; };
if(event.isMine()) func(); if(event.isMine()) func();
else if(event.isOnline()) event.player.send(func); else if(event.isOnline()) event.player.send(func);
var result=yield player.chooseButton(['看破:是否记录三个牌名?',[ var result=yield player.chooseButton(['看破:是否记录三个牌名?',[list,'vcard']],[1,3],true).set('ai',function(button){
list,function(item,type,position,noclick,node){
return lib.skill.sbkanpo.$createButton(item,type,position,noclick,node);
}
]],[1,3],true).set('ai',function(button){
switch(button.link[2]){ switch(button.link[2]){
case 'wuxie':return 5+Math.random(); case 'wuxie':return 5+Math.random();
case 'sha':return 5+Math.random(); case 'sha':return 5+Math.random();
case 'tao':return 4+Math.random(); case 'tao':return 4+Math.random();
case 'jiu':return 3+Math.random();
case 'lebu':return 3+Math.random(); case 'lebu':return 3+Math.random();
case 'shan':return 4.5+Math.random(); case 'shan':return 4.5+Math.random();
case 'wuzhong':return 4+Math.random(); case 'wuzhong':return 4+Math.random();
case 'shunshou':return 3+Math.random(); case 'shunshou':return 2.7+Math.random();
case 'nanman':return 2+Math.random(); case 'nanman':return 2+Math.random();
case 'wanjian':return 2+Math.random(); case 'wanjian':return 1.6+Math.random();
default:return Math.random(); default:return 1.5+Math.random();
} }
}).set('filterButton',button=>{ }).set('filterButton',button=>{
return !_status.event.names.includes(button.link[2]); return !_status.event.names.includes(button.link[2]);
@ -439,14 +436,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.uncheck(); game.uncheck();
}, },
button:function(){ button:function(){
if(ui.selected.buttons.length) return;
const event=get.event(); const event=get.event();
if(event.dialog&&event.dialog.buttons){ if(event.dialog&&event.dialog.buttons){
for(let i=0;i<event.dialog.buttons.length;i++){ for(let i=0;i<event.dialog.buttons.length;i++){
const button=event.dialog.buttons[i]; const button=event.dialog.buttons[i];
if(ui.selected.buttons.includes(button)) continue;
const counterNode=button.querySelector('.caption'); const counterNode=button.querySelector('.caption');
if(counterNode){ if(counterNode){
counterNode.innerText=``; counterNode.childNodes[0].innerHTML=``;
} }
} }
} }
@ -464,9 +461,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(ui.selected.buttons.length>=lib.skill.sbkanpo.getNumber) return false; if(ui.selected.buttons.length>=lib.skill.sbkanpo.getNumber) return false;
button.classList.add('selected'); button.classList.add('selected');
ui.selected.buttons.push(button); ui.selected.buttons.push(button);
const counterNode=button.querySelector('.caption'); let counterNode=button.querySelector('.caption');
const count=ui.selected.buttons.filter(i=>i==button).length;
if(counterNode){ if(counterNode){
counterNode.innerHTML=`<span style="font-size:24px; font-family:xinwei; text-shadow:#FFF 0 0 5px;">×${ui.selected.buttons.filter(i=>i==button).length}</span>`; counterNode=counterNode.childNodes[0];
counterNode.innerHTML=`×${count}`;
}
else{
counterNode=ui.create.caption(`<span style="font-size:24px; font-family:xinwei; text-shadow:#FFF 0 0 4px, #FFF 0 0 4px, rgba(74,29,1,1) 0 0 3px;">×${count}</span>`,button);
counterNode.style.right='5px';
counterNode.style.bottom='2px';
} }
const evt=event.parent; const evt=event.parent;
if(evt.controls) evt.controls[0].show(); if(evt.controls) evt.controls[0].show();
@ -480,13 +484,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.markSkill('sbkanpo'); player.markSkill('sbkanpo');
} }
}, },
$createButton:function(item,type,position,noclick,node){
node=ui.create.buttonPresets.vcard(item,type,position,noclick);
const counterNode=ui.create.caption(`<div class="text"></div>`,node);
counterNode.style.right='5px';
counterNode.style.bottom='2px';
return node;
},
marktext:'破', marktext:'破',
intro:{ intro:{
markcount:function(storage,player){ markcount:function(storage,player){