start setting up backer gear in html

This commit is contained in:
Tyler Renelle 2013-05-08 15:42:44 +01:00
parent da4738ac1a
commit 981bf3e71a
4 changed files with 60 additions and 63 deletions

View file

@ -84,37 +84,40 @@ viewHelpers = (view) ->
###
Items
###
view.fn 'equipped', (type, item=0, preferences={gender:'m', armorSet:'v1'}, backer={}) ->
view.fn 'equipped', (type, item=0, preferences={gender:'m', armorSet:'v1'}, backerTier=0) ->
{gender, armorSet} = preferences
item = parseInt(item)
backerTier = parseInt(backerTier)
console.log backerTier
switch type
when'armor'
if item is 6
return 'armor_6' if backer.tier >= 45
if item > 5
return 'armor_6' if backerTier >= 45
item = 5 # set them back if they're trying to cheat
if gender is 'f'
return if (parseInt(item) is 0) then "f_armor_#{item}_#{armorSet}" else "f_armor_#{item}"
return if (item is 0) then "f_armor_#{item}_#{armorSet}" else "f_armor_#{item}"
else
return "m_armor_#{item}"
when 'head'
if item is 6
return 'head_6' if backer.tier >= 45
if item > 5
return 'head_6' if backerTier >= 45
item = 5
if gender is 'f'
return if (parseInt(item) > 1) then "f_head_#{item}_#{armorSet}" else "f_head_#{item}"
return if (item > 1) then "f_head_#{item}_#{armorSet}" else "f_head_#{item}"
else
return "m_head_#{item}"
when 'shield'
if item is 6
return 'head_6' if backer.tier >= 45
if item > 5
return 'shield_6' if backerTier >= 45
item = 5
return "#{preferences.gender}_shield_#{item}"
when 'weapon'
if item is 7
return 'weapon_7' if backer.tier >= 70
if item > 6
return 'weapon_7' if backerTier >= 70
item = 6
return "#{preferences.gender}_weapon_#{item}"

View file

@ -9,6 +9,7 @@ items = module.exports.items =
{index: 4, text: "Blue Sword", classes:'weapon_4', notes:'Increases experience gain by 12%.', strength: 12, value:65}
{index: 5, text: "Red Sword", classes:'weapon_5', notes:'Increases experience gain by 15%.', strength: 15, value:90}
{index: 6, text: "Golden Sword", classes:'weapon_6', notes:'Increases experience gain by 18%.', strength: 18, value:120}
{index: 7, text: "Dark Souls Blade", classes:'weapon_7', notes:'Increases experience gain by 21%.', strength: 21, value:150}
]
armor: [
{index: 0, text: "Cloth Armor", classes: 'armor_0', notes:'Training armor.', defense: 0, value:0}
@ -17,6 +18,7 @@ items = module.exports.items =
{index: 3, text: "Plate Mail", classes: 'armor_3', notes:'Decreases HP loss by 7%.', defense: 7, value:65}
{index: 4, text: "Red Armor", classes: 'armor_4', notes:'Decreases HP loss by 8%.', defense: 8, value:90}
{index: 5, text: "Golden Armor", classes: 'armor_5', notes:'Decreases HP loss by 10%.', defense: 10, value:120}
{index: 6, text: "Shade Armor", classes: 'armor_6', notes:'Decreases HP loss by 12%.', defense: 12, value:150}
]
head: [
{index: 0, text: "No Helm", classes: 'head_0', notes:'Training helm.', defense: 0, value:0}
@ -25,6 +27,7 @@ items = module.exports.items =
{index: 3, text: "Plate Helm", classes: 'head_3', notes:'Decreases HP loss by 4%.', defense: 4, value:45}
{index: 4, text: "Red Helm", classes: 'head_4', notes:'Decreases HP loss by 5%.', defense: 5, value:60}
{index: 5, text: "Golden Helm", classes: 'head_5', notes:'Decreases HP loss by 6%.', defense: 6, value:80}
{index: 5, text: "Shade Helm", classes: 'head_6', notes:'Decreases HP loss by 7%.', defense: 7, value:100}
]
shield: [
{index: 0, text: "No Shield", classes: 'shield_0', notes:'No Shield.', defense: 0, value:0}
@ -33,6 +36,7 @@ items = module.exports.items =
{index: 3, text: "Enforced Shield", classes: 'shield_3', notes:'Decreases HP loss by 5%.', defense: 5, value:55}
{index: 4, text: "Red Shield", classes: 'shield_4', notes:'Decreases HP loss by 7%.', defense: 7, value:70}
{index: 5, text: "Golden Shield", classes: 'shield_5', notes:'Decreases HP loss by 8%.', defense: 8, value:90}
{index: 6, text: "Tormented Skull", classes: 'shield_6', notes:'Decreases HP loss by 9%.', defense: 9, value:120}
]
potion: {type: 'potion', text: "Potion", notes: "Recover 15 HP", value: 25, classes: 'potion'}
reroll: {type: 'reroll', text: "Re-Roll", classes: 'reroll', notes: "Resets your task values back to 0 (yellow). Useful when everything's red and it's hard to stay alive.", value:0 }

View file

@ -1,54 +1,44 @@
.shop_weapon_6,
.shop_weapon_5,
.shop_weapon_4,
.shop_weapon_3,
.shop_weapon_2,
.shop_weapon_1,
.shop_shield_5,
.shop_shield_4,
.shop_shield_3,
.shop_shield_2,
.shop_shield_1,
.shop_head_5,
.shop_head_4,
.shop_head_3,
.shop_head_2,
.shop_head_1,
.shop_armor_5,
.shop_armor_4,
.shop_armor_3,
.shop_armor_2,
.shop_armor_1,
.shop_reroll,
.shop_potion,
.shop_copper,
.shop_silver,
.shop_gold
background: url("img/sprites/shop_sprites.png") no-repeat
[class^="shop_"]
background: url("/img/sprites/shop_sprites.png") no-repeat
.shop_weapon_6 {background-position: 0 0; width: 40px; height: 40px}
.shop_weapon_5 {background-position: -40px 0; width: 40px; height: 40px}
.shop_weapon_4 {background-position: -80px 0; width: 40px; height: 40px}
.shop_weapon_3 {background-position: -120px 0; width: 40px; height: 40px}
.shop_weapon_2 {background-position: -160px 0; width: 40px; height: 40px}
.shop_weapon_1 {background-position: -200px 0; width: 40px; height: 40px}
.shop_shield_5 {background-position: -240px 0; width: 40px; height: 40px}
.shop_shield_4 {background-position: -280px 0; width: 40px; height: 40px}
.shop_shield_3 {background-position: -320px 0; width: 40px; height: 40px}
.shop_shield_2 {background-position: -360px 0; width: 40px; height: 40px}
.shop_shield_1 {background-position: -400px 0; width: 40px; height: 40px}
.shop_head_5 {background-position: -440px 0; width: 40px; height: 40px}
.shop_head_4 {background-position: -480px 0; width: 40px; height: 40px}
.shop_head_3 {background-position: -520px 0; width: 40px; height: 40px}
.shop_head_2 {background-position: -560px 0; width: 40px; height: 40px}
.shop_head_1 {background-position: -600px 0; width: 40px; height: 40px}
.shop_armor_5 {background-position: -640px 0; width: 40px; height: 40px}
.shop_armor_4 {background-position: -680px 0; width: 40px; height: 40px}
.shop_armor_3 {background-position: -720px 0; width: 40px; height: 40px}
.shop_armor_2 {background-position: -760px 0; width: 40px; height: 40px}
.shop_armor_1 {background-position: -800px 0; width: 40px; height: 40px}
[class^="shop_weapon_"], [class^="shop_shield_"], [class^="shop_head_"], [class^="shop_armor_"]
width 40px
height 40px
.shop_weapon_6 {background-position: 0 0}
.shop_weapon_5 {background-position: -40px 0}
.shop_weapon_4 {background-position: -80px 0}
.shop_weapon_3 {background-position: -120px 0}
.shop_weapon_2 {background-position: -160px 0}
.shop_weapon_1 {background-position: -200px 0}
.shop_shield_5 {background-position: -240px 0}
.shop_shield_4 {background-position: -280px 0}
.shop_shield_3 {background-position: -320px 0}
.shop_shield_2 {background-position: -360px 0}
.shop_shield_1 {background-position: -400px 0}
.shop_head_5 {background-position: -440px 0}
.shop_head_4 {background-position: -480px 0}
.shop_head_3 {background-position: -520px 0}
.shop_head_2 {background-position: -560px 0}
.shop_head_1 {background-position: -600px 0}
.shop_armor_5 {background-position: -640px 0}
.shop_armor_4 {background-position: -680px 0}
.shop_armor_3 {background-position: -720px 0}
.shop_armor_2 {background-position: -760px 0}
.shop_armor_1 {background-position: -800px 0}
.shop_reroll {background-position: -840px 0; width: 40px; height: 40px}
.shop_potion {background-position: -880px 0; width: 40px; height: 40px}
.shop_copper {background-position: -923px -8px; width: 32px; height: 22px}
.shop_silver {background-position: -963px -8px; width: 32px; height: 22px}
.shop_gold {background-position: -1003px -8px; width: 32px; height: 22px}
.shop_weapon_7, .shop_armor_6, .shop_head_6, .shop_shield_6,
.weapon_7, .armor_6, .head_6, .shield_6
background: url("/img/sprites/backer-only/BackerOnly-SpriteSheet.png") no-repeat
width 105px
height 105px
.shop_head_6, .head_6 {background-position: 0 0}
.shop_armor_6, .armor_6 {background-position: -90px 0}
.shop_shield_6, .shield_6 {background-position: -180px 0}
.shop_weapon_7, .weapon_7 {background-position: -270px 0}

View file

@ -32,14 +32,14 @@
{#with @profile.preferences as :p}
<span class='{:p.gender}_skin_{:p.skin}'></span>
<span class='{:p.gender}_hair_{:p.hair}'></span>
<span class="{equipped('armor', @profile.items.armor, @profile.preferences, @profile.backer)}"></span>
<span class="{equipped('armor', @profile.items.armor, @profile.preferences, @profile.backer.tier)}"></span>
{#if :p.showHelm}
<span class="{equipped('head', @profile.items.head, @profile.preferences, @profile.backer)}"></span>
<span class="{equipped('head', @profile.items.head, @profile.preferences, @profile.backer.tier)}"></span>
{else}
<span class="{:p.gender}_head_0"></span>
{/}
<span class="{equipped('shield', @profile.items.shield, @profile.preferences, @profile.backer)}"></span>
<span class="{equipped('weapon', @profile.items.weapon, @profile.preferences, @profile.backer)}"></span>
<span class="{equipped('shield', @profile.items.shield, @profile.preferences, @profile.backer.tier)}"></span>
<span class="{equipped('weapon', @profile.items.weapon, @profile.preferences, @profile.backer.tier)}"></span>
{/}
{#if and(@profile.items.currentPet, not(@minimal))}
<span class="Pet-{@profile.items.currentPet.name}-{@profile.items.currentPet.modifier} current-pet" ></span>