Merge branch 'develop' of github.com:HabitRPG/habitrpg into mountmaster

This commit is contained in:
Blade Barringer 2015-01-16 10:44:52 -06:00
commit 10bc7e4eac
7 changed files with 71 additions and 23 deletions

View file

@ -16,10 +16,10 @@
"dependencies": {
"jquery": "~2.1.0",
"jquery.cookie": "~1.4.0",
"angular": "1.3.3",
"angular": "1.3.9",
"angular-ui": "~0.4.0",
"angular-sanitize": "1.3.3",
"angular-resource": "1.3.3",
"angular-sanitize": "1.3.9",
"angular-resource": "1.3.9",
"angular-ui-utils": "~0.1.0",
"angular-ui-select2": "git://github.com/angular-ui/ui-select2.git",
"angular-bootstrap": "~0.12.0",

View file

@ -4,13 +4,26 @@
* Services that persists and retrieves user from localStorage.
*/
angular.module('groupServices', ['ngResource']).
factory('Groups', ['ApiUrlService', '$resource', '$q', '$http', 'User',
function(ApiUrlService, $resource, $q, $http, User) {
angular.module('groupServices', ['ngResource', 'challengeServices']).
factory('Groups', ['ApiUrlService', '$resource', '$q', '$http', 'User', 'Challenges',
function(ApiUrlService, $resource, $q, $http, User, Challenges) {
var Group = $resource(ApiUrlService.get() + '/api/v2/groups/:gid',
{gid:'@_id', messageId: '@_messageId'},
{
//query: {method: "GET", isArray:false},
get: {
method: "GET",
isArray:false,
// Wrap challenges as ngResource so they have functions like $leave or $join
transformResponse: function(data, headers) {
data = angular.fromJson(data);
_.each(data && data.challenges, function(c) {
angular.extend(c, Challenges.Challenge.prototype);
});
return data;
}
},
postChat: {method: "POST", url: ApiUrlService.get() + '/api/v2/groups/:gid/chat'},
deleteChatMessage: {method: "DELETE", url: ApiUrlService.get() + '/api/v2/groups/:gid/chat/:messageId'},
flagChatMessage: {method: "POST", url: ApiUrlService.get() + '/api/v2/groups/:gid/chat/:messageId/flag'},

View file

@ -660,10 +660,12 @@ questStart = function(req, res, next) {
})
group.quest.active = true;
if (quest.boss)
if (quest.boss) {
group.quest.progress.hp = quest.boss.hp;
else
if (quest.boss.rage) group.quest.progress.rage = 0;
} else {
group.quest.progress.collect = collected;
}
group.quest.members = questMembers;
group.markModified('quest'); // members & progress.collect are both Mixed types
parallel.push(function(cb2){group.save(cb2)});

View file

@ -79,7 +79,7 @@ module.exports.errorHandler = function(err, req, res, next) {
error: "Uncaught error",
stack: (err.stack || err.message || err),
body: req.body, headers: req.header,
auth: (req.headers['x-api-user'] + ' | ' + req.headers['x-api-key']),
auth: req.headers['x-api-user'],
originalUrl: req.originalUrl
});
var message = err.message ? err.message : err;

View file

@ -280,6 +280,7 @@ GroupSchema.statics.tavernBoss = function(user,progress) {
tavern.quest.extra.worldDmg.recent = scene;
tavern.markModified('quest.extra.worldDmg');
tavern.quest.progress.rage = 0;
tavern.quest.progress.hp += (quest.boss.rage.healing * tavern.quest.progress.hp);
}
}
tavern.save(cb);
@ -300,8 +301,17 @@ GroupSchema.statics.bossQuest = function(user, progress, cb) {
var down = progress.down * quest.boss.str; // multiply by boss strength
group.quest.progress.hp -= progress.up;
group.sendChat("`" + user.profile.name + " attacks " + quest.boss.name('en') + " for " + (progress.up.toFixed(1)) + " damage, " + quest.boss.name('en') + " attacks party for " + Math.abs(down).toFixed(1) + " damage.`");
group.sendChat("`" + user.profile.name + " attacks " + quest.boss.name('en') + " for " + (progress.up.toFixed(1)) + " damage, " + quest.boss.name('en') + " attacks party for " + Math.abs(down).toFixed(1) + " damage.`"); //TODO Create a party preferred language option so emits like this can be localized
// If boss has Rage, increment Rage as well
if (quest.boss.rage) {
group.quest.progress.rage += Math.abs(down);
if (group.quest.progress.rage >= quest.boss.rage.value) {
group.sendChat(quest.boss.rage.effect('en'));
group.quest.progress.rage = 0;
if (quest.boss.rage.healing) group.quest.progress.hp += (group.quest.progress.hp * quest.boss.rage.healing); //TODO To make Rage effects more expandable, let's turn these into functions in quest.boss.rage
}
}
// Everyone takes damage
var series = [
function(cb2){

View file

@ -183,6 +183,11 @@ script(type='text/ng-template', id='partials/options.inventory.drops.html')
p
| {{::Content.eggs.#{egg}.value}} 
span.Pet_Currency_Gem1x.inline-gems
div(ng-show='(user.achievements.quests.trex + user.achievements.quests.trex_undead) > 1')
button.customize-option(popover='{{::Content.eggs.TRex.notes()}}', popover-title!=env.t("egg", {eggType: "{{Content.eggs.TRex.text()}}"}), popover-trigger='mouseenter', popover-placement='top', ng-click='purchase("eggs", Content.eggs.TRex)', class='Pet_Egg_TRex')
p
| {{::Content.eggs.TRex.value}} 
span.Pet_Currency_Gem1x.inline-gems
li.customize-menu
menu.pets-menu(label=env.t('hatchingPotions'))

View file

@ -1,25 +1,43 @@
h5 WORLD BOSS BATTLE BEGINS!
h5 TYRANNOSAUR PET QUEST, SPREAD THE WORD CHALLENGE, AND FIRST STRESS STRIKE!
tr
td
h5 World Boss: The Abominable Stressbeast!
.quest_stressbeast.pull-right
p A new World Boss has appeared in the <a href='https://habitrpg.com/#/options/groups/tavern' target='_blank'>Tavern</a>! All of the completed Dailies and To-Dos of Habiticans damage the World Boss. Incomplete Dailies fill the Stress Strike Bar. When the Stress Strike bar is full, the World Boss will attack an NPC.
p A World Boss will never damage individual players or accounts in any way. Only active accounts who are not resting in the inn will have their incomplete Dailies tallied. Read on for the details!
h5 Tyrannosaur Pet Quest
p In the <a href='https://habitrpg.com/#/options/inventory/drops' target='_blank'>Market</a> there are now two new pet quests: King of the Dinosaurs and The Dinosaur Unearthed! They both give out the same rewards, including pet Tyrannosaur eggs. The difference is that "King of the Dinosaurs" is a normal pet quest, like all the others, whereas "The Dinosaur Unearthed" has less HP - but also a Rage bar (a la World Bosses) that allows it to heal if you skip too many of your Dailies. Both bosses still attack your party based on how many Dailies are incomplete. Users will be able to buy Tyrannosaur eggs after defeating either boss twice or both bosses once.
p Have fun!
p.small.muted by Baconsaur, Urse, Lemoness, and SabreCat
tr
td
h5 Winter Plot-Line: The Abominable Stressbeast Attacks!
p The first thing we hear are the footsteps, slower and more thundering than the stampede. One by one, Habiticans look outside their doors, and words fail us.
p We've all seen Stressbeasts before, of course - tiny vicious creatures that attack during difficult times. But this? This towers taller than the buildings, with paws that could crush a dragon with ease. Frost swings from its stinking fur, and as it roars, the icy blast rips the roofs off our houses. A monster of this magnitude has never been mentioned outside of distant legend.
p "Beware, Habiticans!" SabreCat cries. "Barricade yourselves indoors - this is the Abominable Stressbeast itself!"
p "That thing must be made of centuries of stress!" Kiwibot says, locking the Tavern door tightly and shuttering the windows.
p "The Stoïkalm Steppes," Lemoness says, face grim. "All this time, we thought they were placid and untroubled, but they must have been secretly hiding their stress somewhere. Over generations, it grew into this, and now it's broken free and attacked them - and us!"
p There's only one way to drive away a Stressbeast, Abominable or otherwise, and that's to attack it with completed Dailies and To-Dos! Let's all band together and fight off this fearsome foe - but be sure not to slack on your tasks, or our undone Dailies may enrage it so much that it lashes out...
h5 Spread the Word Challenge Reminder
p In case you missed it, we're running our second Spread the Word Challenge! The rules are simple: make a post some time between December 31st 2014 and January 31st 2015 on some form of blog or social media that tells people about HabitRPG. The top post will be awarded 100 GEMS, and the next nineteen top posts will be awarded 80 GEMS each. Learn more and join in <a href='https://habitrpg.com/#/options/groups/challenges/e1ad6d92-587d-4137-848e-4a1f643603ba' target='_blank'>here</a>!
tr
td
h5 World Boss: First Stress Strike!
p The World Boss in the <a href='https://habitrpg.com/#/options/groups/tavern' target='_blank'>Tavern</a> has used its first Stress Strike!
p Despite our best efforts, we've let some Dailies get away from us, and their dark-red color has infuriated the Abominable Stressbeast and caused it to regain some of its health! The horrible creature lunges for the Stables, but Matt the Beast Master heroically leaps into the fray to protect the pets and mounts. The Stressbeast has seized Matt in its vicious grip, but at least it's distracted for the moment.
p Complete Dailies and To-Dos to damage the World Boss! Incomplete Dailies fill the Stress Strike Bar. When the Stress Strike bar is full, the World Boss will attack an NPC. A World Boss will never damage individual players or accounts in any way. Only active accounts who are not resting in the inn will have their incomplete Dailies tallied.
p.small.muted by Lemoness, Kiwibot, and SabreCat
hr
a(href='/static/old-news', target='_blank') Read older news
mixin oldNews
h5 1/8/2015
tr
td
h5 World Boss: The Abominable Stressbeast!
.quest_stressbeast.pull-right
p A new World Boss has appeared in the <a href='https://habitrpg.com/#/options/groups/tavern' target='_blank'>Tavern</a>! All of the completed Dailies and To-Dos of Habiticans damage the World Boss. Incomplete Dailies fill the Stress Strike Bar. When the Stress Strike bar is full, the World Boss will attack an NPC.
p A World Boss will never damage individual players or accounts in any way. Only active accounts who are not resting in the inn will have their incomplete Dailies tallied. Read on for the details!
tr
td
h5 Winter Plot-Line: The Abominable Stressbeast Attacks!
p The first thing we hear are the footsteps, slower and more thundering than the stampede. One by one, Habiticans look outside their doors, and words fail us.
p We've all seen Stressbeasts before, of course - tiny vicious creatures that attack during difficult times. But this? This towers taller than the buildings, with paws that could crush a dragon with ease. Frost swings from its stinking fur, and as it roars, the icy blast rips the roofs off our houses. A monster of this magnitude has never been mentioned outside of distant legend.
p "Beware, Habiticans!" SabreCat cries. "Barricade yourselves indoors - this is the Abominable Stressbeast itself!"
p "That thing must be made of centuries of stress!" Kiwibot says, locking the Tavern door tightly and shuttering the windows.
p "The Stoïkalm Steppes," Lemoness says, face grim. "All this time, we thought they were placid and untroubled, but they must have been secretly hiding their stress somewhere. Over generations, it grew into this, and now it's broken free and attacked them - and us!"
p There's only one way to drive away a Stressbeast, Abominable or otherwise, and that's to attack it with completed Dailies and To-Dos! Let's all band together and fight off this fearsome foe - but be sure not to slack on your tasks, or our undone Dailies may enrage it so much that it lashes out...
p.small.muted by Lemoness, Kiwibot, and SabreCat
h5 1/5/2015
tr
td