guild.h, master.h and spells.h - examples for course 13

[previous example] [course 13] [Table of contents] [next example]

guild.h


/* Filename      : guild.h
 * Description   : contains all guild defines
 *
 * written       : 30-05-1998 - Gunner
 * last modified : 31-05-1998 - Gunner
 * HTML-Version  : 13-02-2000 - Ghorwin
 */

// The following two lines are used to prevent this file from being
// included more than once, which may occur.

#ifndef GUILD_H
#define GUILD_H

#include <mudlib.h>
#include <levels.h>
#include <channels.h>
#include <std.h>
#include "/doc/crashcourse/defs.h"

#define GUILD               "/doc/crashcourse/course13/"

/* Rooms */

#define GUILD_CENTER        "/doc/crashcourse/course13/area/guildcenter"

/* The Master File */

#define GUILD_MASTER        "/doc/crashcourse/course13/master"

/* Directories */

#define GUILD_COMPATH       GUILD + "com/"
#define GUILD_HELPDIR       GUILD + "help/"

/* Messagefiles */

#define JOIN_MSG            GUILD + "etc/JOIN_MSG"
#define LEAVE_MSG           GUILD + "etc/LEAVE_MSG"
#define EXITGAME_MSG        GUILD + "etc/EXITGAME_MSG"
#define ENTERGAME_MSG       GUILD + "etc/ENTERGAME_MSG"

#endif /* GUILD_H */

master.h


/* Filename      : master.h
 * Description   : contains all prototypes for the guildmaster
 *
 * written       : 30-05-1998 - Gunner
 * last modified : 31-05-1998 - Gunner
 * HTML-Version  : 13-02-2000 - Ghorwin
 */

int         join_guild(object player);
void        remove_member(object member);
int         leave_guild(object player);
void        check_member(object member);
int         member_enters(object member);
int         member_exits(object member);
string      member_extra_look(object member);
string      member_finger_info(string name);
string*     query_cmdpaths();

spells.h


/* Filename      : spells.h
 * Description   : spell defines for the guild
 *
 * written       : 30-05-1998 - Gunner
 * last modified : 31-05-1998 - Gunner
 * HTML-Version  : 13-02-2000 - Ghorwin
 */

// This file includes some basic and useful defines to be used in
// the spells of the guild.

#ifndef SPELLS_H
#define SPELLS_H

#define NOT_FAIL(x)         return notify_fail(x);

#define CHECK_MAGIC(x)      if (x->query_property("no_magic"))\
                            NOT_FAIL("The surroundings disturb your concentration.\n")

#define CHECK_SPECIAL(x)    if (x->query_property("no_special"))\
                            NOT_FAIL("The surroundings disturb your concentration.\n")

#define CHECK_MATTACK(x)    if (x->query_property("no_mattack"))\
                            NOT_FAIL("The surroundings disturb your concentration.\n")

#define CHECK_NOFIGHT(x)    if (x->query_property("no_fight"))\
                            NOT_FAIL("Somehow you don't think that's a very good idea.\n")

#define CHECK_BUSY(x)       if (x->query_busy_next_round())\
                            NOT_FAIL("You have already done something this turn.\n")

#define SET_BUSY(x)         x->set_busy_next_round()

#define CHECK_SP(x,y)       if (x->query_sp() < y)\
                            NOT_FAIL("You just don't have the inner strength.\n")

#define REDUCE_SP(x,y)      x->reduce_spell_point(y)

#define CHECK_LIVING(x)     if (!living(x) || x->query_dead())\
                            NOT_FAIL("Why don't you stick to the living?\n")

// Costs for spells

#define DRAIN_COST          50
#define DRAIN_TIME          10+random(10)
#define DRAIN_TIMEOUT       10+random(6)
#define DRAIN_DAMAGE        10+random(10)
#define DRAIN_TYPE          "drain"

#endif /* SPELLS_H */