 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
16 #define _GNU_SOURCE // strcasestr() is a GNU extension in string.h
46 if (!op || !victim || !roll)
56 "But you have no free hands to steal with!");
78 roll -= equip->weight/10000;
81 roll -= equip->weight/5000;
83 roll -= equip->weight/2000;
86 roll -= equip->weight/5000;
88 roll -= equip->weight/100;
114 object *success = NULL, *tmp = NULL;
115 int roll = 0,
chance = 0, stats_value;
130 "Your attempt is prevented!");
145 "You can't steal from the dungeon master!");
150 "You can't steal from other players!");
170 || inv->type ==
SPELL
186 tag_t inv_count = inv->count;
207 "%s%s has nothing you can steal!",
217 if (roll >=
skill->level
230 "%s notices your attempted pilfering!",
244 snprintf(
buf,
sizeof(
buf),
"Your %s is missing!",
name);
246 snprintf(
buf,
sizeof(
buf),
"Your pack feels strangely lighter.");
252 snprintf(
buf,
sizeof(
buf),
"you feel itchy fingers getting at your pack.");
255 snprintf(
buf,
sizeof(
buf),
"%s looks very shifty.",
name);
263 return success ? 1 : 0;
308 if (tmp->
above == NULL)
357 int success = 0, number;
368 if (number < pl->
stats.Dex +
skill->level*2 - difficulty ) {
370 success = difficulty;
403 "There is no lock there.");
413 "There is no lock there.");
422 "You can't pick that lock!");
428 "The door has no lock!");
436 "You fail to pick the lock.");
441 "You pick the lock.");
502 "You don't need to hide while invisible!");
508 "Your attempt to hide breaks the invisibility spell!");
514 "You are as hidden as you can get.");
520 "You hide in the shadows.");
525 "You fail to conceal yourself.");
566 "Your bounce off the walls of %s.", trans_name);
591 for (i = 0; i <= spaces; i++) {
604 "Your jump is blocked.");
615 "You jump into %s%s.",
616 tmp->type ==
PLAYER ?
"" :
"the ", tmp->name);
667 int spaces = 0,
stats;
671 dex = dex ? dex : 15;
672 str = str ? str : 10;
683 else if (spaces == 0) {
685 "You are carrying too much weight to jump.");
815 uint32_t identified = 0;
816 for (uint32_t i = 0; i <
NROF(tmp); i++) {
818 if (skill_value >=
chance) {
823 if (identified == 0) {
829 if (identified <
NROF(tmp)) {
853 "The item has a story:\n%s",
875 int success = 0, area, i;
879 if (tmp->type == obj_class)
888 if (
skill->level > 64) {
890 }
else if (
skill->level > 16) {
892 }
else if (
skill->level > 4) {
898 for (i = 0; i < area; i++) {
910 if (tmp->type == obj_class)
929 int i, identifiable_types=0;
936 "You look at the objects nearby with your %s skill...",
skill->name);
938 switch (
skill->subtype) {
943 "...and discover cursed items!");
950 "...and discover items imbued with mystic forces!");
960 identifiable_types++;
964 if (identifiable_types == 0) {
965 LOG(
llevError,
"Error: skill_ident() called with skill %d which can't identify any items\n",
skill->subtype);
972 "...and learn nothing more.");
1014 "There is nothing to orate to.");
1024 if (tmp2->type ==
PLAYER)
1038 "There is nothing to orate to.");
1044 "You orate to the %s.",
1053 "Too bad the %s isn't listening!",
1062 "Your follower loves your speech.");
1073 "You convince the %s to follow you instead!",
1095 "You convince the %s to become your follower.",
1115 "Your speech angers the %s!",
1150 int i, exp = 0,
chance, mflags;
1180 if (tmp2->type ==
PLAYER) {
1211 "You calm down the %s",
1221 "Too bad the %s isn't listening!",
1241 int i, expsum = 0, mflags;
1249 for (i = 0; i < 9; i++) {
1267 if (tmp2->type ==
RUNE || tmp2->type ==
TRAP)
1270 if (tmp2->stats.Cha > 1) {
1277 tmp2->stats.Cha = 1;
1284 if (tmp->stats.Cha > 1) {
1296 "You search the area.");
1312 int i, success = 0, mflags;
1316 for (i = 0; i < 9; i++) {
1334 if ((tmp2->type ==
RUNE || tmp2->type ==
TRAP) && tmp2->stats.Cha <= 1) {
1339 tmp2->stats.exp = tmp2->stats.Cha*tmp2->level;
1348 if ((tmp->type ==
RUNE || tmp->type ==
TRAP) && tmp->stats.Cha <= 1) {
1353 tmp->stats.exp = tmp->stats.Cha*tmp->level;
1390 snprintf(
buf,
sizeof(
buf),
"You pray.");
1399 if (tmp->type ==
HOLY_ALTAR && tmp->other_arch) {
1400 snprintf(
buf,
sizeof(
buf),
"You pray over the %s.", tmp->name);
1439 "You can't concentrate while wielding a weapon!");
1451 "You can't concentrate while wearing so much armour!");
1491 object *newBook = NULL;
1496 "That was interesting...");
1504 "Hmm... what was I going to write?");
1512 "Trying to cheat now are we?");
1527 snprintf(
buf,
sizeof(
buf),
"%s%s\n", item->
msg, msg);
1529 snprintf(
buf,
sizeof(
buf),
"%s\n", msg);
1533 if (item->
nrof > 1) {
1551 "You write in the %s.",
buf);
1559 "Your message won't fit in the %s!",
buf);
1579 int success = 0, confused = 0, grace_cost = 0;
1580 object *newscroll, *chosen_spell, *tmp;
1585 "A spell must be written on a magic scroll!");
1592 if (!chosen_spell) {
1594 "You should ready the spell you wish to inscribe.");
1603 "You don't have enough grace to write a scroll of %s.",
1604 chosen_spell->
name);
1611 "You don't have enough mana to write a scroll of %s.",
1612 chosen_spell->
name);
1624 "Just the idea of writing a scroll of %s makes you sick!",
1635 "Oops! You accidently read it while trying to write on it.");
1656 if (scroll->
nrof > 1) {
1660 newscroll->
nrof = 1;
1671 "You succeed in writing a new scroll.");
1674 if (!chosen_spell) {
1680 "In your confused state, you write down some odd spell.");
1683 if (newscroll->
inv) {
1685 ninv = newscroll->
inv;
1706 if (newscroll == scroll) {
1718 success = success *
skill->level;
1723 if (chosen_spell->
level >
skill->level || confused) {
1726 "Ouch! Your attempt to write a new scroll strains your mind!");
1733 return -30 * chosen_spell->
level;
1738 "Your attempt to write a new scroll rattles your mind!");
1743 "You fail to write a new scroll.");
1764 const char *
string = params;
1784 "You must learn to read before you can write!");
1791 "You are unable to write while blind.");
1796 if (
string[0] !=
'\0') {
1806 "You haven't marked any items to write on yet.");
1813 "You had better pay for that before you write on it!");
1818 if (msgtype != item->
type) {
1821 "You must mark a %s to write %s.",
1822 msgtype ==
BOOK ?
"book" :
"magic scroll",
1823 msgtype ==
BOOK ?
"your message on" :
"your spell down");
1827 if (msgtype ==
BOOK) {
1829 }
else if (msgtype ==
SCROLL) {
1854 LOG(
llevError,
"find_throw_ob(): confused! have a NULL thrower!\n");
1855 return (
object *)NULL;
1871 if (tmp2->invisible)
1885 if (tmp2->race == race) {
1904 "You can't throw %s.",
1911 "The %s sticks to your hand!",
1916 LOG(
llevError,
"BUG: find_throw_ob(): couldn't unapply\n");
1923 "You should pay for the %s first.",
1929 LOG(
llevError,
"BUG: find_throw_ob(): object is locked\n");
1954 LOG(
llevError,
"BUG: make_throw_ob(): ob is applied\n");
1987 static int do_throw(
object *op,
object *part,
object *toss_item,
int dir,
object *
skill) {
1988 object *throw_ob = toss_item, *left = NULL;
1989 int eff_str = 0, str = op->
stats.
Str, dam = 0;
1990 int pause_f, weight_f = 0, mflags;
1991 float str_factor = 1.0, load_factor = 1.0, item_factor = 1.0;
1997 if (throw_ob == NULL) {
2000 "You have nothing to throw.");
2007 "The gods won't let you throw that.");
2012 tag = throw_ob->
count;
2049 load_factor =
MIN(load_factor, 1.0f);
2053 if (throw_ob->
weight > 0)
2058 "You can't throw %s.",
2063 eff_str = str*load_factor;
2064 eff_str = (float)eff_str*item_factor*str_factor;
2095 "Your load is so heavy you drop %s to the ground.",
2100 "You throw %s at the ground.",
2104 "Something is in the way.");
2115 if (throw_ob == NULL) {
2132 throw_ob = toss_item;
2133 if (throw_ob->
skill)
2162 throw_ob->
last_sp = (eff_str*3)/5;
2185 throw_ob->
last_sp += eff_str/3;
2206 throw_ob->
speed *= 0.8;
2211 if (throw_ob->
weight > 500)
2212 throw_ob->
speed *= 0.8;
2213 if (throw_ob->
weight > 50)
2214 throw_ob->
speed *= 0.5;
2220 if (throw_ob->
last_sp > eff_str)
2230 pause_f = ((2*eff_str)/3)+20+
skill->level;
2255 tag = throw_ob->
count;
#define object_was_destroyed(op, old_tag)
Checks if an object still exists.
bool object_value_set(const object *op, const char *const key)
Determine if an extra value is set.
#define GET_MAP_OB(M, X, Y)
Gets the bottom object on a map.
#define UP_OBJ_FACE
Only thing that changed was the face.
#define M_LEATHER
Leather.
object * object_get_owner(object *op)
Returns the object which this object marks as being the owner.
#define FREE_OBJ_NO_DESTROY_CALLBACK
Do not run the destroy callback.
struct Settings settings
Server settings.
void object_update_turn_face(object *op)
If an object with the IS_TURNABLE() flag needs to be turned due to the closest player being on the ot...
#define FOR_MAP_FINISH()
Finishes FOR_MAP_PREPARE().
void remove_friendly_object(object *op)
Removes the specified object from the linked list of friendly objects.
int16_t maxhp
Max hit points.
#define FLAG_CONFUSED
Will also be unable to cast spells.
@ llevError
Error, serious thing.
uint16_t difficulty
What level the player should be to play here.
#define AP_NO_MERGE
Don't try to merge object after (un)applying it.
uint32_t path_attuned
Paths the object is attuned to.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
#define FLAG_UNDEAD
Monster is undead.
int singing(object *pl, int dir, object *skill)
Singing skill handling.
void drain_specific_stat(object *op, int deplete_stats)
Drain a specified stat from op.
int monster_can_detect_enemy(object *op, object *enemy, rv_vector *rv)
Determine if we can 'detect' the enemy.
void esrv_map_scroll(socket_struct *ns, int dx, int dy)
object * inv
Pointer to the first object in the inventory.
static object * find_throw_ob(object *op, sstring race)
Find an object to throw.
#define FLAG_STARTEQUIP
Object was given to player at start.
object * find_random_spell_in_ob(object *ob, const char *skill)
This returns a random spell from 'ob'.
#define MSG_TYPE_SKILL
Messages related to skill use.
#define QUERY_FLAG(xyz, p)
void confuse_living(object *op, object *hitter, int dam)
Confuse a living thing.
object * object_merge(object *op, object *top)
This function goes through all objects below and including top, and merges op to the first matching o...
void make_visible(object *op)
Makes an object visible again.
#define MSG_TYPE_ATTRIBUTE_GOOD_EFFECT_END
End of a good effect.
int8_t item_power
Power rating of the object.
struct archetype * arch
Pointer to archetype.
uint16_t attack_movement
What kind of attack movement.
@ SK_DET_MAGIC
Detect magic.
#define FOR_BELOW_PREPARE(op_, it_)
Constructs a loop iterating over all objects below an object.
float speed
Frequency of object 'moves' relative to server tick rate.
#define M_ORGANIC
General organic.
int16_t invisible
How much longer the object will be invis.
void spring_trap(object *trap, object *victim)
This function generalizes attacks by runes/traps.
object * transport
Transport the player is in.
float speed_left
How much speed is left to spend this round.
struct mapstruct * map
Pointer to the map in which this object is present.
int use_oratory(object *pl, int dir, object *skill)
Oratory skill handling.
int identifyskill
Skill used to identify this object class.
void object_set_owner(object *op, object *owner)
Sets the owner and sets the skill and exp pointers to owner's current skill and experience objects.
#define MSG_TYPE_ATTRIBUTE
Changes to attributes (stats, resistances, etc)
static int do_throw(object *op, object *part, object *toss_item, int dir, object *skill)
Op throws any object toss_item.
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
int detect_magic_on_item(object *pl, object *tmp, object *skill)
Runs a 'detect magic' check on a given item.
@ SKILL
Also see SKILL_TOOL (74) below.
int8_t direction
Means the object is moving that way.
tag_t count
Unique object number for this object.
#define BODY_ARMS
This should be the index of the arms.
int16_t last_grace
As last_sp, except for grace.
void object_copy(const object *src_ob, object *dest_ob)
Copy object first frees everything allocated by the second object, and then copies the contents of th...
static int do_skill_detect_magic(object *pl, object *skill)
Check for magic object with the 'detect magic' skill.
void fix_object(object *op)
Updates all abilities given by applied objects in the inventory of the given object.
uint32_t hidden
If True, player (DM) is hidden from view.
int rndm(int min, int max)
Returns a number between min and max.
uint8_t hide
The object is hidden, not invisible.
int pray(object *pl, object *skill)
Praying skill handling.
#define FLAG_INV_LOCKED
Item will not be dropped from inventory.
int apply_manual(object *op, object *tmp, int aflag)
Main apply handler.
#define FOR_OB_AND_ABOVE_FINISH()
Finishes FOR_OB_AND_ABOVE_PREPARE().
#define P_IS_ALIVE
Something alive is on this space.
#define FLAG_APPLIED
Object is ready for use by living.
int16_t level
Level of creature or object.
int events_execute_object_event(object *op, int eventcode, object *activator, object *third, const char *message, int fix)
Execute an event on the specified object.
object * object_insert_in_ob(object *op, object *where)
This function inserts the object op in the linked list inside the object environment.
object * above
Pointer to the object stacked above this one.
#define HUGE_BUF
Used for messages - some can be quite long.
#define MSG_TYPE_VICTIM
Something bad is happening to the player.
int find_traps(object *pl, object *skill)
Checks for traps on the spaces around the player or in certain objects.
void cast_dust(object *op, object *throw_ob, int dir)
Handles op throwing objects of type 'DUST'.
Plugin animator file specs[Config] name
#define FOR_BELOW_FINISH()
Finishes FOR_BELOW_PREPARE().
uint32_t path_denied
Paths the object is denied access to.
#define FOR_OB_AND_ABOVE_PREPARE(op_)
Constructs a loop iterating over an object and all objects above it in the same pile.
int32_t carrying
How much weight this object contains.
Link an object type with skill needed to identify, and general name.
void remove_door(object *op)
Remove non locked doors.
uint32_t path_repelled
Paths the object is repelled from.
int16_t y
Position in the map for this object.
static event_registration m
void object_update(object *op, int action)
object_update() updates the array which represents the map.
struct player * contr
Pointer to the player which control this object.
static uint32_t NROF(const object *const ob)
Returns ob->nrof, unless it is 0, in which case return 1.
#define object_decrease_nrof_by_one(xyz)
int32_t last_heal
Last healed.
uint8_t subtype
Subtype of object.
#define FLAG_WAS_WIZ
Player was once a wiz.
short freearr_y[SIZEOFFREE]
Y offset when searching around a spot.
static object * make_throw_ob(object *orig)
We construct the 'carrier' object in which we will insert the object that is being thrown.
const typedata * get_typedata(int itemtype)
object * monster_find_throw_ob(object *op)
Find an item for the monster to throw.
int pick_lock(object *pl, int dir, object *skill)
Lock pick handling.
void query_name(const object *op, char *buf, size_t size)
Describes an item.
int can_see_monsterP(mapstruct *m, int x, int y, int dir)
Recursive routine to see if we can find a path to a certain point.
#define MOVE_WALK
Object walks.
#define FLAG_KNOWN_CURSED
The object is known to be cursed.
object * ranges[range_size]
Object for each range.
#define EVENT_TRIGGER
Button pushed, lever pulled, etc.
int64_t calc_skill_exp(const object *who, const object *op, const object *skill)
Calculates amount of experience can be gained for successful use of a skill.
object clone
An object from which to do object_copy()
@ SK_DET_CURSE
Detect curse.
sstring add_string(const char *str)
This will add 'str' to the hash table.
#define FOR_OB_AND_BELOW_FINISH()
Finishes FOR_OB_AND_BELOW_PREPARE().
#define HEAD(op)
Returns the head part of an object.
MoveType move_type
Type of movement this object uses.
void query_short_name(const object *op, char *buf, size_t size)
query_short_name(object) is similar to query_name(), but doesn't contain any information about object...
#define FLAG_BLIND
If set, object cannot see (visually)
#define MSG_TYPE_ITEM
Item related information.
sstring find_string(const char *str)
Searches a string in the shared strings.
#define FLAG_MAKE_INVIS
(Item) gives invisibility when applied
int32_t value
How much money it is worth (or contains)
int is_identified(const object *op)
Return true if the item is identified, either because it is of a type that doesn't ever need identifi...
char * ob_describe(const object *op, const object *observer, int use_media_tags, char *buf, size_t size)
Returns the description of an object, as seen by the given observer.
int isqrt(int n)
Compute the square root.
void object_update_speed(object *op)
Updates the speed of an object.
#define FREE_AND_COPY(sv, nv)
Release the shared string if not NULL, and make it a reference to nv.
uint32_t tmp_invis
Will invis go away when we attack?
uint8_t type
PLAYER, BULLET, etc.
#define FLAG_DAMNED
The object is very cursed.
int16_t dam
How much damage this object does when hitting.
int8_t magic
Any magical bonuses to this item.
int hide(object *op, object *skill)
Main hide handling.
static int adj_stealchance(object *op, object *victim, int roll)
Computes stealing chance.
static int attempt_pick_lock(object *door, object *pl, object *skill)
Attempt to pick a lock.
int trap_disarm(object *disarmer, object *trap, int risk, object *skill)
Try to disarm a trap/rune.
void object_free(object *ob, int flags)
Frees everything allocated by an object, removes it from the list of used objects,...
#define GET_MAP_MOVE_BLOCK(M, X, Y)
Gets the blocking state of a square.
#define FOR_INV_FINISH()
Finishes FOR_INV_PREPARE().
#define INS_BELOW_ORIGINATOR
Insert new object immediately below originator.
MoveType move_on
Move types affected moving on to this space.
int32_t food
How much food in stomach.
#define MSG_TYPE_SKILL_MISSING
Don't have the skill.
#define FLAG_UNAGGRESSIVE
Monster doesn't attack players.
uint32_t tag_t
Object tag, unique during the whole game.
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
int skill_throw(object *op, object *part, int dir, object *skill)
Throwing skill handling.
#define EVENT_THROW
Object is thrown.
#define FLAG_NO_STEAL
Item can't be stolen.
#define FOR_OB_AND_BELOW_PREPARE(op_)
Constructs a loop iterating over an object and all objects below it in the same pile.
int16_t SP_level_spellpoint_cost(object *caster, object *spell, int flags)
Scales the spellpoint cost of a spell by it's increased effectiveness.
int random_roll(int min, int max, const object *op, int goodbad)
Roll a random number between min and max.
int8_t facing
Object is oriented/facing that way.
int get_dam_bonus(int stat)
int skill_ident(object *pl, object *skill)
Main identification skill handling.
#define FLAG_SPLITTING
Object splits into stats.food other objs.
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
Same as object_insert_in_map() except it handle separate coordinates and do a clean job preparing mul...
#define FLAG_MONSTER
Will attack players.
object * find_skill_by_name(object *who, const char *name)
This returns the skill pointer of the given name (the one that accumulates exp, has the level,...
#define FLAG_HITBACK
Object will hit back when hit.
#define MSG_TYPE_VICTIM_STEAL
Someone tried to steal from the player.
int get_dex_bonus(int stat)
#define P_OUT_OF_MAP
This space is outside the map.
#define MAX_BUF
Used for all kinds of things.
object * object_new(void)
Grabs an object from the list of unused objects, makes sure it is initialised, and returns it.
uint32_t get_weight_limit(int stat)
int32_t weight
Attributes of the object.
void free_string(sstring str)
This will reduce the refcount, and if it has reached 0, str will be freed.
int8_t wc
Weapon Class, lower WC increases probability of hitting.
int trap_show(object *trap, object *where)
Handles showing a trap/rune detonation.
#define MOVE_FLY_LOW
Low flying object.
int16_t maxgrace
Maximum grace.
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
Constructs a loop iterating over all objects of a map tile.
#define FLAG_KNOWN_MAGICAL
The object is known to be magical.
#define OUT_OF_REAL_MAP(M, X, Y)
Checks if a square is out of the map.
static void stop_jump(object *pl)
End of jump.
int identify_object_with_skill(object *tmp, object *pl, object *skill, int print_on_success)
Helper function for do_skill_ident, so that we can loop over inventory AND objects on the ground conv...
int allow_denied_spells_writing
If set, players can write spells they can't cast.
#define FLAG_WIZ
Object has special privilegies.
#define MSG_TYPE_SKILL_ERROR
Doing something wrong.
int hideability(object *ob)
Look at the surrounding terrain to determine the hideability of this object.
#define NDI_UNIQUE
Print immediately, don't buffer.
#define FLAG_FRIENDLY
Will help players.
sstring name
The name of the object, obviously...
method_ret ob_process(object *op)
Processes an object, giving it the opportunity to move or react.
#define MSG_TYPE_SKILL_FAILURE
Failure in using skill.
static int attempt_steal(object *op, object *who, object *skill)
Steal objects.
int steal(object *op, int dir, object *skill)
Main stealing function.
@ OBJECT_TYPE_MAX
Try to find a fire/heat source to light this when applied.
int get_thaco_bonus(int stat)
int object_can_pick(const object *who, const object *item)
Finds out if an object can be picked up.
void add_friendly_object(object *op)
Add a new friendly object to the list of friendly objects.
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
This rolls up wall, blocks_magic, blocks_view, etc, all into one function that just returns a P_.
#define MSG_TYPE_ITEM_REMOVE
Item removed from inv.
int16_t maxsp
Max spell points.
int is_magical(const object *op)
Checks whether object is magical.
object * env
Pointer to the object which is the environment.
static int write_note(object *pl, object *item, const char *msg)
Called by write_on_item() to inscribe a message in an ordinary book.
int32_t last_sp
As last_heal, but for spell points.
const typedef char * sstring
void monster_npc_call_help(object *op)
A monster calls for help against its enemy.
sstring skill
Name of the skill this object uses/grants.
object * object_split(object *orig_ob, uint32_t nr, char *err, size_t size)
object_split(ob,nr) splits up ob into two parts.
int check_pick(object *op)
Sees if there is stuff to be picked up/picks up stuff, for players only.
float get_speed_bonus(int stat)
void object_set_msg(object *op, const char *msg)
Set the message field of an object.
void esrv_update_item(int flags, object *pl, object *op)
Updates object *op for player *pl.
#define FLAG_REFLECTING
Object reflects from walls (lightning)
uint8_t max_stat
Maximum stat value - 255 should be sufficient.
sstring msg
If this is a book/sign/magic mouth/etc.
This is used by get_rangevector to determine where the other creature is.
#define BOOK_BUF
Maximum message buf size for books.
#define CLEAR_FLAG(xyz, p)
int apply_special(object *who, object *op, int aflags)
Apply an object.
#define NUM_ANIMATIONS(ob)
int die_roll(int num, int size, const object *op, int goodbad)
Roll a number of dice (2d3, 4d6).
#define SCRIPT_FIX_ACTIVATOR
Player Stats effect how well a character can survie and interact inside the crossfire world This section discusses the various stats
int write_on_item(object *pl, const char *params, object *skill)
Implement the 'inscription' skill, which checks for the required skills and marked items before runni...
int detect_curse_on_item(object *pl, object *tmp, object *skill)
Runs a 'detect curse' check on a given item.
partylist * party
Party this player is part of.
int identifyskill2
Second skill used to identify this object class.
void meditate(object *pl, object *skill)
Meditation skill handling.
int8_t body_info[NUM_BODY_LOCATIONS]
Body info as loaded from the file.
int book_overflow(const char *buf1, const char *buf2, size_t booksize)
Checks if buf1 and buf2 can be combined.
archetype * get_archetype_by_type_subtype(int type, int subtype)
Retrieves an archetype by type and subtype.
void object_remove(object *op)
This function removes the object op from the linked list of objects which it is currently tied to.
int trap_see(object *op, object *trap)
Should op see trap?
#define FLAG_UNPAID
Object hasn't been paid for yet.
#define OB_TYPE_MOVE_BLOCK(ob1, type)
Basic macro to see if if ob1 can not move onto a space based on the 'type' move_block parameter Add c...
static int write_scroll(object *pl, object *scroll, object *skill)
Called by write_on_item() to inscribe spell scrolls that the player can cast.
static int attempt_jump(object *pl, int dir, int spaces, object *skill)
Someone is trying to jump.
static int do_skill_detect_curse(object *pl, object *skill)
Check for cursed object with the 'detect curse' skill.
static int do_skill_ident(object *pl, int obj_class, object *skill)
Workhorse for skill_ident() -b.t.
uint32_t nrof
Number of objects.
socket_struct * socket
Socket information for this player.
#define PETMOVE
If the upper four bits of attack_movement are set to this number, the monster follows a player until ...
int8_t body_used[NUM_BODY_LOCATIONS]
Calculated value based on items equipped.
bool chance(int a, int b)
Return true with a probability of a/b.
uint8_t no_player_stealing
If 1, can not steal from other players.
living stats
Str, Con, Dex, etc.
#define MSG_TYPE_SKILL_SUCCESS
Successfully used skill.
#define AP_UNAPPLY
Item is to be remvoed.
int stand_near_hostile(object *who)
Determine if who is standing near a hostile creature.
short freearr_x[SIZEOFFREE]
X offset when searching around a spot.
#define FLAG_IS_CAULDRON
container can make alchemical stuff
#define FLAG_CHANGING
Changes to other_arch when anim is done.
#define FLAG_READY_WEAPON
(Monster or Player) has a weapon readied
#define FLAG_NO_SKILL_IDENT
If set, item cannot be identified w/ a skill.
#define FLAG_CURSED
The object is cursed.
int jump(object *pl, int dir, object *skill)
Jump skill handling.
void pick_up(object *op, object *alt)
Try to pick up an item.
#define FLAG_IS_THROWN
Object is designed to be thrown.
#define FLAG_SLEEP
NPC is sleeping.
uint16_t material
What materials this object consist of.
#define MSG_TYPE_ITEM_INFO
Information related to items.
object * find_marked_object(object *op)
Return the object the player has marked with the 'mark' command below.
MoveType move_block
What movement types this blocks.
#define FOR_INV_PREPARE(op_, it_)
Constructs a loop iterating over the inventory of an object.
@ llevDebug
Only for debugging purposes.
int remove_trap(object *op, object *skill)
This skill will disarm any previously discovered trap.
#define FLAG_IDENTIFIED
Player knows full info about item.
void skill_attack(object *tmp, object *pl, int dir, const char *string, object *skill)
Core routine for use when we attack using a skills system.
#define FREE_PLAYER_LOAD_PERCENT
void pray_at_altar(object *pl, object *altar, object *skill)
Player prays at altar.
static int attempt_hide(object *op, object *skill)
Someone is trying to hide.
object * identify(object *op)
Identifies an item.