diff --git a/defns/monsters.rkt b/defns/monsters.rkt index 406dca5..20191db 100644 --- a/defns/monsters.rkt +++ b/defns/monsters.rkt @@ -222,6 +222,16 @@ (list _ prefix suffix)) (list prefix (scale-icon (icons:range)) suffix)] [x (list x)])) + (define (push-pull x) + (match x + [(regexp #px"^(.*)((?i:push)|(?i:pull))(.*)$" + (list _ prefix push-pull suffix)) + (list prefix + (match (string-downcase push-pull) + ["push" (icons:push)] + ["pull" (icons:pull)]) + suffix)] + [x (list x)])) (define replacements (list bulleted attack @@ -234,7 +244,8 @@ consume-element consume-wild target - range)) + range + push-pull)) (for/fold ([result (list (regexp-replaces ability-text replacements))]) ([pict-replacement (in-list pict-replacements)]) (append-map (only-on-text pict-replacement) result))) diff --git a/icons.rkt b/icons.rkt index 3e2be0d..534f476 100644 --- a/icons.rkt +++ b/icons.rkt @@ -3,7 +3,9 @@ (provide (contract-out [target (-> pict?)] - [range (-> pict?)])) + [range (-> pict?)] + [push (-> pict?)] + [pull (-> pict?)])) (require pict pict/color @@ -34,8 +36,26 @@ (inset 0 0 -10 0) highlight))) +(define (push) + (define (outlined-arrowhead size) + (cc-superimpose (arrowhead size 0) + (white (scale (arrowhead size 0) 6/10)))) + (define arrows + (map (flow (~> outlined-arrowhead (rotate (* 1/2 pi)))) + (list 20 10 5))) + + (~> (arrows) sep + (vc-append -2 __) + (scale 1 3/4) + highlight)) + +(define (pull) + (rotate (push) pi)) + (module+ main (require (only-in racket/gui)) (for ([p (list target - range)]) + range + push + pull)]) (show-pict (p)))) diff --git a/scribblings/icons.scrbl b/scribblings/icons.scrbl index 27c8af1..a9fb36c 100644 --- a/scribblings/icons.scrbl +++ b/scribblings/icons.scrbl @@ -9,7 +9,7 @@ This module provides various icons that are spliced into ability card texts. All replacements are case insensitive; any numbers or other accompanying text -are preserved. +are preserved. The signifier @racket[_N] denotes where a number is expected. @(require syntax/parse/define) @@ -18,3 +18,5 @@ are preserved. @deficon[target "Target N" "Target all" "+N target(s)"] @deficon[range "Range N"] +@deficon[push "Push N"] +@deficon[pull "Pull N"]