tModLoader v2024.11
A mod to make and play Terraria mods
AmmoID.Sets Class Reference

Static Public Attributes

static SetFactory Factory = new(ItemLoader.ItemCount)
 
static bool[] IsArrow = Factory.CreateBoolSet(false, Arrow, Stake)
 If true for a given item type (Item.type), then items of that type are counted as arrows for the purposes of Player.arrowDamage and the ItemID.MagicQuiver.
Defaults to false.
 
static bool[] IsBullet = Factory.CreateBoolSet(false, Bullet, CandyCorn)
 If true for a given item type (Item.type), then items of that type are counted as bullets for the purposes of Player.bulletDamage.
Defaults to false.
 
static bool[] IsSpecialist = Factory.CreateBoolSet(false, Rocket, StyngerBolt, JackOLantern, NailFriendly, Coin, Flare, Dart, Snowball, Sand, FallenStar, Gel)
 If true for a given item type (Item.type), then items of that type are counted as specialist ammo for the purposes of Player.specialistDamage.
Defaults to false.
 
static int[] SpecificLauncherAmmoProjectileFallback = Factory.CreateIntSet()
 Maps a weapon item type (Item.type) to a fallback item type to use when determining weapon-specific projectiles for an ammo. If an entry is not found in SpecificLauncherAmmoProjectileMatches for the weapon item and ammo item pair, then the fallback item provided by this set will be used as a fallback query into SpecificLauncherAmmoProjectileMatches. This enables weapons, most commonly weapons using rocket ammo, to properly use "variant projectiles" for specific ammo without tedious copy and paste or cross-mod integrations. For example, Mod A could add an upgraded ItemID.SnowmanCannon using this fallback mechanism. If Mod B adds a new rocket ammo item and associated snow themed variant projectile to SpecificLauncherAmmoProjectileMatches, then Mod A's weapon would automatically use that variant projectile when using that ammo. Defaults to -1.
 
static Dictionary< int, Dictionary< int, int > > SpecificLauncherAmmoProjectileMatches
 Associates a weapon's item type (Item.type) and an ammo's item type (Item.type) to the projectile type (Projectile.type) they will shoot when used together. This is used in vanilla Terraria exclusively by items using rocket ammo but will work for any type of weapon that wants "variant projectiles" for specific ammo. For example, a ItemID.SnowmanCannon used with a ItemID.MiniNukeI will fire the ProjectileID.MiniNukeSnowmanRocketI. New weapons using this system should also set SpecificLauncherAmmoProjectileFallback to use as a fallback for any ammo item types that are unaccounted for, such as ammo added by other mods.