操作
鍛冶 ダメージ範囲 » 履歴 » リビジョン 1
リビジョン 1/2
| 次 »
Noppi, 2023/12/18 11:36
鍛冶 ダメージ範囲¶
#!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 (make-damage-range damage-table)
(let loop ([damage-table damage-table]
[table '()])
(if (null? damage-table)
(reverse table)
(let ([current-line (car damage-table)])
(let ([current-damage-list (cadr current-line)])
(loop
(cdr damage-table)
(cons
(list
(car current-line)
(list
(apply min current-damage-list)
(apply max current-damage-list)))
table)))))))
(define normal-range (make-damage-range normal-table))
(define 2bai-range (make-damage-range 2bai-table))
(define 3bai-range (make-damage-range 3bai-table))
(define 1.2-range (make-damage-range 1.2-table))
(define tekagen-range (make-damage-range tekagen-table))
(define midare-range (make-damage-range midare-table))
(define neppu-range (make-damage-range neppu-table))
(define (display-range title range)
(display title)
(newline)
(display "----------------------------------------\n")
(let loop ([range range])
(cond
[(null? range)
(display "----------------------------------------\n")
(newline)]
[else
(let ([line (car range)])
(display (car line))
(display "℃")
(display " : ")
(let ([current-range-list (cadr line)])
(display (car current-range-list))
(display " ~ ")
(display (cadr current-range-list))
(newline)
(loop (cdr range))))])))
(display-range "たたく、ねらい打ち" normal-range)
(display-range "2倍打ち、超4連打ち" 2bai-range)
(display-range "3倍打ち" 3bai-range)
(display-range "上下打ち、4連打ち、ななめ打ち" 1.2-range)
(display-range "てかげん打ち" tekagen-range)
(display-range "みだれ打ち" midare-range)
(display-range "熱風おろし" neppu-range)
Noppi が2023/12/18に更新 · 1件の履歴