Merge remote-tracking branch 'upstream/develop' into rebalancing-2015-03
Conflicts: common/dist/scripts/habitrpg-shared.js
This commit is contained in:
@@ -56,7 +56,7 @@ gear =
|
||||
0:
|
||||
text: t('weaponBase0Text'), notes: t('weaponBase0Notes'), value:0
|
||||
warrior:
|
||||
0: text: t('weaponWarrior0Text'), notes: t('weaponWarrior0Notes'), value:0
|
||||
0: text: t('weaponWarrior0Text'), notes: t('weaponWarrior0Notes'), value:1
|
||||
1: text: t('weaponWarrior1Text'), notes: t('weaponWarrior1Notes', {str: 3}), str: 3, value:20
|
||||
2: text: t('weaponWarrior2Text'), notes: t('weaponWarrior2Notes', {str: 6}), str: 6, value:30
|
||||
3: text: t('weaponWarrior3Text'), notes: t('weaponWarrior3Notes', {str: 9}), str: 9, value:45
|
||||
@@ -757,7 +757,7 @@ api.spells =
|
||||
|
||||
target.markModified? 'items.special.valentineReceived'
|
||||
user.stats.gp -= 10
|
||||
|
||||
|
||||
# Intercept all spells to reduce user.stats.mp after casting the spell
|
||||
_.each api.spells, (spellClass) ->
|
||||
_.each spellClass, (spell, key) ->
|
||||
@@ -1663,29 +1663,29 @@ _.each api.subscriptionBlocks, (b,k)->b.key = k
|
||||
repeat = {m:true,t:true,w:true,th:true,f:true,s:true,su:true}
|
||||
api.userDefaults =
|
||||
habits: [
|
||||
{type: 'habit', text: t('defaultHabit1Text'), notes: t('defaultHabit1Notes'), value: 0, up: true, down: false, attribute: 'per' }
|
||||
{type: 'habit', text: t('defaultHabit2Text'), notes: t('defaultHabit2Notes'), value: 0, up: false, down: true, attribute: 'con'}
|
||||
{type: 'habit', text: t('defaultHabit1Text'), notes: t('defaultHabit1Notes'), value: 0, up: true, down: false, attribute: 'str' }
|
||||
{type: 'habit', text: t('defaultHabit2Text'), notes: t('defaultHabit2Notes'), value: 0, up: false, down: true, attribute: 'str'}
|
||||
{type: 'habit', text: t('defaultHabit3Text'), notes: t('defaultHabit3Notes'), value: 0, up: true, down: true, attribute: 'str'}
|
||||
]
|
||||
|
||||
dailys: [
|
||||
{type: 'daily', text: t('defaultDaily1Text'), notes: t('defaultDaily1Notes'), value: 0, completed: false, repeat: repeat, attribute: 'per' }
|
||||
{type: 'daily', text: t('defaultDaily2Text'), notes: t('defaultDaily2Notes'), value: 3, completed: false, repeat: repeat, attribute: 'con' }
|
||||
{type: 'daily', text: t('defaultDaily3Text'), notes: t('defaultDaily3Notes'), value: -10, completed: false, repeat: repeat, attribute: 'int' }
|
||||
{type: 'daily', text: t('defaultDaily4Text'), notes: t('defaultDaily4Notes'), checklist: [{completed: true, text: t('defaultDaily4Checklist1') }, {completed: false, text: t('defaultDaily4Checklist2')}, {completed: false, text: t('defaultDaily4Checklist3')}], completed: false, repeat: repeat, attribute: 'str' }
|
||||
# {type: 'daily', text: t('defaultDaily1Text'), notes: t('defaultDaily1Notes'), value: 0, completed: false, repeat: repeat, attribute: 'per' }
|
||||
# {type: 'daily', text: t('defaultDaily2Text'), notes: t('defaultDaily2Notes'), value: 3, completed: false, repeat: repeat, attribute: 'con' }
|
||||
# {type: 'daily', text: t('defaultDaily3Text'), notes: t('defaultDaily3Notes'), value: -10, completed: false, repeat: repeat, attribute: 'int' }
|
||||
# {type: 'daily', text: t('defaultDaily4Text'), notes: t('defaultDaily4Notes'), checklist: [{completed: true, text: t('defaultDaily4Checklist1') }, {completed: false, text: t('defaultDaily4Checklist2')}, {completed: false, text: t('defaultDaily4Checklist3')}], completed: false, repeat: repeat, attribute: 'str' }
|
||||
]
|
||||
|
||||
todos: [
|
||||
{type: 'todo', text: t('defaultTodo1Text'), notes: t('defaultTodoNotes'), completed: false, attribute: 'int' }
|
||||
{type: 'todo', text: t('defaultTodo2Text'), notes: t('defaultTodoNotes'), checklist: [{completed: false, text: t('defaultTodo2Checklist1') }, {completed: false, text: t('defaultTodo2Checklist2')}, {completed: false, text: t('defaultTodo2Checklist3')}], completed: false, attribute: 'per' }
|
||||
{type: 'todo', text: t('defaultTodo3Text'), notes: t('defaultTodoNotes'), checklist: [{completed: false, text: t('defaultTodo3Checklist1') }, {completed: false, text: t('defaultTodo3Checklist2')}, {completed: false, text: t('defaultTodo3Checklist3')}], completed: false, attribute: 'per' }
|
||||
{type: 'todo', text: t('defaultTodo4Text'), notes: t('defaultTodoNotes'), checklist: [{completed: false, text: t('defaultTodo4Checklist1') }, {completed: false, text: t('defaultTodo4Checklist2')}, {completed: false, text: t('defaultTodo4Checklist3')}], completed: false, attribute: 'per' }
|
||||
{type: 'todo', text: t('defaultTodo5Text'), notes: t('defaultTodoNotes'), completed: false, attribute: 'per' }
|
||||
# {type: 'todo', text: t('defaultTodo2Text'), notes: t('defaultTodoNotes'), checklist: [{completed: false, text: t('defaultTodo2Checklist1') }, {completed: false, text: t('defaultTodo2Checklist2')}, {completed: false, text: t('defaultTodo2Checklist3')}], completed: false, attribute: 'per' }
|
||||
# {type: 'todo', text: t('defaultTodo3Text'), notes: t('defaultTodoNotes'), checklist: [{completed: false, text: t('defaultTodo3Checklist1') }, {completed: false, text: t('defaultTodo3Checklist2')}, {completed: false, text: t('defaultTodo3Checklist3')}], completed: false, attribute: 'per' }
|
||||
# {type: 'todo', text: t('defaultTodo4Text'), notes: t('defaultTodoNotes'), checklist: [{completed: false, text: t('defaultTodo4Checklist1') }, {completed: false, text: t('defaultTodo4Checklist2')}, {completed: false, text: t('defaultTodo4Checklist3')}], completed: false, attribute: 'per' }
|
||||
# {type: 'todo', text: t('defaultTodo5Text'), notes: t('defaultTodoNotes'), completed: false, attribute: 'per' }
|
||||
]
|
||||
|
||||
rewards: [
|
||||
{type: 'reward', text: t('defaultReward1Text'), notes: t('defaultReward1Notes'), value: 20 }
|
||||
{type: 'reward', text: t('defaultReward2Text'), notes: t('defaultReward2Notes'), value: 10 }
|
||||
# {type: 'reward', text: t('defaultReward1Text'), notes: t('defaultReward1Notes'), value: 20 }
|
||||
# {type: 'reward', text: t('defaultReward2Text'), notes: t('defaultReward2Notes'), value: 10 }
|
||||
]
|
||||
|
||||
tags: [
|
||||
|
||||
@@ -5,12 +5,12 @@ angular.module('habitrpg')
|
||||
this.setApiUrl = function(newUrl){
|
||||
currentApiUrl = newUrl;
|
||||
};
|
||||
|
||||
|
||||
this.get = function(){
|
||||
return currentApiUrl;
|
||||
};
|
||||
}])
|
||||
|
||||
|
||||
/**
|
||||
* Services that persists and retrieves user from localStorage.
|
||||
*/
|
||||
@@ -29,6 +29,11 @@ angular.module('habitrpg')
|
||||
var settings = {}; //habit mobile settings (like auth etc.) to be stored here
|
||||
var user = {}; // this is stored as a reference accessible to all controllers, that way updates propagate
|
||||
|
||||
var userNotifications = {
|
||||
"party.order" : env.t("updatedParty"),
|
||||
"party.orderAscending" : env.t("updatedParty")
|
||||
}; // this is a list of notifications to send to the user when changes are made, along with the message.
|
||||
|
||||
//first we populate user with schema
|
||||
user.apiToken = user._id = ''; // we use id / apitoken to determine if registered
|
||||
|
||||
@@ -93,13 +98,17 @@ angular.module('habitrpg')
|
||||
_.each(user.ops, function(op,k){
|
||||
user.ops[k] = function(req,cb){
|
||||
if (cb) return op(req,cb);
|
||||
op(req,function(err,response){
|
||||
op(req,function(err,response) {
|
||||
for(var updatedItem in req.body) {
|
||||
var itemUpdateResponse = userNotifications[updatedItem];
|
||||
if(itemUpdateResponse) Notification.text(itemUpdateResponse);
|
||||
}
|
||||
if (err) {
|
||||
var message = err.code ? err.message : err;
|
||||
console.log(message);
|
||||
if (MOBILE_APP) Notification.push({type:'text',text:message});
|
||||
else Notification.text(message);
|
||||
// In the case of 200s, they're friendly alert messages like "You're pet has hatched!" - still send the op
|
||||
// In the case of 200s, they're friendly alert messages like "Your pet has hatched!" - still send the op
|
||||
if ((err.code && err.code >= 400) || !err.code) return;
|
||||
}
|
||||
userServices.log({op:k, params: req.params, query:req.query, body:req.body});
|
||||
@@ -149,6 +158,7 @@ angular.module('habitrpg')
|
||||
set: function(updates) {
|
||||
user.ops.update({body:updates});
|
||||
},
|
||||
|
||||
online: function (status) {
|
||||
if (status===true) {
|
||||
settings.online = true;
|
||||
|
||||
Reference in New Issue
Block a user