//!tgscript v1 //! script name=Inventory //! region graph //! node 1 OnUpdate pos=(60,80) export function onUpdate(ctx) { //! node 2 FindEntity pos=(60,240) entity=Camera const n2_value = ctx.findEntity("Camera"); //! node 3 GetEntityPosition2D pos=(260,240) const n3_value = ctx.getEntityPosition2D(n2_value); //! node 4 GetGlobal pos=(60,340) global=started const n4_value = ctx.getGlobal("started"); //! node 5 ConstNumber pos=(60,440) const n5_value = 0.50; //! node 6 Greater pos=(260,340) const n6_out = (n4_value > n5_value); //! node 7 ConstVec2 pos=(260,440) const n7_value = ctx.vec2(200.00, 280.00); //! node 8 ConstVec2 pos=(260,540) const n8_value = ctx.vec2(0.00, -3.55); //! node 9 AddVec2 pos=(460,500) const n9_out = ctx.addVec2(n3_value, n8_value); //! node 10 Branch pos=(660,80) if (n6_out) { //! node 11 SetPosition2D pos=(860,80) ctx.setPosition2D(n9_out); } else { //! node 12 SetPosition2D pos=(860,240) ctx.setPosition2D(n7_value); } //! node 21 FindEntity pos=(60,700) entity=SwordIcon const n21_value = ctx.findEntity("SwordIcon"); //! node 22 GetGlobal pos=(60,800) global=hasSword const n22_value = ctx.getGlobal("hasSword"); //! node 23 ConstNumber pos=(60,900) const n23_value = 0.50; //! node 24 Greater pos=(260,800) const n24_out = (n22_value > n23_value); //! node 25 And pos=(460,800) const n25_out = (n24_out && n6_out); //! node 26 ConstVec2 pos=(260,1000) const n26_value = ctx.vec2(-2.00, -3.55); //! node 27 AddVec2 pos=(460,1000) const n27_out = ctx.addVec2(n3_value, n26_value); //! node 28 Branch pos=(1060,80) if (n25_out) { //! node 29 SetEntityPosition2D pos=(1260,80) ctx.setEntityPosition2D(n21_value, n27_out); } else { //! node 30 SetEntityPosition2D pos=(1260,240) ctx.setEntityPosition2D(n21_value, n7_value); } //! node 31 FindEntity pos=(60,1120) entity=CoinIcon1 const n31_value = ctx.findEntity("CoinIcon1"); //! node 32 GetGlobal pos=(60,1220) global=coins const n32_value = ctx.getGlobal("coins"); //! node 33 ConstNumber pos=(60,1320) const n33_value = 0.50; //! node 34 Greater pos=(260,1220) const n34_out = (n32_value > n33_value); //! node 35 And pos=(460,1220) const n35_out = (n34_out && n6_out); //! node 36 ConstVec2 pos=(260,1420) const n36_value = ctx.vec2(-1.00, -3.55); //! node 37 AddVec2 pos=(460,1420) const n37_out = ctx.addVec2(n3_value, n36_value); //! node 38 Branch pos=(1560,80) if (n35_out) { //! node 39 SetEntityPosition2D pos=(1760,80) ctx.setEntityPosition2D(n31_value, n37_out); } else { //! node 40 SetEntityPosition2D pos=(1760,240) ctx.setEntityPosition2D(n31_value, n7_value); } //! node 41 FindEntity pos=(60,1540) entity=CoinIcon2 const n41_value = ctx.findEntity("CoinIcon2"); //! node 42 GetGlobal pos=(60,1640) global=coins const n42_value = ctx.getGlobal("coins"); //! node 43 ConstNumber pos=(60,1740) const n43_value = 1.50; //! node 44 Greater pos=(260,1640) const n44_out = (n42_value > n43_value); //! node 45 And pos=(460,1640) const n45_out = (n44_out && n6_out); //! node 46 ConstVec2 pos=(260,1840) const n46_value = ctx.vec2(0.00, -3.55); //! node 47 AddVec2 pos=(460,1840) const n47_out = ctx.addVec2(n3_value, n46_value); //! node 48 Branch pos=(2060,80) if (n45_out) { //! node 49 SetEntityPosition2D pos=(2260,80) ctx.setEntityPosition2D(n41_value, n47_out); } else { //! node 50 SetEntityPosition2D pos=(2260,240) ctx.setEntityPosition2D(n41_value, n7_value); } //! node 51 FindEntity pos=(60,1960) entity=CoinIcon3 const n51_value = ctx.findEntity("CoinIcon3"); //! node 52 GetGlobal pos=(60,2060) global=coins const n52_value = ctx.getGlobal("coins"); //! node 53 ConstNumber pos=(60,2160) const n53_value = 2.50; //! node 54 Greater pos=(260,2060) const n54_out = (n52_value > n53_value); //! node 55 And pos=(460,2060) const n55_out = (n54_out && n6_out); //! node 56 ConstVec2 pos=(260,2260) const n56_value = ctx.vec2(1.00, -3.55); //! node 57 AddVec2 pos=(460,2260) const n57_out = ctx.addVec2(n3_value, n56_value); //! node 58 Branch pos=(2560,80) if (n55_out) { //! node 59 SetEntityPosition2D pos=(2760,80) ctx.setEntityPosition2D(n51_value, n57_out); } else { //! node 60 SetEntityPosition2D pos=(2760,240) ctx.setEntityPosition2D(n51_value, n7_value); } //! node 61 FindEntity pos=(60,2380) entity=PotionIcon const n61_value = ctx.findEntity("PotionIcon"); //! node 62 GetGlobal pos=(60,2480) global=potions const n62_value = ctx.getGlobal("potions"); //! node 63 ConstNumber pos=(60,2580) const n63_value = 0.50; //! node 64 Greater pos=(260,2480) const n64_out = (n62_value > n63_value); //! node 65 And pos=(460,2480) const n65_out = (n64_out && n6_out); //! node 66 ConstVec2 pos=(260,2680) const n66_value = ctx.vec2(2.00, -3.55); //! node 67 AddVec2 pos=(460,2680) const n67_out = ctx.addVec2(n3_value, n66_value); //! node 68 Branch pos=(3060,80) if (n65_out) { //! node 69 SetEntityPosition2D pos=(3260,80) ctx.setEntityPosition2D(n61_value, n67_out); } else { //! node 70 SetEntityPosition2D pos=(3260,240) ctx.setEntityPosition2D(n61_value, n7_value); } } //! endregion