Made it so that high scores and level victories are not achieved when playing changed levels from inside the level editor. Some additions for Nalfar.

This commit is contained in:
Nick Winter 2015-06-05 17:02:37 -07:00
parent 3f23598c60
commit 0d99b07bc3
4 changed files with 5 additions and 2 deletions

View file

@ -24,7 +24,7 @@ module.exports = class ThangType extends CocoModel
librarian: '52fbf74b7e01835453bd8d8e'
'potion-master': '52e9adf7427172ae56002172'
sorcerer: '52fd1524c7e6cf99160e7bc9'
necromancer: ''
necromancer: '55652fb3b9effa46a1f775fd'
'dark-wizard': ''
@heroClasses:
Warrior: ['captain', 'knight', 'samurai', 'raider', 'goliath', 'guardian']

View file

@ -439,6 +439,7 @@ module.exports = class PlayLevelView extends RootView
application.tracker?.trackTiming victoryTime, 'Level Victory Time', @levelID, @levelID
showVictory: ->
return if @isEditorPreview and @level.hasLocalChanges() # Don't award achievements when beating level changed in level editor
@endHighlight()
options = {level: @level, supermodel: @supermodel, session: @session, hasReceivedMemoryWarning: @hasReceivedMemoryWarning}
ModalClass = if @level.get('type', true) in ['hero', 'hero-ladder', 'hero-coop'] then HeroVictoryModal else VictoryModal
@ -537,6 +538,7 @@ module.exports = class PlayLevelView extends RootView
onSubmissionComplete: =>
return if @destroyed
return if @isEditorPreview and @level.hasLocalChanges() # Don't award achievements when beating level changed in level editor
# TODO: Show a victory dialog specific to hero-ladder level
if @goalManager.checkOverallStatus() is 'success' and not @options.realTimeMultiplayerSessionID?
showModalFn = -> Backbone.Mediator.publish 'level:show-victory', showModal: true

View file

@ -72,6 +72,7 @@ module.exports = class CastButtonView extends CocoView
@updateReplayability()
onDoneButtonClick: (e) ->
return if @getQueryVariable('dev') and @level.hasLocalChanges() # Don't award achievements when beating level changed in level editor
@options.session.recordScores @world.scores, @options.level
Backbone.Mediator.publish 'level:show-victory', showModal: true

View file

@ -178,7 +178,7 @@ module.exports = class PlayHeroesModal extends ModalView
layer.container.children[0].y = 250/m
if fullHero.get('slug') in ['forest-archer', 'librarian', 'sorcerer', 'potion-master', 'necromancer']
layer.container.children[0].y -= 3
if fullHero.get('slug') in ['librarian', 'sorcerer', 'potion-master']
if fullHero.get('slug') in ['librarian', 'sorcerer', 'potion-master', 'necromancer']
layer.container.children[0].x -= 3
stage = new createjs.SpriteStage(canvas[0])