Crossfire Server, Branch 1.12  R12190
Data Structures | Defines | Typedefs | Enumerations
treasure.h File Reference

Defines and variables used by the artifact generation routines. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _change_arch
 when a treasure got cloned from archlist, we want perhaps change some default values. More...
struct  treasureliststruct
 treasureliststruct represents one logical group of items to be generated together. More...
struct  treasurestruct
 treasure is one element in a linked list, which together consist of a complete treasure-list. More...

Defines

#define CHANCE_FOR_ARTIFACT   20
 Chance an item becomes an artifact if not magic is 1 in this value.
#define DIFFLEVELS   201
 Maximum difficulty for difficulty/magic mapping.
#define MAX_SPELLITEM_LEVEL   110
 Highest level of rods/staves/scrolls to generate.
#define MAXMAGIC   4
 Maximum magic for difficulty/magic mapping.

Typedefs

typedef struct _change_arch _change_arch
 when a treasure got cloned from archlist, we want perhaps change some default values.
typedef struct treasurestruct treasure
 treasure is one element in a linked list, which together consist of a complete treasure-list.
typedef struct treasureliststruct treasurelist
 treasureliststruct represents one logical group of items to be generated together.

Enumerations

enum  {
  GT_ENVIRONMENT = 0x0001, GT_INVISIBLE = 0x0002, GT_STARTEQUIP = 0x0004, GT_APPLY = 0x0008,
  GT_ONLY_GOOD = 0x0010, GT_UPDATE_INV = 0x0020, GT_MINIMAL = 0x0040
}
 Flags to generate_treasures(): More...

Detailed Description

Defines and variables used by the artifact generation routines.

Definition in file treasure.h.


Define Documentation

#define CHANCE_FOR_ARTIFACT   20

Chance an item becomes an artifact if not magic is 1 in this value.

Definition at line 38 of file treasure.h.

Referenced by fix_generated_item().

#define DIFFLEVELS   201

Maximum difficulty for difficulty/magic mapping.

Definition at line 44 of file treasure.h.

Referenced by magic_from_difficulty().

#define MAX_SPELLITEM_LEVEL   110

Highest level of rods/staves/scrolls to generate.

Definition at line 47 of file treasure.h.

Referenced by level_for_item().

#define MAXMAGIC   4

Maximum magic for difficulty/magic mapping.

Definition at line 41 of file treasure.h.

Referenced by magic_from_difficulty().


Typedef Documentation

typedef struct _change_arch _change_arch

when a treasure got cloned from archlist, we want perhaps change some default values.

All values in this structure will override the default arch. TODO: It is a bad way to implement this with a special structure. Because the real arch list is a at runtime not changed, we can grap for example here a clone of the arch, store it in the treasure list and then run the original arch parser over this clone, using the treasure list as script until an END comes. This will allow ANY changes which is possible and we use ony one parser.

Todo:
is this still used somewhere in the maps/code??
typedef struct treasurestruct treasure

treasure is one element in a linked list, which together consist of a complete treasure-list.

Any arch can point to a treasure-list to get generated standard treasure when an archetype of that type is generated (from a generator)

treasureliststruct represents one logical group of items to be generated together.


Enumeration Type Documentation

anonymous enum

Flags to generate_treasures():

Todo:
document some flags.

Enumerator:
GT_ENVIRONMENT 

?

GT_INVISIBLE 

Unused?

GT_STARTEQUIP 

Generated items have the FLAG_STARTEQUIP.

GT_APPLY 

Monsters should apply generated item.

GT_ONLY_GOOD 

Don't generate bad/cursed items.

Used for new player's equipment.

GT_UPDATE_INV 

When object has been generated, send its information to player.

GT_MINIMAL 

Do minimal adjustments, don't make artifacts, and so on.

Definition at line 58 of file treasure.h.