X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=main.coffee;h=366d54eeabf870a8bc0515198f2e650a6fdb8b08;hb=9cc07cbaa0e30193f6d92301b5b960051ae70374;hp=e67a3e344626aeab8478042a51a4d91ca5e131bd;hpb=fff36074eecf575408c820f9cbf8a9f2dc6942c5;p=hexbog.git diff --git a/main.coffee b/main.coffee index e67a3e3..366d54e 100644 --- a/main.coffee +++ b/main.coffee @@ -339,11 +339,12 @@ blip_selection = -> for nei in [neighbors, nneighbors] if unsink > 0 for i in nei - if i.hp is 0 and unsink >= 15 + if i.hp is 0 and unsink >= 10 i.new_hp = 10 - unsink -= 15 + unsink -= 10 i.text = new_letter() i.dom.html i.text + for nei in [neighbors, nneighbors] if unsink > 0 for i in nei if i.hp > 0 and unsink > 0 @@ -445,7 +446,7 @@ select_tile = (num) -> new_tile = (num, x, y) -> letter = new_letter() - hp = Math.floor(Math.random() * HP_MAX) + hp = 1 + Math.floor(Math.random() * (HP_MAX - 1)) html_tile = $("
#{letter}
") $board.append(html_tile) @@ -456,6 +457,7 @@ new_tile = (num, x, y) -> html_tile.click -> me = $(this) num = me.data 'tile_number' + return if tiles[num].hp < 1 if num in selected nth_of_word = selected.indexOf(num) first = nth_of_word is 0