[Freeciv-Dev] Re: submarines
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Tue, 10 Sep 2002, Christian Knoke wrote:
> And I was quite sure that the firepower wouldn't affect the
> defense ...
>
> Hhm. Looking into some nested *_defense_*() in combat.c ...
> .............................
>
> Looks like that the source is with me! Yeah!
???
void get_modified_firepower(struct unit *attacker, struct unit *defender,
int *att_fp, int *def_fp)
{
*att_fp = unit_type(attacker)->firepower;
*def_fp = unit_type(defender)->firepower;
/* pearl harbour - defender's firepower is reduced to one,
* attacker's is multiplied by two */
if (is_sailing_unit(defender) && map_get_city(defender->x, defender->y)) {
*att_fp *= 2;
*def_fp = 1;
}
/*
* When attacked by fighters, helicopters have their firepower
* reduced to 1.
*/
if (is_heli_unit(defender) && unit_flag(attacker, F_FIGHTER)) {
*def_fp = 1;
}
/* In land bombardment both units have their firepower reduced to 1 */
if (is_sailing_unit(attacker)
&& map_get_terrain(defender->x, defender->y) != T_OCEAN
&& is_ground_unit(defender)) {
*att_fp = 1;
*def_fp = 1;
}
}
...
double unit_win_chance(struct unit *attacker, struct unit *defender)
{
int def_power = get_total_defense_power(attacker, defender);
int att_power = get_total_attack_power(attacker, defender);
double chance;
int def_fp, att_fp;
get_modified_firepower(attacker, defender, &att_fp, &def_fp);
chance = win_chance(att_power, attacker->hp, att_fp,
def_power, defender->hp, def_fp);
return chance;
}
No way.
Yours
Per
"I don't see why people are so upset about cloning sheep. American
television networks have been doing that to their audiences for years."
-- Jello Biafra
- [Freeciv-Dev] submarines, Per I. Mathisen, 2002/09/08
- [Freeciv-Dev] Re: submarines, Miguel Farah, 2002/09/08
- [Freeciv-Dev] Re: submarines, Christian Knoke, 2002/09/08
- Message not available
- [Freeciv-Dev] Re: submarines, Christian Knoke, 2002/09/08
- [Freeciv-Dev] Re: submarines, Per I. Mathisen, 2002/09/10
- [Freeciv-Dev] Re: submarines, Christian Knoke, 2002/09/10
- [Freeciv-Dev] Re: submarines, Raimar Falke, 2002/09/10
- [Freeciv-Dev] Re: submarines,
Per I. Mathisen <=
- [Freeciv-Dev] Re: submarines, Christian Knoke, 2002/09/11
|
|