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

◆ CollectTaxes()

void Terraria.Player.CollectTaxes ( )
inline

Definition at line 22448 of file Player.cs.

22449 {
22450 int num = Item.buyPrice(0, 0, 0, 50);
22451 int num2 = Item.buyPrice(0, 25);
22452 if (Main.tenthAnniversaryWorld)
22453 {
22454 num2 *= 2;
22455 num *= 2;
22456 }
22457 if (!NPC.taxCollector || taxMoney >= num2)
22458 {
22459 return;
22460 }
22461 int num3 = 0;
22462 for (int i = 0; i < 200; i++)
22463 {
22464 if (Main.npc[i].active && !Main.npc[i].homeless && !NPCID.Sets.IsTownPet[Main.npc[i].type] && NPC.TypeToDefaultHeadIndex(Main.npc[i].type) > 0)
22465 {
22466 num3++;
22467 }
22468 }
22469 taxMoney += num * num3;
22470 if (taxMoney > num2)
22471 {
22472 taxMoney = num2;
22473 }
22474 }
static bool[] IsTownPet
If true for a given NPC type (F:Terraria.NPC.type), then that NPC is categorized as a town pet....
Definition NPCID.cs:224

References Terraria.Item.buyPrice(), Terraria.ID.NPCID.Sets.IsTownPet, Terraria.Main.npc, Terraria.NPC.taxCollector, Terraria.Player.taxMoney, Terraria.Main.tenthAnniversaryWorld, and Terraria.NPC.TypeToDefaultHeadIndex().

+ Here is the call graph for this function: