Commit graph

3355 commits

Author SHA1 Message Date
3a1577a6b5 Remove econfig key mission_mob_cost
Questionable feature, and hasn't been used in a long time.
2008-12-25 11:47:33 +01:00
d5f371cc1d Remove oprange()'s mission parameter
Use the current mission instead.  Make mission() set it before calling
oprange(), and clean up somewhat.
2008-12-25 11:47:32 +01:00
ca9af92523 Check capabilities required for mission before range
Checking range first could complain about range when the mission
couldn't work regardless of range.  Not helpful.
2008-12-25 11:47:32 +01:00
820faedb99 Drop checks whether we can get the op-sector from mission()
getsect() can fail here only when the coordinates are invalid.  The
first check uses coordinates from a successful sarg_xy(), so they
can't be invalid.  The second check uses coordinates of an object to
be put on the mission.  If these are invalid, game state is corrupt,
and failing the mission command doesn't improve the situation a bit.
2008-12-25 11:47:32 +01:00
77e3a8fe31 Simplify mission() by separating off clear_mission() 2008-12-25 11:47:32 +01:00
49e8b3c64b Streamline signature of show_mission()
Remove unused parameter, and return status.
2008-12-25 11:47:32 +01:00
7ac151acac Move show_mission() to sole caller, give it internal linkage 2008-12-25 11:47:32 +01:00
c1b76a1a2f All missions now have op areas, simplify mission() 2008-12-25 11:47:32 +01:00
a9b2d9c7f3 Make escort mission obey op-area
Before, the escort mission didn't support an op-area, and planes on
escort mission escorted anywhere.  Change mission() to define the
op-area for escort missions as well.  Show it in mission() and
show_mission().  Check it in find_escorts().
2008-12-25 11:47:32 +01:00
bf89453f8a Remove non-mission land unit reaction
Land unit reactions are overly complex because we have two different
concepts controlling them: reaction radius (set with lrange) and
reserve mission (set with mission).  You need to deal with both to set
up or query reactions.

Commit 8d0e1af5 "fixed" this by making reserve missions meaningless.

The previous commit made reserve missions meaningful again: they
support an op-area now.  This brought back the problem of having to
deal with two separate commands to accomplish one thing.

Fix this for good by removing non-mission land unit reaction
alltogether.  The only feature we lose by that is the ability to order
land units to react until the order is explicitely cancelled.  That's
because missions are implicitely cleared by many commands and events,
while non-mission reaction wasn't.  Closes #858121 and #858122.

Remove the non-mission reaction case from att_reacting_units().

Don't limit reserve missions to the land unit's reaction radius: make
lnd_reaction_range() return the type's maximum radius instead of
lnd_rad_max.

The reaction radius is now useless.  Remove the lrange command, and
struct lndstr member lnd_rad_max along with its selector react.
Remove land command's column rd.  Make ldump show column react as
zero.  Deprecate edit key 'P' in dounit(), and don't show it in
pr_land().
2008-12-25 11:47:05 +01:00
8e527b6cff Make land units on reserve mission react within op-area
Before, they always reacted to their maximum range, and the op-area
was unused.  Change mission() to define the op-area for reserve
missions as well.  Remove the special-case for showing reserve
missions from mission() and show_mission().  New lnd_reaction_range()
factored out of att_reacting_units().  Use it in oprange() to cover
reserve missions.  Pass the mission as separate parameter to oprange()
for now, because miss() doesn't set it in the object until later.
2008-12-17 12:30:43 -05:00
40d8357746 New in_oparea(), factored out of build_mission_list_type() 2008-12-17 11:37:55 -05:00
439fa2eadc Don't reduce mission op area when range shrinks
The mission command limits op area radius to the possible range.
That's okay, as it doesn't actually restrict possible op areas.  When
the mission is executed, it was limited again.  Don't do that; remove
the limiting code from build_mission_list_type() and show_mission().

The removed limiting had no effect, except when the range shrunk.
Then limiting reduced the op area more than necessary.  For instance,
consider an object O with initial range 3 on a mission around M with
range 3:

    - - - y - - -
     - - z y - -
    - - z x y - -
     - O x x M -
    - - z x y - -
     - - z y - -
    - - - y - - -

Initially, all sectors not marked - are in range and in the op area.
If the range drops to two, sectors marked O, x and z are still in
range of O.  But only the x are still in range of M.  The O and z got
excluded.

Range can currently shrink when plane range is reduced (range
command), or a ship, plane or land unit somehow loses tech (deity
intervention).
2008-12-17 11:36:49 -05:00
8d0e1af5b7 Remove reserve mission's reaction radius bonus
Reserve missions are now useless.  They'll become useful again in a
later commit.
2008-12-14 10:45:35 -05:00
6376574754 Use #if 0 to disable code, not comments 2008-12-14 10:45:35 -05:00
5b01c4764d Clean up removal of reserve mission mobility bonus
Land units on reserve missions used to pay only half the usual
mobility for combat.  This bonus was commented out in the code in
4.0.0, but not in info.  Remove it from both.
2008-12-14 10:45:35 -05:00
1417a3442d Remove commented out logerror() calls
Probably ancient debug cruft.
2008-12-14 10:45:34 -05:00
cebba0587c Bump version to 4.3.20 2008-12-14 10:44:02 -05:00
5113bc0bb5 Update change log again for 4.3.19 2008-12-07 18:16:19 -05:00
e597257438 Fix make dist in a separate build directory without git
In that case, make copied the sources.mk from $srcdir, but unless it
existed already, the peculiar workings of VPATH did us in: make
searched for the target, found it in $srcdir, and the dependency
became circular.

Fix by keeping sources.mk in $srcdir always.  We can build it there,
because its contents depends only on git state, not on anything in the
build tree.  This avoids the need to copy sources.mk alltogether.
2008-12-07 18:14:46 -05:00
2454304dde LWP doesn't work with Darwin due to OS bugs, avoid it for now
Darwin's getcontext() overruns its argument buffer.
2008-12-07 17:25:35 -05:00
de2651efa1 Don't let ships double-retreat first on 'i' and then on 'h'
When a ship is shelled, retreat condition 'i' (injured) applies.  When
there's no return fire, 'h' (helpless) applies as well.  Ships
retreated twice in that case.  Fix that.
2008-12-07 09:26:26 -05:00
204caeb243 Update change log for 4.3.19 2008-12-06 20:12:18 -05:00
4c5d3c235b Replace other occurences of git-FOO by git FOO 2008-12-03 07:57:14 -05:00
b4ecf7c7a6 Use 'git ls-files' instead of deprecated 'git-ls-files' 2008-12-02 21:26:32 -05:00
4a0dd2d1f7 Fix shp_prewrite() to print the sunk message
Broken in commit 861a66625, v4.3.17.
2008-11-24 19:08:16 -05:00
Ron Koenderink
344e91bbb9 Log out player when time per day is exceeded
Commit 3da4030 already changed player_main() to log out the player
when m_m_p_d was exceeded in command().  This crept in accidentally.
Complete the job by changing status() to log out the player instead of
downgrading him to visitor status.

Also, change player_main(), command() and status() to apply the time
limit to countries in sanctuary in addition to active countries.
Leave visitors alone, because those are shared logins.  Make the
disconnect message to a player consistent for all situations.

Note that commit 875a80d1 already changed player_main() to apply the
time limit only to active countries instead of all, just like status()
does, but neglected to document that.
2008-11-16 13:16:36 -05:00
Ron Koenderink
9fe6f7a406 Fix nat_timeused calculation on login
Broken in commit 875a80d.
2008-11-15 20:46:52 -06:00
Ron Koenderink
3da4030ac0 Prevent command from execute after game restrictions
If a player is at a prompt when either game hours
restrictions starts or logged in time limit is exceeded
the player is allow to enter one command.
2008-11-15 16:51:02 -06:00
fe69514067 Capital obliteration failed to charge money and report news
Commit 221e88f1 (v4.3.15) made caploss() expect the new owner in
sct_own, so it can distinguish between sack and obliteration.  Commit
0d139ee1 (v4.3.17) broke that in sct_prewrite(): it moved zapping the
sector owner after caploss(), and passed 0 instead of the old owner to
caploss().  Because of that, obliterating a capital didn't make the
news and didn't cost the victim money.  Fix that.
2008-11-15 17:40:48 -05:00
Ron Koenderink
2ce0a58a0d Update emptime.c.patch for commit cb0a373 2008-11-15 16:21:02 -06:00
cb0a373dff Don't call time() for nat_last_login, use player->curup 2008-11-15 15:59:29 -05:00
273875a68c Fix coding style and simplify seconds_since_midnight() a bit 2008-11-15 15:59:29 -05:00
f331432459 Clean up unused variable in status()
Unused since commit 875a80d1.
2008-11-15 15:59:29 -05:00
Ron Koenderink
875a80d14f Rewrite accounting of play time
Replace daychange() and gettimeleft() by update_timeused_login(),
update_timeused() and enforce_minimum_session_time().  The new
code doesn't assume the day is always 24 hours long which can
occur when transitioning into or out of DST and such.  Logging
in after more a multiple of 128 days now resets nat_timeused
properly.

Fix nat_timeused calculation on midnight rollover to include
the time since midnight.

struct natstr member nat_dayno and struct player member timeleft
are now unused, remove them.
2008-11-15 13:08:19 -06:00
Ron Koenderink
f46dc55254 Fix initialization of nat_last_logout
Broken in f94f81ee, v4.2.22.
2008-11-09 18:17:46 -06:00
Ron Koenderink
5054b26899 Fix parsing of 24:00 in game_hours and update_demandtimes
daytime() rejects 24:00 as invalid.  This makes daytime_range()
fail, is_daytime_allowed() ignore this and later ranges silently.
Broken in commit acdee1e3, v4.2.15.
2008-11-09 18:06:51 -06:00
b27298d4c5 New option RAILWAYS
With RAILWAYS, highway-like sectors double as rail.  They need to be
at least 5% efficient to be operational, and then they additionally
extend rail into adjacent sectors that are at least 60% efficient.

New opt_RAILWAYS, SCT_HAS_RAIL(), sct_rail_track().  Update
sector_mcost(), bp_neighbors(), lnd_mar_one_sector() for RAILWAYS
mobility rules.  Update sinfra(), spyline(), satdisp_sect() to show
rail track instead of rail infrastructure for RAILWAYS.

New virtual sector selector track, implemented by nsc_sct_track().
2008-11-01 11:40:15 -04:00
cacc393c53 Age che just like reserves (1% per 24 ETUs)
Factor aging out of age_levels() into new age_people().  Use it in
do_feed() to age che.
2008-11-01 11:37:35 -04:00
a090b7878a Permit ships to assault the sector they're in
Ships still have to be in a sea sector to assault an adjacent sector.
2008-10-28 19:35:51 -04:00
0bdb80c4c9 Don't produce food without work
We don't want to starve tiny populations, because that would require
players to move trivial amounts of food after explore and such.
growfood() used to simply grow at least 1f when a sector was about to
starve.  That food is almost never eaten by a tiny population, so we
effectively got some production without work.  Fix by taking away that
free food after people ate, in do_feed().
2008-10-28 19:35:51 -04:00
3376589007 New concept sector terrain
A sector type's terrain (struct dchrstr member d_terrain) is the
sector type of its underlying terrain.  Sector types occuring in
d_terrain are terrain types, and must have their own type in
d_terrain.  Players can change sector types only to those with the
same terrain.

The builtin configuration defines terrain types sea, mountain,
wasteland, wilderness and plains.  It gives bridge span and tower
terrain sea, and everything else terrain wilderness.  Hence, the stock
game remains unchanged.

Deities can use terrain to create sector types that can be developed
only in limited ways.
2008-10-28 19:35:51 -04:00
0d48dae06b Explicitly specify dependency output file with gcc -MF
Used to work without that, but somehow no longer does.
2008-10-28 19:27:23 -04:00
Ron Koenderink
14319b89ec Represent logged in time in seconds rather than minutes
This simplifies things.  In particular, it gets rid of random rounding
in getcommand(), which created a variation in the nightly build
depending on whether the update starts before or after the deity logs
out.

Replace struct natstr member nat_minused by nat_timeused, and update
cou_ca[] accordingly (this affects xdump nat).  Replace player member
minleft by timeleft, and getminleft() by gettimeleft().  Update
getcommand(), daychange(), player_main(), status() accordingly, taking
care not to change player output.  Change edit country key 'u' to work
in seconds.
2008-10-28 08:48:25 -06:00
Ron Koenderink
436328f641 Correct the emptime.c.patch for player.c
Broken in commit 122171b.
2008-10-26 21:12:10 -06:00
Ron Koenderink
122171b8d1 Add a time base for nightly builds
Increment the time base at the each update.
Remove the unnecessary patches that overrode
the timestamp printouts.
2008-10-26 15:59:43 -06:00
Ron Koenderink
4c8bb492a3 Add more tests to nightly builds
Add Player 02 as an ally for Player 01.
Add tests for telegrams, wall, announce, relationships,
land units, wire, fire, attack, planes, autofish and autooil.
2008-10-26 15:56:04 -06:00
69c20a2f7b Bump version to 4.3.19 2008-10-19 14:41:55 -04:00
5572686e32 Update change log for 4.3.18 2008-10-18 14:40:27 -04:00
c0c416b011 Oops when unit_carrier_change() arguments OLD or NEW are invalid 2008-10-18 14:21:45 -04:00