diff --git a/static/js/components/commandForm.js b/static/js/components/commandForm.js index a844711..cefb984 100644 --- a/static/js/components/commandForm.js +++ b/static/js/components/commandForm.js @@ -286,7 +286,18 @@ window.openUnitModal = function() { let costStr = ''; let clickable = false; - if (data) { + const requiredGod = window.UNIT_GODS ? window.UNIT_GODS[key] : null; + const isWrongGod = requiredGod && town.god !== requiredGod; + const isNoGod = key === 'godsent' && !town.god; + + if (isWrongGod) { + statusClass = 'locked'; statusLabel = '🔒 Άλλος Θεός'; cardClass = 'bld-locked'; + const greekGods = { zeus: 'Δία', poseidon: 'Ποσειδώνα', hera: 'Ήρα', athena: 'Αθηνά', hades: 'Άδη', artemis: 'Άρτεμις', aphrodite: 'Αφροδίτη', ares: 'Άρη' }; + costStr = `Απαιτεί: ${greekGods[requiredGod] || requiredGod}`; + } else if (isNoGod) { + statusClass = 'locked'; statusLabel = '🔒 Χωρίς Θεό'; cardClass = 'bld-locked'; + costStr = `Απαιτείται Ναός`; + } else if (data) { const missingKeys = data.missing_dependencies ? Object.keys(data.missing_dependencies) : []; const isLocked = missingKeys.length > 0; diff --git a/static/js/state.js b/static/js/state.js index 0010120..7ab8545 100644 --- a/static/js/state.js +++ b/static/js/state.js @@ -24,7 +24,7 @@ window.BUILDING_NAMES_GR = { }; window.UNIT_NAMES_GR = { - sword: "Ξιφομάχος", slinger: "Σφενδονήτης", archer: "Τοξότης", hoplite: "Οπλίτης", + sword: "Ξιφομάχος", slinger: "Εκσφενδονιστής", archer: "Τοξότης", hoplite: "Οπλίτης", rider: "Ιππέας", chariot: "Άρμα", catapult: "Καταπέλτης", godsent: "Θεόσταλτος", big_transporter: "Μεταφορικό", small_transporter: "Γρήγ. Μεταφορικό", bireme: "Διήρης", attack_ship: "Πλοίο Φάρος", trireme: "Τριήρης", colonize_ship: "Αποικιακό", @@ -33,6 +33,17 @@ window.UNIT_NAMES_GR = { hydra: "Ύδρα", sea_monster: "Τέρας Θάλασσας", militia: "Εθνοφρουρά" }; +window.UNIT_GODS = { + minotaur: 'zeus', manticore: 'zeus', + zyklop: 'poseidon', hydra: 'poseidon', + harpy: 'hera', medusa: 'hera', + pegasus: 'athena', centaur: 'athena', + cerberus: 'hades', erinys: 'hades', + griffon: 'artemis', calydonian_boar: 'artemis', + siren: 'aphrodite', satyr: 'aphrodite', + spartoi: 'ares', ladon: 'ares' +}; + window.RES_ICONS = { wood: '', stone: '',