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

◆ SetFoodDefaults()

void Terraria.Item.SetFoodDefaults ( int type)
inlineprivate

Definition at line 48020 of file Item.cs.

48021 {
48022 switch (type)
48023 {
48024 case 4022:
48025 DefaultToFood(22, 22, 207, 172800);
48026 SetShopValues(ItemRarityColor.Blue1, buyPrice(0, 50));
48027 break;
48028 case 1919:
48029 DefaultToFood(22, 22, 207, 14400);
48030 SetShopValues(ItemRarityColor.Blue1, buyPrice(0, 0, 25));
48031 break;
48032 case 1920:
48033 DefaultToFood(22, 22, 207, 14400);
48034 SetShopValues(ItemRarityColor.Blue1, buyPrice(0, 0, 25));
48035 break;
48036 case 4011:
48037 DefaultToFood(22, 22, 207, 57600);
48039 break;
48040 case 3532:
48041 DefaultToFood(22, 22, 207, 86400);
48043 break;
48044 case 1911:
48045 DefaultToFood(22, 22, 207, 14400, useGulpSound: true);
48046 SetShopValues(ItemRarityColor.Blue1, buyPrice(0, 0, 10));
48047 break;
48048 case 4013:
48049 DefaultToFood(22, 22, 207, 86400);
48051 break;
48052 case 4615:
48053 DefaultToFood(22, 22, 207, 57600, useGulpSound: true);
48055 break;
48056 case 4027:
48057 DefaultToFood(22, 22, 207, 57600, useGulpSound: true);
48059 break;
48060 case 4025:
48061 DefaultToFood(22, 22, 207, 43200);
48063 break;
48064 case 4029:
48065 DefaultToFood(22, 22, 207, 28800);
48067 break;
48068 case 4036:
48069 DefaultToFood(22, 22, 207, 28800);
48071 break;
48072 case 4037:
48073 DefaultToFood(22, 22, 207, 57600);
48075 break;
48076 case 4015:
48077 DefaultToFood(22, 22, 207, 28800);
48079 break;
48080 case 2426:
48081 DefaultToFood(22, 22, 206, 36000);
48082 SetShopValues(ItemRarityColor.Blue1, buyPrice(0, 0, 75));
48083 break;
48084 case 2427:
48085 DefaultToFood(22, 22, 206, 28800);
48086 SetShopValues(ItemRarityColor.Blue1, buyPrice(0, 0, 25));
48087 break;
48088 case 4034:
48089 DefaultToFood(22, 22, 206, 50400);
48090 SetShopValues(ItemRarityColor.Blue1, buyPrice(0, 0, 50));
48091 break;
48092 case 357:
48093 DefaultToFood(22, 22, 206, 28800, useGulpSound: true);
48095 break;
48096 case 1787:
48097 DefaultToFood(22, 22, 206, 28800);
48098 SetShopValues(ItemRarityColor.Blue1, buyPrice(0, 0, 10));
48099 break;
48100 case 4012:
48101 DefaultToFood(22, 22, 206, 36000, useGulpSound: true);
48103 break;
48104 case 4016:
48105 DefaultToFood(22, 22, 206, 50400);
48107 break;
48108 case 4017:
48109 DefaultToFood(22, 22, 206, 72000);
48111 break;
48112 case 5042:
48113 DefaultToFood(22, 22, 206, 36000, useGulpSound: true);
48115 break;
48116 case 4018:
48117 DefaultToFood(22, 22, 206, 57600, useGulpSound: true);
48119 break;
48120 case 4288:
48121 DefaultToFood(22, 22, 206, 18000);
48123 break;
48124 case 4019:
48125 DefaultToFood(22, 22, 206, 36000);
48127 break;
48128 case 4020:
48129 DefaultToFood(22, 22, 206, 50400);
48131 break;
48132 case 4021:
48133 DefaultToFood(22, 22, 206, 36000);
48135 break;
48136 case 4023:
48137 DefaultToFood(22, 22, 206, 57600);
48139 break;
48140 case 3195:
48141 DefaultToFood(22, 22, 206, 50400, useGulpSound: true);
48143 break;
48144 case 4026:
48145 DefaultToFood(22, 22, 206, 50400, useGulpSound: true);
48147 break;
48148 case 4028:
48149 DefaultToFood(22, 22, 206, 57600);
48151 break;
48152 case 4032:
48153 DefaultToFood(22, 22, 206, 36000);
48155 break;
48156 case 4035:
48157 DefaultToFood(22, 22, 206, 64800);
48158 SetShopValues(ItemRarityColor.Blue1, buyPrice(0, 2, 50));
48159 break;
48160 case 4403:
48161 DefaultToFood(22, 22, 206, 36000);
48163 break;
48164 case 2267:
48165 DefaultToFood(22, 22, 206, 28800);
48166 SetShopValues(ItemRarityColor.Blue1, buyPrice(0, 0, 55));
48167 break;
48168 case 4623:
48169 DefaultToFood(22, 22, 206, 72000, useGulpSound: true);
48171 break;
48172 case 2268:
48173 DefaultToFood(22, 22, 206, 36000, useGulpSound: true);
48174 SetShopValues(ItemRarityColor.Blue1, buyPrice(0, 0, 75));
48175 break;
48176 case 4297:
48177 DefaultToFood(22, 22, 206, 18000);
48179 break;
48180 case 5092:
48181 DefaultToFood(22, 22, 206, 28800);
48182 SetShopValues(ItemRarityColor.Blue1, buyPrice(0, 0, 50));
48183 break;
48184 case 5093:
48185 DefaultToFood(22, 22, 206, 21600);
48187 break;
48188 case 4009:
48189 DefaultToFood(22, 22, 26, 18000);
48191 break;
48192 case 4614:
48193 DefaultToFood(22, 22, 26, 36000, useGulpSound: true);
48195 break;
48196 case 4014:
48197 DefaultToFood(22, 22, 26, 36000, useGulpSound: true);
48199 break;
48200 case 4024:
48201 DefaultToFood(22, 22, 26, 36000);
48203 break;
48204 case 4030:
48205 DefaultToFood(22, 22, 26, 90000);
48206 SetShopValues(ItemRarityColor.Blue1, buyPrice(0, 1, 50));
48207 break;
48208 case 4031:
48209 DefaultToFood(22, 22, 26, 36000);
48211 break;
48212 case 969:
48213 DefaultToFood(12, 12, 26, 36000);
48214 SetShopValues(ItemRarityColor.Blue1, buyPrice(0, 0, 2));
48215 useStyle = 9;
48216 break;
48217 case 2425:
48218 DefaultToFood(22, 22, 26, 28800);
48219 SetShopValues(ItemRarityColor.Blue1, buyPrice(0, 0, 25));
48220 break;
48221 case 4282:
48222 DefaultToFood(22, 22, 26, 18000);
48224 break;
48225 case 4283:
48226 DefaultToFood(22, 22, 26, 18000);
48228 break;
48229 case 4617:
48230 DefaultToFood(22, 22, 26, 54000, useGulpSound: true);
48232 break;
48233 case 4284:
48234 DefaultToFood(22, 22, 26, 18000);
48236 break;
48237 case 4285:
48238 DefaultToFood(22, 22, 26, 18000);
48240 break;
48241 case 4621:
48242 DefaultToFood(22, 22, 26, 72000, useGulpSound: true);
48244 break;
48245 case 4286:
48246 DefaultToFood(22, 22, 26, 18000);
48248 break;
48249 case 4287:
48250 DefaultToFood(22, 22, 26, 18000);
48252 break;
48253 case 4289:
48254 DefaultToFood(22, 22, 26, 18000);
48256 break;
48257 case 4624:
48258 DefaultToFood(22, 22, 26, 54000, useGulpSound: true);
48260 break;
48261 case 4625:
48262 DefaultToFood(22, 22, 26, 90000);
48264 break;
48265 case 4290:
48266 DefaultToFood(22, 22, 26, 18000);
48268 break;
48269 case 4291:
48270 DefaultToFood(22, 22, 26, 18000);
48272 break;
48273 case 4616:
48274 DefaultToFood(22, 22, 26, 36000, useGulpSound: true);
48276 break;
48277 case 4292:
48278 DefaultToFood(22, 22, 26, 18000);
48280 break;
48281 case 967:
48282 DefaultToFood(12, 12, 26, 3600);
48283 SetShopValues(ItemRarityColor.White0, buyPrice(0, 0, 1));
48284 useStyle = 9;
48285 break;
48286 case 4293:
48287 DefaultToFood(22, 22, 26, 18000);
48289 break;
48290 case 4618:
48291 DefaultToFood(22, 22, 26, 36000, useGulpSound: true);
48293 break;
48294 case 4619:
48295 DefaultToFood(22, 22, 26, 72000, useGulpSound: true);
48297 break;
48298 case 4294:
48299 DefaultToFood(22, 22, 26, 18000);
48301 break;
48302 case 4295:
48303 DefaultToFood(22, 22, 26, 18000);
48305 break;
48306 case 4296:
48307 DefaultToFood(22, 22, 26, 18000);
48309 break;
48310 case 4622:
48311 DefaultToFood(22, 22, 26, 72000, useGulpSound: true);
48313 break;
48314 case 4411:
48315 DefaultToFood(22, 22, 26, 36000);
48317 break;
48318 case 4620:
48319 DefaultToFood(22, 22, 26, 72000, useGulpSound: true);
48321 break;
48322 case 5009:
48323 DefaultToFood(22, 22, 26, 18000, useGulpSound: true);
48324 SetShopValues(ItemRarityColor.Blue1, buyPrice(0, 0, 0, 20));
48325 break;
48326 case 5041:
48327 DefaultToFood(22, 22, 26, 72000, useGulpSound: true);
48329 break;
48330 case 4033:
48331 DefaultToFood(22, 22, 26, 36000);
48332 SetShopValues(ItemRarityColor.Blue1, buyPrice(0, 0, 50));
48333 break;
48334 case 5275:
48335 DefaultToFood(22, 22, 26, 7200, useGulpSound: true);
48336 SetShopValues(ItemRarityColor.White0, buyPrice(0, 0, 1, 25));
48337 break;
48338 case 5277:
48339 DefaultToFood(22, 22, 26, 18000);
48341 break;
48342 case 5278:
48343 DefaultToFood(22, 22, 26, 18000);
48345 break;
48346 case 2266:
48347 DefaultToFood(22, 22, 25, 14400, useGulpSound: true);
48348 SetShopValues(ItemRarityColor.Blue1, buyPrice(0, 0, 5));
48349 break;
48350 case 353:
48351 DefaultToFood(22, 22, 25, 7200, useGulpSound: true);
48352 SetShopValues(ItemRarityColor.White0, 100);
48354 holdStyle = 1;
48355 ammo = 353;
48356 notAmmo = true;
48357 break;
48358 case 1912:
48359 DefaultToHealingPotion(22, 22, 80);
48360 SetShopValues(ItemRarityColor.Blue1, 40);
48361 break;
48362 }
48363 float num = 0f;
48364 num = ((buffType == 207) ? (num + 12f) : ((buffType != 206) ? (num + 3f) : (num + 8f)));
48365 num += (float)(buffTime / 14400);
48366 rare = (int)(num / 4f);
48367 }
int ammo
The Ammo ID this item belongs to. Weapons with F:Terraria.Item.useAmmo set to the same AmmoID will co...
Definition Item.cs:606
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 rare
Indicates the rarity of an item. Assign to a T:Terraria.ID.ItemRarityID value. Vanilla values range f...
Definition Item.cs:587
int maxStack
The maximum number of items that can be contained within a single stack. F:Terraria....
Definition Item.cs:402
int buffTime
The duration in ticks of the buff given by this item on use. There are 60 ticks per second,...
Definition Item.cs:690
int buffType
The Buff ID of the buff given by this item on use. To have a potion give multiple buffs,...
Definition Item.cs:683
int useStyle
Assign to an T:Terraria.ID.ItemUseStyleID value to give this item a specific animation while in use....
Definition Item.cs:366
static int CommonMaxStack
The default stack size for stackable items: 9999.
Definition Item.cs:94
void DefaultToHealingPotion(int newwidth, int newheight, int healingAmount, int animationTime=17)
Definition Item.cs:48703
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 holdStyle
Assign to an T:Terraria.ID.ItemHoldStyleID value to give this item a specific animation while the pla...
Definition Item.cs:360
void DefaultToFood(int newwidth, int newheight, int foodbuff, int foodbuffduration, bool useGulpSound=false, int animationTime=17)
This method sets a variety of Item values common to food items. Specifically:
Definition Item.cs:48673
bool notAmmo
If true and the item is ammo (sets F:Terraria.Item.ammo to something), the item will not count as amm...
Definition Item.cs:612
int type
The Item ID of this item. The Item ID is a unique number assigned to each Item loaded into the game....
Definition Item.cs:345

References Terraria.Item.ammo, Terraria.Item.buffTime, Terraria.Item.buffType, Terraria.Item.buyPrice(), Terraria.Item.CommonMaxStack, Terraria.Item.DefaultToFood(), Terraria.Item.DefaultToHealingPotion(), Terraria.Item.holdStyle, Terraria.Item.maxStack, Terraria.Item.notAmmo, Terraria.Item.rare, Terraria.Item.SetShopValues(), Terraria.Item.type, and Terraria.Item.useStyle.

Referenced by Terraria.Item.SetDefaults().

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