From f38ca4fee083b4ee96bbba120080115014d9d406 Mon Sep 17 00:00:00 2001 From: libccy Date: Fri, 4 Nov 2016 18:09:20 +0800 Subject: [PATCH] test --- card/basic.js | 184 +++ card/classic.js | 10 + card/naxx.js | 10 + character/classic.js | 4 + extension/hsmod/extension.js | 96 ++ game/asset.js | 22 +- game/config.js | 5 +- game/game.js | 197 ++- game/package.js | 16 +- game/source.js | 7 + game/update.js | 17 - image/{mode/stone/career => class}/druid.png | Bin image/{mode/stone/career => class}/hunter.png | Bin image/{mode/stone/career => class}/knight.png | Bin image/{mode/stone/career => class}/mage.png | Bin .../{mode/stone/career => class}/paladin.png | Bin image/{mode/stone/career => class}/priest.png | Bin image/{mode/stone/career => class}/rogue.png | Bin image/{mode/stone/career => class}/shaman.png | Bin .../{mode/stone/career => class}/warlock.png | Bin .../{mode/stone/career => class}/warrior.png | Bin image/hearthstone/ailongbakebaohuzhe.jpg | Bin 0 -> 54111 bytes image/hearthstone/beici.jpg | Bin 0 -> 68993 bytes image/hearthstone/beijunmushi.jpg | Bin 0 -> 33986 bytes image/hearthstone/chiyanzhanfu.jpg | Bin 0 -> 20141 bytes image/hearthstone/cikezhiren.jpg | Bin 0 -> 18368 bytes image/hearthstone/diyulieyan.jpg | Bin 0 -> 42325 bytes image/hearthstone/dongwuhuoban.jpg | Bin 0 -> 13566 bytes image/hearthstone/fengxian.jpg | Bin 0 -> 19492 bytes image/hearthstone/hanbingjian.jpg | Bin 0 -> 16158 bytes image/hearthstone/huoyuansu.jpg | Bin 0 -> 45143 bytes image/hearthstone/lansaizhanshi.jpg | Bin 0 -> 41237 bytes image/hearthstone/liewangshouwei.jpg | Bin 0 -> 59734 bytes image/hearthstone/shuiyuansu.jpg | Bin 0 -> 40040 bytes image/hearthstone/xukongxingzhe.jpg | Bin 0 -> 35681 bytes image/hearthstone/xunshoushi.jpg | Bin 0 -> 52438 bytes image/hearthstone/yaoshu.jpg | Bin 0 -> 20734 bytes image/hearthstone/yexingchengzhang.jpg | Bin 0 -> 23186 bytes image/hearthstone/zhangezhihuiguan.jpg | Bin 0 -> 51449 bytes image/hearthstone/zhenyanshudun.jpg | Bin 0 -> 17891 bytes image/hearthstone/zhurufamingjia.jpg | Bin 0 -> 36599 bytes layout/default/hearthstone.css | 392 +++++ layout/default/layout.css | 4 + layout/mode/stone.css | 20 +- mode/brawl.js | 2 + mode/hearthstone.js | 1392 +++++++++++++++++ 46 files changed, 2301 insertions(+), 77 deletions(-) create mode 100644 card/basic.js create mode 100644 card/classic.js create mode 100644 card/naxx.js create mode 100644 character/classic.js create mode 100644 extension/hsmod/extension.js rename image/{mode/stone/career => class}/druid.png (100%) rename image/{mode/stone/career => class}/hunter.png (100%) rename image/{mode/stone/career => class}/knight.png (100%) rename image/{mode/stone/career => class}/mage.png (100%) rename image/{mode/stone/career => class}/paladin.png (100%) rename image/{mode/stone/career => class}/priest.png (100%) rename image/{mode/stone/career => class}/rogue.png (100%) rename image/{mode/stone/career => class}/shaman.png (100%) rename image/{mode/stone/career => class}/warlock.png (100%) rename image/{mode/stone/career => class}/warrior.png (100%) create mode 100644 image/hearthstone/ailongbakebaohuzhe.jpg create mode 100755 image/hearthstone/beici.jpg create mode 100755 image/hearthstone/beijunmushi.jpg create mode 100644 image/hearthstone/chiyanzhanfu.jpg create mode 100644 image/hearthstone/cikezhiren.jpg create mode 100755 image/hearthstone/diyulieyan.jpg create mode 100755 image/hearthstone/dongwuhuoban.jpg create mode 100755 image/hearthstone/fengxian.jpg create mode 100755 image/hearthstone/hanbingjian.jpg create mode 100644 image/hearthstone/huoyuansu.jpg create mode 100644 image/hearthstone/lansaizhanshi.jpg create mode 100644 image/hearthstone/liewangshouwei.jpg create mode 100644 image/hearthstone/shuiyuansu.jpg create mode 100644 image/hearthstone/xukongxingzhe.jpg create mode 100644 image/hearthstone/xunshoushi.jpg create mode 100755 image/hearthstone/yaoshu.jpg create mode 100755 image/hearthstone/yexingchengzhang.jpg create mode 100755 image/hearthstone/zhangezhihuiguan.jpg create mode 100755 image/hearthstone/zhenyanshudun.jpg create mode 100755 image/hearthstone/zhurufamingjia.jpg create mode 100644 layout/default/hearthstone.css create mode 100644 mode/hearthstone.js diff --git a/card/basic.js b/card/basic.js new file mode 100644 index 000000000..b4ff72bda --- /dev/null +++ b/card/basic.js @@ -0,0 +1,184 @@ +'use strict'; +card.basic={ + connect:true, + card:{ + yexingchengzhang:{ + cost:2, + class:'druid', + }, + ailongbakebaohuzhe:{ + cost:8, + class:'druid', + attack:8, + health:8, + skill:{ + taunt:true + }, + }, + dongwuhuoban:{ + cost:3, + class:'hunter' + }, + xunshoushi:{ + cost:4, + class:'hunter', + attack:4, + health:3, + skill:{ + battlecry:{} + }, + }, + hanbingjian:{ + cost:2, + class:'mage', + }, + shuiyuansu:{ + cost:4, + class:'mage', + attack:3, + health:6, + skill:{ + freeze:{} + }, + }, + fengxian:{ + cost:4, + class:'paladin' + }, + liewangshouwei:{ + cost:7, + class:'paladin', + attack:5, + health:6, + skill:{ + battlecry:{} + } + }, + zhenyanshudun:{ + cost:1, + class:'priest' + }, + beijunmushi:{ + cost:1, + class:'priest', + attack:1, + health:3, + skill:{ + heal:{} + } + }, + beici:{ + cost:0, + class:'rogue' + }, + cikezhiren:{ + cost:5, + class:'rogue', + attack:3, + duration:4, + }, + yaoshu:{ + cost:3, + class:'shaman' + }, + huoyuansu:{ + cost:6, + class:'shaman', + attack:6, + health:5, + skill:{ + battlecry:{} + } + }, + diyulieyan:{ + cost:4, + class:'warlock' + }, + xukongxingzhe:{ + cost:1, + class:'warlock', + attack:1, + health:3, + race:'deamon', + skill:{ + taunt:true + } + }, + chiyanzhanfu:{ + cost:2, + class:'warrior', + attack:3, + duration:2, + }, + zhangezhihuiguan:{ + cost:3, + class:'warrior', + attack:2, + health:3, + skill:{ + zhihui:{} + } + }, + lansaizhanshi:{ + cost:2, + class:'neutral', + attack:2, + health:1, + race:'murlock', + skill:{ + charge:true + } + }, + zhurufamingjia:{ + cost:4, + class:'neutral', + attack:2, + health:4, + skill:{ + battlecry:{} + } + } + }, + translate:{ + yexingchengzhang:'野性成长', + yexingchengzhang_info:'获得一个空的法力水晶', + ailongbakebaohuzhe:'埃隆巴克保护者', + ailongbakebaohuzhe_info:'嘲讽', + dongwuhuoban:'动物伙伴', + dongwuhuoban_info:'随机召唤一个野兽伙伴', + xunshoushi:'驯兽师', + xunshoushi_info:'战吼:使一个友方野兽获得+2/+2并获得嘲讽', + hanbingjian:'寒冰箭', + hanbingjian_info:'对一个角色造成3点伤害,并使其冻结', + shuiyuansu:'水元素', + shuiyuansu_info:'冻结任何受到该随从伤害的角色', + fengxian:'奉献', + fengxian_info:'对所有敌人造成2点伤害', + liewangshouwei:'列王守卫', + liewangshouwei_info:'战吼:为你的英雄恢复6点生命值', + zhenyanshudun:'真言术·盾', + zhenyanshudun_info:'使一个随从获得+2生命值。抽一张牌', + beijunmushi:'北郡牧师', + beijunmushi_info:'每当一个随从获得治疗时,抽一张牌', + beici:'背刺', + beici_info:'对一个未受伤的随从造成2点伤害', + cikezhiren:'刺客之刃', + cikezhiren_info:' ', + yaoshu:'妖术', + yaoshu_info:'使一个随从变形成为一个0/1并具有嘲讽的青蛙', + huoyuansu:'火元素', + huoyuansu_info:'战吼:造成3点伤害', + diyulieyan:'地狱烈焰', + diyulieyan_info:'对所有角色造成3点伤害', + xukongxingzhe:'虚空行者', + xukongxingzhe_info:'嘲讽', + chiyanzhanfu:'炽炎战斧', + chiyanzhanfu_info:' ', + zhangezhihuiguan:'战歌指挥官', + zhangezhihuiguan_info:'你的具有冲锋的随从获得+1攻击力', + lansaizhanshi:'蓝鳃战士', + lansaizhanshi_info:'冲锋', + zhurufamingjia:'侏儒发明家', + zhurufamingjia_info:'战吼:抽一张牌', + }, +} diff --git a/card/classic.js b/card/classic.js new file mode 100644 index 000000000..3f65258ee --- /dev/null +++ b/card/classic.js @@ -0,0 +1,10 @@ +'use strict'; +card.classic={ + connect:true, + card:{ + + }, + translate:{ + + }, +} diff --git a/card/naxx.js b/card/naxx.js new file mode 100644 index 000000000..f15a86a7b --- /dev/null +++ b/card/naxx.js @@ -0,0 +1,10 @@ +'use strict'; +card.naxx={ + connect:true, + card:{ + + }, + translate:{ + + }, +} diff --git a/character/classic.js b/character/classic.js new file mode 100644 index 000000000..c6ed69925 --- /dev/null +++ b/character/classic.js @@ -0,0 +1,4 @@ +'use strict'; +character.classic={ + +} diff --git a/extension/hsmod/extension.js b/extension/hsmod/extension.js new file mode 100644 index 000000000..86c57b7b0 --- /dev/null +++ b/extension/hsmod/extension.js @@ -0,0 +1,96 @@ +play.hsmod={ + arenaReady:function(){ + var data={ + total:160, + sha:{ + diamond:6, + club:14, + heart:3, + spade:7, + }, + huosha:{ + diamond:2, + heart:3 + }, + leisha:{ + spade:5, + club:4 + }, + shan:{ + heart:6, + diamond:18 + }, + jiu:{ + diamond:1, + spade:2, + club:2 + }, + tao:{ + heart:9, + diamond:3, + }, + wanjian:{ + heart:1, + }, + nanman:{ + spade:2, + club:1, + }, + guohe:{ + spade:3, + club:2, + heart:1 + }, + shunshou:{ + spade:3, + diamond:2 + }, + wuxie:{ + heart:2, + diamond:1, + spade:2, + club:2 + }, + tiesuo:{ + spade:2, + club:4 + } + } + var rand=function(){ + return Math.ceil(Math.random()*13); + }; + var getn=function(i,j){ + return Math.round(data[i][j]*parseFloat(lib.config['cardpile_'+i+'_playpackconfig'])); + }; + var num=0; + for(var i in data){ + for(var j in data[i]){ + num+=getn(i,j); + } + } + var dn=num*(lib.card.list.length-data.total)/(data.total-num); + if(dn>1000) dn=1000; + if(dn>0){ + var p=0; + for(var i in data){ + for(var j in data[i]){ + var n=Math.round(dn*getn(i,j)/num); + while(n--){ + if(i=='huosha'){ + lib.card.list.push([j,rand(),'sha','fire']); + } + else if(i=='leisha'){ + lib.card.list.push([j,rand(),'sha','thunder']); + } + else{ + lib.card.list.push([j,rand(),i]); + } + } + } + } + } + }, + help:{ + '牌堆补充':'