Commit graph

2532 commits

Author SHA1 Message Date
d16fc6afdd Fix the previous revision. 2006-06-17 13:52:13 +00:00
b9017dbde9 (chance, roundavg): Simplify. No functional change. 2006-06-17 12:40:25 +00:00
ca6c16357f (lnd_fortify): Round mobility fractions up always, not just to 1.
Simplify.

(fort): Don't claim land unit can't be fortified when amount argument
is zero.
2006-06-17 08:42:23 +00:00
07de857b88 (sector_mcost, bp_neighbors, lnd_mar_one_sector): Deal with disabled
road/rail infrastructure.
2006-06-16 21:11:25 +00:00
9067d7a453 (info.ps): New. Adapt TROFF.MAC. Result isn't exactly a readable
book.
2006-06-16 20:51:40 +00:00
8861333689 (mission): Nicer diagnostics. 2006-06-16 20:44:23 +00:00
27d37f35a9 Che cannot target #0:
(guerrilla): Oops on it.
(doland, takeover): Clear them when che_target becomes 0.

(doland): Fix bogus message.

(guerrilla): Remove silly sanity check.
2006-06-16 20:01:30 +00:00
4d1dd6fa6a (sctintrins): New member in_enable. Update infra.config. Use it
instead of opt_DEFENSE_INFRA.
(improve): Test for it.
(show_sect_build): Show only enabled infrastructure.
(opt_DEFENSE_INFRA): Remove.  Deities can edit infra.config instead.

(improve): Dumb down prompt.
2006-06-16 18:39:35 +00:00
2c2b3f7b1d Fix the previous revision. 2006-06-16 17:16:42 +00:00
78d36b8a3e Update copyright. Add `Preface to the Wolfpack Edition'. Spelling
fixes.  Change is authorized by Geoff Cashman.
2006-06-16 17:15:13 +00:00
490b4fa5ff Revert the previous revision, it doesn't make sense. 2006-06-16 05:42:52 +00:00
9ae594153f (show_sect_stats): Display mobility cost of inaccessible sectors as
`no way' instead of obscure magic numbers.
2006-06-15 21:27:45 +00:00
b3fc6413e0 (sector_strength): Back out rev. 1.53's oopses, because their
conditions can happen.
2006-06-15 21:19:03 +00:00
eff3f89cc6 (map): Fix crash on empty argument introduced in rev. 1.18. 2006-06-15 21:17:37 +00:00
083003ad82 (sector_mcost): New, simpler sector mobility cost formula. The cost
is a linear function of sector efficiency, with cost at 0% given by
dchstr member d_mcst and cost at 100% given by d_emcst.  The latter
used to be d_mcst - 1.  Mountain cost is no longer a special case.
Road infrastructure now reduces cost up to 90%, linear in road
efficiency (used to be close to that, but non-linear).  Same for rail
infrastructure, but 99%.  Double land unit minimum cost to 0.02.
Change land unit cost penalty in newly taken land to an extra 0.2
instead of a minimum of 0.2.
(dchrstr): New member d_emcst.  sector.config updated, with some
changes: cost of mountain now ranges from 2.4 to 1.2 instead of 2.174
to 1.304, wildernes 0.4 instead of 0.6 to 0.4, highway, bridge head,
bridge span and tower from 0.4 to 0.001 instead of 0.2 to 0.001.
While I'm at it, make bridge head match highway stats (dstr and value
reduced).
(show_sect_stats): Show d_emcst.
(dchr_ca): New selector emcst for d_emcst.
2006-06-15 21:12:53 +00:00
89022fbc42 (prmobcost): New.
(sinfra): Use it to display inaccessible sectors sensibly.
Inaccessible occurs for rail since src/lib/common/move.c rev. 1.12.
2006-06-15 19:46:27 +00:00
2ecc85b541 (attack_val, defense_val): These functions overestimate unit strength,
because they ignore three facts.  Firstly, mil casualties decrease
strength linearly, while unit casualties decrease it quadratically
(unit strength scales with mil * eff).  Secondly, casualties decrease
strength proportional to the combat multiplier, hence twice as much
mil are more powerful than double multiplier.  Thirdly, units break
and retreat.  Change the estimate from mil * mult to mil * sqrt(mult).
Improves things in simulations, hope it works out in practice as well.
Closes #682571.
2006-06-15 19:05:17 +00:00
ded3ca41ef (lnd_hit_mine): Remove silly use of double. Rounds fractional damage
to engineers down instead of up.

(retreat_land1): Failed to reduce mine damage to engineers.
2006-06-15 18:58:47 +00:00
5dcd0dcd86 (att_reacting_units, attack_val, defense_val, intelligence_report):
Return double.  Callers changed.

(att_reacting_units): Remove silly truncation to int.

(get_dlist): Return void, simplify.
2006-06-15 18:55:15 +00:00
3f23320a7e (tcp_listen): Don't print null host. 2006-06-15 18:34:46 +00:00
d3c0ab9805 (as_search) [DEBUG]: Fix crash bug. We don't normally define DEBUG. 2006-06-15 17:53:55 +00:00
0f2cfef599 Update for 4.3.6. 2006-06-14 18:22:28 +00:00
15a1a06101 Doc fix. 2006-06-14 18:14:40 +00:00
bb2a725b0d (options_cmd): login_opts[] lacked sentinel. Potential crash-bug.
Simplify.
2006-06-14 18:07:37 +00:00
f940413c67 Document signal use. Since Windows lacks real signals, it is only
included if number register w is zero.
2006-06-14 18:05:16 +00:00
c05ecb8781 Update for current code. Minor edits. 2006-06-14 18:02:20 +00:00
cce7f179b8 (satmap, satdisp_units): Don't show landspies.
(satdisp_units): Don't show land units loaded on ships or land units.

(satdisp_units): Align table header with body.
2006-06-14 17:56:26 +00:00
cdfb17d28a (satdisp, satdisp_sect, satdisp_units): Split satdisp() into
satdisp_sect() and satdisp_units().
(satmap): Call only satdisp_sect().  No functional change.
(aircombat): Call both, and call satdisp_units() even over sea.  This
lets spy planes spot surface ships at sea.  Closes #906035.
2006-06-14 17:38:16 +00:00
cefe61916c (MIN_MOBCOST, LND_MINMOBCOST): Just one use, inline and remove. 2006-06-13 21:21:02 +00:00
4e7c993a62 (lnd_mobtype): New.
(lnd_path): Use it.
(lnd_mobcost): Use it, remove last parameter.  Callers changed.  This
fixes mobility use of trains when retreating, both for retreat orders
and for failed morale checks.
(retreat_land1): Fix test for impassable terrain.  Before, trains
could retreat off rail.
(lnd_take_casualty): Test for impassable terrain.  Before, trains
could retreat off rail.
2006-06-13 21:07:44 +00:00
2e693275f1 Make land unit attack mobility cost consistent with march cost:
(att_mobcost): New.
(ask_olist, take_move_in_mob): Use it.  Attacking land units can now
use roads and suffer the newly taken penalty.  No difference in most
cases, because the penalty commonly cancels the road bonus.
(get_mob_support, calc_mobcost, ask_move_in_off): Use it.  No
functional change now; ensures that military's attack mobility cost
will stay consistent with move cost.
(MOB_NONE): Unused, remove.
(sector_mcost): Simplify.
2006-06-13 20:29:47 +00:00
bcd35e15fb (att_fight): Don't charge the defending sector any mobility when it's
already negative.  Used to charge proportional to its absolute value,
which makes no sense.

(att_fight): Oops when attacker's mobility is negative rather than
charging negative mobility.

Remove superflous casts and parenthesis.
2006-06-13 18:35:49 +00:00
6bbd7ffdf3 Change maximum population to 100 for plains (was 49), mountains (was
99), bridge spans and bridge towers (was 999), and to 1000 for the
other habitable sector types (was 999).
2006-06-13 17:52:46 +00:00
be430d4b9d (max_population): Deal gracefully with big city 10 * d_maxpop >
ITEM_MAX: let value grow linearly from d_maxpop at 0% to the minimum
of 10 * d_maxpop and ITEM_MAX at 100%.
2006-06-13 17:46:04 +00:00
d22cb495bc Replace incorrect sea mine hit chance by reference to info Hitchance. 2006-06-11 19:30:19 +00:00
3cb95a8754 Update for changed plane abort chance. 2006-06-11 19:27:07 +00:00
f900ac68cb (shp_sweep): New parameter takemob. Charge mobility only if it's
true.
(shp_nav_one_sector): Pass false.  This lets minesweepers move at the
speed their stats indicate.  Closes #1498801.
(navi): Pass true.  This ensures sweeping without moving still costs
mobility.
2006-06-11 18:09:09 +00:00
0252d4a750 (ac_planedamage): Planes may abort when damaged below 80% efficiency.
Reduce abort chance from 100-eff to 80-eff.  This should make it
easier to punch through air defense, flak in particular, and increase
the risk of getting shot down.
2006-06-11 16:02:13 +00:00
c7f68f2e3e (ac_shipflak, ac_landflak): Reduce flak proportional to efficiency.
Rename some auto variables.  Closes #759402.
2006-06-11 05:12:47 +00:00
3a4e362de5 (FLAK_GUN_MAX): New.
(ac_doflak, ac_shipflak, ac_landflak): Use it.
(ac_shipflak, ac_landflak): Tally flak for all ships / units, then
limit to FLAK_GUN_MAX guns of average tech.  Used to limit to
FLAK_GUN_MAX guns *after* ship / land unit tech factor was applied by
exiting the loop early, then reduce *again* for nation tech of whoever
owns the last ship visited.  Makes no sense.  Exiting the loop early
is no good, because it can skip plane spotting.  This change and the
one below make low-tech ship and land unit flak more powerful;
rebalancing might be needed.

(ac_doflak, ac_landflak, ac_shipflak): Round flak randomly instead of
down.  This simplifies things.  In particular, you no longer have to
calculate how many low-tech ships to bunch together to get any flak.
2006-06-10 18:26:57 +00:00
17759f1071 (ac_fireflak): Remove parameter other, all callers pass 0. Callers
changed.
2006-06-10 17:53:24 +00:00
82bbb318dc (calc_all): Match the real update sequence. Until removal of budget
priorities (rev. 1.25), calc_all() tried to match the real sequence,
but didn't quire succeed to cope with all variations.  Then it matched
until the update sequence change in src/lib/update/main.c rev. 1.25.
This is required but not sufficient for closing #1310407.
2006-06-10 16:20:31 +00:00
Ron Koenderink
4a5700e572 (service_main) [_WIN32]: Added the missing empth_wait_for_signal() and
shutdown() for when the server is running at WIN32 service.  This fix
incorporates the changes that where done to the main thread.
2006-06-10 04:11:16 +00:00
Ron Koenderink
0c53200e8e (empth_wait_for_signal) [_WIN32]: Add thread block for the main thread,
otherwise the main thread blocks all others.
2006-06-10 03:57:50 +00:00
Ron Koenderink
0864c1fdb3 (update_main): Remove unused local variables. 2006-06-09 00:43:33 +00:00
Ron Koenderink
39b885e10e (journal_entry): Remove unused local variable. 2006-06-09 00:41:51 +00:00
Ron Koenderink
a21b4a0e72 (mtsymset, add2symset): Remove unused local variables. 2006-06-09 00:26:59 +00:00
Ron Koenderink
5b84e8087b (starv_units): Remove unused local variable. 2006-06-09 00:25:39 +00:00
Ron Koenderink
ca246d0bf9 (getpath): Remove unused local variables. 2006-06-09 00:24:06 +00:00
Ron Koenderink
961273b6a2 (feed_land): Remove unused local variables. 2006-06-09 00:17:44 +00:00