Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function goToTower(floor) {
- 'use strict';
- /*globals angular*/
- if (floor > 0) {
- var $body = angular.element(document.body),
- $injector = $body.injector(),
- $scope = $body.scope(),
- $http = $injector.get('$http'),
- $location = $injector.get('$location');
- if ($http && $scope && $scope.g) {
- $http({
- method: 'POST',
- url: '/user/setStage',
- data: {
- stageArgs: {
- areaId: '0',
- stageIndex: floor - 1
- }
- }
- }).success(function (data) {
- $scope.g.stage = {
- name: data.stageName,
- activity: data.activity,
- monsters: data.monsters,
- requirements: data.requirements,
- messages: []
- };
- $scope.user.lastStageId = data.stageId;
- if ($location) {
- $location.path('world/location');
- }
- });
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement