[Freeciv-Dev] Re: patch: port attacks!
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
--- "Per I. Mathisen" <Per.Inge.Mathisen@xxxxxxxxxxx> wrote:
> 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...
>
I like the look of it. You realise the AI needs to know about this little
change. I'm also amazed that these are the only lines that need changing.
I'm sure there are various flags in the code that check if no_land_attack.
It seems incomplete. I'll test it and let you know if there are any obvious
bugs.
> Yours,
> Per
>
> "My mother never saw the irony in calling me a son-of-a-bitch."
> -- Jack Nicholson
>
>
>
>
__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/
- [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
|
|