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

◆ DefaultToWhip()

void Terraria.Item.DefaultToWhip ( int projectileId,
int dmg,
float kb,
float shootspeed,
int animationTotalTime = 30 )
inline

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

autoReuse = false; useStyle = F:Terraria.ID.ItemUseStyleID.Swing; useAnimation = animationTotalTime; useTime = animationTotalTime; width = 18; height = 18; shoot = projectileId; UseSound = F:Terraria.ID.SoundID.Item152; noMelee = true; DamageType = P:Terraria.ModLoader.DamageClass.SummonMeleeSpeed; noUseGraphic = true; damage = dmg; knockBack = kb; shootSpeed = shootspeed ;

Parameters
projectileId
dmg
kb
shootspeed
animationTotalTime

Definition at line 47844 of file Item.cs.

47845 {
47846 autoReuse = false;
47847 useStyle = 1;
47850 width = 18;
47851 height = 18;
47854 noMelee = true;
47856 noUseGraphic = true;
47857 damage = dmg;
47858 knockBack = kb;
47860 }
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 Item152
Definition SoundID.cs:981
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
float knockBack
The force of the knock back. Max value is 20. The Knockback wiki pagehas info on existing values....
Definition Item.cs:462
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 damage
The base damage inflicted by this item. The List of weapons wiki pagecan be a useful guide for decidi...
Definition Item.cs:455
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
bool autoReuse
Whether the item is in continuous use while the mouse button is held down. Defaults to false.
Definition Item.cs:494
DamageClass DamageType
The damage type of this Item. Assign to DamageClass.Melee/Ranged/Magic/Summon/Throwing for vanilla cl...
Definition Item.cs:1104
static DamageClass SummonMeleeSpeed
This is a damage class used solely by vanilla whips. It benefits from melee attackSpeed bonuses.
T:Terraria.ModLoader.DamageClass is used to determine the application of item effects,...

References Terraria.Item.autoReuse, Terraria.Item.damage, Terraria.Item.DamageType, Terraria.Entity.height, Terraria.ID.SoundID.Item152, Terraria.Item.knockBack, Terraria.Item.noMelee, Terraria.Item.noUseGraphic, Terraria.Item.shoot, Terraria.Item.shootSpeed, Terraria.ModLoader.DamageClass.SummonMeleeSpeed, 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: