Fix tower connection, remove buddy/rival/xp, add dice calc, universal editor

Tower fix:
- GH-komunikacni-vez connects to H-ridici-centrum (not H-centralni-sachta)
- Eliminates phantom shortcut F->H sachta->tower->G

Removed mechanics (per GM):
- Buddy, Rival, XP — not used in this campaign

New SPC G r — dice calculator:
- Select skill from menu, shows: base dice + stress dice = total

SPC G e — universal editor:
- Edit ANY stat: Health, Stress, Resolve, Story points, all attributes,
  all skills from one completing-read menu

Status (SPC G s) — redesigned layout:
- Attributes with skills grouped by attribute (STRENGTH: CC 2, HM 2...)
- All skills shown (including 0), grouped logically
- Health/Stress/Resolve/Story points on one line

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-24 17:30:13 +01:00
parent ebcf77f3e2
commit 95dd5f769d

View File

@@ -458,7 +458,7 @@
(:id "GH-komunikacni-vez" :deck "GH" :name "Komunikační věž / DA/UT/UR" (:id "GH-komunikacni-vez" :deck "GH" :name "Komunikační věž / DA/UT/UR"
:location "Mezi G a H" :note "Komunikační počítač (Daughter)." :location "Mezi G a H" :note "Komunikační počítač (Daughter)."
:desc "Vertikální věž s komunikačním počítačem DA/UT/UR (Daughter). Úzká — snadno bránitelná, ale i past. Alternativa k MU/TH/UR na palubě B." :desc "Vertikální věž s komunikačním počítačem DA/UT/UR (Daughter). Úzká — snadno bránitelná, ale i past. Alternativa k MU/TH/UR na palubě B."
:connections ("G-shromazdiste" "H-centralni-sachta")) :connections ("G-shromazdiste" "H-ridici-centrum"))
;; === Paluba H === ;; === Paluba H ===
(:id "H-plasma-sz" :deck "H" :name "Plasmová stanice (SZ)" (:id "H-plasma-sz" :deck "H" :name "Plasmová stanice (SZ)"
@@ -508,7 +508,7 @@
(:id "H-ridici-centrum" :deck "H" :name "Řídící centrum" (:id "H-ridici-centrum" :deck "H" :name "Řídící centrum"
:location "Střed" :note "" :location "Střed" :note ""
:desc "Řídící centrum průmyslové paluby. Konzole pro ovládání tavení, plasmy, destilace. Možnost sabotáže nebo nouzového vypnutí." :desc "Řídící centrum průmyslové paluby. Konzole pro ovládání tavení, plasmy, destilace. Možnost sabotáže nebo nouzového vypnutí."
:connections ("H-dilny-z" "H-dilny-v" "H-strojovna-z" "H-strojovna-v" "H-centralni-sachta")) :connections ("H-dilny-z" "H-dilny-v" "H-strojovna-z" "H-strojovna-v" "H-centralni-sachta" "GH-komunikacni-vez"))
(:id "H-strojovna-z" :deck "H" :name "Strojovna (Z)" (:id "H-strojovna-z" :deck "H" :name "Strojovna (Z)"
:location "Jih-západ" :note "" :location "Jih-západ" :note ""
:desc "Těžké strojní vybavení. Hlučné, horké, špatná viditelnost od páry." :desc "Těžké strojní vybavení. Hlučné, horké, špatná viditelnost od páry."
@@ -544,7 +544,7 @@
(:id "H-centralni-sachta" :deck "H" :name "Centrální šachta" (:id "H-centralni-sachta" :deck "H" :name "Centrální šachta"
:location "Střed" :note "" :location "Střed" :note ""
:desc "Vertikální šachta na NEJVĚTŠÍ palubě stanice (měřítko 10 m). Žebříky a servisní plošiny. Průmyslový hluk ze všech stran." :desc "Vertikální šachta na NEJVĚTŠÍ palubě stanice (měřítko 10 m). Žebříky a servisní plošiny. Průmyslový hluk ze všech stran."
:connections ("H-ridici-centrum" "GH-komunikacni-vez" :connections ("H-ridici-centrum"
"B-centralni-sachta" "C-centralni-sachta" "D-centralni-sachta" "B-centralni-sachta" "C-centralni-sachta" "D-centralni-sachta"
"E-centralni-sachta" "F-centralni-sachta" "G-centralni-sachta" "E-centralni-sachta" "F-centralni-sachta" "G-centralni-sachta"
"I-centralni-sachta" "J-centralni-sachta")) "I-centralni-sachta" "J-centralni-sachta"))
@@ -637,11 +637,8 @@
:tiny-items () :tiny-items ()
:injuries () :injuries ()
:conditions () :conditions ()
:xp 0
:story-points 0 :story-points 0
:notes () :notes ())
:buddy nil
:rival nil)
"Dynamický herní stav.") "Dynamický herní stav.")
(defvar alien-rpg-state-file (defvar alien-rpg-state-file
@@ -1043,8 +1040,10 @@ Průlezy G<->H: G3<->H3, G4<->H4, G7<->H7, G8<->H8, G9<->H9
(st alien-rpg-state) (st alien-rpg-state)
(room (alien-rpg--current-room)) (room (alien-rpg--current-room))
(attrs (plist-get ch :attributes)) (attrs (plist-get ch :attributes))
(skills (plist-get ch :skills))
(health (plist-get st :health)) (health (plist-get st :health))
(stress (plist-get st :stress)) (stress (plist-get st :stress))
(resolve (or (plist-get st :resolve) 4))
(weapons (plist-get st :weapons)) (weapons (plist-get st :weapons))
(armor (plist-get st :armor)) (armor (plist-get st :armor))
(gear (plist-get ch :gear)) (gear (plist-get ch :gear))
@@ -1054,37 +1053,32 @@ Průlezy G<->H: G3<->H3, G4<->H4, G7<->H7, G8<->H8, G9<->H9
(with-current-buffer (get-buffer-create "*Alien RPG*") (with-current-buffer (get-buffer-create "*Alien RPG*")
(let ((inhibit-read-only t)) (let ((inhibit-read-only t))
(erase-buffer) (erase-buffer)
;; Hlavicka (insert (format "%s — %s, %s let\n\n"
(insert (format "%s\n" (plist-get ch :name))) (plist-get ch :name) (plist-get ch :career) (plist-get ch :age)))
(insert (format "%s, %s let\n" (plist-get ch :career) (plist-get ch :age))) ;; Atributy a dovednosti - strukturovane
;; Atributy (insert (format "STRENGTH %d: Close Combat %d, Heavy Machinery %d, Stamina %d\n"
(insert (format "Str %s Agi %s Wit %s Emp %s\n" (plist-get attrs :strength)
(plist-get attrs :strength) (plist-get attrs :agility) (plist-get skills :close-combat) (plist-get skills :heavy-machinery)
(plist-get attrs :wits) (plist-get attrs :empathy))) (plist-get skills :stamina)))
;; Health / Stress / Resolve (insert (format "AGILITY %d: Mobility %d, Piloting %d, Ranged Combat %d\n"
(insert (format "Health: %d/4 | Stress: %d | Resolve: %d\n" (plist-get attrs :agility)
health stress (or (plist-get st :resolve) 4))) (plist-get skills :mobility) (plist-get skills :piloting)
;; Dovednosti (jen nenulove) (plist-get skills :ranged-combat)))
(let ((skills-str (insert (format "WITS %d: Comtech %d, Observation %d, Survival %d\n"
(mapconcat (plist-get attrs :wits)
(lambda (sk) (plist-get skills :comtech) (plist-get skills :observation)
(let* ((key (car sk)) (plist-get skills :survival)))
(val (plist-get (plist-get ch :skills) key))) (insert (format "EMPATHY %d: Command %d, Manipulation %d, Medical Aid %d\n\n"
(when (> val 0) (plist-get attrs :empathy)
(format "%s %d" (cdr (assq key alien-rpg-skill-names)) val)))) (plist-get skills :command) (plist-get skills :manipulation)
alien-rpg-skill-attributes ""))) (plist-get skills :medical-aid)))
(insert (format "Dovednosti: %s\n" ;; Stav
(string-join (cl-remove-if #'null (insert (format "Health: %d | Stress: %d | Resolve: %d | Story points: %s\n"
(mapcar (lambda (sk) health stress resolve (or (plist-get st :story-points) 0)))
(let* ((key (car sk))
(val (plist-get (plist-get ch :skills) key)))
(when (> val 0)
(format "%s %d" (cdr (assq key alien-rpg-skill-names)) val))))
alien-rpg-skill-attributes)) ", "))))
;; Talent ;; Talent
(insert (format "Talent: %s\n" (plist-get ch :talent))) (insert (format "Talent: %s\n" (plist-get ch :talent)))
;; Pozice ;; Pozice
(insert (format "Pozice: %s [%s]\n" (plist-get room :name) (plist-get room :id))) (insert (format "Pozice: %s [%s]\n\n" (plist-get room :name) (plist-get room :id)))
;; Vybava ;; Vybava
(let ((all-gear (append gear extra))) (let ((all-gear (append gear extra)))
(insert (format "Výbava: %s\n" (if all-gear (string-join all-gear ", ") "--")))) (insert (format "Výbava: %s\n" (if all-gear (string-join all-gear ", ") "--"))))
@@ -1112,15 +1106,7 @@ Průlezy G<->H: G3<->H3, G4<->H4, G7<->H7, G8<->H8, G9<->H9
;; Zraneni a stavy ;; Zraneni a stavy
(insert (format "Zranění: %s\n" (if injuries (string-join injuries ", ") "--"))) (insert (format "Zranění: %s\n" (if injuries (string-join injuries ", ") "--")))
(insert (format "Stavy: %s\n" (if conditions (string-join conditions ", ") "--"))) (insert (format "Stavy: %s\n" (if conditions (string-join conditions ", ") "--")))
;; Vztahy ;; Signature
(insert (format "Buddy: %s | Rival: %s\n"
(or (plist-get st :buddy) "--")
(or (plist-get st :rival) "--")))
;; XP / Story points
(insert (format "XP: %s | Story points: %s\n"
(or (plist-get st :xp) 0)
(or (plist-get st :story-points) 0)))
;; Signature item
(insert (format "Signature: %s\n" (or (plist-get ch :signature-item) "--")))) (insert (format "Signature: %s\n" (or (plist-get ch :signature-item) "--"))))
(goto-char (point-min)) (goto-char (point-min))
(special-mode)) (special-mode))
@@ -1191,32 +1177,78 @@ Průlezy G<->H: G3<->H3, G4<->H4, G7<->H7, G8<->H8, G9<->H9
(message "Resolve: %d (%s%d)" new-val (if (>= n 0) "+" "") n))) (message "Resolve: %d (%s%d)" new-val (if (>= n 0) "+" "") n)))
(defun alien-rpg-set-stat () (defun alien-rpg-set-stat ()
"Změň atribut nebo dovednost." "Univerzální editor — změň cokoliv na kartě."
(interactive) (interactive)
(let* ((choices '(("Strength" . (:attributes :strength)) (let* ((st-choices '(("Health" . :health)
("Agility" . (:attributes :agility)) ("Stress" . :stress)
("Wits" . (:attributes :wits)) ("Resolve" . :resolve)
("Empathy" . (:attributes :empathy)) ("Story points" . :story-points)))
("Close Combat" . (:skills :close-combat)) (attr-choices '(("Strength" . (:attributes :strength))
("Heavy Machinery" . (:skills :heavy-machinery)) ("Agility" . (:attributes :agility))
("Stamina" . (:skills :stamina)) ("Wits" . (:attributes :wits))
("Mobility" . (:skills :mobility)) ("Empathy" . (:attributes :empathy))))
("Piloting" . (:skills :piloting)) (skill-choices '(("Close Combat" . (:skills :close-combat))
("Ranged Combat" . (:skills :ranged-combat)) ("Heavy Machinery" . (:skills :heavy-machinery))
("Comtech" . (:skills :comtech)) ("Stamina" . (:skills :stamina))
("Observation" . (:skills :observation)) ("Mobility" . (:skills :mobility))
("Survival" . (:skills :survival)) ("Piloting" . (:skills :piloting))
("Command" . (:skills :command)) ("Ranged Combat" . (:skills :ranged-combat))
("Manipulation" . (:skills :manipulation)) ("Comtech" . (:skills :comtech))
("Medical Aid" . (:skills :medical-aid)))) ("Observation" . (:skills :observation))
(choice (completing-read "Stat: " choices nil t)) ("Survival" . (:skills :survival))
(path (cdr (assoc choice choices))) ("Command" . (:skills :command))
(category (car path)) ("Manipulation" . (:skills :manipulation))
(key (cadr path)) ("Medical Aid" . (:skills :medical-aid))))
(current-val (plist-get (plist-get alien-rpg-character category) key)) (all-names (append (mapcar #'car st-choices) (mapcar #'car attr-choices) (mapcar #'car skill-choices)))
(new-val (read-number (format "%s [%d]: " choice current-val) current-val))) (choice (completing-read "Editovat: " all-names nil t))
(plist-put (plist-get alien-rpg-character category) key new-val) (st-match (assoc choice st-choices))
(message "%s: %d -> %d" choice current-val new-val))) (attr-match (assoc choice attr-choices))
(skill-match (assoc choice skill-choices)))
(cond
;; State value (health, stress, resolve, story-points)
(st-match
(let* ((key (cdr st-match))
(current (or (plist-get alien-rpg-state key) 0))
(new-val (read-number (format "%s [%d] -> " choice current) current)))
(setq alien-rpg-state (plist-put alien-rpg-state key (max 0 new-val)))
(alien-rpg--autosave)
(message "%s: %d -> %d" choice current new-val)))
;; Attribute
(attr-match
(let* ((path (cdr attr-match))
(current (plist-get (plist-get alien-rpg-character (car path)) (cadr path)))
(new-val (read-number (format "%s [%d] -> " choice current) current)))
(plist-put (plist-get alien-rpg-character (car path)) (cadr path) new-val)
(message "%s: %d -> %d" choice current new-val)))
;; Skill
(skill-match
(let* ((path (cdr skill-match))
(current (plist-get (plist-get alien-rpg-character (car path)) (cadr path)))
(new-val (read-number (format "%s [%d] -> " choice current) current)))
(plist-put (plist-get alien-rpg-character (car path)) (cadr path) new-val)
(message "%s: %d -> %d" choice current new-val))))))
(defun alien-rpg-dice ()
"Kolik kostek hodit — vyber dovednost."
(interactive)
(let* ((choices (mapcar (lambda (sk)
(let* ((key (car sk))
(attr-key (cdr sk))
(name (cdr (assq key alien-rpg-skill-names)))
(attr-val (plist-get (plist-get alien-rpg-character :attributes) attr-key))
(skill-val (plist-get (plist-get alien-rpg-character :skills) key))
(total (+ attr-val skill-val))
(attr-abbr (cdr (assq attr-key alien-rpg-attr-abbrevs))))
(cons (format "%-18s %d (%s %d + %d)" name total attr-abbr attr-val skill-val)
(list name total attr-abbr attr-val skill-val))))
alien-rpg-skill-attributes))
(choice (completing-read "Hod na: " choices nil t))
(data (cdr (assoc choice choices)))
(name (nth 0 data))
(total (nth 1 data))
(stress (plist-get alien-rpg-state :stress)))
(message "%s: %d základ + %d stress = %d kostek celkem"
name total stress (+ total stress))))
(defun alien-rpg-add-injury (injury) (defun alien-rpg-add-injury (injury)
"Přidej zranění." "Přidej zranění."
@@ -1270,19 +1302,6 @@ Průlezy G<->H: G3<->H3, G4<->H4, G7<->H7, G8<->H8, G9<->H9
(alien-rpg--autosave) (alien-rpg--autosave)
(message "Stav: %s" cond-name))) (message "Stav: %s" cond-name)))
(defun alien-rpg-set-buddy (name)
"Nastav Buddy."
(interactive "sBuddy: ")
(setq alien-rpg-state (plist-put alien-rpg-state :buddy name))
(alien-rpg--autosave)
(message "Buddy: %s" name))
(defun alien-rpg-set-rival (name)
"Nastav Rivala."
(interactive "sRival: ")
(setq alien-rpg-state (plist-put alien-rpg-state :rival name))
(alien-rpg--autosave)
(message "Rival: %s" name))
(defun alien-rpg-add-note (note) (defun alien-rpg-add-note (note)
"Přidej poznámku." "Přidej poznámku."
@@ -1326,15 +1345,13 @@ Průlezy G<->H: G3<->H3, G4<->H4, G7<->H7, G8<->H8, G9<->H9
:desc "Dovednosti" "i" #'alien-rpg-skills :desc "Dovednosti" "i" #'alien-rpg-skills
:desc "Health" "h" #'alien-rpg-set-health :desc "Health" "h" #'alien-rpg-set-health
:desc "Stress" "S" #'alien-rpg-set-stress :desc "Stress" "S" #'alien-rpg-set-stress
:desc "Resolve" "r" #'alien-rpg-set-resolve :desc "Kostky" "r" #'alien-rpg-dice
:desc "Upravit stat" "e" #'alien-rpg-set-stat :desc "Editovat" "e" #'alien-rpg-set-stat
:desc "Zraneni" "j" #'alien-rpg-add-injury :desc "Zraneni" "j" #'alien-rpg-add-injury
:desc "Vybava" "g" #'alien-rpg-add-gear :desc "Vybava" "g" #'alien-rpg-add-gear
:desc "Zbran" "W" #'alien-rpg-add-weapon :desc "Zbran" "W" #'alien-rpg-add-weapon
:desc "Brneni" "a" #'alien-rpg-add-armor :desc "Brneni" "a" #'alien-rpg-add-armor
:desc "Stav/condition" "c" #'alien-rpg-add-condition :desc "Stav/condition" "c" #'alien-rpg-add-condition
:desc "Buddy" "b" #'alien-rpg-set-buddy
:desc "Rival" "R" #'alien-rpg-set-rival
:desc "Poznámka" "n" #'alien-rpg-add-note :desc "Poznámka" "n" #'alien-rpg-add-note
:desc "Poznamky" "N" #'alien-rpg-show-notes :desc "Poznamky" "N" #'alien-rpg-show-notes
:desc "Uložit" "q" #'alien-rpg-save-state :desc "Uložit" "q" #'alien-rpg-save-state