[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pacmacs cfa4437107 292/472: Implement eating terrified gho
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pacmacs cfa4437107 292/472: Implement eating terrified ghosts (#153) |
Date: |
Thu, 6 Jan 2022 21:59:33 -0500 (EST) |
branch: elpa/pacmacs
commit cfa44371072312167fc5a62167c3454b02d73cf8
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>
Implement eating terrified ghosts (#153)
---
pacmacs.el | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/pacmacs.el b/pacmacs.el
index 20483bceb2..ca0d16ae8f 100644
--- a/pacmacs.el
+++ b/pacmacs.el
@@ -253,6 +253,10 @@
(pacmacs--object-type-at-p pacmacs--object-board
row column 'ghost))
+(defun pacmacs--terrified-ghost-at-p (row column)
+ (pacmacs--object-type-at-p pacmacs--object-board
+ row column 'terrified-ghost))
+
(defun pacmacs-quit ()
(interactive)
(when (get-buffer pacmacs-buffer-name)
@@ -455,6 +459,16 @@
(when (equal (plist-get pill :type) 'big-pill)
(pacmacs--terrify-all-ghosts)))))
+(defun pacmacs--detect-terrified-ghost-collision ()
+ (plist-bind ((row :row)
+ (column :column))
+ pacmacs--player-state
+ (-when-let (terrified-ghost (pacmacs--terrified-ghost-at-p row column))
+ (setq pacmacs-score (+ pacmacs-score 200))
+ (setq pacmacs--terrified-ghosts (-remove (-partial #'eql terrified-ghost)
+ pacmacs--terrified-ghosts))
+ (pacmacs--remove-object terrified-ghost))))
+
(defun pacmacs--ghost-collision-p ()
(plist-bind ((row :row)
(column :column))
@@ -473,12 +487,14 @@
(if pacmacs--pills
(progn
(pacmacs--step-object pacmacs--player-state)
+ (pacmacs--detect-terrified-ghost-collision)
(if (pacmacs--ghost-collision-p)
(progn (pacmacs--step-back-object pacmacs--player-state)
(pacmacs--switch-to-death-state))
(pacmacs--detect-pill-collision)
(pacmacs--step-ghosts)
(pacmacs--step-terrified-ghosts)
+ (pacmacs--detect-terrified-ghost-collision)
(pacmacs--decrease-terrified-timers)
(when (pacmacs--ghost-collision-p)
(dolist (ghost pacmacs--ghosts)
- [nongnu] elpa/pacmacs 48dacba354 238/472: Refactor wall generator with bar functions (#131), (continued)
- [nongnu] elpa/pacmacs 48dacba354 238/472: Refactor wall generator with bar functions (#131), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 62bcd78913 243/472: Refactor possible ways functions (#131):, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs c2303269c0 249/472: Drop XBM support for empty cells (#141), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 0f403095f0 265/472: Update README after repo transferring (#140), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 169cd54064 269/472: Add UT for pacmacs--bit-list-to-integer, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 769414fae0 274/472: Extend pacmacs--normalize-wall-bits UT, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs d8a7998192 277/472: Extract `cask install` to separate step in README, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 614a98ccc7 278/472: Cleanup README, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs fa6eca1731 284/472: Introduce list for terrified ghost objects (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 701da0f16c 285/472: Rename direction switching callbacks (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs cfa4437107 292/472: Implement eating terrified ghosts (#153),
ELPA Syncer <=
- [nongnu] elpa/pacmacs ece3e76f30 296/472: Rename run-away-direction arguments (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 24ddb1b9ad 303/472: Merge pull request #160 from codingteam/terrified-ghost-state-153, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 5cb14f20fd 301/472: UT for pacmacs--replace-game-objects (#153), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 00b3223066 305/472: Handle ghost bling threshold (#159), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs d608708f15 311/472: UT for handle-ghost-blinking-threshold (#159), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 2297996e29 323/472: Smarter running away algorithm (#159), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 9b714e4678 321/472: Fix pacmacs--track-object UT (#159), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 16a6ac7e98 327/472: UT for pacmacs--render-track-board, ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 729de2de92 329/472: Remove big from the first level (#162), ELPA Syncer, 2022/01/06
- [nongnu] elpa/pacmacs 556098da2e 337/472: Put big pills level before w/o BP ones (#162), ELPA Syncer, 2022/01/06