Allas
Recruit

So I've set up a magic system that, if you become a mage in camp menu, allows you to open a spell book in battle that gives you spells - itcf_throw_stone throwing weapons (with 2 ammo, because the character unwields the weapon as soon as there is no ammo). And it works fine except for the reloading of the item: from my understanding when the character attacks with the spell, the ti_on_weapon_attack trigger fires before the ammo is used which leads to the attack not occurring at all if I don't have enough mana for yet another attack.
["lightning_bolt", "Lightning Bolt", [("empty",0),("light_beam",ixmesh_flying_ammo),("icon_lightning",ixmesh_inventory)], itp_type_thrown|itp_primary|itp_can_penetrate_shield|itp_crush_through|itp_extra_penetration, itcf_throw_stone, 23, weight(0.23)|difficulty(0)|spd_rtng(60)|shoot_speed(60)|thrust_damage(70,pierce)|max_ammo(100)|weapon_length(7, imodbits_thrown, [(ti_on_weapon_attack,[(play_sound,"snd_lightning"),(val_sub,"$mana","$curcost"),(try_begin),(get_player_agent_no,":agent"),(gt,"$mana","$curcost"),(agent_set_ammo,":agent","$curspell",2),(else_try),(agent_unequip_item,":agent","$curspell"),(try_end)])] ],
Is there a way to circumvent this issue while using a throwing weapon? I tried firearms but unless you reload them manually with a separate item (bullets) you can't use custom projectiles from what I've gathered. How else can I implement this?
["lightning_bolt", "Lightning Bolt", [("empty",0),("light_beam",ixmesh_flying_ammo),("icon_lightning",ixmesh_inventory)], itp_type_thrown|itp_primary|itp_can_penetrate_shield|itp_crush_through|itp_extra_penetration, itcf_throw_stone, 23, weight(0.23)|difficulty(0)|spd_rtng(60)|shoot_speed(60)|thrust_damage(70,pierce)|max_ammo(100)|weapon_length(7, imodbits_thrown, [(ti_on_weapon_attack,[(play_sound,"snd_lightning"),(val_sub,"$mana","$curcost"),(try_begin),(get_player_agent_no,":agent"),(gt,"$mana","$curcost"),(agent_set_ammo,":agent","$curspell",2),(else_try),(agent_unequip_item,":agent","$curspell"),(try_end)])] ],
Is there a way to circumvent this issue while using a throwing weapon? I tried firearms but unless you reload them manually with a separate item (bullets) you can't use custom projectiles from what I've gathered. How else can I implement this?
