Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2002:
[Freeciv-Dev] Re: patch: port attacks!
Home

[Freeciv-Dev] Re: patch: port attacks!

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: patch: port attacks!
From: "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx>
Date: Tue, 12 Mar 2002 14:03:08 +0100 (MET)

On Tue, 12 Mar 2002, Raahul Kumar wrote:
> You are a coding machine. There is no real Per. You must be an auto code
> generator ;-).

I'm flattered, but c'mon, it is only a couple of lines! :)

> >        /* This will make units roughly evenly good defenders look alike. */
> >        int unit_def = (int) (100000 * (1 - unit_win_chance(attacker,
> > defender)));
> > +      /* Ensure that seaborne units that can only attack other seaborne
> > +         units can actually attack enemy seaborne units in a stack if
> > +         they are present, and not fail because the enemy chose to
> > +         defend with a ground unit. Go, subs, go! {:-) - Per */
> > +      if (unit_flag(attacker, F_NO_LAND_ATTACK)
> > +          && is_sailing_unit(defender))
> > +              unit_def += 100000;
>
> I'd like to know why you are adding this number to unit_def. In short, how
> does it work

Whichever unit has the higher calculated unit_def is chosen as defender.
100000 is a number so big you cannot ignore it :) Especially since it is
used as a ceiling in line 2 quoted above...

Yours,
Per

"My mother never saw the irony in calling me a son-of-a-bitch."
 -- Jack Nicholson





[Prev in Thread] Current Thread [Next in Thread]