ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/treasure.C
(Generate patch)

Comparing deliantra/server/common/treasure.C (file contents):
Revision 1.115 by root, Fri Feb 3 02:04:11 2012 UTC vs.
Revision 1.121 by root, Sat Nov 17 23:40:00 2018 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2017,2018 Marc Alexander Lehmann / the Deliantra team
4 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 5 * Copyright (©) 2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2002 Mark Wedel & Crossfire Development Team 6 * Copyright (©) 2002 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992 Frank Tore Johansen 7 * Copyright (©) 1992 Frank Tore Johansen
7 * 8 *
8 * Deliantra is free software: you can redistribute it and/or modify it under 9 * Deliantra is free software: you can redistribute it and/or modify it under
9 * the terms of the Affero GNU General Public License as published by the 10 * the terms of the Affero GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your 11 * Free Software Foundation, either version 3 of the License, or (at your
11 * option) any later version. 12 * option) any later version.
12 * 13 *
13 * This program is distributed in the hope that it will be useful, 14 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details. 17 * GNU General Public License for more details.
17 * 18 *
18 * You should have received a copy of the Affero GNU General Public License 19 * You should have received a copy of the Affero GNU General Public License
19 * and the GNU General Public License along with this program. If not, see 20 * and the GNU General Public License along with this program. If not, see
20 * <http://www.gnu.org/licenses/>. 21 * <http://www.gnu.org/licenses/>.
21 * 22 *
22 * The authors can be reached via e-mail to <support@deliantra.net> 23 * The authors can be reached via e-mail to <support@deliantra.net>
23 */ 24 */
24 25
25/* TREASURE_DEBUG does some checking on the treasurelists after loading. 26/* TREASURE_DEBUG does some checking on the treasurelists after loading.
26 * It is useful for finding bugs in the treasures file. Since it only 27 * It is useful for finding bugs in the treasures file. Since it only
34//#define TREASURE_VERBOSE 35//#define TREASURE_VERBOSE
35 36
36#include <global.h> 37#include <global.h>
37#include <treasure.h> 38#include <treasure.h>
38 39
40#include <flat_hash_map.hpp>
41
39extern char *spell_mapping[]; 42extern char *spell_mapping[];
40 43
41static treasurelist *first_treasurelist; 44static treasurelist *first_treasurelist;
42 45
43static void change_treasure (treasure *t, object *op); /* overrule default values */ 46static void change_treasure (treasure *t, object *op); /* overrule default values */
44 47
45typedef std::tr1::unordered_map< 48typedef ska::flat_hash_map<
46 const char *, 49 const char *,
47 treasurelist *, 50 treasurelist *,
48 str_hash, 51 str_hash,
49 str_equal, 52 str_equal,
50 slice_allocator< std::pair<const char *const, treasurelist *> > 53 slice_allocator< std::pair<const char *const, treasurelist *> >
51> tl_map_t; 54> tl_map_t;
52 55
53static tl_map_t tl_map; 56static tl_map_t tl_map;
54 57
55//TODO: class method 58//TODO: class method
490 { 0, 0, 0, 3, 97}, // 29 493 { 0, 0, 0, 3, 97}, // 29
491 { 0, 0, 0, 0, 100}, // 30 494 { 0, 0, 0, 0, 100}, // 30
492 { 0, 0, 0, 0, 100}, // 31 495 { 0, 0, 0, 0, 100}, // 31
493}; 496};
494 497
495/* calculate the appropriate level for wands staves and scrolls. 498/* calculate the appropriate level for wands staves and scrolls.
496 * This code presumes that op has had its spell object created (in op->inv) 499 * This code presumes that op has had its spell object created (in op->inv)
497 * 500 *
498 * elmex Wed Aug 9 17:44:59 CEST 2006: 501 * elmex Wed Aug 9 17:44:59 CEST 2006:
499 * Removed multiplicator, too many high-level items were generated on low-difficulty maps. 502 * Removed multiplicator, too many high-level items were generated on low-difficulty maps.
500 */ 503 */
808 * order to set it up right. This produced magical bonuses, puts spells 811 * order to set it up right. This produced magical bonuses, puts spells
809 * into scrolls/books/wands, makes it unidentified, hides the value, etc. 812 * into scrolls/books/wands, makes it unidentified, hides the value, etc.
810 */ 813 */
811 814
812/* 4/28/96 added creator object from which op may now inherit properties based on 815/* 4/28/96 added creator object from which op may now inherit properties based on
813 * op->type. Right now, which stuff the creator passes on is object type 816 * op->type. Right now, which stuff the creator passes on is object type
814 * dependant. I know this is a spagetti manuever, but is there a cleaner 817 * dependant. I know this is a spagetti manuever, but is there a cleaner
815 * way to do this? b.t. */ 818 * way to do this? b.t. */
816 819
817/* 820/*
818 * ! (flags & GT_ENVIRONMENT): 821 * ! (flags & GT_ENVIRONMENT):
819 * Automatically calls fix_flesh_item(). 822 * Automatically calls fix_flesh_item().

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines