 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
34 "debug",
"inhibit",
"stop",
"food",
"drink",
35 "valuables",
"bow",
"arrow",
"helmet",
"shield",
36 "armour",
"boots",
"gloves",
"cloak",
"key",
37 "missile",
"melee",
"magical",
"potion",
"spellbook",
38 "skillscroll",
"readables",
"magicdevice",
"notcursed",
"jewels",
39 "flesh",
"container",
"cursed", NULL
60 size_t len = strlen(
name);
75 return best != -2 ? best : -1;
102 object *tmp, *best = NULL;
103 int match_val = 0, tmpmatch;
114 if (tmpmatch > match_val) {
115 match_val = tmpmatch;
145 if (*params ==
'\0') {
147 "Usage: use_skill <skill name>");
164 if (*params ==
'\0') {
166 "Usage: ready_skill <skill name>");
173 "You have no knowledge of the skill %s",
189 const char *missing_message) {
192 do_skill(op, op, skop, op->
facing, *params ==
'\0' ? NULL : params);
253 object *inv = op->
inv;
256 if (*params ==
'\0') {
261 while (*params ==
' ')
263 if (!strncmp(params,
"-a ", 3)) {
267 if (!strncmp(params,
"-u ", 3)) {
271 if (!strncmp(params,
"-o ", 3)) {
275 if (!strncmp(params,
"-b ", 3)) {
285 while (*params ==
' ')
295 "Could not find any match to the %s.",
317 int sack_can_hold(
const object *pl,
const object *sack,
const object *op, uint32_t nrof) {
323 "The %s is not active.",
329 "You can't put the %s into itself.",
336 "You can put only %s into the %s.",
342 "You can't put the key into %s.",
349 new_weight = sack->
carrying+(nrof ? nrof : 1)
358 "That won't fit in the %s!",
385 uint32_t
weight, effective_weight_limit;
386 const int tmp_nrof =
NROF(tmp);
389 int16_t x = tmp->
x, y = tmp->
y;
400 "You are levitating, you can't reach the ground!");
408 "The object disappears in a puff of smoke! It must have been an illusion.");
415 if (nrof > tmp_nrof || nrof == 0)
427 "That item is too heavy for you to pick up.");
434 if (nrof != tmp_nrof) {
437 tmp =
object_split(tmp, nrof, failure,
sizeof(failure));
457 snprintf(
buf,
sizeof(
buf),
"%s will cost you %s.",
name, value);
459 snprintf(
buf,
sizeof(
buf),
"%s will cost you %s. You place it in your %s.",
name, value, op->
name);
464 snprintf(
buf,
sizeof(
buf),
"You pick up the %s.",
name);
466 snprintf(
buf,
sizeof(
buf),
"You pick up the %s and put it in your %s.",
name, op->
name);
521 object *tmp = NULL, *tmp1;
529 "You can't pick up the %s.",
537 "There is nothing to pick up here.");
590 object *container = NULL;
605 }
else if (!container) {
620 if (tmp->
env == alt) {
641 "This object cannot be put into containers!");
807 memset(mp, 0,
sizeof(*mp));
808 if (params[0] ==
'\0') {
813 if (params[0] ==
'#') {
821 if (params[0] ==
'*') {
822 if (params[1] ==
'\0') {
833 strncpy(mp->
name, params,
sizeof(mp->
name) - 1);
879 if ((*matcher)(op, &mp, tmp)) {
886 if (params[0] ==
'\0' && !did_one) {
891 "You can't pick up a %s.",
899 "There is nothing to pick up.");
904 "You were unable to take one of the items.");
907 "You were unable to take %d of the items.",
938 object *sack2, *orig = sack;
946 "The %s is not a container.",
953 "You cannot put the %s in the %s.",
954 name_tmp, name_sack);
970 "You move the items from %s into %s.",
971 name_tmp, name_sack);
990 "You can not put a %s into a %s",
1009 if (nrof && tmp->
nrof != nrof) {
1012 tmp =
object_split(tmp, nrof, failure,
sizeof(failure));
1022 if (sack->
nrof > 1) {
1036 "You put the %s in %s.",
1037 name_tmp, name_sack);
1095 if (nrof && tmp->
nrof != nrof) {
1098 tmp =
object_split(tmp, nrof, failure,
sizeof(failure));
1112 "You drop the %s. The gods who lent it to you retrieve it.",
1125 #ifdef SAVE_INTERVAL
1133 && op->
contr->last_save_time+SAVE_INTERVAL <=
time(NULL)) {
1140 tmp_tag = tmp->
count;
1168 void drop(
object *op,
object *tmp) {
1193 "You don't have anything to drop.");
1198 "This item is locked");
1233 if (op->
inv == NULL) {
1236 "Nothing to drop!");
1255 if (*params ==
'\0') {
1258 && curinv->type !=
MONEY
1259 && curinv->type !=
FOOD
1260 && curinv->type !=
KEY
1262 && curinv->type !=
GEM
1263 && !curinv->invisible
1270 }
else if (strcmp(params,
"weapons") == 0) {
1273 && (curinv->type ==
WEAPON || curinv->type ==
BOW || curinv->type ==
ARROW)) {
1279 }
else if (strcmp(params,
"armor") == 0 || strcmp(params,
"armour") == 0) {
1288 }
else if (strcmp(params,
"food") == 0) {
1291 && (curinv->type ==
FOOD || curinv->type ==
DRINK)) {
1297 }
else if (strcmp(params,
"flesh") == 0) {
1300 && (curinv->type ==
FLESH)) {
1306 }
else if (strcmp(params,
"misc") == 0) {
1310 switch (curinv->type) {
1358 if (*params ==
'\0') {
1375 if ((*matcher)(op, &mp, tmp)) {
1386 "Nothing to drop.");
1389 "One item couldn't be dropped because it was locked.");
1390 else if (missed > 1)
1392 "%d items couldn't be dropped because they were locked.",
1416 if (!container->
inv)
1429 if (inv->below == next)
1453 if (*params ==
'\0') {
1459 if (strcmp(params,
"all") == 0) {
1475 "This is not a container!");
1490 if (*params ==
'\0') {
1504 "Could not find an object that matches %s",
1572 if (*params ==
'\0') {
1576 "You have no marked object.");
1588 "Could not find an object that matches %s",
1619 "It is an undead force.");
1622 "It is likely more powerful than you.");
1625 "It is likely less powerful than you.");
1628 "It is probably as powerful as you.");
1632 "You smell an acrid odor.");
1641 "It is critically wounded.");
1646 "It is in a bad shape.");
1656 "It is somewhat hurt.");
1661 "It is in excellent shape.");
1666 "It looks very ill.");
1679 if (
probe == NULL) {
1719 "You discover mystic forces on %s", tmp->
nrof <= 1?
"that item":
"those items" );
1730 "You have a bad feeling about %s", tmp->
nrof <= 1?
"that item":
"those items" );
1736 LOG(
llevError,
"Attempted to examine item %d with type %d, which is invalid\n", tmp->
count, tmp->
type);
1740 bool have_skill =
false;
1787 bool pl = tmp->
nrof > 1;
1792 "%s made of %s and %s %3.3f kg.",
1794 pl ?
"weigh" :
"weighs",
weight);
1797 "%s made of %s.", pl ?
"They are" :
"It is", tmp->
materialname);
1800 "%s %3.3f kg.", pl ?
"They weigh" :
"it weighs",
weight);
1816 desc =
"It is completely depleted.";
1818 desc =
"It is nearly depleted.";
1820 desc =
"It is very low on power.";
1822 desc =
"It is low on power.";
1824 desc =
"It is well charged.";
1826 desc =
"It is fully charged.";
1828 desc =
"It is overflowing with power.";
1850 if (castings <= 1) {
1851 desc =
"It is nearly depleted.";
1852 }
else if (castings <= 3) {
1853 desc =
"It hums with power.";
1855 desc =
"It crackles with power.";
1886 if (tmp->
msg && strncasecmp(tmp->
msg,
"@match", 6)) {
1887 if (!
output)
return true;
1896 switch (tmp->
type) {
1904 if (!tmp->
skill)
break;
1910 "Unfortunately, it is damaged beyond %s.",
1914 if (
skill->clone.msg) {
1915 if (!
output)
return true;
1917 "%s lets you %s a skill:",
1918 tmp->
nrof > 1 ?
"These objects" :
"This object",
1942 if (!
output)
return true;
1944 "%s holds%s a spell:",
1945 tmp->
nrof > 1 ?
"These objects" :
"This object",
1959 if (!
output)
return true;
1961 "%s a story:", tmp->
nrof > 1 ?
"These objects have" :
"This object has");
1995 "You examine the %s more closely.", tmp->
nrof > 1 ? tmp->
name_pl : tmp->
name);
2006 snprintf(prefix,
MAX_BUF,
"%s:", tmp->
nrof<=1 ?
"That is" :
"Those are");
2010 snprintf(prefix,
MAX_BUF,
"You lack the skill to understand %s:",
2011 tmp->
nrof<=1 ?
"that fully; it is" :
"those fully; they are");
2014 snprintf(prefix,
MAX_BUF,
"You fail to understand %s:",
2015 tmp->
nrof<=1 ?
"that fully; it is" :
"those fully; they are");
2028 "%s %s", prefix,
buf);
2037 switch (tmp->
type) {
2047 if (tmp->
msg != NULL)
2048 snprintf(
buf,
sizeof(
buf),
"Something is written in it.");
2052 if (tmp->
race != NULL) {
2056 snprintf(
buf,
sizeof(
buf),
"It can hold only %s.", tmp->
race);
2075 "%s %s (%d).", tmp->
nrof > 1 ?
"They go" :
"It goes",
2079 "%s %s.", tmp->
nrof > 1 ?
"They go" :
"It goes",
2084 "%s %s.", tmp->
nrof > 1 ?
"They go" :
"It goes",
2094 snprintf(
buf,
sizeof(
buf),
"You reckon %s worth %s.", tmp->
nrof > 1 ?
"they are" :
"it is", value);
2101 snprintf(
buf,
sizeof(
buf),
"%s would cost you %s.", tmp->
nrof > 1 ?
"They" :
"It", value);
2105 snprintf(
buf,
sizeof(
buf),
"You are offered %s for %s.", value, tmp->
nrof > 1 ?
"them" :
"it");
2119 bool has_link =
false;
2122 if (tmp_inv->type ==
FORCE && tmp_inv->slaying != NULL
2123 && strcmp(tmp_inv->slaying, op->
map->
path) == 0
2124 && tmp_inv->msg != NULL
2125 && tmp_inv->path_attuned == (uint32_t) conn) {
2130 "This is a buildable item, connected with: %s",
2138 "This is a buildable item.");
2146 "Examine again for more details.");
2169 int items = 0, length;
2172 if (inv == NULL && op == NULL) {
2174 "Inventory of what object?");
2185 "You carry nothing.");
2209 "[fixed]%s- %-*.*s (%5d) %-8s",
2213 "[fixed]%s- %-*.*s %-8s",
2220 41,
"Total weight :",
weight);
2240 "Pickup is now %s.", (old &
PU_INHIBIT) ?
"active" :
"inhibited");
2259 "%d <= x pickup weight/value RATIO (0==off)",
2364 if (*params ==
'\0') {
2376 while (*params ==
' ')
2379 if (*params ==
'+' || *params ==
'-' || *params ==
'!') {
2389 else if (*params ==
'-')
2402 "Pickup: invalid item %s\n",
2407 if (sscanf(params,
"%u", &i) != 1) {
2411 "Usage: pickup <0-7> or <value_density> .");
2431 "Mode: Don't pick up.");
2436 "Mode: Pick up one item.");
2441 "Mode: Pick up one item and stop.");
2446 "Mode: Stop before picking up.");
2451 "Mode: Pick up all items.");
2456 "Mode: Pick up all items and stop.");
2461 "Mode: Pick up all magic items.");
2466 "Mode: Pick up all coins and gems");
2483 if (!params || *params ==
'\0') {
2486 "Example: search magic+1 "
2487 "Would automatically pick up all "
2488 "items containing the word 'magic+1'.");
2493 "Search mode turned off.");
2497 if ((
int)strlen(params) >=
MAX_BUF) {
2499 "Search string too long.");
2504 "Searching for '%s'.",
2527 object *item = NULL;
2529 const char *closebrace;
2532 if (*params !=
'\0') {
2534 while (
' ' == *params)
2538 itemnumber = atoi(params);
2539 if (itemnumber != 0) {
2541 if (inv->count == itemnumber && !inv->invisible) {
2548 "Tried to rename an invalid item.");
2551 while (isdigit(*params) ||
' ' == *params)
2553 }
else if (
'<' == *params) {
2555 closebrace = strchr(params,
'>');
2562 if (closebrace-params > 127) {
2564 "Old name too long (up to 127 characters allowed)!");
2568 snprintf(
buf,
sizeof(
buf),
"%.*s", (
int)(closebrace-(params+1)), params+1);
2574 "Could not find a matching item to rename.");
2579 params = closebrace+1;
2580 while (
' ' == *params)
2587 "No marked item to rename.");
2593 if (!strncmp(params,
"to ", 3)) {
2595 while (
' ' == *params)
2597 if (
'<' != *params) {
2599 "Syntax error, expecting < at start of new name!");
2602 closebrace = strchr(params+1,
'>');
2605 "Syntax error, expecting > at end of new name!");
2610 if (closebrace-params > 127) {
2612 "New name too long (up to 127 characters allowed)!");
2617 snprintf(
buf,
sizeof(
buf),
"%.*s", (
int)(closebrace-(params+1)), params+1);
2620 for (counter = 0; counter < strlen(
buf); counter++) {
2621 if (isalnum(
buf[counter]))
2623 if (
' ' ==
buf[counter])
2625 if (
'\'' ==
buf[counter])
2627 if (
'+' ==
buf[counter])
2629 if (
'_' ==
buf[counter])
2631 if (
'-' ==
buf[counter])
2638 "Invalid new name!");
2643 if (strlen(params)) {
2645 "Syntax error, expected 'to <' after old name!");
2656 "No marked item to rename.");
2667 "This item has no custom name.");
2674 "You stop calling your %s with weird names.",
2678 if (custom_name != NULL && strcmp(custom_name,
buf) == 0) {
2681 "You keep calling your %s %s.",
2691 "Your %s will now be called %s.",
2715 if (*params ==
'\0' || strlen(params) == 0) {
2724 "Can't find any matching item.");
2731 "Unlocked %s.",
name);
2735 "Locked %s.",
name);
2755 object *first, *second;
2764 strlcpy(copy, params,
sizeof(copy));
2765 with = strstr(copy,
" with ");
2772 with = with+strlen(
" with ");
2785 transformation = NULL;
2795 if (transformation->
yield)
2796 generated->
nrof = transformation->
yield;
#define object_was_destroyed(op, old_tag)
Checks if an object still exists.
void drop(object *op, object *tmp)
Drop an item, either on the floor or in a container.
sstring name_pl
The plural name of the object.
recipe * find_recipe_for_tool(const char *tool, recipe *from)
Find a recipe for a specified tool.
int do_skill(object *op, object *part, object *skill, int dir, const char *string)
Main skills use function-similar in scope to cast_spell().
struct Settings settings
Server settings.
int16_t maxhp
Max hit points.
static int matcher_pickup_type(object *who, matcher_params *params, object *item)
Check if an item matches a pickup type.
#define NUM_BODY_LOCATIONS
Number of body locations.
#define MSG_TYPE_COMMAND_SUCCESS
Successful result from command.
#define AP_APPLY
Item is to be applied.
@ CLOSE_CON
Eneq((at)csd.uu.se): Id for close_container archetype.
@ llevError
Error, serious thing.
void command_search(object *op, const char *params)
'search' command.
object * find_skill_by_number(object *who, int skillno)
This returns the first skill pointer of the given subtype (the one that accumulates exp,...
#define AP_NO_MERGE
Don't try to merge object after (un)applying it.
uint32_t mode
Mode of player for pickup.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
#define FLAG_UNDEAD
Monster is undead.
@ FLESH
animal 'body parts' -b.t.
object * inv
Pointer to the first object in the inventory.
#define FLAG_STARTEQUIP
Object was given to player at start.
#define MSG_TYPE_SKILL
Messages related to skill use.
#define QUERY_FLAG(xyz, p)
void command_rename_item(object *op, const char *params)
Changing the custom name of an item.
int yield
Maximum number of items produced by the recipe.
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...
uint32_t mark_count
Count of marked object.
void examine_monster(object *op, object *tmp, int level)
Player examine a monster.
struct archetype * arch
Pointer to archetype.
StringBuffer * stringbuffer_new(void)
Create a new string buffer.
void examine(object *op, object *tmp)
Player examines some object.
@ SK_DET_MAGIC
Detect magic.
#define FLAG_IS_BUILDABLE
Can build on item.
#define FOR_BELOW_PREPARE(op_, it_)
Constructs a loop iterating over all objects below an object.
int16_t invisible
How much longer the object will be invis.
int detect_curse_on_item(object *pl, object *tmp, object *skill)
Runs a 'detect curse' check on a given item.
void command_rskill(object *pl, const char *params)
'ready_skill' command.
uint64_t shop_price_buy(const object *obj, object *who)
Adjust the value of an item to be bought based on the player's bargaining skill and charisma.
@ SK_DISARM_TRAPS
Disarm traps.
void command_use(object *op, const char *params)
Try to use an item on another.
struct mapstruct * map
Pointer to the map in which this object is present.
int identifyskill
Skill used to identify this object class.
void esrv_send_pickup(player *pl)
Sends the "pickup" state to pl if client wants it requested.
void command_uskill(object *pl, const char *params)
'use_skill' command.
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
static int matcher_name(object *who, matcher_params *params, object *item)
Check if an item matches a string.
same as sound ncom command like but with extra the client want tick commands so it knows animation timing the client wants to be informed of pickup mode changes Mode will be sent when the player successfully logs in
@ SKILL
Also see SKILL_TOOL (74) below.
void examine_wand_charge_level(object *op, object *tmp)
Output charge information for a wand or staff.
tag_t count
Unique object number for this object.
int change_skill(object *who, object *new_skill, int flag)
This changes the object's skill to new_skill.
#define MSG_TYPE_COMMAND_EXAMINE
Player examining something.
void fix_object(object *op)
Updates all abilities given by applied objects in the inventory of the given object.
void command_mark(object *op, const char *params)
'mark' command, to mark an item for some effects (enchant armor, ...).
void command_pickup(object *op, const char *params)
'pickup' command.
char ** arch_name
Possible archetypes of the final product made.
@ TRANSPORT
see doc/Developers/objects
#define MSG_TYPE_COMMAND_ERROR
Bad syntax/can't use command.
int item_to_pick
Index of the item to pick, 1-based.
#define FLAG_PROBE
Object displays HP information to player.
#define FLAG_INV_LOCKED
Item will not be dropped from inventory.
#define MSG_TYPE_SPELL_INFO
random info about spell, not related to failure/success
char path[HUGE_BUF]
Filename of the map.
const char * object_get_value(const object *op, const char *const key)
Get an extra value by key.
void apply_by_living_below(object *pl)
Attempt to apply the object 'below' the player.
#define FLAG_APPLIED
Object is ready for use by living.
#define NDI_BLUE
Actually, it is Dodger Blue.
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.
static void set_pickup_mode(const object *op, int i)
Sets the 'old' pickup mode.
#define MSG_TYPE_COMMAND
Responses to commands, eg, who.
void command_drop(object *op, const char *params)
'drop' command.
const char * nonuse_name
Name to describe objects we can't use.
#define FLAG_NO_PICK
Object can't be picked up.
Plugin animator file specs[Config] name
#define FLAG_IS_FLOOR
Can't see what's underneath this object.
#define FOR_BELOW_FINISH()
Finishes FOR_BELOW_PREPARE().
uint32_t update_look
If true, we need to send the look window.
void command_empty(object *op, const char *params)
'empty' command.
int object_matches_pickup_mode(const object *item, int mode)
Checks if an item matches a specific pickup mode.
int32_t carrying
How much weight this object contains.
#define LOOK_OBJ(ob)
This returns TRUE if the object is something that should be displayed in the look window.
#define AP_NULL
Nothing specific.
Link an object type with skill needed to identify, and general name.
int16_t y
Position in the map for this object.
char * stringbuffer_finish(StringBuffer *sb)
Deallocate the string buffer instance and return the string.
void object_free_drop_inventory(object *ob)
Frees everything allocated by an object, removes it from the list of used objects,...
void put_object_in_sack(object *op, object *sack, object *tmp, uint32_t nrof)
Something tries to put an object into another.
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.
int use_skill(object *op, const char *string)
Similar to invoke command, it executes the skill in the direction that the user is facing.
static int matcher_all(object *who, matcher_params *params, object *item)
Function allowing all objects.
#define object_decrease_nrof_by_one(xyz)
#define FLAG_WAS_WIZ
Player was once a wiz.
void command_throw(object *op, const char *params)
'throw' command.
const typedata * get_typedata(int itemtype)
#define EVENT_PICKUP
Object picked up.
int pickup_type
Value in Pickup modes to match against.
void query_name(const object *op, char *buf, size_t size)
Describes an item.
char name[MAX_BUF]
Name to match for.
const char * use_name
Name used when describing an item we can use.
#define FLAG_KNOWN_CURSED
The object is known to be cursed.
void examine_weight_and_material(object *op, object *tmp)
Output weight and material information for an examined object.
#define EVENT_DROP
Object dropped on the floor.
static int matcher_number(object *who, matcher_params *params, object *item)
Check if an item is the one at the desired position.
@ SK_DET_CURSE
Detect curse.
int set_object_face_main(object *op)
Makes an object's face the main face, which is supposed to be the "closed" one.
#define MSG_TYPE_COMMAND_INFO
Generic info: resistances, etc.
int32_t weight_limit
Weight-limit of object.
sstring add_string(const char *str)
This will add 'str' to the hash table.
void knowledge_add_probe_monster(object *op, object *mon)
Display monster details, then add to a player's knowledge if not already.
#define FOR_OB_AND_BELOW_FINISH()
Finishes FOR_OB_AND_BELOW_PREPARE().
#define HEAD(op)
Returns the head part of an object.
bool player_can_find(object *op, object *ob)
Return true if player 'op' can see object 'op' for purpose of locating items for partial item matchin...
static void pick_up_object(object *pl, object *op, object *tmp, int nrof)
Try to pick up some item.
int transport_can_hold(const object *transport, const object *op, int nrof)
Can transport hold object op? This is a pretty trivial function, but in the future,...
object * below
Pointer to the object stacked below this one.
MoveType move_type
Type of movement this object uses.
object * object_find_by_type_and_name(const object *who, int type, const char *name)
Find object in inventory by type and name.
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_FREED
Object is in the list of free objects.
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.
static void empty_container(object *container, object *pl)
Put all contents of the container on the ground below the player or in opened container,...
#define MOVE_FLYING
Combo of fly_low and fly_high.
uint8_t type
PLAYER, BULLET, etc.
#define INS_NO_MERGE
Don't try to merge with other items.
@ SKILLSCROLL
can add a skill to player's inventory -bt.
sstring materialname
Specific material name.
void command_dropall(object *op, const char *params)
Command to drop all items that have not been locked.
#define FOR_INV_FINISH()
Finishes FOR_INV_PREPARE().
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...
#define INS_BELOW_ORIGINATOR
Insert new object immediately below originator.
int32_t food
How much food in stomach.
#define MSG_TYPE_SKILL_MISSING
Don't have the skill.
void change_exp(object *op, int64_t exp, const char *skill_name, int flag)
Changes experience to a player/monster.
void knowledge_item_can_be_used_alchemy(object *op, const object *item)
Displays known alchemy recipes an item can be used in.
uint32_t tag_t
Object tag, unique during the whole game.
body_locations_struct body_locations[NUM_BODY_LOCATIONS]
The ordering of this is actually doesn't make a difference However, for ease of use,...
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
int object_matches_string(object *pl, object *op, const char *name)
This is a subset of the parse_id command.
static item_matcher make_matcher(object *who, const char *params, matcher_params *mp)
Parse parameters and sets up an item matcher based on them.
#define FLAG_NO_DROP
Object can't be dropped.
void stringbuffer_append_string(StringBuffer *sb, const char *str)
Append a string to a string buffer instance.
#define FOR_OB_AND_BELOW_PREPARE(op_)
Constructs a loop iterating over an object and all objects below it in the same pile.
#define MSG_TYPE_SPELL
Spell related info.
int16_t SP_level_spellpoint_cost(object *caster, object *spell, int flags)
Scales the spellpoint cost of a spell by it's increased effectiveness.
sstring race
Human, goblin, dragon, etc.
int8_t facing
Object is oriented/facing that way.
static object * find_best_apply_object_match(object *start, object *pl, const char *params, int aflag)
Search from start and through below for what matches best with params.
int detect_magic_on_item(object *pl, object *tmp, object *skill)
Runs a 'detect magic' check on a given item.
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
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...
void command_search_items(object *op, const char *params)
'search-items' command.
void inventory(object *op, object *inv)
Prints object's inventory.
#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,...
int ingred_count
Number of items in ingred.
static std::shared_ptr< inja::Environment > env
Rendering environment.
void pick_up(object *op, object *alt)
Try to pick up an item.
#define MAX_BUF
Used for all kinds of things.
static void do_skill_by_number(object *op, int skill_subtype, const char *params, const char *missing_message)
Attempt to use a skill from its subtype.
size_t strlcpy(char *dst, const char *src, size_t size)
Portable implementation of strlcpy(3).
object * object_insert_in_map(object *op, mapstruct *m, object *originator, int flag)
This function inserts the object in the two-way linked list which represents what is on a map.
int sack_can_hold(const object *pl, const object *sack, const object *op, uint32_t nrof)
Check if an item op can be put into a sack.
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.
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.
void command_disarm(object *op, const char *params)
'disarm' command.
static bool IS_PLAYER(object *op)
A buffer that will be expanded as content is added to it.
int item_must_be_pickable
If non zero, then the item number is increased only if the item is pickable.
int probe(object *op, object *caster, object *spell_ob, int dir, int level)
Try to get information about a living thing.
char search_str[MAX_BUF]
Item we are looking for.
#define MSG_TYPE_COMMAND_FAILURE
Failed result from command.
#define FLAG_KNOWN_MAGICAL
The object is known to be magical.
static const uint32_t pickup_modes[]
Value in Pickup modes associated with pickup_names.
static object * find_best_object_match(object *pl, const char *params)
Shortcut to find_best_apply_object_match(pl->inv, pl, params, AF_NULL);.
object * mark
Marked object.
static int get_pickup_mode_index(const char *name)
Return the pickup index in pickup_names and pickup_modes associated with the specified name.
#define FLAG_REMOVED
Object is not in any map or invenory.
#define MSG_TYPE_COMMAND_INVENTORY
Inventory listing.
#define FLAG_WIZ
Object has special privilegies.
sstring lore
Obscure information about this object, to get put into books and the like.
#define NDI_UNIQUE
Print immediately, don't buffer.
sstring slaying
Which race to do double damage to.
int(* item_matcher)(object *who, matcher_params *params, object *item)
Prototype for a function checking if an object matches some parameters.
void query_weight(const object *op, char *buf, size_t size)
Formats the item's weight.
sstring name
The name of the object, obviously...
#define AP_OPEN
Item is a container to be fully opened.
char * cost_approx_str(const object *obj, object *who)
Return a textual cost approximation in a newly-allocated string.
int object_can_pick(const object *who, const object *item)
Finds out if an object can be picked up.
void stringbuffer_trim_whitespace(StringBuffer *sb)
Trim trailing whitespace from a stringbuffer.
char * cost_str(uint64_t cost)
int is_identifiable_type(const object *op)
Return true if this item's type is one that cares about whether or not it's been identified – e....
object * env
Pointer to the object which is the environment.
const typedef char * sstring
void command_apply(object *op, const char *params)
'apply' command.
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.
void command_examine(object *op, const char *params)
'examine' command.
bool examine_fluff(object *op, object *tmp, bool output)
Emit the "fluff", the non-mechanical flavour text, for a given item.
int apply_by_living(object *pl, object *op, int aflag, int quiet)
Living thing is applying an object.
void esrv_update_item(int flags, object *pl, object *op)
Updates object *op for player *pl.
uint8_t max_stat
Maximum stat value - 255 should be sufficient.
sstring msg
If this is a book/sign/magic mouth/etc.
@ SKILL_TOOL
Allows the use of a skill.
#define FLAG_NO_FIX_PLAYER
fix_object() won't be called
object * find_marked_object(object *op)
Return the object the player has marked with the 'mark' command below.
#define CLEAR_FLAG(xyz, p)
#define SK_SUBTRACT_SKILL_EXP
Used when removing exp.
int apply_special(object *who, object *op, int aflags)
Apply an object.
static void display_new_pickup(const object *op, int old)
Utility function to display the pickup mode for a player.
int identifyskill2
Second skill used to identify this object class.
uint32_t count
Any numbers typed before a command.
int8_t body_info[NUM_BODY_LOCATIONS]
Body info as loaded from the file.
tag_t last_examined
Tag of most recently 'examined object.
int save_player(object *op, int flag)
Saves a player to disk.
uint8_t real_wiz
Use mud-like wizards.
object * stop_item(object *op)
An item (ARROW or such) stops moving.
object * container
Current container being used.
void object_remove(object *op)
This function removes the object op from the linked list of objects which it is currently tied to.
linked_char * ingred
List of ingredients.
object * drop_object(object *op, object *tmp, uint32_t nrof)
Try to drop an object on the floor.
MoveType move_off
Move types affected moving off this space.
#define FLAG_UNPAID
Object hasn't been paid for yet.
void examine_rod_charge_level(object *op, object *tmp)
Output charge information for a rod.
void sell_item(object *op, object *pl)
Player is selling an item.
void command_lock_item(object *op, const char *params)
Alternate way to lock/unlock items (command line).
sstring name
More definite name, like "generate_kobold".
#define FLAG_IS_LINKED
The object is linked with other objects.
uint32_t nrof
Number of objects.
socket_struct * socket
Socket information for this player.
int missed
How many items were missed when matching.
void query_base_name(const object *op, int plural, char *buf, size_t size)
Query a short name for the item.
uint8_t search_items
Search_items command.
living stats
Str, Con, Dex, etc.
int object_set_value(object *op, const char *key, const char *value, int add_key)
Updates the key in op to value.
#define AP_UNAPPLY
Item is to be remvoed.
@ SK_FIND_TRAPS
Find traps.
void command_take(object *op, const char *params)
This takes (picks up) an item.
bool shop_contains(object *ob)
Check if an object is in a shop.
static const char * pickup_names[]
Valid names for pickup types.
#define FLAG_IS_CAULDRON
container can make alchemical stuff
int item_number
Index of the checked item, 1-based.
uint32_t attacktype
Bitmask of attacks this object does.
#define FLAG_NO_SKILL_IDENT
If set, item cannot be identified w/ a skill.
object * object_get_player_container(object *op)
Finds the player carrying an object.
#define FLAG_IS_THROWN
Object is designed to be thrown.
#define CUSTOM_NAME_FIELD
Key in an object for the player-assigned custom name.
uint64_t shop_price_sell(const object *obj, object *who)
Adjust the value of an item to be sold based on the player's bargaining skill and charisma.
#define FOR_INV_PREPARE(op_, it_)
Constructs a loop iterating over the inventory of an object.
@ llevDebug
Only for debugging purposes.
ex_autoid_result examine_autoidentify(object *op, object *tmp)
When the player examines an unidentified object, try to ID it if they have the requisite skills.
archetype * get_archetype_by_skill_name(const char *skill, int type)
Retrieves an archetype by skill name and type.