1 | /* |
1 | /* |
2 | * CrossFire, A Multiplayer game |
2 | * This file is part of Crossfire TRT, the Roguelike Realtime MORPG. |
3 | * |
3 | * |
4 | * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team |
4 | * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team |
5 | * Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
6 | * Copyright (C) 1992 Frank Tore Johansen |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
7 | * |
7 | * |
8 | * This program is free software; you can redistribute it and/or modify |
8 | * Crossfire TRT is free software: you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by |
9 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation; either version 2 of the License, or |
10 | * the Free Software Foundation, either version 3 of the License, or |
11 | * (at your option) any later version. |
11 | * (at your option) any later version. |
12 | * |
12 | * |
13 | * This program is distributed in the hope that it will be useful, |
13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. |
16 | * GNU General Public License for more details. |
17 | * |
17 | * |
18 | * You should have received a copy of the GNU General Public License |
18 | * You should have received a copy of the GNU General Public License |
19 | * along with this program; if not, write to the Free Software |
19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|
|
21 | * |
20 | * |
22 | * The authors can be reached via e-mail at <crossfire@schmorp.de> |
21 | * The authors can be reached via e-mail to <crossfire@schmorp.de> |
23 | */ |
22 | */ |
24 | |
23 | |
25 | #include <global.h> |
24 | #include <global.h> |
26 | #include <material.h> |
25 | #include <material.h> |
27 | #include <loader.h> |
26 | #include <loader.h> |
… | |
… | |
396 | mt = get_empty_mat (); |
395 | mt = get_empty_mat (); |
397 | materialt = mt; |
396 | materialt = mt; |
398 | |
397 | |
399 | for (;;) |
398 | for (;;) |
400 | { |
399 | { |
|
|
400 | thawer.next (); |
|
|
401 | |
401 | switch (thawer.get_kv ()) |
402 | switch (thawer.kw) |
402 | { |
403 | { |
403 | case KW_name: |
404 | case KW_name: |
404 | /* clean up the previous entry */ |
405 | /* clean up the previous entry */ |
405 | if (mt->next) |
406 | if (mt->next) |
406 | { |
407 | { |
… | |
… | |
947 | init_skills (); |
948 | init_skills (); |
948 | |
949 | |
949 | parse_args (argc, argv, 3); |
950 | parse_args (argc, argv, 3); |
950 | |
951 | |
951 | init_beforeplay (); |
952 | init_beforeplay (); |
952 | init_ericserver (); |
|
|
953 | init_done = 1; |
953 | init_done = 1; |
954 | } |
954 | } |
955 | |
955 | |
956 | void |
956 | void |
957 | usage (void) |
957 | usage (void) |
… | |
… | |
1012 | init_archetype_pointers (); /* Setup global pointers to archetypes */ |
1012 | init_archetype_pointers (); /* Setup global pointers to archetypes */ |
1013 | init_races (); /* overwrite race designations using entries in lib/races file */ |
1013 | init_races (); /* overwrite race designations using entries in lib/races file */ |
1014 | init_gods (); /* init linked list of gods from archs */ |
1014 | init_gods (); /* init linked list of gods from archs */ |
1015 | init_readable (); /* inits useful arrays for readable texts */ |
1015 | init_readable (); /* inits useful arrays for readable texts */ |
1016 | init_formulae (); /* If not called before, reads formulae from file */ |
1016 | init_formulae (); /* If not called before, reads formulae from file */ |
1017 | |
|
|
1018 | switch (settings.dumpvalues) |
|
|
1019 | { |
|
|
1020 | case 1: |
|
|
1021 | print_monsters (); |
|
|
1022 | exit (0); |
|
|
1023 | case 2: |
|
|
1024 | dump_abilities (); |
|
|
1025 | exit (0); |
|
|
1026 | case 3: |
|
|
1027 | dump_artifacts (); |
|
|
1028 | exit (0); |
|
|
1029 | case 4: |
|
|
1030 | dump_spells (); |
|
|
1031 | exit (0); |
|
|
1032 | case 5: |
|
|
1033 | exit (0); |
|
|
1034 | case 6: |
|
|
1035 | dump_races (); |
|
|
1036 | exit (0); |
|
|
1037 | case 7: |
|
|
1038 | dump_alchemy (); |
|
|
1039 | exit (0); |
|
|
1040 | case 9: |
|
|
1041 | dump_alchemy_costs (); |
|
|
1042 | exit (0); |
|
|
1043 | case 10: |
|
|
1044 | dump_monster_treasure (settings.dumparg); |
|
|
1045 | exit (0); |
|
|
1046 | } |
|
|
1047 | } |
1017 | } |
1048 | |
1018 | |
1049 | void |
1019 | void |
1050 | init_startup (void) |
1020 | init_startup (void) |
1051 | { |
1021 | { |
… | |
… | |
1281 | /* set creature race to race value */ |
1251 | /* set creature race to race value */ |
1282 | if ((mon = archetype::find (cp)) == NULL) |
1252 | if ((mon = archetype::find (cp)) == NULL) |
1283 | LOG (llevError, "Creature %s in race file lacks archetype\n", cp); |
1253 | LOG (llevError, "Creature %s in race file lacks archetype\n", cp); |
1284 | else |
1254 | else |
1285 | { |
1255 | { |
1286 | if (set_race && (!mon->clone.race || strcmp (mon->clone.race, race))) |
1256 | if (set_race && (!mon->race || strcmp (mon->race, race))) |
1287 | { |
1257 | { |
1288 | if (mon->clone.race) |
1258 | if (mon->race) |
1289 | LOG (llevDebug, "Resetting race to %s from %s for archetype %s\n", race, &mon->clone.race, &mon->name); |
1259 | LOG (llevDebug, "Resetting race to %s from %s for archetype %s\n", race, &mon->race, &mon->archname); |
1290 | |
1260 | |
1291 | mon->clone.race = race; |
1261 | mon->race = race; |
1292 | } |
1262 | } |
1293 | |
1263 | |
1294 | /* if the arch is a monster, add it to the race list */ |
1264 | /* if the arch is a monster, add it to the race list */ |
1295 | if (set_list && QUERY_FLAG (&mon->clone, FLAG_MONSTER)) |
1265 | if (set_list && QUERY_FLAG (mon, FLAG_MONSTER)) |
1296 | add_to_racelist (race, &mon->clone); |
1266 | add_to_racelist (race, mon); |
1297 | } |
1267 | } |
1298 | } |
1268 | } |
1299 | } |
1269 | } |
1300 | |
1270 | |
1301 | fclose (file); |
1271 | fclose (file); |
… | |
… | |
1310 | |
1280 | |
1311 | for (list = first_race; list; list = list->next) |
1281 | for (list = first_race; list; list = list->next) |
1312 | { |
1282 | { |
1313 | fprintf (stderr, "\nRACE %s:\t", &list->name); |
1283 | fprintf (stderr, "\nRACE %s:\t", &list->name); |
1314 | for (tmp = list->member; tmp; tmp = tmp->next) |
1284 | for (tmp = list->member; tmp; tmp = tmp->next) |
1315 | fprintf (stderr, "%s(%d), ", &tmp->ob->arch->name, tmp->ob->level); |
1285 | fprintf (stderr, "%s(%d), ", &tmp->ob->arch->archname, tmp->ob->level); |
1316 | } |
1286 | } |
1317 | |
1287 | |
1318 | fprintf (stderr, "\n"); |
1288 | fprintf (stderr, "\n"); |
1319 | } |
1289 | } |
1320 | |
1290 | |