Elin:Code Analysis/Housing: Difference between revisions
No edit summary |
|||
Line 117: | Line 117: | ||
public int GetResidentTax() | public int GetResidentTax() | ||
{ | { | ||
if (! | if (!policies.IsActive(2512, 30)) | ||
{ | { | ||
return 0; | return 0; | ||
} | } | ||
int num = 0; | int num = 0; | ||
int num2 = | int num2 = (policies.IsActive(2500, 30) ? Evalue(2500) : 0); | ||
int num3 = | int num3 = (policies.IsActive(2501, 30) ? Evalue(2501) : 0); | ||
int num4 = 50 + (int)Mathf.Sqrt( | int num4 = 50 + (int)Mathf.Sqrt(Evalue(2512)) * 5; | ||
foreach (Chara | foreach (Chara member in members) | ||
{ | { | ||
if ( | if (member.IsPC || member.memberType != 0) | ||
{ | { | ||
bool isWealthy = | continue; | ||
} | |||
bool isWealthy = member.IsWealthy; | |||
int num5 = 0; | |||
foreach (Hobby item in member.ListWorks().Concat(member.ListHobbies())) | |||
{ | |||
int num6 = item.source.tax * 100 / 100; | |||
if (num6 > num5) | |||
{ | { | ||
num5 = num6; | |||
} | } | ||
} | |||
int num7 = ((isWealthy ? 50 : 10) + member.LV * 2) * num5 / 100 * num4 / 100; | |||
if (isWealthy && num2 > 0) | |||
{ | |||
num7 = num7 * (150 + (int)Mathf.Sqrt(num2) * 5) / 100; | |||
} | |||
if (num3 > 0) | |||
{ | |||
num7 += (80 + (int)Mathf.Sqrt(num3) * 5) * member.faith.source.tax / 100; | |||
} | |||
num7 = num7 * efficiency / (IsTaxFree ? 100 : 1000); | |||
num += num7; | |||
if (num7 > 0) | |||
{ | |||
Log("bTax", num7.ToString() ?? "", member.Name); | |||
} | } | ||
} | } | ||
statistics.tax += num; | |||
return num; | return num; | ||
} | } | ||
</syntaxhighlight>If | </syntaxhighlight> | ||
* The policy of wealth tax, faith tax, and resident tax must already have been enabled for 30 days, for these policies to count. | |||
** The '''base tax percentage''' for each resident is calculated with (50 + Square root of resident tax lvl * 5). | |||
** Each hobby of resident have a different tax base, this we call '''"hobby tax standard"''', we take the maximum among all hobbies of that resident. | |||
*** For example, Reading is 120, Lottery is 140, Gacha is 160 (don't play gacha games guys), Smoking is 300, Extravagance is 400, Rambo is 30, and Supervisor is 0. | |||
** The overall tax for a resident is calculated as: | |||
*** If wealthy: (50 + resident level * 2) * base tax percentage% * hobby tax standard%. | |||
*** If not wealthy: (10 + resident level * 2) * base tax percentage% * hobby tax standard%. | |||
**** For example, a wealthy citizen of lv 5, whose hobby is reading and the resident tax policy level is 9, his tax is (50 + 2 * 5)* 120% * 65% = 46.8. | |||
** Now we go to the policies. | |||
*** If wealthy & wealthy tax activated: | |||
**** the overall tax is modified by (150 + sqrt of wealthy tax policy lvl * 5)%. | |||
*** If faith tax is activated: | |||
**** the overall tax is modified by +(80 + sqrt of faith tax policy lvl) * Faith tax rate%. | |||
***** The faith tax rate is different for each religion. Eyth of void: 500%. Ehekatl of luck: 300%, The lowest is Yakasha of Oblivion: 0%, and Lulwy of Wind: 25%. | |||
** Finally, this tax rate is penalized for lack of efficiency or not in tax free land. | |||
*** '''If your land is not tax free, all resident tax will be penalized by 90%!''' | |||
* Let's look at an example. | |||
** Here is a wealthy citizen, who has a hobby of Gacha, and is lvl 50, and he is worshiping Eyth of void. All your tax policies is at lvl 100, but the land is not tax free. | |||
*** The overall tax before policies is : (50 + 50 * 2) * 160% * (50+50)% = 240 orens. | |||
*** We then have wealthy tax, modified to 240 * (150 + 50)% = 480 orens | |||
*** Then the faith tax modified to 480 + (80 + 50) * 500% = 1230 orens. | |||
** But your land is not tax free, so the final tax is 123 orens. Making your blood boil already? Wanna buy a nuke for Mysilia? | |||
[[Category:Elin Spoiler]] | [[Category:Elin Spoiler]] | ||
[[Category:EN]] | [[Category:EN]] |
Revision as of 17:45, 4 January 2025
This page does not contain information obtained through legitimate play, but rather through Elin's data analysis, debug mode, and internal file viewing. It may contain serious spoilers or information that may detract from the enjoyment of playing the game. please summarize the content in a way that is easy to understand for people who cannot read the code, rather than posting the code as it is. |
Housing: Visitors / Publicity / Attractiveness
This is (TENATIVELY) the code block that determines the amount of visitors that visit a settlement and the type of visitors that visit.
Value# | Element |
---|---|
(2206) | Attraction |
(2811) | Tourist Safety |
(3702) | Ancient Ruin |
(2822) | Celebrity's Heaven |
(2810) | Open for Buisness |
(2710) | Motherless Zone |
(2202) | Publicity |
if (EClass.rnd(5) == 0 && this.policies.IsActive(2810, -1))
{
int num8 = 3 + this.lv + this.Evalue(2206) / 5 + this.Evalue(3702) * 2 + this.Evalue(2202) / 2;
num8 = num8 * (100 + this.Evalue(3702) * 20 + this.Evalue(2206)) / 100;
num8 = num8 * (100 + (int)Mathf.Sqrt((float)this.Evalue(2811)) * 3) / 100;
if (EClass._map.CountGuest() < num8)
{
Chara chara;
if (this.policies.IsActive(2822, -1) && Mathf.Sqrt((float)(this.Evalue(2822) / 2)) + 5f >= (float)EClass.rnd(100))
{
chara = CharaGen.CreateWealthy(this.ContentLV);
EClass._zone.AddCard(chara, EClass._zone.GetSpawnPos(SpawnPosition.Random, 100) ?? EClass._map.GetRandomSurface(false, true, false));
}
else
{
chara = EClass._zone.SpawnMob(null, SpawnSetting.HomeGuest(this.ContentLV));
}
if (chara != null && (chara.id == "nun_mother" || chara.id == "prostitute") && this.policies.IsActive(2710, -1))
{
chara.Destroy();
chara = null;
}
if (chara != null)
{
this.statistics.visitor++;
chara.memberType = FactionMemberType.Guest;
chara.SetInt(34, EClass.world.date.GetRaw(0));
chara.c_allowance = chara.LV * 100;
if (chara.IsWealthy)
{
chara.c_allowance *= 10;
}
if (date.IsRealTime)
{
Msg.Say("guestArrive", chara.Name, null, null, null);
}
else
{
chara.TryAssignBed();
}
}
}
}
So there's a 80% chance if open for business is active, then
num8 = 3 + (I'm guessing land lvl) + (attractiveness / 5) + (If ancient ruin value is active then, it * 2) + publicity / 2
num8 = num8 (from above) * (100 + ancient ruin * 20 + attractiveness) / 100
num8 = num8 (from above) * (100 + integer of the sqrt((of a float of tourist safety) * 3) / 100)
Then if Celeb heaven is on AND the sqrt(Celeb heaven / 2) + 5 is greater than or equal to a random number from 1-100
THEN
wealthy visitors are generated (based on something called content lvl (which may be danger lvl))
add the random visitors somewhere random
Then the next lines check to say if its a mother and if you have the anti mother policy
Then they get an allowance of their character level * 100,
and if they're wealthy its * 1000
TLDR; if you want to build a settlement that generates orens through visitors you should use a snowy / ancient ruin tile
Housing: Taxes
Value# | Element |
---|---|
(2500) | Wealth Tax |
(2501) | Faith Tax |
(2512) | Resident Tax |
public int GetResidentTax()
{
if (!policies.IsActive(2512, 30))
{
return 0;
}
int num = 0;
int num2 = (policies.IsActive(2500, 30) ? Evalue(2500) : 0);
int num3 = (policies.IsActive(2501, 30) ? Evalue(2501) : 0);
int num4 = 50 + (int)Mathf.Sqrt(Evalue(2512)) * 5;
foreach (Chara member in members)
{
if (member.IsPC || member.memberType != 0)
{
continue;
}
bool isWealthy = member.IsWealthy;
int num5 = 0;
foreach (Hobby item in member.ListWorks().Concat(member.ListHobbies()))
{
int num6 = item.source.tax * 100 / 100;
if (num6 > num5)
{
num5 = num6;
}
}
int num7 = ((isWealthy ? 50 : 10) + member.LV * 2) * num5 / 100 * num4 / 100;
if (isWealthy && num2 > 0)
{
num7 = num7 * (150 + (int)Mathf.Sqrt(num2) * 5) / 100;
}
if (num3 > 0)
{
num7 += (80 + (int)Mathf.Sqrt(num3) * 5) * member.faith.source.tax / 100;
}
num7 = num7 * efficiency / (IsTaxFree ? 100 : 1000);
num += num7;
if (num7 > 0)
{
Log("bTax", num7.ToString() ?? "", member.Name);
}
}
statistics.tax += num;
return num;
}
- The policy of wealth tax, faith tax, and resident tax must already have been enabled for 30 days, for these policies to count.
- The base tax percentage for each resident is calculated with (50 + Square root of resident tax lvl * 5).
- Each hobby of resident have a different tax base, this we call "hobby tax standard", we take the maximum among all hobbies of that resident.
- For example, Reading is 120, Lottery is 140, Gacha is 160 (don't play gacha games guys), Smoking is 300, Extravagance is 400, Rambo is 30, and Supervisor is 0.
- The overall tax for a resident is calculated as:
- If wealthy: (50 + resident level * 2) * base tax percentage% * hobby tax standard%.
- If not wealthy: (10 + resident level * 2) * base tax percentage% * hobby tax standard%.
- For example, a wealthy citizen of lv 5, whose hobby is reading and the resident tax policy level is 9, his tax is (50 + 2 * 5)* 120% * 65% = 46.8.
- Now we go to the policies.
- If wealthy & wealthy tax activated:
- the overall tax is modified by (150 + sqrt of wealthy tax policy lvl * 5)%.
- If faith tax is activated:
- the overall tax is modified by +(80 + sqrt of faith tax policy lvl) * Faith tax rate%.
- The faith tax rate is different for each religion. Eyth of void: 500%. Ehekatl of luck: 300%, The lowest is Yakasha of Oblivion: 0%, and Lulwy of Wind: 25%.
- the overall tax is modified by +(80 + sqrt of faith tax policy lvl) * Faith tax rate%.
- If wealthy & wealthy tax activated:
- Finally, this tax rate is penalized for lack of efficiency or not in tax free land.
- If your land is not tax free, all resident tax will be penalized by 90%!
- Let's look at an example.
- Here is a wealthy citizen, who has a hobby of Gacha, and is lvl 50, and he is worshiping Eyth of void. All your tax policies is at lvl 100, but the land is not tax free.
- The overall tax before policies is : (50 + 50 * 2) * 160% * (50+50)% = 240 orens.
- We then have wealthy tax, modified to 240 * (150 + 50)% = 480 orens
- Then the faith tax modified to 480 + (80 + 50) * 500% = 1230 orens.
- But your land is not tax free, so the final tax is 123 orens. Making your blood boil already? Wanna buy a nuke for Mysilia?
- Here is a wealthy citizen, who has a hobby of Gacha, and is lvl 50, and he is worshiping Eyth of void. All your tax policies is at lvl 100, but the land is not tax free.