//!tgscript v1 //! script name=Potion //! region graph //! node 1 OnTriggerEnter pos=(60,80) export function onTriggerEnter(ctx) { //! node 2 ContactOther pos=(60,220) const n2_value = ctx.contactOther(); //! node 3 FindEntity pos=(60,320) entity=Hero const n3_value = ctx.findEntity("Hero"); //! node 4 Equal pos=(260,260) const n4_out = (n2_value === n3_value); //! node 5 Branch pos=(460,80) if (n4_out) { //! node 6 GetGlobal pos=(460,240) global=potions const n6_value = ctx.getGlobal("potions"); //! node 7 ConstNumber pos=(460,340) const n7_value = 1.00; //! node 8 AddNumber pos=(660,280) const n8_out = (n6_value + n7_value); //! node 9 SetGlobal pos=(660,80) global=potions ctx.setGlobal("potions", n8_out); //! node 10 FindEntity pos=(660,420) entity=SfxCoin const n10_value = ctx.findEntity("SfxCoin"); //! node 11 PlayAudio pos=(860,80) ctx.playAudio(n10_value); //! node 12 ConstVec2 pos=(860,240) const n12_value = ctx.vec2(200.00, 270.00); //! node 13 SetPosition2D pos=(1060,80) ctx.setPosition2D(n12_value); } } //! endregion