Skip to content

Commit

Permalink
4
Browse files Browse the repository at this point in the history
  • Loading branch information
libccy authored and libccy committed Jan 8, 2017
1 parent 6ce42c0 commit 0a135f5
Show file tree
Hide file tree
Showing 14 changed files with 292 additions and 92 deletions.
95 changes: 57 additions & 38 deletions card/swd.js
Original file line number Diff line number Diff line change
Expand Up @@ -785,57 +785,72 @@ card.swd={
type:'jiguan',
wuxieable:true,
filterTarget:function(card,player,target){
var es=target.get('e');
for(var i=0;i<es.length;i++){
if(lib.inpile.contains(es[i].name)) return true;
}
return false;
return target==player;
// var es=target.get('e');
// for(var i=0;i<es.length;i++){
// if(lib.inpile.contains(es[i].name)) return true;
// }
// return false;
},
selectTarget:-1,
content:function(){
var es=target.get('e');
var list=get.typeCard('hslingjian');
var list2=get.typeCard('jiqi');
var cards=[];
var time=0;
target.clearEquipTrigger();
for(var i=0;i<es.length;i++){
if(lib.inpile.contains(es[i].name)){
var card=game.createCard(list.randomGet());
cards.push(card);
time+=200;
setTimeout((function(card,name){
return function(){
ui.discardPile.appendChild(game.createCard(card));
card.init([card.suit,card.number,name,card.nature]);
card.style.transform='scale(1.1)';
card.classList.add('glow');
var info=get.info(card);
if(info.skills){
for(var i=0;i<info.skills.length;i++){
target.addSkillTrigger(info.skills[i]);
}
}
setTimeout(function(){
card.style.transform='';
card.classList.remove('glow');
},500);
}
}(es[i],lib.skill._lingjianduanzao.process([card,es[i]]))),i*200);
if(!lib.inpile.contains(es[i].name)){
es.splice(i--,1);
}
}
var num=get.rand(es.length);
var card;
for(var i=0;i<es.length;i++){
target.clearEquipTrigger(es[i]);
if(i==num){
card=game.createCard(list2.randomGet());
}
else{
card=game.createCard(list.randomGet());
}
cards.push(card);
time+=200;
setTimeout((function(card,name){
return function(){
ui.discardPile.appendChild(game.createCard(card));
card.init([card.suit,card.number,name,card.nature]);
card.style.transform='scale(1.1)';
card.classList.add('glow');
var info=get.info(card);
if(info.skills){
for(var i=0;i<info.skills.length;i++){
target.addSkillTrigger(info.skills[i]);
}
}
setTimeout(function(){
card.style.transform='';
card.classList.remove('glow');
},500);
}
}(es[i],lib.skill._lingjianduanzao.process([card,es[i]]))),i*200);
}
target.$gain2(cards);
game.delay(0,time)
},
ai:{
value:7,
order:7.5,
result:{
target:function(player,target){
var es=target.get('e');
var num=0;
for(var i=0;i<es.length;i++){
if(lib.inpile.contains(es[i].name)) num++;
}
return num;
}
// target:function(player,target){
// var es=target.get('e');
// var num=0;
// for(var i=0;i<es.length;i++){
// if(lib.inpile.contains(es[i].name)) num++;
// }
// return num;
// }
target:1
}
}
},
Expand Down Expand Up @@ -1752,13 +1767,13 @@ card.swd={
_shenmiguo:{
trigger:{player:'useCardAfter'},
direct:true,
usable:1,
filter:function(event,player){
if(event.parent.name=='_shenmiguo') return false;
if(_status.currentPhase!=player) return false;
if(event.parent.parent.name!='phaseUse') return false;
if(!event.targets||!event.card) return false;
if(event.card.name=='shenmiguo') return false;
if(player.hasSkill('shenmiguo2')) return false;
var type=get.type(event.card);
if(type!='basic'&&type!='trick') return false;
var card=game.createCard(event.card.name,event.card.suit,event.card.number,event.card.nature);
Expand Down Expand Up @@ -1788,9 +1803,13 @@ card.swd={
return true;
},trigger.player,-1).set('cardname',trigger.card.name).targetRequired=true;
'step 1'
if(result.bool){
player.addTempSkill('shenmiguo2','phaseAfter');
}
delete player.storage.shenmiguo;
}
},
shenmiguo2:{},
yuruyi:{
trigger:{player:'drawBegin'},
forced:true,
Expand Down Expand Up @@ -4399,7 +4418,7 @@ card.swd={
_lingjianduanzao:'煅造',
_lingjianduanzao_info:'出牌阶段,你可以将一张装备牌和一张可煅造的牌合成为一件强化装备,并可装备给距离1以内的一名角色',
jiguanshu:'机关鼠',
jiguanshu_info:'出牌阶段对一名角色使用,用随机零件强化目标装备区内的装备',
jiguanshu_info:'出牌阶段对自己使用,用随机祭器强化装备区内的一张随机装备,然后用随机零件强化其余的装备',
lingjiandai:'零件袋',
lingjiandai_info:'出牌阶段对自己使用,获得3张随机零件',
mujiaren:'木甲人',
Expand Down
34 changes: 32 additions & 2 deletions character/hearth.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ character.hearth={
hs_trueheart:['female','qun',3,['qianghuax']],
hs_sainaliusi:['male','wu',4,['chongsheng','yulu']],
hs_lrhonin:['male','wei',4,['bingyan','yufa']],
hs_bolvar:['male','wei',4,['yuanzheng','byuhuo']],
hs_bolvar:['male','wei',4,['yuanzheng','bzhuiji']],
hs_fuding:['male','wei',4,['shengdun','fbeifa']],
hs_xuanzhuanjijia:['male','shu',3,['jixuan']],
hs_ysera:['female','wu',4,['chenshui']],
Expand Down Expand Up @@ -95,6 +95,23 @@ character.hearth={
hs_malfurion:['hs_malorne'],
},
skill:{
bzhuiji:{
trigger:{global:'dieAfter'},
check:function(event,player){
return ai.get.attitude(player,event.source)<=0;
},
filter:function(event,player){
return event.source&&event.source.isAlive()&&event.source!=player;
},
content:function(){
player.draw(2);
player.useCard({name:'juedou'},trigger.source);
},
ai:{
threaten:1.5,
expose:0.1
}
},
lianjin:{
enable:'phaseUse',
usable:2,
Expand Down Expand Up @@ -955,6 +972,7 @@ character.hearth={
event.target.draw(result.cards.length);
player.storage.xianji3=event.target;
player.addSkill('xianji3');
player.addExpose(0.2);
}
}
},
Expand Down Expand Up @@ -1637,6 +1655,16 @@ character.hearth={
}
},
yuanzheng:{
trigger:{player:'useCardToBegin'},
direct:true,
filter:function(event,player){
return event.target&&event.target!=player&&get.distance(player,event.target)>1&&event.target.num('he')>0;
},
content:function(){
player.discardPlayerCard(trigger.target,get.prompt('yuanzheng',trigger.target),'hej').logSkill=['yuanzheng',trigger.target];
}
},
yuanzheng_old:{
trigger:{player:'useCardToBegin'},
direct:true,
filter:function(event,player){
Expand Down Expand Up @@ -4907,7 +4935,9 @@ character.hearth={
shifa:'嗜法',
shifa_info:'锁定技,出牌阶段开始时,你令场上所有角色各获得一张随机锦囊牌',
yuanzheng:'远征',
yuanzheng_info:'每当你对攻击范围外的一名角色使用一张牌,你可以选择一项:摸一张牌,或视为对目标使用一张杀',
yuanzheng_info:'每当你对距离1以外的角色使用一张牌,你可以弃置目标区域内的一张牌',
bzhuiji:'追击',
bzhuiji_info:'每当一名角色死亡,你可以摸两张牌,并视为对杀死该角色的人使用一张决斗',
byuhuo:'浴火',
byuhuo2:'浴火',
byuhuo_info:'觉醒技,当你进入濒死状态时,你须将体力和体力上限变为2,并将武将牌翻至背面;在你的下一回合开始时,你对所有其他角色造成两点火焰伤害,在此之前,你不能成为其他角色的卡牌的目标',
Expand Down
19 changes: 10 additions & 9 deletions character/ow.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ character.ow={
ow_tuobiang:['male','shu',3,['paotai','maoding']],
// ow_baolei:['female','shu',3,[]],
ow_banzang:['male','qun',4,['fengshi','yinbo']],
ow_laiyinhate:['male','qun',4,['lzhongjia','mengji']],
ow_laiyinhate:['male','qun',4,['zhongdun','mengji']],
// ow_luba:['male','shu',4,[]],
// ow_wensidun:['male','shu',4,[]],
// ow_zhaliya:['female','shu',4,['pingzhang','lichang']],
Expand All @@ -31,18 +31,18 @@ character.ow={
forced:true,
unique:true,
filter:function(event,player){
return player.storage.zhongjia&&!player.hujia&&event.card&&event.card.name=='sha'&&event.notLink();
return player.storage.zhongdun&&!player.hujia&&event.card&&event.card.name=='sha'&&event.notLink();
},
content:function(){
trigger.num++;
}
},
lzhongjia:{
zhongdun:{
unique:true,
init2:function(player){
if(!player.storage.zhongjia){
player.changeHujia(8);
player.storage.zhongjia=true;
if(!player.storage.zhongdun){
player.changeHujia(game.players.length);
player.storage.zhongdun=true;
}
},
enable:'phaseUse',
Expand Down Expand Up @@ -363,6 +363,7 @@ character.ow={
game.addVideo('storage',player,['shoujia2',null]);
if(!player.isTurnedOver()){
player.turnOver();
player.draw();
}
},
intro:{
Expand Down Expand Up @@ -2577,8 +2578,8 @@ character.ow={
translate:{
mengji:'猛击',
mengji_info:'锁定技,若你已发动重盾,当你没有护甲时,你的杀造成的伤害+1',
lzhongjia:'重盾',
lzhongjia_info:'游戏开始时,你获得8点护甲;出牌阶段限一次,你可以弃置一张牌并将一点护甲分给一名没有护甲的其他角色',
zhongdun:'重盾',
zhongdun_info:'游戏开始时,你获得等同于游戏人数护甲;出牌阶段限一次,你可以弃置一张牌并将一点护甲分给一名没有护甲的其他角色',
paotai:'炮台',
paotai2:'炮台',
paotai_info:'出牌阶段,你可以弃置一张杀布置或升级一个炮台(最高3级);回合结束阶段,炮台有一定机率对一名随机敌人造成一点火焰伤害;每当你受到杀造成的伤害,炮台降低一级',
Expand All @@ -2595,7 +2596,7 @@ character.ow={
shoujia:'兽夹',
shoujia2:'兽夹',
shoujia3:'兽夹',
shoujia_info:'出牌阶段限一次,你可以将一张牌背面朝上置于一名其他角色的武将牌上,当该角色使用一张与此牌花色相同的牌指定其他角色为目标时,将此牌置入弃牌堆,该角色将武将牌翻至背面;当该角色对你造成伤害时,将此牌置入弃牌堆',
shoujia_info:'出牌阶段限一次,你可以将一张牌背面朝上置于一名其他角色的武将牌上,当该角色使用一张与此牌花色相同的牌指定其他角色为目标时,将此牌置入弃牌堆,该角色将武将牌翻至背面并摸一张牌;当该角色对你造成伤害时,将此牌置入弃牌堆',
shihuo:'嗜火',
shihuo_info:'锁定技,每当一名角色受到火焰伤害,你摸一张牌',
shanguang:'闪光',
Expand Down
3 changes: 2 additions & 1 deletion character/refresh.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ character.refresh={
},
rejizhi:{
audio:2,
usable:3,
trigger:{player:'useCard'},
frequent:true,
filter:function(event){
Expand Down Expand Up @@ -1563,7 +1564,7 @@ character.refresh={
rerende:'仁德',
rerende_info:'出牌阶段,你可以将至少一张手牌交给其他角色,然后你于此阶段内不能再以此法交给该角色牌;若你于此阶段内给出的牌首次达到两张,你可以视为使用一张基本牌',
liyu_info:'当你使用【杀】对一名其他角色造成伤害后,该角色可令你获得其一张牌,若如此做,则视为你对其选择的另一名角色使用一张【决斗】',
rejizhi_info:'当你使用一张装备牌或锦囊牌时,你可以摸一张牌并展示之,若此牌是基本牌,你须弃置一张手牌',
rejizhi_info:'当你使用一张装备牌或锦囊牌时,你可以摸一张牌并展示之,若此牌是基本牌,你须弃置一张手牌,每回合限3次',
xunxun_info:'摸牌阶段,你可以放弃摸牌,改为观看牌堆顶的四张牌,然后获得其中的两张牌,将其余的牌以任意顺序置于牌堆底。',
wangxi_info:'每当你对其他角色造成1点伤害后,或受到其他角色造成的1点伤害后,你可与该角色各摸一张牌。',
reguose_info:'出牌阶段限一次,你可以选择一项:将一张方片花色牌当做【乐不思蜀】使用;或弃置一张方片花色牌并弃置场上的一张【乐不思蜀】。选择完成后,你摸一张牌。',
Expand Down
1 change: 1 addition & 0 deletions character/sp.js
Original file line number Diff line number Diff line change
Expand Up @@ -6554,6 +6554,7 @@ character.sp={
jici:'激词',
jici_info:'当你发动“鼓舌”拼点的牌亮出后,若点数小于X,你可令点数+X;若点数等于X,你可令你本回合发动“鼓舌”的次数上限+1(X为你“饶舌”标记的数量)',
shefu:'设伏',
shefu_bg:'伏',
shefu_info:'结束阶段开始时,你可以将一张手牌移出游戏,称为"伏兵"。然后为"伏兵"记录一个基本牌或锦囊牌名称(须与其他"伏兵"记录的名称均不同)。你的回合外,当有其他角色使用与你记录的"伏兵"牌名相同的牌时,你可以令此牌无效,然后将该"伏兵"置入弃牌堆',
benyu:'贲育',
benyu2:'贲育',
Expand Down
22 changes: 10 additions & 12 deletions character/swd.js
Original file line number Diff line number Diff line change
Expand Up @@ -2719,32 +2719,30 @@ character.swd={
dangping2:{},
duishi:{
enable:'phaseUse',
usable:1,
filter:function(event,player){
return player.num('h')>0;
return player.num('h')>0&&!player.hasSkill('duishi2');
},
filterTarget:function(card,player,target){
return player!=target&&target.num('h')>0;
return player!=target&&target.num('h')>0&&!target.hasSkill('duishi3');
},
filterCard:true,
check:function(card){return 8-ai.get.value(card)},
content:function(){
"step 0"
var suit=get.suit(cards[0]);
target.chooseToDiscard({suit:suit},'h','弃置一张'+get.translation(suit)+
'牌并令'+get.translation(player)+'摸一张牌,或随机弃置两张牌').ai=function(card){
return 8-ai.get.value(card);
target.chooseToDiscard({suit:suit},'h','对诗:弃置一张'+get.translation(suit)+
'牌,或令'+get.translation(player)+'获得你一张牌').ai=function(card){
if(ai.get.attitude(target,player)>0) return 0;
return 9-ai.get.value(card);
}

"step 1"
if(result.bool){
player.draw();
target.addTempSkill('duishi3','phaseAfter');
}
else{
var he=target.get('he');
if(he.length){
target.discard(he.randomGets(2));
}
player.gainPlayerCard(target,'he',true);
player.addTempSkill('duishi2','phaseAfter');
}
},
ai:{
Expand Down Expand Up @@ -8256,7 +8254,7 @@ character.swd={
guisi:'归思',
guisi_info:'每当你成为杀的目标,你可以交给对方一张手牌并取消之',
duishi:'对诗',
duishi_info:'出牌阶段限一次,你可以弃置一张手牌,并指定一名有手牌的角色选择一项:弃置一张与之花色相同的手牌并令你摸一张牌,或随机弃置两张牌',
duishi_info:'出牌阶段,你可以弃置一张手牌,并指定一名有手牌的角色选择一项:1)弃置一张与之花色相同的手牌,本回合内对诗不能再次指定其为目标,2)令你获得其一张牌,对诗失效直到回合结束',
anlianying:'连营',
anlianying_info:'每当你失去最后一张手牌,可摸两张牌',
lianwu:'连舞',
Expand Down
2 changes: 2 additions & 0 deletions extension/boss/extension.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
play.boss={
init:function(){
if(get.mode()=='tafang') return;
if(get.mode()!='boss'){
lib.characterPack.mode_extension_boss={
boss_zhangchunhua:['female','wei',4,['jueqing','wuxin','shangshix'],['boss','bossallowed'],'wei'],
Expand Down Expand Up @@ -156,6 +157,7 @@ play.boss={
}
},
arenaReady:function(){
if(get.mode()=='tafang') return;
var loadversus=function(){
if(get.mode()!='versus'){
window.mode={};
Expand Down
Loading

0 comments on commit 0a135f5

Please sign in to comment.