diff -Nur -X no.freeciv freeciv-old/client/helpdata.c freeciv-mod/client/helpdata.c --- freeciv-old/client/helpdata.c Mon Sep 13 18:44:40 1999 +++ freeciv-mod/client/helpdata.c Mon Sep 13 21:03:12 1999 @@ -691,7 +691,7 @@ sprintf(buf+strlen(buf), "* Can attack from aboard sea units: against enemy cities and\n onto land squares."); } if (unit_flag(i, F_PARATROOPERS)) { - sprintf(buf+strlen(buf), "* Can be paradropped from a city with airport."); + sprintf(buf+strlen(buf), "* Can be paradropped from a city with airport (Range: %d).", utype->paratroopers_range); } if (unit_flag(i, F_PIKEMEN)) { sprintf(buf+strlen(buf), "* Gets double defense against units specified as 'mounted'.\n"); diff -Nur -X no.freeciv freeciv-old/client/packhand.c freeciv-mod/client/packhand.c --- freeciv-old/client/packhand.c Mon Sep 13 18:44:41 1999 +++ freeciv-mod/client/packhand.c Mon Sep 13 19:40:36 1999 @@ -1081,6 +1081,7 @@ u->shield_cost = p->shield_cost; u->food_cost = p->food_cost; u->gold_cost = p->gold_cost; + u->paratroopers_range = p->paratroopers_range; tilespec_setup_unit_type(p->id); } diff -Nur -X no.freeciv freeciv-old/common/capstr.c freeciv-mod/common/capstr.c --- freeciv-old/common/capstr.c Mon Sep 13 18:44:43 1999 +++ freeciv-mod/common/capstr.c Mon Sep 13 19:38:04 1999 @@ -71,7 +71,7 @@ #define CAPABILITY "+1.8 caravan1 nuke clientcommands" \ " +terrainrulesets1 +governmentrulesets2 +num_units +tilespec" \ " +ruleset_control +ask_pillage +gen_tech1 +nationsruleset" \ - " +long_names +paratroopers" + " +long_names +paratroopers1" /* "caravan1" means the server automatically establishes a traderoute when a caravan type unit moves into an enemy city. For older @@ -109,7 +109,8 @@ "long_names" means that player names longer than 9 chars are allowed. - "paratroopers" is for the support of the "Paratroopers" unit flag + "paratroopers1" is for the support of the "Paratroopers" unit flag + and the paratroopers_range field */ void init_our_capability(void) diff -Nur -X no.freeciv freeciv-old/common/packets.c freeciv-mod/common/packets.c --- freeciv-old/common/packets.c Mon Sep 13 18:44:44 1999 +++ freeciv-mod/common/packets.c Mon Sep 13 21:17:32 1999 @@ -1995,6 +1995,8 @@ cptr=put_string(cptr, packet->name); cptr=put_string(cptr, packet->graphic_str); cptr=put_string(cptr, packet->graphic_alt); + if(unit_flag(packet->id, F_PARATROOPERS)) + cptr=put_int16(cptr, packet->paratroopers_range); put_int16(buffer, cptr-buffer); return send_connection_data(pc, buffer, cptr-buffer); @@ -2035,6 +2037,9 @@ iget_string(&iter, packet->name, sizeof(packet->name)); iget_string(&iter, packet->graphic_str, sizeof(packet->graphic_str)); iget_string(&iter, packet->graphic_alt, sizeof(packet->graphic_alt)); + if(packet->flags & (1L<paratroopers_range); + else packet->paratroopers_range=0; pack_iter_end(&iter, pc); remove_packet_from_buffer(&pc->buffer); diff -Nur -X no.freeciv freeciv-old/common/packets.h freeciv-mod/common/packets.h --- freeciv-old/common/packets.h Mon Sep 13 18:44:45 1999 +++ freeciv-mod/common/packets.h Mon Sep 13 19:51:27 1999 @@ -487,6 +487,8 @@ int shield_cost; /* normal upkeep cost */ int food_cost; /* settler food cost */ int gold_cost; /* gold upkeep (n/a now, maybe later) */ + + int paratroopers_range; /* max range of paratroopers, F_PARATROOPERS */ }; struct packet_ruleset_tech { diff -Nur -X no.freeciv freeciv-old/common/unit.h freeciv-mod/common/unit.h --- freeciv-old/common/unit.h Mon Sep 13 18:44:47 1999 +++ freeciv-mod/common/unit.h Mon Sep 13 19:10:09 1999 @@ -190,6 +190,8 @@ int shield_cost; /* normal upkeep cost */ int food_cost; /* settler food cost */ int gold_cost; /* gold upkeep (n/a now, maybe later) */ + + int paratroopers_range; /* only valid for F_PARATROOPERS */ }; diff -Nur -X no.freeciv freeciv-old/data/civ2/units.ruleset freeciv-mod/data/civ2/units.ruleset --- freeciv-old/data/civ2/units.ruleset Mon Sep 13 18:44:54 1999 +++ freeciv-mod/data/civ2/units.ruleset Mon Sep 13 21:37:18 1999 @@ -49,6 +49,11 @@ ; uk_* = upkeep costs, these are used as base values in the game ; flags = special flag strings, as in common/unit.h,unit.c ; roles = special role strings, as in common/unit.h,unit.c +; +; Following flag strings require extra fields: +; "Paratroopers" +; paratroopers_range = the maximal range the unit can be paradropped to +; [unit_settlers] name = "Settlers" @@ -371,6 +376,8 @@ uk_gold = 0 flags = "Paratroopers" roles = "DefendOk" + +paratroopers_range = 10 [unit_mech_inf] name = "Mech. Inf." diff -Nur -X no.freeciv freeciv-old/data/default/units.ruleset freeciv-mod/data/default/units.ruleset --- freeciv-old/data/default/units.ruleset Mon Sep 13 18:45:01 1999 +++ freeciv-mod/data/default/units.ruleset Mon Sep 13 21:37:22 1999 @@ -49,6 +49,11 @@ ; uk_* = upkeep costs, these are used as base values in the game ; flags = special flag strings, as in common/unit.h,unit.c ; roles = special role strings, as in common/unit.h,unit.c +; +; Following flag strings require extra fields: +; "Paratroopers" +; paratroopers_range = the maximal range the unit can be paradropped to +; [unit_settlers] name = "Settlers" @@ -371,6 +376,8 @@ uk_gold = 0 flags = "Paratroopers" roles = "DefendOk" + +paratroopers_range = 10 [unit_mech_inf] name = "Mech. Inf." diff -Nur -X no.freeciv freeciv-old/server/ruleset.c freeciv-mod/server/ruleset.c --- freeciv-old/server/ruleset.c Mon Sep 13 18:45:08 1999 +++ freeciv-mod/server/ruleset.c Mon Sep 13 19:27:28 1999 @@ -567,6 +567,11 @@ u->name, sval, filename); } u->flags |= (1<paratroopers_range = secfile_lookup_int(file, + "%s.paratroopers_range", sec[i]); + } } free(slist); } @@ -1352,6 +1357,7 @@ packet.shield_cost = u->shield_cost; packet.food_cost = u->food_cost; packet.gold_cost = u->gold_cost; + packet.paratroopers_range = u->paratroopers_range; for(to=0; toowner)) { - if(real_map_distance(punit->x, punit->y, x, y) <= 10) { + int range = get_unit_type(punit->type)->paratroopers_range; + if(real_map_distance(punit->x, punit->y, x, y) <= range) { struct city *start_city = map_get_city(punit->x, punit->y); struct city *dest_city = map_get_city(x, y); int ok=1;