summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSupremist <sergkarv@gmail.com>2025-10-28 22:40:53 +0200
committerSupremist <sergkarv@gmail.com>2025-10-28 22:40:53 +0200
commit09c4ea324a1f3288e4f85d0d9f12220dc4b187fc (patch)
treed067354bf61e7a2a90346c3fe82f403efd3606b2
parent0cc1078b97891cab00f724e6b2a1a8287b293d3d (diff)
downloadpf2e_calc-09c4ea324a1f3288e4f85d0d9f12220dc4b187fc.tar.xz
pf2e_calc-09c4ea324a1f3288e4f85d0d9f12220dc4b187fc.zip
Add simple items classes
-rw-r--r--character.py12
-rw-r--r--items.py26
-rw-r--r--leveling/fundamental_runes.json9
3 files changed, 34 insertions, 13 deletions
diff --git a/character.py b/character.py
index 7c814bd..e7bc97b 100644
--- a/character.py
+++ b/character.py
@@ -3,6 +3,7 @@ import json
from abc import ABC, abstractmethod
from dataclasses import dataclass, asdict
+from items import Armor
_skill_ability = {
@@ -116,15 +117,6 @@ class AbilitiesPlan(LevelingPlan):
res.apply_changes(boost)
return res
-@dataclass
-class Armor:
- name: str
- category: str = "light"
- ac: int = 1
- dex_cap: int = 4
- check_penalty: int = -1
- speed_penalty: int = -5
- strength_req: int = 0
@dataclass
class Character:
@@ -145,7 +137,7 @@ class Character:
self.level = 1
self.abilities = Abilities()
self.features = dict()
- self.armor = Armor("Leather armor")
+ self.armor = Armor("Leather armor", "light", 1)
def max_hp(self):
per_level = self.hp_per_level + self.abilities.modifier("con")
diff --git a/items.py b/items.py
new file mode 100644
index 0000000..a26316c
--- /dev/null
+++ b/items.py
@@ -0,0 +1,26 @@
+from dataclasses import dataclass
+
+@dataclass
+class Armor:
+ name: str
+ category: str
+ ac: int
+ potency: int = 0
+ resilient: int = 0
+ dex_cap: int = 99 # uncapped
+ check_penalty: int = 0
+ speed_penalty: int = 0
+ strength_req: int = 0
+
+@dataclass
+class Weapon:
+ name: str
+ category: str
+ main_die: int
+ potency: int = 0
+ striking: int = 0
+ backstabber: bool = False
+ fatal: int = 0
+ deadly: int = 0
+ agile: bool = False
+ twin: bool = False
diff --git a/leveling/fundamental_runes.json b/leveling/fundamental_runes.json
index a1cbef6..7816045 100644
--- a/leveling/fundamental_runes.json
+++ b/leveling/fundamental_runes.json
@@ -1,11 +1,14 @@
{
"2" : {"weapon potency": 1},
- "4" : {"striking": 2},
+ "4" : {"striking": 1},
"5" : {"armor potency": 1},
+ "8" : {"resilient": 1},
"10": {"weapon potency": 2},
"11": {"armor potency": 2},
- "12": {"striking": 3},
+ "12": {"striking": 2},
+ "14": {"resilient": 2},
"16": {"weapon potency": 3},
"18": {"armor potency": 3},
- "19": {"striking": 4}
+ "19": {"striking": 3},
+ "20": {"resilient": 3}
}