119 strncpy(tmpname, name,
MAX_BUF-1);
121 for (i = strlen(tmpname); i > 0; i--) {
297 object *op, *prev = NULL, *head = NULL;
#define ARCH_SINGULARITY
Archetype for singularity.
void object_free_key_values(object *op)
Zero the key_values on op, decrementing the shared-string refcounts and freeing the links...
char * stringbuffer_finish(StringBuffer *sb)
Deallocate the string buffer instance and return the string.
struct archetype * arch
Pointer to archetype.
archetype * findBySkillNameAndType(const char *skill, int type)
Retrieve an archetype by skill name and type.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
object * more
Pointer to the rest of a large body of objects.
sstring slaying
Which race to do double damage to.
sstring add_string(const char *str)
Share a string.
archetype * findByObjectName(const char *name)
Retrieve an archetype given the name that appears during the game (for example, "writing pen" instead...
int16_t y
Position in the map for this object.
void dump_all_archetypes(void)
Dumps all archetypes to debug-level output.
StringBuffer * stringbuffer_new(void)
Create a new string buffer.
Global type definitions and header inclusions.
archetype * try_find_archetype(const char *name)
#define FLAG_REMOVED
Object is not in any map or invenory.
archetype * head
The main part of a linked object.
archetype * find_archetype_by_object_type_name(int type, const char *name)
This function retrieves an archetype by type and name that appears during the game.
AssetsManager * getManager()
void free_string(sstring str)
This will reduce the refcount, and if it has reached 0, str will be freed.
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
archetype * findByObjectTypeName(int type, const char *name)
Retrieve an archetype by type and name that appears during the game.
sstring name
More definite name, like "generate_kobold".
Defines for loader.l / loader.c.
object * arch_to_object(archetype *at)
Creates and returns a new object which is a copy of the given archetype.
object * create_archetype(const char *name)
Finds which archetype matches the given name, and returns a new object containing a copy of the arche...
sstring msg
If this is a book/sign/magic mouth/etc.
object * head
Points to the main object of a large body.
sstring race
Human, goblin, dragon, etc.
void object_dump(const object *op, StringBuffer *sb)
Dumps an object.
Archetypes * archetypes()
Get archetypes.
object * create_archetype_by_object_name(const char *name)
Creates an object given the name that appears during the game (for example, "writing pen" instead of ...
void object_copy_with_inv(const object *src_ob, object *dest_ob, bool update_speed)
Copy an object with an inventory, duplicate the inv too.
object * object_new(void)
Grabs an object from the list of unused objects, makes sure it is initialised, and returns it...
void fatal(enum fatal_error err)
fatal() is meant to be called whenever a fatal signal is intercepted.
#define MAX_BUF
Used for all kinds of things.
archetype * get_archetype_by_skill_name(const char *skill, int type)
Retrieves an archetype by skill name and type.
object * create_singularity(const char *name)
Creates a dummy object.
archetype * get_archetype_by_type_subtype(int type, int subtype)
Retrieves an archetype by type and subtype.
object * object_create_arch(archetype *at)
Create a full object using the given archetype.
struct archetype * other_arch
Pointer used for various things - mostly used for what this objects turns into or what this object cr...
sstring name_pl
The plural name of the object.
sstring name
The name of the object, obviously...
sstring title
Of foo, etc.
archetype * get_archetype_struct(void)
Allocates, initialises and returns the pointer to an archetype structure.
Only for debugging purposes.
archetype * empty_archetype
Nice to have fast access to it.
#define CLEAR_FLAG(xyz, p)
void dump_arch(archetype *at, StringBuffer *sb)
Dumps an archetype to buffer.
void free_arch(archetype *at)
Frees archetype.
archetype * find_archetype_by_object_name(const char *name)
This function retrieves an archetype given the name that appears during the game (for example...
C function wrappers to interact with assets.
archetype * more
Next part of a linked object.
A buffer that will be expanded as content is added to it.
#define FLAG_NO_PICK
Object can't be picked up.
archetype * findByTypeSubtype(int type, int subtype)
Retrieve an archetype by type and subtype.
void object_clear(object *op)
Frees everything allocated by an object, and also clears all variables and flags to default settings...
object clone
An object from which to do object_copy()
#define FLAG_FREED
Object is in the list of free objects.
void each(std::function< void(T *)> op)
Apply a function to each asset.