forked from github/server
new rules for morale (smaller, shorter steps)
This commit is contained in:
parent
4af4714883
commit
e01bf1bd2f
10 changed files with 76 additions and 54 deletions
|
@ -646,7 +646,7 @@ give_control(unit * u, unit * u2)
|
|||
int morale = region_get_morale(r);
|
||||
region_set_owner(r, u2->faction, turn);
|
||||
if (morale>0) {
|
||||
region_set_morale(r, morale-1, turn);
|
||||
region_set_morale(r, morale-MORALE_TRANSFER, turn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3299,7 +3299,6 @@ peasant_taxes(region * r)
|
|||
building * b;
|
||||
int money;
|
||||
int maxsize;
|
||||
int morale;
|
||||
|
||||
f = region_get_owner(r);
|
||||
if (f==NULL || is_mourning(r, turn)) {
|
||||
|
@ -3315,13 +3314,12 @@ peasant_taxes(region * r)
|
|||
if (u==NULL || u->faction!=f) return;
|
||||
|
||||
maxsize = buildingeffsize(b, false);
|
||||
morale = region_get_morale(r);
|
||||
if (morale<maxsize) {
|
||||
maxsize = morale;
|
||||
}
|
||||
if (maxsize>0 && morale>0) {
|
||||
int taxmoney = (int)(money * b->type->taxes(b, maxsize));
|
||||
if (taxmoney>0) {
|
||||
if (maxsize>0) {
|
||||
double taxfactor = money * b->type->taxes(b, maxsize);
|
||||
double morale = money * region_get_morale(r) * MORALE_TAX_FACTOR;
|
||||
if (taxfactor>morale) taxfactor = morale;
|
||||
if (taxfactor>0) {
|
||||
int taxmoney = (int)taxfactor;
|
||||
change_money(u, taxmoney);
|
||||
rsetmoney(r, money - taxmoney);
|
||||
ADDMSG(&u->faction->msgs, msg_message("income_tax",
|
||||
|
|
|
@ -3088,7 +3088,7 @@ age_building(building * b)
|
|||
|
||||
static double rc_popularity(const struct race * rc)
|
||||
{
|
||||
int pop = get_param_int(rc->parameters, "morale", 10);
|
||||
int pop = get_param_int(rc->parameters, "morale", MORALE_AVERAGE);
|
||||
return 1.0/(pop-MORALE_COOLDOWN); /* 10 turns average */
|
||||
}
|
||||
|
||||
|
|
|
@ -1202,6 +1202,7 @@ statistics(FILE * F, const region * r, const faction * f)
|
|||
rparagraph(F, buf, 2, 2, 0);
|
||||
msg_release(m);
|
||||
}
|
||||
|
||||
if (p) {
|
||||
m = msg_message("nr_stat_recruits", "max", p / RECRUITFRACTION);
|
||||
nr_render(m, f->locale, buf, sizeof(buf), f);
|
||||
|
@ -1220,6 +1221,15 @@ statistics(FILE * F, const region * r, const faction * f)
|
|||
rparagraph(F, buf, 2, 2, 0);
|
||||
msg_release(m);
|
||||
}
|
||||
|
||||
if (r->land->ownership) {
|
||||
m = msg_message("nr_stat_morale", "morale", r->land->morale);
|
||||
nr_render(m, f->locale, buf, sizeof(buf), f);
|
||||
rparagraph(F, buf, 2, 2, 0);
|
||||
msg_release(m);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
/* info about units */
|
||||
|
||||
|
|
|
@ -62,10 +62,13 @@ struct rawmaterial;
|
|||
struct donation;
|
||||
struct item;
|
||||
|
||||
#define MORALE_MAX 4 /* Maximum morale allowed */
|
||||
#define MORALE_TAX_FACTOR 0.005 /* 0.5% tax per point of morale */
|
||||
#define MORALE_MAX 10 /* Maximum morale allowed */
|
||||
#define MORALE_DEFAULT 2 /* Morale of peasants when they are conquered for the first time */
|
||||
#define MORALE_TAKEOVER 0 /* Morale of peasants after they lose their lord */
|
||||
#define MORALE_COOLDOWN 2 /* minimum cooldown before a morale change occurs */
|
||||
#define MORALE_AVERAGE 6 /* default average time for morale to change */
|
||||
#define MORALE_TRANSFER 2 /* points of morale lost when GIVE COMMAND */
|
||||
|
||||
#define OWNER_MOURNING 0x01
|
||||
typedef struct region_owner {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual C++ Express 2005
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util", "common\util.vcproj", "{F70CFB27-8A2F-E447-B452-4E1C590EDA6D}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kernel", "common\kernel.vcproj", "{6F104C0A-DDF5-A34B-A89C-0DC278DCEF6D}"
|
||||
|
@ -8,17 +8,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gamecode", "common\gamecode
|
|||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "editor", "eressea\editor.vcproj", "{D893D6B3-805D-9848-8EA4-CDA1B79151F6}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "eressea-lua", "eressea\eressea-lua.vcproj", "{75501170-51C2-E641-BA8B-EDC008184192}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{6F104C0A-DDF5-A34B-A89C-0DC278DCEF6D} = {6F104C0A-DDF5-A34B-A89C-0DC278DCEF6D}
|
||||
{F70CFB27-8A2F-E447-B452-4E1C590EDA6D} = {F70CFB27-8A2F-E447-B452-4E1C590EDA6D}
|
||||
{1E8BFF9E-3044-0742-992F-C5765B80FE65} = {1E8BFF9E-3044-0742-992F-C5765B80FE65}
|
||||
{D893D6B3-805D-9848-8EA4-CDA1B79151F6} = {D893D6B3-805D-9848-8EA4-CDA1B79151F6}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "eressea", "eressea.vcproj", "{AD80EB0B-7CB4-42F2-9C95-8CCEF68DB387}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SubversionScc) = preSolution
|
||||
Svn-Managed = True
|
||||
Manager = AnkhSVN - Subversion Support for Visual Studio
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Profile|Win32 = Profile|Win32
|
||||
|
@ -41,10 +37,6 @@ Global
|
|||
{D893D6B3-805D-9848-8EA4-CDA1B79151F6}.Profile|Win32.ActiveCfg = Profile|Win32
|
||||
{D893D6B3-805D-9848-8EA4-CDA1B79151F6}.Profile|Win32.Build.0 = Profile|Win32
|
||||
{D893D6B3-805D-9848-8EA4-CDA1B79151F6}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{75501170-51C2-E641-BA8B-EDC008184192}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{75501170-51C2-E641-BA8B-EDC008184192}.Profile|Win32.ActiveCfg = Profile|Win32
|
||||
{75501170-51C2-E641-BA8B-EDC008184192}.Profile|Win32.Build.0 = Profile|Win32
|
||||
{75501170-51C2-E641-BA8B-EDC008184192}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{AD80EB0B-7CB4-42F2-9C95-8CCEF68DB387}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{AD80EB0B-7CB4-42F2-9C95-8CCEF68DB387}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{AD80EB0B-7CB4-42F2-9C95-8CCEF68DB387}.Profile|Win32.ActiveCfg = Release|Win32
|
||||
|
@ -55,8 +47,4 @@ Global
|
|||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(SubversionScc) = preSolution
|
||||
Svn-Managed = True
|
||||
Manager = AnkhSVN - Subversion Support for Visual Studio
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
|
@ -251,6 +251,22 @@
|
|||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\scripts\default.lua"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\scripts\eressea.lua"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\scripts\run-e3a.lua"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\scripts\tests.lua"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
|
|
|
@ -377,14 +377,6 @@
|
|||
RelativePath=".\console.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\default.lua"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\eressea.lua"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Jamfile"
|
||||
>
|
||||
|
@ -393,18 +385,10 @@
|
|||
RelativePath=".\korrektur.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\run-e3a.lua"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\server.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\scripts\tests.lua"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
<function name="itemdrop" value="defaultdrops"/>
|
||||
<param name="other_race" value="dwarf"/>
|
||||
<param name="other_cost" value="500"/>
|
||||
<param name="morale" value="8"/>
|
||||
<param name="morale" value="3"/>
|
||||
<param name="luxury_trade" value="600"/>
|
||||
<skill name="bow" modifier="-1"/>
|
||||
<skill name="building" modifier="1"/>
|
||||
|
|
|
@ -73,25 +73,45 @@
|
|||
<text locale="en">rebellious</text>
|
||||
</string>
|
||||
<string name="1">
|
||||
<text locale="de">wütende</text>
|
||||
<text locale="en">mad</text>
|
||||
</string>
|
||||
<string name="2">
|
||||
<text locale="de">zornige</text>
|
||||
<text locale="en">angry</text>
|
||||
</string>
|
||||
<string name="2">
|
||||
<string name="3">
|
||||
<text locale="de">unruhige</text>
|
||||
<text locale="en">agitated</text>
|
||||
</string>
|
||||
<string name="4">
|
||||
<text locale="de">gleichgültige</text>
|
||||
<text locale="en">indifferent</text>
|
||||
</string>
|
||||
<string name="5">
|
||||
<text locale="de">entspannte</text>
|
||||
<text locale="en">relaxed</text>
|
||||
</string>
|
||||
<string name="6">
|
||||
<text locale="de">zufriedene</text>
|
||||
<text locale="en">content</text>
|
||||
</string>
|
||||
<string name="3">
|
||||
<string name="7">
|
||||
<text locale="de">glückliche</text>
|
||||
<text locale="en">happy</text>
|
||||
</string>
|
||||
<string name="4">
|
||||
<string name="8">
|
||||
<text locale="de">treue</text>
|
||||
<text locale="en">loyal</text>
|
||||
</string>
|
||||
<string name="5">
|
||||
<string name="9">
|
||||
<text locale="de">ergebene</text>
|
||||
<text locale="en">devoted</text>
|
||||
</string>
|
||||
<string name="10">
|
||||
<text locale="de">unterwürfige</text>
|
||||
<text locale="en">subservient</text>
|
||||
</string>
|
||||
</namespace>
|
||||
<string name="charger">
|
||||
<text locale="de">Streitross</text>
|
||||
|
|
|
@ -776,7 +776,6 @@
|
|||
<arg name="units" type="int"/>
|
||||
</type>
|
||||
<text locale="de">"Deine Partei hat $int($population) Personen in $int($units) Einheiten."</text>
|
||||
<text locale="fr">"Your faction has $int($population) people in $int($units) units."</text>
|
||||
<text locale="en">"Your faction has $int($population) people in $int($units) units."</text>
|
||||
</message>
|
||||
<message name="nr_stat_header" section="nr">
|
||||
|
@ -785,7 +784,6 @@
|
|||
</type>
|
||||
<text locale="de">"Statistik für $region($region):"</text>
|
||||
<text locale="en">"Statistics for $region($region):"</text>
|
||||
<text locale="fr">"Statistics for $region($region):"</text>
|
||||
</message>
|
||||
<message name="nr_stat_maxentertainment" section="nr">
|
||||
<type>
|
||||
|
@ -793,7 +791,13 @@
|
|||
</type>
|
||||
<text locale="de">"Unterhaltung: max. $int($max) Silber"</text>
|
||||
<text locale="en">"Entertainment: max. $int($max) silver"</text>
|
||||
<text locale="fr">"Entertainment: max. $int($max) silver"</text>
|
||||
</message>
|
||||
<message name="nr_stat_morale" section="nr">
|
||||
<type>
|
||||
<arg name="morale" type="int"/>
|
||||
</type>
|
||||
<text locale="de">"Moral der Bauern: $int($morale)"</text>
|
||||
<text locale="en">"Peasant morale: $int($morale)"</text>
|
||||
</message>
|
||||
<message name="nr_stat_luxuries" section="nr">
|
||||
<type>
|
||||
|
@ -801,14 +805,13 @@
|
|||
</type>
|
||||
<text locale="de">"Luxusgüter zum angegebenen Preis: $int($max)"</text>
|
||||
<text locale="en">"Luxury goods at this price: $int($max)"</text>
|
||||
<text locale="fr">"Luxury goods at this price: $int($max)"</text>
|
||||
</message>
|
||||
<message name="nr_stat_salary" section="nr">
|
||||
<type>
|
||||
<arg name="max" type="int"/>
|
||||
</type>
|
||||
<text locale="de">"Lohn für Arbeit: $int($max) Silber"</text>
|
||||
<text locale="en">"Worker's salary: $int($max) silver"</text>
|
||||
<text locale="en">"Worker salary: $int($max) silver"</text>
|
||||
</message>
|
||||
<message name="nr_stat_salary_new" section="nr">
|
||||
<type>
|
||||
|
|
Loading…
Reference in a new issue