mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Merge branch 'master' of https://github.com/codecombat/codecombat
This commit is contained in:
commit
cc8a8cabd5
7 changed files with 18 additions and 12 deletions
|
@ -142,13 +142,13 @@ module.exports = class GoalManager extends CocoClass
|
|||
|
||||
onThangTouchedGoal: (e, frameNumber) ->
|
||||
for goal in @goals ? []
|
||||
@checkArrived(goal.id, goal.getToLocations.who, goal.getToLocations.targets, e.actor.id, e.touched.id, frameNumber) if goal.getToLocations?
|
||||
@checkArrived(goal.id, goal.keepFromLocations.who, goal.keepFromLocations.targets, e.actor.id, e.touched.id, frameNumber) if goal.keepFromLocations?
|
||||
@checkArrived(goal.id, goal.getToLocations.who, goal.getToLocations.targets, e.actor, e.touched.id, frameNumber) if goal.getToLocations?
|
||||
@checkArrived(goal.id, goal.keepFromLocations.who, goal.keepFromLocations.targets, e.actor, e.touched.id, frameNumber) if goal.keepFromLocations?
|
||||
|
||||
checkArrived: (goalID, who, targets, thangID, touchedID, frameNumber) ->
|
||||
checkArrived: (goalID, who, targets, thang, touchedID, frameNumber) ->
|
||||
return unless touchedID in targets
|
||||
return unless thangID in who
|
||||
@updateGoalState(goalID, thangID, 'arrived', frameNumber)
|
||||
return unless thang.id in who or thang.team in who
|
||||
@updateGoalState(goalID, thang.id, 'arrived', frameNumber)
|
||||
|
||||
onThangLeftMap: (e, frameNumber) ->
|
||||
for goal in @goals ? []
|
||||
|
@ -211,7 +211,7 @@ module.exports = class GoalManager extends CocoClass
|
|||
stateThangs[thangID] = true
|
||||
success = @goalIsPositive goalID
|
||||
if success
|
||||
numNeeded = Math.max((goal.howMany ? 1), _.size stateThangs)
|
||||
numNeeded = goal.howMany ? Math.max(1, _.size stateThangs)
|
||||
else
|
||||
# saveThangs: by default we would want to save all the Thangs, which means that we would want none of them to be "done"
|
||||
numNeeded = _.size(stateThangs) - Math.min((goal.howMany ? 1), _.size stateThangs) + 1
|
||||
|
|
|
@ -251,7 +251,7 @@
|
|||
padding-right: 20px
|
||||
|
||||
h3
|
||||
margin: 0 0 5px
|
||||
margin: 0
|
||||
font-size: 16px
|
||||
line-height: 16px
|
||||
color: #338
|
||||
|
|
|
@ -97,4 +97,6 @@
|
|||
border-bottom: 1px dotted rgba(255, 128, 128, 0.45)
|
||||
|
||||
.ace_text-layer .ace_comment
|
||||
color: #EBFADA
|
||||
color: darken(rgb(76, 136, 107), 5%)
|
||||
font-weight: bold
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ block content
|
|||
for team in teams
|
||||
div.column.col-md-6
|
||||
a(href="/play/ladder/#{levelID}/team/#{team.id}", style="background-color: #{team.primaryColor}").play-button.btn.btn-danger.btn-block.btn-lg
|
||||
span Play
|
||||
span Play As
|
||||
span= team.name
|
||||
|
||||
table.table.table-bordered.table-condensed.table-hover
|
||||
|
|
|
@ -39,7 +39,7 @@ block content
|
|||
span.loss Loss
|
||||
if match.state === 'tie'
|
||||
span.tie Tie
|
||||
td.name-cell= match.opponentName
|
||||
td.name-cell= match.opponentName || "Anonymous"
|
||||
td.time-cell= match.when
|
||||
td.battle-cell
|
||||
a(href="/play/level/#{levelID}?team=#{teamID}&opponent=#{match.sessionID}") Battle!
|
||||
|
|
|
@ -33,10 +33,13 @@ module.exports = class LadderView extends RootView
|
|||
method: 'POST'
|
||||
data:
|
||||
session: ID
|
||||
alert "Simulating all games!"
|
||||
alert "(do not push more than once pls)"
|
||||
$("#simulate-all-button").prop "disabled", true
|
||||
$("#simulate-all-button").text "Submitted all!"
|
||||
|
||||
onSimulateButtonClick: (e) ->
|
||||
$("#simulate-button").prop "disabled",true
|
||||
$("#simulate-button").text "Simulating..."
|
||||
|
||||
@simulator.fetchAndSimulateTask()
|
||||
|
||||
updateSimulationStatus: (simulationStatus, sessions)->
|
||||
|
|
|
@ -19,6 +19,7 @@ LevelHandler = class LevelHandler extends Handler
|
|||
'name'
|
||||
'i18n'
|
||||
'icon'
|
||||
'goals'
|
||||
]
|
||||
|
||||
postEditableProperties: ['name']
|
||||
|
|
Loading…
Reference in a new issue