This commit is contained in:
copcap 2023-11-09 00:40:08 +08:00
parent de1f7b2073
commit 5980622620
No known key found for this signature in database
GPG Key ID: 9AE7B8AF097EC926
5 changed files with 45 additions and 33 deletions

View File

@ -565,6 +565,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player.chooseTarget(get.prompt2('dcmanzhi'),(card,player,target)=>{
if(player==target) return false;
return !player.hasSkill('dcmanzhi_1')&&target.countCards('he')||!player.hasSkill('dcmanzhi_2')&&target.countCards('hej');
}).set('ai',target=>{
return 1-get.attitude(get.player(),target);
});
'step 1'
if(result.bool){

View File

@ -711,7 +711,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
audio:'twjilun',
inherit:'twjilun',
filter:function(event,player){
return player.hasSkill('twjichou');
return player.hasSkill('twjichou',null,false,false);
},
content:function(){
'step 0'
@ -815,6 +815,8 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return{
type:result.control,
audio:'twjiaohua',
filterCard:()=>false,
selectCard:-1,
filterTarget:true,
content:function(){
'step 0'

View File

@ -2694,7 +2694,12 @@ game.import('character',function(lib,game,ui,get,ai,_status){
trigger.directHit.add(target);
player.chooseToDuiben(target).set('title','谋弈').set('namelist',[
'出阵迎战','拱卫中军','直取敌营','扰阵疲敌'
]);
]).set('ai',button=>{
var source=get.event().getParent().player,target=get.event().getParent().target;
if(!target.countCards('he')&&button.link[2]=='db_def2') return 10;
if(!target.countCards('he')&&get.attitude(target,source)<=0&&button.link[2]=='db_atk1') return 10;
return 1+Math.random();
});
'step 1'
if(result.bool){
if(result.player=='db_def1') player.gainPlayerCard(target,'he',true);
@ -4696,7 +4701,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
forced:true,
locked:false,
filter:function(event,player){
return player.hasSkill('splveying')&&(get.type(event.card)=='trick'&&!get.tag(event.card,'damage'))&&player.countMark('splveying')>1;
return player.hasSkill('splveying',null,false,false)&&(get.type(event.card)=='trick'&&!get.tag(event.card,'damage'))&&player.countMark('splveying')>1;
},
content:function(){
player.removeMark('splveying',2);

View File

@ -1472,7 +1472,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(event.card.name!='sha'||!event.cards||event.cards.length!=1) return false;
var evt=event.getParent('phaseUse');
return evt&&evt.player==player&&player.getHistory('useCard',function(evt2){
return evt2.card.name=='sha'&&evt.cards&&evt.cards.length==1&&evt2.getParent('phaseUse')==evt;
return evt2.card.name=='sha'&&evt2.cards&&evt2.cards.length==1&&evt2.getParent('phaseUse')==evt;
}).indexOf(event)==0;
},
content:function(){

View File

@ -8577,6 +8577,9 @@
else src=`image/${type}/${subfolder}/${name}${ext}`;
}
else src=`image/${name}${ext}`;
this.style.backgroundPositionX='center';
this.style.backgroundSize='cover';
if(type=='character'){
new Promise((resolve,reject)=>{
const image=new Image();
image.src=`${lib.assetURL}${src}`;
@ -8584,8 +8587,6 @@
if(type=='character') image.onerror=reject;
}).then(()=>{
this.setBackgroundImage(src);
this.style.backgroundPositionX='center';
this.style.backgroundSize='cover';
}).catch(()=>new Promise((resolve,reject)=>{
const nameinfo=get.character(name);
const sex=nameinfo[0];
@ -8604,9 +8605,11 @@
image.onerror=reject;
})).then((src)=>{
this.setBackgroundImage(src);
this.style.backgroundPositionX='center';
this.style.backgroundSize='cover';
}));
}
else{
this.setBackgroundImage(src);
}
return this;
}
});