プロジェクト

全般

プロフィール

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

Noppi, 2023/12/18 11:30

1 1 Noppi
[ホーム](https://redmine.noppi.jp) - [[Wiki|DQX]]
2
# [[鍛冶 ダメージ一覧]]
3
``` scheme
4
#!r6rs
5
#!chezscheme
6
7
(import (chezscheme))
8
9
(define (make-sequence n1 n2 inc)
10
  (let loop ([current n2]
11
             [lis '()])
12
    (if (< current n1)
13
      lis
14
      (loop (- current inc) (cons current lis)))))
15
16
(define base-normal (make-sequence 12 18 1))
17
(define temperature-list (make-sequence 50 2000 50))
18
(define temperature-list-neppu (make-sequence 150 2000 50))
19
20
(define (make-2bai n) (* n 2))
21
(define base-2bai (map make-2bai base-normal))
22
23
(define (make-3bai n) (* n 3))
24
(define base-3bai (map make-3bai base-normal))
25
26
(define (make-1.2 n) (exact (floor (+ (* n 1.2) 1))))
27
(define base-1.2 (map make-1.2 base-normal))
28
29
(define (make-tekagen n) (exact (ceiling (* n 0.5))))
30
(define base-tekagen (map make-tekagen base-normal))
31
32
(define (make-midare n) (exact (floor (+ (* n 0.8) 1))))
33
(define base-midare (map make-midare base-normal))
34
35
(define (make-neppu n) (exact (ceiling (* n 2.5))))
36
(define base-neppu (map make-neppu base-normal))
37
38
(define (make-damage-list temperature base-list)
39
  (map
40
    (lambda (n)
41
      (exact (ceiling (* n (+ 1 (* (- temperature 1000) 0.0005))))))
42
    base-list))
43
44
(define (make-damage-table temperature-list base-list)
45
  (let loop ([temperature-list temperature-list]
46
             [lis '()])
47
    (if (null? temperature-list)
48
      lis
49
      (let ([current-temperature (car temperature-list)])
50
        (loop
51
          (cdr temperature-list)
52
          (cons
53
            (list
54
              current-temperature
55
              (make-damage-list current-temperature base-list))
56
            lis))))))
57
58
(define normal-table (make-damage-table temperature-list base-normal))
59
(define 2bai-table (make-damage-table temperature-list base-2bai))
60
(define 3bai-table (make-damage-table temperature-list base-3bai))
61
(define 1.2-table (make-damage-table temperature-list base-1.2))
62
(define tekagen-table (make-damage-table temperature-list base-tekagen))
63
(define midare-table (make-damage-table temperature-list base-midare))
64
(define neppu-table (make-damage-table temperature-list-neppu base-neppu))
65
66
(define (display-table title table)
67
  (display title)
68
  (newline)
69
  (display "----------------------------------------\n")
70
  (let loop ([table table])
71
    (cond
72
      [(null? table)
73
       (display "----------------------------------------\n")
74
       (newline)]
75
      [else
76
        (let ([lis (car table)])
77
          (display (car lis))
78
          (display "℃")
79
          (display " : ")
80
          (display (cadr lis))
81
          (newline)
82
          (loop (cdr table)))])))
83
84
(display-table "たたく、ねらい打ち" normal-table)
85
(display-table "2倍打ち、超4連打ち" 2bai-table)
86
(display-table "3倍打ち" 3bai-table)
87
(display-table "上下打ち、4連打ち、ななめ打ち" 1.2-table)
88
(display-table "てかげん打ち" tekagen-table)
89
(display-table "みだれ打ち" midare-table)
90
(display-table "熱風おろし" neppu-table)
91
```