new rules for morale (smaller, shorter steps)

This commit is contained in:
Enno Rehling 2009-08-11 19:01:00 +00:00
parent 4af4714883
commit e01bf1bd2f
10 changed files with 76 additions and 54 deletions

View File

@ -646,7 +646,7 @@ give_control(unit * u, unit * u2)
int morale = region_get_morale(r); int morale = region_get_morale(r);
region_set_owner(r, u2->faction, turn); region_set_owner(r, u2->faction, turn);
if (morale>0) { 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; building * b;
int money; int money;
int maxsize; int maxsize;
int morale;
f = region_get_owner(r); f = region_get_owner(r);
if (f==NULL || is_mourning(r, turn)) { if (f==NULL || is_mourning(r, turn)) {
@ -3315,13 +3314,12 @@ peasant_taxes(region * r)
if (u==NULL || u->faction!=f) return; if (u==NULL || u->faction!=f) return;
maxsize = buildingeffsize(b, false); maxsize = buildingeffsize(b, false);
morale = region_get_morale(r); if (maxsize>0) {
if (morale<maxsize) { double taxfactor = money * b->type->taxes(b, maxsize);
maxsize = morale; double morale = money * region_get_morale(r) * MORALE_TAX_FACTOR;
} if (taxfactor>morale) taxfactor = morale;
if (maxsize>0 && morale>0) { if (taxfactor>0) {
int taxmoney = (int)(money * b->type->taxes(b, maxsize)); int taxmoney = (int)taxfactor;
if (taxmoney>0) {
change_money(u, taxmoney); change_money(u, taxmoney);
rsetmoney(r, money - taxmoney); rsetmoney(r, money - taxmoney);
ADDMSG(&u->faction->msgs, msg_message("income_tax", ADDMSG(&u->faction->msgs, msg_message("income_tax",

View File

@ -3088,7 +3088,7 @@ age_building(building * b)
static double rc_popularity(const struct race * rc) 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 */ return 1.0/(pop-MORALE_COOLDOWN); /* 10 turns average */
} }

View File

@ -1202,6 +1202,7 @@ statistics(FILE * F, const region * r, const faction * f)
rparagraph(F, buf, 2, 2, 0); rparagraph(F, buf, 2, 2, 0);
msg_release(m); msg_release(m);
} }
if (p) { if (p) {
m = msg_message("nr_stat_recruits", "max", p / RECRUITFRACTION); m = msg_message("nr_stat_recruits", "max", p / RECRUITFRACTION);
nr_render(m, f->locale, buf, sizeof(buf), f); 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); rparagraph(F, buf, 2, 2, 0);
msg_release(m); 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 */ /* info about units */

View File

@ -62,10 +62,13 @@ struct rawmaterial;
struct donation; struct donation;
struct item; 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_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_TAKEOVER 0 /* Morale of peasants after they lose their lord */
#define MORALE_COOLDOWN 2 /* minimum cooldown before a morale change occurs */ #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 #define OWNER_MOURNING 0x01
typedef struct region_owner { typedef struct region_owner {

View File

@ -1,5 +1,5 @@
Microsoft Visual Studio Solution File, Format Version 9.00 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}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "util", "common\util.vcproj", "{F70CFB27-8A2F-E447-B452-4E1C590EDA6D}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kernel", "common\kernel.vcproj", "{6F104C0A-DDF5-A34B-A89C-0DC278DCEF6D}" 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 EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "editor", "eressea\editor.vcproj", "{D893D6B3-805D-9848-8EA4-CDA1B79151F6}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "editor", "eressea\editor.vcproj", "{D893D6B3-805D-9848-8EA4-CDA1B79151F6}"
EndProject 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}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "eressea", "eressea.vcproj", "{AD80EB0B-7CB4-42F2-9C95-8CCEF68DB387}"
EndProject EndProject
Global Global
GlobalSection(SubversionScc) = preSolution
Svn-Managed = True
Manager = AnkhSVN - Subversion Support for Visual Studio
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32 Debug|Win32 = Debug|Win32
Profile|Win32 = Profile|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.ActiveCfg = Profile|Win32
{D893D6B3-805D-9848-8EA4-CDA1B79151F6}.Profile|Win32.Build.0 = Profile|Win32 {D893D6B3-805D-9848-8EA4-CDA1B79151F6}.Profile|Win32.Build.0 = Profile|Win32
{D893D6B3-805D-9848-8EA4-CDA1B79151F6}.Release|Win32.ActiveCfg = Release|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.ActiveCfg = Debug|Win32
{AD80EB0B-7CB4-42F2-9C95-8CCEF68DB387}.Debug|Win32.Build.0 = Debug|Win32 {AD80EB0B-7CB4-42F2-9C95-8CCEF68DB387}.Debug|Win32.Build.0 = Debug|Win32
{AD80EB0B-7CB4-42F2-9C95-8CCEF68DB387}.Profile|Win32.ActiveCfg = Release|Win32 {AD80EB0B-7CB4-42F2-9C95-8CCEF68DB387}.Profile|Win32.ActiveCfg = Release|Win32
@ -55,8 +47,4 @@ Global
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(SubversionScc) = preSolution
Svn-Managed = True
Manager = AnkhSVN - Subversion Support for Visual Studio
EndGlobalSection
EndGlobal EndGlobal

View File

@ -251,6 +251,22 @@
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav" 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}" 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> </Filter>
</Files> </Files>
<Globals> <Globals>

View File

@ -377,14 +377,6 @@
RelativePath=".\console.h" RelativePath=".\console.h"
> >
</File> </File>
<File
RelativePath="..\scripts\default.lua"
>
</File>
<File
RelativePath="..\scripts\eressea.lua"
>
</File>
<File <File
RelativePath=".\Jamfile" RelativePath=".\Jamfile"
> >
@ -393,18 +385,10 @@
RelativePath=".\korrektur.c" RelativePath=".\korrektur.c"
> >
</File> </File>
<File
RelativePath="..\scripts\run-e3a.lua"
>
</File>
<File <File
RelativePath=".\server.c" RelativePath=".\server.c"
> >
</File> </File>
<File
RelativePath="..\scripts\tests.lua"
>
</File>
</Files> </Files>
<Globals> <Globals>
</Globals> </Globals>

View File

@ -54,7 +54,7 @@
<function name="itemdrop" value="defaultdrops"/> <function name="itemdrop" value="defaultdrops"/>
<param name="other_race" value="dwarf"/> <param name="other_race" value="dwarf"/>
<param name="other_cost" value="500"/> <param name="other_cost" value="500"/>
<param name="morale" value="8"/> <param name="morale" value="3"/>
<param name="luxury_trade" value="600"/> <param name="luxury_trade" value="600"/>
<skill name="bow" modifier="-1"/> <skill name="bow" modifier="-1"/>
<skill name="building" modifier="1"/> <skill name="building" modifier="1"/>

View File

@ -73,25 +73,45 @@
<text locale="en">rebellious</text> <text locale="en">rebellious</text>
</string> </string>
<string name="1"> <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="de">zornige</text>
<text locale="en">angry</text> <text locale="en">angry</text>
</string> </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="de">zufriedene</text>
<text locale="en">content</text> <text locale="en">content</text>
</string> </string>
<string name="3"> <string name="7">
<text locale="de">glückliche</text> <text locale="de">glückliche</text>
<text locale="en">happy</text> <text locale="en">happy</text>
</string> </string>
<string name="4"> <string name="8">
<text locale="de">treue</text> <text locale="de">treue</text>
<text locale="en">loyal</text> <text locale="en">loyal</text>
</string> </string>
<string name="5"> <string name="9">
<text locale="de">ergebene</text> <text locale="de">ergebene</text>
<text locale="en">devoted</text> <text locale="en">devoted</text>
</string> </string>
<string name="10">
<text locale="de">unterwürfige</text>
<text locale="en">subservient</text>
</string>
</namespace> </namespace>
<string name="charger"> <string name="charger">
<text locale="de">Streitross</text> <text locale="de">Streitross</text>

View File

@ -776,7 +776,6 @@
<arg name="units" type="int"/> <arg name="units" type="int"/>
</type> </type>
<text locale="de">"Deine Partei hat $int($population) Personen in $int($units) Einheiten."</text> <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> <text locale="en">"Your faction has $int($population) people in $int($units) units."</text>
</message> </message>
<message name="nr_stat_header" section="nr"> <message name="nr_stat_header" section="nr">
@ -785,7 +784,6 @@
</type> </type>
<text locale="de">"Statistik für $region($region):"</text> <text locale="de">"Statistik für $region($region):"</text>
<text locale="en">"Statistics for $region($region):"</text> <text locale="en">"Statistics for $region($region):"</text>
<text locale="fr">"Statistics for $region($region):"</text>
</message> </message>
<message name="nr_stat_maxentertainment" section="nr"> <message name="nr_stat_maxentertainment" section="nr">
<type> <type>
@ -793,7 +791,13 @@
</type> </type>
<text locale="de">"Unterhaltung: max. $int($max) Silber"</text> <text locale="de">"Unterhaltung: max. $int($max) Silber"</text>
<text locale="en">"Entertainment: max. $int($max) silver"</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>
<message name="nr_stat_luxuries" section="nr"> <message name="nr_stat_luxuries" section="nr">
<type> <type>
@ -801,14 +805,13 @@
</type> </type>
<text locale="de">"Luxusgüter zum angegebenen Preis: $int($max)"</text> <text locale="de">"Luxusgüter zum angegebenen Preis: $int($max)"</text>
<text locale="en">"Luxury goods at this price: $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>
<message name="nr_stat_salary" section="nr"> <message name="nr_stat_salary" section="nr">
<type> <type>
<arg name="max" type="int"/> <arg name="max" type="int"/>
</type> </type>
<text locale="de">"Lohn für Arbeit: $int($max) Silber"</text> <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>
<message name="nr_stat_salary_new" section="nr"> <message name="nr_stat_salary_new" section="nr">
<type> <type>