Merge remote-tracking branch 'upstream/develop' into develop

This commit is contained in:
Enno Rehling 2015-07-07 15:34:42 +02:00
commit 76a9dd6741
22 changed files with 87 additions and 85 deletions

View File

@ -11,3 +11,6 @@ script:
os: os:
- linux - linux
- osx - osx
notifications:
slack:
secure: F89aXLWaE125PaJIlETv12jT4EfH6wLXJmGCPZzrN3OcLn2ahDWqjwuzR7lOEDf2nAISmeMPyDZMhEHXLNHAE5qP6lg9yliYQw5hzGmDK9m1xUq/pPEne/b2Y7K3my1mkRZ6n3asbHgSmBWAfCIk1JN8R5Rv+rmbLuWLc+zofts=

View File

@ -90,7 +90,7 @@
<param name="entertain.base" value="0"/> <param name="entertain.base" value="0"/>
<param name="entertain.perlevel" value="20"/> <param name="entertain.perlevel" value="20"/>
<param name="nmr.timeout" value="5"/> <param name="nmr.timeout" value="5"/>
<param name="nmr.removenewbie" value="10"/> <param name="nmr.removenewbie" value="0"/>
<param name="GiveRestriction" value="3"/> <param name="GiveRestriction" value="3"/>
<param name="hunger.long" value="1"/> <param name="hunger.long" value="1"/>
<param name="init_spells" value="0"/> <param name="init_spells" value="0"/>

View File

@ -2212,12 +2212,6 @@
<text locale="de">Schaden</text> <text locale="de">Schaden</text>
</string> </string>
<!--report newbie info -->
<string name="nr_nmr">
<text locale="de">Deine Partei hat letzte Runde keinen Zug
abgegeben!</text>
</string>
<namespace name="race"> <namespace name="race">
<string name="snowman"> <string name="snowman">
<text locale="de">Schneemann</text> <text locale="de">Schneemann</text>

View File

@ -1660,10 +1660,6 @@
</string> </string>
</namespace> </namespace>
<string name="nr_nmr">
<text locale="en">No orders were received for your faction!</text>
</string>
<!-- resources --> <!-- resources -->
<string name="mistletoe"> <string name="mistletoe">
<text locale="de">Mistelzweig</text> <text locale="de">Mistelzweig</text>

View File

@ -2051,7 +2051,4 @@
<text locale="fr">côte ouest</text> <text locale="fr">côte ouest</text>
</string> </string>
</namespace> </namespace>
<string name="nr_nmr">
<text locale="fr">Aucun ordre reçu pour votre faction !</text>
</string>
</strings> </strings>

View File

@ -392,6 +392,7 @@
</message> </message>
<message name="curseinfo::magicresistance" section="events"> <message name="curseinfo::magicresistance" section="events">
<type> <type>
<arg name="unit" type="unit"/>
<arg name="id" type="int"/> <arg name="id" type="int"/>
</type> </type>
<text locale="de">"Die natürliche Widerstandskraft gegen Verzauberung ist gestärkt. ($int36($id))"</text> <text locale="de">"Die natürliche Widerstandskraft gegen Verzauberung ist gestärkt. ($int36($id))"</text>
@ -1182,7 +1183,25 @@
<text locale="en">"$unit($unit) drowns in $region($region)."</text> <text locale="en">"$unit($unit) drowns in $region($region)."</text>
</message> </message>
<message name="drown_amphibian_dead" section="events"> <message name="poison_damage" section="events">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
</type>
<text locale="de">"$unit($unit) nimmt Schaden durch den Giftelementar in $region($region)."</text>
<text locale="en">"$unit($unit) is taking poison damage in $region($region)."</text>
</message>
<message name="poison_death" section="events">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
</type>
<text locale="de">"$unit($unit) stirbt am Schaden durch den Giftelementar in $region($region)."</text>
<text locale="en">"$unit($unit) dies from poison damage taken in $region($region)."</text>
</message>
<message name="drown_amphibian_dead" section="events">
<type> <type>
<arg name="amount" type="int"/> <arg name="amount" type="int"/>
<arg name="unit" type="unit"/> <arg name="unit" type="unit"/>
@ -7100,9 +7119,16 @@
<text locale="en">"$unit($unit) in $region($region): '$order($command)' - Your faction must be at least $int($turns) weeks old to give something to another faction."</text> <text locale="en">"$unit($unit) in $region($region): '$order($command)' - Your faction must be at least $int($turns) weeks old to give something to another faction."</text>
</message> </message>
<message name="turnreminder" section="errors"> <message name="nmr_warning" section="errors">
<type> <type/>
</type> <text locale="de">Deine Partei hat letzte Runde keinen Zug
abgegeben!</text>
<text locale="en">No orders were received for your faction!</text>
<text locale="fr">Aucun ordre reçu pour votre faction !</text>
</message>
<message name="nmr_warning_final" section="errors">
<type/>
<text locale="de">"Bitte sende die Befehle nächste Runde ein, wenn du weiterspielen möchtest."</text> <text locale="de">"Bitte sende die Befehle nächste Runde ein, wenn du weiterspielen möchtest."</text>
<text locale="en">"Please send in orders for the next turn if you want to continue playing."</text> <text locale="en">"Please send in orders for the next turn if you want to continue playing."</text>
</message> </message>

View File

@ -26,7 +26,6 @@ module("tests.common", package.seeall, lunit.testcase)
function setup() function setup()
eressea.free_game() eressea.free_game()
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0") eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("NewbieImmunity", "0") eressea.settings.set("NewbieImmunity", "0")
eressea.settings.set("rules.economy.food", "4") eressea.settings.set("rules.economy.food", "4")
@ -961,7 +960,6 @@ module("tests.report", package.seeall, lunit.testcase)
function setup() function setup()
eressea.free_game() eressea.free_game()
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0") eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("rules.economy.food", "4") eressea.settings.set("rules.economy.food", "4")
end end

View File

@ -4,7 +4,6 @@ module("tests.e2.guard", package.seeall, lunit.testcase)
function setup() function setup()
eressea.free_game() eressea.free_game()
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0") eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("NewbieImmunity", "0") eressea.settings.set("NewbieImmunity", "0")
eressea.settings.set("rules.economy.food", "4") eressea.settings.set("rules.economy.food", "4")

View File

@ -4,7 +4,6 @@ module("tests.e2.movement", package.seeall, lunit.testcase)
function setup() function setup()
eressea.free_game() eressea.free_game()
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0") eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("NewbieImmunity", "0") eressea.settings.set("NewbieImmunity", "0")
end end

View File

@ -4,7 +4,6 @@ module("tests.e2.shiplanding", package.seeall, lunit.testcase)
function setup() function setup()
eressea.free_game() eressea.free_game()
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0") eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("NewbieImmunity", "0") eressea.settings.set("NewbieImmunity", "0")
end end

View File

@ -5,7 +5,6 @@ module("tests.e3.spells", package.seeall, lunit.testcase)
function setup() function setup()
eressea.game.reset() eressea.game.reset()
eressea.settings.set("magic.fumble.enable", "0") eressea.settings.set("magic.fumble.enable", "0")
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0") eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("rules.peasants.growth", "0") eressea.settings.set("rules.peasants.growth", "0")
end end

View File

@ -4,7 +4,6 @@ module("tests.movement", package.seeall, lunit.testcase)
function setup() function setup()
eressea.free_game() eressea.free_game()
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0") eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("rules.ships.storms", "0") eressea.settings.set("rules.ships.storms", "0")
conf = [[{ conf = [[{

View File

@ -16,7 +16,6 @@ function setup()
u = _G.unit.create(f, r, 1) u = _G.unit.create(f, r, 1)
u:clear_orders() u:clear_orders()
eressea.settings.set("rules.economy.food", "4") eressea.settings.set("rules.economy.food", "4")
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0") eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("NewbieImmunity", "0") eressea.settings.set("NewbieImmunity", "0")
end end

View File

@ -6,7 +6,6 @@ function setup()
eressea.game.reset() eressea.game.reset()
eressea.config.reset() eressea.config.reset()
eressea.settings.set("rules.economy.food", "0") eressea.settings.set("rules.economy.food", "0")
eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0") eressea.settings.set("nmr.timeout", "0")
eressea.settings.set("rules.magic.playerschools", "") eressea.settings.set("rules.magic.playerschools", "")
conf = [[{ conf = [[{

View File

@ -4206,8 +4206,6 @@ static void battle_flee(battle * b)
default: default:
if ((fig->person[dt.index].flags & FL_HIT) == 0) if ((fig->person[dt.index].flags & FL_HIT) == 0)
continue; continue;
if (b->turn <= 1)
continue;
if (fig->person[dt.index].hp <= runhp) if (fig->person[dt.index].hp <= runhp)
break; break;
if (fig->person[dt.index].flags & FL_PANICED) { if (fig->person[dt.index].flags & FL_PANICED) {

View File

@ -264,6 +264,7 @@ cr_output_curses(FILE * F, const faction * viewer, const void *obj, objtype_t ty
fprintf(F, "\"%s\"\n", buf); fprintf(F, "\"%s\"\n", buf);
msg_release(msg); msg_release(msg);
} }
a = a->next;
} }
else if (a->type == &at_effect && self) { else if (a->type == &at_effect && self) {
effect_data *data = (effect_data *)a->data.v; effect_data *data = (effect_data *)a->data.v;
@ -276,8 +277,11 @@ cr_output_curses(FILE * F, const faction * viewer, const void *obj, objtype_t ty
fprintf(F, "\"%d %s\"\n", data->value, translate(key, fprintf(F, "\"%d %s\"\n", data->value, translate(key,
LOC(default_locale, key))); LOC(default_locale, key)));
} }
a = a->next;
}
else {
a = a->nexttype;
} }
a = a->next;
} }
} }

View File

@ -517,12 +517,9 @@ static curse *make_curse(unit * mage, attrib ** ap, const curse_type * ct,
break; break;
case CURSETYP_UNIT: case CURSETYP_UNIT:
{
c->data.i = men; c->data.i = men;
break; break;
} }
}
return c; return c;
} }

View File

@ -113,7 +113,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/* - exported global symbols ----------------------------------- */ /* - exported global symbols ----------------------------------- */
static int RemoveNMRNewbie(void) static bool RemoveNMRNewbie(void)
{ {
static int value = -1; static int value = -1;
static int gamecookie = -1; static int gamecookie = -1;
@ -122,17 +122,7 @@ static int RemoveNMRNewbie(void)
value = get_param_int(global.parameters, "nmr.removenewbie", 0); value = get_param_int(global.parameters, "nmr.removenewbie", 0);
gamecookie = global.cookie; gamecookie = global.cookie;
} }
return value; return value!=0;
}
static void checkorders(void)
{
faction *f;
log_info(" - Warne spaete Spieler...");
for (f = factions; f; f = f->next)
if (!is_monsters(f) && turn - f->lastorders == NMRTimeout() - 1)
ADDMSG(&f->msgs, msg_message("turnreminder", ""));
} }
static void age_unit(region * r, unit * u) static void age_unit(region * r, unit * u)
@ -735,6 +725,45 @@ void immigration(void)
} }
} }
static void nmr_warnings(void)
{
faction *f, *fa;
#define FRIEND (HELP_GUARD|HELP_MONEY)
for (f = factions; f; f = f->next) {
if (!fval(f, FFL_NOIDLEOUT) && turn > f->lastorders) {
ADDMSG(&f->msgs, msg_message("nmr_warning", ""));
if (turn - f->lastorders == NMRTimeout() - 1) {
ADDMSG(&f->msgs, msg_message("nmr_warning_final", ""));
}
if ((turn - f->lastorders) >= 2) {
message *msg = NULL;
for (fa = factions; fa; fa = fa->next) {
int warn = 0;
if (get_param_int(global.parameters, "rules.alliances", 0) != 0) {
if (f->alliance && f->alliance == fa->alliance) {
warn = 1;
}
}
else if (alliedfaction(NULL, f, fa, FRIEND)
&& alliedfaction(NULL, fa, f, FRIEND)) {
warn = 1;
}
if (warn) {
if (msg == NULL) {
msg =
msg_message("warn_dropout", "faction turns", f,
turn - f->lastorders);
}
add_message(&fa->msgs, msg);
}
}
if (msg != NULL)
msg_release(msg);
}
}
}
}
void demographics(void) void demographics(void)
{ {
region *r; region *r;
@ -810,7 +839,6 @@ void demographics(void)
remove_empty_units(); remove_empty_units();
immigration(); immigration();
checkorders();
} }
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */
@ -4371,6 +4399,7 @@ void init_processor(void)
} }
p = 10; p = 10;
add_proc_global(p, nmr_warnings, "NMR Warnings");
add_proc_global(p, new_units, "Neue Einheiten erschaffen"); add_proc_global(p, new_units, "Neue Einheiten erschaffen");
p += 10; p += 10;

View File

@ -1834,39 +1834,6 @@ int write_reports(faction * f, time_t ltime)
return 0; return 0;
} }
static void nmr_warnings(void)
{
faction *f, *fa;
#define FRIEND (HELP_GUARD|HELP_MONEY)
for (f = factions; f; f = f->next) {
if (!fval(f, FFL_NOIDLEOUT) && (turn - f->lastorders) >= 2) {
message *msg = NULL;
for (fa = factions; fa; fa = fa->next) {
int warn = 0;
if (get_param_int(global.parameters, "rules.alliances", 0) != 0) {
if (f->alliance && f->alliance == fa->alliance) {
warn = 1;
}
}
else if (alliedfaction(NULL, f, fa, FRIEND)
&& alliedfaction(NULL, fa, f, FRIEND)) {
warn = 1;
}
if (warn) {
if (msg == NULL) {
msg =
msg_message("warn_dropout", "faction turns", f,
turn - f->lastorders);
}
add_message(&fa->msgs, msg);
}
}
if (msg != NULL)
msg_release(msg);
}
}
}
static void report_donations(void) static void report_donations(void)
{ {
region *r; region *r;
@ -1945,7 +1912,6 @@ int reports(void)
if (verbosity >= 1) { if (verbosity >= 1) {
log_printf(stdout, "Writing reports for turn %d:", turn); log_printf(stdout, "Writing reports for turn %d:", turn);
} }
nmr_warnings();
report_donations(); report_donations();
remove_empty_units(); remove_empty_units();

View File

@ -2820,9 +2820,9 @@ static int dc_age(struct curse *c)
if (curse_active(c)) if (curse_active(c))
while (*up != NULL) { while (*up != NULL) {
unit *u = *up; unit *u = *up;
int hp;
double damage = c->effect * u->number; double damage = c->effect * u->number;
freset(u->faction, FFL_SELECT);
if (u->number <= 0 || target_resists_magic(mage, u, TYP_UNIT, 0)) { if (u->number <= 0 || target_resists_magic(mage, u, TYP_UNIT, 0)) {
up = &u->next; up = &u->next;
continue; continue;
@ -2830,8 +2830,9 @@ static int dc_age(struct curse *c)
/* Reduziert durch Magieresistenz */ /* Reduziert durch Magieresistenz */
damage *= (1.0 - magic_resistance(u)); damage *= (1.0 - magic_resistance(u));
change_hitpoints(u, -(int)damage); hp = change_hitpoints(u, -(int)damage);
ADDMSG(&u->faction->msgs, msg_message((hp>0)?"poison_damage":"poison_death", "region unit", r, u));
if (*up == u) if (*up == u)
up = &u->next; up = &u->next;
} }

View File

@ -302,7 +302,7 @@ static struct curse_type ct_oldrace = {
}; };
static struct curse_type ct_magicresistance = { static struct curse_type ct_magicresistance = {
"magicresistance", CURSETYP_UNIT, CURSE_SPREADMODULO, M_MEN, cinfo_simple "magicresistance", CURSETYP_UNIT, CURSE_SPREADMODULO, M_MEN, cinfo_unit
}; };
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */

View File

@ -90,8 +90,8 @@ extern "C" {
#define AT_READ_OK 0 #define AT_READ_OK 0
#define AT_READ_FAIL -1 #define AT_READ_FAIL -1
#define AT_AGE_REMOVE 0 /* remove the attribute after calling age() */ #define AT_AGE_KEEP 0 /* keep the attribute for another turn */
#define AT_AGE_KEEP 1 /* keep the attribute for another turn */ #define AT_AGE_REMOVE 1 /* remove the attribute after calling age() */
#ifdef __cplusplus #ifdef __cplusplus
} }