MCPcopy Create free account
hub / github.com/codecombat/codecombat / makeLevelCompleteAchievement

Function makeLevelCompleteAchievement

test/app/factories.coco.js:197–212  ·  view source on GitHub ↗
(attrs, sources)

Source from the content-addressed store, hash-verified

195 },
196
197 makeLevelCompleteAchievement(attrs, sources) {
198 if (sources == null) { sources = {}; }
199 const _id = _.uniqueId('achievement_');
200 const level = sources.level || this.makeLevel();
201 attrs = _.extend({}, {
202 _id,
203 name: _.string.humanize(_id),
204 query: {
205 'state.complete': true,
206 'level.original': level.get('original')
207 },
208 rewards: { gems: 10 },
209 worth: 20
210 }, attrs);
211 return new Achievement(attrs);
212 },
213
214 makeEarnedAchievement(attrs, sources) {
215 if (sources == null) { sources = {}; }

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected