Merge pull request #888 from PZ157/PR-Branch
临时修复get.value, get.order等函数,其他AI修复和优化
This commit is contained in:
commit
c8f9a9f5dc
|
@ -4372,7 +4372,10 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
prompt:(event)=>('是否将【兵粮寸断】转移给'+get.translation(event.player)+'?'),
|
prompt:(event)=>('是否将【兵粮寸断】转移给'+get.translation(event.player)+'?'),
|
||||||
check(event,player){
|
check(event,player){
|
||||||
return player.hasCard(card=>{
|
return player.hasCard(card=>{
|
||||||
return (card.viewAs||card.name)=='bingliang'&&event.player.canAddJudge(card)&&get.effect(event.player,card,player,player)>=0;
|
return (card.viewAs||card.name)=='bingliang'&&event.player.canAddJudge(card)&&get.effect(event.player,new lib.element.VCard({
|
||||||
|
name:'bingliang',
|
||||||
|
cards:[card]
|
||||||
|
}),player,_status.event.player)>=0;
|
||||||
},'j');
|
},'j');
|
||||||
},
|
},
|
||||||
content(){
|
content(){
|
||||||
|
|
|
@ -1585,7 +1585,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
player.logSkill('dcmanzhi',target);
|
player.logSkill('dcmanzhi',target);
|
||||||
if(result.control=='选项一'){
|
if(result.control=='选项一'){
|
||||||
player.addTempSkill('dcmanzhi_1');
|
player.addTempSkill('dcmanzhi_1');
|
||||||
target.chooseCard(2,'he','蛮智:请交给'+get.translation(player)+'两张牌');
|
target.chooseCard(2,'he','蛮智:请交给'+get.translation(player)+'两张牌',true);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
player.addTempSkill('dcmanzhi_2');
|
player.addTempSkill('dcmanzhi_2');
|
||||||
|
|
|
@ -4437,6 +4437,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
var target=result.targets[0];
|
var target=result.targets[0];
|
||||||
event.target=target;
|
event.target=target;
|
||||||
player.logSkill('nsfeixiong',target);
|
player.logSkill('nsfeixiong',target);
|
||||||
|
if(get.mode()!=='identity'||player.identity!=='nei') player.addExpose(0.2);
|
||||||
player.chooseToCompare(target);
|
player.chooseToCompare(target);
|
||||||
}
|
}
|
||||||
else event.finish();
|
else event.finish();
|
||||||
|
|
|
@ -2897,7 +2897,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
global:'useCardToPlayered',
|
global:'useCardToPlayered',
|
||||||
},
|
},
|
||||||
filter:function(event,player){
|
filter:function(event,player){
|
||||||
return event.isFirstTarget&&event.targets.length>player.getHp();
|
return event.isFirstTarget&&event.targets.length>=player.getHp();
|
||||||
},
|
},
|
||||||
direct:true,
|
direct:true,
|
||||||
usable:1,
|
usable:1,
|
||||||
|
@ -10770,6 +10770,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
'step 2'
|
'step 2'
|
||||||
if(result.bool){
|
if(result.bool){
|
||||||
target.line(player);
|
target.line(player);
|
||||||
|
if(player!==target&&(get.mode()!=='identity'||target.identity!=='nei')) target.addExpose(0.15);
|
||||||
player.draw();
|
player.draw();
|
||||||
}
|
}
|
||||||
if(num<targets.length) event.goto(1);
|
if(num<targets.length) event.goto(1);
|
||||||
|
@ -10784,6 +10785,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
if(result.bool){
|
if(result.bool){
|
||||||
var target=result.targets[0];
|
var target=result.targets[0];
|
||||||
player.line(target,'green');
|
player.line(target,'green');
|
||||||
|
if(get.mode()!=='identity'||player.identity!=='nei') player.addExpose(0.15);
|
||||||
target.damage();
|
target.damage();
|
||||||
}
|
}
|
||||||
else event.finish();
|
else event.finish();
|
||||||
|
@ -10798,6 +10800,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
if(result.bool){
|
if(result.bool){
|
||||||
var target=result.targets[0];
|
var target=result.targets[0];
|
||||||
player.line(target);
|
player.line(target);
|
||||||
|
if(player!==target&&(get.mode()!=='identity'||player.identity!=='nei')) player.addExpose(0.1);
|
||||||
target.draw();
|
target.draw();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -26975,7 +26978,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
|
||||||
olweifu:'威抚',
|
olweifu:'威抚',
|
||||||
olweifu_info:'出牌阶段,你可以弃置一张牌并判定。你本回合下次使用与结果类型相同的牌无距离限制,且可以额外指定一个目标。若你弃置的牌与判定牌类型相同,你摸一张牌。',
|
olweifu_info:'出牌阶段,你可以弃置一张牌并判定。你本回合下次使用与结果类型相同的牌无距离限制,且可以额外指定一个目标。若你弃置的牌与判定牌类型相同,你摸一张牌。',
|
||||||
olkuansai:'款塞',
|
olkuansai:'款塞',
|
||||||
olkuansai_info:'每回合限一次,当一张牌指定第一个目标后,若目标数大于你的体力值,你可以令其中一个目标选择一项:1.交给你一张牌;2.令你回复1点体力。',
|
olkuansai_info:'每回合限一次,当一张牌指定第一个目标后,若目标数不小于你的体力值,你可以令其中一个目标选择一项:1.交给你一张牌;2.令你回复1点体力。',
|
||||||
ol_luyusheng:'OL陆郁生',
|
ol_luyusheng:'OL陆郁生',
|
||||||
ol_luyusheng_prefix:'OL',
|
ol_luyusheng_prefix:'OL',
|
||||||
olcangxin:'藏心',
|
olcangxin:'藏心',
|
||||||
|
|
|
@ -159,9 +159,9 @@ export class Get extends Uninstantable {
|
||||||
* 获取一张装备牌实际占用的装备栏(君曹操六龙)
|
* 获取一张装备牌实际占用的装备栏(君曹操六龙)
|
||||||
*
|
*
|
||||||
* 用法同{@link subtype},返回数组
|
* 用法同{@link subtype},返回数组
|
||||||
*
|
*
|
||||||
* @param { string | Card | VCard | CardBaseUIData } obj
|
* @param { string | Card | VCard | CardBaseUIData } obj
|
||||||
* @param { false | Player } [player]
|
* @param { false | Player } [player]
|
||||||
* @returns { string[] }
|
* @returns { string[] }
|
||||||
*/
|
*/
|
||||||
static subtypes(obj, player) {
|
static subtypes(obj, player) {
|
||||||
|
@ -266,8 +266,8 @@ export class Get extends Uninstantable {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param { string } skill
|
* @param { string } skill
|
||||||
* @param { Player } player
|
* @param { Player } player
|
||||||
* @returns { string[] }
|
* @returns { string[] }
|
||||||
*/
|
*/
|
||||||
static skillCategoriesOf(skill, player) {
|
static skillCategoriesOf(skill, player) {
|
||||||
|
@ -1726,9 +1726,9 @@ export class Get extends Uninstantable {
|
||||||
}
|
}
|
||||||
static type2(card, player) { return get.type(card, 'trick', player); }
|
static type2(card, player) { return get.type(card, 'trick', player); }
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param { string | Card | VCard | CardBaseUIData } obj
|
* @param { string | Card | VCard | CardBaseUIData } obj
|
||||||
* @param { false | Player } [player]
|
* @param { false | Player } [player]
|
||||||
* @returns { string }
|
* @returns { string }
|
||||||
*/
|
*/
|
||||||
static subtype(obj, player) {
|
static subtype(obj, player) {
|
||||||
|
@ -1986,12 +1986,12 @@ export class Get extends Uninstantable {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @overload
|
* @overload
|
||||||
* @param { string } item
|
* @param { string } item
|
||||||
* @returns { Skill }
|
* @returns { Skill }
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* @overload
|
* @overload
|
||||||
* @param { Card | VCard | CardBaseUIData } item
|
* @param { Card | VCard | CardBaseUIData } item
|
||||||
* @param { Player | false } [player]
|
* @param { Player | false } [player]
|
||||||
* @returns { any }
|
* @returns { any }
|
||||||
*/
|
*/
|
||||||
|
@ -2270,7 +2270,7 @@ export class Get extends Uninstantable {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 遍历子元素
|
* 遍历子元素
|
||||||
* @param {HTMLElement} node
|
* @param {HTMLElement} node
|
||||||
* @returns {Iterable<HTMLElement>} 迭代器
|
* @returns {Iterable<HTMLElement>} 迭代器
|
||||||
*/
|
*/
|
||||||
static *iterableChildNodes(node){
|
static *iterableChildNodes(node){
|
||||||
|
@ -4093,8 +4093,6 @@ export class Get extends Uninstantable {
|
||||||
if (aii && aii.value) value = aii.value;
|
if (aii && aii.value) value = aii.value;
|
||||||
else if (aii && aii.basic) value = aii.basic.value;
|
else if (aii && aii.basic) value = aii.basic.value;
|
||||||
if (player == undefined || get.itemtype(player) != 'player') player = _status.event.player;
|
if (player == undefined || get.itemtype(player) != 'player') player = _status.event.player;
|
||||||
let cache = CacheContext.requireCacheContext();
|
|
||||||
player = cache.delegate(player);
|
|
||||||
var geti = function () {
|
var geti = function () {
|
||||||
return player.getCardIndex('hs',card.name,card,5);
|
return player.getCardIndex('hs',card.name,card,5);
|
||||||
};
|
};
|
||||||
|
@ -4105,7 +4103,7 @@ export class Get extends Uninstantable {
|
||||||
if (Array.isArray(value)) {
|
if (Array.isArray(value)) {
|
||||||
if (method == 'raw') result = value[0];
|
if (method == 'raw') result = value[0];
|
||||||
var num = geti();
|
var num = geti();
|
||||||
if (num < value.length) result = value[num];
|
if (num < value.length) result = value[Math.max(0,num)];
|
||||||
else result = value[value.length - 1];
|
else result = value[value.length - 1];
|
||||||
}
|
}
|
||||||
result = game.checkMod(player, card, result, 'aiValue', player);
|
result = game.checkMod(player, card, result, 'aiValue', player);
|
||||||
|
@ -4186,10 +4184,10 @@ export class Get extends Uninstantable {
|
||||||
if (order == undefined) return -1;
|
if (order == undefined) return -1;
|
||||||
var num = order;
|
var num = order;
|
||||||
if (typeof (order) == 'function') {
|
if (typeof (order) == 'function') {
|
||||||
num = order(item, cache.delegate(_status.event.player));
|
num = order(item, _status.event.player);
|
||||||
}
|
}
|
||||||
if (typeof item == 'object' && _status.event.player) {
|
if (typeof item == 'object' && _status.event.player) {
|
||||||
var player = cache.delegate(_status.event.player);
|
var player = _status.event.player;
|
||||||
num = game.checkMod(player, item, num, 'aiOrder', player);
|
num = game.checkMod(player, item, num, 'aiOrder', player);
|
||||||
}
|
}
|
||||||
return num;
|
return num;
|
||||||
|
|
|
@ -6945,7 +6945,7 @@ export class Player extends HTMLDivElement {
|
||||||
cache = new CacheContext();
|
cache = new CacheContext();
|
||||||
}
|
}
|
||||||
for (var i = 0; i < targets.length; i++) {
|
for (var i = 0; i < targets.length; i++) {
|
||||||
if (cache.delegate(player).canUse(card, targets[i], distance, includecard)) {
|
if (player.canUse(card, targets[i], distance, includecard)) {
|
||||||
var eff = cache.get.effect(targets[i], card, player, player);
|
var eff = cache.get.effect(targets[i], card, player, player);
|
||||||
value.push(eff);
|
value.push(eff);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue