I could have done this by namespaces, global stuff, etc...but i wanted to have it all-in-1 itemdata script and 1 lweapon script.
The script is inspired by Megaman's shot (gaining power while button input and shooting on release)
so, the arrow power, range and speed increases, deepending on charge duration.
The final script will offer 3 Bow (sub-)classes.
Short Bow, LongBow, (already working so far)
Slingshot (not added, yet)
you can simply assin the class by check the item's variable flags
Flag[0] (unchecked = short, checked = long)
Flag[1] (checked = Slingshot)
it includes "draw-bow" tile modification, which can be assigned, uniqueto each bow item
(which makes sense, for the slingshot)
...it can be used with enine Arrow->Level handling (always equiping highest level arrow), or with custom arrow shift
(L/R cycle through arrows, while the Bow Item is selected).
The Shortbow fixes player's direction, while charing, but allows to walk.
The Longbow fixes player's X/Y position, but alows to turn around.
...pressing into current direction (for example DIR_UP + InputUp) means to lift the weapon)
...the Arrow ZAxis ill increase quick ...and decrease, with a lil delay
TheSlingshot will work like the shortbow.
...but create LWeapon Reflected Rock, instead of arrows.
..and it will use an independent counter
Edited by Bagu, 21 October 2023 - 03:59 PM.