Team Create (���������� ��������������) + ���������� ���� + ������ 16/17/20/40/44/05 #34

Merged
min merged 69 commits from restore/all-tasks into main 2026-06-08 01:13:01 +00:00
Showing only changes of commit ba90bf5c7d - Show all commits

View File

@ -552,6 +552,22 @@ let score = 0;
function show(){ game.ui.set('score', '⭐ ' + score, { x:8, y:6, anchor:'top', color:'#ffd23a', size:22 }); }
show();
game.onMessage('score', (m) => { score += (m && m.add) ? m.add : 1; show(); });` }],
},
{
id: 'leaderboard',
name: 'Таблица лидеров',
desc: 'Лидерборд справа-сверху (Очки/Время). Растёт от монет и очков других механик. Сохраняется в БД между сессиями. (Задача 20)',
icon: 'trophy', category: 'ui',
scripts: [{ attachTo: 'global', code:
`// Таблица лидеров: столбцы «Очки» (primary) и «Время».
game.leaderstats.define('Очки', { initial: 0, format: 'number', icon: '⭐', color: '#ffd23a', primary: true });
game.leaderstats.define('Время', { initial: 0, format: 'time', icon: '⏱', color: '#7fd0ff' });
// Время идёт само.
game.every(1, () => game.leaderstats.me.add('Время', 1));
// Любая механика, шлющая broadcast('score',{add}) или ('coins',{add}),
// автоматически добавляет очки в таблицу.
game.onMessage('score', (m) => game.leaderstats.me.add('Очки', (m && m.add) ? m.add : 1));
game.onMessage('coins', (m) => game.leaderstats.me.add('Очки', (m && m.add) ? m.add : 1));` }],
},
{
id: 'hp-bar',