プロジェクト

全般

プロフィール

操作

鍛冶 ダメージ一覧 » 履歴 » リビジョン 1

リビジョン 1/2 | 次 »
Noppi, 2023/12/18 11:30


ホーム - DQX

鍛冶 ダメージ一覧

#!r6rs
#!chezscheme

(import (chezscheme))

(define (make-sequence n1 n2 inc)
  (let loop ([current n2]
             [lis '()])
    (if (< current n1)
      lis
      (loop (- current inc) (cons current lis)))))

(define base-normal (make-sequence 12 18 1))
(define temperature-list (make-sequence 50 2000 50))
(define temperature-list-neppu (make-sequence 150 2000 50))

(define (make-2bai n) (* n 2))
(define base-2bai (map make-2bai base-normal))

(define (make-3bai n) (* n 3))
(define base-3bai (map make-3bai base-normal))

(define (make-1.2 n) (exact (floor (+ (* n 1.2) 1))))
(define base-1.2 (map make-1.2 base-normal))

(define (make-tekagen n) (exact (ceiling (* n 0.5))))
(define base-tekagen (map make-tekagen base-normal))

(define (make-midare n) (exact (floor (+ (* n 0.8) 1))))
(define base-midare (map make-midare base-normal))

(define (make-neppu n) (exact (ceiling (* n 2.5))))
(define base-neppu (map make-neppu base-normal))

(define (make-damage-list temperature base-list)
  (map
    (lambda (n)
      (exact (ceiling (* n (+ 1 (* (- temperature 1000) 0.0005))))))
    base-list))

(define (make-damage-table temperature-list base-list)
  (let loop ([temperature-list temperature-list]
             [lis '()])
    (if (null? temperature-list)
      lis
      (let ([current-temperature (car temperature-list)])
        (loop
          (cdr temperature-list)
          (cons
            (list
              current-temperature
              (make-damage-list current-temperature base-list))
            lis))))))

(define normal-table (make-damage-table temperature-list base-normal))
(define 2bai-table (make-damage-table temperature-list base-2bai))
(define 3bai-table (make-damage-table temperature-list base-3bai))
(define 1.2-table (make-damage-table temperature-list base-1.2))
(define tekagen-table (make-damage-table temperature-list base-tekagen))
(define midare-table (make-damage-table temperature-list base-midare))
(define neppu-table (make-damage-table temperature-list-neppu base-neppu))

(define (display-table title table)
  (display title)
  (newline)
  (display "----------------------------------------\n")
  (let loop ([table table])
    (cond
      [(null? table)
       (display "----------------------------------------\n")
       (newline)]
      [else
        (let ([lis (car table)])
          (display (car lis))
          (display "℃")
          (display " : ")
          (display (cadr lis))
          (newline)
          (loop (cdr table)))])))

(display-table "たたく、ねらい打ち" normal-table)
(display-table "2倍打ち、超4連打ち" 2bai-table)
(display-table "3倍打ち" 3bai-table)
(display-table "上下打ち、4連打ち、ななめ打ち" 1.2-table)
(display-table "てかげん打ち" tekagen-table)
(display-table "みだれ打ち" midare-table)
(display-table "熱風おろし" neppu-table)

Noppi2023/12/18に更新 · 1件の履歴