数学孟优高亮

This commit is contained in:
Spmario233 2023-10-09 22:08:53 +08:00
parent 234b8ca3a1
commit 134284390e
5 changed files with 32 additions and 9 deletions

View File

@ -17986,6 +17986,16 @@ game.import('character',function(lib,game,ui,get,ai,_status){
nums.add(current.countCards('j')); nums.add(current.countCards('j'));
}); });
nums.sort((a,b)=>a-b); nums.sort((a,b)=>a-b);
var a=null,b=null,goon=false;
for(a of nums){
for(b of nums){
if((0.5*a*a)+(2.5*b)-game.roundNumber==game.countPlayer()){
goon=true;
break;
}
}
if(goon) break;
}
player.chooseButton(2,[ player.chooseButton(2,[
'蛮智请选择让下列等式成立的A与B的值', '蛮智请选择让下列等式成立的A与B的值',
'<div class="text center">目标等式</div>', '<div class="text center">目标等式</div>',
@ -17994,14 +18004,14 @@ game.import('character',function(lib,game,ui,get,ai,_status){
[nums.map(i=>{ [nums.map(i=>{
return [ return [
`A|${i}`, `A|${i}`,
i.toString(), i==a?(`<span class="yellowtext">${i}</span>`):i,
] ]
}),'tdnodes'], }),'tdnodes'],
'<div class="text center">B的可选值</div>', '<div class="text center">B的可选值</div>',
[nums.map(i=>{ [nums.map(i=>{
return [ return [
`B|${i}`, `B|${i}`,
i.toString(), i==b?(`<span class="yellowtext">${i}</span>`):i,
] ]
}),'tdnodes'], }),'tdnodes'],
]).set('filterButton',function(button){ ]).set('filterButton',function(button){
@ -18009,16 +18019,28 @@ game.import('character',function(lib,game,ui,get,ai,_status){
return button.link[0]!=ui.selected.buttons[0].link[0]; return button.link[0]!=ui.selected.buttons[0].link[0];
}).set('filterOk',function(){ }).set('filterOk',function(){
if(ui.selected.buttons.length!=2) return false; if(ui.selected.buttons.length!=2) return false;
let a,b; var a,b;
for(let i of ui.selected.buttons){ for(var i of ui.selected.buttons){
if(i.link[0]=='A') a=parseInt(i.link.slice(2)); if(i.link[0]=='A') a=parseInt(i.link.slice(2));
else b=parseInt(i.link.slice(2)); else b=parseInt(i.link.slice(2));
} }
return (0.5*a*a)+(2.5*b)-game.roundNumber==game.countPlayer(); return (0.5*a*a)+(2.5*b)-game.roundNumber==game.countPlayer();
}).set('choice',[a,b]).set('ai',(button)=>{
var choice=_status.event.choice;
if(button.link==`A|${choice[0]}`||button.link==`B|${choice[1]}`) return 1;
return 0;
}); });
'step 1' 'step 1'
if(result.bool){ if(result.bool){
var a,b;
for(var i of result.links){
if(i[0]=='A') a=parseInt(i.slice(2));
else b=parseInt(i.slice(2));
}
equals=`0.5×${a}²+2.5×${b}-${game.roundNumber}=${game.countPlayer()}`;
player.logSkill('nsmanzhi'); player.logSkill('nsmanzhi');
player.chat(equals);
game.log(player,'的计算结果为',equals);
player.draw(game.countPlayer()); player.draw(game.countPlayer());
} }
}, },

View File

@ -201,7 +201,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
}, },
chiying:{ chiying:{
trigger:{global:'damageBegin'}, trigger:{global:'damageBegin2'},
check:function(event,player){ check:function(event,player){
return get.attitude(player,event.player)>0; return get.attitude(player,event.player)>0;
}, },
@ -209,7 +209,6 @@ game.import('character',function(lib,game,ui,get,ai,_status){
if(event.num<=1) return false; if(event.num<=1) return false;
return true; return true;
}, },
priority:-11,
content:function(){ content:function(){
trigger.num=1; trigger.num=1;
if(trigger.source){ if(trigger.source){

View File

@ -12165,7 +12165,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
player:"linkBefore", player:"linkBefore",
}, },
forced:true, forced:true,
priority:20, //priority:20,
filter:function(event,player){ filter:function(event,player){
return !player.isLinked(); return !player.isLinked();
}, },
@ -13179,7 +13179,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
cancel:{ cancel:{
trigger:{player:'phaseUseEnd'}, trigger:{player:'phaseUseEnd'},
priority:50, firstDo:true,
silent:true, silent:true,
charlotte:true, charlotte:true,
content:function(){ content:function(){

View File

@ -1976,7 +1976,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}, },
subSkill:{ subSkill:{
skip:{ skip:{
trigger:{player:'phaseBefore'}, trigger:{player:'phaseBeforeStart'},
forced:true, forced:true,
priority:Infinity, priority:Infinity,
popup:false, popup:false,

View File

@ -960,6 +960,7 @@ window.noname_character_rank={
'mengyou', 'mengyou',
're_wenpin', 're_wenpin',
'yue_zhoufei', 'yue_zhoufei',
'ns_mengyou',
], ],
b:[ b:[
'diy_feishi', 'diy_feishi',
@ -1969,6 +1970,7 @@ window.noname_character_rank={
'clan_zhonghui', 'clan_zhonghui',
'zhoubuyi', 'zhoubuyi',
'dc_wangjun', 'dc_wangjun',
'ns_mengyou',
'key_kano', 'key_kano',
'key_haruko', 'key_haruko',
'key_akiko', 'key_akiko',