diff --git a/alien-rpg.el b/alien-rpg.el index 3647c4e..ddaef0d 100644 --- a/alien-rpg.el +++ b/alien-rpg.el @@ -589,17 +589,17 @@ ;; ==================================================================== (defvar alien-rpg-character - '(:name "prof. Hector Navarre, Ph.D." - :career "Biochemický inženýr" + '(:name "prof. Héctor Navarre" + :career "biochemický inženýr" :age 74 :attributes (:strength 3 :agility 4 :wits 3 :empathy 4) :skills (:close-combat 2 :heavy-machinery 2 :stamina 0 :mobility 0 :piloting 0 :ranged-combat 3 :comtech 0 :observation 2 :survival 0 :command 0 :manipulation 3 :medical-aid 0) - :talent "Analyza: Observation → info o organismu/předmětu" - :gear ("Svítilna" "CBRN detektor" "Lokátor PDT") - :signature-item "Karta") + :talent "Analýza: Hod na OBSERVATION, za každý úspěch informace o mimozemském organismu nebo předmětu." + :gear ("svítilna" "CBRN detektor (viry, toxiny, radiace)" "lokátor PDT") + :signature-item "karta") "Statická data postavy.") (defvar alien-rpg-skill-attributes @@ -629,10 +629,12 @@ (defvar alien-rpg-state '(:health 4 :stress 0 + :resolve 4 :current-room "B-centralni-sachta" :weapons () :armor nil :extra-gear () + :tiny-items () :injuries () :conditions () :xp 0 @@ -749,6 +751,10 @@ (setq alien-rpg-state (plist-put alien-rpg-state :conditions nil))) (unless (plist-member alien-rpg-state :armor) (setq alien-rpg-state (plist-put alien-rpg-state :armor nil))) + (unless (plist-member alien-rpg-state :resolve) + (setq alien-rpg-state (plist-put alien-rpg-state :resolve 4))) + (unless (plist-member alien-rpg-state :tiny-items) + (setq alien-rpg-state (plist-put alien-rpg-state :tiny-items nil))) (message "Načteno: %s" file)))) (defun alien-rpg--autosave () @@ -1055,8 +1061,9 @@ Průlezy G<->H: G3<->H3, G4<->H4, G7<->H7, G8<->H8, G9<->H9 (insert (format "Str %s Agi %s Wit %s Emp %s\n" (plist-get attrs :strength) (plist-get attrs :agility) (plist-get attrs :wits) (plist-get attrs :empathy))) - ;; Health / Stress - (insert (format "Health: %d/4 | Stress: %d\n" health stress)) + ;; Health / Stress / Resolve + (insert (format "Health: %d/4 | Stress: %d | Resolve: %d\n" + health stress (or (plist-get st :resolve) 4))) ;; Dovednosti (jen nenulove) (let ((skills-str (mapconcat @@ -1174,6 +1181,43 @@ Průlezy G<->H: G3<->H3, G4<->H4, G7<->H7, G8<->H8, G9<->H9 (alien-rpg--autosave) (message "Stress: %d (%s%d)" new-val (if (>= n 0) "+" "") n))) +(defun alien-rpg-set-resolve (n) + "Změň Resolve (+/-N)." + (interactive "nResolve (+/-N): ") + (let* ((current (or (plist-get alien-rpg-state :resolve) 4)) + (new-val (max 0 (+ current n)))) + (setq alien-rpg-state (plist-put alien-rpg-state :resolve new-val)) + (alien-rpg--autosave) + (message "Resolve: %d (%s%d)" new-val (if (>= n 0) "+" "") n))) + +(defun alien-rpg-set-stat () + "Změň atribut nebo dovednost." + (interactive) + (let* ((choices '(("Strength" . (:attributes :strength)) + ("Agility" . (:attributes :agility)) + ("Wits" . (:attributes :wits)) + ("Empathy" . (:attributes :empathy)) + ("Close Combat" . (:skills :close-combat)) + ("Heavy Machinery" . (:skills :heavy-machinery)) + ("Stamina" . (:skills :stamina)) + ("Mobility" . (:skills :mobility)) + ("Piloting" . (:skills :piloting)) + ("Ranged Combat" . (:skills :ranged-combat)) + ("Comtech" . (:skills :comtech)) + ("Observation" . (:skills :observation)) + ("Survival" . (:skills :survival)) + ("Command" . (:skills :command)) + ("Manipulation" . (:skills :manipulation)) + ("Medical Aid" . (:skills :medical-aid)))) + (choice (completing-read "Stat: " choices nil t)) + (path (cdr (assoc choice choices))) + (category (car path)) + (key (cadr path)) + (current-val (plist-get (plist-get alien-rpg-character category) key)) + (new-val (read-number (format "%s [%d]: " choice current-val) current-val))) + (plist-put (plist-get alien-rpg-character category) key new-val) + (message "%s: %d -> %d" choice current-val new-val))) + (defun alien-rpg-add-injury (injury) "Přidej zranění." (interactive "sZranění: ") @@ -1282,6 +1326,8 @@ Průlezy G<->H: G3<->H3, G4<->H4, G7<->H7, G8<->H8, G9<->H9 :desc "Dovednosti" "i" #'alien-rpg-skills :desc "Health" "h" #'alien-rpg-set-health :desc "Stress" "S" #'alien-rpg-set-stress + :desc "Resolve" "r" #'alien-rpg-set-resolve + :desc "Upravit stat" "e" #'alien-rpg-set-stat :desc "Zraneni" "j" #'alien-rpg-add-injury :desc "Vybava" "g" #'alien-rpg-add-gear :desc "Zbran" "W" #'alien-rpg-add-weapon