forked from github/server
BUG 2391: Friedenslied erlaubt Flucht aus der Region.
This commit is contained in:
parent
6c18604bce
commit
8efc7f1829
7 changed files with 36 additions and 34 deletions
|
@ -121,9 +121,11 @@ function test_fleeing_units_can_be_transported()
|
|||
u1.number = 100
|
||||
u1:add_order("ATTACKIEREN " .. itoa36(u2.id))
|
||||
u2.number = 100
|
||||
u2.name = 'Passagier'
|
||||
u2:add_order("FAHREN " .. itoa36(u3.id))
|
||||
u2:add_order("KAEMPFE FLIEHE")
|
||||
u3.number = 100
|
||||
u3.name = 'Transporter'
|
||||
u3:add_order("KAEMPFE FLIEHE")
|
||||
u3:add_order("TRANSPORT " .. itoa36(u2.id))
|
||||
u3:add_order("NACH O ")
|
||||
|
@ -131,8 +133,8 @@ function test_fleeing_units_can_be_transported()
|
|||
u3:add_item("horse", u2.number)
|
||||
u3:add_order("KAEMPFE FLIEHE")
|
||||
process_orders()
|
||||
assert_equal(u3.region.id, r1.id, "transporter did not move")
|
||||
assert_equal(u2.region.id, r1.id, "transported unit did not move")
|
||||
assert_equal(u3.region, r1, "transporter did not move")
|
||||
assert_equal(u2.region, r1, "transported unit did not move")
|
||||
end
|
||||
|
||||
function test_plane()
|
||||
|
|
|
@ -103,25 +103,3 @@ function test_earn_silver()
|
|||
assert_equal(350, u:get_item("money"))
|
||||
assert_equal(0, r:get_resource("money"))
|
||||
end
|
||||
|
||||
function test_appeasement()
|
||||
local u1, u2, r1, r2, uno
|
||||
r1 = region.create(0, 0, 'plain')
|
||||
r2 = region.create(1, 0, 'plain')
|
||||
u2 = unit.create(faction.create('human'), r1, 1)
|
||||
u2.name = 'Angsthase'
|
||||
u2.magic = 'gwyrrd'
|
||||
u2:add_spell('appeasement')
|
||||
u2:set_skill('magic', 5)
|
||||
u2:add_order('NACH O')
|
||||
u2:add_order('KAMPFZAUBER STUFE 1 Friedenslied')
|
||||
u2.aura = 10
|
||||
uno = u2.id
|
||||
u1 = unit.create(faction.create('human'), r1, 1)
|
||||
u1:set_skill('polearm', 5)
|
||||
u1:add_order('ATTACKIERE ' .. itoa36(uno))
|
||||
process_orders()
|
||||
u2 = get_unit(uno)
|
||||
assert_not_nil(u2)
|
||||
assert_equal(r2, u2.region)
|
||||
end
|
||||
|
|
|
@ -81,3 +81,25 @@ function test_create_dreameye()
|
|||
assert_equal(amax - 5, u.aura_max)
|
||||
end
|
||||
|
||||
function test_appeasement()
|
||||
local u1, u2, r1, r2, uno
|
||||
r1 = region.create(0, 0, 'plain')
|
||||
r2 = region.create(1, 0, 'plain')
|
||||
u2 = unit.create(faction.create('human'), r1, 1)
|
||||
u2.race = 'elf'
|
||||
u2.name = 'Angsthase'
|
||||
u2.magic = 'gwyrrd'
|
||||
u2:set_skill('magic', 5)
|
||||
u2.aura = 10
|
||||
u2:add_spell('appeasement')
|
||||
u2:add_order('NACH O')
|
||||
u2:add_order('KAMPFZAUBER STUFE 1 Friedenslied')
|
||||
uno = u2.id
|
||||
u1 = unit.create(faction.create('human'), r1, 1)
|
||||
u1:set_skill('polearm', 5)
|
||||
u1:add_order('ATTACKIERE ' .. itoa36(uno))
|
||||
process_orders()
|
||||
u2 = get_unit(uno)
|
||||
assert_not_nil(u2)
|
||||
assert_equal(r2, u2.region)
|
||||
end
|
||||
|
|
14
src/battle.c
14
src/battle.c
|
@ -2641,14 +2641,14 @@ static void aftermath(battle * b)
|
|||
}
|
||||
}
|
||||
snumber += du->number;
|
||||
if (relevant) {
|
||||
flags = UFL_LONGACTION | UFL_NOTMOVING;
|
||||
if (du->status == ST_FLEE) {
|
||||
flags -= UFL_NOTMOVING;
|
||||
}
|
||||
}
|
||||
if (df->alive == 0) {
|
||||
flags |= UFL_DEAD;
|
||||
flags = UFL_DEAD;
|
||||
}
|
||||
else if (relevant) {
|
||||
flags = UFL_LONGACTION;
|
||||
if ((du->status != ST_FLEE) && (df->run.hp <= 0)) {
|
||||
flags |= UFL_NOTMOVING;
|
||||
}
|
||||
}
|
||||
if (flags) {
|
||||
fset(du, flags);
|
||||
|
|
|
@ -6460,7 +6460,7 @@ static spelldata spell_functions[] = {
|
|||
{ "mindblast", sp_mindblast_temp, 0 },
|
||||
{ "orkdream", sp_sweetdreams, 0 },
|
||||
/* M_CERDDOR */
|
||||
{ "appeasement", sp_denyattack, 0 },
|
||||
{ "appeasement", sp_appeasement, 0 },
|
||||
{ "song_of_healing", sp_healing, 0 },
|
||||
{ "generous", sp_generous, 0 },
|
||||
{ "song_of_fear", sp_song_of_fear, 0 },
|
||||
|
|
|
@ -1262,7 +1262,7 @@ int sp_reeling_arrows(struct castorder * co)
|
|||
/* Magier weicht dem Kampf aus. Wenn er sich bewegen kann, zieht er in
|
||||
* eine Nachbarregion, wobei ein NACH ber<EFBFBD>cksichtigt wird. Ansonsten
|
||||
* bleibt er stehen und nimmt nicht weiter am Kampf teil. */
|
||||
int sp_denyattack(struct castorder * co)
|
||||
int sp_appeasement(struct castorder * co)
|
||||
{
|
||||
fighter * fi = co->magician.fig;
|
||||
int level = co->level;
|
||||
|
|
|
@ -30,7 +30,7 @@ extern "C" {
|
|||
int sp_berserk(struct castorder * co);
|
||||
int sp_tiredsoldiers(struct castorder * co);
|
||||
int sp_reeling_arrows(struct castorder * co);
|
||||
int sp_denyattack(struct castorder * co);
|
||||
int sp_appeasement(struct castorder * co);
|
||||
int sp_sleep(struct castorder * co);
|
||||
int sp_windshield(struct castorder * co);
|
||||
int sp_strong_wall(struct castorder * co);
|
||||
|
|
Loading…
Reference in a new issue