Merge pull request #1204 from copcap/dev

神华佗添加〖滤心〗AI;同步新杀胡班技能加强
This commit is contained in:
Spmario233 2024-04-14 22:06:51 +08:00 committed by GitHub
commit b03f982d75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 49 additions and 6 deletions

View File

@ -142,6 +142,17 @@ game.import('character', function () {
usable:1,
filterCard:true,
filterTarget:lib.filter.notMe,
check(card){
const round=game.roundNumber,player=get.player();
let valueFix = 0;
if(['sha','shan'].includes(get.name(card,false))) valueFix += 3;
if(round<=2&&player.hasCard(card=>{
return ['sha','shan'].includes(get.name(card))&&get.value(card)<=3;
})||game.hasPlayer(current=>{
return current!==player&&get.attitude(player,current)>0;
})) return 6-get.value(card)+valueFix;
return 4.5-get.value(card)+valueFix;
},
delay:false,
discard:false,
lose:false,
@ -152,7 +163,9 @@ game.import('character', function () {
const result = await player.chooseControl(['摸牌', '弃牌']).set('choiceList', [
`${name}${get.cnNumber(round)}张牌`,
`${name}随机弃置${get.cnNumber(round)}张手牌`
]).set('prompt', '滤心:请选择一项').forResult();
]).set('prompt', '滤心:请选择一项').set('ai', () => {
return get.event('choice');
}).set('choice', get.attitude(player, target) > 0 ? '摸牌' : '弃牌').forResult();
let cards2 = [];
const makeDraw = result.index === 0;
if (makeDraw) {
@ -219,6 +232,21 @@ game.import('character', function () {
content:'下次发动技能时失去#点体力',
},
}
},
ai:{
order:5,
result:{
target(player,target){
const round=game.roundNumber;
if(round<=2&&target.countCards('h')>round*2&&player.getCards('h').some(card=>{
return ['sha','shan'].includes(get.name(card))&&get.value(card)<=3;
})) return 1;
if(get.attitude(player,target)>0){
return round+Math.sqrt(1+target.getDamagedHp());
}
return -(round+Math.sqrt(Math.max(0,2-target.getHp())));
},
}
}
},
huandao:{

View File

@ -2817,15 +2817,30 @@ game.import('character', function () {
});
return history.length&&history[history.length-1].card.name=='sha';
},
prompt2:(event)=>'令'+get.translation(event.player)+'本回合的手牌上限+1',
prompt2(event,player){
const target = event.player;
const history = target.getHistory('useCard', evt => {
return evt.getParent('phaseUse') === event;
});
const evt = history.lastItem, cards = evt.cards.filterInD('d');
let str = '令' + get.translation(target) + '本回合的手牌上限+1';
if (cards.length) str += `,然后你获得${get.translation(cards)}`;
str += '。';
return str;
},
check:function(event,player){
return get.attitude(player,event.player)>0;
},
content:function(){
var target=trigger.player;
async content(event,trigger,player){
const target = trigger.player;
target.addMark('dcchongyi_keep',1,false);
target.addTempSkill('dcchongyi_keep');
game.delayx();
const history = target.getHistory('useCard', evt => {
return evt.getParent('phaseUse') === trigger;
});
const evt = history.lastItem, cards = evt.cards.filterInD('d');
if (cards.length) await player.gain(cards, 'gain2');
else await game.asyncDelayx();
},
},
sha:{
@ -11577,7 +11592,7 @@ game.import('character', function () {
xiongrao_info:'限定技。准备阶段开始时你可以选择所有其他角色。这些角色本回合内所有不为锁定技、限定技、觉醒技的普通技能失效。然后你将体力上限增加至7点并摸X张牌X为你以此法增加的体力上限数。',
dc_huban:'胡班',
dcchongyi:'崇义',
dcchongyi_info:'①一名角色使用【杀】时,若此牌是其于当前出牌阶段内使用的第一张牌,则你可以令其摸两张牌,且其本回合使用【杀】的次数上限+1。②一名角色的出牌阶段结束时若其于此阶段内使用的最后一张牌为【杀】则你可以令其本回合的手牌上限+1。',
dcchongyi_info:'①一名角色使用【杀】时,若此牌是其于当前出牌阶段内使用的第一张牌,则你可以令其摸两张牌,且其本回合使用【杀】的次数上限+1。②一名角色的出牌阶段结束时若其于此阶段内使用的最后一张牌为【杀】则你可以令其本回合的手牌上限+1,然后你获得此【杀】。',
wangwei:'王威',
dcruizhan:'锐战',
dcruizhan_info:'其他角色的准备阶段开始时,若其的手牌数不小于其体力值,则你可以和其拼点。若你赢或拼点牌中有【杀】,则你视为对其使用一张【杀】。然后若此【杀】造成了伤害且以上两个条件均被满足,则你获得其一张牌。',