[Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Fri, Feb 22, 2002 at 06:32:48PM +0100, Petr Baudis wrote:
> > > + && !is_barbarian(unit_owner(punit))
> > > + && punit->ai.ai_role != AIUNIT_ESCORT
> >
> > > + && punit->ai.charge == 0 /* Above line doesn't seem to work.
> > > :( */
> >
> > Please explain.
>
> That was Syela! :) Sorry, but I fear I can't explain it well yet. It's
> possible
> that we're not consistent in keeping those two values in sync; not really an
> idea.
Mhh.
> +This function looks at tiles directly neighbouring the unit in order to find
s/tiles directly neighbouring/tiles adjacent to/
> +something to kill or explore. It prefers tiles in the following order:
>
> -work of Syela - mostly to fix the ZOC/goto strangeness
> +Returns value of the victim which has been chosen:
> +
> +99999 means empty (undefended) city
> +99998 means hut
> +sane number means value of enemy unit weaker than our unit
Sane is relative: s/sane number/number from (1..99998)/
> +1 means barbarians wanting to pillage
> +0 means nothing found or error
> +-2*MORT*TRADE_WEIGHTING means nothing found and punit causing unhappiness
> +If nothing is chosen, (dest_x, dest_y) is set to actual punit's position.
s/If nothing is chosen/If a value <=0 is returned/
Is <=0 correct here?
> + int units_stack = unit_list_size(&(map_get_tile(punit->x,
> punit->y)->units));
Either rename to stack_size or create a "bool more_than_one_unit_here = ...".
> + best = 0 - 2 * MORT * TRADE_WEIGHTING;
s/0 //
> + benefit = (benefit + unit_value(get_role_unit(F_CITIES, 0)))
> + * punit->hp / unit_type(punit)->hp;
Could be replaced by
> + benefit += unit_value(get_role_unit(F_CITIES, 0));
> + benefit = (benefig * punit->hp) / unit_type(punit)->hp;
Plus the SET_BEST change.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"These download files are in Microsoft Word 6.0 format. After
unzipping, these files can be viewed in any text editor, including
all versions of Microsoft Word, WordPad, and Microsoft Word Viewer."
-- http://www.microsoft.com/hwdev/pc99.htm
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), (continued)
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Raahul Kumar, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/22
- Message not available
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/23
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Raahul Kumar, 2002/02/23
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Raimar Falke, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Raimar Falke, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Gregory Berkolaiko, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264) [aiunit.c-1.38], Petr Baudis, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.39] ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264) [aiunit.c-1.38],
Raimar Falke <=
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.40] ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.40] ai_military_findvictim() cleanup (PR#1264), Raimar Falke, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.42] ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.42] ai_military_findvictim() cleanup (PR#1264), Raimar Falke, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.43] ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.43] ai_military_findvictim() cleanup (PR#1264), Raimar Falke, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.43] ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.43] ai_military_findvictim() cleanup (PR#1264), Gregory Berkolaiko, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.43] ai_military_findvictim() cleanup (PR#1264), Raimar Falke, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.43] ai_military_findvictim() cleanup (PR#1264), Gregory Berkolaiko, 2002/02/22
|
|