 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
28 #define sqr(x) ((x)*(x))
50 int write_rune(
object *op,
object *caster,
object *
spell,
int dir,
const char *runename) {
51 object *rune_spell, *rune;
66 "Can't make a rune there!");
70 if (tmp->type ==
RUNE) {
72 "You can't write a rune there.");
77 if (
spell->other_arch) {
84 int bestmatch = 0, ms;
86 if (!runename || *runename == 0) {
88 "Write a rune of what?");
94 if (tmp->type ==
SPELL) {
105 "You don't know any spell named %s",
112 "You can't cast %s with %s",
118 "%s belongs to a spell path denied to you.",
124 "%s is beyond your ability to cast!",
130 "You don't have enough mana.");
136 "You don't have enough grace.");
149 snprintf(
buf,
sizeof(
buf),
"You set off a rune of %s\n", rune_spell->
name);
158 snprintf(
buf, 100,
"%s.111",
spell->name);
161 if (face_override != NULL && anim_override != NULL) {
162 rune->
face = face_override;
194 object *disease = op->
inv;
321 "There's nothing there!");
337 if (tmp->type ==
RUNE || tmp->type ==
TRAP) {
346 if (tmp->type ==
SIGN && !strcmp(tmp->arch->name,
"rune_mark")) {
350 "You wipe out the rune of marking!");
367 "There's nothing there!");
455 "You successfully disarm the %s!",
462 if (owner != NULL && owner->
type !=
PLAYER && risk)
469 "You fail to disarm the %s.",
475 "In fact, you set it off!");
#define object_was_destroyed(op, old_tag)
Checks if an object still exists.
New face structure - this enforces the notion that data is face by face only - you can not change the...
#define HAS_RANDOM_ITEMS(op)
This return TRUE if object has still randomitems which could be expanded.
object * object_get_owner(object *op)
Returns the object which this object marks as being the owner.
void set_spell_skill(object *op, object *caster, object *spob, object *dest)
Utility function to assign the correct skill when casting.
object * object_get_env_recursive(object *op)
Utility function.
#define FOR_MAP_FINISH()
Finishes FOR_MAP_PREPARE().
int16_t maxhp
Max hit points.
#define MSG_TYPE_COMMAND_SUCCESS
Successful result from command.
int trap_see(object *op, object *trap)
Should op see trap?
int trap_disarm(object *disarmer, object *trap, int risk, object *skill)
Try to disarm a trap/rune.
uint16_t difficulty
What level the player should be to play here.
#define GET_ANIMATION(ob, anim)
object * inv
Pointer to the first object in the inventory.
#define QUERY_FLAG(xyz, p)
void spring_trap(object *trap, object *victim)
This function generalizes attacks by runes/traps.
int cast_spell(object *op, object *caster, int dir, object *spell_ob, char *stringarg)
Main dispatch when someone casts a spell.
struct mapstruct * map
Pointer to the map in which this object is present.
int infect_object(object *victim, object *disease, int force)
Try to infect something with a disease.
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 draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
int write_rune(object *op, object *caster, object *spell, int dir, const char *runename)
Player is attempting to write a magical rune.
int8_t direction
Means the object is moving that way.
tag_t count
Unique object number for this object.
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...
void destroy_object(object *op)
Recursively object_free_drop_inventory() op and its inventory.
int dispel_rune(object *op, object *skill, int dir)
Someone is trying to disarm a rune.
int hit_map(object *op, int dir, uint32_t type, int full_hit)
Attack a spot on the map.
int16_t level
Level of creature or object.
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_COMMAND
Responses to commands, eg, who.
#define FLAG_ALIVE
Object can fight (or be fought)
uint32_t path_denied
Paths the object is denied access to.
static void rune_attack(object *op, object *victim)
This function handles those runes which detonate but do not cast spells.
#define MSG_TYPE_SPELL_SUCCESS
Spell succeeded messages.
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,...
object * object_find_by_type2(const object *who, int type1, int type2)
Find object in inventory.
short freearr_y[SIZEOFFREE]
Y offset when searching around a spot.
object clone
An object from which to do object_copy()
int trap_show(object *trap, object *where)
Handles showing a trap/rune detonation.
const Face * face
Face with colors.
uint8_t type
PLAYER, BULLET, etc.
int16_t dam
How much damage this object does when hitting.
#define MSG_TYPE_APPLY_TRAP
Have activated a trap.
with a maximum of six This is not so if you are wearing plate you receive no benefit Armour is additive with all the supplementry forms of which means that it lasts until the next semi permanent spell effect is cast upon the character spell
#define FOR_INV_FINISH()
Finishes FOR_INV_PREPARE().
int32_t food
How much food in stomach.
int caster_level(const object *caster, const object *spell)
This function returns the effective level the spell is being cast at.
uint32_t tag_t
Object tag, unique during the whole game.
int object_matches_string(object *pl, object *op, const char *name)
This is a subset of the parse_id command.
#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.
int random_roll(int min, int max, const object *op, int goodbad)
Roll a random number between min and max.
const Animations * animation
Animation of this item, NULL if not animated.
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...
struct archetype * other_arch
Pointer used for various things - mostly used for what this objects turns into or what this object cr...
#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 * object_new(void)
Grabs an object from the list of unused objects, makes sure it is initialised, and returns it.
object * create_archetype(const char *name)
Finds which archetype matches the given name, and returns a new object containing a copy of the arche...
Animations * try_find_animation(const char *name)
#define MSG_TYPE_COMMAND_FAILURE
Failed result from command.
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
Constructs a loop iterating over all objects of a map tile.
#define NDI_UNIQUE
Print immediately, don't buffer.
sstring name
The name of the object, obviously...
#define MSG_TYPE_SPELL_FAILURE
Spell failure messages.
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_.
This represents one animation.
sstring skill
Name of the skill this object uses/grants.
#define MSG_TYPE_SPELL_ERROR
Spell failure messages.
void object_set_msg(object *op, const char *msg)
Set the message field of an object.
sstring msg
If this is a book/sign/magic mouth/etc.
This is used by get_rangevector to determine where the other creature is.
int hit_player(object *op, int dam, object *hitter, uint32_t type, int full_hit)
Object is attacked by something.
object * arch_to_object(archetype *at)
Creates and returns a new object which is a copy of the given archetype.
int get_rangevector(object *op1, const object *op2, rv_vector *retval, int flags)
From map.c This is used by get_player to determine where the other creature is.
#define FLAG_IS_USED_UP
When (–food<0) the object will exit.
struct treasurelist * randomitems
Items to be generated.
void object_remove(object *op)
This function removes the object op from the linked list of objects which it is currently tied to.
const Face * try_find_face(const char *name, const Face *error)
#define FLAG_IS_LINKED
The object is linked with other objects.
bool chance(int a, int b)
Return true with a probability of a/b.
living stats
Str, Con, Dex, etc.
short freearr_x[SIZEOFFREE]
X offset when searching around a spot.
#define MSG_TYPE_APPLY
Applying objects.
uint32_t attacktype
Bitmask of attacks this object does.
const Animations * temp_animation
A temporary animation.
unsigned int distance
Distance, in squares.
#define FOR_INV_PREPARE(op_, it_)
Constructs a loop iterating over the inventory of an object.
void create_treasure(treasurelist *t, object *op, int flag, int difficulty, int tries)
This calls the appropriate treasure creation function.
#define FLAG_LIFESAVE
Saves a players' life once, then destr.