标准包yiji技能调整缩进

This commit is contained in:
shijian 2023-12-09 12:38:27 +08:00
parent 1ab5975364
commit 60596cd0c0
1 changed files with 43 additions and 44 deletions

View File

@ -551,68 +551,67 @@ game.import('character',function(lib,game,ui,get,ai,_status){
filter:function(event){
return event.num>0;
},
async content(event, trigger, player) {
event.count = trigger.num;
async content(event,trigger,player){
event.count=trigger.num;
// event.goto -> while
while (event.count > 0) {
while(event.count>0){
event.count--;
const { cards } = await game.cardsGotoOrdering(get.cards(2)).toPromise();
if (_status.connectMode) game.broadcastAll(function () { _status.noclearcountdown = true });
event.given_map = {};
if (!cards.length) return;
const {cards}=await game.cardsGotoOrdering(get.cards(2)).toPromise();
if(_status.connectMode) game.broadcastAll(function(){_status.noclearcountdown=true});
event.given_map={};
if(!cards.length) return;
// event.goto -> do while
do {
const { result: { bool, links } } =
cards.length == 1 ?
{ result: { links: cards.slice(0), bool: true } } :
await player.promises.chooseCardButton('遗计:请选择要分配的牌', true, cards, [1, cards.length])
.set('ai', function (button) {
if (ui.selected.buttons.length == 0) return 1;
do{
const {result:{bool,links}} =
cards.length==1?
{result:{links:cards.slice(0),bool: true}}:
await player.promises.chooseCardButton('遗计:请选择要分配的牌',true,cards,[1,cards.length])
.set('ai',button=>{
if(ui.selected.buttons.length==0) return 1;
return 0;
});
if (!bool) return;
if(!bool) return;
cards.removeArray(links);
event.togive = links.slice(0);
const { result: { targets } } = await player.promises.chooseTarget('选择一名角色获得' + get.translation(links), true)
.set('ai', function (target) {
var att = get.attitude(_status.event.player, target);
if (_status.event.enemy) {
event.togive=links.slice(0);
const {result:{targets}}=await player.promises.chooseTarget('选择一名角色获得'+get.translation(links),true)
.set('ai',target=>{
const att=get.attitude(_status.event.player,target);
if(_status.event.enemy){
return -att;
}
else if (att > 0) {
return att / (1 + target.countCards('h'));
else if(att>0){
return att/(1+target.countCards('h'));
}
else {
return att / 100;
else{
return att/100;
}
})
.set('enemy', get.value(event.togive[0], player, 'raw') < 0);
if (targets.length) {
const id = targets[0].playerid,
map = event.given_map;
if (!map[id]) map[id] = [];
.set('enemy',get.value(event.togive[0],player,'raw')<0);
if(targets.length){
const id=targets[0].playerid,
map=event.given_map;
if(!map[id]) map[id]=[];
map[id].addArray(event.togive);
}
} while (cards.length > 0);
if (_status.connectMode) {
game.broadcastAll(function () { delete _status.noclearcountdown; game.stopCountChoose() });
}while(cards.length>0);
if(_status.connectMode){
game.broadcastAll(function(){delete _status.noclearcountdown;game.stopCountChoose()});
}
const list = [];
for (const i in event.given_map) {
const source = (_status.connectMode ? lib.playerOL : game.playerMap)[i];
player.line(source, 'green');
const list=[];
for(const i in event.given_map){
const source=(_status.connectMode?lib.playerOL:game.playerMap)[i];
player.line(source,'green');
list.push([source, event.given_map[i]]);
}
await game.loseAsync({
gain_list: list,
giver: player,
animate: 'draw',
gain_list:list,
giver:player,
animate:'draw',
}).toPromise().setContent('gaincardMultiple');
if (event.count > 0 && player.hasSkill(event.name) && !get.is.blocked(event.name, player)) {
const { result: { bool: repeat } } = await player.promises.chooseBool(get.prompt2(event.name)).set('frequentSkill', event.name);
if (repeat) {
player.logSkill(event.name);
} else return;
if(event.count>0&&player.hasSkill(event.name)&&!get.is.blocked(event.name, player)){
const {result:{bool:chooseBoolResultBool}}=await player.promises.chooseBool(get.prompt2(event.name)).set('frequentSkill',event.name);
if(chooseBoolResultBool) player.logSkill(event.name);
else return;
}
else return;
}