TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ DefaultToGolfBall()

void Terraria.Item.DefaultToGolfBall ( int projid)
inline

This method sets a variety of Item values common to golf ball items.
Specifically:

shoot = projid ; useStyle = F:Terraria.ID.ItemUseStyleID.Swing; shootSpeed = 12f; width = 18; height = 20; maxStack = 1; UseSound = F:Terraria.ID.SoundID.Item1; useAnimation = 15; useTime = 15; noUseGraphic = true; noMelee = true; accessory = true; SetShopValues(ItemRarityColor.Green2, buyPrice(0, 1)); hasVanityEffects = true;

Parameters
projid

Definition at line 39708 of file Item.cs.

39709 {
39710 shoot = projid;
39711 useStyle = 1;
39712 shootSpeed = 12f;
39713 width = 18;
39714 height = 20;
39715 maxStack = 1;
39717 useAnimation = 15;
39718 useTime = 15;
39719 noUseGraphic = true;
39720 noMelee = true;
39721 value = 0;
39722 accessory = true;
39723 SetShopValues(ItemRarityColor.Green2, buyPrice(0, 1));
39724 hasVanityEffects = true;
39725 }
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
static readonly SoundStyle Item1
Definition SoundID.cs:679
SoundStyle? UseSound
The sound this item makes when used. Set this to an existing T:Terraria.ID.SoundID entry or assign to...
Definition Item.cs:534
static int buyPrice(int platinum=0, int gold=0, int silver=0, int copper=0)
Converts the provided buy price into copper coins. If assigned to F:Terraria.Item....
Definition Item.cs:49543
int useAnimation
The time span of the using animation for the item in ticks. This is independent of the time it takes ...
Definition Item.cs:384
bool noMelee
If true, the item's using animation will not deal damage. Set to true on most weapons that aren't swo...
Definition Item.cs:647
int value
The number of copper coins this item is worth (aka, cost to buy from a merchant). Setting it to 10462...
Definition Item.cs:655
int shoot
The ID of the projectile that is fired by this item on use. Either a T:Terraria.ID....
Definition Item.cs:594
int maxStack
The maximum number of items that can be contained within a single stack. F:Terraria....
Definition Item.cs:402
bool hasVanityEffects
If true, this item has vanity effects even though it doesn't use equipment slots. Unused in vanilla...
Definition Item.cs:769
int useStyle
Assign to an T:Terraria.ID.ItemUseStyleID value to give this item a specific animation while in use....
Definition Item.cs:366
bool noUseGraphic
If true, the item's sprite will not be visible while the item is in use. Defaults to false.
Definition Item.cs:641
float shootSpeed
The velocity in pixels the projectile fired by this item will have. Actual velocity depends on the pr...
Definition Item.cs:600
bool accessory
Whether the item is an accessory. Defaults to false.
Definition Item.cs:378
void SetShopValues(ItemRarityColor rarity, int coinValue)
A helper method that sets item rarity (F:Terraria.Item.rare) and item value (F:Terraria....
Definition Item.cs:48724
int useTime
The time span of using the item in ticks. This is independent of the time it takes for the item anima...
Definition Item.cs:391

References Terraria.Item.accessory, Terraria.Item.buyPrice(), Terraria.Item.hasVanityEffects, Terraria.Entity.height, Terraria.ID.SoundID.Item1, Terraria.Item.maxStack, Terraria.Item.noMelee, Terraria.Item.noUseGraphic, Terraria.Item.SetShopValues(), Terraria.Item.shoot, Terraria.Item.shootSpeed, Terraria.Item.useAnimation, Terraria.Item.UseSound, Terraria.Item.useStyle, Terraria.Item.useTime, Terraria.Item.value, and Terraria.Entity.width.

Referenced by Terraria.Item.SetDefaults4(), and Terraria.Item.SetDefaults5().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: