Mantis 2552: rewrite goblin stealing to be more readable.

This commit is contained in:
Enno Rehling 2019-02-09 20:50:47 +01:00
parent 2e1bd01c54
commit d03f2cdab6
1 changed files with 11 additions and 10 deletions

View File

@ -193,8 +193,17 @@ void steal_cmd(unit * u, struct order *ord, econ_request ** stealorders)
n = effsk - max_skill(r, f, SK_PERCEPTION);
if (n <= 0) {
/* Wahrnehmung == Tarnung */
if (u_race(u) != get_race(RC_GOBLIN) || effsk <= 3) {
/* Wenn Goblins mit einem Tarnungstalent von mindestens 4 klauen, bekommen
* sie mindestens 50 Silber, selbst dann, wenn sie erwischt werden. */
if (u_race(u) == get_race(RC_GOBLIN) && effsk >= 4) {
ADDMSG(&u->faction->msgs, msg_message("stealfatal", "unit target", u,
u2));
ADDMSG(&u2->faction->msgs, msg_message("thiefdiscover", "unit target", u,
u2));
n = 1;
goblin = true;
}
else {
ADDMSG(&u->faction->msgs, msg_message("stealfail", "unit target", u, u2));
if (n == 0) {
ADDMSG(&u2->faction->msgs, msg_message("stealdetect", "unit", u2));
@ -205,14 +214,6 @@ void steal_cmd(unit * u, struct order *ord, econ_request ** stealorders)
}
return;
}
else {
ADDMSG(&u->faction->msgs, msg_message("stealfatal", "unit target", u,
u2));
ADDMSG(&u2->faction->msgs, msg_message("thiefdiscover", "unit target", u,
u2));
n = 1;
goblin = true;
}
}
i = i_get(u->items, rring->itype);