Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2000:
[Freeciv-Dev] Re: idea
Home

[Freeciv-Dev] Re: idea

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Lauri Tarkkala <ltarkkal@xxxxxxxxxxxxxxx>, freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: idea
From: Jeff Mallatt <jjm@xxxxxxxxxxxx>
Date: Thu, 10 Aug 2000 10:29:27 -0400

At 2000/08/09 06:50 , Lauri Tarkkala wrote:
[snip]
>I therefore am thinking of doing a patch which would add an optional
>rule like the following.
>
>The production value gained into building a wonder from a caravan
>would be 
>
>x = 25 + MAX(25,"points gained in gold/research upon establishment
>                 of hypotethical trade route");
[snip]
>Now I am curious, could some person more familiar with the Freeciv
>source please tell me where would be the "proper" way to 
>implement this option? 

This looks like a game-wide, miscellaneous rule.  So, it belongs in
game.ruleset.  Perhaps called something like "caravan_wonder_contrib".  It
might take one of three values: 1. "Disband" means it works like any other
unit (i.e., the "help build wonder" value is the same as the "disband"
value); 2. "Cost" means just what it says (i.e, to use the build cost, same
as Civ2 style caravans); 3. "Trade" means use your new formula (which
actually needs to use the unit type's build cost divided by 2, rather than
a hard-coded 25).

If you look at game.ruleset, you'll find existing optional rule controls.
Look at "nuke_contamination" for a good example of a tagged-value item.

So, just grep the entire source tree (except the po directory -- leave that
for the translators) for "nuke_contamination".  This will show you all the
places you need to change to support a new game.ruleset control.  And, at
this time, "nuke_contamination" is part of a "protocol extension"
controlled by the capability string -- so it's a good example of how to
handle optional protocol extensions.

jjm




[Prev in Thread] Current Thread [Next in Thread]