updejt
This commit is contained in:
154
src/utils/CheatConsole.js
Normal file
154
src/utils/CheatConsole.js
Normal file
@@ -0,0 +1,154 @@
|
||||
// CHEAT CONSOLE - NovaFarma
|
||||
// Press ` (backtick) to open console
|
||||
|
||||
window.cheats = {
|
||||
// God Mode - Invincibility
|
||||
godMode: function () {
|
||||
window.godMode = !window.godMode;
|
||||
const status = window.godMode ? 'ENABLED ⚡' : 'DISABLED';
|
||||
console.log(`🎮 GOD MODE: ${status}`);
|
||||
|
||||
if (window.godMode) {
|
||||
// Visual indicator
|
||||
const gameScene = window.gameScene;
|
||||
if (gameScene && gameScene.player) {
|
||||
gameScene.player.sprite.setTint(0xFFD700);
|
||||
}
|
||||
} else {
|
||||
const gameScene = window.gameScene;
|
||||
if (gameScene && gameScene.player) {
|
||||
gameScene.player.sprite.clearTint();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Infinite Resources
|
||||
resources: function (amount = 9999) {
|
||||
const gameScene = window.gameScene;
|
||||
if (!gameScene || !gameScene.inventorySystem) {
|
||||
console.log('❌ Inventory system not found');
|
||||
return;
|
||||
}
|
||||
|
||||
gameScene.inventorySystem.addItem('wood', amount);
|
||||
gameScene.inventorySystem.addItem('stone', amount);
|
||||
gameScene.inventorySystem.addItem('iron', amount);
|
||||
|
||||
console.log(`💰 Added ${amount} of each resource!`);
|
||||
},
|
||||
|
||||
// Speed Boost
|
||||
speed: function (multiplier = 2) {
|
||||
const gameScene = window.gameScene;
|
||||
if (!gameScene || !gameScene.player) {
|
||||
console.log('❌ Player not found');
|
||||
return;
|
||||
}
|
||||
|
||||
gameScene.player.moveSpeed = 200 * multiplier;
|
||||
console.log(`🏃 Speed multiplier: ${multiplier}x`);
|
||||
},
|
||||
|
||||
// Full Health
|
||||
heal: function () {
|
||||
const gameScene = window.gameScene;
|
||||
if (!gameScene || !gameScene.player) {
|
||||
console.log('❌ Player not found');
|
||||
return;
|
||||
}
|
||||
|
||||
gameScene.player.hp = gameScene.player.maxHp;
|
||||
console.log('❤️ Full health restored!');
|
||||
},
|
||||
|
||||
// Teleport to coordinates
|
||||
teleport: function (x, y) {
|
||||
const gameScene = window.gameScene;
|
||||
if (!gameScene || !gameScene.player) {
|
||||
console.log('❌ Player not found');
|
||||
return;
|
||||
}
|
||||
|
||||
gameScene.player.gridX = x;
|
||||
gameScene.player.gridY = y;
|
||||
gameScene.player.sprite.setPosition(
|
||||
gameScene.player.scene.iso.gridToScreen(x, y).x + gameScene.player.offsetX,
|
||||
gameScene.player.scene.iso.gridToScreen(x, y).y + gameScene.player.offsetY
|
||||
);
|
||||
|
||||
console.log(`📍 Teleported to (${x}, ${y})`);
|
||||
},
|
||||
|
||||
// Day/Night time control
|
||||
setTime: function (hour) {
|
||||
const gameScene = window.gameScene;
|
||||
if (!gameScene || !gameScene.timeSystem) {
|
||||
console.log('❌ Time system not found');
|
||||
return;
|
||||
}
|
||||
|
||||
gameScene.timeSystem.hour = hour;
|
||||
console.log(`⏰ Time set to ${hour}:00`);
|
||||
},
|
||||
|
||||
// Instant harvest all crops
|
||||
harvestAll: function () {
|
||||
const gameScene = window.gameScene;
|
||||
if (!gameScene || !gameScene.farmingSystem) {
|
||||
console.log('❌ Farming system not found');
|
||||
return;
|
||||
}
|
||||
|
||||
let count = 0;
|
||||
for (let key in gameScene.farmingSystem.crops) {
|
||||
const crop = gameScene.farmingSystem.crops[key];
|
||||
if (crop.stage === 'ripe') {
|
||||
const [x, y] = key.split(',').map(Number);
|
||||
gameScene.farmingSystem.harvestCrop(x, y);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`🌾 Harvested ${count} crops!`);
|
||||
},
|
||||
|
||||
// List all cheats
|
||||
help: function () {
|
||||
console.log(`
|
||||
🎮 CHEAT CONSOLE - NovaFarma
|
||||
=============================
|
||||
|
||||
Available Commands:
|
||||
-------------------
|
||||
cheats.godMode() - Toggle invincibility
|
||||
cheats.resources(9999) - Add resources (default: 9999)
|
||||
cheats.speed(2) - Set speed multiplier (default: 2x)
|
||||
cheats.heal() - Restore full health
|
||||
cheats.teleport(x, y) - Teleport to coordinates
|
||||
cheats.setTime(12) - Set time (0-24)
|
||||
cheats.harvestAll() - Harvest all ripe crops
|
||||
cheats.help() - Show this menu
|
||||
|
||||
Quick Keys:
|
||||
-----------
|
||||
Press \` (backtick) to open console
|
||||
Type: cheats.godMode()
|
||||
|
||||
Example Usage:
|
||||
--------------
|
||||
cheats.godMode() // Enable god mode
|
||||
cheats.resources(1000) // Add 1000 of each resource
|
||||
cheats.speed(5) // 5x speed boost
|
||||
cheats.teleport(50, 50) // Go to center
|
||||
`);
|
||||
}
|
||||
};
|
||||
|
||||
// Auto-show help on first load
|
||||
console.log('🎮 Cheat Console Loaded! Type "cheats.help()" for commands.');
|
||||
|
||||
// Quick access
|
||||
window.god = window.cheats.godMode;
|
||||
window.res = window.cheats.resources;
|
||||
|
||||
console.log('💡 Quick shortcuts: god() or res()');
|
||||
Reference in New Issue
Block a user