Skip to content

Commit 3eba035

Browse files
author
dashodanger
authored
Merge pull request #677 from GTD-Carthage/content-unstable
Upstream sync
2 parents 71c17dd + 2ece529 commit 3eba035

File tree

5 files changed

+176
-61
lines changed

5 files changed

+176
-61
lines changed
-208 Bytes
Binary file not shown.

modules/zdoom_otex.lua

Lines changed: 123 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,17 @@ OTEX_DIRECT_REMOVALS =
9696
{
9797
"OMRBLA90",
9898
"OMRBLA91",
99-
"OMBRLA92",
100-
"OMBRLA93",
101-
"OMBRLA94",
99+
"OMRBLA92",
100+
"OMRBLA93",
101+
"OMRBLA94",
102102

103-
"OMBRLC90",
103+
"OMRBLC90",
104104

105-
"OMBRLF29",
106-
"OMBRLF38",
107-
"OMBRLF90",
105+
"OMRBLF29",
106+
"OMRBLF38",
107+
"OMRBLF90",
108108

109-
"OMBRLG90",
109+
"OMRBLG90",
110110

111111
"OMRBLI92",
112112
"OMRBLI93",
@@ -119,11 +119,11 @@ OTEX_DIRECT_REMOVALS =
119119
"OMRBLO28",
120120
"OMRBLO29",
121121

122-
"OMBRLP90",
123-
"OMBRLP91",
122+
"OMRBLP90",
123+
"OMRBLP91",
124124

125-
"OMBRLR90",
126-
"OMBRLR94"
125+
"OMRBLR90",
126+
"OMRBLR94"
127127
}
128128
},
129129

@@ -435,18 +435,18 @@ OTEX_SPECIAL_RESOURCES =
435435
liquid_defs =
436436
{
437437
otex_blood = { mat="OBLODA01", special=0},
438-
otex_goop = { mat="OGOOPY01", special=0},
439-
otex_ice = { mat="OICYWA01", special=0},
438+
otex_goop = { mat="OGOOPY01", light_add=16, special=0},
439+
otex_ice = { mat="OICYWA01", light_add=8, special=0},
440440

441-
otex_lavaA1 = { mat="OLAVAA01", light_add=24, special=5, damage=10},
442-
otex_lavaA2 = { mat="OLAVAA02", light_add=24, special=5, damage=10},
443-
otex_lavaB1 = { mat="OLAVAB01", light_add=24, special=5, damage=10},
444-
otex_lavaC1 = { mat="OLAVAC01", light_add=24, special=5, damage=10},
445-
otex_lavaD1 = { mat="OLAVAD01", light_add=24, special=5, damage=10},
446-
otex_lavaE1 = { mat="OLAVAE01", light_add=24, special=5, damage=10},
447-
otex_lavaF1 = { mat="OLAVAF01", light_add=24, special=5, damage=10},
441+
otex_lavaA1 = { mat="OLAVAA01", light_add=56, special=5, damage=10},
442+
otex_lavaA2 = { mat="OLAVAA02", light_add=56, special=5, damage=10},
443+
otex_lavaB1 = { mat="OLAVAB01", light_add=56, special=5, damage=10},
444+
otex_lavaC1 = { mat="OLAVAC01", light_add=56, special=5, damage=10},
445+
otex_lavaD1 = { mat="OLAVAD01", light_add=56, special=5, damage=10},
446+
otex_lavaE1 = { mat="OLAVAE01", light_add=56, special=5, damage=10},
447+
otex_lavaF1 = { mat="OLAVAF01", light_add=56, special=5, damage=10},
448448

449-
otex_nukage = { mat="ONUKEA01", light_add=16, special=7, damage=5},
449+
otex_nukage = { mat="ONUKEA01", light_add=24, special=7, damage=5},
450450

451451
otex_sludge = { mat="OSLUDG01", special=0},
452452
otex_poop = { mat="OPOOPY01", special=0},
@@ -520,21 +520,119 @@ OTEX_SPECIAL_RESOURCES =
520520

521521
OTEX_GLOWING_FLATS =
522522
[[
523-
OBLODA01
523+
OBLODA01
524+
OBLODA02
525+
OBLODA03
526+
OBLODA04
527+
OBLODA05
528+
OBLODA06
529+
OBLODA07
530+
OBLODA08
531+
524532
OGOOPY01
533+
OGOOPY02
534+
OGOOPY03
535+
OGOOPY04
536+
OGOOPY05
537+
OGOOPY06
538+
OGOOPY07
539+
OGOOPY08
540+
525541
OICYWA01
542+
OICYWA02
543+
OICYWA03
544+
OICYWA04
545+
OICYWA05
546+
OICYWA06
547+
OICYWA07
548+
OICYWA08
549+
526550
OLAVAA01
527551
OLAVAA02
528552
OLAVAB01
553+
529554
OLAVAC01
555+
OLAVAC02
556+
OLAVAC03
557+
OLAVAC04
558+
OLAVAC05
559+
OLAVAC06
560+
OLAVAC07
561+
OLAVAC08
562+
530563
OLAVAD01
564+
OLAVAD02
565+
OLAVAD03
566+
OLAVAD04
567+
OLAVAD05
568+
OLAVAD06
569+
OLAVAD07
570+
OLAVAD08
571+
531572
OLAVAE01
573+
OLAVAE02
574+
OLAVAE03
575+
OLAVAE04
576+
OLAVAE05
577+
OLAVAE06
578+
OLAVAE07
579+
OLAVAE08
580+
532581
OLAVAF01
582+
OLAVAF02
583+
OLAVAF03
584+
OLAVAF04
585+
OLAVAF05
586+
OLAVAF06
587+
OLAVAF07
588+
OLAVAF08
589+
OLAVAF09
590+
OLAVAF10
591+
533592
ONUKEA01
593+
ONUKEA02
594+
ONUKEA03
595+
ONUKEA04
596+
ONUKEA05
597+
ONUKEA06
598+
ONUKEA07
599+
ONUKEA08
600+
534601
OSLUDG01
602+
OSLUDG02
603+
OSLUDG03
604+
OSLUDG04
605+
OSLUDG05
606+
OSLUDG06
607+
OSLUDG07
608+
OSLUDG08
609+
535610
OPOOPY01
611+
OPOOPY02
612+
OPOOPY03
613+
OPOOPY04
614+
OPOOPY05
615+
OPOOPY06
616+
OPOOPY07
617+
OPOOPY08
618+
536619
OTAR__01
620+
OTAR__02
621+
OTAR__03
622+
OTAR__04
623+
OTAR__05
624+
OTAR__06
625+
OTAR__07
626+
OTAR__08
627+
537628
OWATER01
629+
OWATER02
630+
OWATER03
631+
OWATER04
632+
OWATER05
633+
OWATER06
634+
OWATER07
635+
OWATER08
538636
]]
539637

540638
function OTEX_PROC_MODULE.setup(self)
@@ -546,7 +644,6 @@ end
546644

547645
function OTEX_PROC_MODULE.synthesize_procedural_themes()
548646
local resource_tab = {}
549-
local r
550647

551648
local function pick_unique_texture(table, tex_group, total_tries)
552649
local tex
@@ -856,7 +953,7 @@ end
856953

857954

858955
function OTEX_PROC_MODULE.all_done()
859-
string.gsub(
956+
GAME.RESOURCES.GLOWING_FLATS_GLDEFS = string.gsub(
860957
GAME.RESOURCES.GLOWING_FLATS_GLDEFS,
861958
"GLOWFLTS",
862959
OTEX_GLOWING_FLATS
@@ -887,7 +984,7 @@ OB_MODULES["otex_proc_module"] =
887984
},
888985

889986
tooltip = _("If enabled, generates room themes using OTEX based on a resource table. "..
890-
"OTEX must be manually loaded in the sourceport. " ..
987+
"OTEX WAD (not pk3 version) must be manually loaded in the sourceport. " ..
891988
"Includes textures and flats only, no patches.\n\n" ..
892989
"Currently does not make any kind of sensibly curated room themes."),
893990

scripts/grower.lua

Lines changed: 50 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,14 +1184,10 @@ function Grower_decide_extents(LEVEL)
11841184
end
11851185

11861186
-- linear start code
1187-
if PARAM.linear_start then
1188-
if PARAM.linear_start ~= "default" then
1189-
if PARAM.linear_start == "all" then
1190-
LEVEL.has_linear_start = true
1191-
elseif rand.odds(math.floor(PARAM.linear_start)) then
1192-
LEVEL.has_linear_start = true
1193-
end
1194-
end
1187+
if PARAM.linear_start
1188+
and PARAM.linear_start ~= "default"
1189+
and PARAM.linear_start == "all" then
1190+
LEVEL.has_linear_start = true
11951191
end
11961192

11971193
if LEVEL.has_linear_start then
@@ -1523,9 +1519,6 @@ end
15231519

15241520

15251521
function Grower_kill_room(SEEDS, LEVEL, R)
1526-
1527-
local hallway_neighbor
1528-
15291522
gui.debugf("Killing " .. R.id .. "\n")
15301523

15311524
local function turn_joiner_into_closet(R2, chunk)
@@ -3626,7 +3619,7 @@ end
36263619

36273620
-- SUCCESS --
36283621

3629-
gui.debugf("APPLIED rule: " .. cur_rule.name .. " in ROOM_" .. R.id.. "\n")
3622+
gui.debugf("ROOM_" .. R.id .. " APPLIED rule: " .. cur_rule.name .. "\n")
36303623

36313624
if pass == "grow" then
36323625
if R.shapes_applied then
@@ -3989,14 +3982,17 @@ function Grower_grow_room(SEEDS, LEVEL, R)
39893982
Grower_grammatical_room(SEEDS, LEVEL, R, "grow")
39903983

39913984
if is_too_small(R) then
3985+
39923986
if R.grow_parent and R.grow_parent.is_start
39933987
and R.small_room then
39943988
return
39953989
end
3990+
39963991
if R.prelim_conn_num == 1 then
39973992
Grower_kill_room(SEEDS, LEVEL, R)
39983993
return
39993994
end
3995+
40003996
end
40013997
end
40023998

@@ -4418,17 +4414,17 @@ gui.debugf("=== Coverage seeds: %d/%d rooms: %d/%d\n",
44184414
end
44194415
end
44204416

4421-
--[[if R.prelim_conn_num(R, LEVEL) == 1 and R.areas[1].svolume <= 8
4422-
and #R.areas == 1 and not R.is_start then
4423-
gui.printf("Prelim conn num: " .. R.prelim_conn_num(R, LEVEL) .. "\n")
4424-
gui.printf(table.tostr(R, 2))
4425-
local hallway_parent
4426-
if R.parent_R and R.parent_R.is_hallway then
4427-
hallway_parent = R.parent_R
4428-
end
4429-
Grower_kill_room(SEEDS, LEVEL, R)
4430-
if hallway_parent then Grower_kill_room(SEEDS, LEVEL, hallway_parent) end
4431-
end]]
4417+
--[[if R.prelim_conn_num(R, LEVEL) == 1 and R.areas[1].svolume <= 8
4418+
and #R.areas == 1 and not R.is_start then
4419+
gui.printf("Prelim conn num: " .. R.prelim_conn_num(R, LEVEL) .. "\n")
4420+
gui.printf(table.tostr(R, 2))
4421+
local hallway_parent
4422+
if R.parent_R and R.parent_R.is_hallway then
4423+
hallway_parent = R.parent_R
4424+
end
4425+
Grower_kill_room(SEEDS, LEVEL, R)
4426+
if hallway_parent then Grower_kill_room(SEEDS, LEVEL, hallway_parent) end
4427+
end]]
44324428

44334429
end
44344430
end
@@ -4496,11 +4492,11 @@ gui.debugf("=== Coverage seeds: %d/%d rooms: %d/%d\n",
44964492

44974493
gui.printf("Oh noes! Attempting emergency sprout in ROOM_" .. R.id .. "!!!\n")
44984494
Grower_grammatical_room(SEEDS, LEVEL, R, "sprout", "is_emergency")
4495+
Grower_grow_room(SEEDS, LEVEL, R)
44994496
end
45004497

4501-
if not R.emergency_sprout_attempts then
4502-
return "oof"
4503-
elseif R.emergency_sprout_attempts > 1 then
4498+
if not R.emergency_sprout_attempts
4499+
or (R.emergency_sprout_attempts and R.emergency_sprout_attempts > 1) then
45044500
return "oof"
45054501
end
45064502
return "yas queen"
@@ -4552,16 +4548,23 @@ gui.debugf("=== Coverage seeds: %d/%d rooms: %d/%d\n",
45524548
expand_limits()
45534549
emergency_sprouts()
45544550

4555-
if not LEVEL.is_procedural_gotcha
4556-
and (#LEVEL.rooms < ((LEVEL.min_rooms + LEVEL.max_rooms) / 2)) then
4557-
if emergency_linear_sprouts() == "oof" then
4558-
emergency_teleport_break(LEVEL)
4551+
if not LEVEL.is_procedural_gotcha then
4552+
4553+
-- levels that don't reach at least
4554+
-- half the amount of expected maximum rooms
4555+
if (#LEVEL.rooms < ((LEVEL.min_rooms + LEVEL.max_rooms) / 2)) then
4556+
if emergency_linear_sprouts() == "oof" then
4557+
emergency_teleport_break(LEVEL)
4558+
end
45594559
end
4560-
elseif #LEVEL.rooms <= 3 and not LEVEL.is_procedural_gotcha
4561-
and LEVEL.cur_coverage <= LEVEL.min_coverage then
4562-
if emergency_linear_sprouts() == "oof" then
4563-
emergency_teleport_break(LEVEL)
4560+
4561+
-- levels that don't reach the prefered coverage
4562+
if (LEVEL.cur_coverage <= LEVEL.min_coverage ) then
4563+
if emergency_linear_sprouts() == "oof" then
4564+
emergency_teleport_break(LEVEL)
4565+
end
45644566
end
4567+
45654568
end
45664569

45674570
--[[if LEVEL.cur_coverage <= LEVEL.min_coverage / 4
@@ -4575,6 +4578,7 @@ gui.debugf("=== Coverage seeds: %d/%d rooms: %d/%d\n",
45754578
end]]
45764579
end
45774580

4581+
-- force grow child rooms from start rooms
45784582
if #LEVEL.rooms == 2 then
45794583
gui.printf("BALLS! " .. MAX_LOOP .. "\n")
45804584
for _,R in pairs(LEVEL.rooms) do
@@ -4607,6 +4611,18 @@ gui.debugf("=== Coverage seeds: %d/%d rooms: %d/%d\n",
46074611
end
46084612
end
46094613

4614+
-- remove ungrown teleporter trunks
4615+
for _,R in pairs(LEVEL.rooms) do
4616+
if R.is_root and R.is_grown and #R.trunk.rooms == 1
4617+
and R:calc_walk_vol() <= 24 and not R.is_start then
4618+
gui.printf("Killed teleporter ROOM_" .. R.id .. "\n")
4619+
gui.printf(table.tostr(R.trunk.rooms,1) .. "\n")
4620+
gui.printf(table.tostr(R,2) .. "\n")
4621+
Grower_kill_room(SEEDS, LEVEL, R)
4622+
--Grower_kill_a_trunk(LEVEL, R.trunk)
4623+
end
4624+
end
4625+
46104626
end
46114627

46124628

scripts/room.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,8 @@ function ROOM_CLASS.calc_walk_vol(R)
384384
-- this should not happen
385385
if vol < 1 then vol = 1 end
386386

387+
R.walk_vol = vol
388+
387389
return vol
388390
end
389391

scripts/shapes.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6599,7 +6599,7 @@ GROW_CAUSEWAY_WATERLOCKED_CROSSED_OUT =
65996599

66006600
GROW_CAUSEWAY_WATERLOCKED_CENTER_PILLAR =
66016601
{
6602-
prob = 35,
6602+
prob = 45,
66036603
skip_prob = 80,
66046604

66056605
structure =

0 commit comments

Comments
 (0)