Skip to content
pookleblinky edited this page Feb 6, 2018 · 2 revisions

Example module:

#lang racket

;; Roll a saving throw to determine whether to respond to an argument, and how.

(require "../machinery/skillcheck.rkt"
         "../stats.rkt")

(provide engage cussout)

(define parry? (skillcheck fucks))

(define cuss? (skillcheck profanity))

(define (engage)
  (if (equal? #t parry?) "Engage" "Ignore"))

(define (cussout)
  (if (equal? #t (and parry? cuss?))
    "Cuss em out" "Ignore/mute"))

(cussout)

Skillchecks end in ?'s. Main method should preferably do little other than return a result based on a skillcheck, leave the displaying elsewhere. Invoking the main method is ok if the script is to be used directly, but preferably is left for a collating script to do.

Clone this wiki locally