forked from github/server
Merge pull request #851 from ennorehling/develop
Sonnensegel, STIRB PARTEI
This commit is contained in:
commit
c5aa6fc940
|
@ -105,7 +105,7 @@ msgid "massive_overload"
|
||||||
msgstr "\"Die $ship($ship) ist zu stark überladen und wird stark beschädigt.\""
|
msgstr "\"Die $ship($ship) ist zu stark überladen und wird stark beschädigt.\""
|
||||||
|
|
||||||
msgid "curseinfo::shipspeedup"
|
msgid "curseinfo::shipspeedup"
|
||||||
msgstr "\"Die Winde scheinen dieses Schiff besonders zu beguenstigen. ($int36($id))\""
|
msgstr "\"Die Winde scheinen dieses Schiff besonders zu begünstigen. ($int36($id))\""
|
||||||
|
|
||||||
msgid "error152"
|
msgid "error152"
|
||||||
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Die Einheit springt über Bord und ertrinkt.\""
|
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Die Einheit springt über Bord und ertrinkt.\""
|
||||||
|
@ -999,7 +999,7 @@ msgid "battle_critical"
|
||||||
msgstr "\"$int36($unit.id($unit))/$int($index) erzielt einen kritischen Treffer.\""
|
msgstr "\"$int36($unit.id($unit))/$int($index) erzielt einen kritischen Treffer.\""
|
||||||
|
|
||||||
msgid "error_spell_on_ship_already"
|
msgid "error_spell_on_ship_already"
|
||||||
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Auf $ship($ship) liegt beeits ein Zauber.\""
|
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Auf $ship($ship) liegt bereits ein Zauber.\""
|
||||||
|
|
||||||
msgid "error228"
|
msgid "error228"
|
||||||
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Nur normale Personen können Steuern eintreiben.\""
|
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Nur normale Personen können Steuern eintreiben.\""
|
||||||
|
|
|
@ -470,7 +470,7 @@ static void test_shipspeed_stormwind(CuTest *tc) {
|
||||||
|
|
||||||
test_setup();
|
test_setup();
|
||||||
sh = setup_ship();
|
sh = setup_ship();
|
||||||
setup_crew(sh, 0, &cap, &crew);
|
setup_crew(sh, NULL, &cap, &crew);
|
||||||
register_shipcurse();
|
register_shipcurse();
|
||||||
assert(sh && cap && crew);
|
assert(sh && cap && crew);
|
||||||
|
|
||||||
|
@ -488,7 +488,7 @@ static void test_shipspeed_nodrift(CuTest *tc) {
|
||||||
|
|
||||||
test_setup();
|
test_setup();
|
||||||
sh = setup_ship();
|
sh = setup_ship();
|
||||||
setup_crew(sh, 0, &cap, &crew);
|
setup_crew(sh, NULL, &cap, &crew);
|
||||||
register_shipcurse();
|
register_shipcurse();
|
||||||
assert(sh && cap && crew);
|
assert(sh && cap && crew);
|
||||||
|
|
||||||
|
@ -503,7 +503,7 @@ static void test_shipspeed_shipspeedup(CuTest *tc) {
|
||||||
|
|
||||||
test_setup();
|
test_setup();
|
||||||
sh = setup_ship();
|
sh = setup_ship();
|
||||||
setup_crew(sh, 0, &cap, &crew);
|
setup_crew(sh, NULL, &cap, &crew);
|
||||||
register_shipcurse();
|
register_shipcurse();
|
||||||
assert(sh && cap && crew);
|
assert(sh && cap && crew);
|
||||||
|
|
||||||
|
@ -519,7 +519,7 @@ static void test_shipspeed_at_speedup(CuTest *tc) {
|
||||||
|
|
||||||
test_setup();
|
test_setup();
|
||||||
sh = setup_ship();
|
sh = setup_ship();
|
||||||
setup_crew(sh, 0, &cap, &crew);
|
setup_crew(sh, NULL, &cap, &crew);
|
||||||
assert(sh && cap && crew);
|
assert(sh && cap && crew);
|
||||||
|
|
||||||
a = a_new(&at_speedup);
|
a = a_new(&at_speedup);
|
||||||
|
@ -536,7 +536,7 @@ static void test_shipspeed_race_bonus(CuTest *tc) {
|
||||||
|
|
||||||
test_setup();
|
test_setup();
|
||||||
sh = setup_ship();
|
sh = setup_ship();
|
||||||
setup_crew(sh, 0, &cap, &crew);
|
setup_crew(sh, NULL, &cap, &crew);
|
||||||
assert(sh && cap && crew);
|
assert(sh && cap && crew);
|
||||||
|
|
||||||
rc = rc_get_or_create(cap->_race->_name);
|
rc = rc_get_or_create(cap->_race->_name);
|
||||||
|
@ -551,7 +551,7 @@ static void test_shipspeed_damage(CuTest *tc) {
|
||||||
|
|
||||||
test_setup();
|
test_setup();
|
||||||
sh = setup_ship();
|
sh = setup_ship();
|
||||||
setup_crew(sh, 0, &cap, &crew);
|
setup_crew(sh, NULL, &cap, &crew);
|
||||||
assert(sh && cap && crew);
|
assert(sh && cap && crew);
|
||||||
|
|
||||||
sh->damage = 1;
|
sh->damage = 1;
|
||||||
|
@ -563,6 +563,32 @@ static void test_shipspeed_damage(CuTest *tc) {
|
||||||
test_teardown();
|
test_teardown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void test_maximum_shipspeed(CuTest *tc) {
|
||||||
|
ship *sh;
|
||||||
|
unit *cap, *crew;
|
||||||
|
race *rc;
|
||||||
|
struct faction *f;
|
||||||
|
attrib *a;
|
||||||
|
|
||||||
|
test_setup();
|
||||||
|
sh = setup_ship();
|
||||||
|
rc = test_create_race("aquarian");
|
||||||
|
rc->flags |= RCF_SHIPSPEED;
|
||||||
|
f = test_create_faction(rc);
|
||||||
|
setup_crew(sh, f, &cap, &crew);
|
||||||
|
CuAssertIntEquals(tc, sh->type->range + 1, shipspeed(sh, cap));
|
||||||
|
create_curse(0, &sh->attribs, &ct_stormwind, 1, 1, 1, 0);
|
||||||
|
CuAssertIntEquals(tc, 2 * sh->type->range + 1, shipspeed(sh, cap));
|
||||||
|
create_curse(0, &sh->attribs, &ct_nodrift, 1, 1, 1, 0);
|
||||||
|
CuAssertIntEquals(tc, 2 * sh->type->range + 2, shipspeed(sh, cap));
|
||||||
|
a = a_new(&at_speedup);
|
||||||
|
a->data.i = 3;
|
||||||
|
a_add(&sh->attribs, a);
|
||||||
|
CuAssertIntEquals(tc, 2 * sh->type->range + 5, shipspeed(sh, cap));
|
||||||
|
create_curse(0, &sh->attribs, &ct_shipspeedup, 1, 1, 4, 0);
|
||||||
|
CuAssertIntEquals(tc, 2 * sh->type->range + 9, shipspeed(sh, cap));
|
||||||
|
}
|
||||||
|
|
||||||
static void test_shipspeed(CuTest *tc) {
|
static void test_shipspeed(CuTest *tc) {
|
||||||
ship *sh;
|
ship *sh;
|
||||||
const ship_type *stype;
|
const ship_type *stype;
|
||||||
|
@ -574,7 +600,7 @@ static void test_shipspeed(CuTest *tc) {
|
||||||
|
|
||||||
CuAssertIntEquals_Msg(tc, "ship without a captain cannot move", 0, shipspeed(sh, NULL));
|
CuAssertIntEquals_Msg(tc, "ship without a captain cannot move", 0, shipspeed(sh, NULL));
|
||||||
|
|
||||||
setup_crew(sh, 0, &cap, &crew);
|
setup_crew(sh, NULL, &cap, &crew);
|
||||||
|
|
||||||
CuAssertPtrEquals(tc, cap, ship_owner(sh));
|
CuAssertPtrEquals(tc, cap, ship_owner(sh));
|
||||||
CuAssertIntEquals_Msg(tc, "ship with fully skilled crew can sail at max speed", 2, shipspeed(sh, cap));
|
CuAssertIntEquals_Msg(tc, "ship with fully skilled crew can sail at max speed", 2, shipspeed(sh, cap));
|
||||||
|
@ -603,7 +629,7 @@ static void test_shipspeed_max_range(CuTest *tc) {
|
||||||
|
|
||||||
test_setup();
|
test_setup();
|
||||||
sh = setup_ship();
|
sh = setup_ship();
|
||||||
setup_crew(sh, 0, &cap, &crew);
|
setup_crew(sh, NULL, &cap, &crew);
|
||||||
config_set("movement.shipspeed.skillbonus", "5");
|
config_set("movement.shipspeed.skillbonus", "5");
|
||||||
r = sh->region;
|
r = sh->region;
|
||||||
f = test_create_faction(NULL);
|
f = test_create_faction(NULL);
|
||||||
|
@ -649,5 +675,6 @@ CuSuite *get_ship_suite(void)
|
||||||
SUITE_ADD_TEST(suite, test_shipspeed_race_bonus);
|
SUITE_ADD_TEST(suite, test_shipspeed_race_bonus);
|
||||||
SUITE_ADD_TEST(suite, test_shipspeed_damage);
|
SUITE_ADD_TEST(suite, test_shipspeed_damage);
|
||||||
SUITE_ADD_TEST(suite, test_shipspeed_max_range);
|
SUITE_ADD_TEST(suite, test_shipspeed_max_range);
|
||||||
|
SUITE_ADD_TEST(suite, test_maximum_shipspeed);
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2242,13 +2242,12 @@ static int sp_stormwinds(castorder * co)
|
||||||
|
|
||||||
sh = pa->param[n]->data.sh;
|
sh = pa->param[n]->data.sh;
|
||||||
|
|
||||||
/* mit C_SHIP_NODRIFT haben wir kein Problem */
|
|
||||||
if (is_cursed(sh->attribs, &ct_flyingship)) {
|
if (is_cursed(sh->attribs, &ct_flyingship)) {
|
||||||
ADDMSG(&caster->faction->msgs, msg_feedback(caster, co->order,
|
ADDMSG(&caster->faction->msgs, msg_feedback(caster, co->order,
|
||||||
"error_spell_on_flying_ship", "ship", sh))
|
"error_spell_on_flying_ship", "ship", sh))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (is_cursed(sh->attribs, &ct_shipspeedup)) {
|
if (is_cursed(sh->attribs, &ct_stormwind)) {
|
||||||
ADDMSG(&caster->faction->msgs, msg_feedback(caster, co->order,
|
ADDMSG(&caster->faction->msgs, msg_feedback(caster, co->order,
|
||||||
"error_spell_on_ship_already", "ship", sh))
|
"error_spell_on_ship_already", "ship", sh))
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue