Module:Iteminfo/datagen/food

From Terraria Wiki
Jump to navigation Jump to search

No documentation subpage exists yet for this module. Create one now.


-- import Item, AmmoID, SoundID and so on.
local extdata  = require('Module:Iteminfo/datagen/extdata')
for k,v in pairs(extdata) do
	_G[k] = v
end

local this
--Terraria.Item.SetFoodDefaults(int type)  v1.4.4.9
local function SetFoodDefaults(type)
if (type <= 3195) then
	if (type <= 1911) then
		if (type <= 967) then
			if (type == 353) then
				this.DefaultToFood(22, 22, 25, 7200, true, 17);
				this.SetShopValues(ItemRarityColor.White0, 100);
				this.maxStack = Item.CommonMaxStack;
				this.holdStyle = 1;
				this.ammo = 353;
				this.notAmmo = true;
			elseif (type == 357) then
				this.DefaultToFood(22, 22, 206, 28800, true, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
			elseif (type == 967) then
				this.DefaultToFood(12, 12, 26, 3600, false, 17);
				this.SetShopValues(ItemRarityColor.White0, Item.buyPrice(0, 0, 1, 0));
				this.useStyle = 9;
			end
		elseif (type == 969) then
			this.DefaultToFood(12, 12, 26, 36000, false, 17);
			this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 0, 2, 0));
			this.useStyle = 9;
		elseif (type == 1787) then
			this.DefaultToFood(22, 22, 206, 28800, false, 17);
			this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 0, 10, 0));
		elseif (type == 1911) then
			this.DefaultToFood(22, 22, 207, 14400, true, 17);
			this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 0, 10, 0));
		end
	elseif (type > 1920) then

		if (type == 2266) then
			this.DefaultToFood(22, 22, 25, 14400, true, 17);
			this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 0, 5, 0));
		elseif (type == 2267) then
			this.DefaultToFood(22, 22, 206, 28800, false, 17);
			this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 0, 55, 0));
		elseif (type == 2268) then
			this.DefaultToFood(22, 22, 206, 36000, true, 17);
			this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 0, 75, 0));
		else
			if (type == 2425) then
				this.DefaultToFood(22, 22, 26, 28800, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 0, 25, 0));
			elseif (type == 2426) then
				this.DefaultToFood(22, 22, 206, 36000, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 0, 75, 0));
			elseif (type == 2427) then
				this.DefaultToFood(22, 22, 206, 28800, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 0, 25, 0));
			else
				if (type == 3195) then
					this.DefaultToFood(22, 22, 206, 50400, true, 17);
					this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
				end
			end
		end

	elseif (type == 1912) then
		this.DefaultToHealingPotion(22, 22, 80, 17);
		this.SetShopValues(ItemRarityColor.Blue1, 40);
	elseif (type == 1919) then
		this.DefaultToFood(22, 22, 207, 14400, false, 17);
		this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 0, 25, 0));
	elseif (type == 1920) then
		this.DefaultToFood(22, 22, 207, 14400, false, 17);
		this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 0, 25, 0));
	end
elseif (type <= 4625) then
	if (type <= 4297) then
		if (type == 3532) then
			this.DefaultToFood(22, 22, 207, 86400, false, 17);
			this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 5, 0, 0));
		else
			if (type == 4009) then
				this.DefaultToFood(22, 22, 26, 18000, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
			elseif (type == 4010) then
			elseif (type == 4011) then
				this.DefaultToFood(22, 22, 207, 57600, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 3, 0, 0));
			elseif (type == 4012) then
				this.DefaultToFood(22, 22, 206, 36000, true, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
			elseif (type == 4013) then
				this.DefaultToFood(22, 22, 207, 86400, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 5, 0, 0));
			elseif (type == 4014) then
				this.DefaultToFood(22, 22, 26, 36000, true, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
			elseif (type == 4015) then
				this.DefaultToFood(22, 22, 207, 28800, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 2, 0, 0));
			elseif (type == 4016) then
				this.DefaultToFood(22, 22, 206, 50400, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 2, 0, 0));
			elseif (type == 4017) then
				this.DefaultToFood(22, 22, 206, 72000, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 3, 0, 0));
			elseif (type == 4018) then
				this.DefaultToFood(22, 22, 206, 57600, true, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 2, 0, 0));
			elseif (type == 4019) then
				this.DefaultToFood(22, 22, 206, 36000, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
			elseif (type == 4020) then
				this.DefaultToFood(22, 22, 206, 50400, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 2, 0, 0));
			elseif (type == 4021) then
				this.DefaultToFood(22, 22, 206, 36000, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
			elseif (type == 4022) then
				this.DefaultToFood(22, 22, 207, 172800, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 50, 0, 0));
			elseif (type == 4023) then
				this.DefaultToFood(22, 22, 206, 57600, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 2, 0, 0));
			elseif (type == 4024) then
				this.DefaultToFood(22, 22, 26, 36000, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
			elseif (type == 4025) then
				this.DefaultToFood(22, 22, 207, 43200, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 3, 0, 0));
			elseif (type == 4026) then
				this.DefaultToFood(22, 22, 206, 50400, true, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 2, 0, 0));
			elseif (type == 4027) then
				this.DefaultToFood(22, 22, 207, 57600, true, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 3, 0, 0));
			elseif (type == 4028) then
				this.DefaultToFood(22, 22, 206, 57600, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 2, 0, 0));
			elseif (type == 4029) then
				this.DefaultToFood(22, 22, 207, 28800, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 2, 0, 0));
			elseif (type == 4030) then
				this.DefaultToFood(22, 22, 26, 90000, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 50, 0));
			elseif (type == 4031) then
				this.DefaultToFood(22, 22, 26, 36000, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
			elseif (type == 4032) then
				this.DefaultToFood(22, 22, 206, 36000, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
			elseif (type == 4033) then
				this.DefaultToFood(22, 22, 26, 36000, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 0, 50, 0));
			elseif (type == 4034) then
				this.DefaultToFood(22, 22, 206, 50400, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 0, 50, 0));
			elseif (type == 4035) then
				this.DefaultToFood(22, 22, 206, 64800, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 2, 50, 0));
			elseif (type == 4036) then
				this.DefaultToFood(22, 22, 207, 28800, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 2, 0, 0));
			elseif (type == 4037) then
				this.DefaultToFood(22, 22, 207, 57600, false, 17);
				this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 3, 0, 0));
			else
				if (type == 4282) then
					this.DefaultToFood(22, 22, 26, 18000, false, 17);
					this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
				elseif (type == 4283) then
					this.DefaultToFood(22, 22, 26, 18000, false, 17);
					this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
				elseif (type == 4284) then
					this.DefaultToFood(22, 22, 26, 18000, false, 17);
					this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
				elseif (type == 4285) then
					this.DefaultToFood(22, 22, 26, 18000, false, 17);
					this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
				elseif (type == 4286) then
					this.DefaultToFood(22, 22, 26, 18000, false, 17);
					this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
				elseif (type == 4287) then
					this.DefaultToFood(22, 22, 26, 18000, false, 17);
					this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
				elseif (type == 4288) then
					this.DefaultToFood(22, 22, 206, 18000, false, 17);
					this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
				elseif (type == 4289) then
					this.DefaultToFood(22, 22, 26, 18000, false, 17);
					this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
				elseif (type == 4290) then
					this.DefaultToFood(22, 22, 26, 18000, false, 17);
					this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
				elseif (type == 4291) then
					this.DefaultToFood(22, 22, 26, 18000, false, 17);
					this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
				elseif (type == 4292) then
					this.DefaultToFood(22, 22, 26, 18000, false, 17);
					this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
				elseif (type == 4293) then
					this.DefaultToFood(22, 22, 26, 18000, false, 17);
					this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
				elseif (type == 4294) then
					this.DefaultToFood(22, 22, 26, 18000, false, 17);
					this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
				elseif (type == 4295) then
					this.DefaultToFood(22, 22, 26, 18000, false, 17);
					this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
				elseif (type == 4296) then
					this.DefaultToFood(22, 22, 26, 18000, false, 17);
					this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
				elseif (type == 4297) then
					this.DefaultToFood(22, 22, 206, 18000, false, 17);
					this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
				end
			end
		end
	elseif (type == 4403) then
		this.DefaultToFood(22, 22, 206, 36000, false, 17);
		this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
	elseif (type == 4411) then
		this.DefaultToFood(22, 22, 26, 36000, false, 17);
		this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
	else
		if (type == 4614) then
			this.DefaultToFood(22, 22, 26, 36000, true, 17);
			this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
		elseif (type == 4615) then
			this.DefaultToFood(22, 22, 207, 57600, true, 17);
			this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 4, 0, 0));
		elseif (type == 4616) then
			this.DefaultToFood(22, 22, 26, 36000, true, 17);
			this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
		elseif (type == 4617) then
			this.DefaultToFood(22, 22, 26, 54000, true, 17);
			this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
		elseif (type == 4618) then
			this.DefaultToFood(22, 22, 26, 36000, true, 17);
			this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
		elseif (type == 4619) then
			this.DefaultToFood(22, 22, 26, 72000, true, 17);
			this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 2, 0, 0));
		elseif (type == 4620) then
			this.DefaultToFood(22, 22, 26, 72000, true, 17);
			this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 2, 0, 0));
		elseif (type == 4621) then
			this.DefaultToFood(22, 22, 26, 72000, true, 17);
			this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 2, 0, 0));
		elseif (type == 4622) then
			this.DefaultToFood(22, 22, 26, 72000, true, 17);
			this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 2, 0, 0));
		elseif (type == 4623) then
			this.DefaultToFood(22, 22, 206, 72000, true, 17);
			this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 2, 0, 0));
		elseif (type == 4624) then
			this.DefaultToFood(22, 22, 26, 54000, true, 17);
			this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 2, 0, 0));
		elseif (type == 4625) then
			this.DefaultToFood(22, 22, 26, 90000, false, 17);
			this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 3, 0, 0));
		end
	end
elseif (type > 5042) then
	if (type == 5092) then
		this.DefaultToFood(22, 22, 206, 28800, false, 17);
		this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 0, 50, 0));
	elseif (type == 5093) then
		this.DefaultToFood(22, 22, 206, 21600, false, 17);
		this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
	else
		if (type == 5275) then
			this.DefaultToFood(22, 22, 26, 7200, true, 17);
			this.SetShopValues(ItemRarityColor.White0, Item.buyPrice(0, 0, 1, 25));
		elseif (type == 5277) then
			this.DefaultToFood(22, 22, 26, 18000, false, 17);
			this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
		elseif (type == 5278) then
			this.DefaultToFood(22, 22, 26, 18000, false, 17);
			this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
		end
	end
elseif (type == 5009) then
	this.DefaultToFood(22, 22, 26, 18000, true, 17);
	this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 0, 0, 20));
elseif (type == 5041) then
	this.DefaultToFood(22, 22, 26, 72000, true, 17);
	this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
elseif (type == 5042) then
	this.DefaultToFood(22, 22, 206, 36000, true, 17);
	this.SetShopValues(ItemRarityColor.Blue1, Item.buyPrice(0, 1, 0, 0));
end
local single = 0;
if (this.buffType == 207) then
	single = single + 12;
elseif (this.buffType ~= 206) then
	single = single + 3;
else
	single = single + 8;
end
single = single + (this.buffTime / 14400);
this.rare = math.floor(single / 4);

end --SetFoodDefaults(type)

---------------------------


return {
	factory = function(obj)
		this = obj
		return SetFoodDefaults
	end
}