classes WIP

This commit is contained in:
Tyler Renelle 2013-11-18 22:34:03 -08:00
parent d98257812f
commit 1ef6bb18a8
10 changed files with 747 additions and 996 deletions

View file

@ -1,34 +0,0 @@
weapon_6, weapon_5, weapon_4, weapon_3, weapon_2, weapon_1, weapon_0, shield_5, shield_4, shield_3, shield_2, shield_1, head_5, head_4, head_3, head_2, head_1, head_0, hair blond, hair black, hair brown, hair white, armor_5, armor_4, armor_3, armor_2, armor_1, armor_0, skin_dead, skin_orc, skin_asian, skin_black, skin_white {background: url('../../img/sprites/male_sprites.png') no-repeat; }
weapon_6 {background-position: 0 0; width: 90px; height: 90px}
weapon_5 {background-position: -90px 0; width: 90px; height: 90px}
weapon_4 {background-position: -180px 0; width: 90px; height: 90px}
weapon_3 {background-position: -270px 0; width: 90px; height: 90px}
weapon_2 {background-position: -360px 0; width: 90px; height: 90px}
weapon_1 {background-position: -450px 0; width: 90px; height: 90px}
weapon_0 {background-position: -540px 0; width: 90px; height: 90px}
shield_5 {background-position: -630px 0; width: 90px; height: 90px}
shield_4 {background-position: -720px 0; width: 90px; height: 90px}
shield_3 {background-position: -810px 0; width: 90px; height: 90px}
shield_2 {background-position: -900px 0; width: 90px; height: 90px}
shield_1 {background-position: -990px 0; width: 90px; height: 90px}
head_5 {background-position: -1080px 0; width: 90px; height: 90px}
head_4 {background-position: -1170px 0; width: 90px; height: 90px}
head_3 {background-position: -1260px 0; width: 90px; height: 90px}
head_2 {background-position: -1350px 0; width: 90px; height: 90px}
head_1 {background-position: -1440px 0; width: 90px; height: 90px}
head_0 {background-position: -1530px 0; width: 90px; height: 90px}
hair blond {background-position: -1620px 0; width: 90px; height: 90px}
hair black {background-position: -1710px 0; width: 90px; height: 90px}
hair brown {background-position: -1800px 0; width: 90px; height: 90px}
hair white {background-position: -1890px 0; width: 90px; height: 90px}
armor_5 {background-position: -1980px 0; width: 90px; height: 90px}
armor_4 {background-position: -2070px 0; width: 90px; height: 90px}
armor_3 {background-position: -2160px 0; width: 90px; height: 90px}
armor_2 {background-position: -2250px 0; width: 90px; height: 90px}
armor_1 {background-position: -2340px 0; width: 90px; height: 90px}
armor_0 {background-position: -2430px 0; width: 90px; height: 90px}
skin_dead {background-position: -2520px 0; width: 90px; height: 90px}
skin_orc {background-position: -2610px 0; width: 90px; height: 90px}
skin_asian {background-position: -2700px 0; width: 90px; height: 90px}
skin_black {background-position: -2790px 0; width: 90px; height: 90px}
skin_white {background-position: -2880px 0; width: 90px; height: 90px}

View file

@ -1,114 +1,231 @@
.m_weapon_6,
.m_weapon_5,
.m_weapon_4,
.m_weapon_3,
.m_weapon_2,
.m_weapon_1,
.m_weapon_0,
.m_shield_5,
.m_shield_4,
.m_shield_3,
.m_shield_2,
.m_shield_1,
.m_head_5,
.m_head_4,
.m_head_3,
.m_head_2,
.m_head_1,
.m_head_0,
.m_hair_blond,
.m_hair_black,
.m_hair_brown,
.m_hair_white,
.m_armor_5,
.m_armor_4,
.m_armor_3,
.m_armor_2,
.m_armor_1,
.m_armor_0,
.m_skin_dead,
.m_skin_orc,
.m_skin_asian,
.m_skin_black,
.m_skin_white,
.m_skin_ea8349,
.m_skin_c06534,
.m_skin_98461a,
.m_skin_eb052b,
.m_skin_f69922,
.m_skin_f5d70f,
.m_skin_0ff591,
.m_skin_2b43f6,
.m_skin_d7a9f7,
.m_skin_800ed0,
.m_skin_rainbow,
.m_skin_monster,
.m_skin_pumpkin,
.m_skin_skeleton,
.m_skin_zombie,
.m_skin_ghost,
.m_skin_shadow,
.m_hair_red
{
background: url("../img/sprites/male_sprites.png") no-repeat;
[class*='m_weapon_'],[class*='m_shield_'],[class*='m_head_'],[class*='m_hair_'],[class*='m_armor_'],[class*='m_skin_']{
background: url("../img/sprites/male_sprites.png") no-repeat;
width: 90px;
height: 90px;
}
[class*='m_shield_0'], [class*='m_armor_0'] { background: none; }
.m_head_0 {background-position: -1980px -90px;}
.m_weapon_6 {background-position: 0 0; width: 90px; height: 90px}
.m_weapon_5 {background-position: -90px 0; width: 90px; height: 90px}
.m_weapon_4 {background-position: -180px 0; width: 90px; height: 90px}
.m_weapon_3 {background-position: -270px 0; width: 90px; height: 90px}
.m_weapon_2 {background-position: -360px 0; width: 90px; height: 90px}
.m_weapon_1 {background-position: -450px 0; width: 90px; height: 90px}
.m_weapon_0 {background-position: -540px 0; width: 90px; height: 90px}
.m_shield_5 {background-position: -630px 0; width: 90px; height: 90px}
.m_shield_4 {background-position: -720px 0; width: 90px; height: 90px}
.m_shield_3 {background-position: -810px 0; width: 90px; height: 90px}
.m_shield_2 {background-position: -900px 0; width: 90px; height: 90px}
.m_shield_1 {background-position: -990px 0; width: 90px; height: 90px}
.m_head_5 {background-position: -1080px 0; width: 90px; height: 90px}
.m_head_4 {background-position: -1170px 0; width: 90px; height: 90px}
.m_head_3 {background-position: -1260px 0; width: 90px; height: 90px}
.m_head_2 {background-position: -1350px 0; width: 90px; height: 90px}
.m_head_1 {background-position: -1440px 0; width: 90px; height: 90px}
.m_head_0 {background-position: -1530px 0; width: 90px; height: 90px}
.m_hair_blond {background-position: -1620px 0; width: 90px; height: 90px}
.m_hair_black {background-position: -1710px 0; width: 90px; height: 90px}
.m_hair_brown {background-position: -1800px 0; width: 90px; height: 90px}
.m_hair_white {background-position: -1890px 0; width: 90px; height: 90px}
.m_armor_5 {background-position: -1980px 0; width: 90px; height: 90px}
.m_armor_4 {background-position: -2070px 0; width: 90px; height: 90px}
.m_armor_3 {background-position: -2160px 0; width: 90px; height: 90px}
.m_armor_2 {background-position: -2250px 0; width: 90px; height: 90px}
.m_armor_1 {background-position: -2340px 0; width: 90px; height: 90px}
.m_armor_0 {background-position: -2430px 0; width: 90px; height: 90px}
/* ---------------- Weapons --------------- */
.m_weapon_6-,.m_weapon_6-warrior {background-position: 0px 0px; }
.m_weapon_5-,.m_weapon_5-warrior {background-position: -90px 0px; }
.m_weapon_4-,.m_weapon_4-warrior {background-position: -180px 0px;}
.m_weapon_3-,.m_weapon_3-warrior {background-position: -270px 0px;}
.m_weapon_2-,.m_weapon_2-warrior {background-position: -360px 0px;}
.m_weapon_1-,.m_weapon_1-warrior {background-position: -450px 0px;}
.m_weapon_0-,.m_weapon_0-warrior {background-position: -540px 0px;}
.m_weapon_6-wizard {background-position: 0px -90px;}
.m_weapon_5-wizard {background-position: -90px -90px;}
.m_weapon_4-wizard {background-position: -180px -90px;}
.m_weapon_3-wizard {background-position: -270px -90px;}
.m_weapon_2-wizard {background-position: -360px -90px;}
.m_weapon_1-wizard {background-position: -450px -90px;}
.m_weapon_0-wizard {background-position: -540px -90px;}
.m_weapon_6-healer {background-position: 0px -180px;}
.m_weapon_5-healer {background-position: -90px -180px;}
.m_weapon_4-healer {background-position: -180px -180px;}
.m_weapon_3-healer {background-position: -270px -180px;}
.m_weapon_2-healer {background-position: -360px -180px;}
.m_weapon_1-healer {background-position: -450px -180px;}
.m_weapon_0-healer {background-position: -540px -180px;}
.m_weapon_6-rogue {background-position: 0px -270px;}
.m_weapon_5-rogue {background-position: -90px -270px;}
.m_weapon_4-rogue {background-position: -180px -270px;}
.m_weapon_3-rogue {background-position: -270px -270px;}
.m_weapon_2-rogue {background-position: -360px -270px;}
.m_weapon_1-rogue {background-position: -450px -270px;}
.m_weapon_0-rogue {background-position: -540px -270px;}
/* ---------------- Shields --------------- */
.m_shield_5-, .m_shield_5-warrior {background-position: -630px 0px;}
.m_shield_4-, .m_shield_4-warrior {background-position: -720px 0px;}
.m_shield_3-, .m_shield_3-warrior {background-position: -810px 0px;}
.m_shield_2-, .m_shield_2-warrior {background-position: -900px 0px;}
.m_shield_1-, .m_shield_1-warrior {background-position: -990px 0px;}
.m_shield_5-wizard {background:none;}
.m_shield_4-wizard {background:none;}
.m_shield_3-wizard {background:none;}
.m_shield_2-wizard {background:none;}
.m_shield_1-wizard {background:none;}
.m_shield_5-healer {background-position: -630px -180px;}
.m_shield_4-healer {background-position: -720px -180px;}
.m_shield_3-healer {background-position: -810px -180px;}
.m_shield_2-healer {background-position: -900px -180px;}
.m_shield_1-healer {background-position: -990px -180px;}
.m_shield_5-rogue {background: none;}
.m_shield_4-rogue {background: none;}
.m_shield_3-rogue {background: none;}
.m_shield_2-rogue {background: none;}
.m_shield_1-rogue {background: none;}
/* ---------------- Helm --------------- */
.m_head_5-,.m_head_5-warrior {background-position: -1080px 0px; }
.m_head_4-,.m_head_4-warrior {background-position: -1170px 0px; }
.m_head_3-,.m_head_3-warrior {background-position: -1260px 0px; }
.m_head_2-,.m_head_2-warrior {background-position: -1350px 0px; }
.m_head_1-,.m_head_1-warrior {background-position: -1440px 0px; }
.m_head_0-,.m_head_0-warrior {background-position: -1980px -90px;}
.m_head_5-wizard {background-position: -1080px -90px; }
.m_head_4-wizard {background-position: -1170px -90px; }
.m_head_3-wizard {background-position: -1260px -90px; }
.m_head_2-wizard {background-position: -1350px -90px; }
.m_head_1-wizard {background-position: -1440px -90px; }
.m_head_0-wizard {background-position: -1980px -90px;}
.m_head_5-healer {background-position: -1080px -180px; }
.m_head_4-healer {background-position: -1170px -180px; }
.m_head_3-healer {background-position: -1260px -180px; }
.m_head_2-healer {background-position: -1350px -180px; }
.m_head_1-healer {background-position: -1440px -180px; }
.m_head_0-healer {background-position: -1980px -90px;}
.m_head_5-rogue {background-position: -1080px -270px; }
.m_head_4-rogue {background-position: -1170px -270px; }
.m_head_3-rogue {background-position: -1260px -270px; }
.m_head_2-rogue {background-position: -1350px -270px; }
.m_head_1-rogue {background-position: -1440px -270px; }
.m_head_0-rogue {background-position: -1980px -90px;}
/* ---------------- Chest --------------- */
.m_armor_5-,.m_armor_5-warrior {background-position: -1530px 0px;}
.m_armor_4-,.m_armor_4-warrior {background-position: -1620px 0px;}
.m_armor_3-,.m_armor_3-warrior {background-position: -1710px 0px;}
.m_armor_2-,.m_armor_2-warrior {background-position: -1800px 0px;}
.m_armor_1-,.m_armor_1-warrior {background-position: -1890px 0px;}
.m_armor_0-,.m_armor_0-warrior {background-position: -1980px 0px;}
.m_armor_5-wizard {background-position: -1530px -90px;}
.m_armor_4-wizard {background-position: -1620px -90px;}
.m_armor_3-wizard {background-position: -1710px -90px;}
.m_armor_2-wizard {background-position: -1800px -90px;}
.m_armor_1-wizard {background-position: -1890px -90px;}
.m_armor_0-wizard {background-position: -1980px -90px;}
.m_armor_5-healer {background-position: -1530px -180px;}
.m_armor_4-healer {background-position: -1620px -180px;}
.m_armor_3-healer {background-position: -1710px -180px;}
.m_armor_2-healer {background-position: -1800px -180px;}
.m_armor_1-healer {background-position: -1890px -180px;}
.m_armor_0-healer {background-position: -1980px -180px;}
.m_armor_5-rogue {background-position: -1530px -270px;}
.m_armor_4-rogue {background-position: -1620px -270px;}
.m_armor_3-rogue {background-position: -1710px -270px;}
.m_armor_2-rogue {background-position: -1800px -270px;}
.m_armor_1-rogue {background-position: -1890px -270px;}
.m_armor_0-rogue {background-position: -1980px -270px;}
/* ---------------- Skins --------------- */
/* Basic Skins */
.m_skin_dead {background-position: -2520px 0; width: 90px; height: 90px}
.m_skin_orc {background-position: -2610px 0; width: 90px; height: 90px}
.m_skin_asian {background-position: -2700px 0; width: 90px; height: 90px}
.m_skin_black {background-position: -2790px 0; width: 90px; height: 90px}
.m_skin_white {background-position: -2880px 0; width: 90px; height: 90px}
.m_skin_ea8349 {background-position: -2970px 0; width: 90px; height: 90px}
.m_skin_c06534 {background-position: -3060px 0; width: 90px; height: 90px}
.m_skin_98461a {background-position: -3150px 0; width: 90px; height: 90px}
.m_skin_dead {background-position: -2070px 0px;}
.m_skin_orc {background-position: -2160px 0px;}
.m_skin_asian {background-position: -2250px 0px;}
.m_skin_black {background-position: -2340px 0px;}
.m_skin_white {background-position: -2070px -90px;}
.m_skin_ea8349 {background-position: -2160px -90px;}
.m_skin_c06534 {background-position: -2250px -90px;}
.m_skin_98461a {background-position: -2340px -90px;}
/* Crazy Skins */
.m_skin_eb052b {background-position: -3240px 0; width: 90px; height: 90px}
.m_skin_f69922 {background-position: -3330px 0; width: 90px; height: 90px}
.m_skin_f5d70f {background-position: -3420px 0; width: 90px; height: 90px}
.m_skin_0ff591 {background-position: -3510px 0; width: 90px; height: 90px}
.m_skin_2b43f6 {background-position: -3600px 0; width: 90px; height: 90px}
.m_skin_d7a9f7 {background-position: -3690px 0; width: 90px; height: 90px}
.m_skin_800ed0 {background-position: -3780px 0; width: 90px; height: 90px}
.m_skin_rainbow {background-position: -3870px 0; width: 90px; height: 90px}
.m_skin_eb052b {background-position: -2430px -90px;}
.m_skin_f69922 {background-position: -2520px -90px;}
.m_skin_f5d70f {background-position: -2610px -90px;}
.m_skin_0ff591 {background-position: -2700px -90px;}
.m_skin_2b43f6 {background-position: -2070px -180px;}
.m_skin_d7a9f7 {background-position: -2160px -180px;}
.m_skin_800ed0 {background-position: -2250px -180px;}
.m_skin_rainbow {background-position: -2340px -180px;}
/* Halloween Skins */
.m_skin_monster {background-position: -3960px 0; width: 90px; height: 90px}
.m_skin_pumpkin {background-position: -4050px 0; width: 90px; height: 90px}
.m_skin_skeleton {background-position: -4140px 0; width: 90px; height: 90px}
.m_skin_zombie {background-position: -4230px 0; width: 90px; height: 90px}
.m_skin_ghost {background-position: -4320px 0; width: 90px; height: 90px}
.m_skin_shadow {background-position: -4410px 0; width: 90px; height: 90px}
.m_skin_monster {background-position: -2430px -270px;}
.m_skin_pumpkin {background-position: -2520px -270px;}
.m_skin_skeleton {background-position: -2610px -270px;}
.m_skin_zombie {background-position: -2700px -270px;}
.m_skin_ghost {background-position: -2790px -270px;}
.m_skin_shadow {background-position: -2880px -270px;}
/* ---------------- Hair --------------- */
[class*='m_hair_base_0'] {background:none;}
[class*='m_hair_bangs_0'] {background-position: -1980px -90px;}
/* White */
.m_hair_bangs_1_white {background-position: -2610px 0px;}
.m_hair_bangs_2_white {background-position: -2700px 0px;}
.m_hair_bangs_3_white {background-position: -2790px 0px;}
.m_hair_base_1_white {background-position: -2880px 0px;}
.m_hair_base_2_white {background-position: -2970px 0px;}
.m_hair_base_3_white {background-position: -3060px 0px;}
.m_hair_base_4_white {background-position: -3150px 0px;}
.m_hair_base_5_white {background-position: -3240px 0px;}
.m_hair_base_6_white {background-position: -3330px 0px;}
.m_hair_base_7_white {background-position: -3420px 0px;}
.m_hair_base_8_white {background-position: -3510px 0px;}
/* Brown */
.m_hair_bangs_1_brown {background-position: -2610px -90px;}
.m_hair_bangs_2_brown {background-position: -2700px -90px;}
.m_hair_bangs_3_brown {background-position: -2790px -90px;}
.m_hair_base_1_brown {background-position: -2880px -90px;}
.m_hair_base_2_brown {background-position: -2970px -90px;}
.m_hair_base_3_brown {background-position: -3060px -90px;}
.m_hair_base_4_brown {background-position: -3150px -90px;}
.m_hair_base_5_brown {background-position: -3240px -90px;}
.m_hair_base_6_brown {background-position: -3330px -90px;}
.m_hair_base_7_brown {background-position: -3420px -90px;}
.m_hair_base_8_brown {background-position: -3510px -90px;}
/* Blond */
.m_hair_bangs_1_blond {background-position: -2610px -180px;}
.m_hair_bangs_2_blond {background-position: -2700px -180px;}
.m_hair_bangs_3_blond {background-position: -2790px -180px;}
.m_hair_base_1_blond {background-position: -2880px -180px;}
.m_hair_base_2_blond {background-position: -2970px -180px;}
.m_hair_base_3_blond {background-position: -3060px -180px;}
.m_hair_base_4_blond {background-position: -3150px -180px;}
.m_hair_base_5_blond {background-position: -3240px -180px;}
.m_hair_base_6_blond {background-position: -3330px -180px;}
.m_hair_base_7_blond {background-position: -3420px -180px;}
.m_hair_base_8_blond {background-position: -3510px -180px;}
/* Red */
.m_hair_bangs_1_red {background-position: -2610px -270px;}
.m_hair_bangs_2_red {background-position: -2700px -270px;}
.m_hair_bangs_3_red {background-position: -2790px -270px;}
.m_hair_base_1_red {background-position: -2880px -270px;}
.m_hair_base_2_red {background-position: -2970px -270px;}
.m_hair_base_3_red {background-position: -3060px -270px;}
.m_hair_base_4_red {background-position: -3150px -270px;}
.m_hair_base_5_red {background-position: -3240px -270px;}
.m_hair_base_6_red {background-position: -3330px -270px;}
.m_hair_base_7_red {background-position: -3420px -270px;}
.m_hair_base_8_red {background-position: -3510px -270px;}
/* Black */
.m_hair_bangs_1_black {background-position: -2610px -360px;}
.m_hair_bangs_2_black {background-position: -2700px -360px;}
.m_hair_bangs_3_black {background-position: -2790px -360px;}
.m_hair_base_1_black {background-position: -2880px -360px;}
.m_hair_base_2_black {background-position: -2970px -360px;}
.m_hair_base_3_black {background-position: -3060px -360px;}
.m_hair_base_4_black {background-position: -3150px -360px;}
.m_hair_base_5_black {background-position: -3240px -360px;}
.m_hair_base_6_black {background-position: -3330px -360px;}
.m_hair_base_7_black {background-position: -3420px -360px;}
.m_hair_base_8_black {background-position: -3510px -360px;}
.customize-menu [class*='m_hair_'] {width: 60px; height: 60px;}
/* Red Hair */
.m_hair_red {background-position: -4500px 0; width: 90px; height: 90px}

1209
dist/habitrpg-shared.js vendored

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View file

@ -89,7 +89,7 @@ module.exports =
newUser: () ->
userSchema =
# _id / id handled by Racer
stats: { gp: 0, exp: 0, lvl: 1, hp: 50 }
stats: gp: 0, exp: 0, lvl: 1, hp: 50
invitations: {party:null, guilds: []}
items:
weapon: 0
@ -102,8 +102,16 @@ module.exports =
hatchingPotions: {}
pets: {}
mounts: {}
preferences: { gender: 'm', skin: 'white', hair: 'blond', armorSet: 'v1', dayStart:0, showHelm: true }
preferences:
gender: 'm'
skin: 'white'
hair: color: 'blond', base: 0, bangs: 1
#armorSet: 'v1'
dayStart:0
showHelm: true
showArmor: true
showWeapon: true
showShield: true
apiToken: uuid() # set in newUserObject below
lastCron: +new Date #this will be replaced with `+new Date` on first run
balance: 0

View file

@ -42,8 +42,133 @@ items = module.exports.items =
{index: 6, text: "Tormented Skull", classes: 'shield_6', notes:'Decreases Health loss by 9%.', defense: 9, value:120, canOwn: ((u)-> +u.backer?.tier >= 45)}
{index: 7, text: "Crystal Shield", classes: 'shield_7', notes:'Decreases Health loss by 10%.', defense: 10, value:150, canOwn: ((u)-> +u.contributor?.level >= 5)}
]
potion: {type: 'potion', text: "Health Potion", notes: "Recover 15 Health (Instant Use)", 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 }
potion:
type: 'potion', text: "Health Potion", notes: "Recover 15 Health (Instant Use)", 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
###
Spell definitions. Text, notes, and mana are obvious. The rest:
* {target}: one of [task, self, party, user]. This is very important, because if the cast() function is expecting one
thing and receives another, it will cause errors. `self` is used for self buffs, multi-task debuffs, AOEs (eg, meteor-shower),
etc. Basically, use self for anything that's not [task, party, user] and is an instant-cast
* {cast}: the fucntion that's run to perform the ability's action. This is pretty slick - because this is exported to the
web, this function can be performed on the client and on the server. `user` param is self (needed for determining your
own stats for effectiveness of cast), and `target` param is one of [task, party, user]. In the case of `self` spells,
you act on `user` instead of `target`. You can trust these are the correct objects, as long as the `target` attr of the
spell is correct. Take a look at habitrpg/src/models/user.js and habitrpg/src/models/task.js for what attributes are
available on each model. Note `task.value` is its "redness". If party is passed in, it's an array of users,
so you'll want to iterate over them like: `_.each(target,function(member){...})`
Note, user.stats.mp is docked after automatically (it's appended to functions automatically down below in an _.each)
###
spells:
wizard:
fireball:
text: 'Fireball'
mana: 10
target: 'task'
notes: 'Burns a task, granting additional exp & decreasing its redness.'
cast: (user, target) ->
target.value += user.stats.int * crit(user)
ice:
text: 'Ice Wall'
mana: 25
target: 'task'
notes: 'Freezes all tasks, slowing the damage they deal you for one day'
cast: (user, target) ->
_.each user.tasks, (task) ->
task.buffs.value ?= task.value
task.buffs.value += user.stats.int
meteorShower:
text: 'Meteor Shower'
mana: 40
target: 'self'
notes: "Causes damage to all tasks, reducing their redness",
cast: (user, target) ->
_.each user.tasks, ((task) ->task.value += user.stats.int)
warrior:
bash:
text: 'Bash'
mana: 10
target: 'task'
notes: 'Hit a single task hard'
cast: (user, target) ->
target.value += user.stats.str * crit(user)
intimidate:
text: 'Intimidate'
mana: 10
target: 'task'
notes: "Intimidate a task, making it flee"
cast: (user, target) ->
(target.buffs ?= {}).value = 9999
defensiveStance:
text: 'Defensive Stance'
target: 'self'
mana: 10
notes: 'Prepare yourself for the onslaught of tasks'
cast: (user, target) ->
user.stats.buffs.def = user.stats.def
rogue:
backStab:
text: 'Back Stab'
mana: 10
target: 'task'
notes: 'High crit chance, stab a habit from behind'
cast: (user, target) ->
_crit = crit(user)
target.value += _crit
user.stats.gp += _crit
pickPocket:
text: 'Pick Pocket'
target: 'task'
mana: 10
notes: 'High chance of getting a free drop from a task'
cast: (user, target) ->
user.stats.gp += target.value * user.stats.per
stealth:
text: 'Stealth'
target: 'self'
mana: 40
notes: 'Hide from as many tasks as you can for one day'
cast: (user, target) ->
user.stats.buffs.stealth = user.stats.per # number of tasks you'll evade
healer:
heal:
text: 'Heal'
mana: 10
target: 'user'
notes: 'Heals self (user.hp += user.def, INT decreases mana cost)'
cast: (user, target) ->
target.stats.hp += user.stats.def
healAll:
text: 'Heal All'
mana: 20
target: 'party'
notes: 'Heals party (user.hp += user.def, INT decreases mana cost)'
cast: (user, target) ->
_.each target, ((member) -> member.stats.hp += user.def)
empower:
text: 'Empower'
mana: 20
target: 'user'
notes: "Increases target's highest stat"
cast: (user, target) ->
# TODO find highst stat, not just str
highestStat = 'str'
(target.stats.buffs ?= {})[highestStat] += (user.def/2)
shield:
text: 'Shield'
mana: 20
target: 'user'
notes: "Increases target's defense for one day"
cast: (user, target) ->
(target.stats.buffs ?= {}).def += user.def
eggs:
# value & other defaults set below
@ -88,9 +213,10 @@ items = module.exports.items =
Saddle: text: 'Saddle', value: 5, notes: 'Instantly raises your pet into a mount.'
# we somtimes want item arrays above in reverse order, for backward lookups (you'll see later in the code)
reversed = {}
crit = (user) -> (Math.random() * user.stats.per + 1)
# we sometimes want item arrays above in reverse order, for backward lookups (you'll see later in the code)
reversed = {}
_.each ['weapon', 'armor', 'head', 'shield'], (type) ->
reversed[type] = items[type].slice().reverse()
# add "type" to each item, so we can reference that as "weapon" or "armor" in the html
@ -110,6 +236,16 @@ _.each items.hatchingPotions, (pot,k) ->
_.each items.food, (food,k) ->
_.defaults food, {value: 1, name: k, notes: "Feed this to a pet and it may grow into a sturdy steed."}
# Intercept all spells to reduce user.stats.mp after casting the spell
_.each items.spells, (spellClass) ->
_.each spellClass, (spell, k) ->
spell.name = k
_cast = spell.cast
spell.cast = (user, target) ->
#return if spell.target and spell.target != (if target.type then 'task' else 'user')
_cast(user,target)
user.stats.mp = user.stats.mp - spell.mana
module.exports.buyItem = (user, type) ->
nextItem =
if type is 'potion' then items.potion
@ -160,9 +296,10 @@ module.exports.equipped = (type, item=0, pref={gender:'m', armorSet:'v1'}, backe
# backer / contrib (they don't have gender)
return "#{type}_#{item}" if (item > lastStandardItem)
# Females have some special thing going on for their armor / helms
if (type in ['armor', 'head'] and pref.gender is 'f')
return "f_armor_#{item}_#{pref.armorSet}" if (item is 0 and type is 'armor')
return "f_head_#{item}_#{pref.armorSet}" if (item > 1 and type is 'head')
return "#{pref.gender}_#{type}_#{item}"
# # Females have some special thing going on for their armor / helms
# if (type in ['armor', 'head'] and pref.gender is 'f')
# return "f_armor_#{item}_#{pref.armorSet}" if (item is 0 and type is 'armor')
# return "f_head_#{item}_#{pref.armorSet}" if (item > 1 and type is 'head')
#
# return "#{pref.gender}_#{type}_#{item}"
return "m_#{type}_#{item}"