From a185ed80da3ab8596edfbfd47d1eb3b018762f0c Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Tue, 1 Oct 2002 16:35:57 +0000 Subject: [PATCH] combat changes. missile defense will now be with skill/2 even for archers defense against melee will be with skill/2 for archers instead of skill 0 --- src/common/attributes/attributes.dsp | 4 ++++ src/common/kernel/battle.c | 11 +++++------ src/common/kernel/battle.h | 5 +++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/common/attributes/attributes.dsp b/src/common/attributes/attributes.dsp index 5709ab9a2..6eb310aa1 100644 --- a/src/common/attributes/attributes.dsp +++ b/src/common/attributes/attributes.dsp @@ -175,6 +175,10 @@ SOURCE=.\viewrange.h # End Group # Begin Source File +SOURCE=.\at_movement.c +# End Source File +# Begin Source File + SOURCE=.\attributes.c # End Source File # Begin Source File diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index ddad58919..5c2aeef87 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -702,11 +702,7 @@ weapon_skill(const weapon_type * wtype, const unit * u, boolean attacking) if (attacking) { skill += wtype->offmod; } else { - /* Fernkämpfer haben im Nahkampf Talent 0 */ - if (fval(wtype, WTF_MISSILE)) skill = 0; - else { - skill += wtype->defmod; - } + skill += wtype->defmod; } } @@ -731,7 +727,7 @@ weapon_effskill(troop t, troop enemy, const weapon * w, boolean attacking, boole if (attacking) { skill = w->offskill; } else { - skill = w->defskill; + skill = missile?w->defmissile:w->defskill; } if (wtype->modifiers) { /* Pferdebonus, Lanzenbonus, usw. */ @@ -2827,6 +2823,9 @@ make_fighter(battle * b, unit * u, boolean attack) if (wtype==NULL || itm->number==0) continue; weapons[w].offskill = weapon_skill(wtype, u, true); weapons[w].defskill = weapon_skill(wtype, u, false); + weapons[w].defmissile = weapons[w].defskill; + /* Fernkämpfer haben im Nahkampf Talent/2 */ + if (fval(wtype, WTF_MISSILE)) weapons[w].defskill/=2; weapons[w].type = wtype; weapons[w].used = 0; weapons[w].count = itm->number; diff --git a/src/common/kernel/battle.h b/src/common/kernel/battle.h index 9e9f87097..4d2b0071a 100644 --- a/src/common/kernel/battle.h +++ b/src/common/kernel/battle.h @@ -96,8 +96,9 @@ typedef struct side { typedef struct weapon { int count, used; const struct weapon_type * type; - int offskill; - int defskill; + int offskill : 8; /* offense skill */ + int defskill : 8; /* defense against melee attacks */ + int defmissile : 8; /* defense against missiles - not div. by 2 yet */ } weapon; /*** fighter::person::flags ***/