Go to the documentation of this file.
68 if (
op->race != NULL) {
70 if (godname != NULL) {
97 return tmp->title != NULL ?
tmp->title :
"none";
115 return s2 != NULL && strcmp(s1, s2) == 0;
134 const char *given_by;
139 if (given_by == god->
name) {
146 "The %s crumble to dust!",
150 "The %s crumbles to dust!",
218 "%s lets %s appear in your hands.",
233 const uint64_t loss = angry * (skill->
stats.
exp / 10);
265 if (!
altar->other_arch)
274 if (!strcmp(pl_god->
name,
altar->other_arch->clone.name)) {
276 int bonus = (
pl->stats.Wis+skill->
level)/10;
279 if (
pl->stats.grace < 0)
280 pl->stats.grace += (bonus > -1*(
pl->stats.grace/10) ? bonus : -1*(
pl->stats.grace/10));
282 if (
pl->stats.grace < (2*
pl->stats.maxgrace)) {
283 pl->stats.grace += bonus/2;
285 if (
pl->stats.grace > (2*
pl->stats.maxgrace)) {
286 pl->stats.grace = (2*
pl->stats.maxgrace);
292 bonus =
MAX(1, bonus+
MAX(
pl->stats.luck, -3));
315 "Foul Priest! %s punishes you!",
321 "Foolish heretic! %s is livid!",
325 "Heretic! %s is angered!",
333 "A divine force pushes you off the altar.");
355 LOG(
llevError,
"BUG: remove_special_prayers(): god %s without randomitems\n", god->
name);
373 if (tr->
item == NULL)
389 "You lose knowledge of %s.",
447 "Fool! %s detests your kind!",
459 && tr->item->clone.invisible
461 && tr->item->clone.type !=
BOOK
462 && tr->item->clone.type !=
SPELL)
467 "You become a follower of %s!",
495 "%s's blessing is withdrawn from you.",
499 if (sk_applied || undeadified) {
541 "You are bathed in %s's aura.",
596 "You may use %s again.",
600 "You are forbidden to use %s.",
681 LOG(
llevError,
"BUG: determine_holy_arch(): no god or god without randomitems\n");
706 return item->other_arch;
743 "You feel like someone is helping you.");
757 if (difficulty < 1) {
758 LOG(
llevError,
"follower_level_to_enchantments(): difficulty %d is invalid\n", difficulty);
763 return level/difficulty;
765 return (20+(
level-20)/2)/difficulty;
766 return (30+(
level-40)/4)/difficulty;
792 "A phosphorescent glow envelops your weapon!");
833 "%s considers your %s is not worthy to be enchanted any more.",
847 const char *divine_owner =
object_get_value(weapon,
"divine_blessing_name");
849 object *skillop = NULL;
851 if (divine_owner != NULL && strcmp(divine_owner, god->
name) != 0) {
854 "Your %s already belongs to %s !",
855 weapon->
name, divine_owner);
859 if ((owner != NULL) && (strcmp(owner,
op->name) != 0)) {
862 "The %s is not yours, and is magically protected against such changes !",
867 if (skillop == NULL) {
868 LOG(
llevError,
"god_enchants_weapon: no praying skill object found ?!\n");
869 snprintf(
buf,
sizeof(
buf),
"%d", 1);
878 if (!weapon->
title) {
879 snprintf(
buf,
sizeof(
buf),
"of %s", god->
name);
884 "Your weapon quivers as if struck!");
891 "Your %s now hungers to slay enemies of your god!",
901 "Your weapon suddenly glows!");
930 LOG(
llevError,
"BUG: god_intervention(): no god or god without randomitems\n");
939 "You feel a holy presence!");
941 if (
altar->anim_suffix != NULL)
957 "Something appears before your eyes. You catch it before it falls to the ground.");
971 && strcmp(
item->name,
"grace limit") == 0) {
972 if (
op->stats.grace <
item->stats.grace
973 ||
op->stats.grace <
op->stats.maxgrace) {
989 && strcmp(
item->name,
"restore grace") == 0) {
990 if (
op->stats.grace >= 0)
994 "You are returned to a state of grace.");
1000 && strcmp(
item->name,
"restore hitpoints") == 0) {
1001 if (
op->stats.hp >=
op->stats.maxhp)
1004 "A white light surrounds and heals you!");
1005 op->stats.hp =
op->stats.maxhp;
1012 && strcmp(
item->name,
"restore spellpoints") == 0) {
1013 int max =
op->stats.maxsp*(
item->stats.maxsp/100.0);
1016 if (
op->stats.sp >=
max/2)
1019 "A blue lightning strikes your head but doesn't hurt you!");
1020 op->stats.sp = new_sp;
1025 && strcmp(
item->name,
"heal spell") == 0) {
1041 && strcmp(
item->name,
"remove curse") == 0) {
1050 && strcmp(
item->name,
"remove damnation") == 0) {
1059 && strcmp(
item->name,
"heal depletion") == 0) {
1062 "Shimmering light surrounds and restores you!");
1068 && strcmp(
item->name,
"voice_behind") == 0) {
1070 "You hear a voice from behind you, but you don't dare to "
1079 && strcmp(
item->name,
"message") == 0) {
1087 && strcmp(
item->name,
"enchant weapon") == 0) {
1102 "%s grants you use of a special prayer!",
1109 if (!
item->invisible) {
1119 "You feel rapture.");
1146 int loss = 10000000;
1147 int angry = abs(reaction);
1151 loss = 0.05*(float)skop->
stats.
exp;
1159 "%s becomes angry and punishes you!",
1190 snprintf(
buf,
sizeof(
buf),
"of %s", god->
name);
1191 if (!strcmp(
item->title,
buf))
1196 if (!strcmp(
item->title,
buf)) {
1202 "Heretic! You are using %s!",
1224 int caster_is_spell = 0;
1227 caster_is_spell = 1;
1237 if (!caster_is_spell)
1239 "This prayer is useless unless you worship an appropriate god");
1252 if (!caster_is_spell)
1267 if (spellop->
title) {
1270 snprintf(
buf,
sizeof(
buf),
"%s of %s", spellop->
name, spellop->
title);
static int god_removes_curse(object *op, int remove_damnation)
void object_free(object *ob, int flags)
sstring add_string(const char *str)
#define MSG_TYPE_SKILL_PRAY
void object_remove(object *op)
object * find_skill_by_number(object *who, int skillno)
int tailor_god_spell(object *spellop, object *caster)
#define QUERY_FLAG(xyz, p)
#define FLAG_REFL_MISSILE
void do_learn_spell(object *op, object *spell, int special_prayer)
static int same_string(const char *s1, const char *s2)
const char * determine_god(object *op)
#define MSG_TYPE_ATTRIBUTE
int move_player(object *op, int dir)
object * object_find_by_type_applied(const object *who, int type)
treasurelist * find_treasurelist(const char *name)
int64_t random_roll64(int64_t min, int64_t max, const object *op, int goodbad)
void create_treasure(treasurelist *t, object *op, int flag, int difficulty, int tries)
static void remove_special_prayers(object *op, const object *god)
int events_execute_object_event(object *op, int eventcode, object *activator, object *third, const char *message, int fix)
struct treasureliststruct * randomitems
const object * find_god(const char *name)
void cast_magic_storm(object *op, object *tmp, int lvl)
const char * object_get_value(const object *op, const char *const key)
void free_string(sstring str)
static int god_gives_present(object *op, const object *god, treasure *tr)
object * object_find_by_type_subtype(const object *who, int type, int subtype)
int cast_heal(object *op, object *caster, object *spell, int dir)
void link_player_skills(object *op)
const object * get_rand_god(void)
static int god_examines_item(const object *god, object *item)
void query_name(const object *op, char *buf, size_t size)
#define FLAG_KNOWN_CURSED
static int improve_weapon_magic(object *op, object *tr, object *weapon, object *skill)
int remove_depletion(object *op, int level)
static void stop_using_item(object *op, int type, int number)
void query_short_name(const object *op, char *buf, size_t size)
#define FREE_AND_COPY(sv, nv)
static int worship_forbids_use(object *op, object *exp_obj, uint32_t flag, const char *string)
static void god_intervention(object *op, const object *god, object *skill, object *altar)
static int god_enchants_weapon(object *op, const object *god, object *tr, object *skill)
struct archt * other_arch
int object_set_value(object *op, const char *key, const char *value, int add_key)
int rndm(int min, int max)
const char * get_god_for_race(const char *race)
static void follower_remove_given_items(object *pl, object *op, const object *god)
static int follower_has_similar_item(object *op, object *item)
void fix_generated_item(object *op, object *creator, int difficulty, int max_magic, int flags)
object * create_archetype(const char *name)
int random_roll(int min, int max, const object *op, int goodbad)
#define MSG_TYPE_ITEM_ADD
struct treasurestruct * items
int become_follower(object *op, const object *new_god)
void apply_anim_suffix(object *who, const char *suffix)
#define MSG_TYPE_ITEM_REMOVE
void LOG(LogLevel logLevel, const char *format,...)
object * create_archetype_by_object_name(const char *name)
static int follower_level_to_enchantments(int level, int difficulty)
object * check_spell_known(object *op, const char *name)
uint8_t personalized_blessings
archetype * determine_holy_arch(const object *god, const char *type)
#define MSG_TYPE_ATTRIBUTE_GOD
void esrv_update_item(int flags, object *pl, object *op)
#define CLEAR_FLAG(xyz, p)
#define SK_SUBTRACT_SKILL_EXP
int apply_special(object *who, object *op, int aflags)
void change_exp(object *op, int64_t exp, const char *skill_name, int flag)
object * object_insert_in_ob(object *op, object *where)
object * arch_to_object(archetype *at)
static bool try_leave_cult(object *pl, object *skill, int angry)
static void update_priest_flag(const object *god, object *exp_ob, uint32_t flag)
object * object_present_in_ob_by_name(int type, const char *str, const object *op)
struct treasurestruct * next
void pray_at_altar(object *pl, object *altar, object *skill)
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
void object_free_drop_inventory(object *ob)
archetype * get_archetype_by_type_subtype(int type, int subtype)
int cast_change_ability(object *op, object *caster, object *spell_ob, int dir, int silent)
#define MSG_TYPE_ITEM_CHANGE
static int god_examines_priest(object *op, const object *god)
#define MAX_WEAPON_ITEM_POWER
object * give_skill_by_name(object *op, const char *skill_name)
int change_abil(object *op, object *tmp)
void player_unready_range_ob(player *pl, object *ob)
int16_t resist[NROFATTACKS]
#define MSG_TYPE_ITEM_INFO
#define FOR_INV_PREPARE(op_, it_)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...)
object * object_get_owner(object *op)