All checks were successful
continuous-integration/drone/push Build is passing
17 lines
849 B
JavaScript
17 lines
849 B
JavaScript
BlockEvents.rightClicked('ags_day_counter:calendar', event => {
|
|
if (event.hand != 'off_hand') return;
|
|
|
|
let playTime = Math.round(event.player.stats.get(Stats.PLAY_TIME) / 24000.0)
|
|
let hordeDay = 15 - (playTime % 15);
|
|
let serverDays = parseInt(event.level.dayTime() / 24000.0);
|
|
event.player.tell(Component.of('Today is day ').append(Component.green(serverDays)).append('.'))
|
|
event.player.tell(Component.of('You have played ').append(Component.green(playTime)).append(' in-game days.'))
|
|
if (hordeDay == 15) {
|
|
hordeDay = 0;
|
|
event.player.tell(Component.of('The next horde wave is coming in ').append(Component.red(hordeDay)).append(' days.'))
|
|
}
|
|
else {
|
|
event.player.tell(Component.of('The next horde wave is coming in ').append(Component.yellow(hordeDay)).append(' days.'))
|
|
}
|
|
return
|
|
}); |