Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Terraria.Item Class Reference

Public Member Functions

IEntitySource GetNPCSource_FromThis ()
 
IEntitySource GetItemSource_Misc (int itemSourceId)
 
override string ToString ()
 
bool Prefix (int prefixWeWant)
 
bool CanRollPrefix (int prefix)
 
bool CanApplyPrefix (int prefix)
 
int[] GetRollablePrefixes ()
 
bool IsAPrefixableAccessory ()
 
string AffixName ()
 
void RebuildTooltip ()
 
Rectangle getRect ()
 
bool checkMat ()
 
void netDefaults (int type)
 
bool FitsAmmoSlot ()
 
bool CanFillEmptyAmmoSlot ()
 
void SetDefaults1 (int type)
 
void SetDefaults2 (int type)
 
void SetDefaults3 (int type)
 
void DefaultToQuestFish ()
 
void SetDefaults4 (int type)
 
void DefaultToGolfBall (int projid)
 
void SetDefaults5 (int type)
 
void DefaultToSolution (int projectileId)
 
void DefaultToWhip (int projectileId, int dmg, float kb, float shootspeed, int animationTotalTime=30)
 
void DefaultTokite (int projId)
 
void ChangeItemType (int to)
 
void DefaultToVanitypet (int projId, int buffID)
 
void DefaultToCapturedCritter (short npcIdToSpawnOnUse)
 
void DefaultToStaff (int projType, float pushForwardSpeed, int singleShotTime, int manaPerShot)
 
void DefaultToSpear (int projType, float pushForwardSpeed, int animationTime)
 
void DefaultToMount (int mount)
 
void DefaultToPlaceableWall (ushort wallToPlace)
 
void SetWeaponValues (int dmg, float knockback, int bonusCritChance=0)
 
void DefaultToBow (int singleShotTime, float shotVelocity, bool hasAutoReuse=false)
 
void DefaultToMagicWeapon (int projType, int singleShotTime, float shotVelocity, bool hasAutoReuse=false)
 
void DefaultToRangedWeapon (int baseProjType, int ammoID, int singleShotTime, float shotVelocity, bool hasAutoReuse=false)
 
void DefaultToThrownWeapon (int baseProjType, int singleShotTime, float shotVelocity, bool hasAutoReuse=false)
 
void DefaultToPlaceableTile (int tileIDToPlace, int tileStyleToPlace=0)
 
void DefaultToPlaceableTile (ushort tileIDToPlace, int tileStyleToPlace=0)
 
void MakeUsableWithChlorophyteExtractinator ()
 
void DefaultToGolfClub (int newwidth, int newheight)
 
void DefaultToLawnMower (int newwidth, int newheight)
 
void DefaultToFood (int newwidth, int newheight, int foodbuff, int foodbuffduration, bool useGulpSound=false, int animationTime=17)
 
void DefaultToHealingPotion (int newwidth, int newheight, int healingAmount, int animationTime=17)
 
void SetShopValues (ItemRarityColor rarity, int coinValue)
 
void DefaultToHeadgear (int newwidth, int newheight, int helmetArtID)
 
void DefaultToAccessory (int newwidth=24, int newheight=24)
 
void DefaultToGuitar (int newwidth=24, int newheight=24)
 
void DefaultToMusicBox (int style)
 
void SetDefaults (int Type=0)
 
void SetDefaults (int Type, bool noMatCheck=false, ItemVariant variant=null)
 
void OnCreated (ItemCreationContext context)
 
void ResetStats (int Type)
 
Color GetAlpha (Color newColor)
 
Color GetColor (Color newColor)
 
bool CanShimmer ()
 
void FixAgainstExploit ()
 
void UpdateItem (int i)
 
void TryCombiningIntoNearbyItems (int i)
 
FlexibleTileWand GetFlexibleTileWand ()
 
bool CanCombineStackInWorld ()
 
void FindOwner (int whoAmI)
 
Item Clone ()
 
Item DeepClone ()
 
bool IsTheSameAs (Item compareItem)
 
bool IsNotTheSameAs (Item compareItem)
 
void SetNameOverride (string name)
 
void ClearNameOverride ()
 
void TurnToAir (bool fullReset=false)
 
void OnPurchase (Item item)
 
int GetStoreValue ()
 
void Serialize (BinaryWriter writer, ItemSerializationContext context)
 
void DeserializeFrom (BinaryReader reader, ItemSerializationContext context)
 
void ResetPrefix ()
 
void Refresh (bool onlyIfVariantChanged=true)
 
float AngleTo (Vector2 Destination)
 
float AngleFrom (Vector2 Source)
 
float Distance (Vector2 Other)
 
float DistanceSQ (Vector2 Other)
 
Vector2 DirectionTo (Vector2 Destination)
 
Vector2 DirectionFrom (Vector2 Source)
 
bool WithinRange (Vector2 Target, float MaxRange)
 

Static Public Member Functions

static void StartCachingType (int t)
 
static void DropCache (IEntitySource reason, Vector2 pos, Vector2 spread, int t, bool stopCaching=true)
 
static int BannerToItem (int banner)
 
static int NPCtoBanner (int i)
 
static int BannerToNPC (int i)
 
static bool IsAGolfingItem (Item item)
 
static bool MechSpawn (float x, float y, int type)
 
static int buyPrice (int platinum=0, int gold=0, int silver=0, int copper=0)
 
static int sellPrice (int platinum=0, int gold=0, int silver=0, int copper=0)
 
static void ShimmerEffect (Vector2 shimmerPositon)
 
static Rectangle GetDrawHitbox (int type, Player user)
 
static int NewItem (IEntitySource source, Vector2 pos, Vector2 randomBox, int Type, int Stack=1, bool noBroadcast=false, int prefixGiven=0, bool noGrabDelay=false, bool reverseLookup=false)
 
static int NewItem (IEntitySource source, Vector2 pos, int Width, int Height, int Type, int Stack=1, bool noBroadcast=false, int prefixGiven=0, bool noGrabDelay=false, bool reverseLookup=false)
 
static int NewItem (IEntitySource source, int X, int Y, int Width, int Height, int Type, int Stack=1, bool noBroadcast=false, int pfix=0, bool noGrabDelay=false, bool reverseLookup=false)
 

Public Attributes

bool questItem
 
bool flame
 
bool mech
 
int noGrabDelay
 
bool beingGrabbed
 
int timeSinceItemSpawned
 
int tileWand = -1
 
bool wornArmor
 
int tooltipContext = -1
 
byte dye
 
int fishingPole = 1
 
int bait
 
short makeNPC
 
bool expertOnly
 
bool expert
 
bool isAShopItem
 
short hairDye = -1
 
byte paint
 
byte paintCoating
 
bool instanced
 
int ownIgnore = -1
 
int ownTime
 
int keepTime
 
int timeLeftInWhichTheItemCannotBeTakenByEnemies
 
int type
 
bool favorited
 
int holdStyle
 
int useStyle
 
bool channel
 
bool accessory
 
int useAnimation
 
int useTime
 
int stack
 
int maxStack
 
int pick
 
int axe
 
int hammer
 
int tileBoost
 
int createTile = -1
 
int createWall = -1
 
int placeStyle
 
int damage
 
float knockBack
 
int healLife
 
int healMana
 
bool potion
 
bool consumable
 
bool autoReuse
 
bool useTurn
 
Color color
 
int alpha
 
short glowMask
 
float scale = 1f
 
LegacySoundStyle UseSound
 
int defense
 
int headSlot = -1
 
int bodySlot = -1
 
int legSlot = -1
 
sbyte handOnSlot = -1
 
sbyte handOffSlot = -1
 
sbyte backSlot = -1
 
sbyte frontSlot = -1
 
sbyte shoeSlot = -1
 
sbyte waistSlot = -1
 
sbyte wingSlot = -1
 
sbyte shieldSlot = -1
 
sbyte neckSlot = -1
 
sbyte faceSlot = -1
 
sbyte balloonSlot = -1
 
sbyte beardSlot = -1
 
int stringColor
 
ItemTooltip ToolTip
 
string BestiaryNotes
 
int playerIndexTheItemIsReservedFor = 255
 
int rare
 
int shoot
 
float shootSpeed
 
int ammo = AmmoID.None
 
bool notAmmo
 
int useAmmo = AmmoID.None
 
int lifeRegen
 
int manaIncrease
 
bool buyOnce
 
int mana
 
bool noUseGraphic
 
bool noMelee
 
int timeSinceTheItemHasBeenReservedForSomeone
 
int value
 
bool buy
 
bool social
 
bool vanity
 
bool material
 
bool noWet
 
int buffType
 
int buffTime
 
int mountType = -1
 
bool cartTrack
 
bool uniqueStack
 
int shopSpecialCurrency = -1
 
int? shopCustomPrice
 
bool shootsEveryUse
 
bool chlorophyteExtractinatorConsumable
 
bool DD2Summon
 
int netID
 
int crit
 
byte prefix
 
bool melee
 
bool magic
 
bool ranged
 
bool summon
 
bool sentry
 
int reuseDelay
 
bool newAndShiny
 
bool hasVanityEffects
 
bool shimmered
 
float shimmerTime
 
int whoAmI
 
bool active
 
Vector2 position
 
Vector2 velocity
 
Vector2 oldPosition
 
Vector2 oldVelocity
 
int oldDirection
 
int direction = 1
 
int width
 
int height
 
bool wet
 
bool shimmerWet
 
bool honeyWet
 
byte wetCount
 
bool lavaWet
 

Static Public Attributes

const int luckPotionDuration1 = 18000
 
const int luckPotionDuration2 = 36000
 
const int luckPotionDuration3 = 54000
 
const int flaskTime = 72000
 
const int copper = 1
 
const int silver = 100
 
const int gold = 10000
 
const int platinum = 1000000
 
const int goldCritterRarityColor = 3
 
static int CommonMaxStack = 9999
 
static int[] cachedItemSpawnsByType = ItemID.Sets.Factory.CreateIntSet(-1)
 
static int potionDelay = 3600
 
static int restorationDelay = 2700
 
static int mushroomDelay = 1800
 
static int[] headType = new int[ArmorIDs.Head.Count]
 
static int[] bodyType = new int[ArmorIDs.Body.Count]
 
static int[] legType = new int[ArmorIDs.Legs.Count]
 
static bool[] staff = new bool[ItemID.Count]
 
static bool[] claw = new bool[ItemID.Count]
 
static int coinGrabRange = 350
 
static int manaGrabRange = 300
 
static int lifeGrabRange = 250
 
static int treasureGrabRange = 150
 
const int WALL_PLACEMENT_USETIME = 7
 
static int numberOfNewItems = 0
 

Package Attributes

long entityId
 

Properties

string Name [get]
 
string HoverName [get]
 
bool PaintOrCoating [get]
 
bool FitsAccessoryVanitySlot [get]
 
int OriginalRarity [get]
 
int OriginalDamage [get]
 
int OriginalDefense [get]
 
ItemVariant Variant [get, private set]
 
bool IsACoin [get]
 
bool IsAir [get]
 
bool IsCurrency [get]
 
bool CanBeQuickUsed [get]
 
virtual Vector2 VisualPosition [get]
 
Vector2 Center [get, set]
 
Vector2 Left [get, set]
 
Vector2 Right [get, set]
 
Vector2 Top [get, set]
 
Vector2 TopLeft [get, set]
 
Vector2 TopRight [get, set]
 
Vector2 Bottom [get, set]
 
Vector2 BottomLeft [get, set]
 
Vector2 BottomRight [get, set]
 
Vector2 Size [get, set]
 
Rectangle Hitbox [get, set]
 

Private Member Functions

bool CanHavePrefixes ()
 
bool TryGetPrefixStatMultipliersForItem (int rolledPrefix, out float dmg, out float kb, out float spd, out float size, out float shtspd, out float mcst, out int crt)
 
bool RollAPrefix (UnifiedRandom random, ref int rolledPrefix)
 
void DefaultToSeaShell ()
 
void SetFoodDefaults (int type)
 
void DefaultToTorch (int tileStyleToPlace, bool allowWaterPlacement=false)
 
void Shimmering ()
 
int FindDecraftAmount ()
 
int GetShimmerEquivalentType ()
 
void GetShimmered ()
 
void DespawnIfMeetingConditions (int i)
 
void CheckLavaDeath (int i)
 
void MoveInWorld (float gravity, float maxFallSpeed, ref Vector2 wetVelocity, int i)
 
void GetPickedUpByMonsters_Special (int i)
 
void GetPickedUpByMonsters_Money (int i)
 
void CombineWithNearbyItems (int myItemIndex)
 
void UpdateItem_VisualEffects ()
 

Static Private Member Functions

static int PickAnItemSlotToSpawnItemOn (bool reverseLookup, int nextItem)
 

Private Attributes

string _nameOverride
 
readonly int shadowOrbPrice = sellPrice(0, 1, 50)
 
readonly int dungeonPrice = sellPrice(0, 1, 75)
 
readonly int queenBeePrice = sellPrice(0, 2)
 
readonly int hellPrice = sellPrice(0, 2, 50)
 
readonly int eclipsePrice = sellPrice(0, 7, 50)
 
readonly int eclipsePostPlanteraPrice = sellPrice(0, 10)
 
readonly int eclipseMothronPrice = sellPrice(0, 12, 50)
 

Static Private Attributes

const int foodWidth = 22
 
const int foodHeight = 22
 

Detailed Description

Definition at line 21 of file Item.cs.


The documentation for this class was generated from the following file: