chooseToDisable与chooseToEnable添加source参数
This commit is contained in:
parent
608b1e700d
commit
bd0d47c708
|
@ -1542,8 +1542,8 @@ export const Content = {
|
||||||
event._result = { control: list[0] };
|
event._result = { control: list[0] };
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var next = player.chooseControl(list);
|
var next = source.chooseControl(list);
|
||||||
next.set('prompt', '请选择恢复一个装备栏');
|
next.set('prompt', '请选择恢复'+get.translation(player.name)+'的一个装备栏');
|
||||||
if (!event.ai) event.ai = function (event, player, list) {
|
if (!event.ai) event.ai = function (event, player, list) {
|
||||||
return list.randomGet();
|
return list.randomGet();
|
||||||
};
|
};
|
||||||
|
@ -1575,8 +1575,8 @@ export const Content = {
|
||||||
else {
|
else {
|
||||||
list.sort();
|
list.sort();
|
||||||
event.list = list;
|
event.list = list;
|
||||||
var next = player.chooseControl(list);
|
var next = source.chooseControl(list);
|
||||||
next.set('prompt', '请选择废除一个装备栏');
|
next.set('prompt', '请选择废除'+get.translation(player.name)+'的一个装备栏');
|
||||||
if (!event.ai) event.ai = function (event, player, list) {
|
if (!event.ai) event.ai = function (event, player, list) {
|
||||||
return list.randomGet();
|
return list.randomGet();
|
||||||
};
|
};
|
||||||
|
|
|
@ -2046,17 +2046,29 @@ export class Player extends HTMLDivElement {
|
||||||
}
|
}
|
||||||
chooseToEnable() {
|
chooseToEnable() {
|
||||||
var next = game.createEvent('chooseToEnable');
|
var next = game.createEvent('chooseToEnable');
|
||||||
|
for (var i = 0; i < arguments.length; i++) {
|
||||||
|
if (get.itemtype(arguments[i]) == 'player') {
|
||||||
|
next.source = arguments[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (next.source == undefined) next.source = this;
|
||||||
next.player = this;
|
next.player = this;
|
||||||
next.setContent('chooseToEnable');
|
next.setContent('chooseToEnable');
|
||||||
return next;
|
return next;
|
||||||
}
|
}
|
||||||
/**
|
chooseToDisable() {
|
||||||
* @param { boolean } [horse]
|
|
||||||
*/
|
|
||||||
chooseToDisable(horse) {
|
|
||||||
var next = game.createEvent('chooseToDisable');
|
var next = game.createEvent('chooseToDisable');
|
||||||
|
for (var i = 0; i < arguments.length; i++) {
|
||||||
|
if (get.itemtype(arguments[i]) == 'player') {
|
||||||
|
next.source = arguments[i];
|
||||||
|
}
|
||||||
|
else if(typeof arguments[i] == 'boolean' ){
|
||||||
|
next.horse = arguments[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (next.horse == undefined) next.horse = false;
|
||||||
|
if (next.source == undefined) next.source = this;
|
||||||
next.player = this;
|
next.player = this;
|
||||||
if (horse) next.horse = true;
|
|
||||||
next.setContent('chooseToDisable');
|
next.setContent('chooseToDisable');
|
||||||
return next;
|
return next;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue