Spaces:
Running
Running
Add 2 files
Browse files- README.md +6 -4
- index.html +873 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
colorTo: blue
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: neonprotocol
|
| 3 |
+
emoji: 🐳
|
| 4 |
+
colorFrom: blue
|
| 5 |
colorTo: blue
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,873 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Neon Protocol - Hacking Simulator</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<style>
|
| 10 |
+
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');
|
| 11 |
+
|
| 12 |
+
:root {
|
| 13 |
+
--neon-green: #39ff14;
|
| 14 |
+
--dark-bg: #0a0a0a;
|
| 15 |
+
--terminal-bg: rgba(10, 10, 10, 0.9);
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
body {
|
| 19 |
+
font-family: 'Share Tech Mono', monospace;
|
| 20 |
+
background-color: var(--dark-bg);
|
| 21 |
+
color: var(--neon-green);
|
| 22 |
+
overflow-x: hidden;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
.terminal {
|
| 26 |
+
background-color: var(--terminal-bg);
|
| 27 |
+
border: 1px solid var(--neon-green);
|
| 28 |
+
box-shadow: 0 0 10px var(--neon-green);
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
.cursor {
|
| 32 |
+
animation: blink 1s infinite;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
@keyframes blink {
|
| 36 |
+
0%, 100% { opacity: 1; }
|
| 37 |
+
50% { opacity: 0; }
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
+
.hack-button {
|
| 41 |
+
transition: all 0.3s;
|
| 42 |
+
box-shadow: 0 0 5px var(--neon-green);
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
.hack-button:hover {
|
| 46 |
+
transform: translateY(-2px);
|
| 47 |
+
box-shadow: 0 0 15px var(--neon-green);
|
| 48 |
+
}
|
| 49 |
+
|
| 50 |
+
.progress-bar {
|
| 51 |
+
height: 5px;
|
| 52 |
+
background-color: var(--neon-green);
|
| 53 |
+
transition: width 0.1s linear;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
.mission-complete {
|
| 57 |
+
position: fixed;
|
| 58 |
+
top: 0;
|
| 59 |
+
left: 0;
|
| 60 |
+
width: 100%;
|
| 61 |
+
height: 100%;
|
| 62 |
+
background-color: black;
|
| 63 |
+
z-index: 1000;
|
| 64 |
+
display: flex;
|
| 65 |
+
justify-content: center;
|
| 66 |
+
align-items: center;
|
| 67 |
+
flex-direction: column;
|
| 68 |
+
animation: explode 2s forwards;
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
@keyframes explode {
|
| 72 |
+
0% {
|
| 73 |
+
opacity: 0;
|
| 74 |
+
transform: scale(1);
|
| 75 |
+
}
|
| 76 |
+
10% {
|
| 77 |
+
opacity: 1;
|
| 78 |
+
transform: scale(1);
|
| 79 |
+
}
|
| 80 |
+
100% {
|
| 81 |
+
opacity: 0;
|
| 82 |
+
transform: scale(10);
|
| 83 |
+
}
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
.binary-particle {
|
| 87 |
+
position: absolute;
|
| 88 |
+
color: var(--neon-green);
|
| 89 |
+
font-size: 1rem;
|
| 90 |
+
animation: float 3s linear forwards;
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
@keyframes float {
|
| 94 |
+
to {
|
| 95 |
+
transform: translate(var(--tx), var(--ty));
|
| 96 |
+
opacity: 0;
|
| 97 |
+
}
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
.location-button {
|
| 101 |
+
transition: all 0.3s;
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
.location-button:hover {
|
| 105 |
+
transform: scale(1.05);
|
| 106 |
+
box-shadow: 0 0 10px var(--neon-green);
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
.enemy-attack {
|
| 110 |
+
animation: shake 0.5s linear infinite;
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
@keyframes shake {
|
| 114 |
+
0%, 100% { transform: translateX(0); }
|
| 115 |
+
25% { transform: translateX(-5px); }
|
| 116 |
+
75% { transform: translateX(5px); }
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
@media (max-width: 768px) {
|
| 120 |
+
.terminal-input {
|
| 121 |
+
width: 80%;
|
| 122 |
+
}
|
| 123 |
+
}
|
| 124 |
+
</style>
|
| 125 |
+
</head>
|
| 126 |
+
<body class="min-h-screen flex flex-col">
|
| 127 |
+
<!-- Mission Complete Animation (hidden by default) -->
|
| 128 |
+
<div id="missionComplete" class="mission-complete hidden">
|
| 129 |
+
<h1 class="text-4xl mb-4">MISSION COMPLETE</h1>
|
| 130 |
+
<p class="text-xl">Access Granted</p>
|
| 131 |
+
</div>
|
| 132 |
+
|
| 133 |
+
<!-- Main Game Container -->
|
| 134 |
+
<div class="container mx-auto px-4 py-6 flex-grow flex flex-col">
|
| 135 |
+
<!-- Header -->
|
| 136 |
+
<header class="flex justify-between items-center mb-6 border-b border-neon-green pb-4">
|
| 137 |
+
<div>
|
| 138 |
+
<h1 class="text-3xl font-bold text-neon-green">NEON PROTOCOL</h1>
|
| 139 |
+
<p class="text-sm">White Hat Hacking Simulator</p>
|
| 140 |
+
</div>
|
| 141 |
+
<div class="flex items-center space-x-4">
|
| 142 |
+
<div id="playerStats" class="text-right">
|
| 143 |
+
<p>Reputation: <span id="reputation">0</span></p>
|
| 144 |
+
<p>Credits: $<span id="credits">1000</span></p>
|
| 145 |
+
<p>Firewall: <span id="firewall">50</span>%</p>
|
| 146 |
+
</div>
|
| 147 |
+
<button id="saveGame" class="bg-black text-neon-green border border-neon-green px-3 py-1 rounded hover:bg-neon-green hover:text-black">
|
| 148 |
+
<i class="fas fa-save"></i> Save
|
| 149 |
+
</button>
|
| 150 |
+
<button id="loadGame" class="bg-black text-neon-green border border-neon-green px-3 py-1 rounded hover:bg-neon-green hover:text-black">
|
| 151 |
+
<i class="fas fa-folder-open"></i> Load
|
| 152 |
+
</button>
|
| 153 |
+
</div>
|
| 154 |
+
</header>
|
| 155 |
+
|
| 156 |
+
<!-- Game Content -->
|
| 157 |
+
<div class="flex flex-col md:flex-row flex-grow gap-6">
|
| 158 |
+
<!-- Left Panel - Game Info -->
|
| 159 |
+
<div class="w-full md:w-1/4 flex flex-col gap-4">
|
| 160 |
+
<!-- Player Info -->
|
| 161 |
+
<div class="terminal p-4">
|
| 162 |
+
<h2 class="text-xl mb-2 border-b border-neon-green pb-2">Player: <span id="playerName">Neo_Byte</span></h2>
|
| 163 |
+
<p class="mb-1">Level: <span id="playerLevel">1</span></p>
|
| 164 |
+
<p class="mb-1">Skills:</p>
|
| 165 |
+
<div class="mb-2">
|
| 166 |
+
<p class="text-sm">Brute Force: <span id="skillBrute">1</span>/10</p>
|
| 167 |
+
<p class="text-sm">Cryptography: <span id="skillCrypto">1</span>/10</p>
|
| 168 |
+
<p class="text-sm">Stealth: <span id="skillStealth">1</span>/10</p>
|
| 169 |
+
</div>
|
| 170 |
+
<p class="mb-1">Current Location: <span id="currentLocation">Home Base</span></p>
|
| 171 |
+
</div>
|
| 172 |
+
|
| 173 |
+
<!-- Locations -->
|
| 174 |
+
<div class="terminal p-4">
|
| 175 |
+
<h2 class="text-xl mb-2 border-b border-neon-green pb-2">Locations</h2>
|
| 176 |
+
<div class="grid grid-cols-2 gap-2">
|
| 177 |
+
<button class="location-button bg-black text-neon-green border border-neon-green p-2 rounded" data-location="home">
|
| 178 |
+
Home Base
|
| 179 |
+
</button>
|
| 180 |
+
<button class="location-button bg-black text-neon-green border border-neon-green p-2 rounded" data-location="darkweb">
|
| 181 |
+
Dark Web
|
| 182 |
+
</button>
|
| 183 |
+
<button class="location-button bg-black text-neon-green border border-neon-green p-2 rounded" data-location="bank">
|
| 184 |
+
City Bank
|
| 185 |
+
</button>
|
| 186 |
+
<button class="location-button bg-black text-neon-green border border-neon-green p-2 rounded" data-location="corp">
|
| 187 |
+
MegaCorp
|
| 188 |
+
</button>
|
| 189 |
+
<button class="location-button bg-black text-neon-green border border-neon-green p-2 rounded" data-location="police">
|
| 190 |
+
Police DB
|
| 191 |
+
</button>
|
| 192 |
+
<button class="location-button bg-black text-neon-green border border-neon-green p-2 rounded" data-location="shadow">
|
| 193 |
+
Shadow Net
|
| 194 |
+
</button>
|
| 195 |
+
</div>
|
| 196 |
+
</div>
|
| 197 |
+
|
| 198 |
+
<!-- Quick Actions -->
|
| 199 |
+
<div class="terminal p-4">
|
| 200 |
+
<h2 class="text-xl mb-2 border-b border-neon-green pb-2">Quick Actions</h2>
|
| 201 |
+
<div class="grid grid-cols-2 gap-2">
|
| 202 |
+
<button class="hack-button bg-black text-neon-green border border-neon-green p-2 rounded" data-command="scan">
|
| 203 |
+
<i class="fas fa-search"></i> Scan
|
| 204 |
+
</button>
|
| 205 |
+
<button class="hack-button bg-black text-neon-green border border-neon-green p-2 rounded" data-command="firewall">
|
| 206 |
+
<i class="fas fa-shield-alt"></i> Firewall
|
| 207 |
+
</button>
|
| 208 |
+
<button class="hack-button bg-black text-neon-green border border-neon-green p-2 rounded" data-command="upgrade">
|
| 209 |
+
<i class="fas fa-level-up-alt"></i> Upgrade
|
| 210 |
+
</button>
|
| 211 |
+
<button class="hack-button bg-black text-neon-green border border-neon-green p-2 rounded" data-command="help">
|
| 212 |
+
<i class="fas fa-question"></i> Help
|
| 213 |
+
</button>
|
| 214 |
+
</div>
|
| 215 |
+
</div>
|
| 216 |
+
</div>
|
| 217 |
+
|
| 218 |
+
<!-- Main Panel - Terminal -->
|
| 219 |
+
<div class="w-full md:w-2/4 flex flex-col">
|
| 220 |
+
<div class="terminal p-4 flex-grow flex flex-col">
|
| 221 |
+
<h2 class="text-xl mb-2 border-b border-neon-green pb-2">Terminal</h2>
|
| 222 |
+
<div id="terminalOutput" class="flex-grow overflow-y-auto mb-4 h-64">
|
| 223 |
+
<p>> Welcome to Neon Protocol, Neo_Byte.</p>
|
| 224 |
+
<p>> Fresh out of high school, you're ready to make your mark in the hacking world.</p>
|
| 225 |
+
<p>> Your goal: Use your skills to take down criminal organizations while avoiding detection.</p>
|
| 226 |
+
<p>> Type 'help' for available commands.</p>
|
| 227 |
+
<p>> </p>
|
| 228 |
+
</div>
|
| 229 |
+
<div class="flex items-center">
|
| 230 |
+
<span class="mr-2">></span>
|
| 231 |
+
<input id="terminalInput" type="text" class="terminal-input bg-transparent border-b border-neon-green outline-none flex-grow text-neon-green" autofocus>
|
| 232 |
+
</div>
|
| 233 |
+
</div>
|
| 234 |
+
|
| 235 |
+
<!-- Active Mission -->
|
| 236 |
+
<div id="activeMission" class="terminal p-4 mt-4 hidden">
|
| 237 |
+
<h2 class="text-xl mb-2 border-b border-neon-green pb-2">Active Mission</h2>
|
| 238 |
+
<p id="missionTitle" class="font-bold"></p>
|
| 239 |
+
<p id="missionDesc" class="mb-2"></p>
|
| 240 |
+
<div class="progress-bar-container bg-gray-800 w-full h-1 mb-2">
|
| 241 |
+
<div id="missionProgress" class="progress-bar" style="width: 0%"></div>
|
| 242 |
+
</div>
|
| 243 |
+
<p id="missionTimer" class="text-right"></p>
|
| 244 |
+
<div class="flex justify-between mt-2">
|
| 245 |
+
<button id="abortMission" class="hack-button bg-black text-red-500 border border-red-500 px-3 py-1 rounded">
|
| 246 |
+
Abort
|
| 247 |
+
</button>
|
| 248 |
+
<button id="completeMission" class="hack-button bg-black text-neon-green border border-neon-green px-3 py-1 rounded hidden">
|
| 249 |
+
Complete
|
| 250 |
+
</button>
|
| 251 |
+
</div>
|
| 252 |
+
</div>
|
| 253 |
+
</div>
|
| 254 |
+
|
| 255 |
+
<!-- Right Panel - Missions & Alerts -->
|
| 256 |
+
<div class="w-full md:w-1/4 flex flex-col gap-4">
|
| 257 |
+
<!-- Available Missions -->
|
| 258 |
+
<div class="terminal p-4">
|
| 259 |
+
<h2 class="text-xl mb-2 border-b border-neon-green pb-2">Available Missions</h2>
|
| 260 |
+
<div id="missionsList" class="space-y-2">
|
| 261 |
+
<div class="mission-item border border-neon-green p-2 rounded">
|
| 262 |
+
<h3 class="font-bold">Tutorial: First Hack</h3>
|
| 263 |
+
<p class="text-sm mb-2">Learn basic commands by hacking a test server.</p>
|
| 264 |
+
<button class="hack-button bg-black text-neon-green border border-neon-green w-full py-1 rounded" data-mission="tutorial">
|
| 265 |
+
Accept
|
| 266 |
+
</button>
|
| 267 |
+
</div>
|
| 268 |
+
</div>
|
| 269 |
+
</div>
|
| 270 |
+
|
| 271 |
+
<!-- Alerts -->
|
| 272 |
+
<div id="alerts" class="terminal p-4">
|
| 273 |
+
<h2 class="text-xl mb-2 border-b border-neon-green pb-2">Alerts</h2>
|
| 274 |
+
<div id="alertsList">
|
| 275 |
+
<p class="text-sm">No active alerts</p>
|
| 276 |
+
</div>
|
| 277 |
+
</div>
|
| 278 |
+
|
| 279 |
+
<!-- Enemy Attacks -->
|
| 280 |
+
<div id="enemyAttack" class="terminal p-4 hidden enemy-attack border border-red-500">
|
| 281 |
+
<h2 class="text-xl mb-2 border-b border-red-500 pb-2 text-red-500">INTRUSION DETECTED!</h2>
|
| 282 |
+
<p class="text-red-500 mb-2">You're under attack by <span id="attackerName">Shadow Syndicate</span>!</p>
|
| 283 |
+
<div class="flex justify-between">
|
| 284 |
+
<button id="defendAttack" class="hack-button bg-black text-red-500 border border-red-500 px-3 py-1 rounded">
|
| 285 |
+
Defend
|
| 286 |
+
</button>
|
| 287 |
+
<button id="escapeAttack" class="hack-button bg-black text-neon-green border border-neon-green px-3 py-1 rounded">
|
| 288 |
+
Escape
|
| 289 |
+
</button>
|
| 290 |
+
</div>
|
| 291 |
+
</div>
|
| 292 |
+
</div>
|
| 293 |
+
</div>
|
| 294 |
+
</div>
|
| 295 |
+
|
| 296 |
+
<script>
|
| 297 |
+
// Game State
|
| 298 |
+
const gameState = {
|
| 299 |
+
player: {
|
| 300 |
+
name: "Neo_Byte",
|
| 301 |
+
level: 1,
|
| 302 |
+
reputation: 0,
|
| 303 |
+
credits: 1000,
|
| 304 |
+
firewall: 50,
|
| 305 |
+
skills: {
|
| 306 |
+
brute: 1,
|
| 307 |
+
crypto: 1,
|
| 308 |
+
stealth: 1
|
| 309 |
+
},
|
| 310 |
+
location: "home",
|
| 311 |
+
missionsCompleted: 0
|
| 312 |
+
},
|
| 313 |
+
missions: {
|
| 314 |
+
tutorial: {
|
| 315 |
+
title: "Tutorial: First Hack",
|
| 316 |
+
description: "Learn basic commands by hacking a test server. Use 'scan' to find vulnerabilities, then 'exploit' to break in.",
|
| 317 |
+
difficulty: 1,
|
| 318 |
+
reward: 500,
|
| 319 |
+
repReward: 10,
|
| 320 |
+
timeLimit: 300, // 5 minutes
|
| 321 |
+
progress: 0,
|
| 322 |
+
active: false
|
| 323 |
+
},
|
| 324 |
+
bankJob: {
|
| 325 |
+
title: "Bank Heist: Stop the Robbers",
|
| 326 |
+
description: "A criminal group is planning to hack City Bank. Infiltrate their systems and stop the transfer.",
|
| 327 |
+
difficulty: 3,
|
| 328 |
+
reward: 2000,
|
| 329 |
+
repReward: 30,
|
| 330 |
+
timeLimit: 600, // 10 minutes
|
| 331 |
+
progress: 0,
|
| 332 |
+
active: false,
|
| 333 |
+
requiredLevel: 2
|
| 334 |
+
},
|
| 335 |
+
corpEspionage: {
|
| 336 |
+
title: "Corporate Espionage",
|
| 337 |
+
description: "MegaCorp is stealing data from small businesses. Find evidence and expose them.",
|
| 338 |
+
difficulty: 4,
|
| 339 |
+
reward: 3500,
|
| 340 |
+
repReward: 50,
|
| 341 |
+
timeLimit: 900, // 15 minutes
|
| 342 |
+
progress: 0,
|
| 343 |
+
active: false,
|
| 344 |
+
requiredLevel: 3
|
| 345 |
+
},
|
| 346 |
+
shadowSyndicate: {
|
| 347 |
+
title: "Shadow Syndicate Takedown",
|
| 348 |
+
description: "The notorious hacking group is planning a major attack. Take down their servers.",
|
| 349 |
+
difficulty: 5,
|
| 350 |
+
reward: 5000,
|
| 351 |
+
repReward: 100,
|
| 352 |
+
timeLimit: 1200, // 20 minutes
|
| 353 |
+
progress: 0,
|
| 354 |
+
active: false,
|
| 355 |
+
requiredLevel: 5
|
| 356 |
+
}
|
| 357 |
+
},
|
| 358 |
+
availableMissions: ["tutorial"],
|
| 359 |
+
currentMission: null,
|
| 360 |
+
enemyAttack: null,
|
| 361 |
+
enemies: [
|
| 362 |
+
{ name: "Script Kiddies", strength: 1, reward: 200 },
|
| 363 |
+
{ name: "Dark Web Thugs", strength: 2, reward: 500 },
|
| 364 |
+
{ name: "Cyber Mafia", strength: 3, reward: 1000 },
|
| 365 |
+
{ name: "Shadow Syndicate", strength: 4, reward: 2000 }
|
| 366 |
+
],
|
| 367 |
+
locations: {
|
| 368 |
+
home: "Home Base",
|
| 369 |
+
darkweb: "Dark Web",
|
| 370 |
+
bank: "City Bank",
|
| 371 |
+
corp: "MegaCorp",
|
| 372 |
+
police: "Police DB",
|
| 373 |
+
shadow: "Shadow Net"
|
| 374 |
+
}
|
| 375 |
+
};
|
| 376 |
+
|
| 377 |
+
// DOM Elements
|
| 378 |
+
const terminalInput = document.getElementById('terminalInput');
|
| 379 |
+
const terminalOutput = document.getElementById('terminalOutput');
|
| 380 |
+
const playerName = document.getElementById('playerName');
|
| 381 |
+
const playerLevel = document.getElementById('playerLevel');
|
| 382 |
+
const reputation = document.getElementById('reputation');
|
| 383 |
+
const credits = document.getElementById('credits');
|
| 384 |
+
const firewall = document.getElementById('firewall');
|
| 385 |
+
const skillBrute = document.getElementById('skillBrute');
|
| 386 |
+
const skillCrypto = document.getElementById('skillCrypto');
|
| 387 |
+
const skillStealth = document.getElementById('skillStealth');
|
| 388 |
+
const currentLocation = document.getElementById('currentLocation');
|
| 389 |
+
const missionsList = document.getElementById('missionsList');
|
| 390 |
+
const activeMission = document.getElementById('activeMission');
|
| 391 |
+
const missionTitle = document.getElementById('missionTitle');
|
| 392 |
+
const missionDesc = document.getElementById('missionDesc');
|
| 393 |
+
const missionProgress = document.getElementById('missionProgress');
|
| 394 |
+
const missionTimer = document.getElementById('missionTimer');
|
| 395 |
+
const completeMission = document.getElementById('completeMission');
|
| 396 |
+
const abortMission = document.getElementById('abortMission');
|
| 397 |
+
const alertsList = document.getElementById('alertsList');
|
| 398 |
+
const enemyAttack = document.getElementById('enemyAttack');
|
| 399 |
+
const defendAttack = document.getElementById('defendAttack');
|
| 400 |
+
const escapeAttack = document.getElementById('escapeAttack');
|
| 401 |
+
const missionComplete = document.getElementById('missionComplete');
|
| 402 |
+
const saveGame = document.getElementById('saveGame');
|
| 403 |
+
const loadGame = document.getElementById('loadGame');
|
| 404 |
+
|
| 405 |
+
// Game Variables
|
| 406 |
+
let missionInterval;
|
| 407 |
+
let attackInterval;
|
| 408 |
+
let missionTimeLeft;
|
| 409 |
+
let enemyAttackTime = 30;
|
| 410 |
+
|
| 411 |
+
// Initialize Game
|
| 412 |
+
function initGame() {
|
| 413 |
+
updatePlayerStats();
|
| 414 |
+
renderMissions();
|
| 415 |
+
setupEventListeners();
|
| 416 |
+
|
| 417 |
+
// Random enemy attacks
|
| 418 |
+
setInterval(() => {
|
| 419 |
+
if (!gameState.currentMission && Math.random() > 0.7) {
|
| 420 |
+
startEnemyAttack();
|
| 421 |
+
}
|
| 422 |
+
}, 300000); // Every 5 minutes
|
| 423 |
+
|
| 424 |
+
// Check for new missions
|
| 425 |
+
setInterval(checkForNewMissions, 60000); // Every minute
|
| 426 |
+
}
|
| 427 |
+
|
| 428 |
+
// Update player stats display
|
| 429 |
+
function updatePlayerStats() {
|
| 430 |
+
playerName.textContent = gameState.player.name;
|
| 431 |
+
playerLevel.textContent = gameState.player.level;
|
| 432 |
+
reputation.textContent = gameState.player.reputation;
|
| 433 |
+
credits.textContent = gameState.player.credits;
|
| 434 |
+
firewall.textContent = gameState.player.firewall;
|
| 435 |
+
skillBrute.textContent = gameState.player.skills.brute;
|
| 436 |
+
skillCrypto.textContent = gameState.player.skills.crypto;
|
| 437 |
+
skillStealth.textContent = gameState.player.skills.stealth;
|
| 438 |
+
currentLocation.textContent = gameState.locations[gameState.player.location];
|
| 439 |
+
}
|
| 440 |
+
|
| 441 |
+
// Render available missions
|
| 442 |
+
function renderMissions() {
|
| 443 |
+
missionsList.innerHTML = '';
|
| 444 |
+
|
| 445 |
+
gameState.availableMissions.forEach(missionId => {
|
| 446 |
+
const mission = gameState.missions[missionId];
|
| 447 |
+
const missionElement = document.createElement('div');
|
| 448 |
+
missionElement.className = 'mission-item border border-neon-green p-2 rounded';
|
| 449 |
+
missionElement.innerHTML = `
|
| 450 |
+
<h3 class="font-bold">${mission.title}</h3>
|
| 451 |
+
<p class="text-sm mb-2">${mission.description}</p>
|
| 452 |
+
<button class="hack-button bg-black text-neon-green border border-neon-green w-full py-1 rounded" data-mission="${missionId}">
|
| 453 |
+
Accept
|
| 454 |
+
</button>
|
| 455 |
+
`;
|
| 456 |
+
missionsList.appendChild(missionElement);
|
| 457 |
+
});
|
| 458 |
+
|
| 459 |
+
// Add event listeners to mission buttons
|
| 460 |
+
document.querySelectorAll('[data-mission]').forEach(button => {
|
| 461 |
+
button.addEventListener('click', function() {
|
| 462 |
+
startMission(this.dataset.mission);
|
| 463 |
+
});
|
| 464 |
+
});
|
| 465 |
+
}
|
| 466 |
+
|
| 467 |
+
// Check for new missions based on player level
|
| 468 |
+
function checkForNewMissions() {
|
| 469 |
+
if (!gameState.availableMissions.includes('bankJob') && gameState.player.level >= 2) {
|
| 470 |
+
gameState.availableMissions.push('bankJob');
|
| 471 |
+
addToTerminal("> New mission available: Bank Heist - Stop the Robbers");
|
| 472 |
+
renderMissions();
|
| 473 |
+
}
|
| 474 |
+
|
| 475 |
+
if (!gameState.availableMissions.includes('corpEspionage') && gameState.player.level >= 3) {
|
| 476 |
+
gameState.availableMissions.push('corpEspionage');
|
| 477 |
+
addToTerminal("> New mission available: Corporate Espionage");
|
| 478 |
+
renderMissions();
|
| 479 |
+
}
|
| 480 |
+
|
| 481 |
+
if (!gameState.availableMissions.includes('shadowSyndicate') && gameState.player.level >= 5) {
|
| 482 |
+
gameState.availableMissions.push('shadowSyndicate');
|
| 483 |
+
addToTerminal("> New mission available: Shadow Syndicate Takedown");
|
| 484 |
+
renderMissions();
|
| 485 |
+
}
|
| 486 |
+
}
|
| 487 |
+
|
| 488 |
+
// Start a mission
|
| 489 |
+
function startMission(missionId) {
|
| 490 |
+
if (gameState.currentMission) {
|
| 491 |
+
addToTerminal("> You're already on a mission. Finish or abort it first.");
|
| 492 |
+
return;
|
| 493 |
+
}
|
| 494 |
+
|
| 495 |
+
const mission = gameState.missions[missionId];
|
| 496 |
+
gameState.currentMission = missionId;
|
| 497 |
+
mission.active = true;
|
| 498 |
+
mission.progress = 0;
|
| 499 |
+
missionTimeLeft = mission.timeLimit;
|
| 500 |
+
|
| 501 |
+
// Update UI
|
| 502 |
+
activeMission.classList.remove('hidden');
|
| 503 |
+
missionTitle.textContent = mission.title;
|
| 504 |
+
missionDesc.textContent = mission.description;
|
| 505 |
+
missionProgress.style.width = '0%';
|
| 506 |
+
updateMissionTimer();
|
| 507 |
+
completeMission.classList.add('hidden');
|
| 508 |
+
|
| 509 |
+
// Remove mission from available
|
| 510 |
+
gameState.availableMissions = gameState.availableMissions.filter(m => m !== missionId);
|
| 511 |
+
renderMissions();
|
| 512 |
+
|
| 513 |
+
// Start mission timer
|
| 514 |
+
missionInterval = setInterval(() => {
|
| 515 |
+
missionTimeLeft--;
|
| 516 |
+
updateMissionTimer();
|
| 517 |
+
|
| 518 |
+
if (missionTimeLeft <= 0) {
|
| 519 |
+
failMission();
|
| 520 |
+
}
|
| 521 |
+
}, 1000);
|
| 522 |
+
|
| 523 |
+
addToTerminal(`> Mission started: ${mission.title}`);
|
| 524 |
+
addToTerminal(`> Time limit: ${Math.floor(mission.timeLimit / 60)} minutes`);
|
| 525 |
+
}
|
| 526 |
+
|
| 527 |
+
// Update mission timer display
|
| 528 |
+
function updateMissionTimer() {
|
| 529 |
+
const minutes = Math.floor(missionTimeLeft / 60);
|
| 530 |
+
const seconds = missionTimeLeft % 60;
|
| 531 |
+
missionTimer.textContent = `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
|
| 532 |
+
}
|
| 533 |
+
|
| 534 |
+
// Update mission progress
|
| 535 |
+
function updateMissionProgress(increment) {
|
| 536 |
+
const mission = gameState.missions[gameState.currentMission];
|
| 537 |
+
mission.progress += increment;
|
| 538 |
+
|
| 539 |
+
if (mission.progress >= 100) {
|
| 540 |
+
mission.progress = 100;
|
| 541 |
+
missionProgress.style.width = '100%';
|
| 542 |
+
completeMission.classList.remove('hidden');
|
| 543 |
+
addToTerminal("> Mission objective complete! Click 'Complete' to finish.");
|
| 544 |
+
} else {
|
| 545 |
+
missionProgress.style.width = `${mission.progress}%`;
|
| 546 |
+
}
|
| 547 |
+
}
|
| 548 |
+
|
| 549 |
+
// Complete current mission
|
| 550 |
+
function completeCurrentMission() {
|
| 551 |
+
const mission = gameState.missions[gameState.currentMission];
|
| 552 |
+
|
| 553 |
+
// Calculate rewards
|
| 554 |
+
const timeBonus = Math.floor((missionTimeLeft / mission.timeLimit) * 0.5 * mission.reward);
|
| 555 |
+
const totalReward = mission.reward + timeBonus;
|
| 556 |
+
|
| 557 |
+
// Update player stats
|
| 558 |
+
gameState.player.credits += totalReward;
|
| 559 |
+
gameState.player.reputation += mission.repReward;
|
| 560 |
+
gameState.player.missionsCompleted++;
|
| 561 |
+
|
| 562 |
+
// Check for level up
|
| 563 |
+
if (gameState.player.missionsCompleted >= gameState.player.level * 2) {
|
| 564 |
+
gameState.player.level++;
|
| 565 |
+
gameState.player.skills.brute = Math.min(10, gameState.player.skills.brute + 1);
|
| 566 |
+
gameState.player.skills.crypto = Math.min(10, gameState.player.skills.crypto + 1);
|
| 567 |
+
gameState.player.skills.stealth = Math.min(10, gameState.player.skills.stealth + 1);
|
| 568 |
+
addToTerminal(`> Level up! You're now level ${gameState.player.level}`);
|
| 569 |
+
}
|
| 570 |
+
|
| 571 |
+
updatePlayerStats();
|
| 572 |
+
addToTerminal(`> Mission complete! Reward: $${totalReward} ($${mission.reward} + $${timeBonus} time bonus)`);
|
| 573 |
+
addToTerminal(`> Reputation increased by ${mission.repReward}`);
|
| 574 |
+
|
| 575 |
+
// Show mission complete animation
|
| 576 |
+
showMissionComplete();
|
| 577 |
+
|
| 578 |
+
// Clean up
|
| 579 |
+
clearInterval(missionInterval);
|
| 580 |
+
gameState.currentMission = null;
|
| 581 |
+
activeMission.classList.add('hidden');
|
| 582 |
+
|
| 583 |
+
// Check for new missions
|
| 584 |
+
checkForNewMissions();
|
| 585 |
+
}
|
| 586 |
+
|
| 587 |
+
// Fail current mission
|
| 588 |
+
function failMission() {
|
| 589 |
+
const mission = gameState.missions[gameState.currentMission];
|
| 590 |
+
|
| 591 |
+
addToTerminal("> Mission failed! Time's up.");
|
| 592 |
+
|
| 593 |
+
// Penalty
|
| 594 |
+
gameState.player.reputation = Math.max(0, gameState.player.reputation - Math.floor(mission.repReward / 2));
|
| 595 |
+
updatePlayerStats();
|
| 596 |
+
|
| 597 |
+
// Clean up
|
| 598 |
+
clearInterval(missionInterval);
|
| 599 |
+
gameState.currentMission = null;
|
| 600 |
+
activeMission.classList.add('hidden');
|
| 601 |
+
|
| 602 |
+
// Add mission back to available
|
| 603 |
+
if (!gameState.availableMissions.includes(mission)) {
|
| 604 |
+
gameState.availableMissions.push(mission);
|
| 605 |
+
renderMissions();
|
| 606 |
+
}
|
| 607 |
+
}
|
| 608 |
+
|
| 609 |
+
// Abort current mission
|
| 610 |
+
function abortCurrentMission() {
|
| 611 |
+
const missionId = gameState.currentMission;
|
| 612 |
+
|
| 613 |
+
addToTerminal("> Mission aborted.");
|
| 614 |
+
|
| 615 |
+
// Clean up
|
| 616 |
+
clearInterval(missionInterval);
|
| 617 |
+
gameState.currentMission = null;
|
| 618 |
+
activeMission.classList.add('hidden');
|
| 619 |
+
|
| 620 |
+
// Add mission back to available
|
| 621 |
+
if (!gameState.availableMissions.includes(missionId)) {
|
| 622 |
+
gameState.availableMissions.push(missionId);
|
| 623 |
+
renderMissions();
|
| 624 |
+
}
|
| 625 |
+
}
|
| 626 |
+
|
| 627 |
+
// Show mission complete animation
|
| 628 |
+
function showMissionComplete() {
|
| 629 |
+
missionComplete.classList.remove('hidden');
|
| 630 |
+
|
| 631 |
+
// Create binary explosion effect
|
| 632 |
+
for (let i = 0; i < 100; i++) {
|
| 633 |
+
const binary = document.createElement('div');
|
| 634 |
+
binary.className = 'binary-particle';
|
| 635 |
+
binary.textContent = Math.random() > 0.5 ? '1' : '0';
|
| 636 |
+
binary.style.left = `${50 + (Math.random() - 0.5) * 20}%`;
|
| 637 |
+
binary.style.top = `${50 + (Math.random() - 0.5) * 20}%`;
|
| 638 |
+
binary.style.setProperty('--tx', `${(Math.random() - 0.5) * 500}px`);
|
| 639 |
+
binary.style.setProperty('--ty', `${(Math.random() - 0.5) * 500}px`);
|
| 640 |
+
missionComplete.appendChild(binary);
|
| 641 |
+
}
|
| 642 |
+
|
| 643 |
+
setTimeout(() => {
|
| 644 |
+
missionComplete.classList.add('hidden');
|
| 645 |
+
missionComplete.innerHTML = `
|
| 646 |
+
<h1 class="text-4xl mb-4">MISSION COMPLETE</h1>
|
| 647 |
+
<p class="text-xl">Access Granted</p>
|
| 648 |
+
`;
|
| 649 |
+
}, 2000);
|
| 650 |
+
}
|
| 651 |
+
|
| 652 |
+
// Start enemy attack
|
| 653 |
+
function startEnemyAttack() {
|
| 654 |
+
if (gameState.enemyAttack) return;
|
| 655 |
+
|
| 656 |
+
const enemy = gameState.enemies[Math.min(gameState.player.level - 1, gameState.enemies.length - 1)];
|
| 657 |
+
gameState.enemyAttack = {
|
| 658 |
+
enemy: enemy,
|
| 659 |
+
timeLeft: enemyAttackTime
|
| 660 |
+
};
|
| 661 |
+
|
| 662 |
+
// Update UI
|
| 663 |
+
enemyAttack.classList.remove('hidden');
|
| 664 |
+
document.getElementById('attackerName').textContent = enemy.name;
|
| 665 |
+
alertsList.innerHTML = `<p class="text-red-500">Under attack by ${enemy.name}!</p>`;
|
| 666 |
+
|
| 667 |
+
// Start attack timer
|
| 668 |
+
attackInterval = setInterval(() => {
|
| 669 |
+
gameState.enemyAttack.timeLeft--;
|
| 670 |
+
|
| 671 |
+
if (gameState.enemyAttack.timeLeft <= 0) {
|
| 672 |
+
enemyAttackSuccess();
|
| 673 |
+
}
|
| 674 |
+
}, 1000);
|
| 675 |
+
|
| 676 |
+
addToTerminal(`> WARNING: Under attack by ${enemy.name}!`);
|
| 677 |
+
}
|
| 678 |
+
|
| 679 |
+
// Defend against enemy attack
|
| 680 |
+
function defendAgainstAttack() {
|
| 681 |
+
const attack = gameState.enemyAttack;
|
| 682 |
+
const defenseChance = gameState.player.firewall / 100;
|
| 683 |
+
|
| 684 |
+
if (Math.random() < defenseChance) {
|
| 685 |
+
// Successful defense
|
| 686 |
+
addToTerminal(`> Successfully defended against ${attack.enemy.name}!`);
|
| 687 |
+
gameState.player.credits += attack.enemy.reward;
|
| 688 |
+
updatePlayerStats();
|
| 689 |
+
} else {
|
| 690 |
+
// Failed defense
|
| 691 |
+
const damage = Math.floor(Math.random() * 20) + 10;
|
| 692 |
+
gameState.player.firewall = Math.max(0, gameState.player.firewall - damage);
|
| 693 |
+
addToTerminal(`> Defense failed! Firewall damaged: -${damage}%`);
|
| 694 |
+
updatePlayerStats();
|
| 695 |
+
}
|
| 696 |
+
|
| 697 |
+
endEnemyAttack();
|
| 698 |
+
}
|
| 699 |
+
|
| 700 |
+
// Escape from enemy attack
|
| 701 |
+
function escapeFromAttack() {
|
| 702 |
+
const attack = gameState.enemyAttack;
|
| 703 |
+
const escapeChance = gameState.player.skills.stealth / 10;
|
| 704 |
+
|
| 705 |
+
if (Math.random() < escapeChance) {
|
| 706 |
+
// Successful escape
|
| 707 |
+
addToTerminal(`> Successfully escaped from ${attack.enemy.name}!`);
|
| 708 |
+
} else {
|
| 709 |
+
// Failed escape
|
| 710 |
+
const damage = Math.floor(Math.random() * 30) + 20;
|
| 711 |
+
gameState.player.firewall = Math.max(0, gameState.player.firewall - damage);
|
| 712 |
+
addToTerminal(`> Escape failed! Firewall damaged: -${damage}%`);
|
| 713 |
+
updatePlayerStats();
|
| 714 |
+
}
|
| 715 |
+
|
| 716 |
+
endEnemyAttack();
|
| 717 |
+
}
|
| 718 |
+
|
| 719 |
+
// Enemy attack succeeds
|
| 720 |
+
function enemyAttackSuccess() {
|
| 721 |
+
const attack = gameState.enemyAttack;
|
| 722 |
+
const damage = Math.floor(Math.random() * 40) + 30;
|
| 723 |
+
gameState.player.firewall = Math.max(0, gameState.player.firewall - damage);
|
| 724 |
+
addToTerminal(`> ${attack.enemy.name} breached your firewall! Damage: -${damage}%`);
|
| 725 |
+
updatePlayerStats();
|
| 726 |
+
endEnemyAttack();
|
| 727 |
+
}
|
| 728 |
+
|
| 729 |
+
// End enemy attack
|
| 730 |
+
function endEnemyAttack() {
|
| 731 |
+
clearInterval(attackInterval);
|
| 732 |
+
gameState.enemyAttack = null;
|
| 733 |
+
enemyAttack.classList.add('hidden');
|
| 734 |
+
alertsList.innerHTML = `<p class="text-sm">No active alerts</p>`;
|
| 735 |
+
}
|
| 736 |
+
|
| 737 |
+
// Add text to terminal
|
| 738 |
+
function addToTerminal(text) {
|
| 739 |
+
const line = document.createElement('p');
|
| 740 |
+
line.textContent = text;
|
| 741 |
+
terminalOutput.appendChild(line);
|
| 742 |
+
terminalOutput.scrollTop = terminalOutput.scrollHeight;
|
| 743 |
+
}
|
| 744 |
+
|
| 745 |
+
// Process terminal command
|
| 746 |
+
function processCommand(command) {
|
| 747 |
+
command = command.toLowerCase().trim();
|
| 748 |
+
|
| 749 |
+
if (!command) return;
|
| 750 |
+
|
| 751 |
+
addToTerminal(`> ${command}`);
|
| 752 |
+
|
| 753 |
+
if (gameState.currentMission) {
|
| 754 |
+
handleMissionCommand(command);
|
| 755 |
+
return;
|
| 756 |
+
}
|
| 757 |
+
|
| 758 |
+
switch (command) {
|
| 759 |
+
case 'help':
|
| 760 |
+
showHelp();
|
| 761 |
+
break;
|
| 762 |
+
case 'scan':
|
| 763 |
+
scanNetwork();
|
| 764 |
+
break;
|
| 765 |
+
case 'firewall':
|
| 766 |
+
checkFirewall();
|
| 767 |
+
break;
|
| 768 |
+
case 'upgrade':
|
| 769 |
+
showUpgradeOptions();
|
| 770 |
+
break;
|
| 771 |
+
case 'clear':
|
| 772 |
+
terminalOutput.innerHTML = '';
|
| 773 |
+
break;
|
| 774 |
+
case 'status':
|
| 775 |
+
showStatus();
|
| 776 |
+
break;
|
| 777 |
+
case 'exploit':
|
| 778 |
+
addToTerminal("> No target specified. Use 'scan' first.");
|
| 779 |
+
break;
|
| 780 |
+
default:
|
| 781 |
+
addToTerminal("> Command not recognized. Type 'help' for available commands.");
|
| 782 |
+
}
|
| 783 |
+
}
|
| 784 |
+
|
| 785 |
+
// Handle commands during a mission
|
| 786 |
+
function handleMissionCommand(command) {
|
| 787 |
+
const mission = gameState.missions[gameState.currentMission];
|
| 788 |
+
|
| 789 |
+
switch (command) {
|
| 790 |
+
case 'scan':
|
| 791 |
+
if (mission.progress < 30) {
|
| 792 |
+
updateMissionProgress(10);
|
| 793 |
+
addToTerminal("> Scanning for vulnerabilities... Found weak encryption.");
|
| 794 |
+
} else {
|
| 795 |
+
addToTerminal("> No new vulnerabilities found.");
|
| 796 |
+
}
|
| 797 |
+
break;
|
| 798 |
+
case 'exploit':
|
| 799 |
+
if (mission.progress >= 20 && mission.progress < 70) {
|
| 800 |
+
updateMissionProgress(15);
|
| 801 |
+
addToTerminal("> Exploiting vulnerability... Gained partial access.");
|
| 802 |
+
} else if (mission.progress >= 70) {
|
| 803 |
+
updateMissionProgress(25);
|
| 804 |
+
addToTerminal("> Exploiting main system... Root access achieved!");
|
| 805 |
+
} else {
|
| 806 |
+
addToTerminal("> Not enough information. Use 'scan' first.");
|
| 807 |
+
}
|
| 808 |
+
break;
|
| 809 |
+
case 'decrypt':
|
| 810 |
+
if (mission.progress >= 40 && mission.progress < 80) {
|
| 811 |
+
updateMissionProgress(20);
|
| 812 |
+
addToTerminal("> Decrypting data... Retrieved sensitive information.");
|
| 813 |
+
} else {
|
| 814 |
+
addToTerminal("> No encrypted data found or insufficient access.");
|
| 815 |
+
}
|
| 816 |
+
break;
|
| 817 |
+
case 'help':
|
| 818 |
+
showMissionHelp();
|
| 819 |
+
break;
|
| 820 |
+
default:
|
| 821 |
+
addToTerminal("> Command not recognized. Type 'help' for mission commands.");
|
| 822 |
+
}
|
| 823 |
+
}
|
| 824 |
+
|
| 825 |
+
// Show help
|
| 826 |
+
function showHelp() {
|
| 827 |
+
addToTerminal("> Available commands:");
|
| 828 |
+
addToTerminal("> help - Show this help message");
|
| 829 |
+
addToTerminal("> scan - Scan the network for vulnerabilities");
|
| 830 |
+
addToTerminal("> firewall - Check firewall status");
|
| 831 |
+
addToTerminal("> upgrade - Show upgrade options");
|
| 832 |
+
addToTerminal("> status - Show player status");
|
| 833 |
+
addToTerminal("> clear - Clear terminal");
|
| 834 |
+
addToTerminal("> Missions:");
|
| 835 |
+
addToTerminal("> Accept missions from the right panel");
|
| 836 |
+
}
|
| 837 |
+
|
| 838 |
+
// Show mission help
|
| 839 |
+
function showMissionHelp() {
|
| 840 |
+
addToTerminal("> Mission commands:");
|
| 841 |
+
addToTerminal("> scan - Find vulnerabilities in target system");
|
| 842 |
+
addToTerminal("> exploit - Attempt to exploit found vulnerabilities");
|
| 843 |
+
addToTerminal("> decrypt - Decrypt encrypted data (requires crypto skill)");
|
| 844 |
+
}
|
| 845 |
+
|
| 846 |
+
// Scan network
|
| 847 |
+
function scanNetwork() {
|
| 848 |
+
addToTerminal("> Scanning network...");
|
| 849 |
+
|
| 850 |
+
setTimeout(() => {
|
| 851 |
+
const locations = Object.keys(gameState.locations).filter(l => l !== gameState.player.location);
|
| 852 |
+
const randomLoc = locations[Math.floor(Math.random() * locations.length)];
|
| 853 |
+
|
| 854 |
+
addToTerminal(`> Found ${gameState.locations[randomLoc]} network`);
|
| 855 |
+
addToTerminal(`> Use 'travel ${randomLoc}' to connect`);
|
| 856 |
+
}, 2000);
|
| 857 |
+
}
|
| 858 |
+
|
| 859 |
+
// Check firewall
|
| 860 |
+
function checkFirewall() {
|
| 861 |
+
addToTerminal(`> Firewall integrity: ${gameState.player.firewall}%`);
|
| 862 |
+
addToTerminal(`> Upgrade cost: $${Math.floor(500 * (1 + gameState.player.firewall / 100))}`);
|
| 863 |
+
addToTerminal("> Use 'upgrade firewall' to strengthen");
|
| 864 |
+
}
|
| 865 |
+
|
| 866 |
+
// Show upgrade options
|
| 867 |
+
function showUpgradeOptions() {
|
| 868 |
+
addToTerminal("> Upgrade options:");
|
| 869 |
+
addToTerminal(`> firewall - Strengthen firewall (current: ${gameState.player.firewall}%) - $${Math.floor(500 * (1 + gameState.player.firewall / 100))}`);
|
| 870 |
+
addToTerminal(`> brute - Improve brute force skill (current: ${gameState.player.skills.brute}/10) - $${1000 * gameState.player.skills.brute}`);
|
| 871 |
+
addToTerminal(`> crypto - Improve cryptography skill (current: ${gameState.player.skills.crypto}/10) - $${1000 * gameState.player.skills.crypto}`);
|
| 872 |
+
addToTerminal(`> stealth - Improve stealth skill (current: ${gameState.player.skills.stealth}/10) - $${1000 * gameState.player.skills.
|
| 873 |
+
</html>
|