MCPcopy Index your code
hub / github.com/codecombat/codecombat / gems

Method gems

app/models/User.js:435–443  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

433 }
434
435 gems () {
436 let left, left1, left2
437 let gemsEarned = (left = this.get('earned')?.gems) != null ? left : 0
438 if (this.isInGodMode()) { gemsEarned = gemsEarned + 100000 }
439 if (this.get('hourOfCode')) { gemsEarned += 1000 }
440 const gemsPurchased = (left1 = this.get('purchased')?.gems) != null ? left1 : 0
441 const gemsSpent = (left2 = this.get('spent')) != null ? left2 : 0
442 return Math.floor((gemsEarned + gemsPurchased) - gemsSpent)
443 }
444
445 heroes () {
446 const heroes = (this.get('purchased')?.heroes || []).concat([

Callers 8

getRenderDataMethod · 0.80
onItemsFetchedMethod · 0.80
getRenderDataMethod · 0.80
onUnlockButtonClickedMethod · 0.80
awardRandomGemsMethod · 0.80
getRenderDataMethod · 0.80
onUnlockButtonClickedMethod · 0.80
setItemMethod · 0.80

Calls 2

getMethod · 0.95
isInGodModeMethod · 0.95

Tested by

no test coverage detected