some work done on character sheets
This commit is contained in:
@@ -33,6 +33,7 @@ if __name__ == "__main__":
|
||||
elif sys.platform.startswith("darwin"): # macos
|
||||
storage_dir = pathlib.Path(os.environ["HOME"]) / "Library/Application Support/seagull"
|
||||
else:
|
||||
# TODO: check if XDG env vars are set and prioritize those
|
||||
storage_dir = pathlib.Path(os.environ["HOME"]) / ".local/share/seagull"
|
||||
desktop.path_storagedir = storage_dir
|
||||
|
||||
|
@@ -22,7 +22,8 @@ app = flask.Flask("seagull-game", root_path=path_appdir)
|
||||
orig_url_for = app.url_for
|
||||
|
||||
xml_namespaces = {
|
||||
"items": "seagull:rules/items"
|
||||
"items": "seagull:rules/items",
|
||||
"upgrades": "seagull:rules/upgrades"
|
||||
}
|
||||
|
||||
#REDIS_HOST="stub-implementation.example.net"
|
||||
@@ -45,6 +46,13 @@ app.url_for = url_for_override
|
||||
base_context = {}
|
||||
base_context_live = False
|
||||
|
||||
@app.route("/dialog/<dialog>")
|
||||
def render_dialog(dialog):
|
||||
if os.path.exists(path_appdir / f"templates/{dialog}.j2"):
|
||||
return flask.render_template(f"{dialog}.j2")
|
||||
else:
|
||||
return "", 404
|
||||
|
||||
def render_base_context():
|
||||
global base_context
|
||||
global base_context_live
|
||||
|
@@ -6,9 +6,6 @@ import lxml.etree as xmltree
|
||||
|
||||
from . import core
|
||||
|
||||
# NOTE: due to how XML libraries handle namespaces, you have to prepend "{seagull:rules/items}" to every tag value
|
||||
# this is merely the price you pay for editor autocompletions
|
||||
|
||||
valid_resources = [
|
||||
"food", "shinies", "psi" # early game
|
||||
]
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
|
||||
<uri name="seagull:rules/items" uri="items.xsd" />
|
||||
<uri name="seagull:rules/upgrades" uri="upgrades.xsd" />
|
||||
</catalog>
|
32
app/rules/schemas/upgrades.xsd
Normal file
32
app/rules/schemas/upgrades.xsd
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" standalone="yes"?>
|
||||
<xs:schema id="UpgradeRules" targetNamespace="seagull:rules/upgrades" xmlns="seagull:rules/upgrades" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="unqualified" elementFormDefault="qualified">
|
||||
<xs:element name="UpgradeRules" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
|
||||
<xs:complexType>
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="Upgrade">
|
||||
<xs:complexType>
|
||||
<xs:choice maxOccurs="unbounded">
|
||||
<xs:element name="Id" type="xs:string" minOccurs="1" maxOccurs="1" />
|
||||
<xs:element name="Name" type="xs:string" minOccurs="1" maxOccurs="1" />
|
||||
<xs:element name="Desc" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
||||
<xs:element name="Modifiers" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="Mod" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="Id" form="unqualified" type="xs:string" />
|
||||
<xs:attribute name="Name" form="unqualified" type="xs:string" />
|
||||
<xs:attribute name="Speed" form="unqualified" type="xs:int" />
|
||||
<xs:attribute name="ChanceSteal" form="unqualified" type="xs:int" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:choice>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
19
app/rules/upgrades/agility.xml
Normal file
19
app/rules/upgrades/agility.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<UpgradeRules xmlns="seagull:rules/upgrades">
|
||||
<Upgrade>
|
||||
<Id>speed1</Id>
|
||||
<Name>Speedier Seagull</Name>
|
||||
<Modifiers>
|
||||
<Mod Id="up_speed1" Name="Upgrade: Speedier Seagull" Speed="5" />
|
||||
</Modifiers>
|
||||
<Desc>You become just a little bit faster, which makes it easier to steal things before your prey's previous owners notice you're coming.</Desc>
|
||||
</Upgrade>
|
||||
<Upgrade>
|
||||
<Id>theft_chance1</Id>
|
||||
<Name>Swooping Techniques</Name>
|
||||
<Modifiers>
|
||||
<Mod Id="up_theft_chance1" Name="Upgrade: Swooping Techniques" ChanceSteal="10" />
|
||||
</Modifiers>
|
||||
<Desc>It's all in the neck. The wings are just the steering wheel. You gain a bonus on all dice rolls for stealing.</Desc>
|
||||
</Upgrade>
|
||||
</UpgradeRules>
|
20
app/templates/charsheet.j2
Normal file
20
app/templates/charsheet.j2
Normal file
@@ -0,0 +1,20 @@
|
||||
<div id="charsheet-leftside">
|
||||
<div class="attr" id="attr-agility">
|
||||
Agility: <span id="lbl-attr-agility">0</span>
|
||||
</div>
|
||||
<div class="attr" id="attr-instinct">
|
||||
<span id="lbl-attr-instinct-txt">Instinct</span>: <span id="lbl-attr-instinct">0</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="charsheet-rightside">
|
||||
<div id="charsheet-upgrade-tabbar">
|
||||
<nav id="nav-upgrades"><ul>
|
||||
<li><button id="btn-upgrade-agility">Agility Upgrades</button></li>
|
||||
<li><button id="btn-upgrade-instinct">Instinct Upgrades</button></li>
|
||||
</ul></nav>
|
||||
</div>
|
||||
<div id="charsheet-upgrade-tree">
|
||||
<pre class="mermaid" id="upgrade-tree">
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
12
app/upgrades/agility.mmd
Normal file
12
app/upgrades/agility.mmd
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
title: Agility Upgrades
|
||||
---
|
||||
flowchart LR
|
||||
speed1["Speedier Seagull"]
|
||||
speed2["Greased Wings"]
|
||||
theft_chance1["Swooping Techniques"]
|
||||
theft_chance2["The Element of Surprise"]
|
||||
|
||||
speed1-->speed2
|
||||
theft_chance1-->speed1
|
||||
theft_chance1-->theft_chance2
|
Reference in New Issue
Block a user