game.washCard

This commit is contained in:
Spmario233 2023-09-13 19:36:33 +08:00
parent 7caa701806
commit 5f8c320b22
3 changed files with 54 additions and 81 deletions

View File

@ -4305,7 +4305,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
skillAnimation:true, skillAnimation:true,
animationColor:'wood', animationColor:'wood',
onWash:function(){ onWash:function(){
_status.event.getParent('fuzhu').washed=false; _status.event.getParent('fuzhu').washed=true;
return 'remove'; return 'remove';
}, },
content:function(){ content:function(){
@ -4319,19 +4319,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return card.name=='sha'&&player.canUse(card,trigger.player,false); return card.name=='sha'&&player.canUse(card,trigger.player,false);
}); });
if(card){ if(card){
card.remove();
game.updateRoundNumber();
player.useCard(card,trigger.player,false); player.useCard(card,trigger.player,false);
} }
'step 2' 'step 2'
if(event.total>0&&!event.washed&&ui.cardPile.childElementCount<=player.hp*10&&trigger.player.isIn()) event.goto(1); if(event.total>0&&!event.washed&&ui.cardPile.childElementCount<=player.hp*10&&trigger.player.isIn()) event.goto(1);
'step 3' 'step 3'
lib.onwash.remove(lib.skill.fuzhu.onWash); lib.onwash.remove(lib.skill.fuzhu.onWash);
var cards=get.cards(ui.cardPile.childElementCount+1); game.washCard();
for(var i=0;i<cards.length;i++){
ui.cardPile.insertBefore(cards[i],ui.cardPile.childNodes[get.rand(ui.cardPile.childElementCount)]);
}
game.updateRoundNumber();
}, },
ai:{ ai:{
threaten:1.5 threaten:1.5

View File

@ -3057,7 +3057,7 @@
cardtempname:{ cardtempname:{
name:'视为卡牌名称显示', name:'视为卡牌名称显示',
intro:'显示强制视为类卡牌(如武魂),包括拆顺对话框内的判定牌(国色)转换等名称的显示方式', intro:'显示强制视为类卡牌(如武魂),包括拆顺对话框内的判定牌(国色)转换等名称的显示方式',
init:'default', init:'image',
unfrequent:true, unfrequent:true,
item:{ item:{
default:'纵向', default:'纵向',
@ -32412,6 +32412,37 @@
} }
}; };
const game={ const game={
//洗牌
washCard:()=>{
if(_status.maxShuffle!=undefined){
if(_status.maxShuffle==0){
if(_status.maxShuffleCheck){
game.over(_status.maxShuffleCheck());
}
else{
game.over('平局');
}
return [];
}
_status.maxShuffle--;
}
game.shuffleNumber++;
const cards=Array.from(ui.cardPile);
if(_status.discarded){
_status.discarded.length=0;
}
for(let i=0;i<ui.discardPile.childNodes.length;i++){
var currentcard=ui.discardPile.childNodes[i];
currentcard.vanishtag.length=0;
if(get.info(currentcard).vanish||currentcard.storage.vanish){
currentcard.remove();
continue;
}
cards.push(currentcard);
}
cards.randomSort();
game.cardsGotoPile(cards,'triggeronly','washCard')
},
//addGroup //addGroup
//基于钩子的添加势力方法 //基于钩子的添加势力方法
addGroup:(id,short,name,config)=>{ addGroup:(id,short,name,config)=>{
@ -54512,34 +54543,7 @@
if(num<0) num=1; if(num<0) num=1;
while(num--){ while(num--){
if(ui.cardPile.hasChildNodes()==false){ if(ui.cardPile.hasChildNodes()==false){
if(_status.maxShuffle!=undefined){ game.washCard();
if(_status.maxShuffle==0){
if(_status.maxShuffleCheck){
game.over(_status.maxShuffleCheck());
}
else{
game.over('平局');
}
return [];
}
_status.maxShuffle--;
}
game.shuffleNumber++;
var cards=[],i;
if(_status.discarded){
_status.discarded.length=0;
}
for(i=0;i<ui.discardPile.childNodes.length;i++){
var currentcard=ui.discardPile.childNodes[i];
currentcard.vanishtag.length=0;
if(get.info(currentcard).vanish||currentcard.storage.vanish){
currentcard.remove();
continue;
}
cards.push(currentcard);
}
cards.randomSort();
game.cardsGotoPile(cards,'triggeronly','washCard')
} }
if(ui.cardPile.hasChildNodes()==false){ if(ui.cardPile.hasChildNodes()==false){
game.over('平局'); game.over('平局');
@ -56001,34 +56005,7 @@
if(num<0) num=1; if(num<0) num=1;
while(num--){ while(num--){
if(ui.cardPile.hasChildNodes()==false){ if(ui.cardPile.hasChildNodes()==false){
if(_status.maxShuffle!=undefined){ game.washCard();
if(_status.maxShuffle==0){
if(_status.maxShuffleCheck){
game.over(_status.maxShuffleCheck());
}
else{
game.over('平局');
}
return [];
}
_status.maxShuffle--;
}
game.shuffleNumber++;
var cards=[],i;
if(_status.discarded){
_status.discarded.length=0;
}
for(i=0;i<ui.discardPile.childNodes.length;i++){
var currentcard=ui.discardPile.childNodes[i];
currentcard.vanishtag.length=0;
if(get.info(currentcard).vanish||currentcard.storage.vanish){
currentcard.remove();
continue;
}
cards.push(currentcard);
}
cards.randomSort();
game.cardsGotoPile(cards,'triggeronly','washCard')
} }
if(ui.cardPile.hasChildNodes()==false){ if(ui.cardPile.hasChildNodes()==false){
game.over('平局'); game.over('平局');

View File

@ -3149,6 +3149,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
}, },
group:'boss_diting_init', group:'boss_diting_init',
subSkill:{ subSkill:{
init:{
trigger:{ trigger:{
global:'gameStart', global:'gameStart',
player:'enterGame', player:'enterGame',
@ -3166,6 +3167,7 @@ game.import('mode',function(lib,game,ui,get,ai,_status){
} }
if(disables.length>0) player.disableEquip(disables); if(disables.length>0) player.disableEquip(disables);
}, },
}
}, },
}, },
/* /*