actions.h
musicmud-2.1.6/include/actions.h · 2.1 KB
From the archive musicmud2.1.6.tar.gz
Download the archive « Back to the archive contents
#ifndef ACTIONS_H
#define ACTIONS_H
#include "emsg.h"
struct parsedact {
MudObject *who;
string a_me;
string a_rest;
string a_you;
string txt;
MudObject *targ;
MudObject *prop;
string r_me;
string r_rest;
string r_you;
MudObject *rprop;
parsedact() : who(0), targ(0), prop(0), rprop(0) {
}
};
parsedact parse_action(MudObject *who, int argc, const char **argv, bool trigger);
parsedact parse_action(MudObject *who, const string &s, bool trigger);
//! an Action.
class Action {
public:
//! the 'category' of this action. e.g. 'roman', 'conv', 'weird'
string category;
//! lua code for this action
string lua;
//! whether the lua code is commline-safe
int safe;
//! message to user for untargetted
string u_me;
//! message to others for untargetted
string u_rest;
//! message to user for targetted
string t_me;
//! message to victim for targetted
string t_you;
//! message to others for targetted
string t_rest;
//! message to user for text
string x_me;
//! message to others for text
string x_rest;
//! error message for text (when text=="")
string x_err;
//! message to user for targetted text
string s_me;
//! message to target for targetted text
string s_you;
//! message to others for targetted text
string s_rest;
//! error message for targetted text (when target=="")
string s_err;
//! message to user for object
string o_me;
//! message to others for object
string o_rest;
//! requirements code for object
string o_req;
//! message to user for prop action
string p_me;
//! message to target for prop action
string p_you;
//! message to others for prop action
string p_rest;
//! requirements code for prop action
string p_req;
//! preposition for prop action
string p_prep;
Action() : safe(0) { }
Action(const Action &a) {
*this = a;
}
//! load an action from a file. will throw an emsg if cannot load.
Action(const char *name, bool create=0);
//! send the code for action to given file
void output(const char *name);
};
#endif