//!tgscript v1 //! script name=Quest //! region graph //! node 1 OnUpdate pos=(60,80) export function onUpdate(ctx) { //! node 2 FindEntity pos=(60,220) entity=QuestText const n2_value = ctx.findEntity("QuestText"); //! node 40 FindEntity pos=(60,320) entity=QuestCount const n40_value = ctx.findEntity("QuestCount"); //! node 3 GetGlobal pos=(60,420) global=hasSword const n3_value = ctx.getGlobal("hasSword"); //! node 4 GetGlobal pos=(60,520) global=slain const n4_value = ctx.getGlobal("slain"); //! node 5 GetGlobal pos=(60,620) global=coins const n5_value = ctx.getGlobal("coins"); //! node 6 GetGlobal pos=(60,720) global=won const n6_value = ctx.getGlobal("won"); //! node 7 ConstNumber pos=(60,820) const n7_value = 0.50; //! node 8 ConstNumber pos=(60,920) const n8_value = 2.00; //! node 9 ConstNumber pos=(60,1020) const n9_value = 3.00; //! node 30 GetGlobal pos=(60,1120) global=started const n30_value = ctx.getGlobal("started"); //! node 10 Less pos=(260,420) const n10_out = (n3_value < n7_value); //! node 11 Less pos=(260,520) const n11_out = (n4_value < n8_value); //! node 12 Less pos=(260,620) const n12_out = (n5_value < n9_value); //! node 13 Less pos=(260,720) const n13_out = (n6_value < n7_value); //! node 31 Less pos=(260,1120) const n31_out = (n30_value < n7_value); //! node 32 Branch pos=(460,80) if (n31_out) { //! node 33 SetText pos=(660,80) text="@quest.title" ctx.setText("@quest.title", n2_value); //! node 34 SetText pos=(860,80) text=" " ctx.setText(" ", n40_value); } else { //! node 14 Branch pos=(660,240) if (n10_out) { //! node 15 SetText pos=(860,240) text="@quest.talk" ctx.setText("@quest.talk", n2_value); //! node 35 SetText pos=(1060,240) text=" " ctx.setText(" ", n40_value); } else { //! node 16 Branch pos=(860,400) if (n11_out) { //! node 41 SetText pos=(1060,400) text="@quest.slimes" ctx.setText("@quest.slimes", n2_value); //! node 17 SubNumber pos=(1060,560) const n17_out = (n8_value - n4_value); //! node 18 SetTextNumber pos=(1260,400) prefix="" ctx.setTextNumber("", n40_value, n17_out); } else { //! node 19 Branch pos=(1060,720) if (n12_out) { //! node 42 SetText pos=(1260,720) text="@quest.coins" ctx.setText("@quest.coins", n2_value); //! node 20 SubNumber pos=(1260,880) const n20_out = (n9_value - n5_value); //! node 21 SetTextNumber pos=(1460,720) prefix="" ctx.setTextNumber("", n40_value, n20_out); } else { //! node 22 Branch pos=(1260,1040) if (n13_out) { //! node 23 SetText pos=(1460,1040) text="@quest.chest" ctx.setText("@quest.chest", n2_value); //! node 36 SetText pos=(1660,1040) text=" " ctx.setText(" ", n40_value); } else { //! node 24 SetText pos=(1460,1200) text="@quest.won" ctx.setText("@quest.won", n2_value); //! node 37 SetText pos=(1660,1200) text=" " ctx.setText(" ", n40_value); } } } } } } //! endregion