chore: adjust player tank's size
This commit is contained in:
@@ -4,6 +4,12 @@
|
||||
* Skins are cosmetic-only color schemes purchased with gold.
|
||||
*/
|
||||
|
||||
/**
|
||||
* DEV MODE: Set to true to unlock all skins for testing.
|
||||
* ⚠️ MUST be set to false before publishing!
|
||||
*/
|
||||
const DEV_UNLOCK_ALL = false;
|
||||
|
||||
/** Skin definitions with id, name, cost, and color scheme. */
|
||||
const SKINS = {
|
||||
default: {
|
||||
@@ -45,15 +51,15 @@ const SKINS = {
|
||||
id: 'neon',
|
||||
nameKey: 'skin.neon',
|
||||
cost: 2000,
|
||||
colors: { body: '#00FF7F', turret: '#00CED1', track: '#008B8B' },
|
||||
preview: '#00FF7F',
|
||||
colors: { body: '#FF1493', turret: '#FF6EC7', track: '#C71585' },
|
||||
preview: '#FF1493',
|
||||
},
|
||||
shadow: {
|
||||
id: 'shadow',
|
||||
nameKey: 'skin.shadow',
|
||||
nebula: {
|
||||
id: 'nebula',
|
||||
nameKey: 'skin.nebula',
|
||||
cost: 3000,
|
||||
colors: { body: '#2C2C2C', turret: '#1A1A1A', track: '#0D0D0D' },
|
||||
preview: '#2C2C2C',
|
||||
colors: { body: '#6A0DAD', turret: '#FF00FF', track: '#3D0066' },
|
||||
preview: '#6A0DAD',
|
||||
},
|
||||
royal: {
|
||||
id: 'royal',
|
||||
@@ -62,10 +68,31 @@ const SKINS = {
|
||||
colors: { body: '#FFD700', turret: '#DAA520', track: '#B8860B' },
|
||||
preview: '#FFD700',
|
||||
},
|
||||
sakura: {
|
||||
id: 'sakura',
|
||||
nameKey: 'skin.sakura',
|
||||
cost: 3500,
|
||||
colors: { body: '#FFB7C5', turret: '#FF69B4', track: '#C44D78' },
|
||||
preview: '#FFB7C5',
|
||||
},
|
||||
thunder: {
|
||||
id: 'thunder',
|
||||
nameKey: 'skin.thunder',
|
||||
cost: 4000,
|
||||
colors: { body: '#1E90FF', turret: '#00BFFF', track: '#0A5E9C' },
|
||||
preview: '#1E90FF',
|
||||
},
|
||||
diamond: {
|
||||
id: 'diamond',
|
||||
nameKey: 'skin.diamond',
|
||||
cost: 8000,
|
||||
colors: { body: '#E0F7FF', turret: '#7DF9FF', track: '#5B8FA8' },
|
||||
preview: '#7DF9FF',
|
||||
},
|
||||
};
|
||||
|
||||
/** Ordered list of skin IDs for display. */
|
||||
const SKIN_ORDER = ['default', 'arctic', 'inferno', 'jungle', 'phantom', 'neon', 'shadow', 'royal'];
|
||||
const SKIN_ORDER = ['default', 'arctic', 'inferno', 'jungle', 'phantom', 'neon', 'nebula', 'royal', 'sakura', 'thunder', 'diamond'];
|
||||
|
||||
class SkinManager {
|
||||
constructor() {
|
||||
@@ -131,6 +158,7 @@ class SkinManager {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isUnlocked(skinId) {
|
||||
if (DEV_UNLOCK_ALL) return true;
|
||||
return this._unlocked.has(skinId);
|
||||
}
|
||||
|
||||
@@ -180,6 +208,19 @@ class SkinManager {
|
||||
return { success: false, error: 'Already unlocked' };
|
||||
}
|
||||
|
||||
// Dev mode: unlock for free without spending gold
|
||||
if (DEV_UNLOCK_ALL) {
|
||||
this._unlocked.add(skinId);
|
||||
this._save();
|
||||
console.log(`[SkinManager][DEV] Free unlock skin: ${skinId}`);
|
||||
try {
|
||||
if (GameGlobal.eventBus) {
|
||||
GameGlobal.eventBus.emit('skin:purchased', { id: skinId, cost: 0 });
|
||||
}
|
||||
} catch (e) {}
|
||||
return { success: true };
|
||||
}
|
||||
|
||||
const cm = GameGlobal.currencyManager;
|
||||
if (!cm || !cm.hasGold(skin.cost)) {
|
||||
return { success: false, error: 'Insufficient gold' };
|
||||
@@ -215,7 +256,7 @@ class SkinManager {
|
||||
return { success: false, error: 'Invalid skin' };
|
||||
}
|
||||
|
||||
if (!this._unlocked.has(skinId)) {
|
||||
if (!DEV_UNLOCK_ALL && !this._unlocked.has(skinId)) {
|
||||
return { success: false, error: 'Not unlocked' };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user