[btech-checkins] CVS: btechmux/src funceval.c,1.5,1.6 functions.c,1.10,1.11 wiz.c,1.1.1.1,1.2 .depen
Brought to you by:
twouters
From: Thomas W. <two...@us...> - 2003-09-30 01:02:05
|
Update of /cvsroot/btech/btechmux/src In directory sc8-pr-cvs1:/tmp/cvs-serv28449/src Modified Files: funceval.c functions.c wiz.c Removed Files: .depend Makefile.in configure configure.in mech.ecm.h Log Message: Massive sync with the 'development' repository at http://btechmux.bkbits.net/btechmux. Among other things, this redoes the build system to be less... convoluted, and adds Cord's MechWarrior 3rd Edition skill system as well as a fairly large set of bugfixes and minor new features. Index: funceval.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/funceval.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** funceval.c 31 Jul 2002 14:53:04 -0000 1.5 --- funceval.c 30 Sep 2003 01:01:31 -0000 1.6 *************** *** 3334,3335 **** --- 3334,3430 ---- } } + + /* + * --------------------------------------------------------------------------- + * fun_setlock: Set lock from a function (like @lock) + */ + + extern NAMETAB lock_sw; + + FUNCTION(fun_setlock) + { + int switchkey = 0; + dbref thing, aowner; + int atr, aflags; + ATTR *ap; + struct boolexp *okey; + + if (*fargs[0]) { + switchkey = search_nametab(player, &lock_sw, fargs[0]); + if (switchkey < 0) { + safe_str("#-1 SWITCH ERROR", buff, bufc); + return; + } + } + + if (parse_attrib(player, fargs[1], &thing, &atr)) { + if (atr != NOTHING) { + if (!atr_get_info(thing, atr, &aowner, &aflags)) { + safe_str("#-1 ATTR NOT FOUND", buff, bufc); + return; + } + ap = atr_num(atr); + + /* + * You may lock an attribute iff: you could write the + * attribute if it were stored on yourself --and-- you own + * the attribute or are a wizard as long as you are not #1 + * and are trying to do something to #1. + */ + + if (ap && (God(player) || (!God(thing) && + (Set_attr(player, player, ap, 0) && (Wizard(player) + || aowner == Owner(player)))))) { + if (*fargs[2]) + aflags |= AF_LOCK; + else + aflags &= ~AF_LOCK; + atr_set_flags(thing, atr, aflags); + safe_str("1", buff, bufc); + } else { + safe_str("#-1 PERMISSION DENIED", buff, bufc); + } + return; + } + } + init_match(player, fargs[1], NOTYPE); + match_everything(MAT_EXIT_PARENTS); + thing = match_result(); + + switch (thing) { + case NOTHING: + safe_str("#-1 NOT FOUND", buff, bufc); + return; + case AMBIGUOUS: + safe_str("#-1 AMBIGUOUS MATCH", buff, bufc); + return; + default: + if (!controls(player, thing)) { + safe_str("#-1 PERMISSION DENIED", buff, bufc); + return; + } + } + + if (!switchkey) + switchkey = A_LOCK; + + if (!*fargs[2]) { + atr_clr(thing, switchkey); + safe_str("1", buff, bufc); + return; + } + + okey = parse_boolexp(player, fargs[2], 0); + if (okey == TRUE_BOOLEXP) { + safe_str("#-1 KEY ERROR", buff, bufc); + } else { + + /* + * everything ok, do it + */ + + atr_add_raw(thing, switchkey, unparse_boolexp_quiet(player, okey)); + safe_str("1", buff, bufc); + } + free_boolexp(okey); + } Index: functions.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/functions.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** functions.c 31 Jul 2002 14:53:04 -0000 1.10 --- functions.c 30 Sep 2003 01:01:31 -0000 1.11 *************** *** 65,69 **** XFUNCTION(fun_btsetarmorstatus); XFUNCTION(fun_btweaponstatus); ! XFUNCTION(fun_btthreshhold); XFUNCTION(fun_btdamagemech); XFUNCTION(fun_btarmorref); --- 65,69 ---- XFUNCTION(fun_btsetarmorstatus); XFUNCTION(fun_btweaponstatus); ! XFUNCTION(fun_btBaseXPMod); XFUNCTION(fun_btdamagemech); XFUNCTION(fun_btarmorref); *************** *** 79,82 **** --- 79,85 ---- XFUNCTION(fun_btlostohex) XFUNCTION(fun_btlostomech) + XFUNCTION(fun_btaddparts) + XFUNCTION(fun_btloadmap) + XFUNCTION(fun_btloadmech) XFUNCTION(fun_cwho); XFUNCTION(fun_clist); *************** *** 93,96 **** --- 96,100 ---- XFUNCTION(fun_create); XFUNCTION(fun_set); + XFUNCTION(fun_setlock); #endif XFUNCTION(fun_last); *************** *** 5097,5101 **** #ifdef BT_ENABLED {"BTDESIGNEX", fun_btdesignex, 1, 0, CA_PUBLIC}, ! {"BTTHRESHHOLD",fun_btthreshhold, 1, 0, CA_WIZARD}, {"BTGETCHARVALUE", fun_btgetcharvalue, 3, 0, CA_WIZARD}, {"BTLAG", fun_lag, 0, 0, CA_WIZARD}, --- 5101,5105 ---- #ifdef BT_ENABLED {"BTDESIGNEX", fun_btdesignex, 1, 0, CA_PUBLIC}, ! {"BTBASEXPMOD",fun_btBaseXPMod, 1, 0, CA_WIZARD}, {"BTGETCHARVALUE", fun_btgetcharvalue, 3, 0, CA_WIZARD}, {"BTLAG", fun_lag, 0, 0, CA_WIZARD}, *************** *** 5131,5134 **** --- 5135,5141 ---- {"BTLOSTOHEX", fun_btlostohex, 3, 0, CA_WIZARD}, {"BTLOSTOMECH", fun_btlostomech, 2, 0, CA_WIZARD}, + {"BTADDPARTS", fun_btaddparts, 3, 0, CA_WIZARD}, + {"BTLOADMAP", fun_btloadmap, 2, FN_VARARGS, CA_WIZARD}, + {"BTLOADMECH", fun_btloadmech, 2, 0, CA_WIZARD}, #endif {"CAPSTR", fun_capstr, -1, 0, CA_PUBLIC}, *************** *** 5304,5307 **** --- 5311,5315 ---- {"SETDIFF", fun_setdiff, 0, FN_VARARGS, CA_PUBLIC}, {"SETINTER", fun_setinter, 0, FN_VARARGS, CA_PUBLIC}, + {"SETLOCK", fun_setlock, 3, 0, CA_WIZARD}, {"SETQ", fun_setq, 2, 0, CA_PUBLIC}, {"SETR", fun_setr, 2, 0, CA_PUBLIC}, Index: wiz.c =================================================================== RCS file: /cvsroot/btech/btechmux/src/wiz.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** wiz.c 3 Jan 2002 00:59:35 -0000 1.1.1.1 --- wiz.c 30 Sep 2003 01:01:31 -0000 1.2 *************** *** 62,66 **** } else { init_match(player, arg1, NOTYPE); ! match_everything(MAT_NO_EXITS); victim = noisy_match_result(); --- 62,66 ---- } else { init_match(player, arg1, NOTYPE); ! match_everything(0); victim = noisy_match_result(); --- .depend DELETED --- --- Makefile.in DELETED --- --- configure DELETED --- --- configure.in DELETED --- --- mech.ecm.h DELETED --- |