forked from taichunmin/dont-starve-together-game-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.lua
2442 lines (2140 loc) · 59.4 KB
/
constants.lua
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
require "util"
local TechTree = require("techtree")
local IS_BETA = BRANCH == "staging" --or BRANCH == "dev"
PI = 3.14159
PI2 = PI*2
DEGREES = PI/180
RADIANS = 180/PI
FRAMES = 1/30
TILE_SCALE = 4
RESOLUTION_X = 1280
RESOLUTION_Y = 720
MAX_FE_SCALE = 3 --Default if you don't call SetMaxPropUpscale
MAX_HUD_SCALE = 1.25
FACING_RIGHT = 0
FACING_UP = 1
FACING_LEFT = 2
FACING_DOWN = 3
FACING_UPRIGHT = 4
FACING_UPLEFT = 5
FACING_DOWNRIGHT = 6
FACING_DOWNLEFT = 7
FACING_NONE = 8
-- Careful inserting into here. You will have to update game\render\RenderLayer.h
LAYER_BACKDROP = 0
LAYER_BELOW_OCEAN = 1
LAYER_BELOW_GROUND = 2
LAYER_GROUND = 3
LAYER_BACKGROUND = 4
LAYER_WORLD_BACKGROUND = 5
LAYER_WORLD = 6
-- client-only layers go below here --
LAYER_WORLD_DEBUG = 7
LAYER_FRONTEND = 8
LAYER_FRONTEND_DEBUG = 9
LAYER_WIP_BELOW_OCEAN = 2 --1
-- From SortKeyConsts in scenegraphnode.h
FINALOFFSET_MIN = -7
FINALOFFSET_MAX = 7
SORTORDER_MIN = -3
SORTORDER_MAX = 3
ANCHOR_MIDDLE = 0
ANCHOR_LEFT = 1
ANCHOR_RIGHT = 2
ANCHOR_TOP = 1
ANCHOR_BOTTOM = 2
SCALEMODE_NONE = 0
SCALEMODE_FILLSCREEN = 1 --stretch art to fit/fill window
SCALEMODE_PROPORTIONAL = 2 --preserve aspect ratio (picks the smaller of horizontal/vertical scale)
SCALEMODE_FIXEDPROPORTIONAL = 3 --same as SCALEMODE_FIXEDSCREEN_NONDYNAMIC, except for safe area on consoles
SCALEMODE_FIXEDSCREEN_NONDYNAMIC = 4 --scale same amount as window scaling from 1280x720
PHYSICS_TYPE_ANIMATION_CONTROLLED = 0
PHYSICS_TYPE_PHYSICS_CONTROLLED = 1
MOVE_UP = 1
MOVE_DOWN = 2
MOVE_LEFT = 3
MOVE_RIGHT = 4
NUM_CRAFTING_RECIPES = 10
--push priorities
STATIC_PRIORITY = 10000
-- Controls:
-- Must match the Control enum in DontStarveInputHandler.h
-- Must match STRINGS.UI.CONTROLSSCREEN.CONTROLS
-- player action controls
CONTROL_PRIMARY = 0
CONTROL_SECONDARY = 1
CONTROL_ATTACK = 2
CONTROL_INSPECT = 3
CONTROL_ACTION = 4
-- player movement controls
CONTROL_MOVE_UP = 5 -- left joystick up
CONTROL_MOVE_DOWN = 6 -- left joystick down
CONTROL_MOVE_LEFT = 7 -- left joystick left
CONTROL_MOVE_RIGHT = 8 -- left joystick right
-- view controls
CONTROL_ZOOM_IN = 9 -- left trigger
CONTROL_ZOOM_OUT = 10 -- right trigger
CONTROL_ROTATE_LEFT = 11 -- left shoulder
CONTROL_ROTATE_RIGHT = 12 -- right shoulder
-- player movement controls
CONTROL_PAUSE = 13 -- start
CONTROL_MAP = 14
CONTROL_INV_1 = 15
CONTROL_INV_2 = 16
CONTROL_INV_3 = 17
CONTROL_INV_4 = 18
CONTROL_INV_5 = 19
CONTROL_INV_6 = 20
CONTROL_INV_7 = 21
CONTROL_INV_8 = 22
CONTROL_INV_9 = 23
CONTROL_INV_10 = 24
CONTROL_FOCUS_UP = 25 -- d-pad up
CONTROL_FOCUS_DOWN = 26 -- d-pad down
CONTROL_FOCUS_LEFT = 27 -- d-pad left
CONTROL_FOCUS_RIGHT = 28 -- d-pad right
CONTROL_ACCEPT = 29 -- A
CONTROL_CANCEL = 30 -- B
CONTROL_SCROLLBACK = 31 -- left shoulder
CONTROL_SCROLLFWD = 32 -- right shoulder
CONTROL_PREVVALUE = 33
CONTROL_NEXTVALUE = 34
CONTROL_SPLITSTACK = 35
CONTROL_TRADEITEM = 36
CONTROL_TRADESTACK = 37
CONTROL_FORCE_INSPECT = 38
CONTROL_FORCE_ATTACK = 39
CONTROL_FORCE_TRADE = 40
CONTROL_FORCE_STACK = 41
CONTROL_OPEN_DEBUG_CONSOLE = 42
CONTROL_TOGGLE_LOG = 43
CONTROL_TOGGLE_DEBUGRENDER = 44
CONTROL_OPEN_INVENTORY = 45 -- right trigger
CONTROL_OPEN_CRAFTING = 46 -- left trigger
CONTROL_INVENTORY_LEFT = 47 -- right joystick left
CONTROL_INVENTORY_RIGHT = 48 -- right joystick right
CONTROL_INVENTORY_UP = 49 -- right joystick up
CONTROL_INVENTORY_DOWN = 50 -- right joystick down
CONTROL_INVENTORY_EXAMINE = 51 -- d-pad up
CONTROL_INVENTORY_USEONSELF = 52 -- d-pad right
CONTROL_INVENTORY_USEONSCENE = 53 -- d-pad left
CONTROL_INVENTORY_DROP = 54 -- d-pad down
CONTROL_PUTSTACK = 55
CONTROL_CONTROLLER_ATTACK = 56 -- X on xbox controller
CONTROL_CONTROLLER_ACTION = 57 -- A
CONTROL_CONTROLLER_ALTACTION = 58 -- B
CONTROL_USE_ITEM_ON_ITEM = 59
CONTROL_MAP_ZOOM_IN = 60
CONTROL_MAP_ZOOM_OUT = 61
CONTROL_OPEN_DEBUG_MENU = 70 --62 steam deck is 70
CONTROL_TOGGLE_SAY = 63
CONTROL_TOGGLE_WHISPER = 64
CONTROL_TOGGLE_SLASH_COMMAND = 65
CONTROL_TOGGLE_PLAYER_STATUS = 66
CONTROL_SHOW_PLAYER_STATUS = 67
CONTROL_MENU_MISC_1 = 68 -- X
CONTROL_MENU_MISC_2 = 69 -- Y
CONTROL_MENU_MISC_3 = 70 -- L
CONTROL_MENU_MISC_4 = 71 -- R
CONTROL_INSPECT_SELF = 72 -- Keyboard self inspect [I]
CONTROL_SERVER_PAUSE = 73
CONTROL_CRAFTING_MODIFIER = 74 -- this + CONTROL_OPEN_CRAFTING to open with the search box ready to type in
CONTROL_CRAFTING_PINLEFT = 75
CONTROL_CRAFTING_PINRIGHT = 76
CONTROL_INV_11 = 77 -- Sequence ordering difference but makes backwards compatability easier.
CONTROL_INV_12 = 78
CONTROL_INV_13 = 79
CONTROL_INV_14 = 80
CONTROL_INV_15 = 81
CONTROL_CUSTOM_START = 100
XBOX_CONTROLLER_ID = 17
-- controller targetting er... controls
CONTROL_TARGET_MODIFIER = CONTROL_MENU_MISC_2
CONTROL_TARGET_LOCK = CONTROL_MENU_MISC_2
CONTROL_TARGET_CYCLE_BACK = CONTROL_ROTATE_LEFT
CONTROL_TARGET_CYCLE_FORWARD = CONTROL_ROTATE_RIGHT
KEY_TAB = 9
KEY_KP_0 = 256
KEY_KP_1 = 257
KEY_KP_2 = 258
KEY_KP_3 = 259
KEY_KP_4 = 260
KEY_KP_5 = 261
KEY_KP_6 = 262
KEY_KP_7 = 263
KEY_KP_8 = 264
KEY_KP_9 = 265
KEY_KP_PERIOD = 266
KEY_KP_DIVIDE = 267
KEY_KP_MULTIPLY = 268
KEY_KP_MINUS = 269
KEY_KP_PLUS = 270
KEY_KP_ENTER = 271
KEY_KP_EQUALS = 272
KEY_MINUS = 45
KEY_EQUALS = 61
KEY_SPACE = 32
KEY_ENTER = 13
KEY_ESCAPE = 27
KEY_HOME = 278
KEY_INSERT = 277
KEY_DELETE = 127
KEY_END = 279
KEY_PAUSE = 19
KEY_PRINT = 316
KEY_CAPSLOCK = 301
KEY_SCROLLOCK = 302
KEY_RSHIFT = 303 -- use KEY_SHIFT instead
KEY_LSHIFT = 304 -- use KEY_SHIFT instead
KEY_RCTRL = 305 -- use KEY_CTRL instead
KEY_LCTRL = 306 -- use KEY_CTRL instead
KEY_RALT = 307 -- use KEY_ALT instead
KEY_LALT = 308 -- use KEY_ALT instead
KEY_LSUPER = 311
KEY_RSUPER = 312
KEY_ALT = 400
KEY_CTRL = 401
KEY_SHIFT = 402
KEY_BACKSPACE = 8
KEY_PERIOD = 46
KEY_SLASH = 47
KEY_SEMICOLON = 59
KEY_LEFTBRACKET = 91
KEY_BACKSLASH = 92
KEY_RIGHTBRACKET= 93
KEY_TILDE = 96
KEY_A = 97
KEY_B = 98
KEY_C = 99
KEY_D = 100
KEY_E = 101
KEY_F = 102
KEY_G = 103
KEY_H = 104
KEY_I = 105
KEY_J = 106
KEY_K = 107
KEY_L = 108
KEY_M = 109
KEY_N = 110
KEY_O = 111
KEY_P = 112
KEY_Q = 113
KEY_R = 114
KEY_S = 115
KEY_T = 116
KEY_U = 117
KEY_V = 118
KEY_W = 119
KEY_X = 120
KEY_Y = 121
KEY_Z = 122
KEY_F1 = 282
KEY_F2 = 283
KEY_F3 = 284
KEY_F4 = 285
KEY_F5 = 286
KEY_F6 = 287
KEY_F7 = 288
KEY_F8 = 289
KEY_F9 = 290
KEY_F10 = 291
KEY_F11 = 292
KEY_F12 = 293
KEY_UP = 273
KEY_DOWN = 274
KEY_RIGHT = 275
KEY_LEFT = 276
KEY_PAGEUP = 280
KEY_PAGEDOWN = 281
KEY_0 = 48
KEY_1 = 49
KEY_2 = 50
KEY_3 = 51
KEY_4 = 52
KEY_5 = 53
KEY_6 = 54
KEY_7 = 55
KEY_8 = 56
KEY_9 = 57
-- DO NOT use these for gameplay!
MOUSEBUTTON_LEFT = 1000
MOUSEBUTTON_RIGHT = 1001
MOUSEBUTTON_MIDDLE = 1002
MOUSEBUTTON_SCROLLUP = 1003
MOUSEBUTTON_SCROLLDOWN = 1004
GESTURE_ZOOM_IN = 900
GESTURE_ZOOM_OUT = 901
GESTURE_ROTATE_LEFT = 902
GESTURE_ROTATE_RIGHT = 903
GESTURE_MAX = 904
SCREEN_FLASH_SCALING =
{
0.9, -- default
0.6, -- dim
0.3, -- dimmest
}
BACKEND_PREFABS = { "forest", "cave", "lavaarena", "quagmire" }
FRONTEND_PREFABS = { "frontend" }
RECIPE_PREFABS = {}
--Defined below:
-- SPECIAL_EVENT_GLOBAL_PREFABS
-- SPECIAL_EVENT_BACKEND_PREFABS
-- SPECIAL_EVENT_FRONTEND_PREFABS
-- FESTIVAL_EVENT_GLOBAL_PREFABS
-- FESTIVAL_EVENT_BACKEND_PREFABS
-- FESTIVAL_EVENT_FRONTEND_PREFABS
FADE_OUT = false
FADE_IN = true
--Legacy table, not for DST
MAIN_CHARACTERLIST =
{
"wilson", "willow", "wolfgang", "wendy", "wx78", "wickerbottom", "woodie", "wes", "waxwell",
}
--Legacy table, not for DST
ROG_CHARACTERLIST =
{
"wathgrithr", "webber",
}
--When adding new characters with alternate states, be sure to update skinsutils.lua function GetSkinModes.
DST_CHARACTERLIST =
{
"wilson",
"willow",
"wolfgang",
"wendy",
"wx78",
"wickerbottom",
"woodie",
"wes",
"waxwell",
"wathgrithr",
"webber",
"winona",
"warly",
--DLC chars:
"wortox",
"wormwood",
"wurt",
"walter",
"wanda",
}
CHARACTER_VIDEOS =
{
wilson = {"https://bit.ly/3w9VYcN"},
willow = {"https://bit.ly/3rFOkU3"},
wendy = {"https://bit.ly/3fI3PbR"},
wolfgang = {"https://klei.gg/33A9mNx"},
wx78 = {"https://klei.gg/3F9qqc1"},
-- wickerbottom = {},
wes = {"https://bit.ly/2QLFpn4"},
waxwell = {"https://bit.ly/3rF0UD0"},
woodie = {"https://bit.ly/3sHhUK1"},
wathgrithr = {"https://bit.ly/3rC8YV6"},
webber = {"https://klei.gg/3zXJrLt"},
winona = {"https://bit.ly/3fB6LHb"},
wortox = {"https://bit.ly/3cBQ10g"},
wormwood = {"https://bit.ly/3cBilQq"},
warly = {"https://bit.ly/39vp0tG"},
wurt = {"https://bit.ly/2QVJup1"},
walter = {"https://bit.ly/31Ajrpj"},
wanda = {"https://klei.gg/dst-wanda-short"},
}
require("prefabskins")
require("clothing")
require("beefalo_clothing")
require("misc_items")
require("emote_items")
require("item_blacklist")
CLOTHING.body_default1 =
{
type = "body",
skin_tags = {},
is_default = true,
release_group = 999,
}
CLOTHING.hand_default1 =
{
type = "hand",
skin_tags = {},
is_default = true,
release_group = 999,
}
CLOTHING.legs_default1 =
{
type = "legs",
skin_tags = {},
is_default = true,
release_group = 999,
}
CLOTHING.feet_default1 =
{
type = "feet",
skin_tags = {},
is_default = true,
release_group = 999,
}
MISC_ITEMS.beard_default1 =
{
type = "beard",
skin_tags = {},
is_default = true,
release_group = 999,
}
BEEFALO_CLOTHING.beef_body_default1 =
{
type = "beef_body",
skin_tags = {},
is_default = true,
release_group = 999,
}
BEEFALO_CLOTHING.beef_horn_default1 =
{
type = "beef_horn",
skin_tags = {},
is_default = true,
release_group = 999,
}
BEEFALO_CLOTHING.beef_head_default1 =
{
type = "beef_head",
skin_tags = {},
is_default = true,
release_group = 999,
}
BEEFALO_CLOTHING.beef_feet_default1 =
{
type = "beef_feet",
skin_tags = {},
is_default = true,
release_group = 999,
}
BEEFALO_CLOTHING.beef_tail_default1 =
{
type = "beef_tail",
skin_tags = {},
is_default = true,
release_group = 999,
}
MAINSCREEN_TOOL_LIST =
{
"swap_axe", "swap_spear", "swap_pickaxe", "swap_shovel", "swap_staffs", "swap_cane", "swap_fishingrod", "swap_hammer", "swap_batbat", "swap_ham_bat",
}
MAINSCREEN_TORSO_LIST =
{
"", "", "", "", "armor_wood", "armor_sweatervest", "torso_amulets", "armor_trunkvest_winter", "armor_ruins", "torso_dragonfly", "torso_hawaiian"
}
MAINSCREEN_HAT_LIST =
{
"", "", "", "", "hat_top", "hat_beefalo", "hat_football", "hat_winter", "hat_spider", "hat_catcoon", "hat_mole", "hat_ice", "hat_watermelon"
}
MODCHARACTERLIST =
{
-- this gets populated by mods
}
MODCHARACTEREXCEPTIONS_DST =
{
-- this also gets populated by mods
}
CHARACTER_GENDERS =
{
FEMALE =
{
"willow",
"wendy",
"wickerbottom",
"wathgrithr",
"winona",
"wurt",
"wanda",
},
MALE =
{
"wilson",
"woodie",
"waxwell",
"wolfgang",
"wes",
"webber",
"warly",
"wortox",
"wormwood",
"walter",
},
ROBOT =
{
"wx78",
"pyro",
},
NEUTRAL = {}, --empty, for modders to add to
PLURAL = {}, --empty, for modders to add to
}
MODCHARACTERMODES = {} --empty, for modders to add to
MAXITEMSLOTS = 15
EQUIPSLOTS =
{
HANDS = "hands",
HEAD = "head",
BODY = "body",
}
ITEMTAG =
{
FOOD = "food",
MEAT = "meat",
WEAPON = "weapon",
TOOL = "tool",
TREASURE = "treasure",
FUEL = "fuel",
FIRE = "fire",
STACKABLE = "stackable",
FX = "FX",
}
OCEAN_DEPTH =
{
SHALLOW = 1,
NORMAL = 2,
DEEP = 3,
VERY_DEEP = 4,
}
-- See map_painter.h
-- PUBLIC USE SPACE FOR MODS is 70 to 89 -- Mods using values outside of this range may find themselfs conflicting with future official content
GROUND =
{
INVALID = 255,
IMPASSABLE = 1,
ROAD = 2,
ROCKY = 3,
DIRT = 4,
SAVANNA = 5,
GRASS = 6,
FOREST = 7,
MARSH = 8,
WEB = 9,
WOODFLOOR = 10,
CARPET = 11,
CHECKER = 12,
-- CAVES
CAVE = 13,
FUNGUS = 14,
SINKHOLE = 15,
UNDERROCK = 16,
MUD = 17,
BRICK = 18,
BRICK_GLOW = 19,
TILES = 20,
TILES_GLOW = 21,
TRIM = 22,
TRIM_GLOW = 23,
FUNGUSRED = 24,
FUNGUSGREEN = 25,
--EXPANDED FLOOR TILES
DECIDUOUS = 30,
DESERT_DIRT = 31,
SCALE = 32,
LAVAARENA_FLOOR = 33,
LAVAARENA_TRIM = 34,
QUAGMIRE_PEATFOREST = 35,
QUAGMIRE_PARKFIELD = 36,
QUAGMIRE_PARKSTONE = 37,
QUAGMIRE_GATEWAY = 38,
QUAGMIRE_SOIL = 39,
QUAGMIRE_CITYSTONE = 41,
PEBBLEBEACH = 42,
METEOR = 43,
SHELLBEACH = 44,
ARCHIVE = 45,
FUNGUSMOON = 46,
FARMING_SOIL = 47,
-- PUBLIC USE SPACE FOR MODS is 70 to 109 --
--NOISE -- from 110 to 127 -- TODO: move noise tile range to > 255
FUNGUSMOON_NOISE = 120,
METEORMINE_NOISE = 121,
METEORCOAST_NOISE = 122,
DIRT_NOISE = 123,
ABYSS_NOISE = 124,
GROUND_NOISE = 125,
CAVE_NOISE = 126,
FUNGUS_NOISE = 127,
UNDERGROUND = 128, -- todo: incrase this to OCEAN_START once WALL_X have been removed
WALL_ROCKY = 151,
WALL_DIRT = 152,
WALL_MARSH = 153,
WALL_CAVE = 154,
WALL_FUNGUS = 155,
WALL_SINKHOLE = 156,
WALL_MUD = 157,
WALL_TOP = 158,
WALL_WOOD = 159,
WALL_HUNESTONE = 160,
WALL_HUNESTONE_GLOW = 161,
WALL_STONEEYE = 162,
WALL_STONEEYE_GLOW = 163,
FAKE_GROUND = 200, -- todo: change to 254 and retrofit maps
-- OCEAN TILES [201, 247]
OCEAN_START = 201, -- enum for checking if tile is ocean water
-- KLEI OCEAN TILES [201, 230]
OCEAN_COASTAL = 201,
OCEAN_COASTAL_SHORE = 202,
OCEAN_SWELL = 203,
OCEAN_ROUGH = 204,
OCEAN_BRINEPOOL = 205,
OCEAN_BRINEPOOL_SHORE = 206,
OCEAN_HAZARDOUS = 207,
OCEAN_WATERLOG = 208,
-- MODS OCEAN TILES [231, 247] <--PUBLIC USE SPACE FOR MODS --
OCEAN_END = 247, -- enum for checking if tile is ocean water
-- STILL_WATER_SHALLOW = 130,
-- STILL_WATER_DEEP = 131,
-- MOVING_WATER_SHALLOW = 132,
-- MOVING_WATER_DEEP = 133,
-- SALT_WATER_SHALLOW = 134,
-- SALT_WATER_DEEP = 135,
}
-- deprecated ground types
GROUND.OCEAN_REEF = GROUND.OCEAN_BRINEPOOL
GROUND.OCEAN_REEF_SHORE = GROUND.OCEAN_BRINEPOOL_SHORE
---------------------------------------------------------
SPECIAL_EVENTS =
{
NONE = "none",
HALLOWED_NIGHTS = "hallowed_nights",
WINTERS_FEAST = "winters_feast",
CARNIVAL = "crow_carnival",
YOTG = "year_of_the_gobbler",
YOTV = "year_of_the_varg",
YOTP = "year_of_the_pig",
YOTC = "year_of_the_carrat",
YOTB = "year_of_the_beefalo",
YOT_CATCOON = "year_of_the_catcoon",
}
WORLD_SPECIAL_EVENT = SPECIAL_EVENTS.NONE
--WORLD_SPECIAL_EVENT = IS_BETA and SPECIAL_EVENTS.YOT_CATCOON or SPECIAL_EVENTS.NONE
WORLD_EXTRA_EVENTS = {}
FESTIVAL_EVENTS =
{
NONE = "none",
LAVAARENA = "lavaarena",
QUAGMIRE = "quagmire",
}
WORLD_FESTIVAL_EVENT = FESTIVAL_EVENTS.NONE
PREVIOUS_FESTIVAL_EVENTS = { FESTIVAL_EVENTS.LAVAARENA, FESTIVAL_EVENTS.QUAGMIRE } --deprecated, use PREVIOUS_FESTIVAL_EVENTS_ORDER
PREVIOUS_FESTIVAL_EVENTS_ORDER =
{
{ id = FESTIVAL_EVENTS.LAVAARENA, season = 2 },
{ id = FESTIVAL_EVENTS.QUAGMIRE, season = 1 },
{ id = FESTIVAL_EVENTS.LAVAARENA, season = 1 },
}
IS_YEAR_OF_THE_SPECIAL_EVENTS =
{
[SPECIAL_EVENTS.YOTG] = true,
[SPECIAL_EVENTS.YOTV] = true,
[SPECIAL_EVENTS.YOTP] = true,
[SPECIAL_EVENTS.YOTC] = true,
[SPECIAL_EVENTS.YOTB] = true,
[SPECIAL_EVENTS.YOT_CATCOON] = true,
}
---------------------------------------------------------
-- Reminder: update event_deps.lua
SPECIAL_EVENT_GLOBAL_PREFABS = { WORLD_SPECIAL_EVENT.."_event_global" }
SPECIAL_EVENT_BACKEND_PREFABS = { WORLD_SPECIAL_EVENT.."_event_backend" }
SPECIAL_EVENT_FRONTEND_PREFABS = { WORLD_SPECIAL_EVENT.."_event_frontend" }
FESTIVAL_EVENT_GLOBAL_PREFABS = { WORLD_FESTIVAL_EVENT.."_fest_global" }
FESTIVAL_EVENT_BACKEND_PREFABS = { WORLD_FESTIVAL_EVENT.."_fest_backend" }
FESTIVAL_EVENT_FRONTEND_PREFABS = { WORLD_FESTIVAL_EVENT.."_fest_frontend" }
---------------------------------------------------------
--Used in preloadsounds.lua
---------------------------------------------------------
-- Reminder: update asset dependencies in frontend.lua --
---------------------------------------------------------
SPECIAL_EVENT_MUSIC =
{
--winter's feast carol
[SPECIAL_EVENTS.WINTERS_FEAST] =
{
-- bank = "music_frontend_winters_feast.fsb",
-- sound = "dontstarve/music/music_FE_WF",
bank = "music_frontend.fsb",
sound = "dontstarve/music/music_FE_wolfgang",
},
--year of the gobbler
[SPECIAL_EVENTS.YOTG] =
{
bank = "music_frontend_yotg.fsb",
sound = "dontstarve/music/music_FE_yotg",
},
--year of the varg
[SPECIAL_EVENTS.YOTV] =
{
bank = "music_frontend_yotg.fsb",
sound = "dontstarve/music/music_FE_yotg",
},
--year of the pig
[SPECIAL_EVENTS.YOTP] =
{
bank = "music_frontend_yotg.fsb",
sound = "dontstarve/music/music_FE_yotg",
},
--year of the carrat
[SPECIAL_EVENTS.YOTC] =
{
bank = "music_frontend_yotc.fsb",
sound = "dontstarve/music/music_FE_yotc",
},
--year of the beefalo
[SPECIAL_EVENTS.YOTB] =
{
bank = "music_frontend_yotb.fsb",
sound = "yotb_2021/music/FE",
},
[SPECIAL_EVENTS.YOT_CATCOON] =
{
bank = "music_frontend_yotg.fsb",
sound = "dontstarve/music/music_FE_yotg",
},
-- crow carnival
[SPECIAL_EVENTS.CARNIVAL] =
{
bank = "music_frontend.fsb",
sound = "dontstarve/music/music_FE_summerevent",
},
}
FESTIVAL_EVENT_MUSIC =
{
--the forge
[FESTIVAL_EVENTS.LAVAARENA] =
{
bank = "lava_arena.fsb",
sound = "dontstarve/music/lava_arena/FE_1_2",
},
--the gorge
[FESTIVAL_EVENTS.QUAGMIRE] =
{
bank = "quagmire.fsb",
sound = "dontstarve/quagmire/music/FE",
},
}
---------------------------------------------------------
local SPECIAL_EVENT_SKIN_TAGS =
{
[SPECIAL_EVENTS.HALLOWED_NIGHTS] = "COSTUME",
}
local FESTIVAL_EVENT_SKIN_TAGS =
{
}
local FESTIVAL_EVENT_INFO =
{
--the forge
[FESTIVAL_EVENTS.LAVAARENA] =
{
GAME_MODE = "lavaarena",
SERVER_NAME = "LavaArena",
FEMUSIC = "dontstarve/music/lava_arena/FE2",
STATS_FILE_PREFIX = "forge_stats",
LATEST_SEASON = 2,
},
--the gorge
[FESTIVAL_EVENTS.QUAGMIRE] =
{
GAME_MODE = "quagmire",
SERVER_NAME = "Quagmire",
FEMUSIC = nil, --no special FE music for the festival event screen
STATS_FILE_PREFIX = "thegorge_stats",
LATEST_SEASON = 1,
},
}
---------------------------------------------------------
-- Refers to holiday-specific events.
function IsSpecialEventActive(event)
return WORLD_SPECIAL_EVENT == event or WORLD_EXTRA_EVENTS[event] == true
end
function IsAnySpecialEventActive()
return WORLD_SPECIAL_EVENT ~= SPECIAL_EVENTS.NONE or not IsTableEmpty(WORLD_EXTRA_EVENTS)
end
function GetActiveSpecialEventCount()
return (WORLD_SPECIAL_EVENT ~= SPECIAL_EVENTS.NONE and 1 or 0) + GetTableSize(WORLD_EXTRA_EVENTS)
end
function GetFirstActiveSpecialEvent()
if WORLD_SPECIAL_EVENT ~= SPECIAL_EVENTS.NONE then
return WORLD_SPECIAL_EVENT
end
return next(WORLD_EXTRA_EVENTS), nil --, nil prevents the value from getting returned by next
end
function GetAllActiveEvents(special_event, extra_events)
local all_events = {}
if special_event then
all_events[special_event] = true
end
for event in pairs(extra_events or {}) do
all_events[event] = true
end
all_events[SPECIAL_EVENTS.NONE] = nil
return all_events
end
---------------------------------------------------------
-- Checks if any of the "Year of the <creature>" events are active
function IsAny_YearOfThe_EventActive()
if IS_YEAR_OF_THE_SPECIAL_EVENTS[WORLD_SPECIAL_EVENT] then
return true
end
for special_event in pairs(WORLD_EXTRA_EVENTS) do
if IS_YEAR_OF_THE_SPECIAL_EVENTS[special_event] then
return true
end
end
return false
end
function GetSpecialEventSkinTag()
return SPECIAL_EVENT_SKIN_TAGS[WORLD_SPECIAL_EVENT]
end
---------------------------------------------------------
-- Refers to intermittent scheduled events.
function IsFestivalEventActive(event)
return WORLD_FESTIVAL_EVENT == event
end
function IsPreviousFestivalEvent(event)
for _,prev_event in ipairs(PREVIOUS_FESTIVAL_EVENTS_ORDER) do
if prev_event.id == event then
return true
end
end
return false
end
function IsAnyFestivalEventActive()
return WORLD_FESTIVAL_EVENT ~= FESTIVAL_EVENTS.NONE
end
function GetFestivalEventSkinTag()
return FESTIVAL_EVENT_SKIN_TAGS[WORLD_FESTIVAL_EVENT]
end
function GetFestivalEventInfo()
return FESTIVAL_EVENT_INFO[WORLD_FESTIVAL_EVENT]
end
function GetFestivalEventSeasons(festival)
return FESTIVAL_EVENT_INFO[festival] ~= nil and FESTIVAL_EVENT_INFO[festival].LATEST_SEASON or 0
end
-- Used by C side. Do NOT rename without editing simulation.cpp
function GetActiveFestivalEventServerName()
local festival = IsAnyFestivalEventActive() and WORLD_FESTIVAL_EVENT
return GetFestivalEventServerName( festival, GetFestivalEventSeasons(festival) )
end
-- Used by C side. Do NOT rename without editing simulation.cpp
function GetActiveFestivalProductName()
return FESTIVAL_EVENT_INFO[WORLD_FESTIVAL_EVENT] ~= nil and FESTIVAL_EVENT_INFO[WORLD_FESTIVAL_EVENT].SERVER_NAME or ""
end
function GetFestivalEventServerName(festival, season)
if season == 1 then
return FESTIVAL_EVENT_INFO[festival] ~= nil and FESTIVAL_EVENT_INFO[festival].SERVER_NAME or ""
else
return FESTIVAL_EVENT_INFO[festival] ~= nil and (string.format( "%s_s%d", FESTIVAL_EVENT_INFO[festival].SERVER_NAME, season )) or ""
end
end
function GetActiveFestivalEventStatsFilePrefix()
local festival = IsAnyFestivalEventActive() and WORLD_FESTIVAL_EVENT
return FESTIVAL_EVENT_INFO[festival] ~= nil and FESTIVAL_EVENT_INFO[festival].STATS_FILE_PREFIX or "stats"
end
function GetActiveFestivalEventAchievementStrings()
--Note, this requires the festival name to have the same spelling at the name in the STRINGS.UI.ACHIEVEMENTS string table
local festival = IsAnyFestivalEventActive() and WORLD_FESTIVAL_EVENT
return STRINGS.UI.ACHIEVEMENTS[festival:upper()]
end
-- To enable/disable the tournament, change the return value of Server_IsTournamentActive()
function Server_IsTournamentActive()
-- for internal server use only
return false
end
function Client_IsTournamentActive() -- ticket_name is optional
return Server_IsTournamentActive() and IsSteam()
end
---------------------------------------------------------
--If changing this logic, remember to update preloadsounds.lua
--default:
-- bank = "music_frontend.fsb"
-- sound = "dontstarve/music/music_FE"
FE_MUSIC =
(FESTIVAL_EVENT_MUSIC[WORLD_FESTIVAL_EVENT] ~= nil and FESTIVAL_EVENT_MUSIC[WORLD_FESTIVAL_EVENT].sound) or
(SPECIAL_EVENT_MUSIC[WORLD_SPECIAL_EVENT] ~= nil and SPECIAL_EVENT_MUSIC[WORLD_SPECIAL_EVENT].sound) or
--"dontstarve/music/music_FE"
"dontstarve/music/music_FE_WX"
--"dontstarve/music/music_moonstorm_FE"
--"dontstarve/music/music_FE_webber"
--"dontstarve/music/music_FE_wanda"
--"terraria1/common/music_main_eot"
---------------------------------------------------------
NUM_HALLOWEENCANDY = 14
NUM_HALLOWEEN_ORNAMENTS = 6
NUM_WINTERFOOD = 9