feat(plans): add time traveler - buy individual mystery items

This commit is contained in:
Tyler Renelle
2014-11-28 19:44:32 -07:00
parent 76be625f6d
commit d81badde69
37 changed files with 4644 additions and 4405 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+107 -19
View File
@@ -9897,6 +9897,14 @@ mystery = {
start: '2014-11-24',
end: '2014-12-02'
},
301404: {
start: '3014-03-24',
end: '3014-04-02'
},
301405: {
start: '3014-04-24',
end: '3014-05-02'
},
wondercon: {
start: '2014-03-24',
end: '2014-04-01'
@@ -10403,6 +10411,12 @@ gear = {
notes: t('weaponMystery201411Notes'),
mystery: mystery['201411'],
value: 0
},
301404: {
text: t('weaponMystery301404Text'),
notes: t('weaponMystery301404Notes'),
mystery: mystery['301404'],
value: 0
}
}
},
@@ -10848,6 +10862,12 @@ gear = {
notes: t('armorMystery201410Notes'),
mystery: mystery['201410'],
value: 0
},
301404: {
text: t('armorMystery301404Text'),
notes: t('armorMystery301404Notes'),
mystery: mystery['301404'],
value: 0
}
}
},
@@ -11281,6 +11301,18 @@ gear = {
notes: t('headMystery201411Notes'),
mystery: mystery['201411'],
value: 0
},
301404: {
text: t('headMystery301404Text'),
notes: t('headMystery301404Notes'),
mystery: mystery['301404'],
value: 0
},
301405: {
text: t('headMystery301405Text'),
notes: t('headMystery301405Notes'),
mystery: mystery['301405'],
value: 0
}
}
},
@@ -11596,6 +11628,14 @@ gear = {
value: 70,
con: 9
}
},
mystery: {
301405: {
text: t('shieldMystery301405Text'),
notes: t('shieldMystery301405Notes'),
mystery: mystery['301405'],
value: 0
}
}
},
back: {
@@ -11741,6 +11781,12 @@ gear = {
notes: t('headAccessoryMystery201409Notes'),
mystery: mystery['201409'],
value: 0
},
301405: {
text: t('headAccessoryMystery301405Text'),
notes: t('headAccessoryMystery301405Notes'),
mystery: mystery['301405'],
value: 0
}
}
},
@@ -11780,6 +11826,20 @@ gear = {
notes: t('eyewearSpecialSummerWarriorNotes'),
value: 20
}
},
mystery: {
301404: {
text: t('eyewearMystery301404Text'),
notes: t('eyewearMystery301404Notes'),
mystery: mystery['301404'],
value: 0
},
301405: {
text: t('eyewearMystery301405Text'),
notes: t('eyewearMystery301405Notes'),
mystery: mystery['301405'],
value: 0
}
}
}
};
@@ -13621,6 +13681,20 @@ api.backgrounds = {
text: t('backgroundStarrySkiesText'),
notes: t('backgroundStarrySkiesNotes')
}
},
backgrounds122014: {
iceberg: {
text: t('backgroundIcebergText'),
notes: t('backgroundIcebergNotes')
},
twinkly_lights: {
text: t('backgroundTwinklyLightsText'),
notes: t('backgroundTwinklyLightsNotes')
},
south_pole: {
text: t('backgroundSouthPoleText'),
notes: t('backgroundSouthPoleNotes')
}
}
};
@@ -15052,26 +15126,36 @@ api.wrap = function(user, main) {
return typeof cb === "function" ? cb(null, user) : void 0;
},
buy: function(req, cb) {
var item, key, message;
var item, key, message, trinket;
key = req.params.key;
trinket = req.query.trinket;
item = key === 'potion' ? content.potion : content.gear.flat[key];
if (!item) {
return typeof cb === "function" ? cb({
code: 404,
message: "Item '" + key + " not found (see https://github.com/HabitRPG/habitrpg-shared/blob/develop/script/content.coffee)"
}) : void 0;
}
if (user.stats.gp < item.value) {
return typeof cb === "function" ? cb({
code: 401,
message: i18n.t('messageNotEnoughGold', req.language)
}) : void 0;
}
if ((item.canOwn != null) && !item.canOwn(user)) {
return typeof cb === "function" ? cb({
code: 401,
message: "You can't own this item"
}) : void 0;
if (trinket) {
if (!(item.klass === 'mystery' && user.purchased.plan.consecutive.trinkets > 0)) {
return typeof cb === "function" ? cb({
code: 401,
message: "Not enough Time Trinkets"
}) : void 0;
}
} else {
if (!item) {
return typeof cb === "function" ? cb({
code: 404,
message: "Item '" + key + " not found (see https://github.com/HabitRPG/habitrpg-shared/blob/develop/script/content.coffee)"
}) : void 0;
}
if (user.stats.gp < item.value) {
return typeof cb === "function" ? cb({
code: 401,
message: i18n.t('messageNotEnoughGold', req.language)
}) : void 0;
}
if ((item.canOwn != null) && !item.canOwn(user)) {
return typeof cb === "function" ? cb({
code: 401,
message: "You can't own this item"
}) : void 0;
}
}
if (item.key === 'potion') {
user.stats.hp += 15;
@@ -15091,7 +15175,11 @@ api.wrap = function(user, main) {
user.fns.ultimateGear();
}
}
user.stats.gp -= item.value;
if (trinket) {
user.purchased.plan.consecutive.trinkets--;
} else {
user.stats.gp -= item.value;
}
return typeof cb === "function" ? cb({
code: 200,
message: message
+93 -57
View File
@@ -1464,25 +1464,25 @@
}
.hair_mustache_1_porange {
background-image: url(spritesmith0.png);
background-position: -706px -296px;
background-position: -637px -1138px;
width: 90px;
height: 90px;
}
.customize-option.hair_mustache_1_porange {
background-image: url(spritesmith0.png);
background-position: -731px -311px;
background-position: -662px -1153px;
width: 60px;
height: 60px;
}
.hair_mustache_1_ppink {
background-image: url(spritesmith0.png);
background-position: -728px -1138px;
background-position: -706px -296px;
width: 90px;
height: 90px;
}
.customize-option.hair_mustache_1_ppink {
background-image: url(spritesmith0.png);
background-position: -753px -1153px;
background-position: -731px -311px;
width: 60px;
height: 60px;
}
@@ -2892,323 +2892,359 @@
}
.hair_bangs_3_pyellow {
background-image: url(spritesmith0.png);
background-position: -637px -1138px;
background-position: -546px -1502px;
width: 90px;
height: 90px;
}
.customize-option.hair_bangs_3_pyellow {
background-image: url(spritesmith0.png);
background-position: -662px -1153px;
background-position: -571px -1517px;
width: 60px;
height: 60px;
}
.hair_bangs_3_rainbow {
background-image: url(spritesmith0.png);
background-position: -91px -592px;
background-position: -637px -1502px;
width: 90px;
height: 90px;
}
.customize-option.hair_bangs_3_rainbow {
background-image: url(spritesmith0.png);
background-position: -116px -607px;
background-position: -662px -1517px;
width: 60px;
height: 60px;
}
.hair_bangs_3_red {
background-image: url(spritesmith0.png);
background-position: 0px -592px;
background-position: -728px -1502px;
width: 90px;
height: 90px;
}
.customize-option.hair_bangs_3_red {
background-image: url(spritesmith0.png);
background-position: -25px -607px;
background-position: -753px -1517px;
width: 60px;
height: 60px;
}
.hair_bangs_3_white {
background-image: url(spritesmith0.png);
background-position: -565px -444px;
background-position: -728px -1138px;
width: 90px;
height: 90px;
}
.customize-option.hair_bangs_3_white {
background-image: url(spritesmith0.png);
background-position: -590px -459px;
background-position: -753px -1153px;
width: 60px;
height: 60px;
}
.hair_bangs_3_winternight {
background-image: url(spritesmith0.png);
background-position: -706px -478px;
background-position: -91px -592px;
width: 90px;
height: 90px;
}
.customize-option.hair_bangs_3_winternight {
background-image: url(spritesmith0.png);
background-position: -731px -493px;
background-position: -116px -607px;
width: 60px;
height: 60px;
}
.hair_bangs_3_yellow {
background-image: url(spritesmith0.png);
background-position: -706px -387px;
background-position: 0px -592px;
width: 90px;
height: 90px;
}
.customize-option.hair_bangs_3_yellow {
background-image: url(spritesmith0.png);
background-position: -731px -402px;
background-position: -25px -607px;
width: 60px;
height: 60px;
}
.hair_bangs_3_zombie {
background-image: url(spritesmith0.png);
background-position: -848px -364px;
background-position: -565px -444px;
width: 90px;
height: 90px;
}
.customize-option.hair_bangs_3_zombie {
background-image: url(spritesmith0.png);
background-position: -873px -379px;
background-position: -590px -459px;
width: 60px;
height: 60px;
}
.hair_base_1_TRUred {
background-image: url(spritesmith0.png);
background-position: -848px -273px;
background-position: -706px -478px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_TRUred {
background-image: url(spritesmith0.png);
background-position: -873px -288px;
background-position: -731px -493px;
width: 60px;
height: 60px;
}
.hair_base_1_black {
background-image: url(spritesmith0.png);
background-position: -848px -182px;
background-position: -706px -387px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_black {
background-image: url(spritesmith0.png);
background-position: -873px -197px;
background-position: -731px -402px;
width: 60px;
height: 60px;
}
.hair_base_1_blond {
background-image: url(spritesmith0.png);
background-position: -848px -91px;
background-position: -848px -364px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_blond {
background-image: url(spritesmith0.png);
background-position: -873px -106px;
background-position: -873px -379px;
width: 60px;
height: 60px;
}
.hair_base_1_blue {
background-image: url(spritesmith0.png);
background-position: -848px 0px;
background-position: -848px -273px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_blue {
background-image: url(spritesmith0.png);
background-position: -873px -15px;
background-position: -873px -288px;
width: 60px;
height: 60px;
}
.hair_base_1_brown {
background-image: url(spritesmith0.png);
background-position: -728px -683px;
background-position: -848px -182px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_brown {
background-image: url(spritesmith0.png);
background-position: -753px -698px;
background-position: -873px -197px;
width: 60px;
height: 60px;
}
.hair_base_1_candycane {
background-image: url(spritesmith0.png);
background-position: -637px -683px;
background-position: -848px -91px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_candycane {
background-image: url(spritesmith0.png);
background-position: -662px -698px;
background-position: -873px -106px;
width: 60px;
height: 60px;
}
.hair_base_1_candycorn {
background-image: url(spritesmith0.png);
background-position: -546px -683px;
background-position: -848px 0px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_candycorn {
background-image: url(spritesmith0.png);
background-position: -571px -698px;
background-position: -873px -15px;
width: 60px;
height: 60px;
}
.hair_base_1_frost {
background-image: url(spritesmith0.png);
background-position: -455px -683px;
background-position: -728px -683px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_frost {
background-image: url(spritesmith0.png);
background-position: -480px -698px;
background-position: -753px -698px;
width: 60px;
height: 60px;
}
.hair_base_1_ghostwhite {
background-image: url(spritesmith0.png);
background-position: -364px -683px;
background-position: -637px -683px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_ghostwhite {
background-image: url(spritesmith0.png);
background-position: -389px -698px;
background-position: -662px -698px;
width: 60px;
height: 60px;
}
.hair_base_1_green {
background-image: url(spritesmith0.png);
background-position: -273px -683px;
background-position: -546px -683px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_green {
background-image: url(spritesmith0.png);
background-position: -298px -698px;
background-position: -571px -698px;
width: 60px;
height: 60px;
}
.hair_base_1_halloween {
background-image: url(spritesmith0.png);
background-position: -182px -683px;
background-position: -455px -683px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_halloween {
background-image: url(spritesmith0.png);
background-position: -207px -698px;
background-position: -480px -698px;
width: 60px;
height: 60px;
}
.hair_base_1_holly {
background-image: url(spritesmith0.png);
background-position: -91px -683px;
background-position: -364px -683px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_holly {
background-image: url(spritesmith0.png);
background-position: -116px -698px;
background-position: -389px -698px;
width: 60px;
height: 60px;
}
.hair_base_1_midnight {
background-image: url(spritesmith0.png);
background-position: 0px -683px;
background-position: -273px -683px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_midnight {
background-image: url(spritesmith0.png);
background-position: -25px -698px;
background-position: -298px -698px;
width: 60px;
height: 60px;
}
.hair_base_1_pblue {
background-image: url(spritesmith0.png);
background-position: -728px -592px;
background-position: -182px -683px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_pblue {
background-image: url(spritesmith0.png);
background-position: -753px -607px;
background-position: -207px -698px;
width: 60px;
height: 60px;
}
.hair_base_1_pgreen {
background-image: url(spritesmith0.png);
background-position: -637px -592px;
background-position: -91px -683px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_pgreen {
background-image: url(spritesmith0.png);
background-position: -662px -607px;
background-position: -116px -698px;
width: 60px;
height: 60px;
}
.hair_base_1_porange {
background-image: url(spritesmith0.png);
background-position: -546px -592px;
background-position: 0px -683px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_porange {
background-image: url(spritesmith0.png);
background-position: -571px -607px;
background-position: -25px -698px;
width: 60px;
height: 60px;
}
.hair_base_1_ppink {
background-image: url(spritesmith0.png);
background-position: -455px -592px;
background-position: -728px -592px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_ppink {
background-image: url(spritesmith0.png);
background-position: -480px -607px;
background-position: -753px -607px;
width: 60px;
height: 60px;
}
.hair_base_1_ppurple {
background-image: url(spritesmith0.png);
background-position: -364px -592px;
background-position: -637px -592px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_ppurple {
background-image: url(spritesmith0.png);
background-position: -389px -607px;
background-position: -662px -607px;
width: 60px;
height: 60px;
}
.hair_base_1_pumpkin {
background-image: url(spritesmith0.png);
background-position: -273px -592px;
background-position: -546px -592px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_pumpkin {
background-image: url(spritesmith0.png);
background-position: -298px -607px;
background-position: -571px -607px;
width: 60px;
height: 60px;
}
.hair_base_1_purple {
background-image: url(spritesmith0.png);
background-position: -182px -592px;
background-position: -455px -592px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_purple {
background-image: url(spritesmith0.png);
background-position: -480px -607px;
width: 60px;
height: 60px;
}
.hair_base_1_pyellow {
background-image: url(spritesmith0.png);
background-position: -364px -592px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_pyellow {
background-image: url(spritesmith0.png);
background-position: -389px -607px;
width: 60px;
height: 60px;
}
.hair_base_1_rainbow {
background-image: url(spritesmith0.png);
background-position: -273px -592px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_rainbow {
background-image: url(spritesmith0.png);
background-position: -298px -607px;
width: 60px;
height: 60px;
}
.hair_base_1_red {
background-image: url(spritesmith0.png);
background-position: -182px -592px;
width: 90px;
height: 90px;
}
.customize-option.hair_base_1_red {
background-image: url(spritesmith0.png);
background-position: -207px -607px;
width: 60px;
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 KiB

After

Width:  |  Height:  |  Size: 150 KiB

+2051 -2051
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 KiB

After

Width:  |  Height:  |  Size: 87 KiB

+482 -458
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

After

Width:  |  Height:  |  Size: 104 KiB

+1032 -1014
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 330 KiB

After

Width:  |  Height:  |  Size: 272 KiB

+332 -308
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 KiB

After

Width:  |  Height:  |  Size: 210 KiB

+507 -489
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 KiB

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 491 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

+19 -3
View File
@@ -111,6 +111,8 @@
"weaponMystery201411Text": "Pitchfork of Feasting",
"weaponMystery201411Notes": "Stab your enemies or dig in to your favorite foods - this versatile pitchfork does it all! Confers no benefit. November 2014 Subscriber Item.",
"weaponMystery301404Text": "Steampunk Cane",
"weaponMystery301404Notes": "Excellent for taking a turn about town. March 3015 Subscriber Item. Confers no benefit.",
"armorBase0Text": "Plain Clothing",
"armorBase0Notes": "Ordinary clothing. Confers no benefit.",
@@ -223,6 +225,8 @@
"armorMystery201409Notes": "A leaf-covered vest that camouflages the wearer. Confers no benefit. September 2014 Subscriber Item.",
"armorMystery201410Text": "Goblin Gear",
"armorMystery201410Notes": "Scaly, slimy, and strong! Confers no benefit. October 2014 Subscriber Item.",
"armorMystery301404Text": "Steampunk Suit",
"armorMystery301404Notes": "Dapper and dashing, wot! February 3015 Subscriber Item. Confers no benefit.",
"headBase0Text": "No Helm",
"headBase0Notes": "No headgear.",
@@ -321,7 +325,6 @@
"headMystery201402Text": "Winged Helm",
"headMystery201402Notes": "This winged circlet imbues the wearer with the speed of the wind! Confers no benefit. February 2014 Subscriber Item.",
"headMystery201405Text": "Flame of Mind",
"headMystery201405Notes": "Burn away the procrastination! Confers no benefit. May 2014 Subscriber Item.",
"headMystery201406Text": "Crown of Tentacles",
@@ -332,6 +335,10 @@
"headMystery201408Notes": "This blazing crown gives its wearer great strength of will. Confers no benefit. August 2014 Subscriber Item.",
"headMystery201411Text": "Steel Helm of Sporting",
"headMystery201411Notes": "This is the traditional helmet worn in the beloved Habitican sport of Balance Ball, which consists of covering yourself with heavy protective gear and then committing to a healthy work-life balance..... WHILE PURSUED BY HIPPOGRIFFS. Confers no benefit. November 2014 Subscriber Item.",
"headMystery301404Text": "Fancy Top Hat",
"headMystery301404Notes": "A fancy top hat for the finest of gentlefolk! January 3015 Subscriber Item. Confers no benefit.",
"headMystery301405Text": "Basic Top Hat",
"headMystery301405Notes": "A basic top hat, just begging to be paired with some fancy head accessories. May 3015 Subscriber Item. Confers no benefit.",
"shieldBase0Text": "No Off-Hand Equipment",
"shieldBase0Notes": "No shield or second weapon.",
@@ -392,6 +399,9 @@
"shieldSpecialFallHealerText": "Jeweled Shield",
"shieldSpecialFallHealerNotes": "This glittery shield was found in an ancient tomb. Increases Constitution by <%= con %>. Limited Edition 2014 Autumn Gear.",
"shieldMystery301405Text": "Clock Shield",
"shieldMystery301405Notes": "Time is on your side with this towering clock shield! June 3015 Subscriber Item. Confers no benefit.",
"backBase0Text": "No Back Accessory",
"backBase0Notes": "No Back Accessory.",
@@ -438,10 +448,11 @@
"headAccessoryMystery201403Notes": "These antlers shimmer with moss and lichen. Confers no benefit. March 2014 Subscriber Item.",
"headAccessoryMystery201404Text": "Twilight Butterfly Antennae",
"headAccessoryMystery201404Notes": "These antennae help the wearer sense dangerous distractions!",
"headAccessoryMystery201404Notes": "These antennae help the wearer sense dangerous distractions! Confers no benefit. April 2014 Subscriber Item.",
"headAccessoryMystery201409Text": "Autumn Antlers",
"headAccessoryMystery201409Notes": "These powerful antlers change colors with the leaves. Confers no benefit. September 2014 Subscriber Item.",
"headAccessoryMystery301405Text": "Headwear Goggles",
"headAccessoryMystery301405Notes": "\"Goggles are for your eyes,\" they said. \"Nobody wants goggles that you can only wear on your head,\" they said. Hah! You sure showed them! August 3015 Subscriber Item. Confers no benefit.",
"eyewearBase0Text": "No Eyewear",
"eyewearBase0Notes": "No Eyewear.",
@@ -454,5 +465,10 @@
"eyewearSpecialWonderconRedText": "Mighty Mask",
"eyewearSpecialWonderconRedNotes": "What a powerful face accessory! Confers no benefit. Special Edition Convention Item.",
"eyewearSpecialWonderconBlackText": "Sneaky Mask",
"eyewearSpecialWonderconBlackNotes": "Your motives are definitely legitimate. Confers no benefit. Special Edition Convention Item."
"eyewearSpecialWonderconBlackNotes": "Your motives are definitely legitimate. Confers no benefit. Special Edition Convention Item.",
"eyewearMystery301404Text": "Eyewear Goggles",
"eyewearMystery301404Notes": "No eyewear could be fancier than a pair of goggles - except, perhaps, for a monocle. April 3015 Subscriber Item. Confers no benefit.",
"eyewearMystery301405Text": "Monocle",
"eyewearMystery301405Notes": "No eyewear could be fancier than a monocle - except, perhaps, for a pair of goggles. July 3015 Subscriber Item. Confers no benefit."
}
+12
View File
@@ -38,6 +38,8 @@ mystery =
201409: {start:'2014-09-24',end:'2014-10-02'}
201410: {start:'2014-10-24',end:'2014-11-02'}
201411: {start:'2014-11-24',end:'2014-12-02'}
301404: {start:'3014-03-24',end:'3014-04-02'}
301405: {start:'3014-04-24',end:'3014-05-02'}
wondercon: {start:'2014-03-24',end:'2014-04-01'} # not really, but the mechanic works
gear =
@@ -113,6 +115,7 @@ gear =
fallHealer: event: events.fall, specialClass: 'healer', text: t('weaponSpecialFallHealerText'), notes: t('weaponSpecialFallHealerNotes', {int: 9}), value: 90, int: 9
mystery:
201411: text: t('weaponMystery201411Text'), notes: t('weaponMystery201411Notes'), mystery:mystery['201411'], value: 0
301404: text: t('weaponMystery301404Text'), notes: t('weaponMystery301404Notes'), mystery:mystery['301404'], value: 0
armor:
base:
@@ -181,6 +184,7 @@ gear =
201408: text: t('armorMystery201408Text'), notes: t('armorMystery201408Notes'), mystery:mystery['201408'], value: 0
201409: text: t('armorMystery201409Text'), notes: t('armorMystery201409Notes'), mystery:mystery['201409'], value: 0
201410: text: t('armorMystery201410Text'), notes: t('armorMystery201410Notes'), mystery:mystery['201410'], value: 0
301404: text: t('armorMystery301404Text'), notes: t('armorMystery301404Notes'), mystery:mystery['301404'], value: 0
head:
base:
@@ -247,6 +251,8 @@ gear =
201407: text: t('headMystery201407Text'), notes: t('headMystery201407Notes'), mystery:mystery['201407'], value: 0
201408: text: t('headMystery201408Text'), notes: t('headMystery201408Notes'), mystery:mystery['201408'], value: 0
201411: text: t('headMystery201411Text'), notes: t('headMystery201411Notes'), mystery:mystery['201411'], value: 0
301404: text: t('headMystery301404Text'), notes: t('headMystery301404Notes'), mystery:mystery['301404'], value: 0
301405: text: t('headMystery301405Text'), notes: t('headMystery301405Notes'), mystery:mystery['301405'], value: 0
shield:
base:
@@ -296,6 +302,8 @@ gear =
fallRogue: event: events.fall, specialClass: 'rogue', text: t('shieldSpecialFallRogueText'), notes: t('shieldSpecialFallRogueNotes', {str: 8}), value: 80, str: 8
fallWarrior: event: events.fall, specialClass: 'warrior', text: t('shieldSpecialFallWarriorText'), notes: t('shieldSpecialFallWarriorNotes', {con: 7}), value: 70, con: 7
fallHealer: event: events.fall, specialClass: 'healer', text: t('shieldSpecialFallHealerText'), notes: t('shieldSpecialFallHealerNotes', {con: 9}), value: 70, con: 9
mystery:
301405: text: t('shieldMystery301405Text'), notes: t('shieldMystery301405Notes'), mystery:mystery['301405'], value: 0
back:
base:
@@ -333,6 +341,7 @@ gear =
201403: text: t('headAccessoryMystery201403Text'), notes: t('headAccessoryMystery201403Notes'), mystery:mystery['201403'], value: 0
201404: text: t('headAccessoryMystery201404Text'), notes: t('headAccessoryMystery201404Notes'), mystery:mystery['201404'], value: 0
201409: text: t('headAccessoryMystery201409Text'), notes: t('headAccessoryMystery201409Notes'), mystery:mystery['201409'], value: 0
301405: text: t('headAccessoryMystery301405Text'), notes: t('headAccessoryMystery301405Notes'), mystery:mystery['301405'], value: 0
eyewear:
base:
@@ -343,6 +352,9 @@ gear =
#Summer
summerRogue: event: events.summer, specialClass: 'rogue', text: t('eyewearSpecialSummerRogueText'), notes: t('eyewearSpecialSummerRogueNotes'), value: 20
summerWarrior: event: events.summer, specialClass: 'warrior', text: t('eyewearSpecialSummerWarriorText'), notes: t('eyewearSpecialSummerWarriorNotes'), value: 20
mystery:
301404: text: t('eyewearMystery301404Text'), notes: t('eyewearMystery301404Notes'), mystery:mystery['301404'], value: 0
301405: text: t('eyewearMystery301405Text'), notes: t('eyewearMystery301405Notes'), mystery:mystery['301405'], value: 0
###
The gear is exported as a tree (defined above), and a flat list (eg, {weapon_healer_1: .., shield_special_0: ...}) since
+8 -5
View File
@@ -745,11 +745,14 @@ api.wrap = (user, main=true) ->
# buy is for gear, purchase is for gem-purchaseables (i know, I know...)
buy: (req, cb) ->
{key} = req.params
{trinket} = req.query
item = if key is 'potion' then content.potion else content.gear.flat[key]
return cb?({code:404, message:"Item '#{key} not found (see https://github.com/HabitRPG/habitrpg-shared/blob/develop/script/content.coffee)"}) unless item
return cb?({code:401, message: i18n.t('messageNotEnoughGold', req.language)}) if user.stats.gp < item.value
return cb?({code:401, message: "You can't own this item"}) if item.canOwn? and !item.canOwn(user)
if trinket
return cb?({code:401, message: "Not enough Time Trinkets"}) unless item.klass=='mystery' and user.purchased.plan.consecutive.trinkets>0
else
return cb?({code:404, message:"Item '#{key} not found (see https://github.com/HabitRPG/habitrpg-shared/blob/develop/script/content.coffee)"}) unless item
return cb?({code:401, message: i18n.t('messageNotEnoughGold', req.language)}) if user.stats.gp < item.value
return cb?({code:401, message: "You can't own this item"}) if item.canOwn? and !item.canOwn(user)
if item.key is 'potion'
user.stats.hp += 15
user.stats.hp = 50 if user.stats.hp > 50
@@ -760,7 +763,7 @@ api.wrap = (user, main=true) ->
message ?= i18n.t('messageBought', {itemText: item.text(req.language)}, req.language)
if not user.achievements.ultimateGear and item.last
user.fns.ultimateGear()
user.stats.gp -= item.value
if trinket then user.purchased.plan.consecutive.trinkets-- else user.stats.gp -= item.value
cb? {code:200, message}, _.pick(user,$w 'items achievements stats')
sell: (req, cb) ->