Skip to content

Commit bf2a6fa

Browse files
committed
Improve HP regen timing and UI refresh
1 parent 8ae8c24 commit bf2a6fa

4 files changed

Lines changed: 24 additions & 5 deletions

File tree

app/js/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var VizMagicConfig = (function() {
3535

3636
/** HP passive regeneration constants */
3737
var HP_REGEN = {
38-
HP_REGEN_RATE: 500, // blocks per +1 HP
38+
HP_REGEN_RATE: 100, // blocks per +1 HP (~5 min)
3939
HP_REGEN_CAP_PCT: 30 // max % of maxHp that passive regen can reach
4040
};
4141

app/js/i18n/en.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -825,10 +825,10 @@ var LangEN = {
825825
help_mana_text: 'Mana is your energy (0–100%). Every spell costs mana. Full regeneration takes ~5 days. Shown as a percentage — 1.00% = 100 basis points on the blockchain.',
826826

827827
help_section_hp: 'HP & Recovery',
828-
help_hp_text: 'HP is your health. Max HP grows from your level, class, and Resilience: base 100 + level × 10 + RES × 3, then your class multiplier is applied. It does not regenerate automatically to full — passive regen slowly restores up to 30% of your max HP (+1 HP every 500 blocks, ~4 min). Full recovery: visit the Hunt screen (camp rest) or use a Health Scroll (craftable or dropped by creatures).',
828+
help_hp_text: 'HP is your health. Max HP grows from your level, class, and Resilience: base 100 + level × 10 + RES × 3, then your class multiplier is applied. It does not regenerate automatically to full — passive regen slowly restores up to 30% of your max HP (+1 HP every 100 blocks, ~5 min). Full recovery: visit the Hunt screen (camp rest) or use a Health Scroll (craftable or dropped by creatures).',
829829

830830
help_section_quests: 'Quests & Prophecies',
831-
help_quests_text: 'Regular quests are accepted in the Quests screen. “Traveler” currently means visiting 3 different regions via the world map. The Daily Prophecy must also be accepted first, then completed. If it tells you to bless others, do that in the Chronicle with the “Bless” button on other mages\' entries.',
831+
help_quests_text: 'Regular quests are accepted in the Quests screen. “Traveler” currently means visiting 3 different regions via the world map — open the map, choose another region, and press “Travel”. The Daily Prophecy must also be accepted first, then completed. If it tells you to bless others, do that in the Chronicle with the “Bless” button on other mages\' entries.',
832832

833833
help_section_hunt: 'Hunting',
834834
help_hunt_text: 'Choose a creature and a spell, then attack. Victory earns XP and loot. Defeat gives 25% XP. Loot is volatile — bank it in a safe zone to keep it.',

app/js/i18n/ru.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -825,10 +825,10 @@ var LangRU = {
825825
help_mana_text: 'Мана — ваша энергия (0–100%). Каждое заклинание тратит ману. Полное восстановление занимает ~5 дней. Отображается в процентах — 1.00% = 100 базисных пунктов в блокчейне.',
826826

827827
help_section_hp: 'HP и Восстановление',
828-
help_hp_text: 'HP — ваше здоровье. Максимум HP растёт от уровня, класса и Стойкости (Resilience): базово 100 + уровень × 10 + RES × 3, затем применяется модификатор класса. До максимума здоровье само не восстанавливается — пассивная регенерация возвращает до 30% от максимума (+1 HP каждые 500 блоков, ~4 мин). Полное восстановление: зайди на экран Охоты (отдых в лагере) или используй Свиток Здоровья (крафтится или падает с существ).',
828+
help_hp_text: 'HP — ваше здоровье. Максимум HP растёт от уровня, класса и Стойкости (Resilience): базово 100 + уровень × 10 + RES × 3, затем применяется модификатор класса. До максимума здоровье само не восстанавливается — пассивная регенерация возвращает до 30% от максимума (+1 HP каждые 100 блоков, ~5 мин). Полное восстановление: зайди на экран Охоты (отдых в лагере) или используй Свиток Здоровья (крафтится или падает с существ).',
829829

830830
help_section_quests: 'Задания и Пророчества',
831-
help_quests_text: 'Обычные задания берутся во вкладке Задания. «Путешественник» сейчас означает: посетить 3 разных региона через карту мира. Ежедневное Пророчество тоже нужно сначала принять, а затем выполнить его цель. Если в цели сказано благословлять — это делается в Хронике кнопкой «Благословить» у записей других магов.',
831+
help_quests_text: 'Обычные задания берутся во вкладке Задания. «Путешественник» сейчас означает: посетить 3 разных региона через карту мира — откройте карту, выберите другой регион и нажмите «Путешествие». Ежедневное Пророчество тоже нужно сначала принять, а затем выполнить его цель. Если в цели сказано благословлять — это делается в Хронике кнопкой «Благословить» у записей других магов.',
832832

833833
help_section_hunt: 'Охота',
834834
help_hunt_text: 'Выберите существо и заклинание, затем атакуйте. Победа приносит опыт и добычу. Поражение даёт 25% опыта. Добыча нестабильна — сохраните её в безопасном месте.',

app/js/ui/app.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,8 @@ var App = (function() {
314314
console.log('App: Checkpoint save error:', cpErr);
315315
}
316316

317+
_refreshActiveScreenAfterSync(eventsCollected);
318+
317319
// If there are more blocks to process, continue immediately
318320
if (endBlock < chainHead) {
319321
var nextStart = endBlock + 1;
@@ -326,6 +328,23 @@ var App = (function() {
326328
});
327329
}
328330

331+
function _refreshActiveScreenAfterSync(eventsCollected) {
332+
var reactiveScreens = {
333+
home: true,
334+
character: true,
335+
quests: true,
336+
map: true,
337+
chronicle: true,
338+
marketplace: true,
339+
leaderboard: true
340+
};
341+
342+
if (!reactiveScreens[currentScreen]) return;
343+
if (!eventsCollected || !eventsCollected.length) return;
344+
345+
_renderScreen(currentScreen);
346+
}
347+
329348
/**
330349
* Stop block polling (for cleanup)
331350
*/

0 commit comments

Comments
 (0)