fix bug
This commit is contained in:
1 parent
107c501755
commit
8116240a28
1 file changed
+109
-105
+109
-105
@@ -454,8 +454,8 @@ game.import("extension", function (lib, game, ui, get, ai, _status) {
|
|||||||
|
|
||||||
|
|
||||||
// alert(lib.config.extension_喵喵配件_player_number_33)
|
// alert(lib.config.extension_喵喵配件_player_number_33)
|
||||||
// if(lib.config.extension_喵喵配件_player_number_33){
|
if(lib.config.extension_喵喵配件_player_number_33){
|
||||||
// setTimeout(()=>{
|
// setTimeout(()=>{
|
||||||
Object.defineProperty(lib.mode.identity.config.player_number, "item", {
|
Object.defineProperty(lib.mode.identity.config.player_number, "item", {
|
||||||
get: function () {
|
get: function () {
|
||||||
const minimumNumberOfPlayers=2,maximumNumberOfPlayers=Math.max(_status.maximumNumberOfPlayers||10,minimumNumberOfPlayers,33),item={};
|
const minimumNumberOfPlayers=2,maximumNumberOfPlayers=Math.max(_status.maximumNumberOfPlayers||10,minimumNumberOfPlayers,33),item={};
|
||||||
@@ -465,9 +465,8 @@ game.import("extension", function (lib, game, ui, get, ai, _status) {
|
|||||||
return item;
|
return item;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
// alert(1)
|
// },1000)
|
||||||
// },2000)
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
miao_nodelay = function(){
|
miao_nodelay = function(){
|
||||||
@@ -485,10 +484,9 @@ game.import("extension", function (lib, game, ui, get, ai, _status) {
|
|||||||
},
|
},
|
||||||
intro: "设置不同游戏操作间的时间间隔"
|
intro: "设置不同游戏操作间的时间间隔"
|
||||||
};
|
};
|
||||||
|
|
||||||
//覆写十周年ui与被十周年ui覆写的delay,等1s加载完以后覆写
|
//覆写十周年ui与被十周年ui覆写的delay,等1s加载完以后覆写
|
||||||
if(decadeUI){
|
setTimeout(()=>{
|
||||||
setTimeout(()=>{
|
if(decadeUI){
|
||||||
decadeUI.delay = num =>{}
|
decadeUI.delay = num =>{}
|
||||||
dui.delay = num =>{}
|
dui.delay = num =>{}
|
||||||
game.delay = function (time, time2) {
|
game.delay = function (time, time2) {
|
||||||
@@ -500,9 +498,9 @@ game.import("extension", function (lib, game, ui, get, ai, _status) {
|
|||||||
if (lib.config.game_speed == "vvfast") time /= 3;
|
if (lib.config.game_speed == "vvfast") time /= 3;
|
||||||
if (lib.config.game_speed == "nodelay"){ time = 1}
|
if (lib.config.game_speed == "nodelay"){ time = 1}
|
||||||
_status.timeout = setTimeout(game.resume, time);
|
_status.timeout = setTimeout(game.resume, time);
|
||||||
};
|
}
|
||||||
},2000)
|
};
|
||||||
}
|
},1000)
|
||||||
|
|
||||||
|
|
||||||
game.delayx = function (time, time2) {
|
game.delayx = function (time, time2) {
|
||||||
@@ -551,105 +549,110 @@ game.import("extension", function (lib, game, ui, get, ai, _status) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// alert(2)
|
||||||
|
|
||||||
if (lib.config.extension_喵喵配件_nodelay) {
|
if (lib.config.extension_喵喵配件_nodelay) {
|
||||||
miao_nodelay()
|
miao_nodelay()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// alert(3)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 让ai爱上诸葛连弩
|
// 让ai爱上诸葛连弩
|
||||||
if(false){
|
// if(false){
|
||||||
lib.card['zhuge'] ={
|
// lib.card['zhuge'] ={
|
||||||
fullskin:true,
|
// fullskin:true,
|
||||||
type:"equip",
|
// type:"equip",
|
||||||
subtype:"equip1",
|
// subtype:"equip1",
|
||||||
ai:{
|
// ai:{
|
||||||
order:function(){
|
// order:function(){
|
||||||
return 9999;
|
// return 9999;
|
||||||
return get.order({name:'sha'})-0.1;
|
// return get.order({name:'sha'})-0.1;
|
||||||
},
|
// },
|
||||||
equipValue:function(card,player){
|
// equipValue:function(card,player){
|
||||||
return 9999
|
// return 9999
|
||||||
if(player._zhuge_temp) return 1;
|
// if(player._zhuge_temp) return 1;
|
||||||
player._zhuge_temp=true;
|
// player._zhuge_temp=true;
|
||||||
var result=function(){
|
// var result=function(){
|
||||||
if(!game.hasPlayer(function(current){
|
// if(!game.hasPlayer(function(current){
|
||||||
return get.distance(player,current)<=1&&player.canUse('sha',current)&&get.effect(current,{name:'sha'},player,player)>0;
|
// return get.distance(player,current)<=1&&player.canUse('sha',current)&&get.effect(current,{name:'sha'},player,player)>0;
|
||||||
})){
|
// })){
|
||||||
return 1;
|
// return 1;
|
||||||
}
|
// }
|
||||||
if(player.hasSha()&&_status.currentPhase==player){
|
// if(player.hasSha()&&_status.currentPhase==player){
|
||||||
if(player.getEquip('zhuge')&&player.countUsed('sha')||player.getCardUsable('sha')==0){
|
// if(player.getEquip('zhuge')&&player.countUsed('sha')||player.getCardUsable('sha')==0){
|
||||||
return 10;
|
// return 10;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
var num=player.countCards('h','sha');
|
// var num=player.countCards('h','sha');
|
||||||
if(num>1) return 6+num;
|
// if(num>1) return 6+num;
|
||||||
return 3+num;
|
// return 3+num;
|
||||||
}();
|
// }();
|
||||||
delete player._zhuge_temp;
|
// delete player._zhuge_temp;
|
||||||
return result;
|
// return result;
|
||||||
},
|
// },
|
||||||
basic:{
|
// basic:{
|
||||||
equipValue:100,
|
// equipValue:100,
|
||||||
order:(card,player)=>{
|
// order:(card,player)=>{
|
||||||
const equipValue=get.equipValue(card,player)/20;
|
// const equipValue=get.equipValue(card,player)/20;
|
||||||
return player&&player.hasSkillTag('reverseEquip')?8.5-equipValue:8+equipValue;
|
// return player&&player.hasSkillTag('reverseEquip')?8.5-equipValue:8+equipValue;
|
||||||
},
|
// },
|
||||||
useful:2000,
|
// useful:2000,
|
||||||
value:(card,player,index,method)=>{
|
// value:(card,player,index,method)=>{
|
||||||
return 9999
|
// return 9999
|
||||||
|
|
||||||
//摸牌摸多了自然喜欢诸葛连弩
|
// //摸牌摸多了自然喜欢诸葛连弩
|
||||||
var num=0;
|
// var num=0;
|
||||||
for(j=0;j<player.stat.length;j++){
|
// for(j=0;j<player.stat.length;j++){
|
||||||
if(player.stat[j].gain!=undefined) num+=player.stat[j].gain;
|
// if(player.stat[j].gain!=undefined) num+=player.stat[j].gain;
|
||||||
}
|
// }
|
||||||
// alert(num)
|
// // alert(num)
|
||||||
game.log(num)
|
// game.log(num)
|
||||||
if(num/game.roundNumber > 5)return Infinity;
|
// if(num/game.roundNumber > 5)return Infinity;
|
||||||
|
|
||||||
// if(player.storage._miao_equip_love && player.storage._miao_equip_love['zhuge']){
|
|
||||||
// return Infinity;
|
|
||||||
// }
|
|
||||||
if(!player.getCards('e').contains(card)&&!player.canEquip(card,true)) return 0.01;
|
|
||||||
const info=get.info(card),current=player.getEquip(info.subtype),value=current&&card!=current&&get.value(current,player);
|
|
||||||
let equipValue=info.ai.equipValue||info.ai.basic.equipValue;
|
|
||||||
if(typeof equipValue=='function'){
|
|
||||||
if(method=='raw')return equipValue(card,player);
|
|
||||||
if(method=='raw2')return equipValue(card,player)-value;
|
|
||||||
return Math.max(0.1,equipValue(card,player)-value);
|
|
||||||
}
|
|
||||||
if(typeof equipValue!='number') equipValue=0;
|
|
||||||
if(method=='raw') return equipValue;
|
|
||||||
if(method=='raw2') return equipValue-value;
|
|
||||||
return Math.max(0.1,equipValue-value);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
tag:{
|
|
||||||
valueswap:1,
|
|
||||||
},
|
|
||||||
result:{
|
|
||||||
// target:(player,target,card)=>get.equipResult(player,target,card.name),
|
|
||||||
target:(player,target,card)=>{return 9999},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
skills:["zhuge_skill"],
|
|
||||||
enable:true,
|
|
||||||
selectTarget:-1,
|
|
||||||
filterTarget:(card,player,target)=>player==target&&target.canEquip(card,true),
|
|
||||||
modTarget:true,
|
|
||||||
allowMultiple:false,
|
|
||||||
content:function(){
|
|
||||||
if(cards.length&&get.position(cards[0],true)=='o') target.equip(cards[0]);
|
|
||||||
},
|
|
||||||
toself:true,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// // if(player.storage._miao_equip_love && player.storage._miao_equip_love['zhuge']){
|
||||||
|
// // return Infinity;
|
||||||
|
// // }
|
||||||
|
// if(!player.getCards('e').contains(card)&&!player.canEquip(card,true)) return 0.01;
|
||||||
|
// const info=get.info(card),current=player.getEquip(info.subtype),value=current&&card!=current&&get.value(current,player);
|
||||||
|
// let equipValue=info.ai.equipValue||info.ai.basic.equipValue;
|
||||||
|
// if(typeof equipValue=='function'){
|
||||||
|
// if(method=='raw')return equipValue(card,player);
|
||||||
|
// if(method=='raw2')return equipValue(card,player)-value;
|
||||||
|
// return Math.max(0.1,equipValue(card,player)-value);
|
||||||
|
// }
|
||||||
|
// if(typeof equipValue!='number') equipValue=0;
|
||||||
|
// if(method=='raw') return equipValue;
|
||||||
|
// if(method=='raw2') return equipValue-value;
|
||||||
|
// return Math.max(0.1,equipValue-value);
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// tag:{
|
||||||
|
// valueswap:1,
|
||||||
|
// },
|
||||||
|
// result:{
|
||||||
|
// // target:(player,target,card)=>get.equipResult(player,target,card.name),
|
||||||
|
// target:(player,target,card)=>{return 9999},
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// skills:["zhuge_skill"],
|
||||||
|
// enable:true,
|
||||||
|
// selectTarget:-1,
|
||||||
|
// filterTarget:(card,player,target)=>player==target&&target.canEquip(card,true),
|
||||||
|
// modTarget:true,
|
||||||
|
// allowMultiple:false,
|
||||||
|
// content:function(){
|
||||||
|
// if(cards.length&&get.position(cards[0],true)=='o') target.equip(cards[0]);
|
||||||
|
// },
|
||||||
|
// toself:true,
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// alert(lib.config.extension_喵喵配件_nodeintroFix)
|
||||||
//四字适配
|
//四字适配
|
||||||
if (lib.config.extension_喵喵配件_nodeintroFix) {
|
if (lib.config.extension_喵喵配件_nodeintroFix) {
|
||||||
setTimeout(()=>{
|
// alert()
|
||||||
get.nodeintro = function (node, simple, evt) {
|
get.nodeintro = function (node, simple, evt) {
|
||||||
var uiintro = ui.create.dialog("hidden", "notouchscroll");
|
var uiintro = ui.create.dialog("hidden", "notouchscroll");
|
||||||
if (node.classList.contains("player") && !node.name) {
|
if (node.classList.contains("player") && !node.name) {
|
||||||
@@ -1764,8 +1767,9 @@ game.import("extension", function (lib, game, ui, get, ai, _status) {
|
|||||||
lib.setScroll(uiintro.contentContainer);
|
lib.setScroll(uiintro.contentContainer);
|
||||||
}
|
}
|
||||||
return uiintro;
|
return uiintro;
|
||||||
}},1)
|
}
|
||||||
}
|
}
|
||||||
|
// pn33()
|
||||||
},
|
},
|
||||||
precontent: function () {},
|
precontent: function () {},
|
||||||
help: {},
|
help: {},
|
||||||
@@ -1782,11 +1786,11 @@ game.import("extension", function (lib, game, ui, get, ai, _status) {
|
|||||||
init: true
|
init: true
|
||||||
},
|
},
|
||||||
|
|
||||||
// player_number_33: {
|
player_number_33: {
|
||||||
// name: "人数上限修改",
|
name: "人数上限修改",
|
||||||
// intro: "开启此选项可将人数上限修改为33人",
|
intro: "开启此选项可将人数上限修改为33人",
|
||||||
// init: true
|
init: true
|
||||||
// },
|
},
|
||||||
|
|
||||||
//存在风险
|
//存在风险
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user