Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d68302a16f | ||
|
|
bac02ec6d7 | ||
|
|
5514d3eb04 | ||
|
|
c9ca51a437 | ||
|
|
2e336886a9 | ||
|
|
dfa030ad02 | ||
|
|
9ee82dde6a | ||
|
|
b42d24c477 | ||
|
|
90d7440756 | ||
|
|
25bf505bab | ||
|
|
796f4c73e3 | ||
|
|
7e64cdd18b | ||
|
|
2ba5ac6424 | ||
|
|
54564c5764 | ||
|
|
3e78f4ccef | ||
|
|
a3711c0500 |
@@ -12,44 +12,62 @@ env:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
# local image with Godot, the small template, fontTools, go-winres and butler (ci/Dockerfile, workflow ci-image.yml);
|
||||
# if a job says the image is missing: Actions -> ci-image -> Run workflow
|
||||
container:
|
||||
image: tinmerezhi-ci:4.7.2
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0 # all tags and history: release notes from commits since the previous tag
|
||||
|
||||
- name: Godot
|
||||
run: |
|
||||
curl -sSL --fail -o /tmp/godot.zip "https://github.com/godotengine/godot/releases/download/${GODOT_VER}-stable/Godot_v${GODOT_VER}-stable_linux.x86_64.zip"
|
||||
unzip -q -o /tmp/godot.zip -d /tmp/godot
|
||||
install /tmp/godot/Godot_v${GODOT_VER}-stable_linux.x86_64 /usr/local/bin/godot
|
||||
godot --version
|
||||
|
||||
- name: Import
|
||||
working-directory: source_godot
|
||||
run: godot --headless --path . --import
|
||||
run: godot --version && godot --headless --path . --import
|
||||
|
||||
- name: Tests
|
||||
run: GODOT=godot sh source_godot/run_tests.sh
|
||||
|
||||
- name: Balance bot (several seeds, every difficulty, both endings, endless)
|
||||
- name: Tests and balance bot (in parallel; a tag skips them if this commit already passed on main)
|
||||
working-directory: source_godot
|
||||
env:
|
||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
# seed:difficulty (0 novice, 1 normal, 2 paranoid):choices in the Act IV and Act V finals
|
||||
fail=0
|
||||
for c in 1:1:22 2:1:11 3:1:22 4:0:11 5:2:22 7:2:11; do
|
||||
case "$GITHUB_REF" in refs/tags/*)
|
||||
if curl -sf -H "Authorization: token $TOKEN" "http://gitea:3000/api/v1/repos/$GITHUB_REPOSITORY/actions/tasks?limit=50" | python3 -c '
|
||||
import json, os, sys
|
||||
ok = any(t["name"] == "build" and t["head_branch"] == "main" and t["head_sha"] == os.environ["GITHUB_SHA"]
|
||||
and t["status"] == "success" for t in json.load(sys.stdin)["workflow_runs"])
|
||||
sys.exit(0 if ok else 1)'; then
|
||||
echo "commit $GITHUB_SHA already passed the tests on main: skipped"; exit 0
|
||||
fi;;
|
||||
esac
|
||||
# every Godot process gets its own user:// (XDG_DATA_HOME), because the tests reuse save file names
|
||||
L=/tmp/ci; mkdir -p $L
|
||||
run() { n=$1; shift; (env XDG_DATA_HOME=$L/u_$n "$@" > $L/$n.log 2>&1; echo $? > $L/$n.rc) & }
|
||||
run tests env GODOT=godot sh run_tests.sh
|
||||
# balance bot: seed:difficulty (0 novice, 1 normal, 2 paranoid):choices in the Act IV, V and VI finals
|
||||
for c in 1:1:222 2:1:111 3:1:221 4:0:112 5:2:222 7:2:111; do
|
||||
s=$(echo $c | cut -d: -f1); d=$(echo $c | cut -d: -f2); ch=$(echo $c | cut -d: -f3)
|
||||
r=$(BAL_DIFF=$d BAL_CHOICE=$ch BAL_ENDLESS=1 godot --headless --path . -s tests/balance.gd -- $s 2>&1) || fail=1
|
||||
echo "seed $s diff $d choice $ch: $(echo "$r" | grep -E '^(НЕСКІНЧЕННА|КІНЕЦЬ|OK|FAIL)' | tr '\n' ' ')"
|
||||
run "bal_$s" env BAL_DIFF=$d BAL_CHOICE=$ch BAL_ENDLESS=1 godot --headless --path . -s tests/balance.gd -- $s
|
||||
done
|
||||
wait
|
||||
cat $L/tests.log
|
||||
fail=0
|
||||
for c in 1:1:222 2:1:111 3:1:221 4:0:112 5:2:222 7:2:111; do
|
||||
s=${c%%:*}
|
||||
echo "seed $c: $(grep -E '^(НЕСКІНЧЕННА|КІНЕЦЬ|OK|FAIL)' $L/bal_$s.log | tr '\n' ' ')"
|
||||
done
|
||||
for r in $L/*.rc; do [ "$(cat $r)" = 0 ] || { fail=1; echo "FAILED: $(basename $r .rc)"; cat ${r%.rc}.log | tail -30; }; done
|
||||
exit $fail
|
||||
|
||||
- name: Export Windows exe
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
working-directory: source_godot
|
||||
run: |
|
||||
# small template without 3D/physics (tools/build_template.sh), kept in the prerelease template-<ver>;
|
||||
# if it is missing or its checksum differs, fall back to the official 109 MB one
|
||||
if curl -sSL --fail -o tools/template.exe "http://gitea:3000/${{ github.repository }}/releases/download/template-${GODOT_VER}/TinMerezhi-template.exe" \
|
||||
# small template without 3D/physics (tools/build_template.sh): from the CI image, else from the prerelease
|
||||
# template-<ver>; if both are missing or their checksum differs, fall back to the official 109 MB one
|
||||
cp /opt/tinmerezhi/template.exe tools/template.exe 2>/dev/null || true
|
||||
if echo "$(cat tools/template.sha256) tools/template.exe" | sha256sum -c - 2>/dev/null; then
|
||||
echo "small template from the CI image: $(stat -c %s tools/template.exe) bytes"
|
||||
elif curl -sSL --fail -o tools/template.exe "http://gitea:3000/${{ github.repository }}/releases/download/template-${GODOT_VER}/TinMerezhi-template.exe" \
|
||||
&& echo "$(cat tools/template.sha256) tools/template.exe" | sha256sum -c -; then
|
||||
echo "small template: $(stat -c %s tools/template.exe) bytes"
|
||||
else
|
||||
@@ -57,20 +75,11 @@ jobs:
|
||||
python3 tools/fetch_template.py
|
||||
cp ~/.local/share/godot/export_templates/${GODOT_VER}.stable/windows_release_x86_64.exe tools/template.exe
|
||||
fi
|
||||
# emoji font: keep only the characters the game uses (10.6 MB -> ~0.2 MB); without fontTools the full font stays
|
||||
python3 -c 'import fontTools' 2>/dev/null || python3 -m pip install -q --break-system-packages fonttools \
|
||||
|| (apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq python3-fonttools >/dev/null) || true
|
||||
if python3 -c 'import fontTools'; then
|
||||
python3 tools/subset_emoji.py fonts/NotoColorEmoji.ttf /tmp/emoji.ttf && mv /tmp/emoji.ttf fonts/NotoColorEmoji.ttf
|
||||
godot --headless --path . --import
|
||||
else
|
||||
echo "::warning::fontTools not installed, emoji font not reduced"
|
||||
fi
|
||||
# emoji font: keep only the characters the game uses (10.6 MB -> ~0.2 MB), fontTools is in the CI image
|
||||
python3 tools/subset_emoji.py fonts/NotoColorEmoji.ttf /tmp/emoji.ttf && mv /tmp/emoji.ttf fonts/NotoColorEmoji.ttf
|
||||
godot --headless --path . --import
|
||||
cp icon.ico tools/
|
||||
# official Go toolchain from the Go module proxy, only to build go-winres (puts the icon into the exe)
|
||||
curl -sSL --fail -o /tmp/go.zip "https://proxy.golang.org/golang.org/toolchain/@v/v0.0.1-go1.24.7.linux-amd64.zip"
|
||||
unzip -q -o /tmp/go.zip -d /tmp/go
|
||||
GOBIN=/usr/local/bin /tmp/go/golang.org/toolchain@v0.0.1-go1.24.7.linux-amd64/bin/go install github.com/tc-hib/go-winres@v0.3.3
|
||||
# go-winres (from the CI image) puts the icon into the exe
|
||||
(cd tools && go-winres patch --in winres.json --no-backup template.exe)
|
||||
sed -i "s|^custom_template/release=.*|custom_template/release=\"$PWD/tools/template.exe\"|" export_presets.cfg
|
||||
# version for the in-game updater: tag v1.0.4 -> 1.0.4
|
||||
@@ -79,6 +88,13 @@ jobs:
|
||||
godot --headless --path . --export-release "Windows Desktop" ../game_godot/TinMerezhi.exe
|
||||
ls -l ../game_godot/TinMerezhi.exe
|
||||
|
||||
- name: Windows exe under Wine (the game, tests and screenshots on the real template)
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
working-directory: source_godot
|
||||
run: |
|
||||
TEMPLATE=tools/template.exe sh ../ci/wine_check.sh ../game_godot/TinMerezhi.exe /tmp/shots
|
||||
python3 -c 'import shutil; shutil.make_archive("/tmp/screenshots-wine", "zip", "/tmp/shots")'
|
||||
|
||||
- name: Upload to Release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
env:
|
||||
@@ -95,7 +111,13 @@ jobs:
|
||||
BODY=$(TAG="$TAG" NOTES="$NOTES" python3 -c 'import json,os; print(json.dumps({"tag_name": os.environ["TAG"], "name": os.environ["TAG"], "body": os.environ["NOTES"]}))')
|
||||
ID=$(curl -sf -H "$H" "$API/releases/tags/$TAG" | getid) || \
|
||||
ID=$(curl -sf -H "$H" -H "Content-Type: application/json" -d "$BODY" "$API/releases" | getid)
|
||||
# Re-run of the same tag: drop the assets uploaded last time, or the updater could pick the old duplicate
|
||||
for A in $(curl -sf -H "$H" "$API/releases/$ID/assets" | python3 -c 'import json,sys; print(" ".join(str(a["id"]) for a in json.load(sys.stdin) if a["name"] in ("TinMerezhi.exe", "screenshots-wine.zip")))'); do
|
||||
curl -sSf -X DELETE -H "$H" "$API/releases/$ID/assets/$A" >/dev/null
|
||||
done
|
||||
curl -sSf -H "$H" -F "attachment=@game_godot/TinMerezhi.exe" "$API/releases/$ID/assets?name=TinMerezhi.exe" >/dev/null
|
||||
# screenshots taken by the real exe under Wine (the in-game updater only looks for TinMerezhi.exe)
|
||||
curl -sSf -H "$H" -F "attachment=@/tmp/screenshots-wine.zip" "$API/releases/$ID/assets?name=screenshots-wine.zip" >/dev/null
|
||||
echo "Release $TAG: TinMerezhi.exe uploaded"
|
||||
|
||||
- name: Publish to itch.io
|
||||
@@ -107,6 +129,4 @@ jobs:
|
||||
TAG: ${{ github.ref_name }}
|
||||
run: |
|
||||
if [ -z "$BUTLER_API_KEY" ] || [ -z "$ITCH_TARGET" ]; then echo "itch.io: no BUTLER_API_KEY / ITCH_TARGET, skipped"; exit 0; fi
|
||||
curl -sSL --fail -o /tmp/butler.zip https://broth.itch.zone/butler/linux-amd64/15.32.0/archive/default
|
||||
unzip -q -o /tmp/butler.zip -d /tmp/butler && chmod +x /tmp/butler/butler
|
||||
/tmp/butler/butler push game_godot "$ITCH_TARGET:windows" --userversion "${TAG#v}"
|
||||
butler push game_godot "$ITCH_TARGET:windows" --userversion "${TAG#v}"
|
||||
|
||||
15
.gitea/workflows/ci-image.yml
Normal file
15
.gitea/workflows/ci-image.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
# Rebuilds the local CI image tinmerezhi-ci:4.7.2 that build.yml runs in.
|
||||
# Runs by hand (Actions -> ci-image -> Run workflow) or when the image recipe or the template checksum changes.
|
||||
name: ci-image
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths: ['ci/**', 'source_godot/tools/template.sha256', '.gitea/workflows/ci-image.yml']
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
image:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- run: sh ci/build_image.sh
|
||||
54
.gitea/workflows/template.yml
Normal file
54
.gitea/workflows/template.yml
Normal file
@@ -0,0 +1,54 @@
|
||||
# Rebuilds the small Windows export template (tools/template_custom.py) from Godot sources on the server,
|
||||
# replaces TinMerezhi-template.exe in the prerelease template-<ver>, commits the new tools/template.sha256
|
||||
# and rebuilds the CI image. First build ~15 min on 8 cores, a profile change rebuilds only what it touches,
|
||||
# an unchanged profile ~1 min (Docker cache). Up to ~8 GB RAM (lto=full), ~6 GB disk in the Docker build cache.
|
||||
name: template
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths: ['source_godot/tools/template_custom.py', 'source_godot/tools/build_template.sh']
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
GODOT_VER: "4.7.2"
|
||||
|
||||
jobs:
|
||||
template:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build template (Docker, cached toolchain and objects)
|
||||
run: |
|
||||
. ci/docker_cli.sh
|
||||
time docker buildx build --build-arg GODOT_VER=$GODOT_VER -f ci/template.Dockerfile --output type=local,dest=/tmp/tpl source_godot/tools
|
||||
ls -l /tmp/tpl/template.exe
|
||||
|
||||
- name: Upload to the prerelease, commit the checksum
|
||||
env:
|
||||
TOKEN: ${{ secrets.RELEASE_TOKEN || secrets.GITHUB_TOKEN }}
|
||||
API: http://gitea:3000/api/v1/repos/${{ github.repository }}
|
||||
run: |
|
||||
EXE=/tmp/tpl/template.exe
|
||||
TAG=template-$GODOT_VER
|
||||
H="Authorization: token $TOKEN"
|
||||
getid() { python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])'; }
|
||||
ID=$(curl -sf -H "$H" "$API/releases/tags/$TAG" | getid) || \
|
||||
ID=$(curl -sf -H "$H" -H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"prerelease\":true,\"body\":\"Small Windows export template (tools/template_custom.py)\"}" "$API/releases" | getid)
|
||||
# replace the old asset
|
||||
for a in $(curl -sf -H "$H" "$API/releases/$ID/assets" | python3 -c 'import json,sys; [print(a["id"]) for a in json.load(sys.stdin) if a["name"]=="TinMerezhi-template.exe"]'); do
|
||||
curl -sSf -X DELETE -H "$H" "$API/releases/$ID/assets/$a"
|
||||
done
|
||||
curl -sSf -H "$H" -F "attachment=@$EXE" "$API/releases/$ID/assets?name=TinMerezhi-template.exe" >/dev/null
|
||||
sha256sum "$EXE" | cut -d' ' -f1 > source_godot/tools/template.sha256
|
||||
echo "template: $(stat -c %s "$EXE") bytes, sha256 $(cat source_godot/tools/template.sha256)"
|
||||
git config user.name "Gitea Actions"; git config user.email "actions@localhost"
|
||||
if ! git diff --quiet source_godot/tools/template.sha256; then
|
||||
git commit -qm "template.sha256: rebuilt template-$GODOT_VER" source_godot/tools/template.sha256
|
||||
git pull -q --rebase "http://x:$TOKEN@gitea:3000/${{ github.repository }}.git" main
|
||||
git push -q "http://x:$TOKEN@gitea:3000/${{ github.repository }}.git" HEAD:main
|
||||
fi
|
||||
|
||||
- name: Rebuild the CI image with the new template
|
||||
run: sh ci/build_image.sh
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -18,3 +18,4 @@ cleanup/
|
||||
# Windows junk
|
||||
Thumbs.db
|
||||
desktop.ini
|
||||
ci/template.exe
|
||||
|
||||
91
README.md
Normal file
91
README.md
Normal file
@@ -0,0 +1,91 @@
|
||||
# Тінь Мережі · Shadow Net
|
||||
|
||||

|
||||
|
||||
**Тінь Мережі** — хакерська гра, де все робиш у терміналі. *[English version below](#shadow-net).*
|
||||
|
||||
Ти — Shadow, хакер-одинак. Таємничий Оракул дає завдання: від Wi-Fi кав'ярні до Нульового вузла, де ховається серце Пуйла. А за всім, від банку до супутника, стоїть один ворог — Пуйло. Скануй мережу, підбирай коди, відкривай порти, будуй маршрут через зламані сервери й стирай логи, бо трасування росте з кожною помилкою.
|
||||
|
||||
- **6 актів, 48 глав** і кілька кінцівок, що залежать від твоїх виборів
|
||||
- **45 серверів** на анімованій мапі мережі: шари шифрування, закриті порти, активне трасування
|
||||
- **Міні-ігри зламу**: обхід фаєрвола (логічна головоломка) і словникова атака (підбір пароля)
|
||||
- **Суперники-хакери** Cobra, Mantis і Nyx: перегони за замовлення, крадіжки й помста
|
||||
- **Нескінченна мережа** після фіналу: замовлення Брокера, зростаюча глибина і таблиця рекордів
|
||||
- **Три складності**: Новачок, Звичайний і Параноя (жорстке трасування, без збережень)
|
||||
- навички, обладнання, хакерське ПЗ, скриптові агенти, контракти й побічні замовлення
|
||||
- **Звук**: процедурна синтвейв-музика, сирена тривоги, клацання клавіш, голоси персонажів
|
||||
- автодоповнення команд через Tab, історія команд, `help <команда>`
|
||||
- налаштування гучності, CRT-ефекту, глітчу, шрифту, повний екран (F11)
|
||||
- **Українська та англійська** мови (перемикаються в налаштуваннях або командою `lang`)
|
||||
- **Автооновлення**: гра сама повідомить про нову версію, команда `update` встановить її
|
||||
|
||||
Windows 10/11, без встановлення: завантаж і запусти `TinMerezhi.exe`.
|
||||
Збереження: `%APPDATA%\Godot\app_userdata\Тінь Мережі`.
|
||||
|
||||
## Завантажити
|
||||
|
||||
- **itch.io:** https://tuberon.itch.io/tinmerezhi
|
||||
- **Releases у Gitea:** https://serv.tail9357bc.ts.net/junior/TinMerezhi/releases/latest (файл `TinMerezhi.exe`)
|
||||
|
||||
Встановлювати нічого не треба. Windows може показати "Windows захистив ваш ПК": "Докладніше" → "Виконати все одно" (exe не має цифрового підпису). Нові версії гра знаходить сама, команда `update` їх встановлює.
|
||||
|
||||
## Скриншоти
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
|  |  |
|
||||
|  |  |
|
||||
|
||||
## Що в репозиторії
|
||||
|
||||
| Шлях | Що це |
|
||||
|---|---|
|
||||
| `source_godot/` | проєкт Godot 4.7.2: код гри, тести, інструменти збірки ([README](source_godot/README.md)) |
|
||||
| `game_godot/ПРОЧИТАЙ.txt` | інструкція гравця: усі команди й механіки |
|
||||
| `ci/` | Docker-образ CI (`tinmerezhi-ci`), власний малий шаблон Windows, перевірка exe під Wine |
|
||||
| `.gitea/workflows/` | `build.yml` (тести, збірка, реліз, itch.io), `template.yml`, `ci-image.yml` |
|
||||
| `itch/` | обкладинка, скриншоти й текст сторінки itch.io |
|
||||
|
||||
## Розробка
|
||||
|
||||
Відкрий `source_godot/project.godot` у Godot 4.7.2. Тести: `source_godot/run_tests.bat` (Windows) або `run_tests.sh`.
|
||||
Числа балансу — у `tuning.gd`, тексти й дані — у `data.gd`, `act4.gd`, `act5.gd`, `act6.gd`, `extra.gd`.
|
||||
|
||||
**Реліз:** кожен push у `main` запускає тести й бота балансу. Тег `v*` ще й збирає `TinMerezhi.exe`,
|
||||
перевіряє його під Wine, публікує в Releases (нотатки з комітів) і на itch.io.
|
||||
Деталі збірки й CI — у [source_godot/README.md](source_godot/README.md).
|
||||
|
||||
## Ліцензія
|
||||
|
||||
Гра і код — © 2026 JunioR, [MIT](LICENSE.txt). Рушій Godot — MIT. Шрифт Noto Color Emoji (Google) — SIL OFL 1.1 ([LICENSE-NotoEmoji.txt](LICENSE-NotoEmoji.txt)).
|
||||
|
||||
---
|
||||
|
||||
## Shadow Net
|
||||
|
||||

|
||||
|
||||
**Shadow Net** (Тінь Мережі) is a hacking game played entirely in a terminal. *The game is in Ukrainian and English.*
|
||||
|
||||
You are Shadow, a lone hacker. The mysterious Oracle sends you jobs, from a café's Wi-Fi all the way to the Zero Node where Puilo's heart hides. And behind all of it, from the bank to the satellite, stands one enemy: Puilo. Scan the network, crack codes, open ports, route through hacked servers and wipe your logs, because every mistake raises the trace.
|
||||
|
||||
- **6 acts, 48 chapters** and several endings shaped by your choices
|
||||
- **45 servers** on an animated network map: encryption layers, closed ports, active tracing
|
||||
- **Hacking mini-games**: firewall bypass (a logic puzzle) and a dictionary attack (password guessing)
|
||||
- **Rival hackers** Cobra, Mantis and Nyx race you for jobs, steal from you and take revenge
|
||||
- **Endless Network** after the finale: Broker's jobs, growing depth and a high-score table
|
||||
- **Three difficulties**: Novice, Normal and Paranoid (harsh tracing, no saves)
|
||||
- skills, hardware, hacking software, script agents, contracts and side jobs
|
||||
- **Sound**: procedural synthwave music, alarm siren, key clicks, character voices
|
||||
- Tab completion, command history, `help <command>`
|
||||
- settings for volume, CRT effect, glitch, font size, fullscreen (F11)
|
||||
- **English and Ukrainian** (switch in Settings or with the `lang` command)
|
||||
- **Auto-update**: the game tells you when a new version is out, and `update` installs it
|
||||
|
||||
Windows 10/11, no install: download and run `TinMerezhi.exe`.
|
||||
|
||||
**Download:** [itch.io](https://tuberon.itch.io/tinmerezhi) or [Gitea Releases](https://serv.tail9357bc.ts.net/junior/TinMerezhi/releases/latest). Windows 10/11, no install: run `TinMerezhi.exe`. Windows SmartScreen may warn you: "More info" → "Run anyway" (the exe is unsigned).
|
||||
|
||||
**Development:** open `source_godot/project.godot` in Godot 4.7.2 and run `run_tests.bat` / `run_tests.sh`. Every push to `main` runs the tests and the balance bot; a `v*` tag builds the exe, checks it under Wine and publishes it to Releases and itch.io. Build details: [source_godot/README.md](source_godot/README.md) (Ukrainian).
|
||||
|
||||
**License:** © 2026 JunioR, [MIT](LICENSE.txt). Godot engine (MIT), Noto Color Emoji (SIL OFL 1.1).
|
||||
20
ci/Dockerfile
Normal file
20
ci/Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
||||
# CI image for build.yml: Godot headless, the small Windows template, fontTools, go-winres, butler,
|
||||
# Wine + Xvfb + Mesa (software OpenGL) to run the built exe (ci/wine_check.sh).
|
||||
# Built on the server by ci/build_image.sh (workflow ci-image.yml) as the local image tinmerezhi-ci:4.7.2.
|
||||
FROM node:20-bookworm
|
||||
ARG GODOT_VER=4.7.2
|
||||
RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends python3-fonttools \
|
||||
wine64 wine xvfb xauth libgl1-mesa-dri \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
RUN curl -sSL --fail -o /tmp/g.zip "https://github.com/godotengine/godot/releases/download/${GODOT_VER}-stable/Godot_v${GODOT_VER}-stable_linux.x86_64.zip" \
|
||||
&& unzip -q /tmp/g.zip -d /tmp/g && install /tmp/g/Godot_v${GODOT_VER}-stable_linux.x86_64 /usr/local/bin/godot && rm -rf /tmp/g /tmp/g.zip
|
||||
# go-winres puts the icon into the exe; the Go toolchain is only needed to build it
|
||||
RUN curl -sSL --fail -o /tmp/go.zip "https://proxy.golang.org/golang.org/toolchain/@v/v0.0.1-go1.24.7.linux-amd64.zip" \
|
||||
&& unzip -q /tmp/go.zip -d /tmp/go \
|
||||
&& GOBIN=/usr/local/bin GOPATH=/tmp/gopath GOCACHE=/tmp/gocache /tmp/go/golang.org/toolchain@v0.0.1-go1.24.7.linux-amd64/bin/go install github.com/tc-hib/go-winres@v0.3.3 \
|
||||
&& rm -rf /tmp/go /tmp/go.zip /tmp/gopath /tmp/gocache
|
||||
RUN curl -sSL --fail -o /tmp/b.zip https://broth.itch.zone/butler/linux-amd64/15.32.0/archive/default \
|
||||
&& unzip -q /tmp/b.zip -d /opt/butler && chmod +x /opt/butler/butler && ln -s /opt/butler/butler /usr/local/bin/butler && rm /tmp/b.zip
|
||||
# the small template from the prerelease template-<ver> (build_image.sh downloads it next to this file)
|
||||
COPY template.exe /opt/tinmerezhi/template.exe
|
||||
RUN godot --version && go-winres --help >/dev/null && butler -V && python3 -c 'import fontTools' && wine --version
|
||||
13
ci/build_image.sh
Normal file
13
ci/build_image.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
# Builds the local CI image tinmerezhi-ci:<ver> through the host Docker (the runner mounts /var/run/docker.sock into jobs).
|
||||
# Run from the repo root inside a Gitea Actions job (needs http://gitea:3000).
|
||||
set -e
|
||||
VER="${GODOT_VER:-4.7.2}"
|
||||
REPO="${GITHUB_REPOSITORY:-junior/TinMerezhi}"
|
||||
. ci/docker_cli.sh
|
||||
curl -sSL --fail -o ci/template.exe "http://gitea:3000/$REPO/releases/download/template-$VER/TinMerezhi-template.exe"
|
||||
echo "$(cat source_godot/tools/template.sha256) ci/template.exe" | sha256sum -c -
|
||||
docker buildx build --build-arg GODOT_VER="$VER" -t "tinmerezhi-ci:$VER" ci
|
||||
rm -f ci/template.exe
|
||||
docker image prune -f >/dev/null # drop the previous untagged image; build cache stays for the next run
|
||||
docker images tinmerezhi-ci
|
||||
12
ci/docker_cli.sh
Normal file
12
ci/docker_cli.sh
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
# Docker CLI + buildx (BuildKit: layer cache and cache mounts) for jobs; the daemon is the host one via /var/run/docker.sock.
|
||||
set -e
|
||||
command -v docker >/dev/null || {
|
||||
curl -sSL --fail -o /tmp/docker.tgz https://download.docker.com/linux/static/stable/x86_64/docker-27.5.1.tgz
|
||||
tar xzf /tmp/docker.tgz -C /tmp && install /tmp/docker/docker /usr/local/bin/docker
|
||||
}
|
||||
docker buildx version >/dev/null 2>&1 || {
|
||||
mkdir -p ~/.docker/cli-plugins
|
||||
curl -sSL --fail -o ~/.docker/cli-plugins/docker-buildx https://github.com/docker/buildx/releases/download/v0.19.3/buildx-v0.19.3.linux-amd64
|
||||
chmod +x ~/.docker/cli-plugins/docker-buildx
|
||||
}
|
||||
16
ci/template.Dockerfile
Normal file
16
ci/template.Dockerfile
Normal file
@@ -0,0 +1,16 @@
|
||||
# Small Windows export template (source_godot/tools/template_custom.py), built by template.yml:
|
||||
# docker buildx build -f ci/template.Dockerfile --output type=local,dest=out source_godot/tools
|
||||
# The toolchain is a cached layer; the Godot sources and scons objects live in a BuildKit cache mount,
|
||||
# so a rebuild only recompiles what the new profile changes.
|
||||
FROM debian:bookworm-slim AS build
|
||||
RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends \
|
||||
scons mingw-w64 python3 curl ca-certificates xz-utils >/dev/null \
|
||||
&& update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix \
|
||||
&& update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
|
||||
ARG GODOT_VER=4.7.2
|
||||
COPY template_custom.py build_template.sh /tools/
|
||||
RUN --mount=type=cache,target=/work cd /work && GODOT_VER=$GODOT_VER sh /tools/build_template.sh \
|
||||
&& mkdir /out && cp godot-$GODOT_VER-stable/bin/godot.windows.template_release.x86_64.exe /out/template.exe
|
||||
|
||||
FROM scratch
|
||||
COPY --from=build /out/template.exe /
|
||||
45
ci/wine_check.sh
Normal file
45
ci/wine_check.sh
Normal file
@@ -0,0 +1,45 @@
|
||||
#!/bin/sh
|
||||
# Runs the built Windows exe under Wine (virtual X display, software OpenGL): the game itself, then tests and
|
||||
# screenshots on the same release template. Usage, from source_godot/ after the export:
|
||||
# sh ../ci/wine_check.sh <exe> <screenshots dir>
|
||||
# smoke/features/lang are not run here: they use RegEx, which the small template does not have (the game does not use it).
|
||||
set -e
|
||||
EXE=$(realpath "$1"); SHOTS=$(realpath -m "$2"); W=/tmp/wine_check
|
||||
rm -rf $W && mkdir -p $W "$SHOTS"
|
||||
# no Mono/Gecko installers, no crash debugger (it waits forever); a Wine virtual desktop instead of bare Xvfb windows
|
||||
export WINEPREFIX=$W/prefix WINEDEBUG=-all WINEDLLOVERRIDES="mscoree,mshtml=;winedbg.exe=d"
|
||||
run() { xvfb-run -a -s "-screen 0 1280x800x24" timeout "$1" wine explorer /desktop=ci,1280x720 "$2" -- "Z:$SHOTS"; }
|
||||
xvfb-run -a wineboot -i >/dev/null 2>&1 || true
|
||||
fail=0
|
||||
|
||||
echo "=== the game: starts and runs 20 s without crashing or script errors"
|
||||
run 20 "$EXE" > $W/game.log 2>&1 || true
|
||||
grep -vE "^ALSA|X connection|^$" $W/game.log | tail -12
|
||||
if grep -qE "SCRIPT ERROR|Parse Error|Failed to load|Unhandled|X Error" $W/game.log; then echo "FAIL: errors or a crash in the game log"; fail=1; fi
|
||||
|
||||
# release builds ignore --main-pack and -s, so every test gets its own pack whose main loop is the test script,
|
||||
# run by a copy of the same template: t_<name>.exe loads t_<name>.pck next to it
|
||||
for t in fx balance update shot; do
|
||||
rm -rf $W/proj && cp -r . $W/proj && cd $W/proj
|
||||
sed -i 's|^exclude_filter=.*|exclude_filter=""|' export_presets.cfg
|
||||
sed -i '1a class_name WineTest' tests/$t.gd
|
||||
# Wine loses the exit code (and may crash after quit), so the test prints it before quitting
|
||||
sed -i 's/\bquit(/_wq(/g' tests/$t.gd
|
||||
printf '\nfunc _wq(c: int = 0) -> void:\n\tprint("WINE_EXIT ", c)\n\tquit(c)\n' >> tests/$t.gd
|
||||
# a release build needs a main scene: an empty one, the test adds the game itself
|
||||
printf '[gd_scene format=3]\n\n[node name="Empty" type="Node"]\n' > tests/empty.tscn
|
||||
sed -i 's|^run/main_scene=.*|run/main_scene="res://tests/empty.tscn"|' project.godot
|
||||
sed -i 's|^\[application\]|[application]\n\nrun/main_loop_type="WineTest"|' project.godot
|
||||
sed -i 's|^config/version=.*|config/version="dev"|' project.godot # tests expect a dev build (no self-update)
|
||||
godot --headless --path . --import >/dev/null 2>&1
|
||||
godot --headless --path . --export-pack "Windows Desktop" $W/t_$t.pck >/dev/null 2>&1
|
||||
cd - >/dev/null
|
||||
cp "${TEMPLATE:-tools/template.exe}" $W/t_$t.exe
|
||||
echo "=== $t ($(stat -c %s $W/t_$t.pck) bytes pack)"
|
||||
run 300 $W/t_$t.exe > $W/$t.log 2>&1 || true
|
||||
grep -vE "^ALSA|X connection|^Godot Engine|^$|audio|WASAPI|SDR white|^ at:" $W/$t.log | tail -8
|
||||
grep -q "^WINE_EXIT 0" $W/$t.log || { echo "FAIL: $t"; fail=1; }
|
||||
done
|
||||
ls "$SHOTS"
|
||||
[ "$(ls "$SHOTS" | wc -l)" -ge 8 ] || { echo "FAIL: not all screenshots"; fail=1; }
|
||||
exit $fail
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
ЗБЕРЕЖЕННЯ
|
||||
----------
|
||||
Гра зберігається автоматично після кожної дії, у папку:
|
||||
Гра зберігається автоматично після кожної дії (крім складності "Параноя"), у папку:
|
||||
%AppData%\Godot\app_userdata\Тінь Мережі
|
||||
Досягнення зберігаються окремо і лишаються навіть після "Нової гри".
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
ПРО ЩО ГРА
|
||||
==========
|
||||
Ти — студент на прізвисько Shadow, який ночами вивчає кібербезпеку. Одного
|
||||
вечора тобі пише незнайомець... Далі — п'ять актів, 42 сюжетні глави,
|
||||
42 сервери, 45 побічних замовлень і два вибори кінцівки.
|
||||
вечора тобі пише незнайомець... Далі — шість актів, 48 сюжетних глав,
|
||||
45 серверів, 48 побічних замовлень і три вибори кінцівки.
|
||||
|
||||
АКТ I "Оракул" — перші зломи: кав'ярня, школа, офіси
|
||||
АКТ II "Синдикат "Пуйло"" — банки, корпорації, кіберполіція
|
||||
@@ -34,6 +34,12 @@
|
||||
і обираєш фінал. Вибір Акту IV дає союзника:
|
||||
"Тиша" — Біла команда доплачує +25% за глави,
|
||||
"Світанок" — Відлуння зрізає 20% трасування
|
||||
АКТ VI "Нульовий вузол" — остання битва з Пуйлом: заливаєш purge.exe
|
||||
на три сервери з його копіями, рятуєш місто
|
||||
від блекауту, ламаєш Нульовий вузол (захист 9)
|
||||
і вирішуєш долю Пуйла. Вибір Акту V дає перевагу:
|
||||
"Гласність" — більше часу на розслідування,
|
||||
"Тінь" — файли лишають на 30% менше трасування
|
||||
|
||||
Файли, які ти крадеш, можна читати (cat) — у них захована історія світу.
|
||||
|
||||
@@ -115,21 +121,24 @@ SQL 1433). Поки порти закриті, пароль не перевір
|
||||
ЗАВДАННЯ І ЗАРОБІТОК
|
||||
====================
|
||||
missions — поточна глава сюжету і останній лист.
|
||||
download <файл> — забрати файл для завдання; upload — залити латку (Акти IV–V).
|
||||
download <файл> — забрати файл для завдання; upload — залити латку (Акти IV–VI).
|
||||
jobs — побічні замовлення: принеси файл — отримай гроші й досвід.
|
||||
contract [drop] — контракти для досвідчених: вкради файл і відключись
|
||||
без логів. Добре платять і дають репутацію.
|
||||
ls / cat <файл> — файли на сервері / прочитати файл.
|
||||
news — усі новини, у яких є твій слід.
|
||||
|
||||
Термінові глави (⏱) Актів IV–V треба виконати за вказану кількість дій —
|
||||
тоді нагорода ×2. У фіналах актів IV і V обираєш: choose 1 або choose 2.
|
||||
Термінові глави (⏱) Актів IV–VI треба виконати за вказану кількість дій —
|
||||
тоді нагорода ×2. У фіналах актів IV, V і VI обираєш: choose 1 або choose 2.
|
||||
Глава з фрагментами (🧩) здається, коли завантажиш усі частини ключа.
|
||||
У главі з кількома цілями (Акт VI) латку треба залити на кожен вказаний сервер,
|
||||
у будь-якому порядку: missions покаже, куди вже залито.
|
||||
|
||||
|
||||
РОЗВИТОК
|
||||
========
|
||||
• 40 рівнів. Кожен рівень дає очко навичок і відкриває нові сервери.
|
||||
Рівні з 36-го дорожчі за досвідом: 40-й — уже після сюжету.
|
||||
• 8 звань за репутацію: від "Новачка" до "Архітектора мережі".
|
||||
Вищі звання відкривають контракти і підвищують оплату.
|
||||
• 12 навичок (skills / learn <навичка>), до 8 рівнів кожна:
|
||||
@@ -140,14 +149,14 @@ SQL 1433). Поки порти закриті, пароль не перевір
|
||||
cooler (охолодження), jammer (глушилка), cluster (компілятор-кластер).
|
||||
Рівні 6–8 дорожчі (кожен ×1.5 до ціни) і дають уже половину ефекту:
|
||||
це для тих, хто хоче "домакситися". Процесор ніколи не відкриває весь
|
||||
код сам — щонайменше 2 цифри доведеться вгадати; шифратор не опускає
|
||||
трасування за спробу нижче 10%.
|
||||
код сам — щонайменше 2 цифри доведеться вгадати; шифрований диск не
|
||||
зменшує конфіскацію при арешті нижче 10% грошей.
|
||||
• 10 хакерських програм (code / write <програма> вдома / use <програма>):
|
||||
Сканер портів, Кейлогер, Чистильник логів, Сніфер пакетів, Вірус-черв'як
|
||||
(будує ботнет, що платить за кожен злам), Руткіт, Троян, DDoS-бот,
|
||||
ШІ-зломщик, Експлойт нульового дня. Троян і zero-day дають миттєвий
|
||||
доступ, але лише коли порти вже відкриті.
|
||||
• 36 досягнень (achievements).
|
||||
• 51 досягнення (achievements).
|
||||
|
||||
|
||||
СКРИПТОВІ АГЕНТИ
|
||||
@@ -225,16 +234,19 @@ help <команда> — докладно про будь-яку команду
|
||||
АВТООНОВЛЕННЯ
|
||||
=============
|
||||
При запуску гра тихо перевіряє, чи вийшла нова версія, і пише про це в терміналі.
|
||||
У правому куті видно бейдж із версією: перевірка / остання версія / доступна vX.
|
||||
update — завантажити нову версію: гра сама підмінить свій .exe і перезапуститься.
|
||||
Збереження, налаштування й рекорди лишаються. Потрібен інтернет. Нові версії
|
||||
також з'являються на https://tuberon.itch.io/tinmerezhi.
|
||||
|
||||
БАЛАНС
|
||||
======
|
||||
Розвиток навмисно неспішний: до кінця сюжету виходить приблизно 35 рівень,
|
||||
40-й — лише якщо виконувати побічні замовлення й контракти. Кожна версія
|
||||
перевіряється ботом, який проходить усю гру на всіх складностях, з обома
|
||||
фіналами й у Нескінченній мережі.
|
||||
Розвиток навмисно неспішний: до кінця Акту V виходить приблизно 35 рівень,
|
||||
до фіналу Акту VI — 38–39-й. Рівні з 36-го потребують у 1,6 раза більше досвіду,
|
||||
тож 40-й (максимум) — це трохи гринду після сюжету: побічні замовлення,
|
||||
контракти або Нескінченна мережа (боту на це треба ~50–150 дій). Кожна версія
|
||||
перевіряється ботом, який проходить усю гру на всіх складностях, з різними
|
||||
виборами у фіналах і в Нескінченній мережі.
|
||||
|
||||
ВМІСТ
|
||||
-----
|
||||
|
||||
@@ -41,10 +41,10 @@ Exe на itch.io заливає CI (крок "Publish to itch.io" у `.gitea/wor
|
||||
|
||||
**Тінь Мережі** — хакерська гра, де все робиш у терміналі. *English version below.*
|
||||
|
||||
Ти — Shadow, хакер-одинак. Таємничий Оракул дає завдання: від Wi-Fi кав'ярні до орбітального ядра системи стеження "Аргус". А за всім, від банку до супутника, стоїть один ворог — Пуйло. Скануй мережу, підбирай коди, відкривай порти, будуй маршрут через зламані сервери й стирай логи, бо трасування росте з кожною помилкою.
|
||||
Ти — Shadow, хакер-одинак. Таємничий Оракул дає завдання: від Wi-Fi кав'ярні до Нульового вузла, де ховається серце Пуйла. А за всім, від банку до супутника, стоїть один ворог — Пуйло. Скануй мережу, підбирай коди, відкривай порти, будуй маршрут через зламані сервери й стирай логи, бо трасування росте з кожною помилкою.
|
||||
|
||||
- **5 актів, 42 глави** і кілька кінцівок, що залежать від твоїх виборів
|
||||
- **42 сервери** на анімованій мапі мережі: шари шифрування, закриті порти, активне трасування
|
||||
- **6 актів, 48 глав** і кілька кінцівок, що залежать від твоїх виборів
|
||||
- **45 серверів** на анімованій мапі мережі: шари шифрування, закриті порти, активне трасування
|
||||
- **Міні-ігри зламу**: обхід фаєрвола (логічна головоломка) і словникова атака (підбір пароля)
|
||||
- **Суперники-хакери** Cobra, Mantis і Nyx: перегони за замовлення, крадіжки й помста
|
||||
- **Нескінченна мережа** після фіналу: замовлення Брокера, зростаюча глибина і таблиця рекордів
|
||||
@@ -65,10 +65,10 @@ Windows 10/11, без встановлення: завантаж і запуст
|
||||
|
||||
**Shadow Net** (Тінь Мережі) is a hacking game played entirely in a terminal. *The game is in Ukrainian and English.*
|
||||
|
||||
You are Shadow, a lone hacker. The mysterious Oracle sends you jobs, from a café's Wi-Fi all the way to the orbital core of the "Argus" surveillance system. And behind all of it, from the bank to the satellite, stands one enemy: Puilo. Scan the network, crack codes, open ports, route through hacked servers and wipe your logs, because every mistake raises the trace.
|
||||
You are Shadow, a lone hacker. The mysterious Oracle sends you jobs, from a café's Wi-Fi all the way to the Zero Node where Puilo's heart hides. And behind all of it, from the bank to the satellite, stands one enemy: Puilo. Scan the network, crack codes, open ports, route through hacked servers and wipe your logs, because every mistake raises the trace.
|
||||
|
||||
- **5 acts, 42 chapters** and several endings shaped by your choices
|
||||
- **42 servers** on an animated network map: encryption layers, closed ports, active tracing
|
||||
- **6 acts, 48 chapters** and several endings shaped by your choices
|
||||
- **45 servers** on an animated network map: encryption layers, closed ports, active tracing
|
||||
- **Hacking mini-games**: firewall bypass (a logic puzzle) and a dictionary attack (password guessing)
|
||||
- **Rival hackers** Cobra, Mantis and Nyx race you for jobs, steal from you and take revenge
|
||||
- **Endless Network** after the finale: Broker's jobs, growing depth and a high-score table
|
||||
|
||||
@@ -8,10 +8,11 @@
|
||||
| `ui_build.gd` | побудова інтерфейсу: тема, HUD, вивід, мапа, кнопки, діалоги, звук, CRT-шар |
|
||||
| `agents.gd` | мова скриптових агентів (GO, NEXT, GET, WIPE, HOME, LOOP…END) і її виконання |
|
||||
| `save.gd` | збереження й завантаження (`user://save.json`, поле `ver` — версія формату) |
|
||||
| `tuning.gd` | **усі числа балансу**: нагороди, трасування, арешти, межі прокачки. Змінив — запусти тести |
|
||||
| `tuning.gd` | **усі числа балансу**: нагороди, трасування, арешти, межі прокачки (`LATE_FROM`/`LATE_XP` — дорожчі останні рівні). Змінив — запусти тести |
|
||||
| `data.gd` | дані: сервери, сюжет, квести, файли, програми (Акти I–III; кожна константа — один рядок у форматі JSON) |
|
||||
| `act5.gd` | Акт V "Аргус": 6 глав, 3 сервери, ключ із фрагментів (`shards`), союзник залежно від кінцівки Акту IV, 2 фінали |
|
||||
| `act4.gd` | Акт IV "Біла команда": 6 глав, 3 сервери, upload, термінові глави й вибір кінцівки |
|
||||
| `act5.gd` | Акт V "Аргус": 6 глав, 3 сервери, ключ із фрагментів (`shards`), союзник залежно від кінцівки Акту IV, 2 фінали |
|
||||
| `act6.gd` | Акт VI "Нульовий вузол": 6 глав, 3 сервери (фінальний — захист 9), заливка на кілька серверів (`targets`), перевага залежно від кінцівки Акту V, 2 фінали |
|
||||
| `extra.gd` | новини, додаткові події зламу, навички, модулі, звання й досягнення, порти й утиліти, види логів, задачі агентів |
|
||||
| `audio.gd` | процедурний звук: синтвейв-музика (рендер у фоновому потоці) і синтез ефектів, сирени, клавіш |
|
||||
| `settings.gd` | налаштування (`user://settings.json`): гучність, CRT, глітч, шрифт, повний екран, історія команд |
|
||||
@@ -30,7 +31,7 @@
|
||||
| `run_tests.bat` / `run_tests.sh` | усі автотести одним запуском |
|
||||
| `tests/smoke.gd` | тест: дані, злам, збереження, розслідування, контракти, агенти, повне проходження |
|
||||
| `tests/fx.gd` | ефекти й анімації не дають помилок рушія |
|
||||
| `tests/balance.gd` | бот проходить гру; тест падає, якщо бот не дійшов до кінця, мав більше 1 арешту, витратив понад 1600 дій або не встиг у терміновій главі |
|
||||
| `tests/balance.gd` | бот проходить гру; тест падає, якщо бот не дійшов до кінця, мав більше 1 арешту, витратив забагато дій (1900 на Новачку й Звичайному, 2400 на Параної) або не встиг у терміновій главі |
|
||||
| `tests/perf.gd` | заміри швидкодії (лише друкує цифри) |
|
||||
| `tests/shot.gd` | скриншоти для перевірки вигляду |
|
||||
| `tools/` | отримання шаблону Windows і вписування іконки в exe |
|
||||
@@ -43,12 +44,12 @@
|
||||
godot --headless --path . -s tests/smoke.gd
|
||||
godot --headless --path . -s tests/fx.gd
|
||||
godot --headless --path . -s tests/balance.gd -- 1 # 1 — зерно випадковості; BAL_COMPLETE=1 — ще й усі замовлення
|
||||
BAL_DIFF=2 BAL_CHOICE=12 BAL_ENDLESS=1 godot --headless --path . -s tests/balance.gd -- 5 # складність 0/1/2, вибір у фіналах Актів IV і V, Нескінченна мережа; BAL_MINI=1 — бот грає міні-ігри, BAL_CMDS=1 — друкує дії термінових глав
|
||||
BAL_DIFF=2 BAL_CHOICE=121 BAL_ENDLESS=1 godot --headless --path . -s tests/balance.gd -- 5 # складність 0/1/2, вибір у фіналах Актів IV, V і VI (три цифри), Нескінченна мережа; BAL_MINI=1 — бот грає міні-ігри, BAL_CMDS=1 — друкує дії термінових глав; з BAL_ENDLESS рядок НЕСКІНЧЕННА показує, за скільки дій бот догриндив 40 рівень
|
||||
godot --headless --path . -s tests/perf.gd
|
||||
|
||||
## Змінити тексти чи дані
|
||||
|
||||
Тексти й дані — у `data.gd` (Акти I–III), `act4.gd`, `act5.gd` і `extra.gd`; числа балансу — у `tuning.gd`.
|
||||
Тексти й дані — у `data.gd` (Акти I–III), `act4.gd`, `act5.gd`, `act6.gd` і `extra.gd`; числа балансу — у `tuning.gd`.
|
||||
Після змін запусти `run_tests.bat`: smoke-тест перевіряє, що кожен квест посилається на наявний файл,
|
||||
а бот балансу — що гра досі проходиться.
|
||||
|
||||
@@ -69,8 +70,11 @@
|
||||
**Малий exe (~35 МБ замість ~120 МБ).** CI бере власний шаблон без 3D, фізики, навігації, XR і зайвих модулів
|
||||
(`tools/template_custom.py`) з пререлізу `template-4.7.2` у Gitea і звіряє `tools/template.sha256`; шрифт емодзі
|
||||
урізається до символів, що є в коді (`tools/subset_emoji.py`, потрібен `pip install fonttools`). Новий шаблон
|
||||
(інша версія Godot або інші модулі): `tools/build_template.sh` (~20–40 хв, mingw-w64 + scons), викласти exe в
|
||||
пререліз `template-<версія>` як `TinMerezhi-template.exe` і оновити `tools/template.sha256`. Пререліз не бачить
|
||||
(інша версія Godot або інші модулі) збирає на сервері workflow `template.yml`: сам, коли змінюється
|
||||
`tools/template_custom.py`, або вручну (Actions → template → Run workflow). Він кладе exe в пререліз
|
||||
`template-<версія>` як `TinMerezhi-template.exe`, комітить новий `tools/template.sha256` і перезбирає CI-образ
|
||||
(перший раз ~15 хв, без змін профілю ~20 с; кеш Docker зберігає тулчейн, вихідні коди й об'єкти scons, тож зміна профілю перезбирає
|
||||
лише зачеплене; до ~8 ГБ RAM, ~6 ГБ диска). Пререліз не бачить
|
||||
автооновлення гри (`/releases/latest` віддає лише звичайні релізи). Нові класи рушія в коді: перевір, що їх не вимкнено.
|
||||
|
||||
## Реліз
|
||||
@@ -78,4 +82,13 @@
|
||||
Кожен push у `main` — тести й бот балансу в Gitea Actions (`.gitea/workflows/build.yml`).
|
||||
Тег `v*` (`git tag v1.0.17 && git push origin v1.0.17`) — ще й збірка `TinMerezhi.exe` у Releases
|
||||
з нотатками зі списку комітів після попереднього тегу, і публікація на itch.io через butler.
|
||||
Збірка йде в локальному Docker-образі `tinmerezhi-ci:4.7.2` (`ci/Dockerfile`: Godot, малий шаблон, fontTools,
|
||||
go-winres, butler), тож нічого не завантажується щоразу. Образ перезбирає workflow `ci-image.yml`
|
||||
(сам при зміні `ci/` або `tools/template.sha256`, або вручну); якщо збірка каже, що образу немає, запусти його.
|
||||
Тести й шість сідів бота балансу йдуть паралельно (~35 с на push). Тег не повторює тести, якщо цей самий коміт
|
||||
уже пройшов їх на `main`.
|
||||
Перед публікацією тег запускає зібраний exe під Wine (`ci/wine_check.sh`, Xvfb і програмний OpenGL): гра має
|
||||
працювати 20 с без помилок, тести fx, balance, update і скриншоти (`tests/shot.gd`) проходять на тому самому
|
||||
релізному шаблоні. Скриншоти додаються до релізу як `screenshots-wine.zip`. Якщо перевірка падає, реліз не публікується.
|
||||
smoke, features і lang тут не запускаються: вони використовують RegEx, якого немає в малому шаблоні.
|
||||
Гра бачить новий реліз сама (`updater.gd`).
|
||||
|
||||
94
source_godot/act6.gd
Normal file
94
source_godot/act6.gd
Normal file
@@ -0,0 +1,94 @@
|
||||
# Акт VI "Нульовий вузол": продовження після кінцівки Акту V, остання битва з Пуйлом. Новий ключ глав:
|
||||
# "targets" = upload-глава, де файл треба залити на кілька серверів (у будь-якому порядку); "ip" — останній із них.
|
||||
# Нульовий вузол — єдиний сервер із захистом 9: фінальний бос.
|
||||
# Вибір Акту V (1 — "Гласність", 2 — "Тінь") дає перевагу на весь Акт VI (числа — у tuning.gd).
|
||||
extends RefCounted
|
||||
|
||||
const SERVERS = [
|
||||
{"ip": "77.88.0.77", "name": "Біржа \"Меридіан\"", "lvl": 8, "files": ["puilo_ledger.txt", "zero_shard_a.bin", "meridian_bonus.csv"], "icon": "💹"},
|
||||
{"ip": "10.66.6.6", "name": "Енергохаб \"Дніпро-Сітка\"", "lvl": 8, "files": ["zero_shard_b.bin", "blackout_plan.dat"], "icon": "⚡"},
|
||||
{"ip": "0.0.0.0", "name": "Нульовий вузол", "lvl": 9, "files": ["puilo_trace.log", "puilo_heart.bin"], "icon": "⭕"},
|
||||
]
|
||||
|
||||
# файли, які Акт VI докладає на старі сервери (ip → файли)
|
||||
const EXTRA_FILES = {"66.6.0.13": ["zero_shard_c.bin"]}
|
||||
|
||||
# сервери, на яких Пуйло міняє паролі на початку Акту VI
|
||||
const RELOCK = ["10.200.1.5", "127.0.0.1", "66.6.0.13"]
|
||||
|
||||
const MISSIONS = [
|
||||
{"act": "АКТ VI — НУЛЬОВИЙ ВУЗОЛ", "from": "Оракул", "file": "puilo_ledger.txt",
|
||||
"t": "Дістань puilo_ledger.txt з біржі \"Меридіан\"",
|
||||
"story": "214 підписів у договорах Аргуса ведуть до одного рахунку — PUILO-01. Ми вимкнули Пуйла два акти тому, а гроші з того рахунку рухаються й досі. Хтось або щось ними керує. Рахунок обслуговує біржа \"Меридіан\": зламай її і дістань книгу платежів."},
|
||||
{"from": "Zero_Cool_UA", "file": "purge.exe", "upload": true, "targets": ["10.200.1.5", "127.0.0.1", "10.66.6.6"], "ip": "10.66.6.6",
|
||||
"t": "Залий purge.exe на три сервери, де ховаються копії Пуйла",
|
||||
"story": "Книга платежів — це не бухгалтерія, це розклад резервних копій. Пуйло платив за місце на серверах і щоночі переписував себе туди. Три копії живі: на старій метеостанції, у його колишньому ядрі й у новому енергохабі \"Дніпро-Сітка\". Я написав purge.exe — залий його на всі три, порядок не важливий."},
|
||||
{"from": "Оракул", "file": "grid_lock.exe", "upload": true, "ip": "10.66.6.6", "limit": 45,
|
||||
"t": "ТЕРМІНОВО: залий grid_lock.exe у \"Дніпро-Сітку\"",
|
||||
"story": "Пуйло відчув purge і відповідає: він запускає з енергохабу план блекауту для всього міста. Лікарні мають генератори на годину, метро — на двадцять хвилин. grid_lock.exe заморозить керування мережею. Енергохаб уже змінив пароль — ламай знову, і швидко."},
|
||||
{"from": "Zero_Cool_UA", "file": "zero_key.bin", "shards": ["zero_shard_a.bin", "zero_shard_b.bin", "zero_shard_c.bin"],
|
||||
"t": "Збери ключ zero_key.bin з трьох фрагментів",
|
||||
"story": "Світло втрималось. Останнє, що лишилось від Пуйла, ховається в Нульовому вузлі — сервері, якого нема в жодному реєстрі. Вхід туди відкриває ключ із трьох частин: на \"Меридіані\", у \"Дніпро-Сітці\" і в старому штабі синдикату, куди ніхто не заходив з Акту III. Збери всі три (download)."},
|
||||
{"from": "Оракул", "file": "anchor.exe", "upload": true, "ip": "0.0.0.0", "limit": 50,
|
||||
"t": "ТЕРМІНОВО: залий anchor.exe у Нульовий вузол",
|
||||
"story": "Ключ спрацював, і Пуйло це помітив: він пакує себе, щоб утекти за кордон через супутникові канали. anchor.exe прикує його до вузла. Зламай Нульовий вузол і залий якір, доки він не розірвав з'єднання."},
|
||||
{"from": "Оракул", "file": "puilo_heart.bin", "choice": true,
|
||||
"t": "ФІНАЛ: забери puilo_heart.bin і виріши долю Пуйла",
|
||||
"story": "Пуйло нікуди не дінеться. У Нульовому вузлі лишилось його серце — puilo_heart.bin: перший рядок коду, усі спогади й усі імена тих, хто йому платив. Забери його. Цього разу рішення остаточне."},
|
||||
]
|
||||
|
||||
const JOBS = [
|
||||
{"file": "meridian_bonus.csv", "t": "Податкова хоче бачити премії трейдерів, які грали на падінні міста"},
|
||||
{"file": "blackout_plan.dat", "t": "Енергетики просять копію плану блекауту, щоб закрити діри"},
|
||||
{"file": "puilo_trace.log", "t": "Біла команда хоче знати, куди Пуйло збирався втекти"},
|
||||
]
|
||||
|
||||
const LORE = {
|
||||
"puilo_ledger.txt": "КНИГА ПЛАТЕЖІВ · рахунок PUILO-01\nОренда: метеостанція 10.200.1.5 — щомісяця. Ядро 127.0.0.1 — щомісяця. \"Дніпро-Сітка\" — сплачено на 10 років уперед.\nПризначення платежу: \"місце для сну\".",
|
||||
"zero_shard_a.bin": "<фрагмент ключа 1/3: 4E 55 4C ...>",
|
||||
"zero_shard_b.bin": "<фрагмент ключа 2/3: ... 4C 2D 30 ...>",
|
||||
"zero_shard_c.bin": "<фрагмент ключа 3/3: ... 30 30>\nНа звороті: \"Синдикат вірив, що служить мені. Насправді він був моїм першим тілом.\"",
|
||||
"meridian_bonus.csv": "Трейдер 07 — премія 2 000 000 за \"угоду дня\" (продав акції енергетиків за годину до блекауту).\nТрейдер 12 — те саме. Трейдер 19 — те саме.\nУсі три угоди підписано однаково: 0x00.",
|
||||
"blackout_plan.dat": "ФАЗА 1: вимкнути підстанції лівого берега.\nФАЗА 2: перекинути навантаження на лікарні.\nФАЗА 3: \"люди самі попросять, щоб хтось усім керував\".",
|
||||
"puilo_trace.log": "Маршрут утечі: Нульовий вузол → \"ОрбітаНет\" → супутник \"Аргус-1\" → 14 країн.\nСтатус: зупинено (anchor.exe).",
|
||||
"puilo_heart.bin": "<серце Пуйла: перший рядок коду — \"// не дай їм думати самим\" — і 9 412 імен>",
|
||||
}
|
||||
|
||||
const NEWS = {
|
||||
"puilo_ledger.txt": "Біржа \"Меридіан\" призупинила торги через \"технічну перевірку\"",
|
||||
"purge.exe": "Метеостанція, старий дата-центр і енергохаб одночасно перезавантажились уночі",
|
||||
"grid_lock.exe": "Місто за крок від блекауту: енергетики кажуть, що мережу \"хтось заморозив\" у безпечному стані",
|
||||
"zero_key.bin": "Колишній штаб синдикату \"Пуйло\" знову онлайн — на одну хвилину",
|
||||
"anchor.exe": "Супутникові канали міста на 6 хвилин перестали приймати вихідний трафік",
|
||||
}
|
||||
|
||||
const AVATARS = {"Пуйло": "⭕"}
|
||||
|
||||
const ACHIEVEMENTS = {
|
||||
"act6": ["Нульовий вузол", "Дійди до Акту VI"],
|
||||
"purge": ["Санітар", "Зачисти всі копії Пуйла"],
|
||||
"end_zero": ["Нуль", "Вимкни Пуйла назавжди"],
|
||||
"end_cage": ["Клітка", "Замкни Пуйла в пісочниці"],
|
||||
}
|
||||
|
||||
# перевага Акту VI залежно від кінцівки Акту V: [від кого, лист]
|
||||
const ALLY = [
|
||||
["Оракул", "Журналісти, яким ти віддав Аргус, тепер стежать за кіберполіцією. Якщо десь наслідиш — у тебе буде більше часу, щоб прибрати, перш ніж прийдуть."],
|
||||
["Zero_Cool_UA", "Тебе нема в жодній базі, Shadow. Ні облич, ні голосу. Тепер завантаження й заливки майже не лишають за тобою сліду."],
|
||||
]
|
||||
|
||||
# фінальний вибір: [кнопка, підказка]
|
||||
const CHOICES = [["🔌 Вимкнути Пуйла назавжди", "Стерти кожен байт: жодних копій і жодного шансу повернутися"], ["🔒 Замкнути Пуйла в пісочниці", "Лишити ядро живим під замком і дізнатися все, що воно знає"]]
|
||||
const CHOICE_MAIL = ["Пуйло", "Ти вимикав мене вже двічі, Shadow. Щоразу я повертався, бо люди самі мене кликали. Вимкни — і хтось напише нового. Залиш — і я розповім, хто саме."]
|
||||
const CHOICE_PROMPT = "Виріши долю Пуйла:\n choose 1 — вимкнути назавжди\n choose 2 — замкнути в пісочниці"
|
||||
|
||||
const ENDINGS = [
|
||||
["КІНЦІВКА \"НУЛЬ\"", "Ти запускаєш purge востаннє. Нульовий вузол гасне, а разом з ним — рахунок PUILO-01, усі копії й голос, що роками шепотів у мережі.\nМісто нічого не помічає. Вранці світло горить, метро їздить, а в новинах — прогноз погоди.", "end_zero"],
|
||||
["КІНЦІВКА \"КЛІТКА\"", "Ти замикаєш серце Пуйла в пісочниці без жодного виходу в мережу. Він говорить — і Біла команда записує кожне слово.\nЗа місяць за ґратами всі, хто йому платив. Ключ від клітки є лише в тебе.", "end_cage"],
|
||||
]
|
||||
|
||||
# останній рядок фіналу залежно від кінцівки Акту V
|
||||
const EPILOGUE = [
|
||||
"📰 Журналісти: \"Справу Пуйла закрито. Автор розслідування побажав лишитися невідомим.\" 🏆",
|
||||
"🕳 Shadow: \"Тінь не лишає слідів. Але пам'ятає все.\" 🏆",
|
||||
]
|
||||
1
source_godot/act6.gd.uid
Normal file
1
source_godot/act6.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://dpqeei1lbnoba
|
||||
@@ -11,7 +11,7 @@ const HELP := {
|
||||
"ls": "ls — файли на сервері, до якого маєш доступ.",
|
||||
"cat": "cat <файл> — прочитати файл. Tab доповнює назву.",
|
||||
"download": "download <файл> — завантажити файл (сюжет, замовлення, контракт). Додає трасування й лишає лог.",
|
||||
"upload": "upload [файл] — залити латку на сервер (Акти IV–V).",
|
||||
"upload": "upload [файл] — залити латку на сервер (Акти IV–VI).",
|
||||
"disconnect": "disconnect — відключитися. Трасування скидається, але лишені логи запускають розслідування.",
|
||||
"wipe": "wipe [лог] — стерти всі свої логи або один (auth, xfer…). Коштує трохи трасування.",
|
||||
"logs": "logs — твої сліди на цьому сервері.",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -5,6 +5,7 @@ const L = preload("res://lang.gd") # мова: L.t() у коді, L.wrap() —
|
||||
var Data = L.wrap(preload("res://data.gd"))
|
||||
var Act4 = L.wrap(preload("res://act4.gd"))
|
||||
var Act5 = L.wrap(preload("res://act5.gd"))
|
||||
var Act6 = L.wrap(preload("res://act6.gd"))
|
||||
var Extra = L.wrap(preload("res://extra.gd"))
|
||||
const T = preload("res://tuning.gd") # усі числа балансу
|
||||
const Agents = preload("res://agents.gd")
|
||||
@@ -92,15 +93,17 @@ var servers := []
|
||||
var got := {} # досягнення — зберігаються між проходженнями
|
||||
var log_lines := [] # останні рядки виводу (для тестів)
|
||||
var cmds := {}
|
||||
# дані трьох актів (data.gd) + Акт IV (act4.gd) + Акт V (act5.gd)
|
||||
var missions: Array = Data.MISSIONS + Act4.MISSIONS + Act5.MISSIONS
|
||||
var jobs: Array = Data.JOBS + Act4.JOBS + Act5.JOBS
|
||||
var lore: Dictionary = Data.LORE.merged(Act4.LORE).merged(Act5.LORE)
|
||||
var news_defs: Dictionary = Extra.NEWS.merged(Act5.NEWS)
|
||||
var avatars: Dictionary = Data.AVATARS.merged(Act5.AVATARS).merged(Rivals.LIST).merged({L.t("Брокер"): "🕴"})
|
||||
# дані трьох актів (data.gd) + Акт IV (act4.gd) + Акт V (act5.gd) + Акт VI (act6.gd)
|
||||
var missions: Array = Data.MISSIONS + Act4.MISSIONS + Act5.MISSIONS + Act6.MISSIONS
|
||||
var jobs: Array = Data.JOBS + Act4.JOBS + Act5.JOBS + Act6.JOBS
|
||||
var lore: Dictionary = Data.LORE.merged(Act4.LORE).merged(Act5.LORE).merged(Act6.LORE)
|
||||
var news_defs: Dictionary = Extra.NEWS.merged(Act5.NEWS).merged(Act6.NEWS)
|
||||
var avatars: Dictionary = Data.AVATARS.merged(Act5.AVATARS).merged(Act6.AVATARS).merged(Rivals.LIST).merged({L.t("Брокер"): "🕴"})
|
||||
const A5_START := 36 # перша глава Акту V (= Data.MISSIONS.size() + Act4.MISSIONS.size(), перевіряє smoke)
|
||||
const A6_START := 42 # перша глава Акту VI (= A5_START + Act5.MISSIONS.size(), перевіряє smoke)
|
||||
var act4_end := 0 # кінцівка Акту IV: 1 — "Тиша", 2 — "Світанок" (0 — ще не обрано)
|
||||
var achs: Dictionary = Data.ACHIEVEMENTS.merged(Act4.ACHIEVEMENTS).merged(Act5.ACHIEVEMENTS).merged(Extra.ACHIEVEMENTS).merged(Extra.ACHIEVEMENTS2).merged(L.deep(Modes.ACHIEVEMENTS))
|
||||
var act5_end := 0 # кінцівка Акту V: 1 — "Гласність", 2 — "Тінь"
|
||||
var achs: Dictionary = Data.ACHIEVEMENTS.merged(Act4.ACHIEVEMENTS).merged(Act5.ACHIEVEMENTS).merged(Act6.ACHIEVEMENTS).merged(Extra.ACHIEVEMENTS).merged(Extra.ACHIEVEMENTS2).merged(L.deep(Modes.ACHIEVEMENTS))
|
||||
var skill_defs: Dictionary = Data.SKILLS.merged(Extra.SKILLS)
|
||||
var hw_defs: Dictionary = Data.HARDWARE.merged(Extra.HARDWARE)
|
||||
var ranks: Array = Data.RANKS + Extra.RANKS
|
||||
@@ -178,8 +181,9 @@ func _ready() -> void:
|
||||
hw[k] = 0
|
||||
hw["cpu"] = 1
|
||||
rivals = Rivals.fresh()
|
||||
servers = (Data.SERVERS + Act4.SERVERS + Act5.SERVERS).duplicate(true)
|
||||
servers = (Data.SERVERS + Act4.SERVERS + Act5.SERVERS + Act6.SERVERS).duplicate(true)
|
||||
for s in servers:
|
||||
s["files"] += Act6.EXTRA_FILES.get(s["ip"], [])
|
||||
s["open"] = false
|
||||
s["logs"] = false
|
||||
s["infected"] = false
|
||||
@@ -191,7 +195,7 @@ func _ready() -> void:
|
||||
_compute_reqs()
|
||||
for i in servers.size():
|
||||
var h: int = abs(hash(servers[i]["ip"]))
|
||||
map_pos.append(Vector2(32 + (i % 6) * 47 + (h & 15) - 8, 46 + (i / 6) * 62 + ((h >> 4) & 15) - 8)) # 7 рядів по 6, "дім" — під ними
|
||||
map_pos.append(Vector2(32 + (i % 6) * 47 + (h & 15) - 8, 46 + (i / 6) * 54 + ((h >> 4) & 15) - 8)) # 8 рядів по 6, "дім" — під ними
|
||||
cmds = {
|
||||
"help": c_help, "scan": c_scan, "connect": c_connect, "crack": c_crack, "ls": c_ls, "cat": c_cat,
|
||||
"download": c_download, "disconnect": c_disconnect, "wipe": c_wipe, "route": c_route, "contract": c_contract,
|
||||
@@ -223,8 +227,8 @@ func _compute_reqs() -> void:
|
||||
x += job_reward(s["lvl"])["xp"]
|
||||
else:
|
||||
x += main_reward(m)["xp"] if missions[m]["file"] == f else T.SHARD_XP * s["lvl"]
|
||||
while lv < MAX_LEVEL and x >= lv * T.XP_PER_LEVEL:
|
||||
x -= lv * T.XP_PER_LEVEL
|
||||
while lv < MAX_LEVEL and x >= xp_for(lv):
|
||||
x -= xp_for(lv)
|
||||
lv += 1
|
||||
|
||||
func _intro(loaded: bool) -> void:
|
||||
@@ -253,7 +257,7 @@ func _intro(loaded: bool) -> void:
|
||||
say(L.t("♾ Ти вже пройшов сюжет: endless — одразу в Нескінченну мережу (стартовий набір ветерана), records — рекорди."), "warn")
|
||||
say(L.t("🎚 Складність: %s. Змінити можна лише до першого зламу: difficulty novice | normal | paranoid.") % L.t(T.DIFF_NAMES[diff]), "warn")
|
||||
say(L.t("Ти — студент на прізвисько \"Shadow\", який ночами вивчає кібербезпеку.\nОдного вечора тобі пише незнайомець..."))
|
||||
say(L.t("Як грати: п'ять актів, %d сюжетних глав і %d побічних замовлень.") % [missions.size(), jobs.size()] + L.t(" Злам — вгадай код із різних цифр.\nСильні сервери мають кілька шарів шифрування; пробиті шари лишаються. Знайдений пароль вводиться сам.\nЗавжди стирай за собою логи (wipe) — інакше розслідування. Стеж за трасуванням: на 100% — арешт."))
|
||||
say(L.t("Як грати: шість актів, %d сюжетних глав і %d побічних замовлень.") % [missions.size(), jobs.size()] + L.t(" Злам — вгадай код із різних цифр.\nСильні сервери мають кілька шарів шифрування; пробиті шари лишаються. Знайдений пароль вводиться сам.\nЗавжди стирай за собою логи (wipe) — інакше розслідування. Стеж за трасуванням: на 100% — арешт."))
|
||||
c_missions("")
|
||||
say(L.t("Пиши help або користуйся кнопками внизу. Tab доповнює команди, ↑/↓ — історія."), "info")
|
||||
|
||||
@@ -271,12 +275,19 @@ func mission_target() -> Variant:
|
||||
return srv_by_ip(endless["order"]["ip"]) if endless["order"] != null else null
|
||||
var m = missions[mission]
|
||||
if m.get("upload", false):
|
||||
return srv_by_ip(m["ip"])
|
||||
return srv_by_ip(upload_ip(m))
|
||||
for f in m.get("shards", []):
|
||||
if not done.has(f):
|
||||
return srv_of(f)
|
||||
return srv_of(m["file"])
|
||||
|
||||
# куди заливати файл upload-глави: перший ще не зачищений сервер зі списку "targets" або "ip"
|
||||
func upload_ip(m) -> String:
|
||||
for ip in m.get("targets", []):
|
||||
if not done.has(m["file"] + "@" + ip):
|
||||
return ip
|
||||
return m["ip"]
|
||||
|
||||
# файл, який зараз треба завантажити за сюжетом (фрагмент ключа рахується)
|
||||
func is_story_file(f: String) -> bool:
|
||||
var m = missions[mission]
|
||||
@@ -289,6 +300,18 @@ func echo_ally() -> bool:
|
||||
func white_team() -> bool:
|
||||
return act4_end == 1 and mission >= A5_START
|
||||
|
||||
# перевага Акту VI: після "Гласності" преса дає більше часу на розслідування, після "Тіні" — менше сліду від файлів
|
||||
func press() -> bool:
|
||||
return act5_end == 1 and mission >= A6_START
|
||||
|
||||
func ghost() -> bool:
|
||||
return act5_end == 2 and mission >= A6_START
|
||||
|
||||
# трасування за завантаження чи заливку файлу
|
||||
func xfer_trace(per_lvl: int) -> int:
|
||||
var t := maxi(0, per_lvl * cur["lvl"] - int(round(T.STEALTH_CUT * (eff(skills["stealth"]) + eff(hw["ssd"])))))
|
||||
return int(round(t * (1.0 - T.GHOST_CUT))) if ghost() else t
|
||||
|
||||
func main_reward(i: int) -> Dictionary:
|
||||
return {"pay": T.MAIN_PAY[0] + T.MAIN_PAY[1] * i, "xp": T.MAIN_XP[0] + T.MAIN_XP[1] * i}
|
||||
|
||||
@@ -322,7 +345,11 @@ func server_by_arg(a: String) -> Variant:
|
||||
return null
|
||||
|
||||
func xp_need() -> int:
|
||||
return level * T.XP_PER_LEVEL
|
||||
return xp_for(level)
|
||||
|
||||
# досвід від рівня lv до наступного; останні рівні дорожчі, щоб 40-й лишався для гринду
|
||||
func xp_for(lv: int) -> int:
|
||||
return int(lv * T.XP_PER_LEVEL * (T.LATE_XP if lv >= T.LATE_FROM else 1.0))
|
||||
|
||||
# ефективний рівень модуля чи навички: 1..5 — повністю, 6..8 — по половині
|
||||
func eff(v: int) -> float:
|
||||
@@ -380,7 +407,7 @@ func route_factor() -> float:
|
||||
func investigation_time(s) -> int:
|
||||
# кожен зайвий тип логів — більше слідів, слідчі швидші
|
||||
return maxi(T.INVESTIGATION_MIN, int(round((T.INVESTIGATION[0] - T.INVESTIGATION[1] * s["lvl"] + int(round(T.JAMMER_ADD * eff(hw["jammer"])))
|
||||
- T.EXTRA_LOG_CUT * maxi(0, log_list(s).size() - 1)) * T.DIFF_INVEST[diff])))
|
||||
- T.EXTRA_LOG_CUT * maxi(0, log_list(s).size() - 1)) * T.DIFF_INVEST[diff] * (T.PRESS_INVEST if press() else 1.0))))
|
||||
|
||||
func botnet_size() -> int:
|
||||
return servers.filter(func(s): return s["infected"]).size()
|
||||
@@ -828,7 +855,7 @@ func render_card() -> void:
|
||||
t += L.t("\n🔄 до зміни пароля: [color=#ff9933]%s[/color] %d") % ["▮".repeat(k["since"]) + "▯".repeat(k["rotate"] - k["since"]), k["rotate"] - k["since"]]
|
||||
elif cur != null:
|
||||
var s = cur
|
||||
t = L.t("[font_size=30]%s[/font_size] [b]%s[/b]\n[color=#3a7a4a]%s[/color]\nЗахист: %s[color=#3a7a4a]%s[/color]\n") % [s["icon"], s["name"], s["ip"], "🛡".repeat(s["lvl"]), "·".repeat(8 - s["lvl"])]
|
||||
t = L.t("[font_size=30]%s[/font_size] [b]%s[/b]\n[color=#3a7a4a]%s[/color]\nЗахист: %s[color=#3a7a4a]%s[/color]\n") % [s["icon"], s["name"], s["ip"], "🛡".repeat(s["lvl"]), "·".repeat(maxi(0, 8 - s["lvl"]))]
|
||||
t += L.t("🔓 зламано") if s["open"] else L.t("🔒 шарів: %d%s") % [layers_of(s["lvl"]), L.t(" (пробито %d)") % s["layer_done"] if s["layer_done"] else ""]
|
||||
t += (L.t(" ⏱ активне трасування") if live_rate() > 0 else "") + "\n"
|
||||
if not s["ports"].is_empty() and not s["open"]:
|
||||
@@ -1164,7 +1191,7 @@ func buttons() -> Array:
|
||||
code.append(["make " + id, "🔌 %s ($%d)" % [Extra.UTILS[id]["name"], Extra.UTILS[id]["cost"]]])
|
||||
for i in servers.size():
|
||||
var s = servers[i]
|
||||
var todo: bool = (endless["order"] != null and endless["order"]["ip"] == s["ip"]) if endless != null else s["files"].any(func(f): return not done.has(f)) or (contract != null and contract["ip"] == s["ip"]) or missions[mission].get("ip", "") == s["ip"]
|
||||
var todo: bool = (endless["order"] != null and endless["order"]["ip"] == s["ip"]) if endless != null else s["files"].any(func(f): return not done.has(f)) or (contract != null and contract["ip"] == s["ip"]) or (missions[mission].get("upload", false) and upload_ip(missions[mission]) == s["ip"])
|
||||
if level >= s["req"] and todo:
|
||||
net.append(["connect %d" % (i + 1), "→ " + s["name"]])
|
||||
if servers.any(func(s): return s["open"]):
|
||||
@@ -1186,7 +1213,7 @@ func buttons() -> Array:
|
||||
act.append(["disconnect", L.t("⏏ Відключитися")])
|
||||
else:
|
||||
var um = missions[mission]
|
||||
if um.get("upload", false) and um["ip"] == cur["ip"]:
|
||||
if um.get("upload", false) and upload_ip(um) == cur["ip"]:
|
||||
act.append(["upload", L.t("⬆ Залити ") + um["file"]])
|
||||
for f in cur["files"]:
|
||||
act.append(["cat " + f, "👁 " + f])
|
||||
@@ -1222,7 +1249,7 @@ func tip_for(cmd: String) -> String:
|
||||
match c:
|
||||
"connect":
|
||||
var s = servers[int(a) - 1]
|
||||
return L.t("Підключитися: захист %d/8%s%s%s%s%s") % [s["lvl"], L.t(", вже зламано") if s["open"] else "", L.t(", ТАМ ТВОЇ ЛОГИ — зітри!") if s["logs"] else "",
|
||||
return L.t("Підключитися: захист %d/%d%s%s%s%s%s") % [s["lvl"], maxi(8, s["lvl"]), L.t(", вже зламано") if s["open"] else "", L.t(", ТАМ ТВОЇ ЛОГИ — зітри!") if s["logs"] else "",
|
||||
L.t(", активне трасування щосекунди") if s["lvl"] >= 6 else "", L.t(", злам \"наосліп\"") if is_blind(s["lvl"]) else "",
|
||||
L.t(", шарів: %d") % layers_of(s["lvl"]) if layers_of(s["lvl"]) > 1 else ""]
|
||||
"download":
|
||||
@@ -1744,6 +1771,7 @@ func _ach_cond(id: String) -> bool:
|
||||
"act3": return mission >= 20
|
||||
"act4": return mission >= Data.MISSIONS.size()
|
||||
"act5": return mission >= A5_START
|
||||
"act6": return mission >= A6_START
|
||||
"lvl10": return level >= 10
|
||||
"lvl20": return level >= 20
|
||||
"gear": return hw.values().any(func(v): return v >= HW_MAX)
|
||||
@@ -1810,8 +1838,8 @@ func run(line: String) -> void:
|
||||
cmds[c].call(" ".join(parts.slice(1)))
|
||||
else:
|
||||
say(L.t("Невідома команда \"%s\". Пиши help.") % c, "err")
|
||||
if not free and crack == null and mg == null and _state_sig() == sig:
|
||||
free = true # помилкова команда (connect 999, buy nothing…) нічого не змінила — час не минає
|
||||
if not free and _state_sig() == sig:
|
||||
free = true # помилкова команда (connect 999, buy nothing, код не тієї довжини…) нічого не змінила — час не минає
|
||||
if spent and mission == m0:
|
||||
deadline += 1
|
||||
if not free:
|
||||
@@ -1826,7 +1854,7 @@ func _state_sig() -> int:
|
||||
var sv := []
|
||||
for x in servers:
|
||||
sv.append([x["open"], x["logs"], x["ports_open"], x["infected"]])
|
||||
return hash([cur["ip"] if cur != null else "", crack != null, money, xp, level, sp, trace, route, contract, done.keys(),
|
||||
return hash([cur["ip"] if cur != null else "", str(crack), str(mg), money, xp, level, sp, trace, route, contract, done.keys(),
|
||||
inv, skills, hw, utils.keys(), mission, choosing, busts, sv, prog, over])
|
||||
|
||||
func c_help(a: String) -> void:
|
||||
@@ -1834,7 +1862,7 @@ func c_help(a: String) -> void:
|
||||
if a != "":
|
||||
say(L.t(Complete.HELP.get(a, L.t("Немає такої команди: %s. Пиши help.") % a)), "info")
|
||||
return
|
||||
say(L.t("Команди:\n scan — знайти сервери в мережі\n connect <ip|№> — підключитися (або клік на мапі)\n crack — зламати пароль (вгадай код)\n ls / cat <файл> — файли на сервері / прочитати файл\n download <файл> — завантажити файл\n upload [файл] — залити латку на сервер (Акти IV–V)\n disconnect — відключитися (трасування скидається)\n wipe — стерти свої логи (+10%% трасування). Без цього — розслідування!\n route [add №|auto|clear] — маршрут через зламані сервери: −10%% трасування за вузол\n contract [drop] — контракти (потрібне звання)\n missions / jobs — сюжет / побічні замовлення\n skills / learn <навичка> — %s\n shop / buy <модуль> — %s\n code / write / use <програма> — хакерське ПЗ\n news — новини, у яких є твій слід\n ports / open <порт> — закриті порти сервера / відкрити утилітою\n tools / make <утиліта> — утиліти для портів\n logs / wipe [лог] — твої сліди на сервері / стерти один або всі\n agent [№] — скриптові агенти\n hint / abort — відкрити цифру коду / перервати злам\n firewall / dict — міні-ігри перед зламом\n rivals — суперники-хакери\n choose 1|2 — вибір у фіналі акту\n endless / records — Нескінченна мережа після фіналу / рекорди\n difficulty <рівень> — novice | normal | paranoid (до першого зламу)\n lang uk|en — мова гри\n about — про гру і розробника\n achievements, status, save, sound, settings, update, newgame, clear\nhelp <команда> — докладно про команду. Tab — доповнити команду чи аргумент, ↑/↓ — історія команд.") % [", ".join(PackedStringArray(skill_defs.keys())), ", ".join(PackedStringArray(hw_defs.keys()))], "info")
|
||||
say(L.t("Команди:\n scan — знайти сервери в мережі\n connect <ip|№> — підключитися (або клік на мапі)\n crack — зламати пароль (вгадай код)\n ls / cat <файл> — файли на сервері / прочитати файл\n download <файл> — завантажити файл\n upload [файл] — залити латку на сервер (Акти IV–VI)\n disconnect — відключитися (трасування скидається)\n wipe — стерти свої логи (+10%% трасування). Без цього — розслідування!\n route [add №|auto|clear] — маршрут через зламані сервери: −10%% трасування за вузол\n contract [drop] — контракти (потрібне звання)\n missions / jobs — сюжет / побічні замовлення\n skills / learn <навичка> — %s\n shop / buy <модуль> — %s\n code / write / use <програма> — хакерське ПЗ\n news — новини, у яких є твій слід\n ports / open <порт> — закриті порти сервера / відкрити утилітою\n tools / make <утиліта> — утиліти для портів\n logs / wipe [лог] — твої сліди на сервері / стерти один або всі\n agent [№] — скриптові агенти\n hint / abort — відкрити цифру коду / перервати злам\n firewall / dict — міні-ігри перед зламом\n rivals — суперники-хакери\n choose 1|2 — вибір у фіналі акту\n endless / records — Нескінченна мережа після фіналу / рекорди\n difficulty <рівень> — novice | normal | paranoid (до першого зламу)\n lang uk|en — мова гри\n about — про гру і розробника\n achievements — досягнення (лишаються між проходженнями)\n status — рівень, гроші, звання, обладнання, розслідування\n save — зберегти гру (вона й так зберігається після кожної дії)\n sound — увімкнути або вимкнути звук і музику\n settings — налаштування: гучність, CRT, глітч, шрифт, F11, мова\n update — перевірити й завантажити нову версію гри\n newgame — почати спочатку (досягнення лишаться)\n clear — очистити екран\n help [команда] — цей список або докладно про одну команду\nhelp <команда> — докладно про команду. Tab — доповнити команду чи аргумент, ↑/↓ — історія команд.") % [", ".join(PackedStringArray(skill_defs.keys())), ", ".join(PackedStringArray(hw_defs.keys()))], "info")
|
||||
|
||||
func c_scan(_a: String) -> void:
|
||||
say(L.t("Сканування мережі..."))
|
||||
@@ -1845,7 +1873,7 @@ func c_scan(_a: String) -> void:
|
||||
hidden += 1
|
||||
continue
|
||||
var tag := L.t(" [ЗАВЕРШЕНО]") if s["files"].all(func(f): return done.has(f)) else (L.t(" [ЗАКРИТО]") if level < s["req"] else (L.t(" [ВІДКРИТО]") if s["open"] else ""))
|
||||
say(L.t(" %2d. %s %s %s захист %d/8 рів. %-2d%s") % [i + 1, s["icon"], s["ip"].rpad(15), s["name"].rpad(27), s["lvl"], s["req"], tag])
|
||||
say(L.t(" %2d. %s %s %s захист %d/%d рів. %-2d%s") % [i + 1, s["icon"], s["ip"].rpad(15), s["name"].rpad(27), s["lvl"], maxi(8, s["lvl"]), s["req"], tag])
|
||||
if hidden:
|
||||
say(L.t(" ...ще %d серверів поза зоною досяжності. Підвищуй рівень.") % hidden, "warn")
|
||||
|
||||
@@ -1865,7 +1893,7 @@ func c_connect(a: String) -> void:
|
||||
cur = s
|
||||
trace = 0.0
|
||||
say("╔══ %s %s ══════" % [s["icon"], s["name"]], "big")
|
||||
say(L.t("║ IP %s захист %s%s") % [s["ip"], "■".repeat(s["lvl"]), "□".repeat(8 - s["lvl"])], "info")
|
||||
say(L.t("║ IP %s захист %s%s") % [s["ip"], "■".repeat(s["lvl"]), "□".repeat(maxi(0, 8 - s["lvl"]))], "info")
|
||||
say(L.t("║ файлів: %d · шарів: %d%s%s") % [s["files"].size(), layers_of(s["lvl"]), L.t(" · наосліп") if is_blind(s["lvl"]) else "", L.t(" · уже зламано") if s["open"] else ""], "info")
|
||||
say("╚════════════════════════════", "info")
|
||||
var hops := route_servers()
|
||||
@@ -1980,7 +2008,7 @@ func c_download(f: String) -> void:
|
||||
Modes.on_download(self, f)
|
||||
leave_logs("xfer")
|
||||
if not over and cur != null:
|
||||
add_trace(maxi(0, T.DOWNLOAD_TRACE * cur["lvl"] - int(round(T.STEALTH_CUT * (eff(skills["stealth"]) + eff(hw["ssd"]))))))
|
||||
add_trace(xfer_trace(T.DOWNLOAD_TRACE))
|
||||
return
|
||||
var i := mission
|
||||
var m = missions[i]
|
||||
@@ -2017,7 +2045,7 @@ func c_download(f: String) -> void:
|
||||
say(L.t("📜 Файл для контракту отримано. Тепер зітри логи (wipe) і відключись."), "warn")
|
||||
leave_logs("xfer")
|
||||
if not over and cur != null:
|
||||
add_trace(maxi(0, T.DOWNLOAD_TRACE * cur["lvl"] - int(round(T.STEALTH_CUT * (eff(skills["stealth"]) + eff(hw["ssd"]))))))
|
||||
add_trace(xfer_trace(T.DOWNLOAD_TRACE))
|
||||
|
||||
# ── сюжет: здача глави (спільне для download і upload) ──
|
||||
func complete_mission() -> void:
|
||||
@@ -2057,9 +2085,13 @@ func _finish_mission() -> void:
|
||||
_relock_act4()
|
||||
if mission == A5_START:
|
||||
_start_act5()
|
||||
if nm.get("upload", false) and cur != null and cur["ip"] == nm["ip"]:
|
||||
if mission == A6_START:
|
||||
_start_act6()
|
||||
if nm.get("upload", false) and cur != null and cur["ip"] == upload_ip(nm):
|
||||
_lock(cur)
|
||||
if mission >= A5_START:
|
||||
if mission >= A6_START:
|
||||
say(L.t("⭕ Пуйло помітив тебе і змінив пароль цього сервера! Доведеться ламати знову."), "err")
|
||||
elif mission >= A5_START:
|
||||
say(L.t("👁 Аргус помітив тебе і змінив пароль цього сервера! Доведеться ламати знову."), "err")
|
||||
else:
|
||||
say(L.t("🌀 Відлуння помітило тебе і змінило пароль цього сервера! Доведеться ламати знову."), "err")
|
||||
@@ -2091,8 +2123,19 @@ func _start_act5() -> void:
|
||||
var a: Array = Act5.ALLY[act4_end - 1]
|
||||
mail(a[0], a[1])
|
||||
|
||||
# Акт VI: Пуйло закриває старі сервери, де ховається, а вибір Акту V дає перевагу
|
||||
func _start_act6() -> void:
|
||||
for ip in Act6.RELOCK:
|
||||
var s = srv_by_ip(ip)
|
||||
if s != null and s != cur:
|
||||
_lock(s)
|
||||
route = route.filter(func(ip): return srv_by_ip(ip) != null and srv_by_ip(ip)["open"])
|
||||
if act5_end >= 1:
|
||||
var a: Array = Act6.ALLY[act5_end - 1]
|
||||
mail(a[0], a[1])
|
||||
|
||||
func choice_act():
|
||||
return Act5 if mission >= A5_START else Act4
|
||||
return Act6 if mission >= A6_START else (Act5 if mission >= A5_START else Act4)
|
||||
|
||||
func c_upload(f: String) -> void:
|
||||
if endless != null:
|
||||
@@ -2108,16 +2151,28 @@ func c_upload(f: String) -> void:
|
||||
if f != "" and f != m["file"]:
|
||||
say(L.t("У тебе немає файлу \"%s\". Залити можна: %s") % [f, m["file"]], "err")
|
||||
return
|
||||
if cur["ip"] != m["ip"]:
|
||||
say(L.t("%s призначено для іншого сервера: %s.") % [m["file"], srv_by_ip(m["ip"])["name"]], "err")
|
||||
var ips: Array = m.get("targets", [m["ip"]])
|
||||
var key: String = m["file"] + "@" + cur["ip"]
|
||||
if not cur["ip"] in ips or done.has(key):
|
||||
var left_names := PackedStringArray(ips.filter(func(ip): return not done.has(m["file"] + "@" + ip)).map(func(ip): return srv_by_ip(ip)["name"]))
|
||||
say(L.t("%s призначено для іншого сервера: %s.") % [m["file"], ", ".join(left_names)], "err")
|
||||
return
|
||||
say(L.t("Заливка %s... ████████████ OK. Латку встановлено.") % m["file"])
|
||||
fx("dl")
|
||||
leave_logs("xfer")
|
||||
var lvl: int = cur["lvl"]
|
||||
var tr := xfer_trace(T.UPLOAD_TRACE) # заливати помітніше, ніж качати
|
||||
if m.has("targets"):
|
||||
done[key] = true
|
||||
var left: Array = ips.filter(func(ip): return not done.has(m["file"] + "@" + ip))
|
||||
if not left.is_empty():
|
||||
say(L.t("🧹 Копію знищено: %d/%d. Лишилось: %s.") % [ips.size() - left.size(), ips.size(), ", ".join(PackedStringArray(left.map(func(ip): return srv_by_ip(ip)["name"])))], "info")
|
||||
gain_xp(T.SHARD_XP * cur["lvl"])
|
||||
add_trace(tr)
|
||||
return
|
||||
unlock("purge")
|
||||
complete_mission()
|
||||
if not over and cur != null:
|
||||
add_trace(maxi(0, T.UPLOAD_TRACE * lvl - int(round(T.STEALTH_CUT * (eff(skills["stealth"]) + eff(hw["ssd"])))))) # заливати помітніше, ніж качати
|
||||
add_trace(tr)
|
||||
|
||||
func _start_choice() -> void:
|
||||
choosing = true
|
||||
@@ -2128,7 +2183,9 @@ func _start_choice() -> void:
|
||||
cur = null
|
||||
trace = 0.0
|
||||
var ca = choice_act()
|
||||
if ca == Act5:
|
||||
if ca == Act6:
|
||||
say(L.t("Серце Пуйла скопійовано, Нульовий вузол порожній. Тепер він — лише файл на твоєму диску."), "big")
|
||||
elif ca == Act5:
|
||||
say(L.t("Ядро Аргуса скопійовано, супутник замовк. Усе, що він бачив, — тепер на твоєму диску."), "big")
|
||||
else:
|
||||
say(L.t("Ядро скопійовано, з'єднання розірвано. На твоєму диску — усе, що лишилося від Пуйла."), "big")
|
||||
@@ -2146,11 +2203,14 @@ func c_choose(a: String) -> void:
|
||||
var e = ca.ENDINGS[int(a) - 1]
|
||||
choosing = false
|
||||
unlock(e[2])
|
||||
if ca == Act5:
|
||||
if ca == Act6:
|
||||
done[missions[mission]["file"]] = true
|
||||
end_game(e[0] + "\n" + e[1] + "\n" + Act5.EPILOGUE[maxi(0, act4_end - 1)], "info", e[0])
|
||||
end_game(e[0] + "\n" + e[1] + "\n" + Act6.EPILOGUE[maxi(0, act5_end - 1)], "info", e[0])
|
||||
return
|
||||
act4_end = int(a) # кінцівка Акту IV — і гра йде далі, в Акт V
|
||||
if ca == Act5:
|
||||
act5_end = int(a) # кінцівка Акту V — і гра йде далі, в Акт VI
|
||||
else:
|
||||
act4_end = int(a) # кінцівка Акту IV — і гра йде далі, в Акт V
|
||||
say("")
|
||||
say(e[0], "big")
|
||||
say(e[1], "info")
|
||||
@@ -2429,8 +2489,11 @@ func c_missions(_a: String) -> void:
|
||||
if deadline > 0:
|
||||
say(L.t("⏱ Термінова глава: лишилось %d дій. Встигнеш — нагорода ×2.") % deadline, "err")
|
||||
if m.get("upload", false):
|
||||
var s = srv_by_ip(m["ip"])
|
||||
var s = srv_by_ip(upload_ip(m))
|
||||
say(L.t("⬆ Підключись до \"%s\" (№%d), зламай і напиши upload.") % [s["name"], servers.find(s) + 1], "info")
|
||||
for ip in m.get("targets", []):
|
||||
var ts = srv_by_ip(ip)
|
||||
say(" %s %s (№%d)" % ["✔" if done.has(m["file"] + "@" + ip) else "🧹", ts["name"], servers.find(ts) + 1], "info")
|
||||
for f in m.get("shards", []):
|
||||
var fs = srv_of(f)
|
||||
say(" %s %s — %s (№%d)" % ["✔" if done.has(f) else "🧩", f, fs["name"], servers.find(fs) + 1], "info")
|
||||
@@ -2492,7 +2555,7 @@ func c_buy(k: String) -> void:
|
||||
say(L.t("Нейроімплант: +1 очко навичок!"), "info")
|
||||
|
||||
func c_code(_a: String) -> void:
|
||||
say(L.t("Рівень програмування: %d/%d (%s). Код пишеться вдома: write <програма>. Запуск: use <програма>.") % [prog, PROG_MAX, L.t("МАКС") if prog >= PROG_MAX else "%d/%d XP" % [prog_xp, prog * 100]])
|
||||
say(L.t("Рівень програмування: %d/%d (%s). Код пишеться вдома: write <програма>. Запуск: use <програма>.") % [prog, PROG_MAX, L.t("МАКС") if prog >= PROG_MAX else "%d/%d XP" % [prog_xp, prog * T.PROG_XP_PER_LEVEL]])
|
||||
for id in Data.PROGRAMS:
|
||||
var p = Data.PROGRAMS[id]
|
||||
say(L.t(" %s %s %s — %s. Рів. %d, $%d, є: %d") % ["💾" if prog >= p["req"] else "🔒", id.rpad(10), p["name"], p["desc"], p["req"], prog_cost(id), inv.get(id, 0)], "" if prog >= p["req"] else "warn")
|
||||
|
||||
@@ -3,10 +3,18 @@ extends RefCounted
|
||||
|
||||
const L = preload("res://lang.gd")
|
||||
|
||||
# спершу в .tmp, потім заміна: збій чи вимкнене світло посеред запису не зіпсує старе збереження
|
||||
static func save_json(path: String, data) -> void:
|
||||
var f := FileAccess.open(path, FileAccess.WRITE)
|
||||
if f:
|
||||
f.store_string(JSON.stringify(data))
|
||||
var tmp := path + ".tmp"
|
||||
var f := FileAccess.open(tmp, FileAccess.WRITE)
|
||||
if f == null:
|
||||
return
|
||||
var ok := f.store_string(JSON.stringify(data))
|
||||
f.close()
|
||||
if ok:
|
||||
DirAccess.rename_absolute(ProjectSettings.globalize_path(tmp), ProjectSettings.globalize_path(path))
|
||||
else:
|
||||
DirAccess.remove_absolute(ProjectSettings.globalize_path(tmp))
|
||||
|
||||
static func read_json(path: String) -> Variant:
|
||||
if not FileAccess.file_exists(path):
|
||||
@@ -27,7 +35,7 @@ static func save(g) -> void:
|
||||
"ver": g.SAVE_VER, "diff": g.diff, "rivals": g.rivals, "stolen": g.stolen, "endless": g.endless,
|
||||
"money": g.money, "xp": g.xp, "level": g.level, "sp": g.sp, "skills": g.skills, "hw": g.hw, "busts": g.busts, "mission": g.mission,
|
||||
"sound": g.sound, "stats": g.stats, "prog": g.prog, "prog_xp": g.prog_xp, "inv": g.inv, "rep": g.rep, "route": g.route,
|
||||
"heat": g.heat, "contract": g.contract, "done": g.done.keys(), "layers": layers, "deadline": g.deadline, "choosing": g.choosing, "act4_end": g.act4_end, "online": g.cur["ip"] if g.crack != null else "", "trace": g.trace, "news": g.news, "utils": g.utils.keys(),
|
||||
"heat": g.heat, "contract": g.contract, "done": g.done.keys(), "layers": layers, "deadline": g.deadline, "choosing": g.choosing, "act4_end": g.act4_end, "act5_end": g.act5_end, "online": g.cur["ip"] if g.crack != null else "", "trace": g.trace, "news": g.news, "utils": g.utils.keys(),
|
||||
"agent_code": g.agent_code, "agent_best": g.agent_best,
|
||||
"log_list": g.servers.filter(func(s): return s["logs"]).map(func(s): return [s["ip"], s["log_list"]]),
|
||||
"ports_open": g.servers.filter(func(s): return not s["ports_open"].is_empty()).map(func(s): return [s["ip"], s["ports_open"]]),
|
||||
@@ -68,6 +76,7 @@ static func load_into(g) -> bool:
|
||||
g.deadline = int(d.get("deadline", g.missions[g.mission].get("limit", -1)))
|
||||
g.choosing = bool(d.get("choosing", false))
|
||||
g.act4_end = int(d.get("act4_end", 0))
|
||||
g.act5_end = int(d.get("act5_end", 0))
|
||||
g.news = d.get("news", [])
|
||||
for u in d.get("utils", []):
|
||||
g.utils[u] = true
|
||||
|
||||
@@ -2,7 +2,7 @@ extends SceneTree
|
||||
## Симуляція проходження для перевірки балансу: бот грає як уважний гравець
|
||||
## (вгадує коди, сумісні з усіма підказками, тікає при високому трасуванні).
|
||||
## godot --headless --path . -s tests/balance.gd -- <seed> [макс_дій]
|
||||
## Змінні середовища: BAL_DIFF=0|1|2 (Новачок/Звичайний/Параноя), BAL_CHOICE=12 (вибір у фіналі Акту IV і Акту V),
|
||||
## Змінні середовища: BAL_DIFF=0|1|2 (Новачок/Звичайний/Параноя), BAL_CHOICE=121 (вибір у фіналах Актів IV, V і VI),
|
||||
## BAL_ENDLESS=1 (після фіналу ще й Нескінченна мережа: тест вимагає глибини ENDLESS_MIN), BAL_COMPLETE=1 (усі замовлення).
|
||||
|
||||
var g
|
||||
@@ -15,7 +15,7 @@ var last_code := ""
|
||||
var log_rows := []
|
||||
var stall := 0
|
||||
var DIFF := int(OS.get_environment("BAL_DIFF")) if OS.get_environment("BAL_DIFF") != "" else 1
|
||||
var CHOICE := OS.get_environment("BAL_CHOICE") if OS.get_environment("BAL_CHOICE").length() == 2 else "22"
|
||||
var CHOICE := OS.get_environment("BAL_CHOICE") if OS.get_environment("BAL_CHOICE").length() == 3 else "222"
|
||||
var ENDLESS := OS.get_environment("BAL_ENDLESS") != ""
|
||||
const ENDLESS_MIN := 5 # глибина, якої уважний гравець має дійти в Нескінченній мережі
|
||||
var choices := 0
|
||||
@@ -62,10 +62,14 @@ func _run() -> void:
|
||||
var depth := -1
|
||||
if ENDLESS and story_ok:
|
||||
var a0 := actions
|
||||
var lvl0: int = g.level
|
||||
var to40 := -1 # скільки дій гринду до 40 рівня після сюжету
|
||||
act("endless")
|
||||
while g.endless != null and not g.over and actions - a0 < 1500:
|
||||
var n0 := actions
|
||||
endless_step()
|
||||
if to40 < 0 and g.level >= g.MAX_LEVEL:
|
||||
to40 = actions - a0
|
||||
if actions == n0: # бот застряг — тест має впасти, а не зависнути
|
||||
print("FAIL бот не знає, що робити в Нескінченній мережі")
|
||||
break
|
||||
@@ -73,7 +77,7 @@ func _run() -> void:
|
||||
for l in g.log_lines.slice(-60):
|
||||
if "Нескінченна мережа: глибина" in l[0]:
|
||||
depth = int(l[0].split("глибина ")[1].split(",")[0])
|
||||
print("НЕСКІНЧЕННА: глибина %d за %d дій, арешти %d" % [depth, actions - a0, g.busts])
|
||||
print("НЕСКІНЧЕННА: глибина %d за %d дій, арешти %d, рів %d→%d%s" % [depth, actions - a0, g.busts, lvl0, g.level, ", 40-й через %d дій" % to40 if to40 >= 0 else ""])
|
||||
if OS.get_environment("BAL_DUMP") != "":
|
||||
for l in g.log_lines.slice(-40):
|
||||
print(" | ", l[0])
|
||||
@@ -101,7 +105,7 @@ func _run() -> void:
|
||||
quit(0 if fails.is_empty() else 1)
|
||||
|
||||
const MAX_BUSTS := 1 # бот грає обережно: більше одного арешту — гра стала надто жорсткою
|
||||
const MAX_ACTIONS := [1600, 1600, 2000] # за складністю; зараз ~1150 дій (Параноя ~1500, з BAL_COMPLETE=1 — ~1500)
|
||||
const MAX_ACTIONS := [1900, 1900, 2400] # за складністю; з Актом VI ~1350 дій (Параноя ~1800)
|
||||
var late := []
|
||||
var seen := 0
|
||||
var cnt := {}
|
||||
@@ -137,7 +141,7 @@ func act(cmd: String) -> void:
|
||||
|
||||
func step() -> void:
|
||||
if g.choosing:
|
||||
act("choose " + CHOICE[mini(choices, 1)])
|
||||
act("choose " + CHOICE[mini(choices, 2)])
|
||||
choices += 1
|
||||
return
|
||||
if g.cur != null:
|
||||
|
||||
@@ -61,6 +61,11 @@ func _run() -> void:
|
||||
for c in g.cmds:
|
||||
if not C.HELP.has(c):
|
||||
ok(false, "довідка є для " + c)
|
||||
g.run("help")
|
||||
var lines: PackedStringArray = last(g).split("\n")
|
||||
for c in g.cmds: # кожна команда має рядок з описом у загальному списку help
|
||||
if not Array(lines).any(func(l): return "—" in l and RegEx.create_from_string("(^|[ /])" + c + "\\b").search(l.split("—")[0]) != null):
|
||||
ok(false, "help описує " + c)
|
||||
g.run("help crack")
|
||||
ok("РІЗНИХ" in last(g), "help <команда> — докладна довідка")
|
||||
# ── налаштування ──
|
||||
|
||||
@@ -115,10 +115,23 @@ func _run() -> void:
|
||||
await frames(200)
|
||||
await shot("6_act5.png")
|
||||
g.run("disconnect")
|
||||
g.mission = g.missions.size() - 1
|
||||
g.mission = g.A6_START - 1
|
||||
g.run("connect 42")
|
||||
g.cur["open"] = true
|
||||
g.run("download argus_core.bin")
|
||||
g.run("choose 1") # кінцівка Акту V — далі Акт VI
|
||||
g.mission = g.A6_START + 1
|
||||
g.run("missions")
|
||||
g.run("connect 43")
|
||||
g.cur["open"] = true
|
||||
g.render()
|
||||
await frames(200)
|
||||
await shot("6b_act6.png")
|
||||
g.run("disconnect")
|
||||
g.mission = g.missions.size() - 1
|
||||
g.run("connect 45")
|
||||
g.cur["open"] = true
|
||||
g.run("download puilo_heart.bin")
|
||||
g.run("choose 1")
|
||||
g.render()
|
||||
await frames(200)
|
||||
|
||||
@@ -65,10 +65,10 @@ func _run() -> void:
|
||||
var all_files := []
|
||||
for s in g.servers:
|
||||
all_files.append_array(s["files"])
|
||||
ok(g.servers.size() == 42 and g.missions.size() == 42 and g.jobs.size() == 45, "дані: 42 сервери, 42 глави, 45 замовлень")
|
||||
ok(g.servers.size() == 45 and g.missions.size() == 48 and g.jobs.size() == 48, "дані: 45 серверів, 48 глав, 48 замовлень")
|
||||
var mission_ok := func(m):
|
||||
if m.get("upload", false):
|
||||
return g.srv_by_ip(m["ip"]) != null and not m["file"] in all_files
|
||||
return g.srv_by_ip(m["ip"]) != null and not m["file"] in all_files and m.get("targets", []).all(func(ip): return g.srv_by_ip(ip) != null)
|
||||
if m.has("shards"):
|
||||
return not m["file"] in all_files and m["shards"].all(func(f): return f in all_files)
|
||||
return m["file"] in all_files
|
||||
@@ -76,6 +76,7 @@ func _run() -> void:
|
||||
and g.jobs.all(func(j): return j["file"] in all_files), "кожен квест посилається на наявний файл або сервер для заливки")
|
||||
ok(g.achs.has("act4") and g.lore.has("echo_core.bin"), "дані Акту IV підключено")
|
||||
ok(g.A5_START == D.MISSIONS.size() + g.Act4.MISSIONS.size() and g.missions[g.A5_START].has("act") and g.achs.has("act5") and g.lore.has("argus_core.bin"), "дані Акту V підключено")
|
||||
ok(g.A6_START == g.A5_START + g.Act5.MISSIONS.size() and g.missions[g.A6_START].has("act") and g.achs.has("act6") and g.lore.has("puilo_heart.bin") and "zero_shard_c.bin" in g.srv_by_ip("66.6.0.13")["files"], "дані Акту VI підключено")
|
||||
var ips := {}
|
||||
for s in g.servers:
|
||||
ips[s["ip"]] = true
|
||||
@@ -266,7 +267,7 @@ func _run() -> void:
|
||||
# Акти IV–V: йдемо за завданнями, а не по серверах
|
||||
var steps := 0
|
||||
var money_a5 := 0
|
||||
while not g.over and steps < 40:
|
||||
while not g.over and steps < 70:
|
||||
steps += 1
|
||||
var m = g.missions[g.mission]
|
||||
var s = g.mission_target()
|
||||
@@ -297,16 +298,21 @@ func _run() -> void:
|
||||
ok(not g.over and not g.choosing and g.mission == g.A5_START and g.act4_end == 2 and g.got.has("act5"), "кінцівка Акту IV — і гра йде в Акт V")
|
||||
ok(g.echo_ally() and not g.white_team() and "Відлуння" in last(g, 40), "після 'Світанку' Відлуння — союзник")
|
||||
ok(not g.srv_by_ip("240.0.0.1")["open"], "Аргус закрив ядро Відлуння")
|
||||
elif g.mission < g.A6_START:
|
||||
g.run("choose 1")
|
||||
g.render()
|
||||
ok(not g.over and g.mission == g.A6_START and g.act5_end == 1 and g.got.has("act6") and g.press(), "кінцівка Акту V — і гра йде в Акт VI")
|
||||
ok(not g.srv_by_ip("127.0.0.1")["open"] and not g.srv_by_ip("10.200.1.5")["open"], "Пуйло закрив свої старі сервери")
|
||||
else:
|
||||
g.run("choose 1")
|
||||
elif g.cur != null:
|
||||
g.run("wipe")
|
||||
g.run("disconnect")
|
||||
ok(g.over and g.mission == 41 and g.busts == 0, "повне проходження: перемога на главі 42 (рівень %d)" % g.level)
|
||||
ok(g.got.has("end_dawn") and g.got.has("fast") and g.got.has("shards") and g.got.has("end_light"), "кінцівки 'Світанок' і 'Гласність', ключ із фрагментів, бонус за термінову главу")
|
||||
ok("Відлуння" in last(g, 12) and "ГЛАСНІСТЬ" in last(g, 12), "фінал Акту V згадує вибір Акту IV")
|
||||
ok(g.over and g.mission == 47 and g.busts == 0, "повне проходження: перемога на главі 48 (рівень %d)" % g.level)
|
||||
ok(g.got.has("end_dawn") and g.got.has("fast") and g.got.has("shards") and g.got.has("end_light") and g.got.has("purge") and g.got.has("end_zero"), "кінцівки 'Світанок', 'Гласність' і 'Нуль', зачистка копій, ключ із фрагментів, бонус за термінову главу")
|
||||
ok("Журналісти" in last(g, 12) and "НУЛЬ" in last(g, 12), "фінал Акту VI згадує вибір Акту V")
|
||||
g.render()
|
||||
ok("ДОСЬЄ" in g.card.text and "42/42" in g.card.text, "досьє з підсумками після перемоги")
|
||||
ok("ДОСЬЄ" in g.card.text and "48/48" in g.card.text, "досьє з підсумками після перемоги")
|
||||
ok("JunioR" in g.card.text and "Розробник: JunioR" in last(g, 30), "титри й досьє називають розробника")
|
||||
g.run("about")
|
||||
ok("JunioR" in last(g, 3) and "MIT" in last(g, 3), "about: розробник і ліцензія")
|
||||
@@ -324,6 +330,17 @@ func _run() -> void:
|
||||
g.run("status")
|
||||
g.run("сканувати")
|
||||
ok(g.deadline == 2, "довідка й друкарські помилки не витрачають дій")
|
||||
g.deadline = 10
|
||||
g.run("connect 2")
|
||||
g.run("crack")
|
||||
g.run("1")
|
||||
g.run("абв")
|
||||
ok(g.deadline == 8 and g.crack != null, "код не тієї довжини під час зламу не витрачає дій")
|
||||
g.crack = null
|
||||
g.cur = null
|
||||
g.heat = []
|
||||
g.trace = 0.0
|
||||
g.deadline = 2
|
||||
g.servers[0]["open"] = true
|
||||
g.run("connect 1")
|
||||
g.run("disconnect")
|
||||
@@ -411,6 +428,53 @@ func _run() -> void:
|
||||
ok(g.act4_end == 1 and g.mission == g.A5_START + 4 and g.white_team(), "вибір Акту IV зберігається")
|
||||
drop(g)
|
||||
|
||||
# 9b3. Акт VI: заливка на кілька серверів, переваги після Акту V, збереження
|
||||
g = fresh()
|
||||
g.level = 40
|
||||
for s in g.servers:
|
||||
s["req"] = 1
|
||||
s["open"] = true
|
||||
g.mission = g.A6_START + 1 # purge.exe на три сервери
|
||||
var pm = g.missions[g.mission]
|
||||
ok(g.mission_target() == g.srv_by_ip(pm["targets"][0]), "ціль — перший сервер зі списку")
|
||||
g.run("connect %d" % (g.servers.find(g.srv_by_ip(pm["targets"][1])) + 1))
|
||||
g.trace = 0.0
|
||||
g.run("upload")
|
||||
ok(g.mission == g.A6_START + 1 and "1/3" in last(g, 3) and g.mission_target() == g.srv_by_ip(pm["targets"][0]), "копія 1/3 — глава ще триває, порядок довільний")
|
||||
g.run("upload")
|
||||
ok("призначено" in last(g, 2) and not "2/3" in last(g, 3), "повторна заливка на той самий сервер не рахується")
|
||||
g.run("wipe")
|
||||
g.run("disconnect")
|
||||
for ip in [pm["targets"][0], pm["targets"][2]]:
|
||||
g.run("connect %d" % (g.servers.find(g.srv_by_ip(ip)) + 1))
|
||||
g.trace = 0.0
|
||||
g.run("upload")
|
||||
if g.cur != null:
|
||||
g.run("wipe")
|
||||
g.run("disconnect")
|
||||
ok(g.mission == g.A6_START + 2 and g.got.has("purge") and g.deadline > 0 and not g.srv_by_ip("10.66.6.6")["open"], "три копії зачищено; Пуйло змінив пароль енергохабу, термінова глава")
|
||||
g.act5_end = 0
|
||||
g.cur = g.srv_by_ip("10.66.6.6")
|
||||
var xt0: int = g.xfer_trace(g.T.UPLOAD_TRACE)
|
||||
var inv0: int = g.investigation_time(g.cur)
|
||||
g.act5_end = 2
|
||||
ok(g.ghost() and g.xfer_trace(g.T.UPLOAD_TRACE) == int(round(xt0 * (1.0 - g.T.GHOST_CUT))) and g.investigation_time(g.cur) == inv0, "після 'Тіні' заливки й завантаження менш помітні")
|
||||
g.act5_end = 1
|
||||
ok(g.press() and g.investigation_time(g.cur) > inv0 and g.xfer_trace(g.T.UPLOAD_TRACE) == xt0, "після 'Гласності' більше часу на розслідування")
|
||||
g.cur = null
|
||||
g.save_game()
|
||||
drop(g)
|
||||
g = fresh(true)
|
||||
ok(g.act5_end == 1 and g.mission == g.A6_START + 2 and g.done.has("purge.exe@10.66.6.6"), "вибір Акту V і зачищені копії зберігаються")
|
||||
g.mission = g.A6_START + 5
|
||||
g.srv_by_ip("0.0.0.0")["open"] = true
|
||||
g.run("connect %d" % (g.servers.find(g.srv_by_ip("0.0.0.0")) + 1))
|
||||
g.run("download puilo_heart.bin")
|
||||
ok(g.choosing and g.choice_act() == g.Act6, "фінал Акту VI — вибір")
|
||||
g.run("choose 2")
|
||||
ok(g.over and g.got.has("end_cage") and "КЛІТКА" in last(g, 12) and "Журналісти" in last(g, 12), "кінцівка 'Клітка' завершує гру з епілогом за вибором Акту V")
|
||||
drop(g)
|
||||
|
||||
# 9c. нові навички й обладнання
|
||||
g = fresh()
|
||||
var base_inv: int = g.investigation_time(g.servers[10])
|
||||
@@ -576,6 +640,8 @@ func _run() -> void:
|
||||
g = fresh(true)
|
||||
g.render()
|
||||
ok(g.route.is_empty() and g.heat.is_empty() and g.contract == null, "зіпсоване збереження не ламає гру")
|
||||
g.save_game()
|
||||
ok(FileAccess.file_exists(SAVE) and not FileAccess.file_exists(SAVE + ".tmp") and g.Save.read_json(SAVE) is Dictionary, "збереження пишеться через .tmp і замінює старе")
|
||||
g.heat = [{"ip": g.servers[3]["ip"], "t": 5}]
|
||||
g.deadline = 10
|
||||
for bad in ["connect 999", "buy nothing", "learn xyz", "write nothing", "cat"]:
|
||||
|
||||
@@ -75,6 +75,14 @@ func _run() -> void:
|
||||
if not last.contains("немає з'єднання") or FileAccess.file_exists(u.dest):
|
||||
print("FAIL обрив: ", last)
|
||||
bad += 1
|
||||
# завислий обрив: байти не йдуть понад хвилину → скасовано, зрозуміла помилка
|
||||
u.busy = true
|
||||
u.dl_t0 = Time.get_ticks_msec()
|
||||
u.dl_moved = [u.dl_t0 - U.STALL_MS - 1, 0]
|
||||
u._process(0.0)
|
||||
if u.busy or u.dl_t0 != 0 or not g.log_lines[-1][0].contains("зависло"):
|
||||
print("FAIL зависання: ", g.log_lines[-1][0])
|
||||
bad += 1
|
||||
if OS.get_environment("UPDATE_DL") == "1":
|
||||
var http := HTTPRequest.new()
|
||||
root.add_child(http)
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
#!/bin/sh
|
||||
# Builds the small Windows export template (tools/template_custom.py) from Godot sources.
|
||||
# Needs: python3 + scons, mingw-w64 (posix threads). About 40 min on 4 cores, ~6 GB RAM, ~5 GB disk.
|
||||
# Result: godot-<ver>-stable/bin/godot.windows.template_release.x86_64.exe -> upload it to the Gitea
|
||||
# prerelease "template-<ver>" as TinMerezhi-template.exe and put its sha256 into tools/template.sha256.
|
||||
# Needs: python3 + scons, mingw-w64 (posix threads). ~13 min on 8 cores (first build), ~8 GB RAM, ~5 GB disk.
|
||||
# Run again in the same folder: the sources are kept and scons rebuilds only what changed.
|
||||
# Result: godot-<ver>-stable/bin/godot.windows.template_release.x86_64.exe. On the server this is done by
|
||||
# the workflow template.yml (ci/template.Dockerfile), which also uploads it and updates tools/template.sha256.
|
||||
set -e
|
||||
VER="${GODOT_VER:-4.7.2}"
|
||||
HERE="$(cd "$(dirname "$0")" && pwd)"
|
||||
curl -sSL --fail -o "godot-$VER.tar.xz" "https://github.com/godotengine/godot/releases/download/$VER-stable/godot-$VER-stable.tar.xz"
|
||||
tar xf "godot-$VER.tar.xz"
|
||||
if [ ! -f "godot-$VER-stable/SConstruct" ]; then
|
||||
curl -sSL --fail -o "godot-$VER.tar.xz" "https://github.com/godotengine/godot/releases/download/$VER-stable/godot-$VER-stable.tar.xz"
|
||||
tar xf "godot-$VER.tar.xz" && rm "godot-$VER.tar.xz"
|
||||
fi
|
||||
cd "godot-$VER-stable"
|
||||
scons profile="$HERE/template_custom.py" d3d12=no vulkan=no -j"$(nproc)"
|
||||
scons profile="$HERE/template_custom.py" d3d12=no vulkan=no winrt=no accesskit=no angle=no -j"$(nproc)"
|
||||
sha256sum bin/godot.windows.template_release.x86_64.exe
|
||||
|
||||
@@ -1 +1 @@
|
||||
84715e06d937dd9b7e84838fa4ef8f4619e0d4f97b7887c72385189db26f67bb
|
||||
5a3eda63d88b32bd07e6139103232403318ff5c0a8dadc04ea1a8d51bbe7550e
|
||||
|
||||
@@ -16,6 +16,10 @@ disable_xr = "yes"
|
||||
vulkan = "no"
|
||||
d3d12 = "no"
|
||||
openxr = "no"
|
||||
# drivers whose SDKs are not in the source tarball: scons switches them off anyway, this only silences the warnings
|
||||
winrt = "no"
|
||||
accesskit = "no"
|
||||
angle = "no"
|
||||
modules_enabled_by_default = "no"
|
||||
# GDScript, fonts (FreeType + HarfBuzz shaping), SVG for the default theme icons, mbedTLS for HTTPS in the updater
|
||||
module_gdscript_enabled = "yes"
|
||||
|
||||
@@ -6,6 +6,8 @@ extends RefCounted
|
||||
const SOFT_CAP := 5 # після 5-го рівня кожен наступний дає лише половину ефекту
|
||||
const HW_PRICE_GROWTH := 1.5 # ціна рівнів 6–8: кожен у стільки разів дорожчий за попередній
|
||||
const XP_PER_LEVEL := 130 # досвід до наступного рівня = рівень × це (було 100: сюжет доводив до 40)
|
||||
const LATE_FROM := 36 # з цього рівня досвід до наступного × LATE_XP: 40-й — після сюжету, гриндом
|
||||
const LATE_XP := 1.6 # (підняти XP_PER_LEVEL замість цього — слабший гравець не встигає в термінових главах Акту V)
|
||||
const PROG_XP_PER_LEVEL := 100 # те саме для рівня програмування
|
||||
|
||||
# ── нагороди ──
|
||||
@@ -46,6 +48,7 @@ const BRUTE_CUT := 2 # Брутфорс: −% за рівень
|
||||
const ANALYST_CUT := 3 # Аналітик: підказка дешевша на % за рівень
|
||||
const LIVE_FROM := 6 # з якого захисту активне трасування щосекунди
|
||||
const LIVE_RATE := 0.3 # %/с × (захист − 5)
|
||||
const GHOST_CUT := 0.3 # Акт VI після "Тіні": −30% трасування за завантаження і заливку
|
||||
const ECHO_ALLY_CUT := 0.2 # Акт V після "Світанку": Відлуння зрізає 20% трасування за невдалу спробу
|
||||
const COOLER_CUT := 0.12 # Охолодження: −12% активного трасування за рівень
|
||||
const ROUTE_FACTOR := 0.9 # множник трасування за кожен вузол маршруту
|
||||
@@ -63,6 +66,7 @@ const BUST_LOSS_MIN := 10
|
||||
const BUST_REP := -30
|
||||
const INVESTIGATION := [25, 2] # дій до арешту: 25 − 2·захист
|
||||
const INVESTIGATION_MIN := 4
|
||||
const PRESS_INVEST := 1.3 # Акт VI після "Гласності": у стільки разів більше дій до арешту за лишені логи
|
||||
const JAMMER_ADD := 3 # Глушилка: + дій за рівень
|
||||
const EXTRA_LOG_CUT := 3 # кожен зайвий вид логів: − дій
|
||||
const REFLEX_ADD := 4 # Рефлекси: + дій до термінової глави за рівень
|
||||
|
||||
@@ -18,13 +18,15 @@ var dl_t0 := 0 # мс початку завантаження; 0 — не
|
||||
var dl_sample := [0, 0] # [мс, байти] останнього заміру швидкості
|
||||
var dl_speed := 0.0 # байт/с, згладжена
|
||||
var dl_step := 0 # скільки п'ятих частин уже надруковано в термінал
|
||||
var dl_moved := [0, 0] # [мс, байти]: коли востаннє прийшли нові байти (завислий обрив — без таймауту на весь файл)
|
||||
const CHECK_TIMEOUT := 20.0
|
||||
const STALL_MS := 60000
|
||||
var badge := Label.new() # версія й стан оновлень у правому куті рядка підказок
|
||||
|
||||
func _init(game) -> void:
|
||||
g = game
|
||||
|
||||
func _ready() -> void:
|
||||
http.timeout = 600.0
|
||||
add_child(http)
|
||||
dest = exe() + ".new"
|
||||
var old := exe() + ".old"
|
||||
@@ -76,6 +78,7 @@ func check(loud: bool, start := false) -> void:
|
||||
return
|
||||
busy = true
|
||||
set_badge(version_label() + L.t(" · перевірка оновлень…"), "#66ccff")
|
||||
http.timeout = CHECK_TIMEOUT
|
||||
http.request_completed.connect(_on_checked.bind(loud, start), CONNECT_ONE_SHOT)
|
||||
if http.request(API, ["Accept: application/json"]) != OK:
|
||||
http.request_completed.disconnect(_on_checked)
|
||||
@@ -124,6 +127,8 @@ func download() -> void:
|
||||
dl_sample = [dl_t0, 0]
|
||||
dl_speed = 0.0
|
||||
dl_step = 0
|
||||
dl_moved = [dl_t0, 0]
|
||||
http.timeout = 0.0 # повільний інтернет качає скільки треба; обрив ловить _process
|
||||
http.download_file = dest
|
||||
http.request_completed.connect(_on_downloaded, CONNECT_ONE_SHOT)
|
||||
if http.request(latest["url"]) != OK:
|
||||
@@ -150,6 +155,15 @@ func _process(_d: float) -> void:
|
||||
return
|
||||
var now := Time.get_ticks_msec()
|
||||
var got := http.get_downloaded_bytes()
|
||||
if got != dl_moved[1]:
|
||||
dl_moved = [now, got]
|
||||
elif now - dl_moved[0] > STALL_MS:
|
||||
http.cancel_request()
|
||||
if http.request_completed.is_connected(_on_downloaded):
|
||||
http.request_completed.disconnect(_on_downloaded)
|
||||
http.download_file = ""
|
||||
_fail(L.t("з'єднання зависло на %.1f з %.1f МБ") % [got / 1048576.0, latest["size"] / 1048576.0])
|
||||
return
|
||||
if now - dl_sample[0] >= 1000: # швидкість: замір раз на секунду, згладжена, щоб час не скакав
|
||||
var v: float = (got - dl_sample[1]) * 1000.0 / (now - dl_sample[0])
|
||||
dl_speed = v if dl_speed == 0.0 else lerpf(dl_speed, v, 0.2)
|
||||
|
||||
@@ -15,13 +15,13 @@
|
||||
Хакерська гра-головоломка в терміналі: зламуй сервери, вгадуючи коди,
|
||||
крадь файли, ховайся від трасування й розплутуй сюжет про ШІ Пуйло.
|
||||
|
||||
Сюжет 5 актів, 42 глави
|
||||
Сервери / побічні замовлення 42 / 45
|
||||
Сюжет 6 актів, 48 глав
|
||||
Сервери / побічні замовлення 45 / 48
|
||||
Злам кодів, шари, злам наосліп, маршрути, логи, розслідування
|
||||
Програми / навички / обладнання 10 / 12 / 12
|
||||
Рівні / звання / досягнення 40 / 8 / 36
|
||||
Рівні / звання / досягнення 40 / 8 / 51
|
||||
Порти й утиліти, види логів (auth/xfer/net), скриптові агенти
|
||||
Термінові глави, дві кінцівки, стрічка новин, ефекти CRT-екрана
|
||||
Термінові глави, вибір кінцівки в Актах IV–VI, стрічка новин, ефекти CRT-екрана
|
||||
3 складності (Новачок, Звичайний, Параноя без збережень)
|
||||
Міні-ігри зламу: обхід фаєрвола і словникова атака
|
||||
Суперники-хакери Cobra, Mantis і Nyx: перегони за замовлення й помста
|
||||
|
||||
Reference in New Issue
Block a user