From aaff749236d16a6b64f5f56bf1fd2e334a4fb61f Mon Sep 17 00:00:00 2001
From: SilicaAndPina <earsyum@gmail.com>
Date: Thu, 10 Sep 2020 12:30:19 +1200
Subject: [PATCH] Add more crafitng

---
 Spaceinator.project.gmx               |   1 +
 objects/obj_crafting.object.gmx       |  29 +++-
 objects/obj_crafting_final.object.gmx | 191 ++++++++++++++++++++++++++
 sprites/images/spr_broken_ship_0.png  | Bin 346 -> 287 bytes
 4 files changed, 219 insertions(+), 2 deletions(-)
 create mode 100644 objects/obj_crafting_final.object.gmx

diff --git a/Spaceinator.project.gmx b/Spaceinator.project.gmx
index 4e16ce3..1ca6c04 100644
--- a/Spaceinator.project.gmx
+++ b/Spaceinator.project.gmx
@@ -63,6 +63,7 @@
       <object>objects\obj_gameover_overlay</object>
       <object>objects\obj_inventory</object>
       <object>objects\obj_crafting</object>
+      <object>objects\obj_crafting_final</object>
       <object>objects\obj_hotbar</object>
     </objects>
     <objects name="items">
diff --git a/objects/obj_crafting.object.gmx b/objects/obj_crafting.object.gmx
index 7e7bc14..4ee9948 100644
--- a/objects/obj_crafting.object.gmx
+++ b/objects/obj_crafting.object.gmx
@@ -30,6 +30,31 @@
 move_slot = false;
 selected_item = 0;
 selected_total = 0;
+
+crafting_final_object = instance_create(0,0,obj_crafting_final);
+</string>
+          </argument>
+        </arguments>
+      </action>
+    </event>
+    <event eventtype="1" enumb="0">
+      <action>
+        <libid>1</libid>
+        <id>603</id>
+        <kind>7</kind>
+        <userelative>0</userelative>
+        <isquestion>0</isquestion>
+        <useapplyto>-1</useapplyto>
+        <exetype>2</exetype>
+        <functionname></functionname>
+        <codestring></codestring>
+        <whoName>self</whoName>
+        <relative>0</relative>
+        <isnot>0</isnot>
+        <arguments>
+          <argument>
+            <kind>1</kind>
+            <string>instance_destroy(crafting_final_object);
 </string>
           </argument>
         </arguments>
@@ -52,8 +77,8 @@ selected_total = 0;
         <arguments>
           <argument>
             <kind>1</kind>
-            <string>x = view_xview[0]+view_wview[0]/2 - (424/2);
-y = view_yview[0]+view_hview[0]/2 - (254/2) - 200;
+            <string>x = view_xview[0]+view_wview[0]/2 - (424/2) + 90;
+y = view_yview[0]+view_hview[0]/2 - (254/2) - 150;
 
 
 var i = 0;
diff --git a/objects/obj_crafting_final.object.gmx b/objects/obj_crafting_final.object.gmx
new file mode 100644
index 0000000..6c09629
--- /dev/null
+++ b/objects/obj_crafting_final.object.gmx
@@ -0,0 +1,191 @@
+<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
+<object>
+  <spriteName>spr_final</spriteName>
+  <solid>0</solid>
+  <visible>-1</visible>
+  <depth>-4400</depth>
+  <persistent>0</persistent>
+  <parentName>&lt;undefined&gt;</parentName>
+  <maskName>&lt;undefined&gt;</maskName>
+  <events>
+    <event eventtype="0" enumb="0">
+      <action>
+        <libid>1</libid>
+        <id>603</id>
+        <kind>7</kind>
+        <userelative>0</userelative>
+        <isquestion>0</isquestion>
+        <useapplyto>-1</useapplyto>
+        <exetype>2</exetype>
+        <functionname></functionname>
+        <codestring></codestring>
+        <whoName>self</whoName>
+        <relative>0</relative>
+        <isnot>0</isnot>
+        <arguments>
+          <argument>
+            <kind>1</kind>
+            <string>selected_slot = 0;
+
+move_slot = false;
+selected_item = 0;
+selected_total = 0;
+</string>
+          </argument>
+        </arguments>
+      </action>
+    </event>
+    <event eventtype="3" enumb="0">
+      <action>
+        <libid>1</libid>
+        <id>603</id>
+        <kind>7</kind>
+        <userelative>0</userelative>
+        <isquestion>0</isquestion>
+        <useapplyto>-1</useapplyto>
+        <exetype>2</exetype>
+        <functionname></functionname>
+        <codestring></codestring>
+        <whoName>self</whoName>
+        <relative>0</relative>
+        <isnot>0</isnot>
+        <arguments>
+          <argument>
+            <kind>1</kind>
+            <string>x = view_xview[0]+view_wview[0]/2 - (424/2) + 240;
+y = view_yview[0]+view_hview[0]/2 - (254/2) - 115;
+
+
+var i = 0;
+if((mouse_x &gt;= x &amp;&amp; mouse_x &lt;= x+51) &amp;&amp; (mouse_y &gt;= y &amp;&amp; mouse_y &lt;= y+52))
+{
+    for(yy = 8; yy &lt; (5*44); yy+=45)
+    {
+        for(xx = 6; xx &lt; (9*45); xx+=45+1)
+        {
+            if((mouse_x &gt;= x+xx &amp;&amp; mouse_x &lt;= x+xx+45) &amp;&amp; (mouse_y &gt;= y+yy &amp;&amp; mouse_y &lt;= y+yy+45))
+            {
+                selected_slot = i;
+            }    
+            i++;
+        }    
+    }   
+    
+}
+</string>
+          </argument>
+        </arguments>
+      </action>
+    </event>
+    <event eventtype="6" enumb="4">
+      <action>
+        <libid>1</libid>
+        <id>603</id>
+        <kind>7</kind>
+        <userelative>0</userelative>
+        <isquestion>0</isquestion>
+        <useapplyto>-1</useapplyto>
+        <exetype>2</exetype>
+        <functionname></functionname>
+        <codestring></codestring>
+        <whoName>self</whoName>
+        <relative>0</relative>
+        <isnot>0</isnot>
+        <arguments>
+          <argument>
+            <kind>1</kind>
+            <string>if(!move_slot)
+{
+    selected_item = obj_inv_controller.inventory[selected_slot];
+    if(selected_item == 0)
+        return false;
+    selected_total = obj_inv_controller.inventoryCount[selected_slot];
+    obj_inv_controller.inventory[selected_slot] = 0;
+    obj_inv_controller.inventoryCount[selected_slot] = 0;
+    move_slot = true;
+}
+else
+{
+    if(obj_inv_controller.inventory[selected_slot] == 0)
+    {
+        
+        obj_inv_controller.inventory[selected_slot] = selected_item;
+        obj_inv_controller.inventoryCount[selected_slot] = selected_total;
+        
+        move_slot = false;
+        selected_item = 0;
+
+    }    
+}
+</string>
+          </argument>
+        </arguments>
+      </action>
+    </event>
+    <event eventtype="8" enumb="0">
+      <action>
+        <libid>1</libid>
+        <id>603</id>
+        <kind>7</kind>
+        <userelative>0</userelative>
+        <isquestion>0</isquestion>
+        <useapplyto>-1</useapplyto>
+        <exetype>2</exetype>
+        <functionname></functionname>
+        <codestring></codestring>
+        <whoName>self</whoName>
+        <relative>0</relative>
+        <isnot>0</isnot>
+        <arguments>
+          <argument>
+            <kind>1</kind>
+            <string>draw_self();
+var xx = 6;
+var yy = 8;
+var i = 0;
+for(yy = 8; yy &lt; (5*44); yy+=45)
+{
+    for(xx = 6; xx &lt; (9*45); xx+=45+1)
+    {
+        if(i == selected_slot)
+        {
+            draw_set_color(make_colour_rgb(100,100,100));
+            draw_rectangle(x+xx,y+yy,x+xx+45,y+yy+44,false)
+        }
+        
+        draw_sprite(spr_blocks,obj_inv_controller.inventory[i],x+xx+6,y+yy+7);
+        var count = obj_inv_controller.inventoryCount[i];
+        
+        var xoffset = string_width(string(count))
+        if(count &gt; 1)
+        {
+            draw_set_color(c_white);
+            draw_text(x+xx+45-xoffset,y+yy+30,string(count));
+        }
+        i++
+    }    
+}   
+
+if(selected_item != 0)
+{
+    draw_sprite(spr_blocks,selected_item,mouse_x-(TILE_SIZE/2),mouse_y-(TILE_SIZE/2));
+}
+</string>
+          </argument>
+        </arguments>
+      </action>
+    </event>
+  </events>
+  <PhysicsObject>0</PhysicsObject>
+  <PhysicsObjectSensor>0</PhysicsObjectSensor>
+  <PhysicsObjectShape>0</PhysicsObjectShape>
+  <PhysicsObjectDensity>0.5</PhysicsObjectDensity>
+  <PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
+  <PhysicsObjectGroup>0</PhysicsObjectGroup>
+  <PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
+  <PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
+  <PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>
+  <PhysicsObjectAwake>-1</PhysicsObjectAwake>
+  <PhysicsObjectKinematic>0</PhysicsObjectKinematic>
+  <PhysicsShapePoints/>
+</object>
diff --git a/sprites/images/spr_broken_ship_0.png b/sprites/images/spr_broken_ship_0.png
index 5cb114aba4d54a6cb6998c262ff8163107fb82ea..cf562e127ff9fa28b60293a5fa787133f2d59ab3 100644
GIT binary patch
delta 271
zcmV+q0r39X0-pkq8Gi-<0047(dh`GQ0Om<VK~#90?bcBegdhk2P>$vW_D&w9qj<9#
zN(vn@F&BSihUsUO7lkdriY&Zy`_$r;^8nuO9>5-e#X|@eU<LvUB7o8qfW^*?cTWH_
z#QE%F2l&<OWxU^h>O?I5HWl0N>X3IIJ5>Y}5IKYj=K%F6i+=zK0#9M=0(BzUOM}Qa
zZ%#)z8LS6r5E6hv+5mZ*M*&*Ln2Vc>{{^5;Gl2AXOaO(mU_9XE3`l;*5kmn2q6!{1
zhLsVluM+@0|E!)x%J$Lvq&V~e@Jy%kT?^p*+<Rz0=cSKJPtc8YE#%h~D^^&<0n(}{
V&hL6%o&W#<00>D%PDHLkV1h{WbZGzp

delta 330
zcmbQwbc<<%WIZzj1B1(wu46!ou{g-xiDBJ2nU_EgOS+@4BLl<6e(pbstU$g*fKP}k
zkZy2rXaE8Rh64u<Ebs+#fnp5JDsqBAilZdRFZe$MFx+e28wnKSEbxddW?<ku48n}Z
z^H-z*1-E;;IEGmGU%ePz&)1^B!y4e7dGmkY-r5ceCgc6Zo>vZeYE*2||H(U{{#<fH
zhO&%EUy>NZs#Il$9oKd-pII6b*R@zMyeD-w!;v!<9s-%K-p^yv>sitK@QyggAz#-&
zNxKXt99q1jqOQr2h2dl=!(+SWJ00w|-922*t#Vzq=Vrr=Ox`u&9h@ilE;w)Nl;n7L
zmG_?b)KZ2ssk{u0J9Ts;uB!`76-;nTW%<}FH}Us;X@Q<po}AC@3$_Zo2#Xyw(VQm+
P^aO*atDnm{r-UW|nvr}Z