forked from github/server
- fix recruit
- skill costs configurable - function to write spells to a file
This commit is contained in:
parent
98f8f1a1f8
commit
71b34b434a
12 changed files with 99 additions and 63 deletions
|
@ -19,6 +19,8 @@
|
|||
* permission from the authors.
|
||||
*/
|
||||
|
||||
#pragma region includes
|
||||
|
||||
#include <config.h>
|
||||
#include <kernel/eressea.h>
|
||||
#include "economy.h"
|
||||
|
@ -79,6 +81,7 @@
|
|||
#include <assert.h>
|
||||
#include <limits.h>
|
||||
|
||||
#pragma endregion
|
||||
|
||||
typedef struct request {
|
||||
struct request * next;
|
||||
|
@ -101,6 +104,27 @@ static int entertaining;
|
|||
static int norders;
|
||||
static request *oa;
|
||||
|
||||
#define RECRUIT_MERGE 1
|
||||
#define RECRUIT_CLASSIC 2
|
||||
#define RECRUIT_ARCHETYPES 4
|
||||
static int rules_recruit = -1;
|
||||
|
||||
static void recruit_init(void)
|
||||
{
|
||||
if (rules_recruit<0) {
|
||||
rules_recruit = 0;
|
||||
if (get_param_int(global.parameters, "recruit.allow_merge", 1)) {
|
||||
rules_recruit |= RECRUIT_MERGE;
|
||||
}
|
||||
if (get_param_int(global.parameters, "recruit.classic", 1)) {
|
||||
rules_recruit |= RECRUIT_CLASSIC;
|
||||
}
|
||||
if (get_param_int(global.parameters, "recruit.archetype", 0)) {
|
||||
rules_recruit |= RECRUIT_ARCHETYPES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
income(const unit * u)
|
||||
{
|
||||
|
@ -1091,11 +1115,6 @@ maintain_buildings(region * r, boolean crash)
|
|||
}
|
||||
}
|
||||
|
||||
#define RECRUIT_MERGE 1
|
||||
#define RECRUIT_CLASSIC 2
|
||||
#define RECRUIT_ARCHETYPES 4
|
||||
static int rules_recruit = -1;
|
||||
|
||||
static int
|
||||
recruit_archetype(unit * u, order * ord)
|
||||
{
|
||||
|
@ -1103,18 +1122,7 @@ recruit_archetype(unit * u, order * ord)
|
|||
int want;
|
||||
const char * s;
|
||||
|
||||
if (rules_recruit<0) {
|
||||
rules_recruit = 0;
|
||||
if (get_param_int(global.parameters, "recruit.allow_merge", 1)) {
|
||||
rules_recruit |= RECRUIT_MERGE;
|
||||
}
|
||||
if (get_param_int(global.parameters, "recruit.classic", 1)) {
|
||||
rules_recruit |= RECRUIT_CLASSIC;
|
||||
}
|
||||
if (get_param_int(global.parameters, "recruit.archetype", 0)) {
|
||||
rules_recruit |= RECRUIT_ARCHETYPES;
|
||||
}
|
||||
}
|
||||
if (rules_recruit<0) recruit_init();
|
||||
|
||||
init_tokens(ord);
|
||||
skip_token();
|
||||
|
@ -1235,16 +1243,6 @@ recruit_archetype(unit * u, order * ord)
|
|||
return -1;
|
||||
}
|
||||
|
||||
static void recruit_init(void)
|
||||
{
|
||||
if (rules_recruit<0) {
|
||||
rules_recruit = 0;
|
||||
if (get_param_int(global.parameters, "recruit.allow_merge", 1)) {
|
||||
rules_recruit |= RECRUIT_MERGE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int recruit_archetypes(void)
|
||||
{
|
||||
if (rules_recruit<0) recruit_init();
|
||||
|
|
|
@ -2925,10 +2925,10 @@ static void age_region(region * r)
|
|||
int stability = r->land->ownership->since_turn;
|
||||
int morale = MORALE_TAKEOVER + stability/10;
|
||||
if (r->land->ownership->owner && r->land->morale<MORALE_MAX) {
|
||||
r->land->morale = MIN(morale, MORALE_MAX);
|
||||
r->land->morale = (short)MIN(morale, MORALE_MAX);
|
||||
}
|
||||
if (!r->land->ownership->owner && r->land->morale<MORALE_DEFAULT) {
|
||||
r->land->morale = MIN(morale, MORALE_DEFAULT);
|
||||
r->land->morale = (short)MIN(morale, MORALE_DEFAULT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -107,8 +107,12 @@ magic_lowskill(unit *u)
|
|||
int
|
||||
study_cost(unit *u, skill_t sk)
|
||||
{
|
||||
static int cost = 0;
|
||||
int stufe, k = 50;
|
||||
|
||||
if (cost==0) {
|
||||
cost = get_param_int(global.parameters, "skills.cost", 200);
|
||||
}
|
||||
switch (sk) {
|
||||
case SK_SPY:
|
||||
return 100;
|
||||
|
|
|
@ -1347,7 +1347,6 @@ parse_equipment(xmlDocPtr doc)
|
|||
xmlXPathFreeObject(xpathResult);
|
||||
|
||||
xpathResult = xmlXPathEvalExpression(BAD_CAST "skill", xpath);
|
||||
assert(!eq->skills);
|
||||
add_skills(eq, xpathResult->nodesetval);
|
||||
xmlXPathFreeObject(xpathResult);
|
||||
|
||||
|
|
|
@ -36,32 +36,26 @@ Global
|
|||
{F70CFB27-8A2F-E447-B452-4E1C590EDA6D}.Profile|Win32.ActiveCfg = Profile|Win32
|
||||
{F70CFB27-8A2F-E447-B452-4E1C590EDA6D}.Profile|Win32.Build.0 = Profile|Win32
|
||||
{F70CFB27-8A2F-E447-B452-4E1C590EDA6D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F70CFB27-8A2F-E447-B452-4E1C590EDA6D}.Release|Win32.Build.0 = Release|Win32
|
||||
{6F104C0A-DDF5-A34B-A89C-0DC278DCEF6D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{6F104C0A-DDF5-A34B-A89C-0DC278DCEF6D}.Profile|Win32.ActiveCfg = Profile|Win32
|
||||
{6F104C0A-DDF5-A34B-A89C-0DC278DCEF6D}.Profile|Win32.Build.0 = Profile|Win32
|
||||
{6F104C0A-DDF5-A34B-A89C-0DC278DCEF6D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{6F104C0A-DDF5-A34B-A89C-0DC278DCEF6D}.Release|Win32.Build.0 = Release|Win32
|
||||
{1E8BFF9E-3044-0742-992F-C5765B80FE65}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{1E8BFF9E-3044-0742-992F-C5765B80FE65}.Profile|Win32.ActiveCfg = Profile|Win32
|
||||
{1E8BFF9E-3044-0742-992F-C5765B80FE65}.Profile|Win32.Build.0 = Profile|Win32
|
||||
{1E8BFF9E-3044-0742-992F-C5765B80FE65}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{1E8BFF9E-3044-0742-992F-C5765B80FE65}.Release|Win32.Build.0 = Release|Win32
|
||||
{74B1CBD4-3B6E-E544-9475-33FBB0BCE165}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{74B1CBD4-3B6E-E544-9475-33FBB0BCE165}.Profile|Win32.ActiveCfg = Profile|Win32
|
||||
{74B1CBD4-3B6E-E544-9475-33FBB0BCE165}.Profile|Win32.Build.0 = Profile|Win32
|
||||
{74B1CBD4-3B6E-E544-9475-33FBB0BCE165}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{74B1CBD4-3B6E-E544-9475-33FBB0BCE165}.Release|Win32.Build.0 = Release|Win32
|
||||
{D893D6B3-805D-9848-8EA4-CDA1B79151F6}.Debug|Win32.ActiveCfg = Debug|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}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{D893D6B3-805D-9848-8EA4-CDA1B79151F6}.Release|Win32.Build.0 = 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
|
||||
{75501170-51C2-E641-BA8B-EDC008184192}.Release|Win32.Build.0 = 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
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="libxml2.lib pdcurses.lib lua5.1_d.lib tolua++.lib luabind_d.lib"
|
||||
AdditionalDependencies="libxml2.lib pdcurses.lib lua5.1_d.lib tolua++.lib"
|
||||
OutputFile="$(OutDir)\eressea.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
|
@ -124,6 +124,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=".;common"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="2"
|
||||
|
@ -142,6 +143,7 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="libxml2.lib pdcurses.lib lua5.1.lib tolua++.lib"
|
||||
OutputFile="$(OutDir)\eressea.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
|
@ -212,6 +214,14 @@
|
|||
PrecompiledHeaderThrough="stdafx.h"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\combined\util.c"
|
||||
|
|
|
@ -593,6 +593,27 @@ load_inifile(const char * filename)
|
|||
inifile = d;
|
||||
}
|
||||
|
||||
static void
|
||||
write_spells(void)
|
||||
{
|
||||
const resource_type * rt_water = rt_find("p2");
|
||||
struct locale * loc = find_locale("de");
|
||||
FILE * F = fopen("spells.txt", "w");
|
||||
spell_list * spl = spells;
|
||||
for (;spl;spl=spl->next) {
|
||||
const spell * sp = spl->data;
|
||||
spell_component * spc = sp->components;
|
||||
char components[128];
|
||||
components[0]=0;
|
||||
for (;spc->type;++spc) {
|
||||
strcat(components, LOC(loc, spc->type->_name[0]));
|
||||
strcat(components, ",");
|
||||
}
|
||||
fprintf(F, "%s;%d;%s;%s\n", LOC(loc, mkname("spell", sp->sname)), sp->level, LOC(loc, mkname("school", magietypen[sp->magietyp])), components);
|
||||
}
|
||||
fclose(F);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
|
@ -628,7 +649,9 @@ main(int argc, char *argv[])
|
|||
kernel_init();
|
||||
game_init();
|
||||
|
||||
// run the main script
|
||||
/* write_spells(); */
|
||||
|
||||
/* run the main script */
|
||||
if (luafile==NULL) lua_console(luaState);
|
||||
else {
|
||||
char buf[MAX_PATH];
|
||||
|
|
|
@ -4026,7 +4026,7 @@
|
|||
<text locale="en">Shadow Call</text>
|
||||
</string>
|
||||
<string name="create_ror">
|
||||
<text locale="de">Erscahffe einen Ring der Regeneration</text>
|
||||
<text locale="de">Erschaffe einen Ring der Regeneration</text>
|
||||
<text locale="en">Create A Ring Of Regeneration</text>
|
||||
</string>
|
||||
<string name="raise_mob">
|
||||
|
|
|
@ -49,6 +49,8 @@
|
|||
|
||||
<game name="Aragon" units="500">
|
||||
<!-- Game specific settings -->
|
||||
<param name="database.gameid" value="7"></param>
|
||||
|
||||
<order name="ARBEITEN" disable="yes"/>
|
||||
<order name="BETEN" disable="yes"/>
|
||||
<order name="FRIEDEN" disable="yes"/>
|
||||
|
@ -67,7 +69,6 @@
|
|||
<order name="WERWESEN" disable="yes"/>
|
||||
<order name="XONTORMIA" disable="yes"/>
|
||||
|
||||
<skill name="alchemy" enable="true"/>
|
||||
<skill name="armorer" enable="true"/>
|
||||
<skill name="bow" enable="true"/>
|
||||
<skill name="building" enable="true"/>
|
||||
|
@ -91,6 +92,7 @@
|
|||
<skill name="unarmed" enable="true"/>
|
||||
<skill name="weaponsmithing" enable="true"/>
|
||||
|
||||
<skill name="alchemy" enable="false"/>
|
||||
<skill name="entertainment" enable="false"/>
|
||||
<skill name="espionage" enable="false"/>
|
||||
<skill name="perception" enable="false"/>
|
||||
|
@ -103,14 +105,16 @@
|
|||
<param name="modules.astralspace" value="0"/>
|
||||
<param name="modules.wormholes" value="0"/>
|
||||
|
||||
<param name="skills.cost" value="500"/>
|
||||
<param name="entertain.base" value="0"/>
|
||||
<param name="entertain.perlevel" value="20"/>
|
||||
<param name="nmr.timeout" value="5"/>
|
||||
<param name="nmr.removenewbie" value="10"/>
|
||||
<param name="GiveRestriction" value="3"/>
|
||||
<param name="hunger.long" value="1"/>
|
||||
<param name="hunger.long" value="0"/>
|
||||
<param name="hunger.damage" value="1d9+9"/>
|
||||
<param name="recruit.allow_merge" value="1"/>
|
||||
<param name="study.expensivemigrants" value="1"/>
|
||||
<param name="rules.check_overload" value="0"/>
|
||||
<param name="rules.combat.herospeed" value="3"/>
|
||||
<param name="rules.combat.skill_bonus" value="0"/>
|
||||
|
@ -119,8 +123,10 @@
|
|||
<param name="rules.cavalry.mode" value="1"/>
|
||||
<param name="rules.economy.taxation" value="1"/>
|
||||
<param name="rules.give" value="3"/> <!-- only self + peasants -->
|
||||
<param name="rules.help.mask" value="fight guard stealth money"/>
|
||||
<param name="rules.help.mask" value="fight guard money"/>
|
||||
<param name="movement.shipspeed.skillbonus" value="7"/>
|
||||
<param name="alliance.auto" value="fight"/>
|
||||
<!--param name="alliance.restricted" value="fight"/-->
|
||||
</game>
|
||||
<xi:include href="eressea/strings.xml"/>
|
||||
<xi:include href="eressea/races.xml"/>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<skill name="building" modifier="1"/>
|
||||
<skill name="cartmaking" modifier="-1"/>
|
||||
<skill name="catapult" modifier="1"/>
|
||||
<skill name="magic" modifier="-1"/>
|
||||
<skill name="magic" modifier="-99"/>
|
||||
<skill name="mining" modifier="1"/>
|
||||
<skill name="roadwork" modifier="-2"/>
|
||||
<skill name="sailing" modifier="-2"/>
|
||||
|
@ -36,7 +36,6 @@
|
|||
<skill name="cartmaking" modifier="-1"/>
|
||||
<skill name="forestry" modifier="1"/>
|
||||
<skill name="herbalism" modifier="-2"/>
|
||||
<skill name="magic" modifier="-1"/>
|
||||
<skill name="mining" modifier="1"/>
|
||||
<skill name="quarrying" modifier="1"/>
|
||||
<skill name="riding" modifier="-99"/>
|
||||
|
@ -44,6 +43,7 @@
|
|||
<skill name="shipcraft" modifier="-1"/>
|
||||
<skill name="tactics" modifier="1"/>
|
||||
<skill name="training" modifier="-1"/>
|
||||
<skill name="magic" modifier="-99"/>
|
||||
<skill name="unarmed" modifier="-99"/>
|
||||
<skill name="weaponsmithing" modifier="2"/>
|
||||
<attack type="1" damage="1d5"/>
|
||||
|
@ -59,6 +59,7 @@
|
|||
<skill name="herbalism" modifier="-1"/>
|
||||
<skill name="shipcraft" modifier="3"/>
|
||||
<skill name="sailing" modifier="3"/>
|
||||
<skill name="magic" modifier="-99"/>
|
||||
<skill name="unarmed" modifier="-99"/>
|
||||
<attack type="1" damage="1d5"/>
|
||||
<familiar race="dolphin" default="yes"/>
|
||||
|
@ -84,6 +85,7 @@
|
|||
<skill name="sailing" modifier="-2"/>
|
||||
<skill name="shipcraft" modifier="-1"/>
|
||||
<skill name="training" modifier="-1"/>
|
||||
<skill name="magic" modifier="-99"/>
|
||||
<skill name="unarmed" modifier="-99"/>
|
||||
<attack type="1" damage="1d5"/>
|
||||
<familiar race="eagle" default="yes"/>
|
||||
|
|
|
@ -6973,7 +6973,7 @@
|
|||
<arg name="unit" type="unit"/>
|
||||
<arg name="region" type="region"/>
|
||||
<arg name="command" type="order"/>
|
||||
<arg name="building" type="name"/>
|
||||
<arg name="building" type="string"/>
|
||||
</type>
|
||||
<text locale="de">"$unit($unit) in $region($region): '$order($command)' - Die Einheit steht nicht im benötigten Gebäude, $localize($building)."</text>
|
||||
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - The unit must be in a $localize($building) to produce this."</text>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<include href="buildings.xml" />
|
||||
|
||||
<game name="Kreis der Macht" units="250" welcome="vinyambar">
|
||||
<comment>Game specific</comment>
|
||||
<!-- Game specific -->
|
||||
<order name="ARBEITEN" disable></order>
|
||||
<param name="entertain.base" value="15"></param>
|
||||
<param name="entertain.perlevel" value="5"></param>
|
||||
|
|
Loading…
Reference in a new issue