# User:Ogmobot/Midas Touch Patch
diff --git a/include/artifact.h b/include/artifact.h
index 987c0bf6..d45229b1 100644
--- a/include/artifact.h
+++ b/include/artifact.h
@@ -68,7 +68,8 @@ enum invoke_prop_types {
     CREATE_PORTAL,
     ENLIGHTENING,
     CREATE_AMMO,
-    PHASING
+    PHASING,
+    CHANGE_MATERIAL
 };
 
 #endif /* ARTIFACT_H */
diff --git a/include/artilist.h b/include/artilist.h
index d2a8c447..119a7a0b 100644
--- a/include/artilist.h
+++ b/include/artilist.h
@@ -221,6 +221,10 @@ STATIC_OVL NEARDATA struct artifact artilist[] = {
     A("Luck Blade", BROADSWORD, (SPFX_RESTR | SPFX_LUCK | SPFX_INTEL), 0, 0,
       PHYS(5,6), NO_DFNS, NO_CARY, 0, A_CHAOTIC, PM_CONVICT, NON_PM, 3000L,
       NO_COLOR),
+    /* Golden gauntlets that turn wielded items into gold. These belong to Croesus.
+     */
+    A("Midas Touch", GAUNTLETS, (SPFX_NOGEN | SPFX_RESTR | SPFX_DEFN), 0, 0, NO_ATTK, DFNS(AD_DISE),
+      NO_CARY, CHANGE_MATERIAL, A_NEUTRAL, NON_PM, NON_PM, 5000L, NO_COLOR),
 
     /*
      *      The artifacts for the quest dungeon, all self-willed.
diff --git a/include/extern.h b/include/extern.h
index 13ce605c..b99b2ca4 100644
--- a/include/extern.h
+++ b/include/extern.h
@@ -104,6 +104,7 @@ E void FDECL(retouch_equipment, (int));
 E void NDECL(mkot_trap_warn);
 E boolean FDECL(is_magic_key, (struct monst *, struct obj *));
 E struct obj *FDECL(has_magic_key, (struct monst *));
+E boolean FDECL(change_material, (struct obj *, int mat));
 
 /* ### attrib.c ### */
 
diff --git a/src/artifact.c b/src/artifact.c
index 1f9ebdd0..21f2dfbc 100644
--- a/src/artifact.c
+++ b/src/artifact.c
@@ -15,6 +15,8 @@
  */
 
 extern boolean notonhead; /* for long worms */
+extern const int matprices[];
+extern const int matdensities[];
 
 #define get_artifact(o) \
     (((o) &amp;&amp; (o)-&gt;oartifact)&nbsp;? &amp;artilist[(int) (o)-&gt;oartifact]&nbsp;: 0)
@@ -2146,6 +2148,24 @@ struct obj *obj;
             incr_itimeout(&amp;HPasses_walls, (50 + rnd(100)));
             obj-&gt;age += HPasses_walls; /* Time begins after phasing ends */
             break;
+        case CHANGE_MATERIAL: {
+            int mat, tryct = 0;
+            if (oart == &amp;artilist[ART_MIDAS_TOUCH])
+                /* Transform wielded item into gold, if possible */
+                mat = GOLD;
+            else if (uwep) {
+                /* Transform wielded item into something different */
+                mat = uwep-&gt;material;
+                while ((mat == uwep-&gt;material
+                       || (mat == objects[uwep-&gt;otyp].oc_material &amp;&amp; rn2(3))
+                       || !valid_obj_material(uwep, mat)) &amp;&amp; tryct++ &lt; 100)
+                    mat = rnd(NUM_MATERIAL_TYPES - 1);
+            } else
+                mat = 0; /* Should always be invalid */
+            if (!change_material(uwep, mat))
+                goto nothing_special;
+            break;
+        }
         }
     } else {
         long eprop = (u.uprops[oart-&gt;inv_prop].extrinsic ^= W_ARTI),
@@ -2802,4 +2822,30 @@ struct monst *mon; /* if null, hero assumed */
     return (struct obj *) 0;
 }
 
+/* Changes an object into the given material, if possible.
+ * TODO: allow some objects to change to a material that's not
+ *       usually allowed for it; e.g. gold orcish items.
+ */
+boolean
+change_material(obj, mat)
+struct obj *obj;
+int mat;
+{
+    if (obj &amp;&amp; obj-&gt;material&nbsp;!= mat &amp;&amp; !obj-&gt;oartifact
+        &amp;&amp; valid_obj_material(obj, mat)) {
+        if (!Blind)
+            pline("%s %s!", Tobjnam(obj, "become"), materialnm[mat]);
+        else if ((obj == uwep || obj == uswapwep)
+                 &amp;&amp; (matdensities[obj-&gt;material]&nbsp;!= matdensities[mat]))
+            pline("%s %s.", Tobjnam(obj, "feel"),
+                  matdensities[obj-&gt;material] &gt; matdensities[mat]
+                  ? "lighter"&nbsp;: "heavier");
+        if (carried(obj) &amp;&amp; matprices[obj-&gt;material] &gt; matprices[mat])
+            costly_alteration(obj, COST_DEGRD);
+        set_material(obj, mat);
+        return TRUE;
+    } else
+        return FALSE;
+}
+
 /*artifact.c*/
diff --git a/src/do_name.c b/src/do_name.c
index 8e037c37..2eea2482 100644
--- a/src/do_name.c
+++ b/src/do_name.c
@@ -1350,6 +1350,9 @@ const char *name;
         case ART_IRON_BALL_OF_LIBERATION:
             set_material(obj, IRON);
             break;
+        case ART_MIDAS_TOUCH:
+            set_material(obj, GOLD);
+            break;
         default:
             /* prevent any wishes for materials on an artifact */
             set_material(obj, objects[obj-&gt;otyp].oc_material);
diff --git a/src/makemon.c b/src/makemon.c
index ea2c0bbe..f2ad939d 100644
--- a/src/makemon.c
+++ b/src/makemon.c
@@ -921,22 +921,29 @@ register struct monst *mtmp;
             (void) mongets(mtmp, TWO_HANDED_SWORD);
             struct obj* received = m_carrying(mtmp, TWO_HANDED_SWORD);
             if (received)
-                received-&gt;material = GOLD;
+                set_material(received, GOLD);
             int item = rn2(2)&nbsp;? BANDED_MAIL&nbsp;: PLATE_MAIL;
             (void) mongets(mtmp, item);
             received = m_carrying(mtmp, item);
             if (received)
-                received-&gt;material = GOLD;
-            int item2 = rn2(2)&nbsp;? HELMET&nbsp;: DWARVISH_HELM;
-            (void) mongets(mtmp, item2);
-            received = m_carrying(mtmp, item2);
+                set_material(received, GOLD);
+            item = rn2(2)&nbsp;? HELMET&nbsp;: DWARVISH_HELM;
+            (void) mongets(mtmp, item);
+            received = m_carrying(mtmp, item);
             if (received)
-                received-&gt;material = GOLD;
-            int item3 = rn2(2)&nbsp;? KICKING_BOOTS&nbsp;: DWARVISH_BOOTS;
-            (void) mongets(mtmp, item3);
-            received = m_carrying(mtmp, item3);
+                set_material(received, GOLD);
+            item = rn2(2)&nbsp;? KICKING_BOOTS&nbsp;: DWARVISH_BOOTS;
+            (void) mongets(mtmp, item);
+            received = m_carrying(mtmp, item);
             if (received)
-                received-&gt;material = GOLD;
+                set_material(received, GOLD);
+            otmp = mksobj(GAUNTLETS, FALSE, FALSE);
+            otmp-&gt;material = GOLD;
+            if (!rn2(2)) {
+                otmp = oname(otmp, artiname(ART_MIDAS_TOUCH));
+                curse(otmp);
+            }
+            (void) mpickobj(mtmp, otmp);
         }
         break;
 
diff --git a/src/mkobj.c b/src/mkobj.c
index c977853a..f2b1e9cc 100644
--- a/src/mkobj.c
+++ b/src/mkobj.c
@@ -1459,7 +1459,6 @@ unsigned onoff; /* 1 or 0 */
  * counterpart, and things such as wooden plate mails were incredibly
  * overpowered by weighing about one-tenth as much as the iron counterpart.
  * Instead, use arbitrary units. */
-STATIC_DCL
 const int matdensities[] = {
     0,   // will cause div/0 errors if anything is this material
     10,  // LIQUID