noname/character/onlyOL.js

335 lines
12 KiB
JavaScript
Raw Normal View History

'use strict';
game.import('character',function(lib,game,ui,get,ai,_status){
return {
name:'onlyOL',
connect:true,
character:{
ol_sb_jiangwei:['male','shu',4,['olsbzhuri','olsbranji']],
ol_caozhang:['male','wei',4,['oljiangchi']],
ol_jianyong:['male','shu',3,['olqiaoshui','jyzongshi']],
ol_lingtong:['male','wu',4,['olxuanfeng'],['die_audio:re_lingtong']],
},
characterSort:{
onlyOL:{
onlyOL_standard:[],
onlyOL_yijiang1:['ol_caozhang','ol_jianyong','ol_lingtong'],
onlyOL_sb:['ol_sb_jiangwei'],
},
},
characterIntro:{
},
characterReplace:{
},
skill:{
//OL谋姜维
olsbzhuri:{
audio:2,
trigger:{player:['phaseZhunbeiEnd','phaseJudgeEnd','phaseDrawEnd','phaseUseEnd','phaseDiscardEnd','phaseJieshuEnd']},
filter:function(event,player){
if(player.hasSkill('olsbzhuri_block')) return false;
if(!game.hasPlayer(target=>player.canCompare(target))) return false;
return player.getHistory('gain',evt=>evt.getParent(event.name)==event).length+player.getHistory('lose',evt=>evt.getParent(event.name)==event).length;
},
direct:true,
content:function*(event,map){
var player=map.player;
var result=yield player.chooseTarget(get.prompt('olsbzhuri'),'与一名角色进行拼点若你赢你可以使用其中的一张拼点牌若你没赢你失去1点体力或令此技能于本回合失效',(card,player,target)=>{
return player.canCompare(target);
}).set('ai',target=>{
var player=_status.event.player;
var ts=target.getCards('h').sort((a,b)=>get.number(a)-get.number(b));
if(get.attitude(player,target)<0){
var hs=player.getCards('h').sort((a,b)=>get.number(a)-get.number(b));
if(!hs.length||!ts.length) return 0;
if(get.value(hs[0])>6) return 0;
if(get.number(hs[0])>get.number(ts[0])) return 1;
return Math.random()-0.7;
}
return 0;
});
if(result.bool){
var target=result.targets[0];
player.logSkill('olsbzhuri',target);
var result2=yield player.chooseToCompare(target);
if(result2.bool){
var cards=[result.player,result.target].filterInD('d');
cards=cards.filter(card=>player.hasUseTarget(card));
if(cards.length){
var result3=yield player.chooseButton(['是否使用其中的牌?',cards]).set('ai',button=>_status.event.player.getUseValue(button.link));
if(result3.bool){
var card=result3.links[0];
player.$gain2(card,false);
game.delayx();
player.chooseUseTarget(true,card,false);
}
}
}
else{
var result3=yield player.chooseControl('失去体力','技能失效').set('prompt','逐日失去1点体力或令此技能于本回合失效').set('ai',()=>{
var player=_status.event.player;
if(get.effect(player,{name:'losehp'},player,player)>0) return '失去体力';
return '技能失效';
});
player[result3.control=='失去体力'?'loseHp':'addTempSkill'](result3.control=='失去体力'?1:'olsbzhuri_block');
}
}
},
subSkill:{
block:{
charlotte:true,
mark:true,
marktext:'<span style="text-decoration: line-through;">日</span>',
intro:{content:'追不动太阳了'},
},
},
},
olsbranji:{
audio:2,
trigger:{player:'phaseJieshuBegin'},
prompt2:function(event,player){
var str='获得技能';
var num=event.getParent().phaseList.slice(0,event.getParent().num).filter(name=>player.getHistory('useCard',evt=>evt.getParent(name).name==name).length).length;
if(num>=player.getHp()) str+='【困奋】';
if(num==player.getHp()) str+='和';
if(num<=player.getHp()) str+='【诈降】';
str+='。将手牌数调整至手牌或将体力值调整为体力上限。然后你不能回复体力直到你杀死角色。';
},
content:function*(event,map){
var player=map.player;
var trigger=map.trigger;
player.awakenSkill('olsbranji');
var num=trigger.getParent().phaseList.slice(0,trigger.getParent().num).filter(name=>player.getHistory('useCard',evt=>evt.getParent(name).name==name).length).length;
if(num>=player.getHp()) player.addSkillLog('kunfen');
if(num<=player.getHp()) player.addSkillLog('zhaxiang');
if(player.countCards('h')!=player.getHandcardLimit()||player.hp!=player.maxHp){
var result;
if(player.countCards('h')==player.getHandcardLimit()) result={index:1};
else if(player.hp==player.maxHp) result={index:0};
else{
var num1=player.countCards('h')<player.getHandcardLimit();
var num2=player.hp<player.maxHp;
result=yield player.chooseControl('手牌数','体力值').set('choiceList',[
num1<0?'摸'+get.cnNumber(-num1)+'张牌':'弃置'+get.cnNumber(num1)+'张牌',
num2<0?'回复'+(-num2)+'点体力':'失去'+(num2)+'点体力',
]).set('ai',()=>{
var player=_status.event.player;
var list=_status.event.list;
var num1=get.effect(player,{name:'wuzhong'},player,player)/2;
var num2=get.recoverEffect(player,player,player);
return num1*list[0]>num2*list[1]?0:1;
}).set('list',[-num1,-num2]);
}
if(result.index==0){
if(player.countCards('h')<player.getHandcardLimit()) player.draw(player.getHandcardLimit()-player.countCards('h'));
else player.chooseToDiscard(player.countCards('h')-player.getHandcardLimit(),'h',true);
}
else{
var num=player.maxHp-player.hp;
player[num>0?'recover':'loseHp'](Math.abs(num));
}
}
player.addSkill('olsbranji_norecover');
},
derivation:['kunfen','zhaxiang'],
subSkill:{
norecover:{
charlotte:true,
mark:true,
intro:{content:'不能回复体力直到杀死角色'},
trigger:{
player:'recoverBefore',
source:'dieAfter',
},
forced:true,
popup:false,
firstDo:true,
content:function(){
if(trigger.name=='recover') trigger.cancel();
else player.removeSkill('olsbranji_norecover');
},
ai:{
effect:{
target:function(card,player,target){
if(get.tag(card,'recover')) return 'zeroplayertarget';
},
},
},
},
},
},
//界曹彰
oljiangchi:{
audio:2,
trigger:{player:'phaseDrawEnd'},
direct:true,
content:function*(event,map){
var player=map.player;
var choiceList=[
'摸一张牌,本回合使用【杀】的次数上限-1且【杀】不计入手牌上限。',
'重铸一张牌,本回合使用【杀】无距离限制,且使用【杀】的次数上限+1。',
],list=['cancel2'];
if(player.countCards('he',card=>player.canRecast(card))) list.unshift('重铸,+1');
else choiceList[1]='<span style="opacity:0.5">'+choiceList[1]+'</span>';
list.unshift('摸牌,-1');
var result=yield player.chooseControl(list).set('ai',()=>{
var player=_status.event.player;
var controls=_status.event.controls.slice();
if(controls.includes('重铸,+1')&&player.countCards('hs',card=>get.name(card)=='sha'&&player.hasValueTarget(card))>=2) return '重铸,+1';
return '摸牌,-1';
}).set('choiceList',choiceList).set('prompt',get.prompt('oljiangchi'));
if(result.control!='cancel2'){
player.logSkill('oljiangchi');
if(result.control=='摸牌,-1'){
player.draw();
player.addTempSkill('oljiangchi_less');
player.addMark('oljiangchi_less',1,false);
}
else{
var result2=yield player.chooseCard('he','将驰:请重铸一张牌',true,(card,player)=>player.canRecast(card));
if(result2.bool){
player.recast(result2.cards);
player.addTempSkill('oljiangchi_more');
player.addMark('oljiangchi_more',1,false);
}
}
}
},
subSkill:{
less:{
charlotte:true,
onremove:true,
mod:{
cardUsable:function(card,player,num){
if(card.name=='sha') return num-player.countMark('oljiangchi_less');
},
ignoredHandcard:function(card,player){
if(card.name=='sha') return true;
},
cardDiscardable:function(card,player,name){
if(name=='phaseDiscard'&&card.name=='sha') return false;
},
},
},
more:{
charlotte:true,
onremove:true,
mod:{
cardUsable:function(card,player,num){
if(card.name=='sha') return num+player.countMark('oljiangchi_more');
},
targetInRange:function (card,player){
if(card.name=='sha') return true;
},
},
},
},
},
//界简雍
olqiaoshui:{
audio:2,
inherit:'reqiaoshui',
filter:function(event,player){
return player.countCards('h')>0&&!player.hasSkill('olqiaoshui_used');
},
content:function(){
'step 0'
player.chooseToCompare(target);
'step 1'
if(result.bool) player.addTempSkill('qiaoshui3',{player:'phaseUseAfter'});
else{
player.addTempSkill('qiaoshui2');
player.addTempSkill('olqiaoshui_used');
}
},
subSkill:{
used:{
charlotte:true,
mark:true,
marktext:'<span style="text-decoration: line-through;">说</span>',
intro:{content:'被迫闭嘴'},
},
},
},
//界凌统
olxuanfeng:{
audio:'xuanfeng',
audioname:['boss_lvbu3'],
audioname2:{
lingtong:'xuanfeng',
ol_lingtong:'xuanfeng_re_lingtong',
},
trigger:{
player:['loseAfter'],
global:['equipAfter','addJudgeAfter','gainAfter','loseAsyncAfter','addToExpansionAfter'],
},
filter:function(event,player){
var evt=event.getl(player);
return evt&&(evt.es.length||evt.cards2.length>1);
},
direct:true,
content:function(){
'step 0'
event.count=2;
event.logged=false;
'step 1'
player.chooseTarget(get.prompt('olxuanfeng'),'弃置一名其他角色的一张牌',function(card,player,target){
if(player==target) return false;
return target.countDiscardableCards(player,'he');
}).set('ai',function(target){
return -get.attitude(_status.event.player,target);
});
'step 2'
if(result.bool){
if(!event.logged){
player.logSkill('olxuanfeng',result.targets);
event.logged=true;
}
else player.line(result.targets[0],'green');
player.discardPlayerCard(result.targets[0],'he',true);
event.count--;
}
else event.finish();
'step 3'
if(event.count) event.goto(1);
},
ai:{
reverseEquip:true,
noe:true,
effect:{
target:function(card,player,target,current){
if(get.type(card)=='equip'&&!get.cardtag(card,'gifts')) return [1,3];
},
},
},
},
xuanfeng_re_lingtong:{audio:2},
},
dynamicTranslate:{
},
translate:{
ol_lingtong:'OL界凌统',
ol_lingtong_prefix:'OL界',
olxuanfeng:'旋风',
olxuanfeng_info:'当你一次性失去至少两张牌后,或失去装备区的牌后,你可以依次弃置一至两名其他角色的共计两张牌。',
ol_jianyong:'OL界简雍',
ol_jianyong_prefix:'OL界',
olqiaoshui:'巧说',
olqiaoshui_info:'出牌阶段,你可与一名其他角色拼点。若你赢,你使用的下一张基本牌或普通锦囊牌可以额外指定任意一名其他角色为目标或减少指定一个目标;若你没赢,此技能于本回合失效且本回合你不能使用锦囊牌。',
ol_caozhang:'OL界曹彰',
ol_caozhang_prefix:'OL界',
oljiangchi:'将驰',
oljiangchi_info:'摸牌阶段结束时,你可以选择一项:①摸一张牌,本回合使用【杀】的次数上限-1且【杀】不计入手牌上限。②重铸一张牌本回合使用【杀】无距离限制且使用【杀】的次数上限+1。',
ol_sb_jiangwei:'OL谋姜维',
ol_sb_jiangwei_prefix:'OL谋',
olsbzhuri:'逐日',
olsbzhuri_info:'你的回合阶段结束时若你本阶段失去或得到过牌则你可以与一名角色拼点。若你赢你可以使用其中一张拼点牌若你没赢你失去1点体力或令此技能于本回合无效。',
olsbranji:'燃己',
olsbranji_info:'限定技,结束阶段。若你本回合使用过牌的阶段数大于等于/小于等于体力值,你获得技能〖困奋〗/〖诈降〗(同时满足则都获得),然后你将手牌数调整至手牌上限或将体力值调整为体力上限,最后你不能回复体力直到你杀死角色。',
onlyOL_standard:'OL专属·标准',
onlyOL_yijiang1:'OL专属·将1',
onlyOL_sb:'OL专属·上兵伐谋',
},
};
});