Skip to content

Instantly share code, notes, and snippets.

@kui
Last active November 13, 2018 13:08
Show Gist options
  • Save kui/79944b295c3388880e2acb0f381c5b07 to your computer and use it in GitHub Desktop.
Save kui/79944b295c3388880e2acb0f381c5b07 to your computer and use it in GitHub Desktop.
I DO NOT want to be a Morlock at 7 Days to Die α16.4

In your terminal:

$ patch -p1 < auto-miner.patch

And you might need to edit some duplicated IDs.

diff --git a/Data/Config/Localization.txt b/Data/Config/Localization.txt
index 7e2b9c9..cc49c78 100644
--- a/Data/Config/Localization.txt
+++ b/Data/Config/Localization.txt
@@ -4907,4 +4907,6 @@ inpActGuiRightclick,UI,Controls Dialog,,UI secondary click,,,,
ttBedrollGone,UI,Tooltip,New,Your bedroll is gone,,Dein Schlafsack ist verschwunden,,
extinguishFireBuffName,buffs,Buff,New,Extinguish Fire,,Lösche Feuer,,
extinguishFireBuffDesc,buffs,Buff,New,If you happen to be on fire then this will put out the fire and prevent another while the buff remains active.,,Solltest Du in Flammen stehen dann löscht dies das Feuer und verhindert ein neues solange der Effekt aktiv ist.,,
-DroppedLootContainer,entityclasses,Entity Info,New,Dropped Loot,,,,
\ No newline at end of file
+DroppedLootContainer,entityclasses,Entity Info,New,Dropped Loot,,,,
+miner,blocks,Station,,Miner,,
+minerDesc,blocks,Station,,"Used to mine resources from the ground. It will mine the ground and be lootable after a day, it can then be refueled with 1000 Gas!",,
diff --git a/Data/Config/blocks.xml b/Data/Config/blocks.xml
index 29eb62b..b926544 100644
--- a/Data/Config/blocks.xml
+++ b/Data/Config/blocks.xml
@@ -15914,4 +15914,47 @@ kind of free
<drop event="Destroy" name="brokenGlass" count="1,4"/>
</block>
+<block id="2032" name="minerProcessing">
+ <property name="CustomIcon" value="controlPanelTop06" />
+ <property name="Material" value="Msteel"/>
+ <property name="Shape" value="Ext3dModel" />
+ <property name="Mesh" value="models" />
+ <property name="Model" value="Industrial/control_panel_top_06" param1="main_mesh" />
+ <property name="Place" value="TowardsPlacerInverted" />
+ <property class="RepairItems">
+ <property name="forgedSteel" value="10"/>
+ </property>
+ <drop event="Destroy" name="miner" count="1"/>
+ <property name="Class" value="PlantGrowing"/>
+ <property name="PlantGrowing.FertileLevel" value="0"/>
+ <property name="PlantGrowing.Next" value="miner"/>
+ <property name="PlantGrowing.GrowthRate" value="60"/>
+ <property name="PlantGrowing.IsRandom" value="false"/>
+ <property name="PlantGrowing.LightLevelStay" value="0"/>
+ <property name="PlantGrowing.GrowIfAnythinOnTop" value="true"/>
+ <property name="PlantGrowing.LightLevelGrow" value="0"/>
+</block>
+<block id="2033" name="miner">
+ <property name="CustomIcon" value="controlPanelTop06" />
+ <property name="DescriptionKey" value="minerDesc"/>
+ <property name="Class" value="Loot" />
+ <property name="LootList" value="100" />
+ <property name="Material" value="Msteel"/>
+ <property name="Shape" value="Ext3dModel" />
+ <property name="Mesh" value="models" />
+ <property name="Model" value="Industrial/control_panel_top_06" param1="main_mesh" />
+ <property name="Place" value="TowardsPlacerInverted" />
+ <property class="RepairItems">
+ <property name="forgedSteel" value="10"/>
+ </property>
+ <drop event="Destroy" name="miner" count="1"/>
+ <property name="OnlySimpleRotations" value="true"/>
+ <property class="UpgradeBlock">
+ <property name="ToBlock" value="minerProcessing"/>
+ <property name="Item" value="gasCan"/>
+ <property name="ItemCount" value="1000"/>
+ <property name="UpgradeHitCount" value="1"/>
+ </property>
+</block>
+
</blocks><!-- Block limit: No block can have an ID greater 2047. -->
diff --git a/Data/Config/items.xml b/Data/Config/items.xml
index 201812b..c84e1d7 100644
--- a/Data/Config/items.xml
+++ b/Data/Config/items.xml
@@ -1470,7 +1470,7 @@ Mesh files no longer used:
<property name="Repair_amount" value="100"/>
<property name="Upgrade_hit_offset" value="0"/>
<property name="Sound_start" value="repair_block"/>
- <property name="Allowed_upgrade_items" value="wood,clayLump,dirtFragment,snowBall,scrapIron,forgedIron,forgedSteel,steelPolish,concreteMix,cobblestones,yuccaFibers"/>
+ <property name="Allowed_upgrade_items" value="wood,clayLump,dirtFragment,snowBall,scrapIron,forgedIron,forgedSteel,steelPolish,concreteMix,cobblestones,yuccaFibers,gasCan"/>
</property>
<property class="Attributes">
<property name="EntityDamage" value="4,10"/>
@@ -1833,7 +1833,7 @@ Mesh files no longer used:
<property name="Repair_amount" value="350"/>
<property name="Upgrade_hit_offset" value="-2"/>
<property name="Sound_start" value="repair_block"/>
- <property name="Allowed_upgrade_items" value="wood,clayLump,dirtFragment,snowBall,scrapIron,forgedIron,forgedSteel,steelPolish,concreteMix,cobblestones,yuccaFibers"/>
+ <property name="Allowed_upgrade_items" value="wood,clayLump,dirtFragment,snowBall,scrapIron,forgedIron,forgedSteel,steelPolish,concreteMix,cobblestones,yuccaFibers,gasCan"/>
</property>
<property class="Attributes">
<property name="EntityDamage" value="4,10"/>
@@ -1882,7 +1882,7 @@ Mesh files no longer used:
<property name="Repair_amount" value="250"/>
<property name="Upgrade_hit_offset" value="-3"/>
<property name="Sound_start" value="repair_block"/>
- <property name="Allowed_upgrade_items" value="wood,clayLump,dirtFragment,snowBall,scrapIron,forgedIron,forgedSteel,steelPolish,concreteMix,cobblestones,yuccaFibers,nail"/>
+ <property name="Allowed_upgrade_items" value="wood,clayLump,dirtFragment,snowBall,scrapIron,forgedIron,forgedSteel,steelPolish,concreteMix,cobblestones,yuccaFibers,nail,gasCan"/>
</property>
<property class="Attributes">
<property name="EntityDamage" value="8,20"/>
@@ -1941,7 +1941,7 @@ Mesh files no longer used:
<property name="Upgrade_hit_offset" value="-3"/>
<property name="Repair_action_sound" value="nailgun_fire"/>
<property name="Upgrade_action_sound" value="nailgun_fire"/>
- <property name="Allowed_upgrade_items" value="wood,clayLump,dirtFragment,snowBall,scrapIron,forgedIron,forgedSteel,steelPolish,concreteMix,cobblestones,yuccaFibers,nail"/>
+ <property name="Allowed_upgrade_items" value="wood,clayLump,dirtFragment,snowBall,scrapIron,forgedIron,forgedSteel,steelPolish,concreteMix,cobblestones,yuccaFibers,nail,gasCan"/>
<!--<property name="Restricted_upgrade_items" value="concrete"/>-->
</property>
<property name="Group" value="Tools/Traps"/>
diff --git a/Data/Config/loot.xml b/Data/Config/loot.xml
index 19ea157..d44ec11 100644
--- a/Data/Config/loot.xml
+++ b/Data/Config/loot.xml
@@ -2222,4 +2222,47 @@
<lootcontainer id="99" count="0" size="5,10" destroy_on_close="false" sound_open="UseActions/open_corpse" sound_close="UseActions/close_corpse" open_time="1" loot_quality_template="baseTemplate">
</lootcontainer>
+<lootgroup name="minerStone" count="all">
+ <item name="rockSmall" count="25,50"/>
+</lootgroup>
+<lootgroup name="minerDirt" count="all">
+ <item name="dirt" count="25,50"/>
+ </lootgroup>
+<lootgroup name="minerSand" count="all">
+ <item name="crushedSand" count="25,50"/>
+</lootgroup>
+<lootgroup name="minerClay" count="all">
+ <item name="clayLump" count="25,50"/>
+</lootgroup>
+<lootgroup name="minerGravel" count="all">
+ <item name="gravel" count="25,50"/>
+</lootgroup>
+<lootgroup name="minerLead" count="all">
+ <item name="scrapLead" count="25,50"/>
+</lootgroup>
+<lootgroup name="minerIron" count="all">
+ <item name="ironFragment" count="25,50"/>
+</lootgroup>
+<lootgroup name="minerPotassiumNitrate" count="all">
+ <item name="potassiumNitratePowder" count="25,50"/>
+</lootgroup>
+<lootgroup name="minerCoal" count="all">
+ <item name="coal" count="25,50"/>
+</lootgroup>
+<lootgroup name="minerOilShale" count="all">
+ <item name="oilShale" count="25,50"/>
+</lootgroup>
+<lootcontainer id="100" count="50,100" size="8,4" sound_open="UseActions/open_file_cabinet" sound_close="UseActions/close_file_cabinet">
+ <item group="minerStone" prob="0.7"/>
+ <!-- <item group="minerDirt" prob="0.7"/> -->
+ <item group="minerSand" prob="0.7"/>
+ <item group="minerClay" prob="0.5"/>
+ <item group="minerGravel" prob="0.5"/>
+ <item group="minerLead" prob="0.5"/>
+ <item group="minerIron" prob="0.5"/>
+ <item group="minerPotassiumNitrate" prob="0.5"/>
+ <item group="minerCoal" prob="0.5"/>
+ <item group="minerOilShale" prob="0.7"/>
+</lootcontainer>
+
</lootcontainers>
diff --git a/Data/Config/recipes.xml b/Data/Config/recipes.xml
index 08160c9..78fb323 100644
--- a/Data/Config/recipes.xml
+++ b/Data/Config/recipes.xml
@@ -2678,6 +2678,12 @@ Unfortunately auto-calc only seems to work on the first (top) ingredient in the
<ingredient name="cobblestones" count="4"/>
</recipe>
+<recipe name="miner" count="1" craft_area="workbench">
+ <ingredient name="forgedSteel" count="10"/>
+ <ingredient name="smallEngine" count="1"/>
+ <ingredient name="carBattery" count="1"/>
+</recipe>
+
</recipes>
<!-- To do (maybe / later)
<recipe name="steelArrowHead" count="1" craft_area="forge" craft_tool="calipers" material_based="true">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment