1 ##########################################################################
3 # Copyright (c) 2003 Aymargeddon Development Team
5 # This file is part of "Last days of Aymargeddon"
7 # Aymargeddon is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by the Free
9 # Software Foundation; either version 2 of the License, or (at your option)
12 # Aymargeddon is distributed in the hope that it will be useful, but WITHOUT
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 # You should have received a copy of the GNU General Public License along
17 # with this program; if not, write to the Free Software Foundation, Inc., 675
18 # Mass Ave, Cambridge, MA 02139, USA.
20 ###########################################################################
23 # TODO: seperate FROGS-config from Aymargeddon-config in different files
25 # change this file to configure your game
30 @::ISA = qw(Exporter);
31 @::EXPORT_OK = qw($conf);
35 -DB_SOURCE => 'mysql:RAGNAROEK',
36 -DB_USER => 'aymargeddon',
37 -DB_SECRETS => '/home/benni/aymargeddon/current/+secrets',
38 -COMMANDS => 'AymCommand.pm',
39 -GAME_NAME => 'Aymargeddon',
40 -DEFAULT_LANGUAGE => 'EN',
41 -LOG_TIME_IN_LOOP => 1000, # loops until next time output in log
45 -FULL_DEBUG_FILE => '/home/benni/aymargeddon/current/src/FROGS/+out',
46 -SCHEDULER_SLEEP => 2,
47 -DELETE_OLD_EVENTS => 1, # dont touch this, it will not work!
48 -DELETE_OLD_COMMANDS => 1, # dont touch this, it will not work!
49 -SEND_MESSAGE_TO_FIELD => 1, # set to 0 to stop slow messages
50 -MAX_ARGS => 4, # maximum arguments for localisation tags
51 # (hardcoded in database-structure)
54 # Aymargeddon stuff... you maybe dont need this for other games
59 -MAX_MOUNTAINS => 1, # mountains per god/earthling-combination
60 -MIN_DISTANCE_HOME => 3, # minimal distance between homecitys
61 -NEIGHBOUR_CITIES => 2, # number of citys in the neighbourhood of a home
62 -MIN_DISTANCE_MOUNTAIN => 2,
63 -WANTED_DISTANCE_MOUNTAIN => 3,
64 -MIN_DISTANCE_MOUNTAIN_FROM_WATER => 2,
67 -MANA_FOR_TEMPLE => 1,
68 -FORTUNE_FAKTOR_ISLAND => 1,
69 -FORTUNE_FAKTOR_MOUNTAIN => 2,
70 -MAX_UNBUILD_DESTROY => 1,
71 # -ARK_RETREAT_POSSIBILITY => 0.5, (in the moment hardcoded)
72 -WINNER_DEATH_COUNT_FRACTION => 5,
73 -LOOSER_DEATH_COUNT_FRACTION => 3,
74 -WINNER_AVATARS_DYING_FRACTION => 4,
75 -LOOSER_AVATARS_DYING_FRACTION => 2,
76 -DEATH_SHARE_ROW => [0.4, 0.3, 0.2, 0.1], # should sum to 1
77 -DEFAULT_DYING => 'KHP',
79 -PLAGUES => ['INFLUENZA','PESTILENTIA','TUBERCULOSIS'],
80 -PESTILENTIA_DEATH_SHARE => 0.5,
81 -SPREAD_PLAGUE => {'CITY' => 0.1,
88 # can gods give earthlings right to see?
89 -GODS_SHOW_EARTHLINGS => 0,
91 # which fields keep there owner without units?
92 -HOMECITY_KEEP_OWNER => 1,
93 -TEMPLE_KEEP_OWNER => 1,
94 -KEEP_OWNER => {'CITY' => 1},
96 # which fields fight without owner?
97 -FIGHTS_WITHOUT_OWNER => {'CITY' => 1},
99 # which fields fights without units?
100 #-HOMECITY_FIGHTS => 1,
101 #-FIGHTS_WITHOUT_UNIT => {'CITY' => 1},
109 # -MOVE_PROPHET => 6, # 12
111 -FIGHT_EARTHLING => 6,
112 -FIGHT_GOD => 10, #10
113 -BUILD_TEMPLE => 3, # 50
117 -PRODUCE_WARRIOR => 40, # 40
118 -PRODUCE_WARRIOR_HOME => 20, # 20
119 -PRODUCE_WARRIOR_CHANGE => 0,
120 -PRODUCE_PRIEST => 40, # 40
121 -PRODUCE_PRIEST_HOME => 40, # 40
122 -BUILD_ARK => 30, #30
132 -AVATAR => 4, # maximum
153 #-AVATAR => 4, # maximum
182 -NEUTRAL => '#b8a266',
186 # read password from secrets-file. password should not be included in source!
188 my $conf = $::conf->{-DB_SECRETS};
190 # substitute "~" (UNIX only!) from Perl Cookbook 7.3 not really useful
191 # here, because HOME is different in webserver and in user context
192 $conf =~ s{ ^ ~ ( [^/]* ) }{ $1 ? (getpwnam($1))[7] : ($ENV{HOME}||$ENV{LOGDIR}||
193 (getpwuid($<))[7])}ex;
195 open(CONFIG,$conf) or die "could not open config file $conf: $!\n";
201 $::conf->{-DB_PASSWD} = $_;
203 close CONFIG or die "could not close config file $conf: $!\n";