state sync; the basic early game works

This commit is contained in:
2025-08-05 17:57:43 -07:00
parent 9f514db33b
commit 1b72e899af
16 changed files with 209 additions and 23 deletions

19
app/pylocal/actions.py Normal file
View File

@@ -0,0 +1,19 @@
import json
import random
import flask
from . import core
def dice_roll(min=0, max=100, modifiers=[]):
result = random.randint(min, max)
for _, mod in modifiers:
result += mod
return result
@core.app.route("/act/steal/<resource>", methods=["POST"])
def steal_resource(resource):
return flask.Response(json.dumps({
"success": (dice_roll() >= 50)
}), status=200, content_type="application/json")