Combat stats grid pinned under the slot details; damage type on the equipped weapon
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
8f44557076
commit
50f069b069
5 changed files with 52 additions and 17 deletions
5
app.py
5
app.py
|
|
@ -110,6 +110,9 @@ def player_view(world: dict, player: dict, now: float) -> dict:
|
|||
view["slots_used"] = game.slots_used(world, player)
|
||||
view["stack"] = game.stack_size(world)
|
||||
view["power"] = game.combat_power(player)
|
||||
me = game.fighter(player, game.blessing(player), game.potion_effect(player, "combat"))
|
||||
view["fighter"] = {"max_hit": me["max_hit"], "accuracy": round(me["accuracy"]), "evasion": me["evasion"],
|
||||
"crit": me["crit"], "interval": me["interval"], "block": me["block"], "damage": me["damage"]}
|
||||
view["perk_costs"] = {perk: game.perk_cost(player, perk) for perk in player["perks"]}
|
||||
if player["action"]:
|
||||
action, fight = game.growing(player), player["action"].get("fight")
|
||||
|
|
@ -171,6 +174,8 @@ def roster(world: dict, now: float) -> list[dict]:
|
|||
people.append({
|
||||
"xp": player["xp"], "equip": player["equip"], "joined": player["joined"],
|
||||
"hp": int(player["hp"]), "max_hp": game.max_hp(player), "power": game.combat_power(player),
|
||||
"fighter": {key: value for key, value in game.fighter(player, game.blessing(player), {}).items()
|
||||
if key in ("max_hit", "accuracy", "evasion", "crit", "interval", "block", "damage")},
|
||||
"armour": game.armour(player), "reduction": round(game.damage_reduction(player), 3),
|
||||
"ward": game.magic_ward(player), "ward_reduction": round(game.reduction(game.magic_ward(player)), 3),
|
||||
"favour": player["favour"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue