29 object *applier,
int aflags);
47 object *applier,
int aflags) {
51 if (applier->type == PLAYER) {
60 if (applier->type == PLAYER && (potion->attacktype&
AT_DEPLETE)) {
70 "Your potion had no effect.");
77 if (applier->type == PLAYER && potion->attacktype&
AT_GODPOWER) {
78 for (i = 1; i <
MIN(11, applier->level); i++) {
80 if (applier->contr->levhp[i] != 1) {
81 applier->contr->levhp[i] = 1;
84 if (applier->contr->levsp[i] != 1) {
85 applier->contr->levsp[i] = 1;
88 if (applier->contr->levgrace[i] != 1) {
89 applier->contr->levgrace[i] = 1;
93 if (applier->contr->levhp[i] < 9) {
94 applier->contr->levhp[i] = 9;
97 if (applier->contr->levsp[i] < 6) {
98 applier->contr->levsp[i] = 6;
101 if (applier->contr->levgrace[i] < 3) {
102 applier->contr->levgrace[i] = 3;
108 if (i <
MIN(11, applier->level))
114 "The Gods smile upon you and remake you a little more in their image. " 115 "You feel a little more perfect.");
118 "The potion had no effect - you are already perfect");
123 "The Gods are angry and punish you.");
126 "You are fortunate that you are so pathetic.");
143 "Yech! Your lungs are on fire!");
150 cast_spell(applier, potion, applier->facing, potion->inv, NULL);
162 if (potion->resist[i]) {
165 memcpy(force->resist, potion->resist,
sizeof(potion->resist));
166 force->type = POTION_RESIST_EFFECT;
168 force->duration = 60;
180 force->duration *= 10;
182 if (force->resist[i] > 0)
183 force->resist[i] = -force->resist[i];
185 force->speed_left = -1;
197 if (potion->other_arch != NULL && applier->map != NULL) {
205 if (applier->type == PLAYER) {
207 && potion->value != 0)
213 "Nothing happened.");
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...)
void drain_stat(object *op)
#define MSG_TYPE_APPLY_FAILURE
void apply_handle_yield(object *tmp)
static method_ret potion_type_apply(ob_methods *context, object *potion, object *applier, int aflags)
#define EXPLODING_FIREBALL
void free_string(sstring str)
static const float MOVE_PER_SECOND
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
int change_abil(object *op, object *tmp)
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
object * object_insert_in_ob(object *op, object *where)
object * arch_to_object(archetype *at)
object * create_archetype(const char *name)
EXTERN const char *const change_resist_msg[NROFATTACKS]
void register_apply(int ob_type, apply_func method)
#define QUERY_FLAG(xyz, p)
#define CLEAR_FLAG(xyz, p)
void store_spell_expiry(object *spell)
#define object_decrease_nrof_by_one(xyz)
int remove_depletion(object *op, int level)
#define MSG_TYPE_APPLY_SUCCESS
sstring add_string(const char *str)
object * identify(object *op)
#define MSG_TYPE_APPLY_CURSED
void play_sound_map(int8_t sound_type, object *emitter, int dir, const char *action)
int random_roll(int min, int max, const object *op, int goodbad)
void init_type_potion(void)
void fix_object(object *op)
int cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg)