Angband
Data Structures | Macros | Functions | Variables
obj-randart.c File Reference

Random artifact generation. More...

#include "angband.h"
#include "effects.h"
#include "init.h"
#include "obj-desc.h"
#include "obj-make.h"
#include "obj-power.h"
#include "obj-randart.h"
#include "obj-slays.h"
#include "obj-tval.h"
#include "obj-util.h"
#include "randname.h"
#include "list-elements.h"

Data Structures

struct  element_type
 Describes an element-name pair. More...

Macros

#define ELEM(a, b, c, d, e, f, g, col)   {ELEM_##a, b},

Functions

void fake_pvals_to_mods (struct artifact *a)
void mods_to_fake_pvals (struct artifact *a)
static s32b artifact_power (int a_idx, bool translate)
 Return the artifact power, by generating a "fake" object based on the artifact, and calling the common object_power function.
static void store_base_power (void)
 Store the original artifact power ratings as a baseline.
static object_kindchoose_item (int a_idx)
 Randomly select a base item type (tval,sval).
static void do_mod (artifact_type *a_ptr)
 We've just added an ability which uses the pval bonus.
static void remove_contradictory (artifact_type *a_ptr)
 Clean up the artifact by removing illogical combinations of powers.
static void adjust_freqs (void)
 Adjust the parsed frequencies for any peculiarities of the algorithm.
static void parse_frequencies (void)
 Parse the list of artifacts and count up the frequencies of the various abilities.
static bool add_flag (artifact_type *a_ptr, int flag)
 Adds a flag to an artifact.
static bool add_resist (artifact_type *a_ptr, int element)
 Adds a resist to an artifact.
static void add_immunity (artifact_type *a_ptr)
 Adds an immunity to an artifact.
static void add_pval_mod (artifact_type *a_ptr, int mod)
 Adds a flag and pval to an artifact.
static bool add_fixed_pval_mod (artifact_type *a_ptr, int mod)
 Adds a flag and a pval to an artifact, but won't increase the pval if the flag is present.
static bool add_first_pval_mod (artifact_type *a_ptr, int mod)
 Adds a flag and an initial pval to an artifact.
static void add_stat (artifact_type *a_ptr)
 Adds a stat modifier, if possible.
static void add_sustain (artifact_type *a_ptr)
 Adds a sustain, if possible.
static void add_low_resist (artifact_type *a_ptr)
 Adds a low resist, if possible.
static void add_high_resist (artifact_type *a_ptr)
 Adds a high resist, if possible.
static void add_brand (artifact_type *a_ptr)
 Adds a brand, if possible.
static void add_slay (artifact_type *a_ptr)
 Adds a slay, if possible.
static void add_damage_dice (artifact_type *a_ptr)
 Adds one or two damage dice.
static void add_to_hit (artifact_type *a_ptr, int fixed, int random)
 Adds to_h, if not too high already.
static void add_to_dam (artifact_type *a_ptr, int fixed, int random)
 Adds to_d, if not too high already.
static void add_to_AC (artifact_type *a_ptr, int fixed, int random)
 Adds to_a, if not too high already.
static void add_weight_mod (artifact_type *a_ptr)
 Lowers weight.
static void add_activation (artifact_type *a_ptr, s32b target_power)
 Add an activation (called only if artifact does not yet have one)
static void build_freq_table (artifact_type *a_ptr, s16b *freq)
 Build a suitable frequency table for this item, based on the generated frequencies.
static int choose_ability (s16b *freq_table)
 Choose a random ability using weights based on the given cumulative frequency table.
static void add_ability_aux (artifact_type *a_ptr, int r, s32b target_power)
 Add an ability given by the index r.
static void add_ability (artifact_type *a_ptr, s32b target_power)
 Randomly select an extra ability to be added to the artifact in question.
static void try_supercharge (artifact_type *a_ptr, s32b target_power)
 Try to supercharge this item by running through the list of the supercharge abilities and attempting to add each in turn.
static void do_curse (artifact_type *a_ptr)
 Make it bad, or if it's already bad, make it worse!
static void scramble_artifact (int a_idx)
 Scramble an artifact.
static bool artifacts_acceptable (void)
 Return TRUE if the whole set of random artifacts meets certain criteria.
static errr scramble (void)
 Scramble each artifact.
char * artifact_gen_name (struct artifact *a, const char ***words)
 Use W.
static errr init_names (void)
 Initialise all the artifact names.
static errr do_randart_aux (bool full)
 Call the name allocation and artifact scrambling routines.
errr do_randart (u32b randart_seed, bool full)
 Randomize the artifacts.

Variables

static s16b art_idx_bow []
static s16b art_idx_weapon []
static s16b art_idx_nonweapon []
static s16b art_idx_melee []
static s16b art_idx_allarmor []
static s16b art_idx_boot []
static s16b art_idx_glove []
static s16b art_idx_headgear []
static s16b art_idx_shield []
static s16b art_idx_cloak []
static s16b art_idx_armor []
static s16b art_idx_gen []
static s16b art_idx_high_resist []
static s16b artprobs [ART_IDX_TOTAL]
static s16bbaseprobs
static s16b art_bow_total = 0
static s16b art_melee_total = 0
static s16b art_boot_total = 0
static s16b art_glove_total = 0
static s16b art_headgear_total = 0
static s16b art_shield_total = 0
static s16b art_cloak_total = 0
static s16b art_armor_total = 0
static s16b art_other_total = 0
static s16b art_total = 0
static s16b art_freq [ART_IDX_TOTAL]
static s16bbase_freq
static s16b mean_hit_increment = 4
static s16b mean_dam_increment = 4
static s16b mean_hit_startval = 10
static s16b mean_dam_startval = 10
static s16b mean_ac_startval = 15
static s16b mean_ac_increment = 5
static ang_filelog_file = NULL
static s32bbase_power
static s16b max_power
static s16b min_power
static s16b avg_power
static s16b var_power
static bytebase_item_level
static bytebase_item_prob
static bytebase_art_alloc
struct activationactivations
static int verbose = 1
int fake_pval [3] = {0, 0, 0}
static const element_type elements []
 Include the elements and names.

Detailed Description

Random artifact generation.

Copyright (c) 1998 Greg Wooledge, Ben Harrison, Robert Ruhlmann Copyright (c) 2001 Chris Carr, Chris Robertson

This work is free software; you can redistribute it and/or modify it under the terms of either:

a) the GNU General Public License as published by the Free Software Foundation, version 2, or

b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.

Original random artifact generator (randart) by Greg Wooledge. Updated by Chris Carr / Chris Robertson 2001-2010.

Macro Definition Documentation

#define ELEM (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  col 
)    {ELEM_##a, b},

Function Documentation

static void add_ability ( artifact_type a_ptr,
s32b  target_power 
)
static

Randomly select an extra ability to be added to the artifact in question.

References add_ability_aux(), add_flag(), art_freq, choose_ability(), artifact::modifiers, remove_contradictory(), and artifact::tval.

Referenced by scramble_artifact().

static void add_ability_aux ( artifact_type a_ptr,
int  r,
s32b  target_power 
)
static

Add an ability given by the index r.

This is mostly just a long case statement.

Note that this method is totally general and imposes no restrictions on appropriate item type for a given ability. This is assumed to have been done already.

References artifact::activation, add_activation(), add_brand(), add_damage_dice(), add_first_pval_mod(), add_fixed_pval_mod(), add_flag(), add_high_resist(), add_immunity(), add_low_resist(), add_pval_mod(), add_resist(), add_slay(), add_stat(), add_sustain(), add_to_AC(), add_to_dam(), add_to_hit(), add_weight_mod(), AGGR_POWER, ART_IDX_ALLARMOR_WEIGHT, ART_IDX_ARMOR_AC, ART_IDX_ARMOR_ALLRES, ART_IDX_ARMOR_CON, ART_IDX_ARMOR_HLIFE, ART_IDX_ARMOR_HRES, ART_IDX_ARMOR_LRES, ART_IDX_ARMOR_STEALTH, ART_IDX_BOOT_AC, ART_IDX_BOOT_FEATHER, ART_IDX_BOOT_SPEED, ART_IDX_BOOT_STEALTH, ART_IDX_BOW_BRAND, ART_IDX_BOW_MIGHT, ART_IDX_BOW_SHOTS, ART_IDX_BOW_SLAY, ART_IDX_CLOAK_AC, ART_IDX_CLOAK_STEALTH, ART_IDX_GEN_AC, ART_IDX_GEN_ACTIV, ART_IDX_GEN_ESP, ART_IDX_GEN_FA, ART_IDX_GEN_FEATHER, ART_IDX_GEN_HLIFE, ART_IDX_GEN_IMMUNE, ART_IDX_GEN_INFRA, ART_IDX_GEN_LIGHT, ART_IDX_GEN_LRES, ART_IDX_GEN_PSTUN, ART_IDX_GEN_RBLIND, ART_IDX_GEN_RCHAOS, ART_IDX_GEN_RCONF, ART_IDX_GEN_RDARK, ART_IDX_GEN_RDISEN, ART_IDX_GEN_REGEN, ART_IDX_GEN_RFEAR, ART_IDX_GEN_RLIGHT, ART_IDX_GEN_RNETHER, ART_IDX_GEN_RNEXUS, ART_IDX_GEN_RPOIS, ART_IDX_GEN_RSHARD, ART_IDX_GEN_RSOUND, ART_IDX_GEN_SDIG, ART_IDX_GEN_SEARCH, ART_IDX_GEN_SINV, ART_IDX_GEN_SPEED, ART_IDX_GEN_STAT, ART_IDX_GEN_STEALTH, ART_IDX_GEN_SUST, ART_IDX_GEN_TUNN, ART_IDX_GLOVE_AC, ART_IDX_GLOVE_DEX, ART_IDX_GLOVE_FA, ART_IDX_HELM_AC, ART_IDX_HELM_ESP, ART_IDX_HELM_INT, ART_IDX_HELM_RBLIND, ART_IDX_HELM_SINV, ART_IDX_HELM_WIS, ART_IDX_MELEE_AC, ART_IDX_MELEE_BLESS, ART_IDX_MELEE_BLOWS, ART_IDX_MELEE_BRAND, ART_IDX_MELEE_DICE, ART_IDX_MELEE_SINV, ART_IDX_MELEE_SLAY, ART_IDX_MELEE_TUNN, ART_IDX_MELEE_WEIGHT, ART_IDX_NONWEAPON_AGGR, ART_IDX_NONWEAPON_BLOWS, ART_IDX_NONWEAPON_BRAND, ART_IDX_NONWEAPON_DAM, ART_IDX_NONWEAPON_HIT, ART_IDX_NONWEAPON_HIT_DAM, ART_IDX_NONWEAPON_SHOTS, ART_IDX_NONWEAPON_SLAY, ART_IDX_SHIELD_AC, ART_IDX_SHIELD_LRES, ART_IDX_WEAPON_AGGR, ART_IDX_WEAPON_DAM, ART_IDX_WEAPON_HIT, fake_pval, mean_ac_increment, mean_dam_increment, mean_hit_increment, artifact::modifiers, and artifact::tval.

Referenced by add_ability().

static void add_activation ( artifact_type a_ptr,
s32b  target_power 
)
static

Add an activation (called only if artifact does not yet have one)

References angband_constants::act_max, artifact::activation, random::base, random::dice, file_putf(), i, max_power, MAX_TRIES, p, activation::power, randint0, random::sides, artifact::time, and z_info.

Referenced by add_ability_aux().

static void add_brand ( artifact_type a_ptr)
static

Adds a brand, if possible.

References append_random_brand(), artifact::brands, file_putf(), MAX_TRIES, and name.

Referenced by add_ability_aux().

static void add_damage_dice ( artifact_type a_ptr)
static

Adds one or two damage dice.

References artifact::dd, file_putf(), and randint1.

Referenced by add_ability_aux().

static bool add_first_pval_mod ( artifact_type a_ptr,
int  mod 
)
static

Adds a flag and an initial pval to an artifact.

Returns true when the flag was not present.

References do_mod(), fake_pval, FALSE, file_putf(), mod_name(), artifact::modifiers, randint1, and TRUE.

Referenced by add_ability_aux().

static bool add_fixed_pval_mod ( artifact_type a_ptr,
int  mod 
)
static

Adds a flag and a pval to an artifact, but won't increase the pval if the flag is present.

Returns true when changes were made.

References do_mod(), fake_pval, FALSE, file_putf(), mod_name(), artifact::modifiers, and TRUE.

Referenced by add_ability_aux(), and add_stat().

static bool add_flag ( artifact_type a_ptr,
int  flag 
)
static

Adds a flag to an artifact.

Returns true when changes were made.

References FALSE, file_putf(), flag_name(), artifact::flags, of_has, of_on, and TRUE.

Referenced by add_ability(), add_ability_aux(), add_high_resist(), and add_sustain().

static void add_high_resist ( artifact_type a_ptr)
static

Adds a high resist, if possible.

References add_flag(), add_resist(), art_idx_high_resist, artprobs, FALSE, i, MAX_TRIES, N_ELEMENTS, and randint1.

Referenced by add_ability_aux().

static void add_immunity ( artifact_type a_ptr)
static

Adds an immunity to an artifact.

Returns true when changes were made.

References artifact::el_info, file_putf(), randint0, and element_info::res_level.

Referenced by add_ability_aux().

static void add_low_resist ( artifact_type a_ptr)
static

Adds a low resist, if possible.

References add_resist(), artifact::el_info, ELEM_BASE_MIN, ELEM_HIGH_MIN, i, randint0, and element_info::res_level.

Referenced by add_ability_aux().

static void add_pval_mod ( artifact_type a_ptr,
int  mod 
)
static

Adds a flag and pval to an artifact.

Always attempts to increase the pval.

References do_mod(), fake_pval, file_putf(), mod_name(), and artifact::modifiers.

Referenced by add_ability_aux().

static bool add_resist ( artifact_type a_ptr,
int  element 
)
static

Adds a resist to an artifact.

Returns true when changes were made.

References artifact::el_info, FALSE, file_putf(), element_info::res_level, and TRUE.

Referenced by add_ability_aux(), add_high_resist(), and add_low_resist().

static void add_slay ( artifact_type a_ptr)
static

Adds a slay, if possible.

References append_random_slay(), file_putf(), MAX_TRIES, name, and artifact::slays.

Referenced by add_ability_aux().

static void add_stat ( artifact_type a_ptr)
static

Adds a stat modifier, if possible.

References add_fixed_pval_mod(), FALSE, artifact::modifiers, and randint0.

Referenced by add_ability_aux().

static void add_sustain ( artifact_type a_ptr)
static

Adds a sustain, if possible.

References add_flag(), FALSE, FLAG_END, artifact::flags, flags_test_all(), OF_SIZE, and randint0.

Referenced by add_ability_aux().

static void add_to_AC ( artifact_type a_ptr,
int  fixed,
int  random 
)
static

Adds to_a, if not too high already.

References file_putf(), HIGH_TO_AC, INHIBIT_STRONG, INHIBIT_WEAK, randint0, artifact::to_a, artifact::to_h, and VERYHIGH_TO_AC.

Referenced by add_ability_aux().

static void add_to_dam ( artifact_type a_ptr,
int  fixed,
int  random 
)
static

Adds to_d, if not too high already.

References file_putf(), HIGH_TO_DAM, INHIBIT_STRONG, INHIBIT_WEAK, randint0, artifact::to_d, artifact::to_h, and VERYHIGH_TO_DAM.

Referenced by add_ability_aux().

static void add_to_hit ( artifact_type a_ptr,
int  fixed,
int  random 
)
static

Adds to_h, if not too high already.

References file_putf(), HIGH_TO_HIT, INHIBIT_STRONG, INHIBIT_WEAK, randint0, artifact::to_h, and VERYHIGH_TO_HIT.

Referenced by add_ability_aux().

static void add_weight_mod ( artifact_type a_ptr)
static

Lowers weight.

References file_putf(), and artifact::weight.

Referenced by add_ability_aux().

static void adjust_freqs ( void  )
static

Adjust the parsed frequencies for any peculiarities of the algorithm.

For example, if stat bonuses and sustains are being added in a correlated fashion, it will tend to push the frequencies up for both of them. In this method we compensate for cases like this by applying corrective scaling.

References ART_IDX_BOW_BRAND, ART_IDX_BOW_MIGHT_SUPER, ART_IDX_BOW_SHOTS_SUPER, ART_IDX_BOW_SLAY, ART_IDX_GEN_AC, ART_IDX_GEN_AC_SUPER, ART_IDX_GEN_PSTUN, ART_IDX_GEN_RFEAR, ART_IDX_GEN_SPEED_SUPER, ART_IDX_GEN_TUNN, ART_IDX_MELEE_AC, ART_IDX_MELEE_BLOWS_SUPER, ART_IDX_MELEE_DICE_SUPER, ART_IDX_NONWEAPON_AGGR, ART_IDX_NONWEAPON_BLOWS, ART_IDX_NONWEAPON_BRAND, ART_IDX_NONWEAPON_SHOTS, ART_IDX_NONWEAPON_SLAY, ART_IDX_WEAPON_AGGR, and artprobs.

Referenced by parse_frequencies().

char* artifact_gen_name ( struct artifact a,
const char ***  words 
)
static s32b artifact_power ( int  a_idx,
bool  translate 
)
static

Return the artifact power, by generating a "fake" object based on the artifact, and calling the common object_power function.

References a_info, buf, fake_pvals_to_mods(), FALSE, file_putf(), make_fake_artifact(), mods_to_fake_pvals(), object_desc(), object_power(), ODESC_FULL, ODESC_PREFIX, ODESC_SPOIL, TRUE, and verbose.

Referenced by scramble_artifact(), and store_base_power().

static bool artifacts_acceptable ( void  )
static

Return TRUE if the whole set of random artifacts meets certain criteria.

Return FALSE if we fail to meet those criteria (which will restart the whole process).

References a_info, angband_constants::a_max, bodies, FALSE, file_putf(), i, strnfmt(), TRUE, verbose, and z_info.

Referenced by scramble().

static void build_freq_table ( artifact_type a_ptr,
s16b freq 
)
static

Build a suitable frequency table for this item, based on the generated frequencies.

The frequencies for any abilities that don't apply for this item type will be set to zero. First parameter is the artifact for which to generate the frequency table.

The second input parameter is a pointer to an array that the function will use to store the frequency table. The array must have size ART_IDX_TOTAL.

The resulting frequency table is cumulative for ease of use in the weighted randomization algorithm.

References art_idx_allarmor, art_idx_armor, art_idx_boot, art_idx_bow, art_idx_cloak, art_idx_gen, art_idx_glove, art_idx_headgear, art_idx_melee, art_idx_nonweapon, art_idx_shield, ART_IDX_TOTAL, art_idx_weapon, artprobs, file_putf(), i, N_ELEMENTS, and artifact::tval.

Referenced by scramble_artifact().

static int choose_ability ( s16b freq_table)
static

Choose a random ability using weights based on the given cumulative frequency table.

A pointer to the frequency array (which must be of size ART_IDX_TOTAL) is passed as a parameter. The function returns a number representing the index of the ability chosen.

References ART_IDX_TOTAL, file_putf(), and randint1.

Referenced by add_ability().

static object_kind* choose_item ( int  a_idx)
static
static void do_curse ( artifact_type a_ptr)
static

Make it bad, or if it's already bad, make it worse!

References fake_pval, artifact::flags, of_has, of_on, one_in_, artifact::to_a, artifact::to_d, and artifact::to_h.

Referenced by scramble_artifact().

static void do_mod ( artifact_type a_ptr)
static

We've just added an ability which uses the pval bonus.

Make sure it's not zero. If it's currently negative, leave it negative (heh heh).

References fake_pval, file_putf(), INHIBIT_STRONG, artifact::modifiers, one_in_, and randint1.

Referenced by add_first_pval_mod(), add_fixed_pval_mod(), and add_pval_mod().

errr do_randart ( u32b  randart_seed,
bool  full 
)
static errr do_randart_aux ( bool  full)
static

Call the name allocation and artifact scrambling routines.

References init_names(), and scramble().

Referenced by do_randart().

void fake_pvals_to_mods ( struct artifact a)
static errr init_names ( void  )
static
void mods_to_fake_pvals ( struct artifact a)
static void parse_frequencies ( void  )
static

Parse the list of artifacts and count up the frequencies of the various abilities.

This is used to give dynamic generation probabilities.

References a_info, angband_constants::a_max, artifact::activation, adjust_freqs(), art_armor_total, art_boot_total, art_bow_total, art_cloak_total, art_glove_total, art_headgear_total, art_idx_allarmor, ART_IDX_ALLARMOR_WEIGHT, art_idx_armor, ART_IDX_ARMOR_AC, ART_IDX_ARMOR_ALLRES, ART_IDX_ARMOR_CON, ART_IDX_ARMOR_HLIFE, ART_IDX_ARMOR_HRES, ART_IDX_ARMOR_LRES, ART_IDX_ARMOR_STEALTH, art_idx_boot, ART_IDX_BOOT_AC, ART_IDX_BOOT_FEATHER, ART_IDX_BOOT_SPEED, ART_IDX_BOOT_STEALTH, art_idx_bow, ART_IDX_BOW_MIGHT, ART_IDX_BOW_MIGHT_SUPER, ART_IDX_BOW_SHOTS, ART_IDX_BOW_SHOTS_SUPER, art_idx_cloak, ART_IDX_CLOAK_AC, ART_IDX_CLOAK_STEALTH, ART_IDX_GEN_AC, ART_IDX_GEN_AC_SUPER, ART_IDX_GEN_ACTIV, ART_IDX_GEN_ESP, ART_IDX_GEN_FA, ART_IDX_GEN_FEATHER, ART_IDX_GEN_HLIFE, ART_IDX_GEN_IMMUNE, ART_IDX_GEN_INFRA, ART_IDX_GEN_LIGHT, ART_IDX_GEN_LRES, ART_IDX_GEN_PSTUN, ART_IDX_GEN_RBLIND, ART_IDX_GEN_RCHAOS, ART_IDX_GEN_RCONF, ART_IDX_GEN_RDARK, ART_IDX_GEN_RDISEN, ART_IDX_GEN_REGEN, ART_IDX_GEN_RFEAR, ART_IDX_GEN_RLIGHT, ART_IDX_GEN_RNETHER, ART_IDX_GEN_RNEXUS, ART_IDX_GEN_RPOIS, ART_IDX_GEN_RSHARD, ART_IDX_GEN_RSOUND, ART_IDX_GEN_SDIG, ART_IDX_GEN_SEARCH, ART_IDX_GEN_SINV, ART_IDX_GEN_SPEED, ART_IDX_GEN_SPEED_SUPER, ART_IDX_GEN_STAT, ART_IDX_GEN_STEALTH, ART_IDX_GEN_SUST, ART_IDX_GEN_TUNN, art_idx_glove, ART_IDX_GLOVE_AC, ART_IDX_GLOVE_DEX, ART_IDX_GLOVE_FA, art_idx_headgear, ART_IDX_HELM_AC, ART_IDX_HELM_ESP, ART_IDX_HELM_INT, ART_IDX_HELM_RBLIND, ART_IDX_HELM_SINV, ART_IDX_HELM_WIS, art_idx_melee, ART_IDX_MELEE_AC, ART_IDX_MELEE_BLESS, ART_IDX_MELEE_BLOWS, ART_IDX_MELEE_BLOWS_SUPER, ART_IDX_MELEE_BRAND, ART_IDX_MELEE_DICE, ART_IDX_MELEE_DICE_SUPER, ART_IDX_MELEE_SINV, ART_IDX_MELEE_SLAY, ART_IDX_MELEE_TUNN, ART_IDX_MELEE_WEIGHT, art_idx_nonweapon, ART_IDX_NONWEAPON_AGGR, ART_IDX_NONWEAPON_BLOWS, ART_IDX_NONWEAPON_DAM, ART_IDX_NONWEAPON_HIT, ART_IDX_NONWEAPON_HIT_DAM, ART_IDX_NONWEAPON_SHOTS, art_idx_shield, ART_IDX_SHIELD_AC, ART_IDX_SHIELD_LRES, ART_IDX_TOTAL, art_idx_weapon, ART_IDX_WEAPON_AGGR, ART_IDX_WEAPON_DAM, ART_IDX_WEAPON_HIT, art_melee_total, art_shield_total, art_total, artprobs, base_freq, base_power, baseprobs, brand_count(), artifact::brands, object_kind::dd, artifact::dd, artifact::el_info, file_putf(), FLAG_END, artifact::flags, flags_test(), i, angband_constants::k_max, kf_has, object_kind::kidx, object_kind::kind_flags, lookup_kind(), MAXIMISE, mean_ac_increment, mean_ac_startval, mean_dam_increment, mean_dam_startval, mean_hit_increment, mean_hit_startval, MINIMISE, artifact::modifiers, N_ELEMENTS, artifact::name, of_has, OF_SIZE, randcalc(), element_info::res_level, slay_count(), artifact::slays, artifact::sval, object_kind::to_a, artifact::to_a, object_kind::to_d, artifact::to_d, object_kind::to_h, artifact::to_h, artifact::tval, verbose, object_kind::weight, artifact::weight, and z_info.

Referenced by do_randart().

static void remove_contradictory ( artifact_type a_ptr)
static

Clean up the artifact by removing illogical combinations of powers.

References fake_pval, artifact::flags, artifact::modifiers, of_has, and of_off.

Referenced by add_ability(), and scramble_artifact().

static errr scramble ( void  )
static

Scramble each artifact.

References angband_constants::a_max, artifacts_acceptable(), scramble_artifact(), and z_info.

Referenced by do_randart_aux().

static void scramble_artifact ( int  a_idx)
static
static void store_base_power ( void  )
static
static void try_supercharge ( artifact_type a_ptr,
s32b  target_power 
)
static

Variable Documentation

struct activation* activations
s16b art_armor_total = 0
static
s16b art_boot_total = 0
static
s16b art_bow_total = 0
static
s16b art_cloak_total = 0
static
s16b art_freq[ART_IDX_TOTAL]
static

Referenced by add_ability(), and scramble_artifact().

s16b art_glove_total = 0
static
s16b art_headgear_total = 0
static
s16b art_idx_allarmor[]
static
Initial value:

Referenced by build_freq_table(), and parse_frequencies().

s16b art_idx_armor[]
static
s16b art_idx_boot[]
static
s16b art_idx_bow[]
static
s16b art_idx_cloak[]
static
s16b art_idx_gen[]
static

Referenced by build_freq_table().

s16b art_idx_glove[]
static
s16b art_idx_headgear[]
static
s16b art_idx_high_resist[]
static
s16b art_idx_melee[]
static
s16b art_idx_nonweapon[]
static
s16b art_idx_shield[]
static
s16b art_idx_weapon[]
static
s16b art_melee_total = 0
static
s16b art_other_total = 0
static

Referenced by store_base_power().

s16b art_shield_total = 0
static
s16b art_total = 0
static
s16b artprobs[ART_IDX_TOTAL]
static
s16b avg_power
static
byte* base_art_alloc
static
s16b* base_freq
static
byte* base_item_level
static

Referenced by do_randart(), and store_base_power().

byte* base_item_prob
static
s32b* base_power
static
s16b* baseprobs
static

Referenced by do_randart(), and parse_frequencies().

const element_type elements[]
static

Include the elements and names.

int fake_pval[3] = {0, 0, 0}
ang_file* log_file = NULL
static

Referenced by object_power(), and object_value_real().

s16b max_power
static
s16b mean_ac_increment = 5
static
s16b mean_ac_startval = 15
static

Referenced by choose_item(), and parse_frequencies().

s16b mean_dam_increment = 4
static
s16b mean_dam_startval = 10
static

Referenced by choose_item(), and parse_frequencies().

s16b mean_hit_increment = 4
static
s16b mean_hit_startval = 10
static

Referenced by choose_item(), and parse_frequencies().

s16b min_power
static

Referenced by store_base_power().

s16b var_power
static

Referenced by store_base_power().

int verbose = 1
static