summaryrefslogtreecommitdiff
path: root/lisp/play
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/play')
-rw-r--r--lisp/play/bubbles.el36
-rw-r--r--lisp/play/dunnet.el78
-rw-r--r--lisp/play/gametree.el49
3 files changed, 84 insertions, 79 deletions
diff --git a/lisp/play/bubbles.el b/lisp/play/bubbles.el
index e7f5725a0f0..cae151f0b33 100644
--- a/lisp/play/bubbles.el
+++ b/lisp/play/bubbles.el
@@ -1005,20 +1005,17 @@ Set `bubbles--col-offset' and `bubbles--row-offset'."
(set-buffer-modified-p nil)
(erase-buffer)
(insert " ")
- (add-text-properties
- (point-min) (point) (list 'intangible t 'display
- (cons 'space
- (list :height bubbles--row-offset))))
+ (put-text-property (point-min) (point)
+ 'display
+ (cons 'space (list :height bubbles--row-offset)))
(insert "\n")
(let ((max-char (length (bubbles--colors))))
(dotimes (i (bubbles--grid-height))
(let ((p (point)))
(insert " ")
- (add-text-properties
- p (point) (list 'intangible t
- 'display (cons 'space
- (list :width
- bubbles--col-offset)))))
+ (put-text-property p (point)
+ 'display
+ (cons 'space (list :width bubbles--col-offset))))
(dotimes (j (bubbles--grid-width))
(let* ((index (random max-char))
(char (nth index bubbles-chars)))
@@ -1026,10 +1023,9 @@ Set `bubbles--col-offset' and `bubbles--row-offset'."
(add-text-properties (1- (point)) (point) (list 'index index))))
(insert "\n"))
(insert "\n ")
- (add-text-properties
- (1- (point)) (point) (list 'intangible t 'display
- (cons 'space
- (list :width bubbles--col-offset)))))
+ (put-text-property (1- (point)) (point)
+ 'display
+ (cons 'space (list :width bubbles--col-offset))))
(put-text-property (point-min) (point-max) 'pointer 'arrow))
(bubbles-mode)
(bubbles--reset-score)
@@ -1179,10 +1175,9 @@ Use optional parameter POS instead of point if given."
(delete-region (point) (point-max))
(insert (format "Selected: %4d\n" bubbles--neighborhood-score))
(insert " ")
- (add-text-properties (1- (point)) (point)
- (list 'intangible t 'display
- (cons 'space
- (list :width bubbles--col-offset))))
+ (put-text-property (1- (point)) (point)
+ 'display
+ (cons 'space (list :width bubbles--col-offset)))
(insert (format "Score: %4d" bubbles--score))
(put-text-property pos (point) 'status t))))
@@ -1200,10 +1195,9 @@ Use optional parameter POS instead of point if given."
(goto-char (point-max))
(let* ((inhibit-read-only t))
(insert "\n ")
- (add-text-properties (1- (point)) (point)
- (list 'intangible t 'display
- (cons 'space
- (list :width bubbles--col-offset))))
+ (put-text-property (1- (point)) (point)
+ 'display
+ (cons 'space (list :width bubbles--col-offset)))
(insert "Game Over!"))
;; save score
(gamegrid-add-score (format "bubbles-%s-%d-%d-%d-scores"
diff --git a/lisp/play/dunnet.el b/lisp/play/dunnet.el
index 0028b7258ae..3f4b8e8c5b8 100644
--- a/lisp/play/dunnet.el
+++ b/lisp/play/dunnet.el
@@ -100,7 +100,8 @@
(defun dun-describe-room (room)
(if (and (not (member (abs room) dun-light-rooms))
- (not (member obj-lamp dun-inventory)))
+ (not (member obj-lamp dun-inventory))
+ (not (member obj-lamp (nth dun-current-room dun-room-objects))))
(dun-mprincl "It is pitch dark. You are likely to be eaten by a grue.")
(dun-mprincl (cadr (nth (abs room) dun-rooms)))
(if (and (and (or (member room dun-visited)
@@ -615,7 +616,8 @@ just try dropping it.")
(defun dun-move (dir)
(if (and (not (member dun-current-room dun-light-rooms))
- (not (member obj-lamp dun-inventory)))
+ (not (member obj-lamp dun-inventory))
+ (not (member obj-lamp (nth dun-current-room dun-room-objects))))
(progn
(dun-mprinc
"You trip over a grue and fall into a pit and break every bone in your
@@ -896,7 +898,7 @@ to swim.")
(defun dun-help (args)
(dun-mprincl
-"Welcome to dunnet (2.01), by Ron Schnell (ronnie@driver-aces.com).
+"Welcome to dunnet (2.02), by Ron Schnell (ronnie@driver-aces.com - @RonnieSchnell).
Here is some useful information (read carefully because there are one
or more clues in here):
- If you have a key that can open a door, you do not need to explicitly
@@ -1385,8 +1387,8 @@ for a moment, then straighten yourself up.
(setq dungeon-mode 'dungeon)
(setq dun-unix-verbs '((ls . dun-ls) (ftp . dun-ftp) (echo . dun-echo)
(exit . dun-uexit) (cd . dun-cd) (pwd . dun-pwd)
- (rlogin . dun-rlogin) (uncompress . dun-uncompress)
- (cat . dun-cat)))
+ (rlogin . dun-rlogin) (ssh . dun-rlogin)
+ (uncompress . dun-uncompress) (cat . dun-cat)))
(setq dun-dos-verbs '((dir . dun-dos-dir) (type . dun-dos-type)
(exit . dun-dos-exit) (command . dun-dos-spawn)
@@ -2537,25 +2539,31 @@ treasures for points?" "4" "four")
(dun-mprincl "Incorrect.")))
(let (varname epoint afterq i value)
- (setq varname (substring line 0 esign))
- (if (not (setq epoint (string-match ")" line)))
- (if (string= (substring line (1+ esign) (+ esign 2))
- "\"")
- (progn
- (setq afterq (substring line (+ esign 2)))
- (setq epoint (+
- (string-match "\"" afterq)
- (+ esign 3))))
-
- (if (not (setq epoint (string-match " " line)))
- (setq epoint (length line))))
- (setq epoint (1+ epoint))
- (while (and
- (not (= epoint (length line)))
- (setq i (string-match ")" (substring line epoint))))
- (setq epoint (+ epoint i 1))))
- (setq value (substring line (1+ esign) epoint))
- (dun-eval varname value))))
+ (setq varname (replace-regexp-in-string " " "" (substring line 0 esign)))
+
+ (if (or (= (length varname) 0) (< (- (length line) esign) 2))
+ (progn
+ (dun-mprinc line)
+ (dun-mprincl " : not found."))
+
+ (if (not (setq epoint (string-match ")" line)))
+ (if (string= (substring line (1+ esign) (+ esign 2))
+ "\"")
+ (progn
+ (setq afterq (substring line (+ esign 2)))
+ (setq epoint (+
+ (string-match "\"" afterq)
+ (+ esign 3))))
+
+ (if (not (setq epoint (string-match " " line)))
+ (setq epoint (length line))))
+ (setq epoint (1+ epoint))
+ (while (and
+ (not (= epoint (length line)))
+ (setq i (string-match ")" (substring line epoint))))
+ (setq epoint (+ epoint i 1))))
+ (setq value (substring line (1+ esign) epoint))
+ (dun-eval varname value)))))
(defun dun-eval (varname value)
(let (eval-error)
@@ -2739,16 +2747,20 @@ drwxr-xr-x 3 root staff 2048 Jan 1 1970 ..")
(if dun-batch-mode
(dun-mprincl "Login failed.")
(dun-mprincl "\nLogin failed."))
- (if dun-batch-mode
- (dun-mprincl
- "Guest login okay, user access restrictions apply.")
- (dun-mprincl
- "\nGuest login okay, user access restrictions apply."))
- (dun-ftp-commands)
- (setq newlist
+ (if (= (length ident) 0)
+ (if dun-batch-mode
+ (dun-mprincl "Password is required.")
+ (dun-mprincl "\nPassword is required."))
+ (if dun-batch-mode
+ (dun-mprincl
+ "Guest login okay, user access restrictions apply.")
+ (dun-mprincl
+ "\nGuest login okay, user access restrictions apply."))
+ (dun-ftp-commands)
+ (setq newlist
'("What password did you use during anonymous ftp to gamma?"))
- (setq newlist (append newlist (list ident)))
- (rplaca (nthcdr 1 dun-endgame-questions) newlist)))))))))
+ (setq newlist (append newlist (list ident)))
+ (rplaca (nthcdr 1 dun-endgame-questions) newlist))))))))))
(defun dun-ftp-commands ()
(setq dun-exitf nil)
diff --git a/lisp/play/gametree.el b/lisp/play/gametree.el
index a2a93730cf0..b71eb562f08 100644
--- a/lisp/play/gametree.el
+++ b/lisp/play/gametree.el
@@ -590,31 +590,30 @@ shogi, etc.) players, it is a slightly modified version of Outline mode.
(add-hook 'write-contents-hooks 'gametree-save-and-hack-layout))
;;;; Goodies for mousing users
-(and (fboundp 'track-mouse)
- (defun gametree-mouse-break-line-here (event)
- (interactive "e")
- (mouse-set-point event)
- (gametree-break-line-here))
- (defun gametree-mouse-show-children-and-entry (event)
- (interactive "e")
- (mouse-set-point event)
- (gametree-show-children-and-entry))
- (defun gametree-mouse-show-subtree (event)
- (interactive "e")
- (mouse-set-point event)
- (show-subtree))
- (defun gametree-mouse-hide-subtree (event)
- (interactive "e")
- (mouse-set-point event)
- (hide-subtree))
- (define-key gametree-mode-map [M-down-mouse-2 M-mouse-2]
- 'gametree-mouse-break-line-here)
- (define-key gametree-mode-map [S-down-mouse-1 S-mouse-1]
- 'gametree-mouse-show-children-and-entry)
- (define-key gametree-mode-map [S-down-mouse-2 S-mouse-2]
- 'gametree-mouse-show-subtree)
- (define-key gametree-mode-map [S-down-mouse-3 S-mouse-3]
- 'gametree-mouse-hide-subtree))
+(defun gametree-mouse-break-line-here (event)
+ (interactive "e")
+ (mouse-set-point event)
+ (gametree-break-line-here))
+(defun gametree-mouse-show-children-and-entry (event)
+ (interactive "e")
+ (mouse-set-point event)
+ (gametree-show-children-and-entry))
+(defun gametree-mouse-show-subtree (event)
+ (interactive "e")
+ (mouse-set-point event)
+ (show-subtree))
+(defun gametree-mouse-hide-subtree (event)
+ (interactive "e")
+ (mouse-set-point event)
+ (hide-subtree))
+(define-key gametree-mode-map [M-down-mouse-2 M-mouse-2]
+ 'gametree-mouse-break-line-here)
+(define-key gametree-mode-map [S-down-mouse-1 S-mouse-1]
+ 'gametree-mouse-show-children-and-entry)
+(define-key gametree-mode-map [S-down-mouse-2 S-mouse-2]
+ 'gametree-mouse-show-subtree)
+(define-key gametree-mode-map [S-down-mouse-3 S-mouse-3]
+ 'gametree-mouse-hide-subtree)
(provide 'gametree)