summaryrefslogtreecommitdiff
blob: 15109a3af832fe9c15cf942e22dc7bc3d739d7ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
module Battle.Lang.English exposing (..)

-- Elm -------------------------------------------------------------------------
import Html
import Html.Attributes
import Html.Events

-- Battle ----------------------------------------------------------------------
import Battle.Struct.Attributes
import Battle.Struct.Statistics

-- Local Module ----------------------------------------------------------------
import Struct.Event
import Struct.HelpRequest

--------------------------------------------------------------------------------
-- TYPES -----------------------------------------------------------------------
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
-- LOCAL -----------------------------------------------------------------------
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
-- EXPORTED --------------------------------------------------------------------
--------------------------------------------------------------------------------

-- Nouns -----------------------------------------------------------------------
---- Attributes ----------------------------------------------------------------
constitution : String
constitution = "Constitution"

dexterity : String
dexterity = "Dexterity"

intelligence : String
intelligence = "Intelligence"

mind : String
mind = "Mind"

speed : String
speed = "Speed"

strength : String
strength = "Strength"

---- Statistics ----------------------------------------------------------------
max_health : String
max_health = "Max. Health"

movement_points : String
movement_points = "Movement Points"

dodges : String
dodges = "Dodge Chance"

parries : String
parries = "Parry Chance"

accuracy : String
accuracy = "Accuracy"

double_hits : String
double_hits = "Double Hit Chance"

critical_hits : String
critical_hits = "Critical Hit Chance"

-- Help ------------------------------------------------------------------------
---- Attributes ----------------------------------------------------------------
constitution_help : (Html.Html Struct.Event.Type)
constitution_help =
   (Html.div
      [
      ]
      [
         (Html.text "Constitution influences "),
         (get_stats_reference_html Battle.Struct.Statistics.MaxHealth),
         (Html.text " (75%), and "),
         (get_stats_reference_html Battle.Struct.Statistics.MovementPoints),
         (Html.text " (~33%).")
      ]
   )

dexterity_help : (Html.Html Struct.Event.Type)
dexterity_help =
   (Html.div
      [
      ]
      [
         (Html.text "Dexterity influences "),
         (get_stats_reference_html Battle.Struct.Statistics.Accuracy),
         (Html.text " (100%), "),
         (get_stats_reference_html Battle.Struct.Statistics.Dodges),
         (Html.text " (~33%), and "),
         (get_stats_reference_html Battle.Struct.Statistics.Parries),
         (Html.text " (25%).")
      ]
   )

intelligence_help : (Html.Html Struct.Event.Type)
intelligence_help =
   (Html.div
      [
      ]
      [
         (Html.text "Intelligence influences "),
         (get_stats_reference_html Battle.Struct.Statistics.CriticalHits),
         (Html.text " (100%), and "),
         (get_stats_reference_html Battle.Struct.Statistics.Parries),
         (Html.text " (25%).")
      ]
   )

mind_help : (Html.Html Struct.Event.Type)
mind_help =
   (Html.div
      [
      ]
      [
         (Html.text "Mind influences "),
         (get_stats_reference_html Battle.Struct.Statistics.DoubleHits),
         (Html.text " (50%), "),
         (get_stats_reference_html Battle.Struct.Statistics.Dodges),
         (Html.text " (~33%), "),
         (get_stats_reference_html Battle.Struct.Statistics.MaxHealth),
         (Html.text " (25%), and "),
         (get_stats_reference_html Battle.Struct.Statistics.MovementPoints),
         (Html.text " (~16%).")
      ]
   )

speed_help : (Html.Html Struct.Event.Type)
speed_help =
   (Html.div
      [
      ]
      [
         (Html.text "Speed influences "),
         (get_stats_reference_html Battle.Struct.Statistics.MovementPoints),
         (Html.text " (50%), "),
         (get_stats_reference_html Battle.Struct.Statistics.DoubleHits),
         (Html.text " (50%), and "),
         (get_stats_reference_html Battle.Struct.Statistics.Dodges),
         (Html.text " (~33%).")
      ]
   )

strength_help : (Html.Html Struct.Event.Type)
strength_help =
   (Html.div
      [
      ]
      [
         (Html.text "Strength influences attack damage (100%), and "),
         (get_stats_reference_html Battle.Struct.Statistics.Parries),
         (Html.text " (25%).")
      ]
   )

---- Statistics ----------------------------------------------------------------
max_health_help : (Html.Html Struct.Event.Type)
max_health_help =
   (Html.div
      [
      ]
      [
         (Html.text
            """
            Maximum Health is the maximum amount of hit points the character can
            have. It is based on
            """
         ),
         (get_atts_reference_html Battle.Struct.Attributes.Constitution),
         (Html.text " (75%), and "),
         (get_atts_reference_html Battle.Struct.Attributes.Mind),
         (Html.text " (25%).")
      ]
   )

movement_points_help : (Html.Html Struct.Event.Type)
movement_points_help =
   (Html.div
      [
      ]
      [
         (Html.text
            """
            Movement Points are an indication of how much this character can
            move every turn. They are based on
            """
         ),
         (get_atts_reference_html Battle.Struct.Attributes.Speed),
         (Html.text " (50%), "),
         (get_atts_reference_html Battle.Struct.Attributes.Constitution),
         (Html.text " (~33%), and "),
         (get_atts_reference_html Battle.Struct.Attributes.Mind),
         (Html.text " (~16%).")
      ]
   )

dodges_help : (Html.Html Struct.Event.Type)
dodges_help =
   (Html.div
      [
      ]
      [
         (Html.text
            """
            Dodge Chance is the base chance for this character to completely
            avoid an incoming attack. The actual chance is Dodge Chance minus
            the opponent's
            """
         ),
         (get_stats_reference_html Battle.Struct.Statistics.Accuracy),
         (Html.text
            """. Multiply by two to get the chance of avoiding partially (taking
            only half damage) an attack. Dodge Chance is based on
            """
         ),
         (get_atts_reference_html Battle.Struct.Attributes.Dexterity),
         (Html.text " (~33%), "),
         (get_atts_reference_html Battle.Struct.Attributes.Mind),
         (Html.text " (~33%), and "),
         (get_atts_reference_html Battle.Struct.Attributes.Speed),
         (Html.text " (~33%).")
      ]
   )

parries_help : (Html.Html Struct.Event.Type)
parries_help =
   (Html.div
      [
      ]
      [
         (Html.text
            """
            Parry Chance indicates how likely it is for this characters to void
            an incoming attack and replace it by one of their own. It is
            based on
            """
         ),
         (get_atts_reference_html Battle.Struct.Attributes.Dexterity),
         (Html.text " (25%), "),
         (get_atts_reference_html Battle.Struct.Attributes.Intelligence),
         (Html.text " (25%), "),
         (get_atts_reference_html Battle.Struct.Attributes.Speed),
         (Html.text " (25%), and "),
         (get_atts_reference_html Battle.Struct.Attributes.Strength),
         (Html.text " (25%).")
      ]
   )

accuracy_help : (Html.Html Struct.Event.Type)
accuracy_help =
   (Html.div
      [
      ]
      [
         (Html.text
            """
            Accuracy lower the target's chance to evade an incoming blow, as it
            is subtracted to their
            an incoming attack and replace it by one of their own. It is
            based on their
            """
         ),
         (get_stats_reference_html Battle.Struct.Statistics.Dodges),
         (Html.text ". Accuracy is based on "),
         (get_atts_reference_html Battle.Struct.Attributes.Dexterity),
         (Html.text " (100%).")
      ]
   )

double_hits_help : (Html.Html Struct.Event.Type)
double_hits_help =
   (Html.div
      [
      ]
      [
         (Html.text
            """
            Double Hit Chance indicate how likely this character is to perform
            a follow-up attack (which takes place after their target's
            retaliation, if there is any). It is based on
            """
         ),
         (get_atts_reference_html Battle.Struct.Attributes.Mind),
         (Html.text " (50%), and "),
         (get_atts_reference_html Battle.Struct.Attributes.Speed),
         (Html.text " (50%).")
      ]
   )

critical_hits_help : (Html.Html Struct.Event.Type)
critical_hits_help =
   (Html.div
      [
      ]
      [
         (Html.text
            """
            Critical Hit Chance indicate how likely this character is to perform
            an attack with double the damage. It is based on
            """
         ),
         (get_atts_reference_html Battle.Struct.Attributes.Intelligence),
         (Html.text " (100%).")
      ]
   )

get_stats_reference_html : (
      Battle.Struct.Statistics.Category ->
      (Html.Html Struct.Event.Type)
   )
get_stats_reference_html cat =
   (Html.div
      [
         (Html.Attributes.class "tooltip-reference"),
         (Html.Events.onClick
            (Struct.Event.RequestedHelp
               (Struct.HelpRequest.Statistic cat)
            )
         )
      ]
      [
         (Html.div
            [
               (Html.Attributes.class "omnimod-icon"),
               (Html.Attributes.class
                  (
                     "omnimod-icon-"
                     ++ (Battle.Struct.Statistics.encode_category cat)
                  )
               )
            ]
            [
            ]
         ),
         (Html.text (get_statistic_name cat))
      ]
   )

get_atts_reference_html : (
      Battle.Struct.Attributes.Category ->
      (Html.Html Struct.Event.Type)
   )
get_atts_reference_html cat =
   (Html.div
      [
         (Html.Attributes.class "tooltip-reference"),
         (Html.Events.onClick
            (Struct.Event.RequestedHelp
               (Struct.HelpRequest.Attribute cat)
            )
         )
      ]
      [
         (Html.div
            [
               (Html.Attributes.class "omnimod-icon"),
               (Html.Attributes.class
                  (
                     "omnimod-icon-"
                     ++ (Battle.Struct.Attributes.encode_category cat)
                  )
               )
            ]
            [
            ]
         ),
         (Html.text (get_attribute_name cat))
      ]
   )

get_attribute_name : Battle.Struct.Attributes.Category -> String
get_attribute_name cat =
   case cat of
      Battle.Struct.Attributes.Constitution -> (constitution)
      Battle.Struct.Attributes.Dexterity -> (dexterity)
      Battle.Struct.Attributes.Intelligence -> (intelligence)
      Battle.Struct.Attributes.Mind -> (mind)
      Battle.Struct.Attributes.Speed -> (speed)
      Battle.Struct.Attributes.Strength -> (strength)

get_statistic_name : Battle.Struct.Statistics.Category -> String
get_statistic_name cat =
   case cat of
      Battle.Struct.Statistics.MaxHealth -> (max_health)
      Battle.Struct.Statistics.MovementPoints -> (movement_points)
      Battle.Struct.Statistics.Dodges -> (dodges)
      Battle.Struct.Statistics.Parries -> (parries)
      Battle.Struct.Statistics.Accuracy -> (accuracy)
      Battle.Struct.Statistics.DoubleHits -> (double_hits)
      Battle.Struct.Statistics.CriticalHits -> (critical_hits)

get_attribute_category_help : (
      Battle.Struct.Attributes.Category ->
      (String, (Html.Html Struct.Event.Type))
   )
get_attribute_category_help cat =
   case cat of
      Battle.Struct.Attributes.Constitution ->
         ((constitution), (constitution_help))

      Battle.Struct.Attributes.Dexterity ->
         ((dexterity), (dexterity_help))

      Battle.Struct.Attributes.Intelligence ->
         ((intelligence), (intelligence_help))

      Battle.Struct.Attributes.Mind ->
         ((mind), (mind_help))

      Battle.Struct.Attributes.Speed ->
         ((speed), (speed_help))

      Battle.Struct.Attributes.Strength ->
         ((strength), (strength_help))

get_statistic_category_help : (
      Battle.Struct.Statistics.Category ->
      (String, (Html.Html Struct.Event.Type))
   )
get_statistic_category_help cat =
   case cat of
      Battle.Struct.Statistics.MaxHealth ->
         ((max_health), (max_health_help))

      Battle.Struct.Statistics.MovementPoints ->
         ((movement_points), (movement_points_help))

      Battle.Struct.Statistics.Dodges ->
         ((dodges), (dodges_help))

      Battle.Struct.Statistics.Parries ->
         ((parries), (parries_help))

      Battle.Struct.Statistics.Accuracy ->
         ((accuracy), (accuracy_help))

      Battle.Struct.Statistics.DoubleHits ->
         ((double_hits), (double_hits_help))

      Battle.Struct.Statistics.CriticalHits ->
         ((critical_hits), (critical_hits_help))