From 8b69c621114325d2fbc3a60cabe0c92a2a87d711 Mon Sep 17 00:00:00 2001
From: MascaraSnake <jonassauer27@gmail.com>
Date: Tue, 28 Dec 2021 08:19:56 +0100
Subject: [PATCH] Adapt more scenery items to UDMF

---
 extras/conf/udb/Includes/SRB222_things.cfg | 36 ++++++++++++++++++++++
 src/p_mobj.c                               | 12 ++++----
 src/p_setup.c                              | 15 +++++++++
 3 files changed, 57 insertions(+), 6 deletions(-)

diff --git a/extras/conf/udb/Includes/SRB222_things.cfg b/extras/conf/udb/Includes/SRB222_things.cfg
index 4aa66b87d3..250934fadf 100644
--- a/extras/conf/udb/Includes/SRB222_things.cfg
+++ b/extras/conf/udb/Includes/SRB222_things.cfg
@@ -5351,6 +5351,10 @@ udmf
 			width = 8;
 			height = 16;
 			hangs = 1;
+			arg0
+			{
+				title = "Dripping delay";
+			}
 		}
 		1003
 		{
@@ -5386,6 +5390,12 @@ udmf
 			sprite = "KELPA0";
 			width = 16;
 			height = 292;
+			arg0
+			{
+				title = "Double size?";
+				type = 11;
+				enum = "noyes";
+			}
 		}
 		1008
 		{
@@ -5393,6 +5403,12 @@ udmf
 			sprite = "DSTGA0";
 			width = 8;
 			height = 116;
+			arg0
+			{
+				title = "Double size?";
+				type = 11;
+				enum = "noyes";
+			}
 		}
 		1010
 		{
@@ -5408,6 +5424,12 @@ udmf
 			sprite = "DSTGA0";
 			width = 8;
 			height = 116;
+			arg0
+			{
+				title = "Double size?";
+				type = 11;
+				enum = "noyes";
+			}
 		}
 		1012
 		{
@@ -6240,6 +6262,16 @@ udmf
 			sprite = "LFALF0";
 			width = 30;
 			height = 32;
+			arg0
+			{
+				title = "Initial delay";
+			}
+			arg1
+			{
+				title = "Double size?";
+				type = 11;
+				enum = "noyes";
+			}
 		}
 		1305
 		{
@@ -7081,6 +7113,10 @@ udmf
 			sprite = "FMCEA0";
 			width = 18;
 			height = 28;
+			arg0
+			{
+				title = "Initial delay";
+			}
 		}
 		2001
 		{
diff --git a/src/p_mobj.c b/src/p_mobj.c
index 22a5007154..aaefa9fedc 100644
--- a/src/p_mobj.c
+++ b/src/p_mobj.c
@@ -12791,7 +12791,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
 		}
 		break;
 	case MT_WATERDRIP:
-		mobj->tics = 3*TICRATE + mthing->angle;
+		mobj->tics = 3*TICRATE + mthing->args[0];
 		break;
 	case MT_FLAMEJET:
 	case MT_VERTICALFLAMEJET:
@@ -12856,7 +12856,7 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
 	case MT_DSZSTALAGMITE:
 	case MT_DSZ2STALAGMITE:
 	case MT_KELP:
-		if (mthing->options & MTF_OBJECTSPECIAL) { // make mobj twice as big as normal
+		if (mthing->args[0]) { // make mobj twice as big as normal
 			P_SetScale(mobj, 2*mobj->scale); // not 2*FRACUNIT in case of something like the old ERZ3 mode
 			mobj->destscale = mobj->scale;
 		}
@@ -12896,12 +12896,12 @@ static boolean P_SetupSpawnedMapThing(mapthing_t *mthing, mobj_t *mobj, boolean
 	}
 	break;
 	case MT_SMASHINGSPIKEBALL:
-		if (mthing->angle > 0)
-			mobj->tics += mthing->angle;
+		if (mthing->args[0] > 0)
+			mobj->tics += mthing->args[0];
 		break;
 	case MT_LAVAFALL:
-		mobj->fuse = 30 + mthing->angle;
-		if (mthing->options & MTF_AMBUSH)
+		mobj->fuse = 30 + mthing->args[0];
+		if (mthing->args[1])
 		{
 			P_SetScale(mobj, 2*mobj->scale);
 			mobj->destscale = mobj->scale;
diff --git a/src/p_setup.c b/src/p_setup.c
index 3a7b70b958..b25b3aa146 100644
--- a/src/p_setup.c
+++ b/src/p_setup.c
@@ -5086,6 +5086,14 @@ static void P_ConvertBinaryMap(void)
 		case 780: //Skybox
 			mapthings[i].args[0] = !!(mapthings[i].options & MTF_OBJECTSPECIAL);
 			break;
+		case 1002: //Dripping water
+			mapthings[i].args[0] = mapthings[i].angle;
+			break;
+		case 1007: //Kelp
+		case 1008: //Stalagmite (DSZ1)
+		case 1011: //Stalagmite (DSZ2)
+			mapthings[i].args[0] = !!(mapthings[i].options & MTF_OBJECTSPECIAL);
+			break;
 		case 1104: //Mace spawnpoint
 		case 1105: //Chain with maces spawnpoint
 		case 1106: //Chained spring spawnpoint
@@ -5173,6 +5181,10 @@ static void P_ConvertBinaryMap(void)
 			mapthings[i].args[1] = ((mapthings[i].angle >> 10) & 7)*TICRATE/2;
 			mapthings[i].args[2] = 80 - 5*mapthings[i].extrainfo;
 			break;
+		case 1304: //Lavafall
+			mapthings[i].args[0] = mapthings[i].angle;
+			mapthings[i].args[1] = !!(mapthings[i].options & MTF_AMBUSH);
+			break;
 		case 1700: //Axis
 			mapthings[i].args[2] = mapthings[i].angle & 16383;
 			mapthings[i].args[3] = !!(mapthings[i].angle & 16384);
@@ -5223,6 +5235,9 @@ static void P_ConvertBinaryMap(void)
 		case 1807: //Axe
 			mapthings[i].args[0] = LE_AXE;
 			break;
+		case 2000: //Smashing spikeball
+			mapthings[i].args[0] = mapthings[i].angle;
+			break;
 		case 2006: //Jack-o'-lantern 1
 		case 2007: //Jack-o'-lantern 2
 		case 2008: //Jack-o'-lantern 3
-- 
GitLab