68 size_t nmlen = strlen(name);
70 if (name && strcmp(name,
"none")) {
73 if (!strncmp(name, gl->
name,
MIN(strlen(gl->
name), nmlen)))
99 if (!strcmp(name, gl->
name))
132 if (op->
race != NULL) {
134 if (godname != NULL) {
164 for (tmp = op->
inv; tmp != NULL; tmp = tmp->
below)
193 return strcmp(s1, s2) == 0;
213 const char *given_by;
216 for (tmp = op->
inv; tmp != NULL; tmp = next) {
220 if (given_by == god->
name) {
227 "The %s crumble to dust!",
228 "The %s crumble to dust!",
232 "The %s crumbles to dust!",
233 "The %s crumbles to dust!",
255 for (tmp = op->
inv; tmp != NULL; tmp = tmp->
below) {
303 "%s lets %s appear in your hands.",
384 "Foul Priest! %s punishes you!",
385 "Foul Priest! %s punishes you!",
391 "Foolish heretic! %s is livid!",
392 "Foolish heretic! %s is livid!",
396 "Heretic! %s is angered!",
397 "Heretic! %s is angered!",
416 "A divine force pushes you off the altar.", NULL);
436 object *tmp, *next_tmp;
440 for (tmp = op->
inv; tmp; tmp = next_tmp) {
441 next_tmp = tmp->
below;
450 LOG(
llevError,
"BUG: check_special_prayers(): god %s without randomitems\n", god->
name);
462 if (tr->
item == NULL)
479 "You lose knowledge of %s.",
480 "You lose knowledge of %s.",
503 const object *old_god = NULL;
505 object *item, *skop, *next;
512 for (item = op->
inv; item != NULL; item = next) {
524 "You lose knowledge of %s.",
525 "You lose knowledge of %s.",
548 "Fool! %s detests your kind!",
549 "Fool! %s detests your kind!",
569 "You become a follower of %s!",
570 "You become a follower of %s!",
573 for (skop = op->
inv; skop != NULL; skop = skop->
below)
599 "%s's blessing is withdrawn from you.",
600 "%s's blessing is withdrawn from you.",
604 if (sk_applied || undeadified) {
646 "You are bathed in %s's aura.",
647 "You are bathed in %s's aura.",
702 "You may use %s again.",
703 "You may use %s again.",
707 "You are forbidden to use %s.",
708 "You are forbidden to use %s.",
731 for (tmp = op->
inv; tmp && number; tmp = tmp->
below)
789 LOG(
llevError,
"BUG: determine_holy_arch(): no god or god without randomitems\n");
806 count =
rndm(1, count);
836 for (tmp = op->
inv; tmp; tmp = tmp->
below) {
853 "You feel like someone is helping you.", NULL);
867 if (difficulty < 1) {
868 LOG(
llevError,
"follower_level_to_enchantments(): difficulty %d is invalid\n", difficulty);
873 return level/difficulty;
875 return (20+(level-20)/2)/difficulty;
876 return (30+(level-40)/4)/difficulty;
900 if (weapon->
magic < tmp) {
902 "A phosphorescent glow envelops your weapon!", NULL);
935 for (weapon = op->
inv; weapon; weapon = weapon->
below)
944 "%s considers your %s is not worthy to be enchanted any more.",
945 "%s considers your %s is not worthy to be enchanted any more.",
959 const char *divine_owner =
get_ob_key_value(weapon,
"divine_blessing_name");
961 object *skillop = NULL;
963 if (divine_owner != NULL) {
964 if (!strcmp(divine_owner, god->
name)) {
976 "Your %s already belongs to %s !",
977 "Your %s already belongs to %s !",
978 weapon->
name, divine_owner);
980 }
else if ((owner != NULL) && (!strcmp(owner, op->
name))) {
983 "The %s is not yours, and is magically protected against such changes !",
984 "The %s is not yours, and is magically protected against such changes !",
989 if (skillop == NULL) {
990 LOG(
llevError,
"god_enchants_weapon: no praying skill object found ?!\n");
991 snprintf(buf,
sizeof(buf),
"%d", 1);
1000 if (!weapon->
title) {
1006 "Your weapon quivers as if struck!", NULL);
1013 "Your %s now hungers to slay enemies of your god!",
1014 "Your %s now hungers to slay enemies of your god!",
1024 "Your weapon suddenly glows!", NULL);
1051 LOG(
llevError,
"BUG: god_intervention(): no god or god without randomitems\n");
1062 "You feel a holy presence!", NULL);
1077 "Something appears before your eyes. You catch it before it falls to the ground.",
1092 && strcmp(item->
name,
"grace limit") == 0) {
1110 && strcmp(item->
name,
"restore grace") == 0) {
1115 "You are returned to a state of grace.", NULL);
1121 && strcmp(item->
name,
"restore hitpoints") == 0) {
1125 "A white light surrounds and heals you!", NULL);
1133 && strcmp(item->
name,
"restore spellpoints") == 0) {
1140 "A blue lightning strikes your head but doesn't hurt you!", NULL);
1146 && strcmp(item->
name,
"heal spell") == 0) {
1162 && strcmp(item->
name,
"remove curse") == 0) {
1171 && strcmp(item->
name,
"remove damnation") == 0) {
1180 && strcmp(item->
name,
"heal depletion") == 0) {
1186 LOG(
llevError,
"Could not find archetype depletion.\n");
1193 "Shimmering light surrounds and restores you!", NULL);
1207 && strcmp(item->
name,
"voice_behind") == 0) {
1209 "You hear a voice from behind you, but you don't dare to "
1210 "turn around:", NULL);
1218 && strcmp(item->
name,
"message") == 0) {
1226 && strcmp(item->
name,
"enchant weapon") == 0) {
1241 "%s grants you use of a special prayer!",
1242 "%s grants you use of a special prayer!",
1260 "You feel rapture.", NULL);
1277 object *item = NULL, *skop;
1279 for (item = op->
inv; item; item = item->
below) {
1287 int loss = 10000000;
1288 int angry = abs(reaction);
1290 for (skop = op->
inv; skop != NULL; skop = skop->
below)
1295 loss = 0.05*(float)skop->stats.exp;
1303 "%s becomes angry and punishes you!",
1304 "%s becomes angry and punishes you!",
1336 if (!strcmp(item->
title, buf))
1341 if (!strcmp(item->
title, buf)) {
1347 "Heretic! You are using %s!",
1348 "Heretic! You are using %s!",
1369 const char *godname = NULL;
1396 int caster_is_spell = 0;
1399 caster_is_spell = 1;
1409 if (!caster_is_spell)
1411 "This prayer is useless unless you worship an appropriate god", NULL);
1424 if (!caster_is_spell)
1439 if (spellop->
title) {
int apply_special(object *who, object *op, int aflags)
archetype * find_archetype(const char *name)
static int improve_weapon_magic(object *op, object *tr, object *weapon, object *skill)
#define MSG_TYPE_ATTRIBUTE_GOD
const char * get_ob_key_value(const object *op, const char *const key)
int move_player(object *op, int dir)
void change_exp(object *op, sint64 exp, const char *skill_name, int flag)
object * check_spell_known(object *op, const char *name)
const char *const restore_msg[NUM_STATS]
archetype * determine_holy_arch(const object *god, const char *type)
void do_forget_spell(object *op, const char *spell)
int cast_change_ability(object *op, object *caster, object *spell_ob, int dir, int silent)
static int lookup_god_by_name(const char *name)
treasurelist * find_treasurelist(const char *name)
sint8 get_attr_value(const living *stats, int attr)
void free_string(sstring str)
void esrv_update_item(int flags, object *pl, object *op)
struct treasureliststruct * randomitems
void draw_ext_info(int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *message, const char *oldmessage)
static int worship_forbids_use(object *op, object *exp_obj, uint32 flag, const char *string)
object * create_archetype_by_object_name(const char *name)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8 type, uint8 subtype, const char *new_format, const char *old_format,...)
struct archt * other_arch
static void check_special_prayers(object *op, const object *god)
#define MSG_TYPE_ATTRIBUTE_BAD_EFFECT_END
void create_treasure(treasurelist *t, object *op, int flag, int difficulty, int tries)
object * give_skill_by_name(object *op, const char *skill_name)
int rndm(int min, int max)
#define MSG_TYPE_SKILL_PRAY
int change_abil(object *op, object *tmp)
void remove_ob(object *op)
static void follower_remove_given_items(object *pl, object *op, const object *god)
static int god_examines_priest(object *op, const object *god)
#define MSG_TYPE_ITEM_REMOVE
object * create_archetype(const char *name)
static void update_priest_flag(const object *god, object *exp_ob, uint32 flag)
int tailor_god_spell(object *spellop, object *caster)
static const char * get_god_for_race(const char *race)
#define MSG_TYPE_ITEM_INFO
#define MSG_TYPE_ATTRIBUTE
object * get_owner(object *op)
const char * determine_god(object *op)
#define MSG_TYPE_ITEM_CHANGE
static int follower_has_similar_item(object *op, object *item)
#define MAX_WEAPON_ITEM_POWER
const object * pntr_to_god_obj(godlink *godlnk)
object * present_in_ob_by_name(int type, const char *str, const object *op)
void do_learn_spell(object *op, object *spell, int special_prayer)
static void god_intervention(object *op, const object *god, object *skill)
static int god_examines_item(const object *god, object *item)
void player_unready_range_ob(player *pl, object *ob)
void cast_magic_storm(object *op, object *tmp, int lvl)
EXTERN godlink * first_god
static void stop_using_item(object *op, int type, int number)
#define QUERY_FLAG(xyz, p)
#define CLEAR_FLAG(xyz, p)
void fix_generated_item(object *op, object *creator, int difficulty, int max_magic, int flags)
object * insert_ob_in_ob(object *op, object *where)
static int god_removes_curse(object *op, int remove_damnation)
static int god_gives_present(object *op, const object *god, treasure *tr)
static int follower_level_to_enchantments(int level, int difficulty)
struct treasurestruct * items
void become_follower(object *op, const object *new_god)
sint16 resist[NROFATTACKS]
#define FLAG_KNOWN_CURSED
int snprintf(char *dest, int max, const char *format,...)
static int god_enchants_weapon(object *op, const object *god, object *tr, object *skill)
int cast_heal(object *op, object *caster, object *spell, int dir)
#define FREE_AND_COPY(sv, nv)
int set_ob_key_value(object *op, const char *key, const char *value, int add_key)
void free_object2(object *ob, int free_inventory)
archetype * get_archetype_by_type_subtype(int type, int subtype)
object * present_arch_in_ob(const archetype *at, const object *op)
void query_short_name(const object *op, char *buf, size_t size)
int execute_event(object *op, int eventcode, object *activator, object *third, const char *message, int fix)
sstring add_string(const char *str)
void link_player_skills(object *op)
int strcasecmp(const char *s1, const char *s2)
uint8 personalized_blessings
void LOG(LogLevel logLevel, const char *format,...)
static int same_string(const char *s1, const char *s2)
void query_name(const object *op, char *buf, size_t size)
#define SK_SUBTRACT_SKILL_EXP
object * find_skill_by_number(object *who, int skillno)
void free_object(object *ob)
int random_roll(int min, int max, const object *op, int goodbad)
sint64 random_roll64(sint64 min, sint64 max, const object *op, int goodbad)
struct treasurestruct * next
#define FLAG_REFL_MISSILE
void fix_object(object *op)
#define MSG_TYPE_ITEM_ADD
object * arch_to_object(archetype *at)
void pray_at_altar(object *pl, object *altar, object *skill)
const object * find_god(const char *name)