Hey, im really stuck on a mod im making.
I have my own ammo type, and guns that use it, but I have one specific gun that I need help with.
What I want to do is check if I have any of the ammoType in my bags, if not then deal 2 damage to the player, and create a BloodshardBolt ammo, then shoot that ammo instead.
I feel like I have tried everything, tried asking if (mod.itemType("MyAmmo") <=0)
{
//Do Stuff
}
Tried overriding PickAmmo but its just errors all over the place.
Tried item.useAmmo = mod.ItemType("BloodshardBolts");
Tried bypassing the ammo thing entirely and shooting the projectile in the weapons shoot()
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, mod.ItemType("BloodshardBolts"), damage, knockBack, player.whoAmI, 0f, 0f);
Tried the same thing but passing it a type
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
type = mod.ProjectileType("BloodshardBolts");
Literally nothing works, I can get it to convert the ammo to the new type while i have more than 0, but once it hits 0 nothing works.
There is no way I can figure out to replace it once it hits 0. Or even check that its at 0.
For the second issue which is damaging me when I use it without ammo.
Tried to get the Shoot() to hurt the player, but only thing that worked was player.statLife -= 2; or player.HealEffect(-2, true);
which was more of a negative heal since no damage worked, it always expected a death and not just damage.
Tried Player.Hurt(2); which did nothing, tried passing it the projectiles direction to stop the error, but still did nothing.
Any help is appreciated, main things I dont understand is how to check the ammo, then how to replace the ammo if its 0, or to bypass this and shoot the projectile directly and skip the normal shoot. Projectile.NewProjectile didn't work.
Also need to find a way to hurt the player and show the damage text above them.