Beispiel #1
0
void send_beep(object o_user, mixed t_user, string t_mud)
{

    if(objectp(t_user)) t_user = lower_case(t_user->query_name());
    else
    if(stringp(t_user)) t_user = lower_case(t_user);
    else return;

    find_object(I3_CHDMOD)->sendToUser("beep", o_user->query_name(), t_mud, t_user, 0);
}
Beispiel #2
0
nomask int query_mortal(mixed player) {

    if (objectp(player)) {
        if (!player <-"/sys/obj/player") {
            return 0;
        }
        player = player->query_name();
    } else {
        argcheck(stringp(player), 1, "player object or string");
    }

    return !query_wizard(player);
}
Beispiel #3
0
int query_admin(mixed player) {

  if(objectp(player)) {
    if( !player<-"/sys/lib/player" ) {
      return 0;
    }
    player = player->query_name();
  } else {
    argcheck( stringp( player ), 1, "player object or string" );
  }

  return SECURE_D->query_admin( player ) ;
}
Beispiel #4
0
varargs void send_error(mixed o_user, string t_mud, mixed t_user, string err_code, string err_msg, mixed *packet)
{

    if(intp(o_user)) o_user = 0;
    else
    if(objectp(o_user)) o_user = o_user->query_name();
    else
    if(stringp(o_user)) o_user = lower_case(o_user);
    else o_user = 0;

    if(intp(t_user)) t_user = 0;
    else
    if(objectp(t_user)) t_user = t_user->query_name();
    else
    if(stringp(t_user)) t_user = lower_case(t_user);
    else t_user = 0;

    find_object(I3_CHDMOD)->sendToUser("error", o_user, t_mud, t_user, ({
      err_code,
      err_msg,
      packet ? packet : 0
    }) );
Beispiel #5
0
string pluralize(mixed single) {
    int x;
    string str, tmp;
    if(!single) return single;
    if(objectp(single)) {
        if(str = (string)single->query("plural name")) return str;
        else str = (string)single->query_name();
    }
    else str = (string)single;
    if(!str) return str;
    x = strlen(str);
    if(ABNORMAL[str]) return ABNORMAL[str];
    if(x > 2 && str[x-3..x-1] == "man")
        return str[0..x-3]+"en";
    if(x > 1) {
        tmp = str[x-2..x-1];
        switch(tmp) {
        case "ts": return str+"";
        case "ch": case "sh":
            return str+"es";
        case "ff": case "fe":
            return str[0..x-3]+"ves";
        case "us":
            return str[0..x-3]+"i";
        case "um":
            return str[0..x-3]+"a";
        case "ef":
            return str+"s";
        }
    }
    tmp = str[x-1..x-1];
    //  2 bug fixes by Whit
    if(str[sizeof(str)-2..sizeof(str)] == "ts") return str;
    if(str[sizeof(str)-2..sizeof(str)] == "es") return str;
    switch(tmp) {
    case "s":
        return str+"es";
    case "o": case "x": 
        return str+"es";
    case "wolf": return str[0..x-4]+"wolves";
    case "f": return str[0..x-2]+"ves";
    case "y" : return str[0..x-2]+"ies";
    }
    return str+"s";
}