[Freeciv-Dev] Re: patch: port attacks!
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
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
- [Freeciv-Dev] documentation patch to units.ruleset, Per I. Mathisen, 2002/03/10
- [Freeciv-Dev] Re: documentation patch to units.ruleset, Raahul Kumar, 2002/03/12
- [Freeciv-Dev] Re: patch: port attacks!, Jason Short, 2002/03/12
- [Freeciv-Dev] Re: patch: port attacks!, Raahul Kumar, 2002/03/12
- [Freeciv-Dev] Re: patch: port attacks!, Per I. Mathisen, 2002/03/12
- [Freeciv-Dev] Re: patch: port attacks!, Raahul Kumar, 2002/03/12
- [Freeciv-Dev] Re: patch: port attacks!, Gregory Berkolaiko, 2002/03/12
[Freeciv-Dev] Re: documentation patch to units.ruleset, Raimar Falke, 2002/03/12
|
|