-
Notifications
You must be signed in to change notification settings - Fork 8
/
event-log.js
43 lines (33 loc) · 952 Bytes
/
event-log.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*global gs, console*/
'use strict';
gs.logDungeonLevel = function () {
var str = '';
if (gs.zoneName === 'TheUpperDungeon' && gs.zoneLevel === 1) {
return;
}
str += 'Entered: ' + gs.zoneName + '[' + gs.zoneLevel + '] ';
str += 'Time: ' + gs.timeToString(gs.gameTime()) + ', ';
str += 'Turn: ' + gs.turn;
this.eventLog.push(str);
};
gs.logExperienceLevel = function () {
var str = '';
str += 'Gained XL: ' + gs.pc.level + ' ';
str += 'Time: ' + gs.timeToString(gs.gameTime()) + ', ';
str += 'Turn: ' + gs.turn;
this.eventLog.push(str);
};
gs.logCriticalMoment = function () {
var str = '';
str += 'Critical Moment: ';
str += 'Time: ' + gs.timeToString(gs.gameTime()) + ', ';
str += 'Turn: ' + gs.turn;
this.eventLog.push(str);
};
gs.printEventLog = function () {
var str = '';
this.eventLog.forEach(function (event) {
str += event + '\n';
}, this);
console.log(str);
};