aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Pouar <pouar@pouar.net>2020-10-12 22:11:54 -0500
committerGravatar Pouar <pouar@pouar.net>2020-10-12 23:18:57 -0500
commit1b185479fcfaa0a5e0656661bf14735537a7e02e (patch)
treec5e9b6249e19b9dd6b4ceef1ed53a776ddeb48bb
parentthis seems to be clearer in programmer intent (diff)
better docstrings
-rw-r--r--core/libexec/generic-functions.lisp10
-rw-r--r--core/libexec/init.lisp54
2 files changed, 37 insertions, 27 deletions
diff --git a/core/libexec/generic-functions.lisp b/core/libexec/generic-functions.lisp
index b1fdcb4..a2a758f 100644
--- a/core/libexec/generic-functions.lisp
+++ b/core/libexec/generic-functions.lisp
@@ -222,7 +222,15 @@
(t
(attack target self nil))))))))
(defgeneric condition-script (user condition battle)
- (:documentation #.(f:fmt nil "Function that runs at the beginning of each turn @var{USER} is the character who has the @var{CONDITION}. @var{CONDITION} is a " (ref status-condition :class) " @var{BATTLE} is whether the condition happens in battle or not"))
+ (:documentation
+ #.(f:fmt nil "Function that runs at the beginning of each turn" #\Newline #\Newline
+ "@var{USER} is the character who has the @var{CONDITION}." #\Newline #\Newline
+ "@var{CONDITION} is a " (ref status-condition :class) #\Newline #\Newline
+ " @var{BATTLE} is whether the condition happens in battle or not" #\Newline #\Newline
+ "Dumb limitation of the API: Game assumes that characters don't faint outside of battle" #\Newline #\Newline
+ "This is because most of the dialog doesn't make sense when the character is fainted," #\Newline #\Newline
+ "such as talking, walking around, and doing a potty dance and acting embarrassed when having an accident." #\Newline #\Newline
+ "Fixing this made the code way too complicated."))
(:method ((user base-character) (condition status-condition) battle)))
(defgeneric toggle-onesie% (onesie))
(defgeneric toggle-onesie (onesie clothes user))
diff --git a/core/libexec/init.lisp b/core/libexec/init.lisp
index 94f9074..e9b7c35 100644
--- a/core/libexec/init.lisp
+++ b/core/libexec/init.lisp
@@ -4,34 +4,36 @@
(defconstant +stat-view+ (make-instance 'stat-view))
(in-package :yadfa)
(s:eval-always
- (defmacro ref (symbol type)
- `(if (asdf:component-loaded-p "yadfa/docs")
- (format nil "@ref{~a,@code{~a} in @code{~a},@code{~a}∶@code{~a}}"
- (uiop:symbol-call '#:net.didierverna.declt '#:escape-anchor
- (uiop:symbol-call '#:net.didierverna.declt '#:anchor-name
- (uiop:symbol-call '#:net.didierverna.declt '
- ,(make-symbol (string-upcase (format nil "make-~a-definition" type)))
- :symbol ',symbol)))
- (uiop:symbol-call '#:net.didierverna.declt '#:escape ',symbol)
- (uiop:symbol-call '#:net.didierverna.declt '#:escape ,(package-name (symbol-package symbol)))
- (uiop:symbol-call '#:net.didierverna.declt '#:escape ,(package-name (symbol-package symbol)))
- (uiop:symbol-call '#:net.didierverna.declt '#:escape ',symbol))
+ (defmacro ref (symbol type)
+ (if (asdf:component-loaded-p "yadfa/docs")
+ (let* ((package-name (uiop:symbol-call '#:net.didierverna.declt '#:escape (package-name (symbol-package symbol))))
+ (symbol-name (uiop:symbol-call '#:net.didierverna.declt '#:escape symbol))
+ (external (if (eq (nth-value 1 symbol) :external)
+ 2 1)))
+ (f:fmt nil "@ref{"
+ (uiop:symbol-call '#:net.didierverna.declt '#:escape-anchor
+ (uiop:symbol-call '#:net.didierverna.declt '#:anchor-name
+ (uiop:symbol-call '#:net.didierverna.declt
+ (make-symbol (string-upcase (format nil "make-~a-definition" type)))
+ :symbol symbol)))
+ ",@code{" package-name (:times "∶" external) symbol-name "},@code{" package-name (:times ":" external) symbol-name "}}"))
(let ((*package* (find-package :cl)))
- (format nil "~s" ',symbol))))
- (defmacro xref (symbol type)
- `(if (asdf:component-loaded-p "yadfa/docs")
- (format nil "@xref{~a,@code{~a} in @code{~a},@code{~a}∶@code{~a}}"
- (uiop:symbol-call '#:net.didierverna.declt '#:escape-anchor
- (uiop:symbol-call '#:net.didierverna.declt '#:anchor-name
- (uiop:symbol-call '#:net.didierverna.declt
- ',(make-symbol (string-upcase (format nil "make-~a-definition" type)))
- :symbol ',symbol)))
- (uiop:symbol-call '#:net.didierverna.declt '#:escape ',symbol)
- (uiop:symbol-call '#:net.didierverna.declt '#:escape ,(package-name (symbol-package symbol)))
- (uiop:symbol-call '#:net.didierverna.declt '#:escape ,(package-name (symbol-package symbol)))
- (uiop:symbol-call '#:net.didierverna.declt '#:escape ',symbol))
+ (format nil "~s" symbol))))
+ (defmacro xref (symbol type)
+ (if (asdf:component-loaded-p "yadfa/docs")
+ (let* ((package-name (uiop:symbol-call '#:net.didierverna.declt '#:escape (package-name (symbol-package symbol))))
+ (symbol-name (uiop:symbol-call '#:net.didierverna.declt '#:escape symbol))
+ (external (if (eq (nth-value 1 symbol) :external)
+ 2 1)))
+ (f:fmt nil "@xref{"
+ (uiop:symbol-call '#:net.didierverna.declt '#:escape-anchor
+ (uiop:symbol-call '#:net.didierverna.declt '#:anchor-name
+ (uiop:symbol-call '#:net.didierverna.declt
+ (make-symbol (string-upcase (format nil "make-~a-definition" type)))
+ :symbol symbol)))
+ ",@code{" package-name (:times "∶" external) symbol-name "},@code{" package-name (:times ":" external) symbol-name "}}"))
(let ((*package* (find-package :cl)))
- (format nil "See ~s" ',symbol)))))
+ (format nil "See ~s" symbol)))))
(g:define-global-var *events* (make-hash-table :test #'equal :size 100))
(g:define-global-var yadfa-clim::*records* ())
(g:define-global-var *battle* nil)