-
-
Notifications
You must be signed in to change notification settings - Fork 61
/
enumgen.go
1288 lines (1266 loc) · 27.1 KB
/
enumgen.go
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
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright ©1998-2023 by Richard A. Wilkes. All rights reserved.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, version 2.0. If a copy of the MPL was not distributed with
* this file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This Source Code Form is "Incompatible With Secondary Licenses", as
* defined by the Mozilla Public License, version 2.0.
*/
package main
//go:generate go run enumgen.go
import (
"bytes"
"fmt"
"go/format"
"io"
"os"
"path/filepath"
"strings"
"text/template"
"unicode"
"github.com/richardwilkes/toolbox/fatal"
"github.com/richardwilkes/toolbox/txt"
"golang.org/x/text/cases"
"golang.org/x/text/language"
)
const (
rootDir = ".."
genSuffix = "_gen.go"
)
type enumValue struct {
Name string
Key string
OldKeys []string
String string
Alt string
NoLocalize bool
EmptyStringOK bool
}
type enumInfo struct {
Pkg string
Name string
Desc string
Values []enumValue
}
func main() {
removeExistingGenFiles()
for _, one := range allEnums {
processSourceTemplate("enum.go.tmpl", one)
}
}
func removeExistingGenFiles() {
root, err := filepath.Abs(rootDir)
fatal.IfErr(err)
fatal.IfErr(filepath.Walk(root, func(path string, info os.FileInfo, _ error) error {
name := info.Name()
if info.IsDir() {
if name == ".git" {
return filepath.SkipDir
}
} else {
if strings.HasSuffix(name, genSuffix) {
fatal.IfErr(os.Remove(path))
}
}
return nil
}))
}
func processSourceTemplate(tmplName string, info *enumInfo) {
tmpl, err := template.New(tmplName).Funcs(template.FuncMap{
"fileLeaf": filepath.Base,
"join": join,
"last": last,
"toIdentifier": toIdentifier,
"wrapComment": wrapComment,
}).ParseFiles(tmplName)
fatal.IfErr(err)
var buffer bytes.Buffer
writeGeneratedFromComment(&buffer, tmplName)
fatal.IfErr(tmpl.Execute(&buffer, info))
var data []byte
if data, err = format.Source(buffer.Bytes()); err != nil {
fmt.Println("unable to format source file: " + filepath.Join(info.Pkg, info.Name+genSuffix))
data = buffer.Bytes()
}
dir := filepath.Join(rootDir, info.Pkg)
fatal.IfErr(os.MkdirAll(dir, 0o750))
fatal.IfErr(os.WriteFile(filepath.Join(dir, info.Name+genSuffix), data, 0o640))
}
func writeGeneratedFromComment(w io.Writer, tmplName string) {
_, err := fmt.Fprintf(w, "// Code generated from \"%s\" - DO NOT EDIT.\n\n", tmplName)
fatal.IfErr(err)
}
func join(values []string) string {
var buffer strings.Builder
for i, one := range values {
if i != 0 {
buffer.WriteString(", ")
}
fmt.Fprintf(&buffer, "%q", one)
}
return buffer.String()
}
func (e *enumInfo) LocalType() string {
return txt.FirstToLower(toIdentifier(e.Name)) + "Data"
}
func (e *enumInfo) IDFor(v enumValue) string {
id := v.Name
if id == "" {
id = toIdentifier(v.Key)
}
return id
}
func (e *enumInfo) HasAlt() bool {
for _, one := range e.Values {
if one.Alt != "" {
return true
}
}
return false
}
func (e *enumInfo) HasOldKeys() bool {
for _, one := range e.Values {
if len(one.OldKeys) != 0 {
return true
}
}
return false
}
func (e *enumInfo) NeedI18N() bool {
for _, one := range e.Values {
if !one.NoLocalize || one.Alt != "" {
return true
}
}
return false
}
func (e *enumValue) StringValue() string {
if e.String == "" && !e.EmptyStringOK {
return cases.Title(language.AmericanEnglish).String(strings.ReplaceAll(e.Key, "_", " "))
}
return e.String
}
func last(in []enumValue) enumValue {
return in[len(in)-1]
}
func toIdentifier(in string) string {
var buffer strings.Builder
useUpper := true
for i, ch := range in {
isUpper := ch >= 'A' && ch <= 'Z'
isLower := ch >= 'a' && ch <= 'z'
isDigit := ch >= '0' && ch <= '9'
isAlpha := isUpper || isLower
if i == 0 && !isAlpha {
if !isDigit {
continue
}
buffer.WriteString("_")
}
if isAlpha {
if useUpper {
buffer.WriteRune(unicode.ToUpper(ch))
} else {
buffer.WriteRune(unicode.ToLower(ch))
}
useUpper = false
} else {
if isDigit {
buffer.WriteRune(ch)
}
useUpper = true
}
}
return buffer.String()
}
func wrapComment(in string, cols int) string {
return txt.Wrap("// ", in, cols)
}
var allEnums = []*enumInfo{
{
Pkg: "model/fxp",
Name: "length_unit",
Desc: "holds the length unit type. Note that conversions to/from metric are done using the simplified GURPS metric conversion of 1 yd = 1 meter. For consistency, all metric lengths are converted to meters, then to yards, rather than the variations at different lengths that the GURPS rules suggest",
Values: []enumValue{
{
Name: "FeetAndInches",
Key: "ft_in",
String: "Feet & Inches",
},
{
Name: "Inch",
Key: "in",
String: "in",
NoLocalize: true,
},
{
Name: "Feet",
Key: "ft",
String: "ft",
NoLocalize: true,
},
{
Name: "Yard",
Key: "yd",
String: "yd",
NoLocalize: true,
},
{
Name: "Mile",
Key: "mi",
String: "mi",
NoLocalize: true,
},
{
Name: "Centimeter",
Key: "cm",
String: "cm",
NoLocalize: true,
},
{
Name: "Kilometer",
Key: "km",
String: "km",
NoLocalize: true,
},
{
Name: "Meter",
Key: "m",
String: "m",
NoLocalize: true,
},
},
},
{
Pkg: "model/fxp",
Name: "weight_unit",
Desc: "holds the weight unit type. Note that conversions to/from metric are done using the simplified GURPS metric conversion of 1 lb = 0.5kg. For consistency, all metric weights are converted to kilograms, then to pounds, rather than the variations at different weights that the GURPS rules suggest",
Values: []enumValue{
{
Name: "Pound",
Key: "lb",
String: "lb",
NoLocalize: true,
},
{
Name: "PoundAlt",
Key: "#",
String: "#",
NoLocalize: true,
},
{
Name: "Ounce",
Key: "oz",
String: "oz",
NoLocalize: true,
},
{
Name: "Ton",
Key: "tn",
String: "tn",
NoLocalize: true,
},
{
Name: "TonAlt",
Key: "t",
String: "t",
NoLocalize: true,
},
{
Name: "Kilogram",
Key: "kg",
String: "kg",
NoLocalize: true,
},
{
Name: "Gram",
Key: "g",
String: "g",
NoLocalize: true,
},
},
},
{
Pkg: "model/gurps/enums/affects",
Name: "option",
Desc: "describes how a TraitModifier affects the point cost",
Values: []enumValue{
{
Key: "total",
String: "to cost",
},
{
Key: "base_only",
String: "to base cost only",
Alt: "(base only)",
},
{
Key: "levels_only",
String: "to leveled cost only",
Alt: "(levels only)",
},
},
},
{
Pkg: "model/gurps/enums/attribute",
Name: "type",
Desc: "holds the type of an attribute definition",
Values: []enumValue{
{Key: "integer"},
{Key: "integer_ref", String: "Integer (Display Only)"},
{Key: "decimal"},
{Key: "decimal_ref", String: "Decimal (Display Only)"},
{Key: "pool"},
{Key: "primary_separator"},
{Key: "secondary_separator"},
{Key: "pool_separator"},
},
},
{
Pkg: "model/gurps/enums/autoscale",
Name: "option",
Desc: "holds the possible auto-scaling options",
Values: []enumValue{
{Key: "no", String: "No Auto-Scaling"},
{Key: "fit_width"},
{Key: "fit_page"},
},
},
{
Pkg: "model/gurps/enums/cell",
Name: "type",
Desc: "holds the type of table cell",
Values: []enumValue{
{Key: "text"},
{Key: "tags"},
{Key: "toggle"},
{Key: "page_ref"},
{Key: "markdown"},
},
},
{
Pkg: "model/gurps/enums/container",
Name: "type",
Desc: "holds the type of a trait container",
Values: []enumValue{
{Key: "group"},
{Key: "alternative_abilities"},
{
Key: "ancestry",
OldKeys: []string{"race"},
},
{Key: "attributes"},
{
Key: "meta_trait",
String: "Meta-Trait",
},
},
},
{
Pkg: "model/gurps/enums/dgroup",
Name: "group",
Desc: "holds the set of dockable groupings",
Values: []enumValue{
{Key: "character_sheets"},
{Key: "character_templates"},
{Key: "campaigns"},
{Key: "editors"},
{Key: "images"},
{Key: "libraries"},
{Key: "markdown"},
{Key: "pdfs", Name: "PDFs", String: "PDFs"},
{Key: "settings"},
{Key: "sub-editors"},
},
},
{
Pkg: "model/gurps/enums/difficulty",
Name: "level",
Desc: "holds the difficulty level of a skill",
Values: []enumValue{
{
Name: "Easy",
Key: "e",
NoLocalize: true,
},
{
Name: "Average",
Key: "a",
NoLocalize: true,
},
{
Name: "Hard",
Key: "h",
NoLocalize: true,
},
{
Name: "VeryHard",
Key: "vh",
String: "VH",
NoLocalize: true,
},
{
Name: "Wildcard",
Key: "w",
NoLocalize: true,
},
},
},
{
Pkg: "model/gurps/enums/display",
Name: "option",
Desc: "holds a display option",
Values: []enumValue{
{Key: "not_shown"},
{Key: "inline"},
{Key: "tooltip"},
{
Key: "inline_and_tooltip",
String: "Inline & Tooltip",
},
},
},
{
Pkg: "model/gurps/enums/emcost",
Name: "type",
Desc: "describes how an Equipment Modifier's cost is applied",
Values: []enumValue{
{
Name: "Original",
Key: "to_original_cost",
String: "to original cost",
Alt: `"+5", "-5", "+10%", "-10%", "x3.2"`,
},
{
Name: "Base",
Key: "to_base_cost",
String: "to base cost",
Alt: `"x2", "+2 CF", "-0.2 CF"`,
},
{
Name: "FinalBase",
Key: "to_final_base_cost",
String: "to final base cost",
Alt: `"+5", "-5", "+10%", "-10%", "x3.2"`,
},
{
Name: "Final",
Key: "to_final_cost",
String: "to final cost",
Alt: `"+5", "-5", "+10%", "-10%", "x3.2"`,
},
},
},
{
Pkg: "model/gurps/enums/emcost",
Name: "value",
Desc: "describes how an Equipment Modifier's cost value is applied",
Values: []enumValue{
{
Name: "Addition",
Key: "+",
},
{
Name: "Percentage",
Key: "%",
},
{
Name: "Multiplier",
Key: "x",
String: "x",
},
{
Name: "CostFactor",
Key: "cf",
String: "CF",
},
},
},
{
Pkg: "model/gurps/enums/emweight",
Name: "type",
Desc: "describes how an Equipment Modifier's weight is applied",
Values: []enumValue{
{
Name: "Original",
Key: "to_original_weight",
String: "to original weight",
Alt: `"+5 lb", "-5 lb", "+10%", "-10%"`,
},
{
Name: "Base",
Key: "to_base_weight",
String: "to base weight",
Alt: `"+5 lb", "-5 lb", "x10%", "x3", "x2/3"`,
},
{
Name: "FinalBase",
Key: "to_final_base_weight",
String: "to final base weight",
Alt: `"+5 lb", "-5 lb", "x10%", "x3", "x2/3"`,
},
{
Name: "Final",
Key: "to_final_weight",
String: "to final weight",
Alt: `"+5 lb", "-5 lb", "x10%", "x3", "x2/3"`,
},
},
},
{
Pkg: "model/gurps/enums/emweight",
Name: "value",
Desc: "describes how an Equipment Modifier's weight value is applied",
Values: []enumValue{
{
Name: "Addition",
Key: "+",
NoLocalize: true,
},
{
Name: "PercentageAdder",
Key: "%",
NoLocalize: true,
},
{
Name: "PercentageMultiplier",
Key: "x%",
String: "x%",
NoLocalize: true,
},
{
Name: "Multiplier",
Key: "x",
String: "x",
NoLocalize: true,
},
},
},
{
Pkg: "model/gurps/enums/encumbrance",
Name: "level",
Desc: "holds the encumbrance level",
Values: []enumValue{
{
Name: "No",
Key: "none",
},
{Key: "light"},
{Key: "medium"},
{Key: "heavy"},
{
Key: "extra_heavy",
String: "X-Heavy",
},
},
},
{
Pkg: "model/gurps/enums/entity",
Name: "type",
Desc: "holds the type of an Entity",
Values: []enumValue{
{
Name: "PC",
Key: "character",
String: "PC",
},
},
},
{
Pkg: "model/gurps/enums/feature",
Name: "type",
Desc: "holds the type of a Feature",
Values: []enumValue{
{
Key: "attribute_bonus",
String: "Gives an attribute modifier of",
},
{
Key: "conditional_modifier",
String: "Gives a conditional modifier of",
},
{
Name: "DRBonus",
Key: "dr_bonus",
String: "Gives a DR bonus of",
},
{
Key: "reaction_bonus",
String: "Gives a reaction modifier of",
},
{
Key: "skill_bonus",
String: "Gives a skill level modifier of",
},
{
Key: "skill_point_bonus",
String: "Gives a skill point modifier of",
},
{
Key: "spell_bonus",
String: "Gives a spell level modifier of",
},
{
Key: "spell_point_bonus",
String: "Gives a spell point modifier of",
},
{
Key: "weapon_bonus",
String: "Gives a weapon damage modifier of",
},
{
Key: "weapon_acc_bonus",
String: "Gives a weapon accuracy modifier of",
},
{
Key: "weapon_scope_acc_bonus",
String: "Gives a weapon scope accuracy modifier of",
},
{
Name: "WeaponDRDivisorBonus",
Key: "weapon_dr_divisor_bonus",
String: "Gives a weapon DR divisor modifier of",
},
{
Name: "WeaponMinSTBonus",
Key: "weapon_min_st_bonus",
String: "Gives a weapon minimum ST modifier of",
},
{
Key: "weapon_min_reach_bonus",
String: "Gives a weapon minimum reach modifier of",
},
{
Key: "weapon_max_reach_bonus",
String: "Gives a weapon maximum reach modifier of",
},
{
Key: "weapon_half_damage_range_bonus",
String: "Gives a weapon half-damage range modifier of",
},
{
Key: "weapon_min_range_bonus",
String: "Gives a weapon minimum range modifier of",
},
{
Key: "weapon_max_range_bonus",
String: "Gives a weapon maximum range modifier of",
},
{
Key: "weapon_recoil_bonus",
String: "Gives a weapon recoil modifier of",
},
{
Key: "weapon_bulk_bonus",
String: "Gives a weapon bulk modifier of",
},
{
Key: "weapon_parry_bonus",
String: "Gives a weapon parry modifier of",
},
{
Key: "weapon_block_bonus",
String: "Gives a weapon block modifier of",
},
{
Key: "weapon_rof_mode_1_shots_bonus",
String: "Gives a weapon shots per attack (mode 1) modifier of",
},
{
Key: "weapon_rof_mode_1_secondary_bonus",
String: "Gives a weapon secondary projectiles (mode 1) modifier of",
},
{
Key: "weapon_rof_mode_2_shots_bonus",
String: "Gives a weapon shots per attack (mode 2) modifier of",
},
{
Key: "weapon_rof_mode_2_secondary_bonus",
String: "Gives a weapon secondary projectiles (mode 2) modifier of",
},
{
Key: "weapon_non_chamber_shots_bonus",
String: "Gives a weapon non-chamber shots modifier of",
},
{
Key: "weapon_chamber_shots_bonus",
String: "Gives a weapon chamber shots modifier of",
},
{
Key: "weapon_shot_duration_bonus",
String: "Gives a weapon shot duration modifier of",
},
{
Key: "weapon_reload_time_bonus",
String: "Gives a weapon reload time modifier of",
},
{
Key: "weapon_switch",
String: "Set the weapon flag",
},
{
Key: "cost_reduction",
String: "Reduces the attribute cost of",
},
{
Key: "contained_weight_reduction",
String: "Reduces the contained weight by",
},
},
},
{
Pkg: "model/gurps/enums/namegen",
Name: "builtin",
Desc: "holds a built-in name data type",
Values: []enumValue{
{Key: "none"},
{Key: "american_male"},
{Key: "american_female"},
{Key: "american_last"},
{Key: "unweighted_american_male"},
{Key: "unweighted_american_female"},
{Key: "unweighted_american_last"},
},
},
{
Pkg: "model/gurps/enums/namegen",
Name: "type",
Desc: "holds a name generation type",
Values: []enumValue{
{Key: "simple"},
{Key: "markov_letter", OldKeys: []string{"markov_chain"}},
{Key: "markov_run"},
{Key: "compound"},
},
},
{
Pkg: "model/gurps/enums/picker",
Name: "type",
Desc: "holds the type of template picker",
Values: []enumValue{
{Key: "not_applicable"},
{Key: "count"},
{Key: "points"},
},
},
{
Pkg: "model/gurps/enums/prereq",
Name: "type",
Desc: "holds the type of a Prereq",
Values: []enumValue{
{
Name: "List",
Key: "prereq_list",
String: "a list",
},
{
Name: "Trait",
Key: "trait_prereq",
OldKeys: []string{"advantage_prereq"},
String: "a trait",
},
{
Name: "Attribute",
Key: "attribute_prereq",
String: "the attribute",
},
{
Name: "ContainedQuantity",
Key: "contained_quantity_prereq",
String: "a contained quantity of",
},
{
Name: "ContainedWeight",
Key: "contained_weight_prereq",
String: "a contained weight",
},
{
Name: "EquippedEquipment",
Key: "equipped_equipment",
String: "has equipped equipment",
},
{
Name: "Skill",
Key: "skill_prereq",
String: "a skill",
},
{
Name: "Spell",
Key: "spell_prereq",
String: "spell(s)",
},
},
},
{
Pkg: "model/gurps/enums/progression",
Name: "option",
Desc: "controls how Thrust and Swing are calculated",
Values: []enumValue{
{
Key: "basic_set",
Alt: "*The standard damage progression*",
},
{
Key: "knowing_your_own_strength",
Alt: "*From [Pyramid 3-83, pages 16-19](PY83:16)*",
},
{
Key: "no_school_grognard_damage",
Alt: "*From [Adjusting Swing Damage in Dungeon Fantasy](https://noschoolgrognard.blogspot.com/2013/04/adjusting-swing-damage-in-dungeon.html)*",
},
{
Key: "thrust_equals_swing_minus_2",
String: "Thrust = Swing-2",
Alt: "*From [Alternate Damage Scheme (Thr = Sw-2)](https://github.com/richardwilkes/gcs/issues/97)*",
},
{
Key: "swing_equals_thrust_plus_2",
String: "Swing = Thrust+2",
Alt: "*From a [house rule](https://gamingballistic.com/2020/12/04/df-eastmarch-boss-fight-and-house-rules/) originating with Kevin Smyth*",
},
{
Key: "tbone_1",
String: "T Bone's New Damage for ST (option 1)",
Alt: "*From [T Bone's Games Diner](https://www.gamesdiner.com/rules-nugget-gurps-new-damage-for-st/)*",
},
{
Key: "tbone_1_clean",
String: "T Bone's New Damage for ST (option 1, cleaned)",
Alt: "*From [T Bone's Games Diner](https://www.gamesdiner.com/rules-nugget-gurps-new-damage-for-st/)*",
},
{
Key: "tbone_2",
String: "T Bone's New Damage for ST (option 2)",
Alt: "*From [T Bone's Games Diner](https://www.gamesdiner.com/rules-nugget-gurps-new-damage-for-st/)*",
},
{
Key: "tbone_2_clean",
String: "T Bone's New Damage for ST (option 2, cleaned)",
Alt: "*From [T Bone's Games Diner](https://www.gamesdiner.com/rules-nugget-gurps-new-damage-for-st/)*",
},
{
Key: "phoenix_flame_d3",
Alt: "*From a [house rule](https://github.com/richardwilkes/gcs/pull/393) that uses d3s instead of d6s for damage*",
},
},
},
{
Pkg: "model/gurps/enums/selfctrl",
Name: "adjustment",
Desc: "holds an Adjustment for a self-control roll",
Values: []enumValue{
{
Name: "NoCRAdj",
Key: "none",
Alt: "None",
},
{
Key: "action_penalty",
String: "Includes an Action Penalty for Failure",
Alt: "%d Action Penalty",
},
{
Key: "reaction_penalty",
String: "Includes a Reaction Penalty for Failure",
Alt: "%d Reaction Penalty",
},
{
Key: "fright_check_penalty",
String: "Includes Fright Check Penalty",
Alt: "%d Fright Check Penalty",
},
{
Key: "fright_check_bonus",
String: "Includes Fright Check Bonus",
Alt: "+%d Fright Check Bonus",
},
{
Key: "minor_cost_of_living_increase",
String: "Includes a Minor Cost of Living Increase",
Alt: "+%d%% Cost of Living Increase",
},
{
Key: "major_cost_of_living_increase",
String: "Includes a Major Cost of Living Increase and Merchant Skill Penalty",
Alt: "+%d%% Cost of Living Increase",
},
},
},
{
Pkg: "model/gurps/enums/skillsel",
Name: "type",
Desc: "holds the type of a selection",
Values: []enumValue{
{
Name: "Name",
Key: "skills_with_name",
String: "to skills whose name",
},
{
Key: "this_weapon",
String: "to this weapon",
},
{
Key: "weapons_with_name",
String: "to weapons whose name",
},
},
},
{
Pkg: "model/gurps/enums/spellcmp",
Name: "type",
Desc: "holds the type of a comparison",
Values: []enumValue{
{
Key: "name",
String: "whose name",
},
{
Key: "tag",
OldKeys: []string{"category"},
String: "with a tag which",
},
{
Key: "college",
String: "whose college name",
},
{
Key: "college_count",
String: "from different colleges",
},
{
Key: "any",
String: "of any kind",
},
},
},
{
Pkg: "model/gurps/enums/spellmatch",
Name: "type",
Desc: "holds the type of a match",
Values: []enumValue{
{
Key: "all_colleges",
String: "to all colleges",
},
{
Key: "college_name",
String: "to the college whose name",
},
{
Name: "PowerSource",
Key: "power_source_name",
String: "to the power source whose name",
},
{
Name: "Name",
Key: "spell_name",
String: "to the spell whose name",
},
},
},
{
Pkg: "model/gurps/enums/stdmg",
Name: "option",
Desc: "holds the type of strength dice to add to damage",
Values: []enumValue{
{
Key: "none",
String: "None",
},
{
Name: "Thrust",
Key: "thr",
String: "thr",
NoLocalize: true,
},