From 5d85d3ff5097339711809e0ac71542dd35a0f476 Mon Sep 17 00:00:00 2001 From: libccy Date: Tue, 7 Feb 2017 00:24:42 +0800 Subject: [PATCH] g --- card/gujian.js | 278 ++++++++++++++++++++++++++++++++++++++++++++---- card/swd.js | 2 +- card/yunchou.js | 10 +- game/game.js | 30 +++++- 4 files changed, 290 insertions(+), 30 deletions(-) diff --git a/card/gujian.js b/card/gujian.js index 42838fdb3..448b843dd 100644 --- a/card/gujian.js +++ b/card/gujian.js @@ -1,6 +1,29 @@ 'use strict'; card.gujian={ card:{ + luyugeng:{ + fullskin:true, + type:'food', + enable:true, + markimage:'-14%', + filterTarget:function(card,player,target){ + return !target.hasSkill('luyugeng'); + }, + range:{global:1}, + content:function(){ + target.$gain2(cards); + target.storage.luyugeng=card; + target.storage.luyugeng_markcount=2; + target.addSkill('luyugeng'); + }, + ai:{ + order:2, + value:4, + result:{ + target:1 + } + } + }, jinlianzhu:{ type:'trick', fullskin:true, @@ -32,16 +55,39 @@ card.gujian={ fullskin:true, type:'food', enable:true, + markimage:'-13%', filterTarget:function(card,player,target){ - return target==player; + return !target.hasSkill('chunbing'); }, - selectTarget:-1, - modTarget:true, + range:{global:1}, + content:function(){ + target.$gain2(cards); + target.storage.chunbing=card; + target.storage.chunbing_markcount=5; + target.addSkill('chunbing'); + }, + ai:{ + order:2, + value:4, + result:{ + target:function(player,target){ + var num=target.needsToDiscard(); + if(num){ + if(target==player&&num>1){ + return num; + } + return Math.sqrt(num); + } + return 0; + } + } + } }, gudonggeng:{ fullskin:true, type:'food', enable:true, + markimage:'-18%', filterTarget:function(card,player,target){ return !target.hasSkill('gudonggeng'); }, @@ -82,8 +128,8 @@ card.gujian={ value:4, result:{ target:function(player,target){ - if(player==target&&target.isLeastHp()) return 2; - if(target.isLeastHp()) return 1.5; + if(player==target&&target.isLowestHp()) return 2; + if(target.isLowestHp()) return 1.5; return 1/Math.max(1,target.hp); } } @@ -93,21 +139,60 @@ card.gujian={ fullskin:true, type:'food', enable:true, + markimage:'-16%', filterTarget:function(card,player,target){ - return target==player; + return !target.hasSkill('mizhilianou'); }, - selectTarget:-1, - modTarget:true, + range:{global:1}, + content:function(){ + target.$gain2(cards); + target.storage.mizhilianou=card; + target.storage.mizhilianou_markcount=3; + target.addSkill('mizhilianou'); + }, + ai:{ + order:2, + value:4, + result:{ + target:function(player,target){ + if(target==player){ + if(target.num('he',{suit:'heart'})){ + if(target.isDamaged()) return 1.5; + } + else{ + return 0.2; + } + } + else if(target.isDamaged()){ + return 1; + } + return 0.5; + } + } + } }, xiajiao:{ fullskin:true, type:'food', enable:true, filterTarget:function(card,player,target){ - return target==player; + return !target.hasSkill('xiajiao'); }, - selectTarget:-1, - modTarget:true, + range:{global:1}, + content:function(){ + target.$gain2(cards); + target.storage.xiajiao=card; + target.storage.xiajiao_markcount=3; + target.addSkill('xiajiao'); + target.addTempSkill('xiajiao3','phaseAfter'); + }, + ai:{ + order:2, + value:5, + result:{ + target:1 + } + } }, tanhuadong:{ fullskin:true, @@ -135,6 +220,7 @@ card.gujian={ fullskin:true, type:'food', enable:true, + markimage:'-18%', filterTarget:function(card,player,target){ return !target.hasSkill('mapodoufu'); }, @@ -159,6 +245,7 @@ card.gujian={ fullskin:true, type:'food', enable:true, + markimage:'-16%', filterTarget:function(card,player,target){ return !target.hasSkill('qingtuan'); }, @@ -192,6 +279,7 @@ card.gujian={ fullskin:true, type:'food', enable:true, + markimage:'-16%', filterTarget:function(card,player,target){ return !target.hasSkill('yougeng'); }, @@ -208,7 +296,7 @@ card.gujian={ result:{ target:function(player,target){ if(target.isHealthy()) return player.needsToDiscard?0.1:0; - if(target.isLeastHp()) return 1.5; + if(target.isLowestHp()) return 1.5; return 1/Math.max(1,target.hp); } } @@ -815,6 +903,152 @@ card.gujian={ }, }, skill:{ + luyugeng:{ + mark:'card', + trigger:{player:'phaseBegin'}, + direct:true, + nopop:true, + intro:{ + content:function(storage,player){ + return '准备阶段,你对一名体力值全场最高的随机敌人造成一点雷属性伤害(剩余'+player.storage.luyugeng_markcount+'回合)' + } + }, + content:function(){ + var list=player.getEnemies(); + for(var i=0;i0; + }, + save:true, + } + } + } + }, + chunbing:{ + mark:'card', + trigger:{player:'phaseAfter'}, + direct:true, + nopop:true, + intro:{ + content:function(storage,player){ + return '你的手牌上限+1(剩余'+player.storage.chunbing_markcount+'回合)' + } + }, + mod:{ + maxHandcard:function(player,num){ + return num+1; + } + }, + content:function(){ + player.storage.chunbing_markcount--; + if(player.storage.chunbing_markcount==0){ + delete player.storage.chunbing; + delete player.storage.chunbing_markcount; + player.removeSkill('chunbing'); + } + else{ + player.updateMarks(); + } + }, + }, gudonggeng:{ mark:'card', trigger:{player:'phaseBegin'}, @@ -904,7 +1138,7 @@ card.gujian={ } }, content:function(){ - if(player.isLeastHp()){ + if(player.isLowestHp()){ player.logSkill('liyutang'); player.changeHujia(); } @@ -930,7 +1164,7 @@ card.gujian={ } }, content:function(){ - if(player.isDamaged()&&player.isLeastHp()){ + if(player.isDamaged()&&player.isLowestHp()){ player.logSkill('yougeng'); player.recover(); } @@ -1372,24 +1606,24 @@ card.gujian={ heilonglinpian_info:'对自己使用,获得一点护甲,直到下一回合开始,你的防御距离+1', food:'食物', - // chunbing:'春饼', - // chunbing_info:'春饼', + chunbing:'春饼', + chunbing_info:'你的手牌上限+1,持续五回合', gudonggeng:'骨董羹', gudonggeng_info:'你受到杀造成的伤害时有50%的机率令伤害-1,持续三回合', yougeng:'酉羹', yougeng_info:'准备阶段,若你的体力值为全场最少或之一,你回复一点体力,持续两回合', liyutang:'鲤鱼汤', liyutang_info:'结束阶段,若你的体力值为全场最少或之一,你获得一点护甲,持续两回合', - // mizhilianou:'蜜汁藕', - // mizhilianou_info:'蜜汁藕', - // xiajiao:'虾饺', - // xiajiao_info:'虾饺', + mizhilianou:'蜜汁藕', + mizhilianou_info:'你可以将一张红桃牌当作桃使用,持续三回合', + xiajiao:'虾饺', + xiajiao_info:'你在摸牌阶段额外摸一张牌,并在摸牌阶段时弃置一张牌,持续三回合', tanhuadong:'昙花冻', tanhuadong_info:'结束阶段,你有50%的机率摸一张牌,持续三回合', qingtuan:'青团', qingtuan_info:'你在回合内使用首张杀时摸一张牌,持续两回合', - // luyugeng:'鲈鱼羹', - // luyugeng_info:'鲈鱼羹', + luyugeng:'鲈鱼羹', + luyugeng_info:'准备阶段,你对一名体力值全场最高的随机敌人造成一点雷属性伤害,持续两回合', yuanbaorou:'元宝肉', yuanbaorou_info:'你在出牌阶段可以额外使用一张杀,持续三回合', molicha:'茉莉茶', diff --git a/card/swd.js b/card/swd.js index 1224d1a02..8648be4d4 100644 --- a/card/swd.js +++ b/card/swd.js @@ -4990,7 +4990,7 @@ card.swd={ longfan_info:'出牌阶段限一次,你可以进行一次判定,然后按花色执行以下效果。红桃:你回复一点体力;方片:你摸一张牌;梅花:你弃置一名其他角色的一张牌;黑桃:无事发生', // longfan_info:'0000:翻面;1111:弃手牌;2222:弃装备牌;3333:受伤害;4444:流失体力;5555:连环;6666:摸牌;7777:回复体力;8888:弃置判定牌;9999:置衡', guiyoujie:'鬼幽结', - guiyoujie_info:'出牌阶段,对一名其他角色使用。若判定结果为黑色,则将其翻面。', + guiyoujie_info:'出牌阶段,对一名其他角色使用。若判定结果为黑色,其摸一张牌并翻面。', yufulu:'御夫录', yufulu_info:'出牌阶段,可弃置一张武器牌令一名角色受到一点伤害,然后该角色获得此武器牌', touzhi:'投掷', diff --git a/card/yunchou.js b/card/yunchou.js index 98a5b0f46..ec6031167 100644 --- a/card/yunchou.js +++ b/card/yunchou.js @@ -430,13 +430,13 @@ card.yunchou={ type:'trick', enable:true, filterTarget:function(card,player,target){ - return (target.isLeastHp()&&target.isDamaged())||target.isLeastHandcard(); + return (target.isLowestHp()&&target.isDamaged())||target.isFewestHandcard(); }, content:function(){ 'step 0' - if(target.isLeastHandcard()) target.draw(2); + if(target.isFewestHandcard()) target.draw(2); 'step 1' - if(target.isLeastHp()) target.recover(); + if(target.isLowestHp()) target.recover(); }, ai:{ order:2, @@ -444,7 +444,7 @@ card.yunchou={ result:{ target:function(player,target){ var num=0; - if(target.isLeastHp()&&ai.get.recoverEffect(target)>0){ + if(target.isLowestHp()&&ai.get.recoverEffect(target)>0){ if(target.hp==1){ num+=3; } @@ -452,7 +452,7 @@ card.yunchou={ num+=2; } } - if(target.isLeastHandcard()){ + if(target.isFewestHandcard()){ num+=2; } return num; diff --git a/game/game.js b/game/game.js index 310bc9069..62071267b 100644 --- a/game/game.js +++ b/game/game.js @@ -12082,6 +12082,9 @@ node=name.copy('mark',this.node.marks); node.suit=name.suit; node.number=name.number; + if(name.name&&lib.card[name.name]&&lib.card[name.name].markimage){ + node.node.image.style.left=lib.card[name.name].markimage; + } name=name.name; } else{ @@ -12695,7 +12698,18 @@ isHealthy:function(){ return this.hp==this.maxHp; }, - isLeastHp:function(equal){ + isHighestHp:function(equal){ + for(var i=0;i=this.hp) return false; + } + else{ + if(game.players[i].hp>this.hp) return false; + } + } + return true; + }, + isLowestHp:function(equal){ for(var i=0;i=nh) return false; + } + else{ + if(game.players[i].num('h')>nh) return false; + } + } + return true; + }, + isFewestHandcard:function(equal){ var nh=this.num('h'); for(var i=0;i