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

◆ DefaultToSpear()

void Terraria.Item.DefaultToSpear ( int projType,
float pushForwardSpeed,
int animationTime )
inline

This method sets a variety of Item values common to spear weapons.
Specifically:

useStyle = F:Terraria.ID.ItemUseStyleID.Shoot; useAnimation = animationTime; useTime = animationTime; shootSpeed = pushForwardSpeed; width = 32; height = 32; UseSound = SoundID.Item1; shoot = projType; noMelee = true; noUseGraphic = true; DamageType = DamageClass.Melee;

Parameters
projType
pushForwardSpeed
animationTime

Definition at line 48004 of file Item.cs.

48005 {
48006 useStyle = 5;
48007 useAnimation = 31;
48008 useTime = 31;
48010 width = 32;
48011 height = 32;
48013 shoot = projType;
48014 noMelee = true;
48015 noUseGraphic = true;
48016 melee = true;
48018 }
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
bool melee
Definition Item.cs:800
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
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 shoot
The ID of the projectile that is fired by this item on use. Either a T:Terraria.ID....
Definition Item.cs:594
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
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.Entity.height, Terraria.ID.SoundID.Item1, Terraria.Item.melee, Terraria.Item.noMelee, Terraria.Item.noUseGraphic, Terraria.Item.shoot, Terraria.Item.shootSpeed, Terraria.Item.useAnimation, Terraria.Item.UseSound, Terraria.Item.useStyle, Terraria.Item.useTime, and Terraria.Entity.width.

Referenced by Terraria.Item.SetDefaults5().

+ Here is the caller graph for this function: