/* Definitions of the unit type properties in Xconq GDL.
   Copyright (C) 1991-1998 Stanley T. Shebs.

Xconq is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.  See the file COPYING.  */

DEF_UPROP_L("acp-damage-effect", u_acp_damage_effect,
	"effect of reduced hp on acp per turn",
	acpdamageeffect)

DEF_UPROP_I("acp-max", u_acp_max,
	"maximum acp that can be accumulated from turn to turn",
	acpmax, -1, -1, PROPHI)

DEF_UPROP_I("acp-min", u_acp_min,
	"amount by which unit acp may go negative during a turn",
	acpmin, PROPLO, 0, PROPHI)

DEF_UPROP_L("acp-morale-effect", u_acp_morale_effect,
	"effect of morale on acp per turn",
	acpmoraleeffect)

DEF_UPROP_I("acp-per-turn", u_acp,
	"base number of actions that this type can do in one turn",
	acp, 0, 0, PROPHI)

DEF_UPROP_I("acp-per-turn-max", u_acp_turn_max,
	"maximum acp after modification by damage etc effects",
	acpturnmax, -1, -1, PROPHI)

DEF_UPROP_I("acp-per-turn-min", u_acp_turn_min,
	"minimum acp after modification by damage etc effects",
	acpturnmin, 0, 0, PROPHI)

DEF_UPROP_L("acp-season-effect", u_acp_season_effect,
	"effect of season on acp",
	acpseasoneffect)

DEF_UPROP_L("acp-temperature-effect", u_acp_temp_effect,
	"effect of temperature on acp",
	acptempeffect)

DEF_UPROP_I("acp-to-change-side", u_acp_to_change_side,
	"action points used up by side change",
	acptochangeside, 0, 0, PROPHI)

DEF_UPROP_I("acp-to-detonate", u_acp_to_detonate,
	"action points used up by detonating",
	acptodetonate, 0, 0, PROPHI)

DEF_UPROP_I("acp-to-disband", u_acp_to_disband,
	"action points used up by disbanding",
	acptodisband, 0, 0, PROPHI)

DEF_UPROP_I("acp-to-fire", u_acp_to_fire,
	"action points used up by firing",
	acptofire, 0, 0, PROPHI)

DEF_UPROP_I("acp-to-move", u_acp_to_move,
	"action points used up by one move",
	acptomove, 0, 1, PROPHI)

DEF_UPROP_I("acp-to-transfer-part", u_acp_to_transfer_part,
	"action points used to transfer unit parts",
	acptotransferpart, 0, 0, PROPHI)

DEF_UPROP_I("action-priority", u_action_priority,
	"relative order in which the unit acts",
	actionpriority, 0, 0, PROPHI)

DEF_UPROP_I("already-seen", u_already_seen,
	"chance the unit is seen initially if its cell is seen",
	alreadyseen, 0, 0, 100)

DEF_UPROP_I("already-seen-independent", u_already_seen_indep,
	"chance the independent unit is seen initially if its cell is seen",
	alreadyseenindep, 0, 0, 100)

DEF_UPROP_I("assign-number", u_assign_number,
	"true if unit should be given a number",
	assignnumber, 0, 1, 1)

DEF_UPROP_I("available", u_available,
	"true if this type may be used",
	available, 0, 1, 1)

DEF_UPROP_I("can-be-self", u_can_be_self,
	"true if this type can be a self-unit",
	canbeself, 0, 0, 1)

DEF_UPROP_I("capacity", u_capacity,
	"space for occupants shared by all types of occupants",
	capacity, 0, 0, PROPHI)

/* Note that this function cannot be named u_char, because certain
   &^$%&^%! OSes, like AIX, typedef it to be an unsigned char. */

DEF_UPROP_S("char", u_uchar,
	"single character to use in displays",
	uchar, "")

DEF_UPROP_L("consumption-temperature-effect", u_consume_temp_effect,
	"effect of temperature on base consumption",
	consumetempeffect)

DEF_UPROP_I("country-units-max", u_country_units_max,
	"maximum number of units in the entire country",
	countryunitsmax, -1, -1, PROPHI)

DEF_UPROP_I("courage-max", u_courage_max,
	"maximum of type's courage vs other sides",
	couragemax, -100, 0, 100)

DEF_UPROP_I("courage-min", u_courage_min,
	"minimum of type's courage vs other sides",
	couragemin, -100, 0, 100)

DEF_UPROP_I("cp", u_cp,
	"number of construction points to complete a new unit",
	cp, 1, 1, PROPHI)

DEF_UPROP_I("cp-attrition", u_cp_attrition,
	"chance that an incomplete unit will lose cp",
	cpattrition, 0, 0, 10000)

DEF_UPROP_I("cp-per-self-build", u_cp_per_self_build,
	"number of construction points per self completion",
	cpperselfbuild, 0, 0, PROPHI)

DEF_UPROP_I("cp-to-self-build", u_cp_to_self_build,
	"number of construction points to enable self completion",
	cptoselfbuild, 0, 0, PROPHI)

DEF_UPROP_I("cxp-max", u_cxp_max,
	"upper bound on combat experience",
	cxpmax, 0, 0, PROPHI)

DEF_UPROP_I("cxp-on-capture-effect", u_cxp_on_capture,
	"change in combat experience of a captured unit",
	cxponcapture, 0, 100, PROPHI)

DEF_UPROP_L("description-format", u_desc_format,
	"formatting info for textual descriptions of a unit",
	descformat)

DEF_UPROP_I("detonate-on-death", u_detonate_on_death,
	"chance that a unit will detonate when about to die",
	detonateondepth, 0, 0, 100)

DEF_UPROP_I("direct-control", u_direct_control,
	"true if the type can be controlled directly by the player",
	directcontrol, 0, 1, 1)

DEF_UPROP_L("extensions", u_extensions,
	"extension properties",
	extensions)

DEF_UPROP_I("fire-angle-max", u_fire_angle_max,
	"maximum elevation of firing weapons, as percentage",
	fireanglemax, 0, 0, PROPHI)

DEF_UPROP_I("free-acp", u_free_acp,
	"extra action points available if an action needs them",
	freeacp, 0, 0, PROPHI)

DEF_UPROP_I("free-mp", u_free_mp,
	"extra mp available if a move action needs them",
	freemp, 0, 0, PROPHI)

DEF_UPROP_S("generic-char", u_gchar,
	"a non-unique character for the type",
	gchar, "")

DEF_UPROP_S("generic-name", u_generic_name,
	"a non-unique name for the type",
	genericname, "")

DEF_UPROP_S("help", u_help,
	"brief description of this type",
	help, "")

DEF_UPROP_I("hit-falloff-range", u_hit_falloff_range,
	"",
	hitfalloffrange, 0, PROPHI, PROPHI)

DEF_UPROP_I("hp-max", u_hp_max,
	"maximum number of hit points",
	hpmax, 1, 1, PROPHI)

DEF_UPROP_I("hp-per-disband", u_hp_per_disband,
	"hit points lost by one disband action",
	hpperdisband, 0, 0, PROPHI)

DEF_UPROP_I("hp-per-detonation", u_hp_per_detonation,
	"hit points lost by one detonate action",
	hpperdetonation, 0, 0, PROPHI)

DEF_UPROP_I("hp-recovery", u_hp_recovery,
	"number of hit points restored automatically each turn",
	hprecovery, 0, 0, PROPHI)

DEF_UPROP_I("hp-to-recover", u_hp_to_recover,
	"minimum hp for hp recovery to work",
	hptorecover, 0, 0, PROPHI)

DEF_UPROP_S("image-name", u_image_name,
	"ways to specify what a unit looks like",
	imagename, "")

DEF_UPROP_I("independent-growth-chance", u_indep_growth,
	"chance that an independent unit will be created during country growth",
	indepgrowth, 0, 0, 10000)

DEF_UPROP_I("independent-near-start", u_indep_near_start,
	"number of independent units within the min radius of the country",
	indepnearstart, 0, 0, PROPHI)

DEF_UPROP_I("independent-takeover-chance", u_indep_takeover,
	"chance that an existing independent unit will be given to a growing country",
	indeptakeover, 0, 0, 10000)

DEF_UPROP_I("initial-seen-radius", u_seen_radius,
	"radius around initial units that is seen initially",
	seenradius, 0, 1, PROPHI)

DEF_UPROP_S("long-name", u_long_name,
	"completely expanded-out name for the type",
	longname, "")

DEF_UPROP_I("lost-revolt-chance", u_lost_revolt,
	"chance that a unit on a losing side will revolt",
	lostrevolt, 0, 0, 10000)

DEF_UPROP_I("lost-vanish-chance", u_lost_vanish,
	"chance that a unit on a losing side will vanish",
	lostvanish, 0, 10000, 10000)

DEF_UPROP_I("lost-wreck-chance", u_lost_wreck,
	"chance that a unit on a losing side will be wrecked",
	lostwreck, 0, 0, 10000)

DEF_UPROP_I("morale-max", u_morale_max,
	"upper bound on morale",
	moralemax, 0, 0, PROPHI)

DEF_UPROP_I("morale-recovery", u_morale_recovery,
	"morale regained each turn",
	moralerecovery, 0, 0, PROPHI)

DEF_UPROP_I("move-range", u_move_range,
	"distance that a unit can jump in one move",
	moverange, 0, 1, PROPHI)

DEF_UPROP_I("mp-to-leave-world", u_mp_to_leave_world,
	"movement points needed to leave the world entirely",
	mptoleaveworld, -1, -1, PROPHI)

DEF_UPROP_S("namer", u_namer,
	"namer or naming method for this type",
	namer, "")

DEF_UPROP_S("name", u_type_name,
	"basic name of the type",
	name, "")

DEF_UPROP_S("name-internal", u_internal_name,
	"",
	iname, "")

DEF_UPROP_L("notes", u_notes,
	"player notes about the unit type",
	notes)

DEF_UPROP_I("occupant-total-max", u_occ_total_max,
	"maximum number of all types of occupants added together",
	occtotalmax, -1, -1, PROPHI)

DEF_UPROP_I("opinion-max", u_opinion_max,
	"maximum of type's opinion about other sides",
	opinionmax, -100, 0, 100)

DEF_UPROP_I("opinion-min", u_opinion_min,
	"minimum of type's opinion about other sides",
	opinionmin, -100, 0, 100)

DEF_UPROP_I("point-value", u_point_value,
	"an arbitrary number that assigns a value to a unit type",
	pointvalue, 0, 1, PROPHI)

DEF_UPROP_I("parts-max", u_parts,
	"maximum number of subparts in one unit",
	partsmax, 1, 1, PROPHI)

DEF_UPROP_L("possible-sides", u_possible_sides,
	"side(s) (class(es)) to which this type can belong",
	possiblesides)

DEF_UPROP_I("range", u_range,
	"maximum possible distance to fire",
	range, 0, 1, PROPHI)

DEF_UPROP_I("range-min", u_range_min,
	"minimum possible distance to fire",
	rangemin, 0, 0, PROPHI)

DEF_UPROP_I("revolt-chance", u_revolt,
	"basic chance that a unit will revolt",
	revolt, 0, 0, 10000)

DEF_UPROP_I("revolt-at-opinion-min", u_revolt_opinion_min,
	"chance that a unit will revolt when at its lowest opinion of its side",
	revoltopinionmin, 0, 0, 10000)

DEF_UPROP_I("road-to-edge-chance", u_road_to_edge_chance,
	"chance for a road running from unit to edge of the world",
	roadtoedgechance, 0, 0, 100)

DEF_UPROP_I("see-always", u_see_always,
	"true if others' view of unit is always up-to-date",
	seealways, 0, 0, 1)

DEF_UPROP_I("see-occupants", u_see_occupants,
	"true if occupants seen whenever unit is seen",
	seeoccs, 0, 0, 1)

DEF_UPROP_I("see-terrain-if-captured", u_see_terrain_captured,
	"chance to see other side's terrain view if unit captured",
	seeterrcap, 0, 0, 100)

DEF_UPROP_I("self-changeable", u_self_changeable,
	"true if self-unit may be changed by player at will",
	selfchangeable, 0, 0, 1)

DEF_UPROP_I("self-resurrects", u_self_resurrects,
	"true if self-unit switches automatically if current one dies",
	selfresurrects, 0, 0, 1)

DEF_UPROP_S("short-name", u_short_name,
	"abbreviated but still informative name string",
	shortname, "")

DEF_UPROP_I("speed", u_speed,
	"normal acp/move ratio",
	speed, 0, 100, PROPHI)

DEF_UPROP_L("speed-damage-effect", u_speed_damage_effect,
	"effect of damage on speed",
	speeddamageeffect)

DEF_UPROP_I("speed-max", u_speed_max,
	"maximum possible acp/move ratio",
	speedmax, 0, PROPHI, PROPHI)

DEF_UPROP_I("speed-min", u_speed_min,
	"minimum possible acp/move ratio",
	speedmin, 0, 0, PROPHI)

DEF_UPROP_L("speed-wind-effect", u_speed_wind_effect,
	"effect of wind (force and angle) on speed",
	speedwindeffect)

DEF_UPROP_I("spot-action", u_spot_action,
	"true if unit might be spotted if it acts",
	spotaction, 0, 0, 1)

DEF_UPROP_I("spur-chance", u_spur_chance,
	"chance for a road spur",
	spurchance, 0, 0, 100)

DEF_UPROP_I("spur-range", u_spur_range,
	"maximum length for a road spur",
	spurrange, 0, 0, PROPHI)

DEF_UPROP_I("spy-chance", u_spy_chance,
	"chance that a unit's spying will succeed",
	spychance, 0, 0, 10000)

DEF_UPROP_I("spy-range", u_spy_range,
	"distance around which a unit's spying will yield information",
	spyrange, -1, 0, PROPHI)

DEF_UPROP_I("stack-order", u_stack_order,
	"relative priority of unit within stack (0 = highest)",
	stackorder, 0, 0, PROPHI)

DEF_UPROP_I("start-with", u_start_with,
	"number of units within the initial area",
	startwith, 0, 0, PROPHI)

DEF_UPROP_I("tech-from-ownership", u_tech_from_ownership,
	"tech guaranteed by owning a unit of this type",
	techfromownership, 0, 0, PROPHI)

DEF_UPROP_I("tech-leakage", u_tech_leakage,
	"",
	techleakage, 0, 0, PROPHI)

DEF_UPROP_I("tech-max", u_tech_max,
	"maximum possible tech for this type",
	techmax, 0, 0, PROPHI)

DEF_UPROP_I("tech-per-turn-max", u_tech_per_turn_max,
	"limit on tech gains from research and acquisition",
	techperturnmax, 0, PROPHI, PROPHI)

DEF_UPROP_I("tech-to-build", u_tech_to_build,
	"minimum tech required to be able to create and complete this type",
	techtobuild, 0, 0, PROPHI)

DEF_UPROP_I("tech-to-own", u_tech_to_own,
	"minimum tech required to be able to have this type on one's side",
	techtoown, 0, 0, PROPHI)

DEF_UPROP_I("tech-to-see", u_tech_to_see,
	"minimum tech required to be able to see this type",
	techtosee, 0, 0, PROPHI)

DEF_UPROP_I("tech-to-use", u_tech_to_use,
	"minimum tech required to be able to use this type",
	techtouse, 0, 0, PROPHI)

DEF_UPROP_L("temperature-attrition", u_temp_attrition,
	"effect of temperature on hp",
	tempattrition)

DEF_UPROP_I("type-in-game-max", u_type_in_game_max,
	"maximum number (for all sides summed) units of this type allowed",
	typeingamemax, -1, -1, PROPHI)

DEF_UPROP_I("type-per-side-max", u_type_per_side_max,
	"maximum number of this type for each side",
	typepersidemax, -1, -1, PROPHI)

DEF_UPROP_I("unit-growth-chance", u_unit_growth,
	"chance that a new unit will be created during country growth",
	unitgrowth, 0, 0, 10000)

DEF_UPROP_I("unit-takeover-chance", u_unit_takeover,
	"chance that an existing unit will be given to the side during country growth",
	unittakeover, 0, 0, 10000)

DEF_UPROP_I("vision-range", u_vision_range,
	"range out to which a unit sees everything",
	visionrange, -1, 1, PROPHI)

DEF_UPROP_I("vision-bend", u_vision_bend,
	"",
	visionbend, 0, 100, 100)

DEF_UPROP_I("wrecked-type", u_wrecked_type,
	"unit type to turn into if unit loses all of its HP",
	wreckedtype, 0, NONUTYPE, MAXUTYPES)

/* Used by AIs only. */

DEF_UPROP_I("zz-b", u_is_base,
	"",
	is_base, 0, 0, 0)

DEF_UPROP_I("zz-bb", u_is_base_builder,
	"",
	is_base_builder, 0, 0, 0)

DEF_UPROP_I("zz-transport", u_is_transport,
	"",
	is_transport, 0, 0, 0)

DEF_UPROP_I("zz-c", u_is_carrier,
	"",
	is_carrier, 0, 0, 0)

DEF_UPROP_I("zz-cm", u_can_make,
	"",
	can_make, 0, 0, 0)

DEF_UPROP_I("zz-cc", u_can_capture,
	"",
	can_capture, 0, 0, 0)

DEF_UPROP_I("zz-bw", u_bw,
	"",
	bw, 0, 0, 0)
	
DEF_UPROP_I("advanced", u_advanced,
	"true if unit is advanced city that can use food to grow in size",
	advanced_city, 0, 0, 1)
	
// --- ADVANCED GAME SUPPORT ----------------------------------------

DEF_UPROP_I("minimal-size-goal", u_minimal_size_goal,
	"minimal possible size goal when selecting new location for advanced unit",
	minimalsizegoal, 0, 12, PROPHI)

DEF_UPROP_I("reach", u_reach,
	"default reach in cells for this type (used to initialize unit->reach)",
	ureach, 0, 2, PROPHI)

DEF_UPROP_I("colonizer", u_colonizer,
	"true if unit can colonize the land by building cities",
	colonizer, 0, 0, 1)

DEF_UPROP_I("improver", u_improver,
	"true if unit can build facilities or improve the terrain",
	improver, 0, 0, 1)

DEF_UPROP_I("facility", u_facility,
	"true if unit is a facility",
	facility, 0, 0, 1)

DEF_UPROP_I("offensive", u_offensive,
	"true if unit is offensive",
	offensive, 0, 1, 1)

DEF_UPROP_I("defensive", u_defensive,
	"true if unit is defensive",
	defensive, 0, 0, 1)

DEF_UPROP_I("explorer", u_explorer,
	"true if unit can explore",
	explorer, 0, 1, 1)

DEF_UPROP_I("disable-standard-acp", u_disable_standard_acp,
	"true if unit does not compute acps in the normal way (used for advanced units)",
	disablestandardacp, 0, 0, 1)

