Merge pull request #653 from copcap/dev-chara

新杀蒯祺
This commit is contained in:
Spmario233 2023-11-18 22:15:36 +08:00 committed by GitHub
commit d7e58fd410
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 171 additions and 4 deletions

View File

@ -4,6 +4,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
name:'huicui',
connect:true,
character:{
kuaiqi:['male','wei',3,['dcliangxiu','dcxunjie']],
yue_caiyong:['male','qun',3,['dcjiaowei','dcfeibai']],
pangshanmin:['male','wei',3,['dccaisi','dczhuoli']],
dc_jiachong:['male','wei',3,['dcbeini','dcshizong']],
@ -93,7 +94,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
characterSort:{
huicui:{
sp_baigei:['re_panfeng','xingdaorong','caoxing','re_chunyuqiong','xiahoujie','dc_caiyang','zhoushan'],
sp_caizijiaren:['re_dongbai','re_sunluyu','heyan','zhaoyan','wangtao','wangyue','zhangxuan','tengyin','zhangyao','xiahoulingnv','dc_sunru','pangshanmin'],
sp_caizijiaren:['re_dongbai','re_sunluyu','heyan','zhaoyan','wangtao','wangyue','zhangxuan','tengyin','zhangyao','xiahoulingnv','dc_sunru','pangshanmin','kuaiqi'],
sp_zhilan:['liuyong','wanniangongzhu','zhanghu','lvlingqi','tenggongzhu','panghui','dc_zhaotongzhaoguang','yuantanyuanxiyuanshang','yuechen'],
sp_guixin:['re_kanze','re_chendeng','caimaozhangyun','dc_lvkuanglvxiang','dc_gaolan','yinfuren','chengui','chenjiao','dc_sp_jiaxu','qinlang'],
sp_daihan:['mamidi','dc_jiling','zhangxun','dc_yuejiu','wanglie','leibo','qiaorui','dongwan','yuanyin'],
@ -108,6 +109,162 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}
},
skill:{
//蒯祺
dcliangxiu:{
audio:2,
enable:'phaseUse',
filter:function(event,player){
return player.hasCard(card=>{
const type=get.type2(card,player);
return player.hasCard(cardx=>{
if(card==cardx) return false;
return get.type2(cardx,player)!=type;
},'he');
},'he');
},
filterCard:function(card,player){
if(!ui.selected.cards.length) return true;
return get.type2(ui.selected.cards[0],player)!=get.type2(card,player);
},
selectCard:2,
check:function(card){
const player=get.player();
const bannedTypes=[];
bannedTypes.addArray(player.getStorage('dcliangxiu'));
if(!ui.selected.cards.length){
let val=get.value(card);
if(val>5.5) return 0;
if(bannedTypes.includes(get.type2(card,player))) return 7.5-val;
return 5.5-val;
}
bannedTypes.addArray(ui.selected.cards.map(card=>get.type2(card,player)));
bannedTypes.add(get.type2(card,player));
const filter=card=>!bannedTypes.includes(get.type2(card,player));
if(!get.cardPile(filter)) return 0;
return 6-get.value(card);
},
position:'he',
complexCard:true,
onremove:true,
content:function*(event,map){
const player=map.player;
const cards=[];
const bannedTypes=[];
bannedTypes.addArray(event.cards.map(card=>get.type2(card,player)));
bannedTypes.addArray(player.getStorage('dcliangxiu'));
const filter=card=>!bannedTypes.includes(get.type2(card,player));
const piles=['cardPile','discardPile'];
for(const pile of piles){
for(let i=0;i<ui[pile].childNodes.length;i++){
const card=ui[pile].childNodes[i];
if(filter(card)){
cards.add(card);
if(cards.length>=2) break;
}
}
if(cards.length>=2) break;
}
let result;
if(!cards.length){
player.chat('没牌了…');
game.log('但是哪里都找不到没有符合条件的牌!');
event.finish();
return;
}
else if(cards.length==1) result={bool:true,links:cards};
else result=yield player.chooseButton(['良秀:获得一张牌',cards],true).set('ai',get.buttonValue);
if(result.bool){
const toGain=result.links;
player.markAuto('dcliangxiu',get.type2(toGain[0],false));
player.when({global:'phaseChange'}).then(()=>{
player.unmarkSkill('dcliangxiu');
});
player.gain(toGain,'gain2');
}
},
intro:{
content:'已因此技能获得过$牌',
onunmark:true,
},
ai:{
order:2,
result:{player:1},
},
},
dcxunjie:{
audio:2,
trigger:{global:'phaseEnd'},
filter:function(event,player){
if(['handcard','hp'].every(i=>player.isTempBanned(`dcxunjie_${i}`))) return false;
return player.hasHistory('gain',evt=>{
return !evt.getParent('phaseDraw',true);
});
},
direct:true,
content:function*(event,map){
const player=map.player;
const choices=[];
const choiceList=[
'令一名角色将手牌数摸或弃置至与其体力值相同',
'令一名角色将体力值回复或失去至与其手牌数相同',
];
if(!player.isTempBanned('dcxunjie_handcard')) choices.push('选项一');
else choiceList[0]='<span style="opacity:0.5">'+choiceList[0]+'(已被选择过)</span>';
if(!player.isTempBanned('dcxunjie_hp')) choices.push('选项二');
else choiceList[1]='<span style="opacity:0.5">'+choiceList[1]+'(已被选择过)</span>';
let result;
if(_status.connectMode) game.broadcastAll(()=>{_status.noclearcountdown=true});
if(choices.length==1) result={control:choices[0]};
else result=yield player.chooseControl(choices,'cancel2').set('choiceList',choiceList).set('prompt',get.prompt('dcxunjie')).set('ai',()=>{
return get.event('choice');
}).set('choice',(()=>{
const getValue=(index,target)=>{
let att=get.attitude(player,target);
att=Math.sign(att)*Math.sqrt(Math.abs(att));
let delt=target.getHp(true)-target.countCards('h');
if(index==1&&delt<0) delt=0;
return (1-3*index)*att*delt;
}
const list=game.filterPlayer().map(current=>{
const val0=getValue(0,current),val1=getValue(1,current);
return [val0,val1,Math.max(val0,val1)];
}).sort((a,b)=>{
return b[2]-a[2];
});
const toChoose=list[0];
if(toChoose[2]<=0) return 'cancel2';
return toChoose[0]>toChoose[1]?0:1;
})());
if(result.control=='cancel2'){
if(_status.connectMode){game.broadcastAll(()=>{delete _status.noclearcountdown;game.stopCountChoose()})}
return event.finish();
}
let prompt='';
const choice=result.control,index=choice=='选项一'?0:1;
if(choices.length==1){
prompt=`###${get.prompt('dcxunjie')}###<div class="text center">${choiceList[index]}</div>`;
}
else prompt=`###殉节:请选择一名角色###<div class="text center">${choiceList[index].replace('一名','该')}</div>`;
result=yield player.chooseTarget(prompt).set('ai',target=>{
const player=get.player(),index=get.event('index');
let att=get.attitude(player,target);
att=Math.sign(att)*Math.sqrt(Math.abs(att));
let delt=target.getHp(true)-target.countCards('h');
if(index==1&&delt<0) delt=0;
return (1-2*index)*att*delt;
}).set('index',index);
if(_status.connectMode){game.broadcastAll(()=>{delete _status.noclearcountdown;game.stopCountChoose()})}
if(!result.bool) return event.finish();
const target=result.targets[0];
player.logSkill('dcxunjie',target);
player.tempBanSkill(`dcxunjie_${index==0?'handcard':'hp'}`,'roundStart',false);
const delt=(target.getHp(true)-target.countCards('h'))*(1-2*index);
if(delt==0) event.finish();
else if(index==0) target[delt>0?'draw':'chooseToDiscard'](Math.abs(delt),true);
else target[delt>0?'recover':'loseHp'](Math.abs(delt));
}
},
//乐蔡邕
dcjiaowei:{
audio:2,
@ -10597,6 +10754,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
mengyou:'孟优,《三国演义》里的人物,南蛮王孟获之弟。与诸葛亮的南征军交战,向败战的兄长推荐朵思大王,劝兄长借助朵思之力与蜀汉军对抗。后来与兄长一起发誓归顺蜀汉。',
liuchongluojun:'刘宠(?~197年汉明帝刘庄玄孙陈敬王刘羡曾孙陈顷王刘崇之孙陈孝王刘承之子陈国第六位国君也是东汉陈国的最后一位国君。骆俊?-197字孝远东汉末年扬州会稽郡乌伤县今浙江义乌人。宗室陈王刘宠的国相在任期间励精图治深得民众爱戴。刘宠勇猛过人善使弓弩箭法高超。在其父刘承死后继承陈王爵位。中平年间黄巾军起义郡县官兵都弃城逃走刘宠于是征兵自守卫。当时天下饥荒诸王侯都已不再享有租赋反屡遭抢掠有的甚至流离在外死于荒野。只有陈国仍很富强邻郡百姓纷纷前去投靠陈国拥有部众达十余万人。初平元年190年各州郡起兵讨伐董卓刘宠率军屯驻阳夏自称辅汉大将军。建安二年197年袁术向陈国求取粮草遭陈国国相骆俊拒绝袁术大为生气便派刺客张闿假装路过陈国乘机杀死骆俊和刘宠。',
yuechen:'乐綝195~257年字号不详阳平郡卫国县今河南省清丰县人。三国时期曹魏将领右将军乐进的儿子。果毅坚毅袭封广昌亭侯累迁扬州刺史。甘露二年为叛乱的征东大将军诸葛诞所杀追赠卫尉。',
kuaiqi:'蒯祺(?~219年南郡中卢人荆州望族子弟与荆州牧刘表帐下谋士蒯良、蒯越为同族东汉末年房陵太守。建安二十四年219年汉中王刘备遣宜都太守孟达从秭归北攻房陵蒯祺于战斗中被孟达所部士兵所杀。清朝任兆麟《心斋十种》中的《襄阳记》辑本引用《万历襄阳府志》“钦从祖祺妇即诸葛孔明之姊也”称蒯祺娶故兖州泰山郡丞诸葛珪长女即他是知名政治家、蜀汉丞相诸葛亮的姐夫。但在任兆麟之前的《襄阳记》辑本中并没有这一条。',
},
characterTitle:{
},
@ -11086,6 +11244,11 @@ game.import('character',function(lib,game,ui,get,ai,_status){
dcjiaowei_info:'锁定技。①游戏开始时,你将所有手牌标记为“弦”。②你的“弦”牌不计入手牌上限。③当你受到伤害时,若来源的手牌数不大于你的“弦”牌数,防止此伤害。',
dcfeibai:'飞白',
dcfeibai_info:'每回合限一次。当你使用牌结算结束后若你本回合使用过至少两张牌你可以随机获得一张字数为X的牌。若你的“弦”数不大于X你重置〖飞白〗X为此牌与你使用的上一张牌的字数之和。',
kuaiqi:'蒯祺',
dcliangxiu:'良秀',
dcliangxiu_info:'出牌阶段,你可以弃置两张不同类型的牌,然后从两张与你弃置的牌类型均不同的牌中选择一张获得之(每阶段每种类型限一次)。',
dcxunjie:'殉节',
dcxunjie_info:'每轮每项限一次。一名角色的回合结束时若你本回合于摸牌阶段外得到过牌你可以选择一项1.令一名角色将手牌数摸或弃置至与其体力值相同2.令一名角色将体力值回复或失去至与其手牌数相同。',
sp_baigei:'无双上将',
sp_caizijiaren:'才子佳人',

View File

@ -633,6 +633,7 @@ window.noname_character_rank={
'nezha',
'dc_jiachong',
'pangshanmin',
'kuaiqi',
],
bp:[
'chess_diaochan',

View File

@ -27864,10 +27864,10 @@
return skill;
}
tempBanSkill(skill,expire,log){
if(!this.hasSkill(skill)||this.hasStorage(`temp_ban_${skill}`)) return;
if(this.isTempBanned(skill)) return;
this.setStorage(`temp_ban_${skill}`,true);
if(log!==false) game.log(this,'的技能',`#g【${get.translation(skill)}`,'暂时失效了');
if(log!==false&&this.hasSkill(skill)) game.log(this,'的技能',`#g【${get.translation(skill)}`,'暂时失效了');
if(!expire) expire={global:['phaseAfter','phaseBeforeStart']};
else if(typeof expire=='string'||Array.isArray(expire)) expire={global:expire};
@ -27880,6 +27880,9 @@
})
return skill;
}
isTempBanned(skill){
return this.hasStorage(`temp_ban_${skill}`);
}
attitudeTo(target){
if(typeof get.attitude=='function') return get.attitude(this,target);
return 0;

BIN
image/character/kuaiqi.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB