Skip to content

Commit

Permalink
pets: rename shaners Item_HatchingPotion to Pet_HatchingPotion to fit
Browse files Browse the repository at this point in the history
previous architecture, add some placeholders for the un-finished
potions. got them working
  • Loading branch information
lefnire committed Mar 27, 2013
1 parent db2a210 commit 6520bfb
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 16 deletions.
30 changes: 23 additions & 7 deletions public/img/sprites/PetEggs.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.Pet_Egg_Wolf, .Pet_Egg_TigerCub, .Pet_Egg_PolarBear, .Pet_Egg_PandaCub, .Pet_Egg_LionCub, .Pet_Egg_Fox, .Pet_Egg_FlyingPig, .Pet_Egg_Dragon, .Pet_Egg_Cactus, .Pet_Egg_BearCub, .Item_HatchingPotion_Basic, .Item_HatchingPotion_White, .Item_HatchingPotion_Desert, .Item_HatchingPotion_Red, .Item_HatchingPotion_Shade, .Item_HatchingPotion_Skeleton {background: url("/img/sprites/Egg_Sprite_Sheet.png") no-repeat}
.Pet_Egg_Wolf, .Pet_Egg_TigerCub, .Pet_Egg_PolarBear, .Pet_Egg_PandaCub, .Pet_Egg_LionCub, .Pet_Egg_Fox, .Pet_Egg_FlyingPig, .Pet_Egg_Dragon, .Pet_Egg_Cactus, .Pet_Egg_BearCub, .Pet_HatchingPotion_Base, .Pet_HatchingPotion_White, .Pet_HatchingPotion_Desert, .Pet_HatchingPotion_Red, .Pet_HatchingPotion_Shade, .Pet_HatchingPotion_Skeleton, .Pet_HatchingPotion_Zombie, .Pet_HatchingPotion_CottonCandyPink, .Pet_HatchingPotion_CottonCandyBlue, .Pet_HatchingPotion_Golden {background: url("/img/sprites/Egg_Sprite_Sheet.png") no-repeat}
.Pet_Egg_Wolf {background-position: 0px 0px; width: 48px; height: 51px}
.Pet_Egg_TigerCub {background-position: 0px -51px; width: 48px; height: 51px}
.Pet_Egg_PolarBear {background-position: 0px -102px; width: 48px; height: 51px}
Expand All @@ -9,9 +9,25 @@
.Pet_Egg_Dragon {background-position: 0px -357px; width: 48px; height: 51px}
.Pet_Egg_Cactus {background-position: 0px -408px; width: 48px; height: 51px}
.Pet_Egg_BearCub {background-position: 0px -459px; width: 48px; height: 51px}
.Item_HatchingPotion_Basic {background-position: -48px -0px; width: 48px; height: 51px}
.Item_HatchingPotion_White {background-position: -48px -51px; width: 48px; height: 51px}
.Item_HatchingPotion_Desert {background-position: -48px -102px; width: 48px; height: 51px}
.Item_HatchingPotion_Red {background-position: -48px -153px; width: 48px; height: 51px}
.Item_HatchingPotion_Shade {background-position: -48px -204px; width: 48px; height: 51px}
.Item_HatchingPotion_Skeleton {background-position: -48px -255px; width: 48px; height: 51px}

.Pet_HatchingPotion_Base {background-position: -48px -0px; width: 48px; height: 51px}
.Pet_HatchingPotion_White {background-position: -48px -51px; width: 48px; height: 51px}
.Pet_HatchingPotion_Desert {background-position: -48px -102px; width: 48px; height: 51px}
.Pet_HatchingPotion_Red {background-position: -48px -153px; width: 48px; height: 51px}
.Pet_HatchingPotion_Shade {background-position: -48px -204px; width: 48px; height: 51px}
.Pet_HatchingPotion_Skeleton {background-position: -48px -255px; width: 48px; height: 51px}

/* Temporary until we get the other hatching potions */
.Pet_HatchingPotion_Zombie, .Pet_HatchingPotion_CottonCandyPink, .Pet_HatchingPotion_CottonCandyBlue, .Pet_HatchingPotion_Golden {background-position: -48px -0px; width: 48px; height: 51px}
.Pet_HatchingPotion_Zombie {
-webkit-filter: invert(1);
}
.Pet_HatchingPotion_CottonCandyPink {
-webkit-filter: hue-rotate(120deg);
}
.Pet_HatchingPotion_CottonCandyBlue {
-webkit-filter: saturate(3);
}
.Pet_HatchingPotion_Golden {
-webkit-filter: hue-rotate(220deg);
}
2 changes: 1 addition & 1 deletion src/app/items.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ items = module.exports.items =
_.each ['weapon', 'armor', 'head', 'shield'], (key) ->
_.each items[key], (item) -> item.type = key

_.each items.pets, (pet) -> pet.notes = 'Find some Hatching Powder to sprinkle on this egg, and one day it will hatch into a loyal pet.'
_.each items.pets, (pet) -> pet.notes = 'Find some Hatching Potion to sprinkle on this egg, and one day it will hatch into a loyal pet.'
_.each items.food, (food) -> food.notes = "Sprinkle this on an egg, and it will hatch as a #{food.text} pet."

###
Expand Down
4 changes: 2 additions & 2 deletions src/app/scoring.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ randomDrop = (model, delta) ->
acceptableDrops = _.filter(food, (foodItem) -> foodItem.name in acceptableDrops)
drop = randomVal acceptableDrops
user.push 'items.food', drop.name
drop.type = 'Food'
drop.dialog = "You've found #{drop.text} Hatching Powder! #{drop.notes}"
drop.type = 'HatchingPotion'
drop.dialog = "You've found a #{drop.text} Hatching Potion! #{drop.notes}"

model.set '_drop', drop
$('#item-dropped-modal').modal 'show'
Expand Down
2 changes: 1 addition & 1 deletion views/app/avatar.html
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ <h4>Eggs</h4>
</tr>
</table>
{/}
<h4>Hatching Powder</h4>
<h4>Hatching Potions</h4>
{#with _view.items.food as :food}
<table>
<tr>
Expand Down
10 changes: 5 additions & 5 deletions views/app/pets.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<food:>
<td class="active-food">
<div rel=tooltip class="Pet_Food_{.name}" title="{.text} - {.value} Tokens" x-bind="click:buyFood" data-food='{.name}'></div>
<div rel=tooltip class="Pet_HatchingPotion_{.name}" title="{.text} - {.value} Tokens" x-bind="click:buyFood" data-food='{.name}'></div>
{.text}
</td>

Expand Down Expand Up @@ -52,12 +52,12 @@
</li>
<li class="customize-menu">
{#if not(_user.items.food)}
<p>You don't have any hatching powder yet.</p>
<p>You don't have any hatching potions yet.</p>
{/if}
<menu label="Hatching Powder" class='food-menu'>
<menu label="Hatching Potion" class='food-menu'>
{#each _user.items.food as :food}
<div>
<button rel=tooltip title="{:food}" class="customize-option Pet_Food_{{:food}}" x-bind="click: chooseFood"></button>
<button rel=tooltip title="{:food}" class="customize-option Pet_HatchingPotion_{{:food}}" x-bind="click: chooseFood"></button>
<p>{:food}</p>
</div>
{/each}
Expand All @@ -69,7 +69,7 @@
<div class='span6 well'>
<h3>Hatch Your Egg</h3>
{#if not(_user.items.food)}
<p>You don't have any hatching powder yet.</p>
<p>You don't have any hatching potions yet.</p>
{else}
<p>What would you like to sprinkle on your {_feedEgg.text} egg?</p>
<form x-bind="submit:feedEgg">
Expand Down

0 comments on commit 6520bfb

Please sign in to comment.