summaryrefslogtreecommitdiff
path: root/src/gizmo/wasp-animism.el
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2025-05-01 17:06:41 -0400
committerLLLL Colonq <llll@colonq>2025-05-01 17:06:41 -0400
commitfb01362a9dd816fc0d0e50052ab4764dd30e46f3 (patch)
treed581df21e161a0483d8b02ea4519debb4501a4a7 /src/gizmo/wasp-animism.el
parentb21ecce6645fc17c520b722de3d96e550c77c490 (diff)
You know we love updating with a horrendous commit message
Diffstat (limited to 'src/gizmo/wasp-animism.el')
-rw-r--r--src/gizmo/wasp-animism.el57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/gizmo/wasp-animism.el b/src/gizmo/wasp-animism.el
new file mode 100644
index 00000000..80c6f70e
--- /dev/null
+++ b/src/gizmo/wasp-animism.el
@@ -0,0 +1,57 @@
+;;; wasp-animism --- Superterranean Animism Overlay -*- lexical-binding: t; -*-
+;;; Commentary:
+;;; Code:
+
+(require 'wasp-utils)
+(require 'wasp-bus)
+(require 'wasp-prod)
+
+(add-to-list 'load-path (f-canonical "~/src/animism/"))
+(require 'bulletml)
+
+;; src,Xway,fire^쾠㘽쾷ㅗ껋㾨먝乲뛏屚w㮇㸩멽ꝼ쓋♫릫m떫쓏䓳⩺䮻1㨧퉝ƭ쓐ǥᓌ㒵ᒄ먽乳俴㢈쿗峫ฐꙢ왽욍투ㅖ㨧슝呑㟪䁓Ɂy䏧呠3먫슎呒3⧘ɍy욋ᕈ00먫⇳
+;; this one is broken fix it -ellg, probably
+
+(defconst w/overlay-spellcard-names
+ '("Joel" "Pemis" "JoelTeachingHisSonJolHowToSpinWhileWideBorisPassesBy" "bugSegz"
+ "widepeepoMASTURBATION77769420GANGSHITNOMOREFORTNITE19DOLLERFORTNITECARD"
+ "Machine Made Of Fire, Heart Made Of Doves"
+ "Dream Seal" "Evil-Sealing Circle" "Dream Seal -Spread-" "Dream Seal -Concentrate-"
+ "Duplex Barrier" "Dream Orb" "Omnidirectional Oni-Binding Circle" "Yin-Yang Treasured Orb"
+ "Yin-Yang Kishin Orb" "Dream Orb String" "Yin-Yang Scattering" "Exorcising Border"
+ "Yin-Yang King Piece" "Illusionary Moon" "Flying Mysterious Shrine Maiden"
+ "Dream Seal -Blink-" "Great Duplex Barrier" "Dream Seal -Worn-" "Dream Seal -Marred-"
+ "Dream Seal -The Point Of The Mask-"
+ ))
+
+(defvar w/overlay-barrage-active nil)
+(defvar w/overlay-last-cursor nil)
+(defun w/overlay-update-cursor ()
+ "Inform the overlay about the current cursor position."
+ (when (and w/overlay-barrage-active (process-live-p (get-process w/bus-process)))
+ (when-let ((pos (window-absolute-pixel-position)))
+ (when (not (equal pos w/overlay-last-cursor))
+ (setf w/overlay-last-cursor pos)
+ (w/pub '(overlay cursor) (list (- (car pos) 1920) (cdr pos)))))))
+(add-hook 'post-command-hook #'w/overlay-update-cursor)
+
+(defun w/overlay-start-barrage (bml)
+ "Start a barrage on the overlay using the BulletML source string BML."
+ (w/pub '(overlay barrage start) (list (w/encode-string bml))))
+
+(defun w/overlay-decode-shorthand-bml (s k)
+ "Decode the shorthand BulletML string S.
+Pass the resulting BulletML XML string to K."
+ ;; (w/write-log s)
+ (w/prod-get-raw
+ (format "/api/yamame?input=%s" (url-encode-url s))
+ (lambda (data)
+ (if-let* ((bml (bml/parse-string data))
+ (b (bml/initialize bml))
+ ((bml/barrage-toplevel b)))
+ (progn
+ (funcall k data))
+ (w/write-chat-event "That spell card is too powerful... ")))))
+
+(provide 'wasp-animism)
+;;; wasp-animism.el ends here