From 4256511b0ab5309fa296a2171220420d06101063 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Mon, 7 Mar 2005 22:55:56 +0000 Subject: [PATCH] =?UTF-8?q?http://eressea.upb.de/mantis/view.php=3Fid=3D45?= =?UTF-8?q?8=20Kapazit=C3=A4t=20von=20Einh=C3=B6rnern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/kernel/item.c | 1 + src/common/kernel/movement.c | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/common/kernel/item.c b/src/common/kernel/item.c index 5b420d780..aa67edd71 100644 --- a/src/common/kernel/item.c +++ b/src/common/kernel/item.c @@ -1495,6 +1495,7 @@ init_olditems(void) switch (i) { case I_HORSE: + case I_UNICORN: itype->capacity = HORSECAPACITY; itype->give = give_horses; break; diff --git a/src/common/kernel/movement.c b/src/common/kernel/movement.c index 1f69feab9..40c9ef785 100644 --- a/src/common/kernel/movement.c +++ b/src/common/kernel/movement.c @@ -235,7 +235,7 @@ static int ridingcapacity(unit * u) { int n; - int wagen, pferde; + int wagen, pferde, unicorns; n = 0; @@ -243,13 +243,15 @@ ridingcapacity(unit * u) * tragen nichts (siehe walkingcapacity). Ein Wagen zählt nur, wenn er * von zwei Pferden gezogen wird */ - pferde = min(get_item(u, I_HORSE), effskill(u, SK_RIDING) * u->number * 2); - if(fval(u->race, RCF_HORSE)) pferde += u->number; + unicorns = get_item(u, I_UNICORN); + pferde = get_item(u, I_HORSE); + pferde = min(pferde, effskill(u, SK_RIDING) * u->number * 2); + if (fval(u->race, RCF_HORSE)) pferde += u->number; /* maximal diese Pferde können zum Ziehen benutzt werden */ wagen = min(pferde / HORSESNEEDED, get_item(u, I_WAGON)); - n = wagen * WAGONCAPACITY + pferde * HORSECAPACITY; + n = wagen * WAGONCAPACITY + (pferde + unicorns) * HORSECAPACITY; return n; } @@ -262,6 +264,7 @@ walkingcapacity(const struct unit * u) * die Leute tragen */ pferde = get_item(u, I_HORSE); + unicorns = get_item(u, I_UNICORN); if (fval(u->race, RCF_HORSE)) { pferde += u->number; personen = 0; @@ -292,6 +295,7 @@ walkingcapacity(const struct unit * u) } n += pferde * HORSECAPACITY; + n += unicorns * HORSECAPACITY; n += personen * personcapacity(u); /* Goliathwasser */ tmp = get_effect(u, oldpotiontype[P_STRONG]); @@ -355,7 +359,7 @@ canfly(unit *u) { if (get_movement(&u->attribs, MV_CANNOTMOVE)) return false; - if(get_item(u, I_HORSE)) return false; + if(get_item(u, I_HORSE) || get_item(u, I_UNICORN)) return false; if(get_item(u, I_PEGASUS) >= u->number && effskill(u, SK_RIDING) >= 4) return true; @@ -373,6 +377,7 @@ canswim(unit *u) if (get_movement(&u->attribs, MV_CANNOTMOVE)) return false; if (get_item(u, I_HORSE)) return false; + if (get_item(u, I_UNICORN)) return false; if (get_item(u, I_DOLPHIN) >= u->number && effskill(u, SK_RIDING) >= 4) return true;