 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
35 static void slow_living(
object *op,
object *hitter,
int dam);
40 static void poison_living(
object *op,
object *hitter,
int dam);
42 object *op,
object *hitter,
int dam, uint32_t attacknum);
80 if (op->
material & (*mt)->material) {
105 int i, roll, saves = 0,
attacks = 0, number;
136 if (op->
resist[number] == 100)
140 else if ((20-mt->
save[number])/3 > originator->
stats.
dam)
207 int x = op->
x, y = op->
y;
220 if (op->
map == NULL) {
228 "You are expelled from the %s during its destruction.",
230 inv->contr->transport = NULL;
240 if (inv->type ==
RUNE)
245 object *badguy =
blame(originator);
246 if (badguy != NULL) {
309 "Despite the flame, you feel nothing.");
318 env->stats.hp -= dam;
320 if (
env->stats.hp < 0)
417 if (tmp->map != map || tmp->x != x || tmp->y != y)
443 else if ((tmp->material || tmp->materialname) && op->
stats.
dam > 0 && !tmp->move_block) {
539 snprintf(buf1,
MAX_BUF,
"hit");
540 snprintf(buf2,
MAX_BUF,
"hits");
570 if (dam == 9998 && op->
type ==
DOOR) {
572 snprintf(buf2,
MAX_BUF,
" unlocks");
577 snprintf(buf2,
MAX_BUF,
" hits");
582 snprintf(buf2,
MAX_BUF,
" misses");
586 snprintf(buf1,
MAX_BUF,
"hit");
587 snprintf(buf2,
MAX_BUF,
"hits");
632 && ((owner != NULL ? owner : hitter)->
type) ==
PLAYER) {
634 snprintf(
buf,
sizeof(
buf),
"%s's %s%s you.", owner->
name, hitter->name, buf2);
636 snprintf(
buf,
sizeof(
buf),
"%s%s you.", hitter->name, buf2);
643 if (hitter->type ==
PLAYER) {
644 snprintf(
buf,
sizeof(
buf),
"You %s.", buf1);
647 }
else if (owner != NULL && owner->
type ==
PLAYER) {
668 }
else if (
rndm(0, 5) != 0)
673 hitter->name, buf2, op->
name);
689 int *simple_attack) {
691 LOG(
llevError,
"BUG: get_attack_mode(): freed object\n");
694 *target =
HEAD(*target);
695 *hitter =
HEAD(*hitter);
696 if ((*hitter)->env != NULL || (*target)->env != NULL) {
702 || (*hitter)->map == NULL
704 LOG(
llevError,
"BUG: hitter (arch %s, name %s) with no relation to target\n", (*hitter)->arch->name, (*hitter)->name);
724 static int abort_attack(
object *target,
object *hitter,
int simple_attack) {
727 if (hitter->
env == target || target->
env == hitter)
735 return new_mode != simple_attack;
768 int simple_attack, roll, dam;
770 tag_t op_tag, hitter_tag;
771 const char *anim_suffix = NULL;
792 anim_suffix =
"attack";
798 hitter_tag = hitter->
count;
825 if (roll >= 20 || op->
stats.
ac >= wc-roll) {
830 "You attacked and lost your spell!");
836 "You were hit and lost your spell!");
839 "%s was hit by %s and lost a spell.",
844 if (!simple_attack) {
862 "You were hit by a wild attack. You are no longer hidden!");
892 "You are splashed by acid!\n");
915 "The %s arrests you!", hitter->
name);
938 hitter =
HEAD(hitter);
980 object *container, *hitter;
981 int hit_something = 0;
982 tag_t victim_tag, hitter_tag, container_tag;
983 int16_t victim_x, victim_y;
985 const char *old_skill = NULL;
1011 container_tag = container->
count;
1015 victim_x = victim->
x;
1016 victim_y = victim->
y;
1017 victim_map = victim->
map;
1018 victim_tag = victim->
count;
1019 hitter_tag = hitter->
count;
1031 if (container != NULL) {
1032 old_skill = hitter->
skill;
1050 if (container != NULL) {
1052 hitter->
skill = old_skill;
1058 if (hit_something && op->
speed <= 10.0) {
1060 if (container == NULL) {
1085 if (victim_x != hitter->
x || victim_y != hitter->
y) {
1097 if (hit_something && op->
speed >= 10.0)
1195 int exp_to_drain = op->
stats.
exp/rate;
1201 exp_to_drain =
MIN(exp_to_drain,
1205 if (exp_to_drain <= 1) {
1232 exp_to_drain = orig_exp - op->
stats.
exp;
1235 if (owner && owner != hitter) {
1273 int doesnt_slay = 1;
1278 LOG(
llevError,
"hit_with_one_attacktype: Invalid attacknumber passed: %u\n", attacknum);
1283 LOG(
llevError,
"hit_with_one_attacktype called with negative damage: %d\n", dam);
1315 dam *= (100-op->
resist[attacknum]);
1327 if (op->
resist[attacknum] >= 100
1334 switch (attacknum) {
1406 if (!(tmp->material&
M_IRON))
1408 if (tmp->magic < -4)
1410 if (tmp->type ==
RING
1414 || tmp->type ==
WAND
1415 || tmp->type ==
ROD)
1426 "The %s's acid corrodes your %s!",
1427 name_hitter, name_op);
1477 LOG(
llevError,
"%s was hit by %s with non-specific chaos.\n", name_op, name_hitter);
1516 int dam_modifier = is_wraith ? 200 : 3000;
1532 new_hp = hitter->
stats.
hp+dam;
1535 if (new_hp > hitter->
stats.
hp)
1555 #ifdef PARTY_KILL_LOG
1556 void party_add_kill(
partylist *party,
const char *killer,
const char *dead,
long exp);
1592 object *owner = NULL;
1593 const object *skop = NULL;
1634 "Your pet, the %s, is killed by %s.",
1671 time_t
t =
time(NULL);
1676 tmv = localtime(&
t);
1677 strftime(
buf,
sizeof(
buf),
"%a %b %d %H:%M:%S %Y", tmv);
1688 if (owner != hitter) {
1694 "You killed %s with %s.",
1717 if (pk == 1 && !battleg)
1733 LOG(
llevError,
"kill_object - unable to find skill that killed monster\n");
1747 if (owner != hitter) {
1749 const char *owner_prefix;
1750 const char *op_prefix;
1752 owner_prefix = !battleg && pk && owner->
contr != NULL && !owner->
contr->
peaceful ?
"hostile " :
"";
1753 op_prefix = !battleg && pk && op->
contr != NULL && !op->
contr->
peaceful ?
"hostile " :
"";
1757 snprintf(kill_message,
sizeof(kill_message),
"%s%s killed %s%s with %s%s.", owner_prefix, owner->
name, op_prefix, name_op, name_hitter, battleg ?
" (duel)" : (pk ?
" (pk)" :
""));
1759 const char *hitter_prefix;
1760 const char *op_prefix;
1762 hitter_prefix = !battleg && pk && hitter->
contr != NULL && !hitter->
contr->
peaceful ?
"hostile " :
"";
1763 op_prefix = !battleg && pk && op->
contr != NULL && !op->
contr->
peaceful ?
"hostile " :
"";
1765 snprintf(kill_message,
sizeof(kill_message),
"%s%s killed %s%s%s%s.", hitter_prefix, hitter->
name, op_prefix, op->
name,
1767 " in hand to hand combat" :
"", battleg ?
" (duel)" : (pk ?
" (pk)" :
""));
1790 "Your foe has fallen!\nVICTORY!!!");
1813 #ifdef PARTY_KILL_LOG
1862 hitter =
HEAD(hitter);
1870 if (owner != NULL) {
1881 return friendlyfire;
1909 int maxattacktype, attacknum;
1910 int body_attack = op->
head != NULL;
1912 tag_t op_tag, hitter_tag;
1932 hitter_tag = hitter->
count;
1951 if (!simple_attack && op->
type ==
DOOR) {
1983 dam = (dam > (
rndm(0, 99))) ? 1 : 0;
2006 && god->race != NULL
2011 maxattacktype =
type;
2012 for (attacknum = 0; attacknum <
NROFATTACKS; attacknum++) {
2015 attacktype = 1<<attacknum;
2029 if (
type&attacktype) {
2034 if (ndam >= maxdam) {
2036 maxattacktype = 1<<attacknum;
2040 if (attacktype ==
AT_DEATH && ndam > 0)
2058 if (friendlyfire && maxdam) {
2069 unsigned int area = 0;
2070 for (at = op->
arch; at != NULL; at = at->
more)
2075 unsigned int remainder = 100*(maxdam%area)/area;
2077 if (
RANDOM()%100 < remainder)
2086 if (owner != NULL) {
2087 if (op->
enemy != hitter)
2090 if (op->
enemy == NULL ||
rndm(1, 20) == 0)
2208 "You suddenly feel very ill.");
2222 "Your %s poisons %s.",
2245 else if (tmp->
stats.
exp > -speed_penalty) {
2285 if (speed_penalty < 1)
2287 else if (speed_penalty > 30)
2293 "The world suddenly moves very fast!");
2298 "The world moves even faster!");
2344 "You suddenly feel very confused!");
2359 object *tmp, *owner;
2386 "Your attack blinds %s!",
2423 "You limbs stop moving!");
2454 int atk_lev, def_lev, kill_lev, lev_mult = 1;
2472 def_lev = op->
level;
2495 kill_lev = (atk_lev - def_lev) * lev_mult * (100 - op->
resist[
ATNR_DEATH]) / 100;
2507 *dam *= kill_lev/def_lev;
2531 switch (hitter->
type) {
2567 object *attacker = hitter;
2571 if (!target || !hitter || !hitter->
map || !target->
map || !
on_same_map(hitter, target)) {
2572 LOG(
llevError,
"BUG: adj_attackroll(): hitter and target not on same map\n");
2579 if (attacker == NULL)
uint8_t casting_time
It takes awhile to cast a spell.
#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.
static int did_make_save_item(object *op, int type, object *originator)
Checks to make sure the item actually made its saving throw based on the tables.
static uint8_t get_attack_message_type(int type, const object *op, const object *hitter)
Figure the Attack types ATM_xxx type for an attack.
#define UP_OBJ_FACE
Only thing that changed was the face.
object * object_get_owner(object *op)
Returns the object which this object marks as being the owner.
#define EVENT_ATTACKS
Weapon or arrow hitting something.
static void deathstrike_living(object *op, object *hitter, int *dam)
Attempts to kill 'op'.
static void cancellation(object *op)
Cancels object *op.
#define ATNR_CANCELLATION
struct Settings settings
Global settings.
uint8_t simple_exp
If true, use the simple experience system.
#define INS_NO_WALK_ON
Don't call check_walk_on against the originator.
#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.
static int stick_arrow(object *op, object *tmp)
Try to put an arrow in inventory.
uint32_t weapontype
Type of weapon.
#define FLAG_CONFUSED
Will also be unable to cast spells.
object * find_applied_skill_by_name(const object *op, const char *name)
Find a skill by name using the last_skill_ob list.
static int abort_attack(object *target, object *hitter, int simple_attack)
Check if target and hitter are still in a relation similar to the one determined by get_attack_mode()...
@ llevError
Error, serious thing.
#define FABS(x)
Decstations have trouble with fabs()...
@ EVENT_CONNECTOR
Lauwenmark: an invisible object holding a plugin event hook.
#define MSG_TYPE_ADMIN_PLAYER
Player coming/going/death.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
#define FLAG_UNDEAD
Monster is undead.
archetype * more
Next part of a linked object.
#define FLAG_GENERATOR
Will generate type ob->stats.food.
int monster_stand_in_light(object *op)
Cache monster_stand_in_light_internal().
object * inv
Pointer to the first object in the inventory.
#define EVENT_DEATH
Player or monster dead.
uint32_t golem_count
To track the golem.
int hit_player(object *op, int dam, object *hitter, uint32_t type, int full_hit)
Object is attacked by something.
#define QUERY_FLAG(xyz, p)
object * map_find_by_archetype(mapstruct *m, int x, int y, const archetype *at)
Searches for any objects with a matching archetype at the given map and coordinates.
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.
int op_on_battleground(object *op, int *x, int *y, archetype **trophy)
Check if the given object (usually a player) is standing on a battleground tile.
struct archetype * arch
Pointer to archetype.
#define MSG_TYPE_ATTACK_DID_HIT
Player hit something else.
float speed
Frequency of object 'moves' relative to server tick rate.
void object_set_enemy(object *op, object *enemy)
Sets the enemy of an object.
int16_t invisible
How much longer the object will be invis.
uint32_t peaceful
If set, won't attack friendly creatures.
void spring_trap(object *trap, object *victim)
This function generalizes attacks by runes/traps.
static void get_attack_message(int dam, int type, const object *op, const object *hitter, char *buf1, char *buf2)
Compute attack messages.
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.
sstring anim_suffix
Used to determine combined animations.
object * arch_present_in_ob(const archetype *at, const object *op)
Searches for any objects with a matching archetype in the inventory of the given object.
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.
void object_handle_death_animation(object *op)
#define MSG_TYPE_ATTRIBUTE
Changes to attributes (stats, resistances, etc)
#define SET_ANIMATION(ob, newanim)
non standard information is not specified or uptime this means how long since the executable has been started A particular host may have been running a server for quite a long time
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
@ SKILL
Also see SKILL_TOOL (74) below.
void play_sound_map(int8_t sound_type, object *emitter, int dir, const char *action)
Plays a sound on a map.
tag_t count
Unique object number for this object.
void set_materialname(object *op)
Set the material name and type for an item, if not set.
#define FLAG_SCARED
Monster is scared (mb player in future)
void fix_object(object *op)
Updates all abilities given by applied objects in the inventory of the given object.
int16_t pk_luck_penalty
Amount by which player luck is reduced if they PK.
#define FLAG_ONE_HIT
Monster can only hit once before going away (replaces ghosthit)
const Face * blank_face
Following can just as easily be pointers, but it is easier to keep them like this.
void shuffle_attack(object *op)
This routine shuffles the attack of op to one of the ones in the list.
void confuse_living(object *op, object *hitter, int dam)
Confuse a living thing.
@ TRANSPORT
see doc/Developers/objects
object * enemy
Monster/player to follow even if not closest.
#define WEAP_WHIP
whips n chains
int hit_map(object *op, int dir, uint32_t type, int full_hit)
Attack a spot on the map.
int friendly_fire(object *op, object *hitter)
Find out if this is friendly fire (PVP and attacker is peaceful) or not.
int rndm(int min, int max)
Returns a number between min and max.
#define FLAG_BLOCKSVIEW
Object blocks view.
uint8_t hide
The object is hidden, not invisible.
@ range_golem
Control golem.
sstring title
Of foo, etc.
std::vector< materialtype_t * > materials
#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.
materialtype_t * name_to_material(const char *name)
Convert materialname to materialtype_t.
object * object_insert_in_ob(object *op, object *where)
This function inserts the object op in the linked list inside the object environment.
#define MSG_TYPE_VICTIM
Something bad is happening to the player.
int16_t resist[NROFATTACKS]
Resistance adjustments for attacks.
#define FLAG_NO_PICK
Object can't be picked up.
const object * find_god(const char *name)
Returns a god's object from its name.
Plugin animator file specs[Config] name
int attack_ob(object *op, object *hitter)
Simple wrapper for attack_ob_simple(), will use hitter's values.
static int hit_with_one_attacktype(object *op, object *hitter, int dam, uint32_t attacknum)
Handles one attacktype's damage.
#define FLAG_ALIVE
Object can fight (or be fought)
int64_t pk_max_experience
Maximum experience one can get for PKing.
void blind_living(object *op, object *hitter, int dam)
Blind a living thing.
#define MSG_TYPE_ATTACK_DID_KILL
Player killed something.
int16_t y
Position in the map for this object.
static event_registration m
void object_free_drop_inventory(object *ob)
Frees everything allocated by an object, removes it from the list of used objects,...
void save_throw_object(object *op, uint32_t type, object *originator)
Object is attacked with some attacktype (fire, ice, ...).
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.
#define FLAG_TEAR_DOWN
at->faces[hp*animations/maxhp] at hit
object * chosen_skill
The skill chosen to use.
#define USING_SKILL(op, skill)
True if op is using skill, false else.
char killer[BIG_NAME]
Who killed this player.
object * object_find_by_type2(const object *who, int type1, int type2)
Find object in inventory.
uint8_t subtype
Subtype of object.
#define FLAG_WAS_WIZ
Player was once a wiz.
bool is_criminal(object *op)
int pk_max_experience_percent
Percentage of experience of victim the killer gets.
sstring add_refcount(sstring str)
This will increase the refcount of the string str.
int free_no_drop(object *op)
Check whether the given object is FLAG_NO_DROP.
static int adj_attackroll(object *hitter, object *target)
Adjustments to attack rolls by various conditions.
const char * determine_god(object *op)
Determines if op worships a god.
short freearr_y[SIZEOFFREE]
Y offset when searching around a spot.
#define MSG_TYPE_ATTRIBUTE_BAD_EFFECT_START
Start of a bad effect to the player.
object * object_present_in_ob_by_name(int type, const char *str, const object *op)
Searches for any objects with a matching type & name variable in the inventory of the given object.
#define MSG_TYPE_APPLY_SUCCESS
Was able to apply object.
void query_name(const object *op, char *buf, size_t size)
Describes an item.
#define FLAG_RUN_AWAY
Object runs away from nearest player \ but can still attack at a distance.
uint16_t set_friendly_fire
Percent of damage done by peaceful player vs player damage.
#define FLAG_KNOWN_CURSED
The object is known to be cursed.
object * ranges[range_size]
Object for each range.
void check_physically_infect(object *victim, object *hitter)
Possibly infect due to direct physical contact i.e., AT_PHYSICAL.
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()
uint8_t run_away
Monster runs away if it's hp goes below this percentage.
sstring add_string(const char *str)
This will add 'str' to the hash table.
void apply_anim_suffix(object *who, const char *suffix)
Applies a compound animation to an object.
#define EVENT_GKILL
Triggered when anything got killed by anyone.
#define FOR_OB_AND_BELOW_FINISH()
Finishes FOR_OB_AND_BELOW_PREPARE().
#define HEAD(op)
Returns the head part of an object.
void commit_crime(object *op, const char *description)
#define MSG_TYPE_ATTACK_PET_DIED
Pet was killed.
int16_t casting_time
Time left before spell goes off.
MoveType move_type
Type of movement this object uses.
#define WEAP_HIT
the basic
#define FLAG_FREED
Object is in the list of free objects.
object * hit_with_arrow(object *op, object *victim)
hit_with_arrow() disassembles the missile, attacks the victim and reassembles the missile.
#define FLAG_BLIND
If set, object cannot see (visually)
const Face * face
Face with colors.
char * host
Which host it is connected from (ip address).
#define MSG_TYPE_ATTACK
Attack related messages.
#define MOVE_FLYING
Combo of fly_low and fly_high.
void object_update_speed(object *op)
Updates the speed of an object.
#define FLAG_NO_DAMAGE
monster can't be damaged
int slow_living_by(object *op, const int speed_penalty)
uint8_t type
PLAYER, BULLET, etc.
#define INS_NO_MERGE
Don't try to merge with other items.
#define FLAG_DAMNED
The object is very cursed.
int16_t dam
How much damage this object does when hitting.
in that case they will be relative to whatever the PWD of the crossfire server process is You probably shouldn t
int8_t magic
Any magical bonuses to this item.
#define FLAG_PARALYZED
Monster or player is paralyzed.
void counterspell(object *op, int dir)
Nullifies spell effects.
sstring materialname
Specific material name.
#define FOR_INV_FINISH()
Finishes FOR_INV_PREPARE().
void fix_stopped_item(object *op, mapstruct *map, object *originator)
Put stopped item where stop_item() had found it.
int32_t food
How much food in stomach.
void change_exp(object *op, int64_t exp, const char *skill_name, int flag)
Changes experience to a player/monster.
object * fix_stopped_arrow(object *op)
An ARROW stops moving.
#define FLAG_UNAGGRESSIVE
Monster doesn't attack players.
#define ATNR_COUNTERSPELL
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...
#define MSG_TYPE_VICTIM_WAS_HIT
Player was hit by something.
#define FOR_OB_AND_BELOW_PREPARE(op_)
Constructs a loop iterating over an object and all objects below it in the same pile.
int random_roll(int min, int max, const object *op, int goodbad)
Roll a random number between min and max.
sstring race
Human, goblin, dragon, etc.
int8_t save[NROFATTACKS]
Save chances for the attacks.
TIPS on SURVIVING Crossfire is populated with a wealth of different monsters These monsters can have varying immunities and attack types In some of them can be quite a bit smarter than others It will be important for new players to learn the abilities of different monsters and learn just how much it will take to kill them This section discusses how monsters can interact with players Most monsters in the game are out to mindlessly kill and destroy the players These monsters will help boost a player s after he kills them When fighting a large amount of monsters in a single attempt to find a narrower hallway so that you are not being attacked from all sides Charging into a room full of Beholders for instance would not be open the door and fight them one at a time For there are several maps designed for them Find these areas and clear them out All throughout these a player can find signs and books which they can read by stepping onto them and hitting A to apply the book sign These messages will help the player to learn the system One more always keep an eye on your food If your food drops to your character will soon so BE CAREFUL ! NPCs Non Player Character are special monsters which have intelligence Players may be able to interact with these monsters to help solve puzzles and find items of interest To speak with a monster you suspect to be a simply move to an adjacent square to them and push the double ie Enter your and press< Return > You can also use say if you feel like typing a little extra Other NPCs may not speak to but display intelligence with their movement Some monsters can be and may attack the nearest of your enemies Others can be in that they follow you around and help you in your quest to kill enemies and find treasure SPECIAL ITEMS There are many special items which can be found in of these the most important may be the signs all a player must do is apply the handle In the case of the player must move items over the button to hold it down Some of the larger buttons may need very large items to be moved onto before they can be activated Gates and locked but be for you could fall down into a pit full of ghosts or dragons and not be able to get back out Break away sometimes it may be worth a player s time to test the walls of a map for secret doors Fire such as missile weapons and spells you will notice them going up in smoke ! So be careful not to destroy valuable items Spellbooks sometimes a player can learn the other times they cannot There are many different types of books and scrolls out there Improve item have lower weight
#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...
Chaos_Attacks ATTACKS[22]
Some local definitions for shuffle_attack().
struct archetype * other_arch
Pointer used for various things - mostly used for what this objects turns into or what this object cr...
#define FLAG_MONSTER
Will attack players.
#define FLAG_HITBACK
Object will hit back when hit.
static int get_attack_mode(object **target, object **hitter, int *simple_attack)
Find correct parameters for attack, do some sanity checks.
#define P_OUT_OF_MAP
This space is outside the map.
static std::shared_ptr< inja::Environment > env
Rendering environment.
#define MAX_BUF
Used for all kinds of things.
object * blame(object *op)
int is_wraith_pl(object *op)
Tests if a player is a wraith.
object * head
Points to the main object of a large body.
object * create_archetype(const char *name)
Finds which archetype matches the given name, and returns a new object containing a copy of the arche...
object * object_present_in_ob(uint8_t type, const object *op)
Searches for any objects with a matching type variable in the inventory of the given object.
object * current_weapon
Pointer to the weapon currently used.
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.
MoveType move_slow
Movement types this slows down.
int8_t wc
Weapon Class, lower WC increases probability of hitting.
float move_slow_penalty
How much this slows down the object.
#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.
int change_abil(object *op, object *tmp)
Permanently alters an object's stats/flags based on another object.
#define OUT_OF_REAL_MAP(M, X, Y)
Checks if a square is out of the map.
attackmess_t attack_mess[NROFATTACKMESS][MAXATTACKMESS]
static void attack_message(int dam, int type, object *op, object *hitter)
Send an attack message to someone.
#define FLAG_REMOVED
Object is not in any map or invenory.
object * object_decrease_nrof(object *op, uint32_t i)
Decreases a specified number from the amount of an object.
int monster_can_see_enemy(object *op, object *enemy)
Assuming no walls/barriers, lets check to see if its possible to see an enemy.
#define FLAG_WIZ
Object has special privilegies.
#define NDI_UNIQUE
Print immediately, don't buffer.
sstring slaying
Which race to do double damage to.
#define MSG_TYPE_ATTACK_PET_HIT
Players pet hit something else.
#define WEAP_BLUD
bludgeoning, club, stick
#define FLAG_FRIENDLY
Will help players.
sstring name
The name of the object, obviously...
#define WEAP_STAB
knife, dagger
static void tear_down_wall(object *op)
Handles wall tearing animation.
#define WEAP_PIERCE
arrows, stiletto
@ SK_WRAITH_FEED
Wraith feed.
#define MSG_TYPE_VICTIM_WAS_PUSHED
Player was pushed or attempted pushed.
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_.
const char *const attacks[NROFATTACKS]
Attack type names.
object * env
Pointer to the object which is the environment.
void drain_stat(object *op)
Drains a random stat from op.
#define NDI_ALL
Inform all players of this message.
void monster_npc_call_help(object *op)
A monster calls for help against its enemy.
#define WEAP_CRUSH
big hammers, flails
sstring skill
Name of the skill this object uses/grants.
archetype * find_archetype(const char *name)
static void object_get_materialtype(object *op, materialtype_t **mt)
char * name
Name of map as given by its creator.
int get_turn_bonus(int stat)
void change_luck(object *op, int value)
Alter the object's luck.
void esrv_update_item(int flags, object *pl, object *op)
Updates object *op for player *pl.
int did_make_save(const object *op, int level, int bonus)
This function takes an object (monster/player, op), and determines if it makes a basic save throw by ...
static int attack_ob_simple(object *op, object *hitter, int base_dam, int wc)
Handles simple attack cases.
#define MSG_TYPE_ATTACK_FUMBLE
Player fumbled attack.
int on_same_map(const object *op1, const object *op2)
Checks whether 2 objects are on the same map or not.
#define CLEAR_FLAG(xyz, p)
method_ret ob_apply(object *op, object *applier, int aflags)
Apply an object by running an event hook or an object method.
static int hit_with_drain(object *op, object *hitter, int dam)
int8_t ac
Armor Class, lower AC increases probability of not getting hit.
void paralyze_living(object *op, int dam)
Paralyze a living thing.
#define NUM_ANIMATIONS(ob)
int player_arrest(object *who)
Put a player into jail, taking into account cursed exits and player's region.
void share_exp(object *op, int64_t exp, const char *skill, int flag)
Gives experience to a player/monster, sharing it with party if applicable.
int16_t duration
Number of moves (see 'speed') spell lasts.
object * arch_to_object(archetype *at)
Creates and returns a new object which is a copy of the given archetype.
partylist * party
Party this player is part of.
void change_object(object *op)
Replaces op with its other_arch if it has reached its end of life.
int64_t check_exp_loss(const object *op, int64_t exp)
This function checks to make sure that object 'op' can lose 'exp' experience.
object * stop_item(object *op)
An item (ARROW or such) stops moving.
static void scare_creature(object *target, object *hitter)
Creature is scared, update its values.
void process_object(object *op)
Main object move function.
void object_remove(object *op)
This function removes the object op from the linked list of objects which it is currently tied to.
int player_can_view(object *pl, object *op)
Check the player los field for viewability of the object op.
#define FLAG_UNPAID
Object hasn't been paid for yet.
#define EVENT_ATTACKED
Object attacked, with weapon or spell.
#define SK_EXP_TOTAL
Give player exp to total, no skill.
void update_all_los(const mapstruct *map, int x, int y)
This function makes sure that update_los() will be called for all players on the given map within the...
void object_copy_owner(object *op, object *clone)
Set the owner to clone's current owner and set the skill and experience objects to clone's objects (t...
sstring name
More definite name, like "generate_kobold".
#define SK_EXP_ADD_SKILL
Give the player the skill.
uint32_t nrof
Number of objects.
socket_struct * socket
Socket information for this player.
living stats
Str, Con, Dex, etc.
char title[BIG_NAME]
Default title, like fighter, wizard, etc.
static void put_in_icecube(object *op, object *originator)
void get_attack_message_for_attack_type(int dam, uint8_t atm_type, const char *victim_name, char *buf1, char *buf2)
Get the attack message for a damage and a type.
short freearr_x[SIZEOFFREE]
X offset when searching around a spot.
#define FLAG_IS_LIGHTABLE
object can be lit
uint8_t darkness
Indicates level of darkness of map.
#define FLAG_READY_WEAPON
(Monster or Player) has a weapon readied
#define MSG_TYPE_APPLY
Applying objects.
uint32_t attacktype
Bitmask of attacks this object does.
#define FLAG_CURSED
The object is cursed.
static int kill_object(object *op, int dam, object *hitter)
An object was killed, handle various things (logging, messages, ...).
static void thrown_item_effect(object *, object *)
Handles any special effects of thrown items (like attacking living creatures–a potion thrown at a mon...
#define ATNR_LIFE_STEALING
void kill_player(object *op, const object *killer)
Handle a player's death.
#define FLAG_SLEEP
NPC is sleeping.
uint16_t material
What materials this object consist of.
MoveType move_block
What movement types this blocks.
static int is_aimed_missile(object *op)
Determine if the object is an 'aimed' missile.
#define FOR_INV_PREPARE(op_, it_)
Constructs a loop iterating over the inventory of an object.
static const int32_t MAX_FOOD
static void poison_living(object *op, object *hitter, int dam)
Poison a living thing.
void events_execute_global_event(int eventcode,...)
Execute a global event.
void object_replace_insert_in_map(const char *arch_string, object *op)
This function inserts an object of a specified archetype in the map, but if it finds objects of its o...
@ llevDebug
Only for debugging purposes.
static void slow_living(object *op, object *hitter, int dam)
Slow a living thing.
#define MSG_TYPE_APPLY_UNAPPLY
Unapply an object.