#include "config.h"
#include <stdio.h>
#include <string.h>
#include "mech.h"
#include "mech.events.h"
#include "glue.h"
#include "coolmenu.h"
#include "mycool.h"
#include "turret.h"
#include "p.template.h"
#include "p.mech.tech.h"
#include "p.mech.utils.h"
#include "p.mech.partnames.h"
#include "p.econ.h"
#include "p.map.obj.h"
#include "p.mech.tech.damages.h"
#include "p.mech.status.h"
#include "p.mech.sensor.h"
#include "p.btechstats.h"
#include "p.mech.combat.h"
#include "p.mech.damage.h"
#include "p.mechrep.h"
#include "p.mech.move.h"
#include "p.mech.los.h"
#include "p.event.h"
#include "p.mech.restrict.h"
#include "mech.partnames.h"
#include "p.functions.h"
#include "p.mech.tech.commands.h"
#include "p.mech.consistency.h"
Include dependency graph for glue.scode.c:
Go to the source code of this file.
Data Structures | |
struct | GMV |
Defines | |
#define | Uglie(dat) ((void *) &dat((MECH *)0)) |
#define | UglieV(dat, val) ((void *) &dat((MECH *)0,val)) |
#define | MeEntry(Name, Func, Type) {GTYPE_MECH,Name,Uglie(Func),Type,0} |
#define | MeEntryS(Name, Func, Type, Size) {GTYPE_MECH,Name,Uglie(Func),Type,Size} |
#define | MeVEntry(Name, Func, Val, Type) {GTYPE_MECH,Name,UglieV(Func,Val),Type,0} |
#define | UglieM(dat) ((void *)&((MAP *)0)->dat) |
#define | MaEntry(Name, Func, Type) {GTYPE_MAP,Name,UglieM(Func),Type,0} |
#define | MaEntryS(Name, Func, Type, Size) {GTYPE_MAP,Name,UglieM(Func),Type,Size} |
#define | UglieT(dat) (void *)&((TURRET_T *)0)->dat |
#define | TuEntry(Name, Func, Type) {GTYPE_TURRET,Name,UglieT(Func),Type,0} |
#define | TuEntryS(Name, Func, Type, Size) {GTYPE_TURRET,Name,UglieT(Func),Type,Size} |
#define | ADD(foo...) { if (count++) strcat(buf,","); sprintf(buf+strlen(buf), foo); } |
#define | offsetof(TYPE, MEMBER) (void *)((size_t) &((TYPE *)0)->MEMBER) |
#define | NUMBERS ".0123456789" |
Enumerations | |
enum | { TYPE_STRING, TYPE_CHAR, TYPE_SHORT, TYPE_INT, TYPE_FLOAT, TYPE_DBREF, TYPE_STRFUNC, TYPE_STRFUNC_S, TYPE_BV, TYPE_STRFUNC_BD, TYPE_CBV, TYPE_CHAR_RO, TYPE_SHORT_RO, TYPE_INT_RO, TYPE_FLOAT_RO, TYPE_DBREF_RO, TYPE_LAST_TYPE } |
Functions | |
dbref | match_thing (dbref player, char *name) |
char * | mechref_path (char *id) |
char * | setarmorstatus_func (MECH *mech, char *sectstr, char *typestr, char *valuestr) |
char * | mechIDfunc (int mode, MECH *mech) |
static char * | mech_getset_ref (int mode, MECH *mech, char *data) |
char * | mechTypefunc (int mode, MECH *mech, char *arg) |
char * | mechMovefunc (int mode, MECH *mech, char *arg) |
char * | mechTechTimefunc (int mode, MECH *mech) |
void | apply_mechDamage (MECH *omech, char *buf) |
char * | mechDamagefunc (int mode, MECH *mech, char *arg) |
char * | mechCentBearingfunc (int mode, MECH *mech, char *arg) |
char * | mechCentDistfunc (int mode, MECH *mech, char *arg) |
static int | bv_val (int in, int mode) |
static int | text2bv (char *text) |
static char * | bv2text (int i) |
void | fun_btsetxcodevalue (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
static char * | RetrieveValue (void *data, int i) |
void | fun_btgetxcodevalue (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btgetxcodevalue_ref (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | set_xcodestuff (dbref player, void *data, char *buffer) |
void | list_xcodestuff (dbref player, void *data, char *buffer) |
void | fun_btunderrepair (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btstores (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btmapterr (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btmapelev (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | list_xcodevalues (dbref player) |
void | fun_btdesignex (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btdamages (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btcritstatus (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btarmorstatus (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btweaponstatus (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btcritstatus_ref (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btarmorstatus_ref (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btweaponstatus_ref (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btsetarmorstatus (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btthreshold (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btdamagemech (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_bttechstatus (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_bthexemit (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btmakepilotroll (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btid2db (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_bthexlos (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btlosm2m (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btaddstores (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
int | xlate (char *) |
void | fun_btticweaps (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btloadmap (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btloadmech (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btmechfreqs (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btgetweight (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btremovestores (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_bttechtime (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btcritslot (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btcritslot_ref (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btgetrange (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | correct_speed (MECH *) |
void | fun_btsetmaxspeed (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btgetrealmaxspeed (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btgetbv (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btgetbv_ref (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_bttechlist (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_bttechlist_ref (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btpayload_ref (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btshowstatus_ref (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btshowwspecs_ref (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btshowcritstatus_ref (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btengrate (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btengrate_ref (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btfasabasecost_ref (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btweapstat (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btnumrepjobs (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btsetxy (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btmapunits (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
int | MapLimitedBroadcast3d (MAP *map, float x, float y, float z, float range, char *message) |
int | MapLimitedBroadcast2d (MAP *map, float x, float y, float range, char *message) |
void | fun_btmapemit (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btparttype (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btgetpartcost (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btsetpartcost (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btunitfixable (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_btlistblz (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
void | fun_bthexinblz (char *buff, char **bufc, dbref player, dbref cause, char *fargs[], int nfargs, char *cargs[], int ncargs) |
Variables | |
SpecialObjectStruct | SpecialObjects [] |
static MECH | tmpm |
static MAP | tmpmap |
static TURRET_T | tmpturret |
static int | scode_in_out [TYPE_LAST_TYPE] |
char * | mech_types [] |
char * | move_types [] |
static GMV | xcode_data [] |
char | radio_colorstr [] |
#define ADD | ( | foo... | ) | { if (count++) strcat(buf,","); sprintf(buf+strlen(buf), foo); } |
#define MaEntry | ( | Name, | |||
Func, | |||||
Type | ) | {GTYPE_MAP,Name,UglieM(Func),Type,0} |
Definition at line 91 of file glue.scode.c.
#define MaEntryS | ( | Name, | |||
Func, | |||||
Type, | |||||
Size | ) | {GTYPE_MAP,Name,UglieM(Func),Type,Size} |
Definition at line 92 of file glue.scode.c.
#define MeEntry | ( | Name, | |||
Func, | |||||
Type | ) | {GTYPE_MECH,Name,Uglie(Func),Type,0} |
Definition at line 84 of file glue.scode.c.
#define MeEntryS | ( | Name, | |||
Func, | |||||
Type, | |||||
Size | ) | {GTYPE_MECH,Name,Uglie(Func),Type,Size} |
Definition at line 86 of file glue.scode.c.
#define MeVEntry | ( | Name, | |||
Func, | |||||
Val, | |||||
Type | ) | {GTYPE_MECH,Name,UglieV(Func,Val),Type,0} |
Definition at line 88 of file glue.scode.c.
#define NUMBERS ".0123456789" |
#define offsetof | ( | TYPE, | |||
MEMBER | ) | (void *)((size_t) &((TYPE *)0)->MEMBER) |
Definition at line 400 of file glue.scode.c.
#define TuEntry | ( | Name, | |||
Func, | |||||
Type | ) | {GTYPE_TURRET,Name,UglieT(Func),Type,0} |
Definition at line 96 of file glue.scode.c.
#define TuEntryS | ( | Name, | |||
Func, | |||||
Type, | |||||
Size | ) | {GTYPE_TURRET,Name,UglieT(Func),Type,Size} |
Definition at line 97 of file glue.scode.c.
#define Uglie | ( | dat | ) | ((void *) &dat((MECH *)0)) |
Definition at line 81 of file glue.scode.c.
#define UglieM | ( | dat | ) | ((void *)&((MAP *)0)->dat) |
Definition at line 90 of file glue.scode.c.
#define UglieT | ( | dat | ) | (void *)&((TURRET_T *)0)->dat |
Definition at line 94 of file glue.scode.c.
#define UglieV | ( | dat, | |||
val | ) | ((void *) &dat((MECH *)0,val)) |
Definition at line 82 of file glue.scode.c.
anonymous enum |
Definition at line 69 of file glue.scode.c.
00069 { TYPE_STRING, TYPE_CHAR, TYPE_SHORT, TYPE_INT, TYPE_FLOAT, 00070 TYPE_DBREF, TYPE_STRFUNC, TYPE_STRFUNC_S, TYPE_BV, 00071 TYPE_STRFUNC_BD, TYPE_CBV, TYPE_CHAR_RO, TYPE_SHORT_RO, TYPE_INT_RO, 00072 TYPE_FLOAT_RO, TYPE_DBREF_RO, TYPE_LAST_TYPE 00073 };
void apply_mechDamage | ( | MECH * | omech, | |
char * | buf | |||
) |
Definition at line 154 of file glue.scode.c.
References CLASS_MECH, DestroyPart, do_magic(), FullAmmo(), GetPartData, GetPartType, GetSectArmor, GetSectInt, GetSectOArmor, GetSectOInt, GetSectORArmor, GetSectRArmor, IsAmmo, IsCrap, mech_RepairPart(), MechType, NUM_CRITICALS, NUM_SECTIONS, PartIsDestroyed, PartTempNuke, SetPartData, SetPartTempNuke, SetSectArmor, SetSectInt, SetSectRArmor, and UnDestroyPart.
Referenced by mechDamagefunc().
00155 { 00156 MECH mek; 00157 MECH *mech = &mek; 00158 int i, j, i1, i2, i3; 00159 char *s; 00160 int do_mag = 0; 00161 00162 memcpy(mech, omech, sizeof(MECH)); 00163 for(i = 0; i < NUM_SECTIONS; i++) { 00164 SetSectInt(mech, i, GetSectOInt(mech, i)); 00165 SetSectArmor(mech, i, GetSectOArmor(mech, i)); 00166 SetSectRArmor(mech, i, GetSectORArmor(mech, i)); 00167 for(j = 0; j < NUM_CRITICALS; j++) 00168 if(GetPartType(mech, i, j) && !IsCrap(GetPartType(mech, i, j))) { 00169 if(PartIsDestroyed(mech, i, j)) 00170 UnDestroyPart(mech, i, j); 00171 if(IsAmmo(GetPartType(mech, i, j))) 00172 SetPartData(mech, i, j, FullAmmo(mech, i, j)); 00173 else 00174 SetPartTempNuke(mech, i, j, 0); 00175 } 00176 } 00177 s = buf; 00178 while (*s) { 00179 while (*s && (*s == ' ' || *s == ',')) 00180 s++; 00181 if(!(*s)) 00182 break; 00183 /* Parse the keyword ; it's one of the many known types */ 00184 if(sscanf(s, "A:%d/%d", &i1, &i2) == 2) { 00185 /* Ordinary armor damage */ 00186 if(i1 >= 0 && i1 < NUM_SECTIONS) 00187 SetSectArmor(mech, i1, GetSectOArmor(mech, i1) - i2); 00188 } else if(sscanf(s, "A(R):%d/%d", &i1, &i2) == 2) { 00189 /* Ordinary rear armor damage */ 00190 if(i1 >= 0 && i1 < NUM_SECTIONS) 00191 SetSectRArmor(mech, i1, GetSectORArmor(mech, i1) - i2); 00192 } else if(sscanf(s, "I:%d/%d", &i1, &i2) == 2) { 00193 /* Ordinary int damage */ 00194 if(i1 >= 0 && i1 < NUM_SECTIONS) 00195 SetSectInt(mech, i1, GetSectOInt(mech, i1) - i2); 00196 } else if(sscanf(s, "C:%d/%d", &i1, &i2) == 2) { 00197 /* Dest'ed crit */ 00198 if(i1 >= 0 && i1 < NUM_SECTIONS) 00199 DestroyPart(mech, i1, i2); 00200 } else if(sscanf(s, "G:%d/%d(%d)", &i1, &i2, &i3) == 3) { 00201 /* Glitch */ 00202 if(i1 >= 0 && i1 < NUM_SECTIONS) 00203 if(i2 >= 0 && i2 < NUM_CRITICALS) 00204 SetPartTempNuke(mech, i1, i2, i3); 00205 } else if(sscanf(s, "R:%d/%d(%d)", &i1, &i2, &i3) == 3) { 00206 /* Reload */ 00207 if(i1 >= 0 && i1 < NUM_SECTIONS) 00208 if(i2 >= 0 && i2 < NUM_CRITICALS) 00209 SetPartData(mech, i1, i2, FullAmmo(mech, i1, i2) - i3); 00210 } 00211 while (*s && (*s != ' ' && *s != ',')) 00212 s++; 00213 } 00214 for(i = 0; i < NUM_SECTIONS; i++) { 00215 if(GetSectInt(mech, i) != GetSectInt(omech, i)) 00216 SetSectInt(omech, i, GetSectInt(mech, i)); 00217 if(GetSectArmor(mech, i) != GetSectArmor(omech, i)) 00218 SetSectArmor(omech, i, GetSectArmor(mech, i)); 00219 if(GetSectRArmor(mech, i) != GetSectRArmor(omech, i)) 00220 SetSectRArmor(omech, i, GetSectRArmor(mech, i)); 00221 for(j = 0; j < NUM_CRITICALS; j++) 00222 if(GetPartType(mech, i, j) && !IsCrap(GetPartType(mech, i, j))) { 00223 if(PartIsDestroyed(mech, i, j) && 00224 !PartIsDestroyed(omech, i, j)) { 00225 /* Blast a part */ 00226 DestroyPart(omech, i, j); 00227 do_mag = 1; 00228 } else if(!PartIsDestroyed(mech, i, j) && 00229 PartIsDestroyed(omech, i, j)) { 00230 mech_RepairPart(omech, i, j); 00231 SetPartTempNuke(omech, i, j, 0); 00232 do_mag = 1; 00233 } 00234 if(IsAmmo(GetPartType(mech, i, j))) { 00235 if(GetPartData(mech, i, j) != GetPartData(omech, i, j)) 00236 SetPartData(omech, i, j, GetPartData(mech, i, j)); 00237 } else { 00238 if(PartTempNuke(mech, i, j) != PartTempNuke(omech, i, j)) 00239 SetPartTempNuke(omech, i, j, 00240 PartTempNuke(mech, i, j)); 00241 00242 } 00243 } 00244 } 00245 if(do_mag && MechType(omech) == CLASS_MECH) 00246 do_magic(omech); 00247 }
static char* bv2text | ( | int | i | ) | [static] |
Definition at line 378 of file glue.scode.c.
References bv_val(), c, and SBUF_SIZE.
Referenced by fun_btmechfreqs(), and RetrieveValue().
00379 { 00380 static char buf[SBUF_SIZE]; 00381 int p = 1; 00382 char *c = buf; 00383 00384 while (i > 0) { 00385 if(i & 1) 00386 *(c++) = bv_val(p, 1); 00387 i >>= 1; 00388 p <<= 1; 00389 } 00390 if(c == buf) 00391 *(c++) = '-'; 00392 *c = 0; 00393 return buf; 00394 }
static int bv_val | ( | int | in, | |
int | mode | |||
) | [static] |
Definition at line 328 of file glue.scode.c.
Referenced by bv2text(), and text2bv().
00329 { 00330 int p = 0; 00331 00332 if(mode == 0) { 00333 if(in >= 'a' && in <= 'z') 00334 return 1 << (in - 'a'); 00335 return 1 << ('z' - 'a' + 1 + (in - 'A')); 00336 } 00337 while (in > 0) { 00338 p++; 00339 in >>= 1; 00340 } 00341 /* Hmm. */ 00342 p--; 00343 if(p > ('z' - 'a')) 00344 return 'A' + (p - ('z' - 'a' + 1)); 00345 return 'a' + p; 00346 }
void correct_speed | ( | MECH * | ) |
Definition at line 39 of file crit.c.
References MechDesiredSpeed, MechMaxSpeed, MechSpeed, MMaxSpeed, and SetCargoWeight().
Referenced by DoMotiveSystemHit(), fun_btsetmaxspeed(), mech_attachcables(), mech_detachcables(), mech_dropoff(), mech_embark(), mech_loadcargo(), mech_pickup(), mech_udisembark(), mech_unloadcargo(), NormalizeAllActuatorCrits(), and NormalizeLocActuatorCrits().
00040 { 00041 float maxspeed = MMaxSpeed(mech); 00042 int neg = 1; 00043 00044 if(MechMaxSpeed(mech) < 0.0) 00045 MechMaxSpeed(mech) = 0.0; 00046 SetCargoWeight(mech); 00047 if(MechDesiredSpeed(mech) < -0.1) { 00048 maxspeed = maxspeed * 2.0 / 3.0; 00049 neg = -1; 00050 } 00051 if(fabs(MechDesiredSpeed(mech)) > maxspeed) 00052 MechDesiredSpeed(mech) = (float) maxspeed *neg; 00053 00054 if(fabs(MechSpeed(mech)) > maxspeed) 00055 MechSpeed(mech) = (float) maxspeed *neg; 00056 }
void fun_btaddstores | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1318 of file glue.scode.c.
References ADDSTORES_MAX, econ_change_items(), find_matching_long_part(), find_matching_short_part(), find_matching_vlong_part(), FUNCHECK, get_parts_vlong_name(), Good_obj, loc, match_thing(), MBUF_SIZE, safe_tprintf_str(), SendEcon, tprintf(), and WizR.
01320 { 01321 /* fargs[0] = mech/map 01322 fargs[1] = partname 01323 fargs[2] = quantity 01324 */ 01325 int loc; 01326 int index = -1, id = 0, brand = 0, count; 01327 01328 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01329 01330 loc = match_thing(player, fargs[0]); 01331 FUNCHECK(!Good_obj(loc), "#-1 INVALID TARGET"); 01332 01333 FUNCHECK(strlen(fargs[1]) >= MBUF_SIZE, "#-1 PARTNAME TOO LONG"); 01334 01335 FUNCHECK(!fargs[1], "#-1 NEED PARTNAME"); 01336 01337 /* Add a limit to the number of parts you can add at once to prevent reaching the integer limits. */ 01338 count = atoi(fargs[2]); 01339 if(count > ADDSTORES_MAX) { 01340 count = ADDSTORES_MAX; 01341 } 01342 01343 FUNCHECK(!count, "1"); 01344 FUNCHECK(!find_matching_short_part(fargs[1], &index, &id, &brand) && 01345 !find_matching_vlong_part(fargs[1], &index, &id, &brand) && 01346 !find_matching_long_part(fargs[1], &index, &id, &brand), "0"); 01347 econ_change_items(loc, id, brand, count); 01348 SendEcon(tprintf("#%d added %d %s to #%d", player, count, 01349 get_parts_vlong_name(id, brand), loc)); 01350 safe_tprintf_str(buff, bufc, "1"); 01351 } /* end btaddstores() */
void fun_btarmorstatus | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 966 of file glue.scode.c.
References armorstatus_func(), Examinable, FindObjectsData(), FUNCHECK, IsMech, match_thing(), NOTHING, safe_tprintf_str(), and WizR.
00968 { 00969 /* fargs[0] = id of the mech 00970 * fargs[1] = location to show 00971 */ 00972 dbref it; 00973 char *infostr; 00974 MECH *mech; 00975 00976 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 00977 it = match_thing(player, fargs[0]); 00978 FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1 NOT A MECH"); 00979 FUNCHECK(!IsMech(it), "#-1 NOT A MECH"); 00980 FUNCHECK(!(mech = FindObjectsData(it)), "#-1"); 00981 infostr = armorstatus_func(mech, fargs[1]); /* fargs[1] unguaranteed ! */ 00982 safe_tprintf_str(buff, bufc, infostr ? infostr : "#-1 ERROR"); 00983 }
void fun_btarmorstatus_ref | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1023 of file glue.scode.c.
References armorstatus_func(), FUNCHECK, load_refmech(), safe_tprintf_str(), and WizR.
01026 { 01027 /* fargs[0] = ref of the mech 01028 * fargs[1] = location to show 01029 */ 01030 char *infostr; 01031 MECH *mech; 01032 01033 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01034 FUNCHECK((mech = load_refmech(fargs[0])) == NULL, "#-1 NO SUCH MECH"); 01035 infostr = armorstatus_func(mech, fargs[1]); /* fargs[1] unguaranteed ! */ 01036 safe_tprintf_str(buff, bufc, infostr ? infostr : "#-1 ERROR"); 01037 }
void fun_btcritslot | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1551 of file glue.scode.c.
References critslot_func(), Examinable, FindObjectsData(), fn_range_check(), FUNCHECK, IsMech, match_thing(), NOTHING, safe_tprintf_str(), and WizR.
01553 { 01554 /* fargs[0] = id of the mech 01555 fargs[1] = location name 01556 fargs[2] = critslot 01557 fargs[3] = partname type flag, 0 template name, 1 repair part name (differentiate Ammo types basically) 01558 */ 01559 dbref it; 01560 MECH *mech; 01561 01562 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01563 01564 if(!fn_range_check("BTCRITSLOT", nfargs, 3, 4, buff, bufc)) 01565 return; 01566 01567 it = match_thing(player, fargs[0]); 01568 FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1 NOT A MECH"); 01569 FUNCHECK(!IsMech(it), "#-1 NOT A MECH"); 01570 FUNCHECK(!(mech = FindObjectsData(it)), "#-1 INVALID MECH"); 01571 01572 safe_tprintf_str(buff, bufc, "%s", 01573 critslot_func(mech, fargs[1], fargs[2], fargs[3])); 01574 }
void fun_btcritslot_ref | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1576 of file glue.scode.c.
References critslot_func(), fn_range_check(), FUNCHECK, load_refmech(), safe_tprintf_str(), and WizR.
01578 { 01579 /* fargs[0] = ref 01580 fargs[1] = location name 01581 fargs[2] = critslot 01582 fargs[3] = partname type flag, 0 template name, 1 repair part name (differentiate Ammo types basically) 01583 */ 01584 MECH *mech; 01585 01586 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01587 01588 if(!fn_range_check("BTCRITSLOT_REF", nfargs, 3, 4, buff, bufc)) 01589 return; 01590 FUNCHECK((mech = load_refmech(fargs[0])) == NULL, "#-1 NO SUCH MECH"); 01591 01592 safe_tprintf_str(buff, bufc, "%s", 01593 critslot_func(mech, fargs[1], fargs[2], fargs[3])); 01594 }
void fun_btcritstatus | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 947 of file glue.scode.c.
References critstatus_func(), Examinable, FindObjectsData(), FUNCHECK, IsMech, match_thing(), NOTHING, safe_tprintf_str(), and WizR.
00949 { 00950 /* fargs[0] = id of the mech 00951 * fargs[1] = location to show 00952 */ 00953 dbref it; 00954 char *critstr; 00955 MECH *mech; 00956 00957 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 00958 it = match_thing(player, fargs[0]); 00959 FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1 NOT A MECH"); 00960 FUNCHECK(!IsMech(it), "#-1 NOT A MECH"); 00961 FUNCHECK(!(mech = FindObjectsData(it)), "#-1"); 00962 critstr = critstatus_func(mech, fargs[1]); /* fargs[1] unguaranteed ! */ 00963 safe_tprintf_str(buff, bufc, critstr ? critstr : "#-1 ERROR"); 00964 }
void fun_btcritstatus_ref | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1007 of file glue.scode.c.
References critstatus_func(), FUNCHECK, load_refmech(), safe_tprintf_str(), and WizR.
01010 { 01011 /* fargs[0] = ref of the mech 01012 * fargs[1] = location to show 01013 */ 01014 char *critstr; 01015 MECH *mech; 01016 01017 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01018 FUNCHECK((mech = load_refmech(fargs[0])) == NULL, "#-1 NO SUCH MECH"); 01019 critstr = critstatus_func(mech, fargs[1]); /* fargs[1] unguaranteed ! */ 01020 safe_tprintf_str(buff, bufc, critstr ? critstr : "#-1 ERROR"); 01021 }
void fun_btdamagemech | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1093 of file glue.scode.c.
References dodamage_func(), Examinable, FindObjectsData(), FUNCHECK, IsMech, match_thing(), NOTHING, Readnum, safe_tprintf_str(), and WizR.
01095 { 01096 /* 01097 * fargs[0] = dbref of MECH object 01098 * fargs[1] = total amount of damage 01099 * fargs[2] = clustersize 01100 * fargs[3] = direction of 'attack' 01101 * fargs[4] = (try to) force crit 01102 * fargs[5] = message to send to damaged 'mech 01103 * fargs[6] = message to MechLOSBroadcast, prepended by mech name 01104 */ 01105 01106 int totaldam, clustersize, direction, iscrit; 01107 MECH *mech; 01108 dbref it; 01109 01110 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01111 it = match_thing(player, fargs[0]); 01112 FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1 NOT A MECH"); 01113 FUNCHECK(!IsMech(it), "#-1 NOT A MECH"); 01114 FUNCHECK(!(mech = FindObjectsData(it)), "#-1 UNABLE TO GET MECHDATA"); 01115 FUNCHECK(Readnum(totaldam, fargs[1]) || totaldam < 1 01116 || totaldam > 1000, "#-1 INVALID 2ND ARG"); 01117 FUNCHECK(Readnum(clustersize, fargs[2]) 01118 || clustersize < 1, "#-1 INVALID 3RD ARG"); 01119 FUNCHECK(Readnum(direction, fargs[3]), "#-1 INVALID 4TH ARG"); 01120 FUNCHECK(Readnum(iscrit, fargs[4]), "#-1 INVALID 5TH ARG"); 01121 safe_tprintf_str(buff, bufc, "%d", dodamage_func(player, mech, 01122 totaldam, clustersize, 01123 direction, iscrit, 01124 fargs[5], fargs[6])); 01125 }
void fun_btdamages | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 929 of file glue.scode.c.
References damages_func(), Examinable, FindObjectsData(), FUNCHECK, IsMech, match_thing(), NOTHING, safe_tprintf_str(), and WizR.
00931 { 00932 /* fargs[0] = id of the mech 00933 */ 00934 dbref it; 00935 char *damstr; 00936 MECH *mech; 00937 00938 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 00939 it = match_thing(player, fargs[0]); 00940 FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1 NOT A MECH"); 00941 FUNCHECK(!IsMech(it), "#-1 NOT A MECH"); 00942 FUNCHECK(!(mech = FindObjectsData(it)), "#-1"); 00943 damstr = damages_func(mech); 00944 safe_tprintf_str(buff, bufc, damstr ? damstr : "#-1 ERROR"); 00945 }
void fun_btdesignex | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 918 of file glue.scode.c.
References mechref_path(), and safe_tprintf_str().
00920 { 00921 char *id = fargs[0]; 00922 00923 if(mechref_path(id)) { 00924 safe_tprintf_str(buff, bufc, "1"); 00925 } else 00926 safe_tprintf_str(buff, bufc, "0"); 00927 }
void fun_btengrate | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1916 of file glue.scode.c.
References Examinable, FUNCHECK, getMech(), IsMech, match_thing(), MechEngineSize, NOTHING, safe_tprintf_str(), susp_factor(), and WizR.
01918 { 01919 dbref mechdb; 01920 MECH *mech; 01921 01922 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01923 mechdb = match_thing(player, fargs[0]); 01924 FUNCHECK(mechdb == NOTHING 01925 || !Examinable(player, mechdb), "#-1 NOT A MECH"); 01926 FUNCHECK(!IsMech(mechdb), "#-1 NOT A MECH"); 01927 FUNCHECK(!(mech = getMech(mechdb)), "#-1"); 01928 01929 safe_tprintf_str(buff, bufc, "%d %d", MechEngineSize(mech), 01930 susp_factor(mech)); 01931 }
void fun_btengrate_ref | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1933 of file glue.scode.c.
References FUNCHECK, load_refmech(), MechEngineSize, safe_tprintf_str(), susp_factor(), and WizR.
01935 { 01936 MECH *mech; 01937 01938 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01939 FUNCHECK(!(mech = load_refmech(fargs[0])), "#-1 INVALID REF"); 01940 01941 safe_tprintf_str(buff, bufc, "%d %d", MechEngineSize(mech), 01942 susp_factor(mech)); 01943 }
void fun_btfasabasecost_ref | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1945 of file glue.scode.c.
References FUNCHECK, load_refmech(), safe_tprintf_str(), and WizR.
01948 { 01949 #ifdef BT_ADVANCED_ECON 01950 MECH *mech; 01951 01952 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01953 FUNCHECK(!(mech = load_refmech(fargs[0])), "#-1 INVALID REF"); 01954 01955 safe_tprintf_str(buff, bufc, "%lld", CalcFasaCost(mech)); 01956 #else 01957 safe_tprintf_str(buff, bufc, "#-1 NO ECONDB SUPPORT"); 01958 #endif 01959 }
void fun_btgetbv | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1784 of file glue.scode.c.
References Examinable, FindObjectsData(), FUNCHECK, IsMech, match_thing(), MechBV, NOTHING, safe_tprintf_str(), tprintf(), and WizR.
01786 { 01787 dbref it; 01788 MECH *mech; 01789 int bv; 01790 01791 it = match_thing(player, fargs[0]); 01792 FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1 NOT A MECH"); 01793 FUNCHECK(!IsMech(it), "#-1 NOT A MECH"); 01794 FUNCHECK(!(mech = FindObjectsData(it)), "#-1"); 01795 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01796 01797 bv = CalculateBV(mech, 100, 100); 01798 MechBV(mech) = bv; 01799 safe_tprintf_str(buff, bufc, tprintf("%d", bv)); 01800 }
void fun_btgetbv_ref | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1802 of file glue.scode.c.
References FUNCHECK, load_refmech(), MechBV, safe_tprintf_str(), and WizR.
01804 { 01805 MECH *mech; 01806 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01807 FUNCHECK((mech = load_refmech(fargs[0])) == NULL, "#-1 NO SUCH MECH"); 01808 01809 MechBV(mech) = CalculateBV(mech, 4, 5); 01810 safe_tprintf_str(buff, bufc, "%d", MechBV(mech)); 01811 }
void fun_btgetpartcost | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 2329 of file glue.scode.c.
References find_matching_long_part(), find_matching_vlong_part(), FUNCHECK, I2Special, safe_tprintf_str(), SWORD, and WizR.
02331 { 02332 #ifdef BT_ADVANCED_ECON 02333 int i = -1, p, index, b; 02334 02335 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 02336 if(!find_matching_long_part(fargs[0], &i, &p, &b)) { 02337 i = -1; 02338 FUNCHECK(!find_matching_vlong_part(fargs[0], &i, &p, &b), 02339 "#-1 INVALID PART NAME"); 02340 } 02341 if(strstr(fargs[0], "Sword") && !strstr(fargs[0], "PC.")) 02342 p = I2Special(SWORD); 02343 02344 safe_tprintf_str(buff, bufc, "%lld", GetPartCost(p)); 02345 #else 02346 safe_tprintf_str(buff, bufc, "#-1 NO ECONDB SUPPORT"); 02347 #endif 02348 }
void fun_btgetrange | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1598 of file glue.scode.c.
References Elevation, Examinable, FaMechRange, FindRange(), fn_range_check(), FUNCHECK, getMap(), getMech(), IsMap(), IsMech, MAP::map_height, MAP::map_width, MapCoordToRealCoord(), MECH::mapindex, match_thing(), MechFX, MechFY, MechFZ, NOTHING, NUMBERS, safe_tprintf_str(), WizR, and ZSCALE.
01600 { 01601 /* fargs[0] - [4] Combos of XY or DBref */ 01602 dbref mechAdb, mechBdb, mapdb; 01603 MECH *mechA, *mechB; 01604 MAP *map; 01605 float fxA, fyA, fzA, fxB, fyB, fzB; 01606 int xA, yA, zA, xB, yB, zB; 01607 01608 FUNCHECK(!WizR(player), "#=1 PERMISSION DENIED"); 01609 01610 if(!fn_range_check("BTGETRANGE", nfargs, 3, 7, buff, bufc)) 01611 return; 01612 01613 mapdb = match_thing(player, fargs[0]); 01614 FUNCHECK(mapdb == NOTHING 01615 || !Examinable(player, mapdb), "#-1 INVALID MAPDB"); 01616 FUNCHECK(!IsMap(mapdb), "#-1 OBJECT NOT MAP"); 01617 FUNCHECK(!(map = getMap(mapdb)), "#-1 INVALID MAP"); 01618 01619 switch (nfargs) { 01620 case 3: 01621 mechAdb = match_thing(player, fargs[1]); 01622 FUNCHECK(mechAdb == NOTHING 01623 || !Examinable(player, mechAdb), "#-1 INVALID MECHDBREF"); 01624 mechBdb = match_thing(player, fargs[2]); 01625 FUNCHECK(mechBdb == NOTHING 01626 || !Examinable(player, mechBdb), "#-1 INVALID MECHDBREF"); 01627 FUNCHECK(!IsMech(mechAdb) || !IsMech(mechBdb), "#-1 INVALID MECH"); 01628 FUNCHECK(!(mechA = getMech(mechAdb)) 01629 || !(mechB = getMech(mechBdb)), "#-1 INVALID MECH"); 01630 FUNCHECK(mechA->mapindex != mapdb 01631 || mechB->mapindex != mapdb, "#-1 MECH NOT ON MAP"); 01632 safe_tprintf_str(buff, bufc, "%f", FaMechRange(mechA, mechB)); 01633 return; 01634 case 4: 01635 if(strspn(fargs[1], NUMBERS) < 1) { 01636 mechAdb = match_thing(player, fargs[1]); 01637 FUNCHECK(strspn(fargs[2], NUMBERS) < 1, "#-1 INVALID COORDS"); 01638 xA = atoi(fargs[2]); 01639 FUNCHECK(strspn(fargs[3], NUMBERS) < 1, "#-1 INVALID COORDS"); 01640 yA = atoi(fargs[3]); 01641 } else { 01642 FUNCHECK(strspn(fargs[1], NUMBERS) < 1, "#-1 INVALID COORDS"); 01643 xA = atoi(fargs[1]); 01644 FUNCHECK(strspn(fargs[2], NUMBERS) < 1, "#-1 INVALID COORDS"); 01645 yA = atoi(fargs[2]); 01646 mechAdb = match_thing(player, fargs[3]); 01647 } 01648 FUNCHECK(mechAdb == NOTHING 01649 || !Examinable(player, mechAdb), "#-1 INVALID MECHDBREF"); 01650 FUNCHECK(!IsMech(mechAdb), "#-1 INVALID MECH"); 01651 FUNCHECK(!(mechA = getMech(mechAdb)), "#-1 INVALID MECH"); 01652 FUNCHECK(mechA->mapindex != mapdb, "#-1 MECH NOT ON MAP"); 01653 FUNCHECK(xA < 0 || yA < 0 || xA > map->map_width 01654 || yA > map->map_height, "#-1 INVALID COORDS"); 01655 MapCoordToRealCoord(xA, yA, &fxA, &fyA); 01656 safe_tprintf_str(buff, bufc, "%f", 01657 FindRange(MechFX(mechA), MechFY(mechA), 01658 MechFZ(mechA), fxA, fyA, Elevation(map, xA, 01659 yA) * 01660 ZSCALE)); 01661 return; 01662 case 5: 01663 if(strspn(fargs[1], NUMBERS) < 1 || strspn(fargs[4], NUMBERS) < 1) { 01664 // this is the (map, mech, x, y, z) or (map, x, y, z, mech) condition 01665 if(strspn(fargs[1], NUMBERS) < 1) { 01666 // mech first 01667 mechAdb = match_thing(player, fargs[1]); 01668 FUNCHECK(strspn(fargs[2], NUMBERS) < 1, "#-1 INVALID COORDS"); 01669 xA = atoi(fargs[2]); 01670 FUNCHECK(strspn(fargs[3], NUMBERS) < 1, "#-1 INVALID COORDS"); 01671 yA = atoi(fargs[3]); 01672 FUNCHECK(strspn(fargs[4], NUMBERS) < 1, "#-1 INVALID COORDS"); 01673 zA = atoi(fargs[4]); 01674 } else { 01675 FUNCHECK(strspn(fargs[1], NUMBERS) < 1, "#-1 INVALID COORDS"); 01676 xA = atoi(fargs[1]); 01677 FUNCHECK(strspn(fargs[2], NUMBERS) < 1, "#-1 INVALID COORDS"); 01678 yA = atoi(fargs[2]); 01679 FUNCHECK(strspn(fargs[3], NUMBERS) < 1, "#-1 INVALID COORDS"); 01680 zA = atoi(fargs[3]); 01681 mechAdb = match_thing(player, fargs[4]); 01682 } 01683 FUNCHECK(mechAdb == NOTHING 01684 || !Examinable(player, mechAdb), 01685 "#-1 INVALID MECHDBREF"); 01686 FUNCHECK(!IsMech(mechAdb), "#-1 INVALID MECH"); 01687 FUNCHECK(!(mechA = getMech(mechAdb)), "#-1 INVALID MECH"); 01688 FUNCHECK(mechA->mapindex != mapdb, "#-1 MECH NOT ON MAP"); 01689 FUNCHECK(xA < 0 || yA < 0 || xA > map->map_width 01690 || yA > map->map_height, "#-1 INVALID COORDS"); 01691 MapCoordToRealCoord(xA, yA, &fxA, &fyA); 01692 safe_tprintf_str(buff, bufc, "%f", 01693 FindRange(MechFX(mechA), MechFY(mechA), 01694 MechFZ(mechA), fxA, fyA, zA * ZSCALE)); 01695 return; 01696 } 01697 // tihs is the (map, x1, y1, x2, y2) condition 01698 FUNCHECK(strspn(fargs[1], NUMBERS) < 1, "#-1 INVALID COORDS"); 01699 xA = atoi(fargs[1]); 01700 FUNCHECK(strspn(fargs[2], NUMBERS) < 1, "#-1 INVALID COORDS"); 01701 yA = atoi(fargs[2]); 01702 FUNCHECK(xA < 0 || yA < 0 || xA > map->map_width 01703 || yA > map->map_height, "#-1 INVALID COORDS"); 01704 FUNCHECK(strspn(fargs[3], NUMBERS) < 1, "#-1 INVALID COORDS"); 01705 xB = atoi(fargs[3]); 01706 FUNCHECK(strspn(fargs[4], NUMBERS) < 1, "#-1 INVALID COORDS"); 01707 yB = atoi(fargs[4]); 01708 FUNCHECK(xB < 0 || yB < 0 || xB > map->map_width 01709 || yB > map->map_height, "#-1 INVALID COORDS"); 01710 MapCoordToRealCoord(xA, yA, &fxA, &fyA); 01711 MapCoordToRealCoord(xB, yB, &fxB, &fyB); 01712 safe_tprintf_str(buff, bufc, "%f", 01713 FindRange(fxA, fyA, Elevation(map, xA, yA) * ZSCALE, 01714 fxB, fyB, Elevation(map, xB, yB))); 01715 return; 01716 case 7: 01717 FUNCHECK(strspn(fargs[1], NUMBERS) < 1, "#-1 INVALID COORDS"); 01718 xA = atoi(fargs[1]); 01719 FUNCHECK(strspn(fargs[2], NUMBERS) < 1, "#-1 INVALID COORDS"); 01720 yA = atoi(fargs[2]); 01721 FUNCHECK(strspn(fargs[3], NUMBERS) < 1, "#-1 INVALID COORDS"); 01722 zA = atoi(fargs[3]); 01723 FUNCHECK(strspn(fargs[4], NUMBERS) < 1, "#-1 INVALID COORDS"); 01724 xB = atoi(fargs[4]); 01725 FUNCHECK(strspn(fargs[5], NUMBERS) < 1, "#-1 INVALID COORDS"); 01726 yB = atoi(fargs[5]); 01727 FUNCHECK(strspn(fargs[6], NUMBERS) < 1, "#-1 INVALID COORDS"); 01728 zB = atoi(fargs[6]); 01729 MapCoordToRealCoord(xA, yA, &fxA, &fyA); 01730 MapCoordToRealCoord(xB, yB, &fxB, &fyB); 01731 safe_tprintf_str(buff, bufc, "%f", 01732 FindRange(fxA, fyA, zA * ZSCALE, fxB, fyB, 01733 zB * ZSCALE)); 01734 return; 01735 default: 01736 safe_tprintf_str(buff, bufc, "#-1 INVALID ARGUMENTS"); 01737 return; 01738 } 01739 }
void fun_btgetrealmaxspeed | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1765 of file glue.scode.c.
References Examinable, FindObjectsData(), FUNCHECK, IsMech, match_thing(), MechCargoMaxSpeed(), MechMaxSpeed, NOTHING, safe_tprintf_str(), tprintf(), and WizR.
01768 { 01769 dbref it; 01770 MECH *mech; 01771 float speed; 01772 01773 it = match_thing(player, fargs[0]); 01774 FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1 NOT A MECH"); 01775 FUNCHECK(!IsMech(it), "#-1 NOT A MECH"); 01776 FUNCHECK(!(mech = FindObjectsData(it)), "#-1"); 01777 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01778 01779 speed = MechCargoMaxSpeed(mech, MechMaxSpeed(mech)); 01780 01781 safe_tprintf_str(buff, bufc, tprintf("%f", speed)); 01782 }
void fun_btgetweight | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1479 of file glue.scode.c.
References find_matching_long_part(), find_matching_vlong_part(), FUNCHECK, GetPartWeight(), safe_tprintf_str(), tprintf(), and WizR.
01481 { 01482 /* 01483 fargs[0] = stringname of part 01484 */ 01485 float sw = 0; 01486 int i = -1, p, b; 01487 01488 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01489 01490 if(!find_matching_long_part(fargs[0], &i, &p, &b)) { 01491 i = -1; 01492 FUNCHECK(!find_matching_vlong_part(fargs[0], &i, &p, &b), 01493 "#-1 INVALID PART NAME"); 01494 } 01495 sw = GetPartWeight(p); 01496 if(sw <= 0) 01497 sw = (1024 * 100); 01498 safe_tprintf_str(buff, bufc, tprintf("%.3f", (float) sw / 1024)); 01499 }
void fun_btgetxcodevalue | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 630 of file glue.scode.c.
References Examinable, FindObjectsData(), FUNCHECK, match_thing(), GMV::name, name, NOTHING, RetrieveValue(), safe_tprintf_str(), scode_in_out, WhichSpecial(), WizR, and xcode_data.
00632 { 00633 /* fargs[0] = id of the mech 00634 fargs[1] = name of the value 00635 */ 00636 dbref it; 00637 int i; 00638 void *foo; 00639 int spec; 00640 00641 it = match_thing(player, fargs[0]); 00642 FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1"); 00643 spec = WhichSpecial(it); 00644 FUNCHECK(!(foo = FindObjectsData(it)), "#-1"); 00645 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 00646 for(i = 0; xcode_data[i].name; i++) 00647 if(!strcasecmp(fargs[1], xcode_data[i].name) && 00648 xcode_data[i].gtype == spec && 00649 (scode_in_out[xcode_data[i].type] & 1)) { 00650 safe_tprintf_str(buff, bufc, "%s", RetrieveValue(foo, i)); 00651 return; 00652 } 00653 safe_tprintf_str(buff, bufc, "#-1"); 00654 return; 00655 }
void fun_btgetxcodevalue_ref | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 657 of file glue.scode.c.
References FUNCHECK, GTYPE_MECH, load_refmech(), name, GMV::name, RetrieveValue(), safe_tprintf_str(), scode_in_out, WizR, and xcode_data.
00660 { 00661 /* fargs[0] = mech ref 00662 fargs[1] = name of the value 00663 */ 00664 int i; 00665 MECH *foo; 00666 int spec; 00667 00668 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 00669 FUNCHECK((foo = load_refmech(fargs[0])) == NULL, "#-1 NO SUCH MECH"); 00670 spec = GTYPE_MECH; 00671 for(i = 0; xcode_data[i].name; i++) 00672 if(!strcasecmp(fargs[1], xcode_data[i].name) && 00673 xcode_data[i].gtype == spec && 00674 (scode_in_out[xcode_data[i].type] & 1)) { 00675 safe_tprintf_str(buff, bufc, "%s", RetrieveValue(foo, i)); 00676 return; 00677 } 00678 safe_tprintf_str(buff, bufc, "#-1"); 00679 return; 00680 }
void fun_bthexemit | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1147 of file glue.scode.c.
References FUNCHECK, getMap(), HexLOSBroadcast(), MAP::map_height, MAP::map_width, match_thing(), safe_tprintf_str(), WizR, x, and y.
01149 { 01150 /* fargs[0] = mapref 01151 fargs[1] = x coordinate 01152 fargs[2] = y coordinate 01153 fargs[3] = message 01154 */ 01155 MAP *map; 01156 int x = -1, y = -1; 01157 char *msg = fargs[3]; 01158 dbref mapnum; 01159 01160 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01161 01162 while (msg && *msg && isspace(*msg)) 01163 msg++; 01164 FUNCHECK(!msg || !*msg, "#-1 INVALID MESSAGE"); 01165 01166 mapnum = match_thing(player, fargs[0]); 01167 FUNCHECK(mapnum < 0, "#-1 INVALID MAP"); 01168 map = getMap(mapnum); 01169 FUNCHECK(!map, "#-1 INVALID MAP"); 01170 01171 x = atoi(fargs[1]); 01172 y = atoi(fargs[2]); 01173 FUNCHECK(x < 0 || x > map->map_width || y < 0 || y > map->map_height, 01174 "#-1 INVALID COORDINATES"); 01175 HexLOSBroadcast(map, x, y, msg); 01176 safe_tprintf_str(buff, bufc, "1"); 01177 }
void fun_bthexinblz | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 2424 of file glue.scode.c.
References mapobj_struct::datai, FindHexRange(), first_mapobj(), FUNCHECK, getMap(), Good_obj, MAP::map_height, MAP::map_width, MapCoordToRealCoord(), match_thing(), next_mapobj(), safe_tprintf_str(), TYPE_B_LZ, WizR, mapobj_struct::x, x, mapobj_struct::y, and y.
02426 { 02427 dbref mapdb; 02428 MAP *map; 02429 mapobj *o; 02430 int x, y, bl = 0; 02431 float fx, fy, tx, ty; 02432 02433 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 02434 02435 mapdb = match_thing(player, fargs[0]); 02436 FUNCHECK(!Good_obj(mapdb), "#-1 INVALID MAP"); 02437 FUNCHECK(!(map = getMap(mapdb)), "#-1 INVALID MAP"); 02438 x = atoi(fargs[1]); 02439 y = atoi(fargs[2]); 02440 FUNCHECK(x < 0 || y < 0 || x > map->map_width 02441 || y > map->map_height, "#-1 INVALID COORDS"); 02442 MapCoordToRealCoord(x, y, &fx, &fy); 02443 02444 for(o = first_mapobj(map, TYPE_B_LZ); o; o = next_mapobj(o)) { 02445 if(abs(x - o->x) > o->datai || abs(y - o->y) > o->datai) 02446 continue; 02447 MapCoordToRealCoord(o->x, o->y, &tx, &ty); 02448 if(FindHexRange(fx, fy, tx, ty) <= o->datai) { 02449 bl = 1; 02450 break; 02451 } 02452 } 02453 safe_tprintf_str(buff, bufc, "%d", bl); 02454 }
void fun_bthexlos | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1247 of file glue.scode.c.
References Examinable, FindHexRange(), FUNCHECK, getMap(), getMech(), InLineOfSight_NB(), IsMech, MAP::map_height, MAP::map_width, MapCoordToRealCoord(), MECH::mapindex, match_thing(), MechFX, MechFY, NOTHING, safe_tprintf_str(), WizR, x, and y.
01249 { 01250 /* fargs[0] = mech 01251 fargs[1] = x 01252 fargs[2] = y 01253 */ 01254 01255 MECH *mech; 01256 MAP *map; 01257 int x = -1, y = -1, mechnum; 01258 float fx, fy; 01259 01260 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01261 mechnum = match_thing(player, fargs[0]); 01262 FUNCHECK(mechnum == NOTHING || !Examinable(player, mechnum), 01263 "#-1 INVALID MECH"); 01264 FUNCHECK(!IsMech(mechnum), "#-1 INVALID MECH"); 01265 FUNCHECK(!(mech = getMech(mechnum)), "#-1 INVALID MECH"); 01266 FUNCHECK(!(map = getMap(mech->mapindex)), "#-1 INTERNAL ERROR"); 01267 01268 x = atoi(fargs[1]); 01269 y = atoi(fargs[2]); 01270 FUNCHECK(x < 0 || x > map->map_width || y < 0 || y > map->map_height, 01271 "#-1 INVALID COORDINATES"); 01272 MapCoordToRealCoord(x, y, &fx, &fy); 01273 if(InLineOfSight_NB(mech, NULL, x, y, 01274 FindHexRange(MechFX(mech), MechFY(mech), fx, fy))) 01275 safe_tprintf_str(buff, bufc, "1"); 01276 else 01277 safe_tprintf_str(buff, bufc, "0"); 01278 }
void fun_btid2db | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1211 of file glue.scode.c.
References Examinable, FindMechOnMap(), FindTargetDBREFFromMapNumber(), FlMechRange, FUNCHECK, getMap(), getMech(), InLineOfSight_NB(), IsMap(), IsMech, MECH::mapindex, match_thing(), MechX, MechY, NOTHING, safe_str, safe_tprintf_str(), and WizR.
01213 { 01214 /* fargs[0] = mech 01215 fargs[1] = target ID */ 01216 MECH *target; 01217 MECH *mech = NULL; 01218 dbref mechnum; 01219 01220 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01221 mechnum = match_thing(player, fargs[0]); 01222 FUNCHECK(mechnum == NOTHING || !Examinable(player, mechnum), 01223 "#-1 INVALID MECH/MAP"); 01224 FUNCHECK(strlen(fargs[1]) != 2, "#-1 INVALID TARGETID"); 01225 if(IsMech(mechnum)) { 01226 FUNCHECK(!(mech = getMech(mechnum)), "#-1 INVALID MECH"); 01227 mechnum = FindTargetDBREFFromMapNumber(mech, fargs[1]); 01228 } else if(IsMap(mechnum)) { 01229 MAP *map; 01230 FUNCHECK(!(map = getMap(mechnum)), "#-1 INVALID MAP"); 01231 mechnum = FindMechOnMap(map, fargs[1]); 01232 } else { 01233 safe_str("#-1 INVALID MECH/MAP", buff, bufc); 01234 return; 01235 } 01236 FUNCHECK(mechnum < 0, "#-1 INVALID TARGETID"); 01237 if(mech) { 01238 FUNCHECK(!(target = getMech(mechnum)), "#-1 INVALID TARGETID"); 01239 FUNCHECK(!InLineOfSight_NB(mech, target, MechX(target), MechY(target), 01240 FlMechRange(getMap(mech->mapindex), mech, 01241 target)), 01242 "#-1 INVALID TARGETID"); 01243 } 01244 safe_tprintf_str(buff, bufc, "#%d", (int) mechnum); 01245 }
void fun_btlistblz | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 2393 of file glue.scode.c.
References mapobj_struct::datai, first_mapobj(), FUNCHECK, getMap(), Good_obj, match_thing(), MBUF_SIZE, next_mapobj(), NUM_MAPOBJTYPES, safe_tprintf_str(), TYPE_B_LZ, WizR, mapobj_struct::x, and mapobj_struct::y.
02395 { 02396 char buf[MBUF_SIZE] = { '\0' }; 02397 dbref mapdb; 02398 MAP *map; 02399 mapobj *tmp; 02400 int i, count = 0, strcount = 0; 02401 02402 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 02403 02404 mapdb = match_thing(player, fargs[0]); 02405 FUNCHECK(!Good_obj(mapdb), "#-1 INVALID MAP"); 02406 FUNCHECK(!(map = getMap(mapdb)), "#-1 INVALID MAP"); 02407 02408 for(i = 0; i < NUM_MAPOBJTYPES; i++) 02409 for(tmp = first_mapobj(map, i); tmp; tmp = next_mapobj(tmp)) 02410 if(i == TYPE_B_LZ) { 02411 count++; 02412 if(count == 1) 02413 strcount += 02414 snprintf(buf + strcount, MBUF_SIZE - strcount, 02415 "%d %d %d", tmp->x, tmp->y, tmp->datai); 02416 else 02417 strcount += 02418 snprintf(buf + strcount, MBUF_SIZE - strcount, 02419 "|%d %d %d", tmp->x, tmp->y, tmp->datai); 02420 } 02421 safe_tprintf_str(buff, bufc, buf); 02422 }
void fun_btloadmap | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1387 of file glue.scode.c.
References FUNCHECK, getMap(), Good_obj, map_clearmechs(), map_load(), match_thing(), safe_str, and WizR.
01389 { 01390 /* fargs[0] = mapobject 01391 fargs[1] = mapname 01392 fargs[2] = clear or not to clear 01393 */ 01394 int mapdbref; 01395 MAP *map; 01396 01397 FUNCHECK(nfargs < 2 || nfargs > 3, 01398 "#-1 BTLOADMAP TAKES 2 OR 3 ARGUMENTS"); 01399 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01400 mapdbref = match_thing(player, fargs[0]); 01401 FUNCHECK(!Good_obj(mapdbref), "#-1 INVALID TARGET"); 01402 map = getMap(mapdbref); 01403 FUNCHECK(!map, "#-1 INVALID TARGET"); 01404 switch (map_load(map, fargs[1])) { 01405 case -1: 01406 safe_str("#-1 MAP NOT FOUND", buff, bufc); 01407 return; 01408 case -2: 01409 safe_str("#-1 INVALID MAP", buff, bufc); 01410 return; 01411 case 0: 01412 break; 01413 default: 01414 safe_str("#-1 UNKNOWN ERROR", buff, bufc); 01415 return; 01416 } 01417 /* For now, we're gonna ignore the third arg, and just clear mechs anyways*/ 01418 /* if(nfargs > 2 && xlate(fargs[2])) */ 01419 map_clearmechs(player, (void *) map, ""); 01420 safe_str("1", buff, bufc); 01421 }
void fun_btloadmech | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1423 of file glue.scode.c.
References clear_mech_from_LOS(), FUNCHECK, getMech(), Good_obj, match_thing(), mech_loadnew(), muxevent_remove_data(), safe_str, and WizR.
01425 { 01426 /* fargs[0] = mechobject 01427 fargs[1] = mechref 01428 */ 01429 int mechdbref; 01430 MECH *mech; 01431 01432 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01433 mechdbref = match_thing(player, fargs[0]); 01434 FUNCHECK(!Good_obj(mechdbref), "#-1 INVALID TARGET"); 01435 mech = getMech(mechdbref); 01436 FUNCHECK(!mech, "#-1 INVALID TARGET"); 01437 if(mech_loadnew(player, mech, fargs[1]) == 1) { 01438 muxevent_remove_data((void *) mech); 01439 clear_mech_from_LOS(mech); 01440 safe_str("1", buff, bufc); 01441 } else { 01442 safe_str("#-1 UNABLE TO LOAD TEMPLATE", buff, bufc); 01443 } 01444 }
void fun_btlosm2m | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1280 of file glue.scode.c.
References Examinable, FlMechRange, FUNCHECK, getMech(), InLineOfSight(), InLineOfSight_NB(), IsMech, MECH::mapindex, match_thing(), MechX, MechY, NOTHING, safe_tprintf_str(), and WizR.
01282 { 01283 /* fargs[0] = mech 01284 fargs[1] = target 01285 */ 01286 01287 int mechnum; 01288 MECH *mech, *target; 01289 01290 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01291 mechnum = match_thing(player, fargs[0]); 01292 FUNCHECK(mechnum == NOTHING || !Examinable(player, mechnum), 01293 "#-1 INVALID MECH"); 01294 FUNCHECK(!IsMech(mechnum), "#-1 INVALID MECH"); 01295 FUNCHECK(!(mech = getMech(mechnum)), "#-1 INVALID MECH"); 01296 01297 mechnum = match_thing(player, fargs[1]); 01298 FUNCHECK(mechnum == NOTHING || !Examinable(player, mechnum), 01299 "#-1 INVALID MECH"); 01300 FUNCHECK(!IsMech(mechnum), "#-1 INVALID MECH"); 01301 FUNCHECK(!(target = getMech(mechnum)), "#-1 INVALID MECH"); 01302 01303 if(InLineOfSight(mech, target, MechX(mech), MechY(mech), FlMechRange(getmap(mech->mapindex), mech, target))) 01304 if(InLineOfSight_NB(mech, target, MechX(mech), MechY (mech), FlMechRange(getmap(mech->mapindex), mech, target))) 01305 safe_tprintf_str(buff, bufc, "1"); 01306 else 01307 safe_tprintf_str(buff, bufc, "2"); 01308 else 01309 safe_tprintf_str(buff, bufc, "0"); 01310 01311 }
void fun_btmakepilotroll | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1179 of file glue.scode.c.
References Examinable, FindObjectsData(), FUNCHECK, IsMech, MadePilotSkillRoll(), match_thing(), MechFalls(), NOTHING, safe_tprintf_str(), and WizR.
01181 { 01182 /* fargs[0] = mechref 01183 fargs[1] = roll modifier 01184 fargs[2] = damage modifier 01185 */ 01186 01187 MECH *mech; 01188 int rollmod = 0, dammod = 0; 01189 dbref mechnum; 01190 01191 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01192 01193 mechnum = match_thing(player, fargs[0]); 01194 FUNCHECK(mechnum == NOTHING || !Examinable(player, mechnum), 01195 "#-1 INVALID MECH"); 01196 FUNCHECK(!IsMech(mechnum), "#-1 INVALID MECH"); 01197 FUNCHECK(!(mech = FindObjectsData(mechnum)), "#-1 INVALID MECH"); 01198 01199 /* No checking on rollmod/dammod, they're assumed to be 0 if invalid. */ 01200 rollmod = atoi(fargs[1]); 01201 dammod = atoi(fargs[2]); 01202 01203 if(MadePilotSkillRoll(mech, rollmod)) { 01204 safe_tprintf_str(buff, bufc, "1"); 01205 } else { 01206 MechFalls(mech, dammod, 1); 01207 safe_tprintf_str(buff, bufc, "0"); 01208 } 01209 }
void fun_btmapelev | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 877 of file glue.scode.c.
References Elevation, Examinable, FindObjectsData(), FUNCHECK, GTYPE_MAP, MAP::map_height, MAP::map_width, match_thing(), NOTHING, Readnum, safe_tprintf_str(), WhichSpecial(), x, and y.
00879 { 00880 /* fargs[0] = reference of map 00881 fargs[1] = x 00882 fargs[2] = y 00883 */ 00884 dbref it; 00885 int i; 00886 MAP *map; 00887 int x, y; 00888 int spec; 00889 00890 it = match_thing(player, fargs[0]); 00891 FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1"); 00892 spec = WhichSpecial(it); 00893 FUNCHECK(spec != GTYPE_MAP, "#-1"); 00894 FUNCHECK(!(map = FindObjectsData(it)), "#-1"); 00895 FUNCHECK(Readnum(x, fargs[1]), "#-2"); 00896 FUNCHECK(Readnum(y, fargs[2]), "#-2"); 00897 FUNCHECK(x < 0 || y < 0 || x >= map->map_width 00898 || y >= map->map_height, "?"); 00899 i = Elevation(map, x, y); 00900 if(i < 0) 00901 safe_tprintf_str(buff, bufc, "-%c", '0' + -i); 00902 else 00903 safe_tprintf_str(buff, bufc, "%c", '0' + i); 00904 }
void fun_btmapemit | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 2206 of file glue.scode.c.
References FUNCHECK, getMap(), MAP::map_height, MAP::map_width, MapBroadcast(), MapCoordToRealCoord(), MapLimitedBroadcast2d(), MapLimitedBroadcast3d(), match_thing(), safe_tprintf_str(), WizR, x, y, and ZSCALE.
02208 { 02209 /* fargs[0] = mapref 02210 fargs[1] = message 02211 02212 OR 02213 02214 fargs[0] = mapref 02215 fargs[1] = x 02216 fargs[2] = y 02217 fargs[3] = range 02218 fargs[4] = message 02219 02220 OR 02221 02222 fargs[0] = mapref 02223 fargs[1] = x 02224 fargs[2] = y 02225 fargs[3] = z 02226 fargs[4] = range 02227 fargs[5] = message 02228 02229 */ 02230 02231 MAP *map; 02232 dbref mapnum; 02233 float x, y, realX, realY, z, range; 02234 02235 FUNCHECK(nfargs < 2, "#-1 TOO FEW ARGUMENTS"); 02236 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 02237 mapnum = match_thing(player, fargs[0]); 02238 FUNCHECK(mapnum < 0, "#-1 INVALID MAP"); 02239 map = getMap(mapnum); 02240 FUNCHECK(!map, "#-1 INVALID MAP"); 02241 02242 switch (nfargs) { 02243 case 2: 02244 FUNCHECK(!fargs[1] || !*fargs[1], "#-1 INVALID MESSAGE"); 02245 MapBroadcast(map, fargs[1]); 02246 safe_tprintf_str(buff, bufc, "1"); 02247 break; 02248 case 5: 02249 x = atof(fargs[1]); 02250 y = atof(fargs[2]); 02251 range = atof(fargs[3]); 02252 FUNCHECK(x < 0 || x > map->map_width, "#-1 ILLEGAL X COORD"); 02253 FUNCHECK(y < 0 || y > map->map_height, "#-1 ILLEGAL Y COORD"); 02254 FUNCHECK(range < 0, "#-1 ILLEGAL RANGE"); 02255 FUNCHECK(!fargs[4] || !*fargs[4], "#-1 INVALID MESSAGE"); 02256 MapCoordToRealCoord(x, y, &realX, &realY); 02257 safe_tprintf_str(buff, bufc, "%d", 02258 MapLimitedBroadcast2d(map, realX, realY, range, 02259 fargs[4])); 02260 break; 02261 case 6: 02262 x = atof(fargs[1]); 02263 y = atof(fargs[2]); 02264 z = atof(fargs[3]); 02265 range = atof(fargs[4]); 02266 FUNCHECK(x < 0 || x > map->map_width, "#-1 ILLEGAL X COORD"); 02267 FUNCHECK(y < 0 || y > map->map_height, "#-1 ILLEGAL Y COORD"); 02268 FUNCHECK(z < 0 || z > 100000, "#-1 ILLEGAL Z COORD"); // XXX: Is this accurate? 02269 FUNCHECK(range < 0, "#-1 ILLEGAL RANGE"); 02270 FUNCHECK(!fargs[5] || !*fargs[5], "#-1 INVALID MESSAGE"); 02271 MapCoordToRealCoord(x, y, &realX, &realY); // XXX: should we deal with z? 02272 safe_tprintf_str(buff, bufc, "%d", 02273 MapLimitedBroadcast3d(map, realX, realY, z * ZSCALE, 02274 range, fargs[5])); 02275 break; 02276 default: 02277 safe_tprintf_str(buff, bufc, "#-1 INVALID ARGUMENTS"); 02278 return; 02279 } 02280 02281 return; 02282 }
void fun_btmapterr | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 848 of file glue.scode.c.
References Examinable, FindObjectsData(), FUNCHECK, GetTerrain, GRASSLAND, GTYPE_MAP, MAP::map_height, MAP::map_width, match_thing(), NOTHING, Readnum, safe_tprintf_str(), WhichSpecial(), x, and y.
00850 { 00851 /* fargs[0] = reference of map 00852 fargs[1] = x 00853 fargs[2] = y 00854 */ 00855 dbref it; 00856 MAP *map; 00857 int x, y; 00858 int spec; 00859 char terr; 00860 00861 it = match_thing(player, fargs[0]); 00862 FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1"); 00863 spec = WhichSpecial(it); 00864 FUNCHECK(spec != GTYPE_MAP, "#-1"); 00865 FUNCHECK(!(map = FindObjectsData(it)), "#-1"); 00866 FUNCHECK(Readnum(x, fargs[1]), "#-2"); 00867 FUNCHECK(Readnum(y, fargs[2]), "#-2"); 00868 FUNCHECK(x < 0 || y < 0 || x >= map->map_width || 00869 y >= map->map_height, "?"); 00870 terr = GetTerrain(map, x, y); 00871 if(terr == GRASSLAND) 00872 terr = '.'; 00873 00874 safe_tprintf_str(buff, bufc, "%c", terr); 00875 }
void fun_btmapunits | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 2102 of file glue.scode.c.
References FindRange(), FindXYRange(), MAP::first_free, FUNCHECK, getMap(), getMech(), MAP::map_height, MAP::map_width, MapCoordToRealCoord(), match_thing(), MechFX, MechFY, MechFZ, MAP::mechsOnMap, safe_tprintf_str(), WizR, x, y, and ZSCALE.
02104 { 02105 /* 02106 * fargs[0] = mapref 02107 * 02108 * OR 02109 * 02110 * fargs[0] = mapref 02111 * fargs[1] = x 02112 * fargs[2] = y 02113 * fargs[3] = range 02114 * 02115 * OR 02116 * 02117 * fargs[0] = mapref 02118 * fargs[1] = x 02119 * fargs[2] = y 02120 * fargs[3] = z 02121 * fargs[4] = range 02122 */ 02123 02124 MAP *map; 02125 float x, y, z, range, realX, realY; 02126 MECH *mech; 02127 int loop; 02128 dbref mapnum; 02129 02130 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 02131 02132 switch (nfargs) { 02133 case 1: 02134 mapnum = match_thing(player, fargs[0]); 02135 FUNCHECK(mapnum < 0, "#-1 INVALID MAP"); 02136 map = getMap(mapnum); 02137 FUNCHECK(!map, "#-1 INVALID MAP"); 02138 for(loop = 0; loop < map->first_free; loop++) { 02139 if(map->mechsOnMap[loop] < 0) 02140 continue; 02141 mech = getMech(map->mechsOnMap[loop]); 02142 02143 if(mech) 02144 safe_tprintf_str(buff, bufc, "#%d ", map->mechsOnMap[loop]); 02145 } 02146 break; 02147 case 4: 02148 mapnum = match_thing(player, fargs[0]); 02149 FUNCHECK(mapnum < 0, "#-1 INVALID MAP"); 02150 map = getMap(mapnum); 02151 FUNCHECK(!map, "#-1 INVALID MAP"); 02152 x = atof(fargs[1]); 02153 y = atof(fargs[2]); 02154 range = atof(fargs[3]); 02155 FUNCHECK(x < 0 || x > map->map_width, "#-1 INVALID X COORD"); 02156 FUNCHECK(y < 0 || y > map->map_height, "#-1 INVALID Y COORD"); 02157 FUNCHECK(range < 0, "#-1 INVALID RANGE"); 02158 MapCoordToRealCoord(x, y, &realX, &realY); 02159 for(loop = 0; loop < map->first_free; loop++) { 02160 if(map->mechsOnMap[loop] < 0) 02161 continue; 02162 mech = getMech(map->mechsOnMap[loop]); 02163 if(mech 02164 && FindXYRange(realX, realY, MechFX(mech), 02165 MechFY(mech)) <= range) 02166 safe_tprintf_str(buff, bufc, "#%d ", map->mechsOnMap[loop]); 02167 } 02168 break; 02169 case 5: 02170 mapnum = match_thing(player, fargs[0]); 02171 FUNCHECK(mapnum < 0, "#-1 INVALID MAP"); 02172 map = getMap(mapnum); 02173 FUNCHECK(!map, "#-1 INVALID MAP"); 02174 x = atof(fargs[1]); 02175 y = atof(fargs[2]); 02176 z = atof(fargs[3]); 02177 range = atof(fargs[4]); 02178 FUNCHECK(x < 0 || x > map->map_width, "#-1 INVALID X COORD"); 02179 FUNCHECK(y < 0 || y > map->map_height, "#-1 INVALID Y COORD"); 02180 FUNCHECK(range < 0, "#-1 INVALID RANGE"); 02181 MapCoordToRealCoord(x, y, &realX, &realY); 02182 for(loop = 0; loop < map->first_free; loop++) { 02183 if(map->mechsOnMap[loop] < 0) 02184 continue; 02185 mech = getMech(map->mechsOnMap[loop]); 02186 02187 if(mech 02188 && FindRange(realX, realY, z * ZSCALE, MechFX(mech), 02189 MechFY(mech), MechFZ(mech)) <= range) 02190 safe_tprintf_str(buff, bufc, "#%d ", map->mechsOnMap[loop]); 02191 } 02192 break; 02193 default: 02194 safe_tprintf_str(buff, bufc, "#-1 INVALID ARGUMENTS"); 02195 break; 02196 } 02197 02198 return; 02199 }
void fun_btmechfreqs | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1448 of file glue.scode.c.
References bv2text(), MECH::freq, FREQ_REST, MECH::freqmodes, FUNCHECK, getMech(), Good_obj, match_thing(), MFreqs, radio_colorstr, safe_str, safe_tprintf_str(), and WizR.
01450 { 01451 /* fargs[0] = mechobject 01452 */ 01453 int mechdbref; 01454 MECH *mech; 01455 int i; 01456 01457 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01458 mechdbref = match_thing(player, fargs[0]); 01459 FUNCHECK(!Good_obj(mechdbref), "#-1 INVALID TARGET"); 01460 mech = getMech(mechdbref); 01461 FUNCHECK(!mech, "#-1 INVALID TARGET"); 01462 01463 for(i = 0; i < MFreqs(mech); i++) { 01464 if(i) 01465 safe_str(",", buff, bufc); 01466 safe_tprintf_str(buff, bufc, "%d|%d|%s", 01467 i + 1, mech->freq[i], 01468 bv2text(mech->freqmodes[i] % FREQ_REST)); 01469 if(mech->freqmodes[i] / FREQ_REST) { 01470 safe_tprintf_str(buff, bufc, "|%c", 01471 radio_colorstr[mech->freqmodes[i] / FREQ_REST - 01472 1]); 01473 } else { 01474 safe_str("|-", buff, bufc); 01475 } 01476 } 01477 }
void fun_btnumrepjobs | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 2019 of file glue.scode.c.
References damage_last, Examinable, FindObjectsData(), FUNCHECK, IsMech, make_damage_table(), make_scrap_table(), match_thing(), NOTHING, safe_tprintf_str(), and unit_is_fixable().
02021 { 02022 extern int damage_last; 02023 MECH *mech; 02024 dbref it; 02025 02026 it = match_thing(player, fargs[0]); 02027 FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1"); 02028 FUNCHECK(!IsMech(it), "#-2"); 02029 mech = FindObjectsData(it); 02030 02031 if(unit_is_fixable(mech)) 02032 make_damage_table(mech); 02033 else 02034 make_scrap_table(mech); 02035 02036 safe_tprintf_str(buff, bufc, "%d", damage_last); 02037 }
void fun_btparttype | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 2284 of file glue.scode.c.
References Cargo2I, find_matching_long_part(), find_matching_vlong_part(), FUNCHECK, I2Special, IsAmmo, IsBomb, IsCargo, IsSpecial, IsWeapon, mudconf, safe_tprintf_str(), SWORD, and WizR.
02286 { 02287 /* 02288 fargs[0] = stringname of part 02289 */ 02290 int i = -1, p, b; 02291 02292 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 02293 02294 if(!find_matching_long_part(fargs[0], &i, &p, &b)) { 02295 i = -1; 02296 FUNCHECK(!find_matching_vlong_part(fargs[0], &i, &p, &b), 02297 "#-1 INVALID PART NAME"); 02298 } 02299 if(strstr(fargs[0], "Sword") && !strstr(fargs[0], "PC.")) 02300 p = I2Special(SWORD); 02301 if(IsWeapon(p)) { 02302 safe_tprintf_str(buff, bufc, "WEAP"); 02303 return; 02304 } else if(IsAmmo(p) || strstr(fargs[0], "Ammo_")) { 02305 safe_tprintf_str(buff, bufc, "AMMO"); 02306 return; 02307 } else if(IsBomb(p)) { 02308 safe_tprintf_str(buff, bufc, "BOMB"); 02309 return; 02310 } else if(IsSpecial(p)) { 02311 safe_tprintf_str(buff, bufc, "PART"); 02312 return; 02313 #ifdef BT_COMPLEXREPAIRS 02314 } else if(mudconf.btech_complexrepair && IsCargo(p) 02315 && Cargo2I(p) >= TON_SENSORS_FIRST 02316 && Cargo2I(p) <= TON_ENGINE_COMP_LAST) { 02317 safe_tprintf_str(buff, bufc, "PART"); 02318 return; 02319 #endif 02320 } else if(IsCargo(p)) { 02321 safe_tprintf_str(buff, bufc, "CARG"); 02322 return; 02323 } else { 02324 safe_tprintf_str(buff, bufc, "OTHER"); 02325 return; 02326 } 02327 }
void fun_btpayload_ref | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1849 of file glue.scode.c.
References FUNCHECK, load_refmech(), payloadlist_func(), safe_tprintf_str(), and WizR.
01851 { 01852 MECH *mech; 01853 char *infostr; 01854 01855 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01856 FUNCHECK((mech = load_refmech(fargs[0])) == NULL, "#-1 NO SUCH MECH"); 01857 01858 infostr = payloadlist_func(mech); 01859 safe_tprintf_str(buff, bufc, infostr ? infostr : "#-1"); 01860 }
void fun_btremovestores | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1501 of file glue.scode.c.
References econ_change_items(), econ_find_items(), Examinable, find_matching_long_part(), find_matching_vlong_part(), FindObjectsData(), FUNCHECK, match_thing(), NOTHING, Readnum, safe_tprintf_str(), WhichSpecial(), and WizR.
01503 { 01504 /* fargs[0] = id of the bay */ 01505 /* fargs[1] = name of the part */ 01506 /* fargs[2] = amount */ 01507 dbref it; 01508 int i = -1, spec; 01509 int num = 0; 01510 void *foo; 01511 int p, b; 01512 01513 it = match_thing(player, fargs[0]); 01514 FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1"); 01515 spec = WhichSpecial(it); 01516 FUNCHECK(!(foo = FindObjectsData(it)), "#-1"); 01517 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01518 FUNCHECK(Readnum(num, fargs[2]), "#-2 Illegal Value"); 01519 if(!find_matching_long_part(fargs[1], &i, &p, &b)) { 01520 i = -1; 01521 FUNCHECK(!find_matching_vlong_part(fargs[1], &i, &p, &b), 01522 "#-1 INVALID PART NAME"); 01523 } 01524 econ_change_items(it, p, b, 0 - num); 01525 safe_tprintf_str(buff, bufc, "%d", econ_find_items(it, p, b)); 01526 }
void fun_btsetarmorstatus | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1058 of file glue.scode.c.
References Examinable, FindObjectsData(), FUNCHECK, IsMech, match_thing(), NOTHING, safe_tprintf_str(), setarmorstatus_func(), and WizR.
01061 { 01062 /* fargs[0] = id of the mech 01063 * fargs[1] = location to set 01064 * fargs[2] = what to change 01065 * fargs[3] = value to change to. 01066 */ 01067 dbref it; 01068 char *infostr; 01069 MECH *mech; 01070 01071 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01072 it = match_thing(player, fargs[0]); 01073 FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1 NOT A MECH"); 01074 FUNCHECK(!IsMech(it), "#-1 NOT A MECH"); 01075 FUNCHECK(!(mech = FindObjectsData(it)), "#-1"); 01076 infostr = setarmorstatus_func(mech, fargs[1], fargs[2], fargs[3]); /* fargs[1] unguaranteed ! */ 01077 safe_tprintf_str(buff, bufc, infostr ? infostr : "#-1 ERROR"); 01078 }
void fun_btsetmaxspeed | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1743 of file glue.scode.c.
References correct_speed(), Examinable, FindObjectsData(), FUNCHECK, IsMech, match_thing(), MechMaxSpeed, NOTHING, safe_tprintf_str(), and WizR.
01745 { 01746 /* fargs[0] = id of the mech 01747 fargs[1] = what the new maxspeed should be set too 01748 */ 01749 dbref it; 01750 MECH *mech; 01751 float newmaxspeed = atof(fargs[1]); 01752 01753 it = match_thing(player, fargs[0]); 01754 FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1 NOT A MECH"); 01755 FUNCHECK(!IsMech(it), "#-1 NOT A MECH"); 01756 FUNCHECK(!(mech = FindObjectsData(it)), "#-1"); 01757 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01758 01759 MechMaxSpeed(mech) = newmaxspeed; 01760 correct_speed(mech); 01761 01762 safe_tprintf_str(buff, bufc, "1"); 01763 }
void fun_btsetpartcost | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 2350 of file glue.scode.c.
References find_matching_long_part(), find_matching_vlong_part(), FUNCHECK, I2Special, safe_tprintf_str(), SWORD, and WizR.
02352 { 02353 #ifdef BT_ADVANCED_ECON 02354 int i = -1, p, index, b; 02355 unsigned long long int cost; 02356 02357 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 02358 if(!find_matching_long_part(fargs[0], &i, &p, &b)) { 02359 i = -1; 02360 FUNCHECK(!find_matching_vlong_part(fargs[0], &i, &p, &b), 02361 "#-1 INVALID PART NAME"); 02362 } 02363 if(strstr(fargs[0], "Sword") && !strstr(fargs[0], "PC.")) 02364 p = I2Special(SWORD); 02365 cost = atoll(fargs[1]); 02366 /* since we're using an unsigned long long, lets check before we push it to unsigned status */ 02367 if(atoll(fargs[1]) < 0) { 02368 safe_tprintf_str(buff, bufc, "#-1 COST ERROR"); 02369 return; 02370 } 02371 SetPartCost(p, cost); 02372 safe_tprintf_str(buff, bufc, "%lld", cost); 02373 #else 02374 safe_tprintf_str(buff, bufc, "#-1 NO ECONDB SUPPORT"); 02375 #endif 02376 }
void fun_btsetxcodevalue | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 523 of file glue.scode.c.
References Examinable, FindObjectsData(), FUNCHECK, match_thing(), GMV::name, name, NOTHING, safe_tprintf_str(), scode_in_out, GMV::size, text2bv(), TYPE_BV, TYPE_CBV, TYPE_CHAR, TYPE_DBREF, TYPE_FLOAT, TYPE_INT, TYPE_SHORT, TYPE_STRFUNC_BD, TYPE_STRFUNC_S, TYPE_STRING, WhichSpecial(), WizR, and xcode_data.
00525 { 00526 /* fargs[0] = id of the mech 00527 fargs[1] = name of the value 00528 fargs[2] = what the value's to be set as 00529 */ 00530 dbref it; 00531 int i, spec; 00532 void *foo; 00533 void *bar; 00534 void *(*tempfun) (); 00535 00536 it = match_thing(player, fargs[0]); 00537 FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1"); 00538 spec = WhichSpecial(it); 00539 FUNCHECK(!(foo = FindObjectsData(it)), "#-1"); 00540 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 00541 for(i = 0; xcode_data[i].name; i++) 00542 if(!strcasecmp(fargs[1], xcode_data[i].name) && 00543 xcode_data[i].gtype == spec && 00544 (scode_in_out[xcode_data[i].type] & 2)) { 00545 bar = (void *) ((int) foo + xcode_data[i].rel_addr); 00546 switch (xcode_data[i].type) { 00547 case TYPE_STRFUNC_BD: 00548 case TYPE_STRFUNC_S: 00549 tempfun = (void *) xcode_data[i].rel_addr; 00550 tempfun(1, (MECH *) foo, (char *) fargs[2]); 00551 break; 00552 case TYPE_STRING: 00553 strncpy((char *) bar, fargs[2], xcode_data[i].size - 1); 00554 ((char *) bar)[xcode_data[i].size - 1] = '\0'; 00555 break; 00556 case TYPE_DBREF: 00557 *((dbref *) bar) = atoi(fargs[2]); 00558 break; 00559 case TYPE_CHAR: 00560 *((char *) bar) = atoi(fargs[2]); 00561 break; 00562 case TYPE_SHORT: 00563 *((short *) bar) = atoi(fargs[2]); 00564 break; 00565 case TYPE_INT: 00566 *((int *) bar) = atoi(fargs[2]); 00567 break; 00568 case TYPE_FLOAT: 00569 *((float *) bar) = atof(fargs[2]); 00570 break; 00571 case TYPE_BV: 00572 *((int *) bar) = text2bv(fargs[2]); 00573 break; 00574 case TYPE_CBV: 00575 *((byte *) bar) = (byte) text2bv(fargs[2]); 00576 break; 00577 } 00578 safe_tprintf_str(buff, bufc, "1"); 00579 return; 00580 } 00581 safe_tprintf_str(buff, bufc, "#-1"); 00582 return; 00583 }
void fun_btsetxy | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 2039 of file glue.scode.c.
References Examinable, FUNCHECK, getMap(), getMech(), GOD, Good_obj, IsMap(), MAP::map_height, MAP::map_width, match_thing(), MBUF_SIZE, mech_Rsetmapindex(), mech_Rsetxy(), MechCarrying, NOTHING, safe_tprintf_str(), WizR, x, and y.
02041 { 02042 /* 02043 fargs[0] = mech 02044 fargs[1] = map 02045 fargs[2] = x 02046 fargs[3] = y 02047 fargs[4] = z 02048 02049 */ 02050 dbref mechdb, mapdb; 02051 int x, y, z; 02052 MECH *mech; 02053 MECH *towee = NULL; 02054 MAP *map; 02055 char buffer[MBUF_SIZE]; 02056 02057 FUNCHECK(nfargs < 4 || nfargs > 5, "#-1 INVALID ARGUMENT"); 02058 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 02059 mechdb = match_thing(player, fargs[0]); 02060 FUNCHECK(!Good_obj(mechdb), "#-1 INVALID TARGET"); 02061 mech = getMech(mechdb); 02062 FUNCHECK(!mech, "#-1 INVALID TARGET"); 02063 02064 mapdb = match_thing(player, fargs[1]); 02065 FUNCHECK(mapdb == NOTHING 02066 || !Examinable(player, mapdb), "#-1 INVALID MAP"); 02067 FUNCHECK(!IsMap(mapdb), "#-1 INVALID MAP"); 02068 FUNCHECK(!(map = getMap(mapdb)), "#-1 INVALID MAP"); 02069 02070 x = atoi(fargs[2]); 02071 y = atoi(fargs[3]); 02072 FUNCHECK(x < 0 || x > map->map_width, "#-1 X COORD"); 02073 FUNCHECK(y < 0 || y > map->map_height, "#-1 Y COORD"); 02074 02075 if(nfargs == 5) { 02076 z = atoi(fargs[4]); 02077 FUNCHECK(z < 0 || z > 10000, "#-1 Z COORD"); 02078 } 02079 02080 if (MechCarrying(mech) > 0) 02081 towee = getMech(MechCarrying(mech)); 02082 02083 snprintf(buffer, MBUF_SIZE, "%d", mapdb); 02084 mech_Rsetmapindex(GOD, (void *) mech, buffer); 02085 02086 if (towee) 02087 mech_Rsetmapindex(GOD, (void *) towee, buffer); 02088 02089 if(nfargs == 5) { 02090 snprintf(buffer, MBUF_SIZE, "%d %d %d", x, y, z); 02091 } else { 02092 snprintf(buffer, MBUF_SIZE, "%d %d", x, y); 02093 } 02094 mech_Rsetxy(GOD, (void *) mech, buffer); 02095 02096 if (towee) 02097 mech_Rsetxy(GOD, (void *) towee, buffer); 02098 02099 safe_tprintf_str(buff, bufc, "1"); 02100 }
void fun_btshowcritstatus_ref | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1898 of file glue.scode.c.
References Examinable, FUNCHECK, isPlayer, load_refmech(), match_thing(), mech_critstatus(), NOTHING, safe_tprintf_str(), and WizR.
01901 { 01902 dbref outplayer; 01903 MECH *mech; 01904 char *infostr; 01905 01906 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01907 FUNCHECK((mech = load_refmech(fargs[0])) == NULL, "#-1 NO SUCH MECH"); 01908 outplayer = match_thing(player, fargs[1]); 01909 FUNCHECK(outplayer == NOTHING || !Examinable(player, outplayer) 01910 || !isPlayer(outplayer), "#-1"); 01911 01912 mech_critstatus(outplayer, (void *) mech, fargs[2]); 01913 safe_tprintf_str(buff, bufc, "1"); 01914 }
void fun_btshowstatus_ref | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1862 of file glue.scode.c.
References Examinable, FUNCHECK, isPlayer, load_refmech(), match_thing(), mech_status(), NOTHING, safe_tprintf_str(), and WizR.
01865 { 01866 dbref outplayer; 01867 MECH *mech; 01868 char *infostr; 01869 01870 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01871 FUNCHECK((mech = load_refmech(fargs[0])) == NULL, "#-1 NO SUCH MECH"); 01872 outplayer = match_thing(player, fargs[1]); 01873 FUNCHECK(outplayer == NOTHING || !Examinable(player, outplayer) 01874 || !isPlayer(outplayer), "#-1"); 01875 01876 mech_status(outplayer, (void *) mech, "R"); 01877 safe_tprintf_str(buff, bufc, "1"); 01878 }
void fun_btshowwspecs_ref | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1880 of file glue.scode.c.
References Examinable, FUNCHECK, isPlayer, load_refmech(), match_thing(), mech_weaponspecs(), NOTHING, safe_tprintf_str(), and WizR.
01883 { 01884 dbref outplayer; 01885 MECH *mech; 01886 char *infostr; 01887 01888 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01889 FUNCHECK((mech = load_refmech(fargs[0])) == NULL, "#-1 NO SUCH MECH"); 01890 outplayer = match_thing(player, fargs[1]); 01891 FUNCHECK(outplayer == NOTHING || !Examinable(player, outplayer) 01892 || !isPlayer(outplayer), "#-1"); 01893 01894 mech_weaponspecs(outplayer, (void *) mech, ""); 01895 safe_tprintf_str(buff, bufc, "1"); 01896 }
void fun_btstores | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 802 of file glue.scode.c.
References A_ECONPARTS, BRANDCOUNT, econ_find_items(), find_matching_long_part(), find_matching_vlong_part(), FUNCHECK, Good_obj, match_thing(), NUM_ITEMS, object_count, part_name_long(), safe_str, safe_tprintf_str(), short_sorted, silly_atr_get(), UNPACK_PART, WizR, and x.
00804 { 00805 /* fargs[0] = id of the bay/mech */ 00806 /* fargs[1] = (optional) name of the part */ 00807 dbref it; 00808 int i = -1, x = 0; 00809 int p, b; 00810 int pile[BRANDCOUNT + 1][NUM_ITEMS]; 00811 char *t; 00812 00813 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 00814 FUNCHECK(nfargs < 1 || nfargs > 2, 00815 "#-1 FUNCTION (BTSTORES) EXPECTS 1 OR 2 ARGUMENTS"); 00816 it = match_thing(player, fargs[0]); 00817 FUNCHECK(!Good_obj(it), "#-1 INVALID TARGET"); 00818 if(nfargs > 1) { 00819 i = -1; 00820 if(!find_matching_long_part(fargs[1], &i, &p, &b)) { 00821 i = -1; 00822 FUNCHECK(!find_matching_vlong_part(fargs[1], &i, &p, &b), 00823 "#-1 INVALID PART NAME"); 00824 } 00825 safe_tprintf_str(buff, bufc, "%d", econ_find_items(it, p, b)); 00826 } else { 00827 memset(pile, 0, sizeof(pile)); 00828 t = silly_atr_get(it, A_ECONPARTS); 00829 while (*t) { 00830 if(*t == '[') 00831 if((sscanf(t, "[%d,%d,%d]", &i, &p, &b)) == 3) 00832 pile[p][i] += b; 00833 t++; 00834 } 00835 for(i = 0; i < object_count; i++) { 00836 UNPACK_PART(short_sorted[i]->index, p, b); 00837 if(pile[b][p]) { 00838 if(x) 00839 safe_str("|", buff, bufc); 00840 x = pile[b][p]; 00841 safe_tprintf_str(buff, bufc, "%s:%d", 00842 part_name_long(p, b), x); 00843 } 00844 } 00845 } 00846 }
void fun_bttechlist | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1813 of file glue.scode.c.
References Examinable, FindObjectsData(), FUNCHECK, IsMech, match_thing(), NOTHING, safe_tprintf_str(), techlist_func(), and WizR.
01815 { 01816 dbref it; 01817 MECH *mech; 01818 int i, ii, part = 0, axe = 0, sword = 0, mace = 0, hascase = 0; 01819 char *infostr; 01820 01821 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01822 it = match_thing(player, fargs[0]); 01823 FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1 NOT A MECH"); 01824 FUNCHECK(!IsMech(it), "#-1 NOT A MECH"); 01825 FUNCHECK(!(mech = FindObjectsData(it)), "#-1"); 01826 infostr = techlist_func(mech); 01827 safe_tprintf_str(buff, bufc, infostr ? infostr : " "); 01828 }
void fun_bttechlist_ref | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1830 of file glue.scode.c.
References FUNCHECK, load_refmech(), safe_tprintf_str(), techlist_func(), and WizR.
01832 { 01833 dbref it; 01834 MECH *mech; 01835 int i, ii, part = 0, axe = 0, sword = 0, mace = 0, hascase = 0; 01836 char *infostr; 01837 01838 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01839 FUNCHECK((mech = load_refmech(fargs[0])) == NULL, "#-1 NO SUCH MECH"); 01840 01841 infostr = techlist_func(mech); 01842 safe_tprintf_str(buff, bufc, infostr ? infostr : "#-1"); 01843 }
void fun_bttechstatus | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1127 of file glue.scode.c.
References Examinable, FindObjectsData(), FUNCHECK, IsMech, match_thing(), NOTHING, safe_tprintf_str(), techstatus_func(), and WizR.
01129 { 01130 /* 01131 * fargs[0] = dbref of MECH object 01132 */ 01133 01134 dbref it; 01135 MECH *mech; 01136 char *infostr; 01137 01138 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01139 it = match_thing(player, fargs[0]); 01140 FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1 NOT A MECH"); 01141 FUNCHECK(!IsMech(it), "#-1 NOT A MECH"); 01142 FUNCHECK(!(mech = FindObjectsData(it)), "#-1 UNABLE TO GET MECHDATA"); 01143 infostr = techstatus_func(mech); 01144 safe_tprintf_str(buff, bufc, "%s", infostr ? infostr : "#-1 ERROR"); 01145 }
void fun_bttechtime | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1528 of file glue.scode.c.
References A_TECHTIME, MBUF_SIZE, mudstate, notify, statedata::now, and silly_atr_get().
01530 { 01531 time_t old; 01532 char *olds = silly_atr_get(player, A_TECHTIME); 01533 char buf[MBUF_SIZE]; 01534 01535 if(olds) { 01536 old = (time_t) atoi(olds); 01537 if(old < mudstate.now) { 01538 strcpy(buf, "00:00.00"); 01539 } else { 01540 old -= mudstate.now; 01541 sprintf(buf, "%02ld:%02d.%02d", (long) (old / 3600), 01542 (int) ((old / 60) % 60), (int) (old % 60)); 01543 } 01544 } else { 01545 strcpy(buf, "00:00.00"); 01546 } 01547 01548 notify(player, buf); 01549 }
void fun_btthreshold | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1080 of file glue.scode.c.
References btthreshold_func(), FUNCHECK, safe_tprintf_str(), and WizR.
01082 { 01083 /* 01084 * fargs[0] = skill to query 01085 */ 01086 int xpth; 01087 01088 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01089 xpth = btthreshold_func(fargs[0]); 01090 safe_tprintf_str(buff, bufc, xpth < 0 ? "#%d ERROR" : "%d", xpth); 01091 }
void fun_btticweaps | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1355 of file glue.scode.c.
References Examinable, FindObjectsData(), FindWeaponNumberOnMech(), FUNCHECK, GetPartType, IsMech, match_thing(), MAX_WEAPONS_PER_MECH, MechWeapons, name, NOTHING, safe_tprintf_str(), SINGLE_TICLONG_SIZE, MECH::tic, tprintf(), and Weapon2I.
01356 { 01357 /* fargs[0] = dbref of mech 01358 * fargs[1] = tic # 01359 */ 01360 01361 MECH *mech; 01362 dbref it; 01363 int i, j, k , l, section, critical; 01364 int ticnum; 01365 01366 it = match_thing(player, fargs[0]); 01367 FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1 NOT A MECH"); 01368 FUNCHECK(!IsMech(it), "#-1 NOT A MECH"); 01369 FUNCHECK(!(mech = FindObjectsData(it)), "#-1"); 01370 ticnum = atoi(fargs[1]); 01371 01372 for( j = 0; j < MAX_WEAPONS_PER_MECH; j++) { 01373 k = j / SINGLE_TICLONG_SIZE; 01374 l = j % SINGLE_TICLONG_SIZE; 01375 01376 if(mech->tic[ticnum][k] & (1 << l)) { 01377 if(FindWeaponNumberOnMech(mech, j, §ion, &critical) == -1) { 01378 j = MAX_WEAPONS_PER_MECH ; 01379 continue; 01380 } 01381 safe_tprintf_str(buff,bufc,tprintf("%d:%s ",j,&MechWeapons[Weapon2I(GetPartType(mech, section, critical))].name[3])); 01382 } 01383 } 01384 01385 01386 }
void fun_btunderrepair | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 786 of file glue.scode.c.
References Examinable, figure_latest_tech_event(), FindObjectsData(), FUNCHECK, IsMech, match_thing(), NOTHING, and safe_tprintf_str().
00788 { 00789 /* fargs[0] = ref of the mech to be checked */ 00790 int n; 00791 MECH *mech; 00792 dbref it; 00793 00794 it = match_thing(player, fargs[0]); 00795 FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1"); 00796 FUNCHECK(!IsMech(it), "#-2"); 00797 mech = FindObjectsData(it); 00798 n = figure_latest_tech_event(mech); 00799 safe_tprintf_str(buff, bufc, "%d", n > 0); 00800 }
void fun_btunitfixable | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 2378 of file glue.scode.c.
References FUNCHECK, getMech(), Good_obj, match_thing(), safe_tprintf_str(), unit_is_fixable(), and WizR.
02380 { 02381 MECH *mech; 02382 dbref mechdb; 02383 02384 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 02385 mechdb = match_thing(player, fargs[0]); 02386 FUNCHECK(!Good_obj(mechdb), "#-1 INVALID TARGET"); 02387 mech = getMech(mechdb); 02388 FUNCHECK(!mech, "#-1 INVALID TARGET"); 02389 02390 safe_tprintf_str(buff, bufc, "%d", unit_is_fixable(mech)); 02391 }
void fun_btweaponstatus | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 985 of file glue.scode.c.
References Examinable, FindObjectsData(), FUNCHECK, IsMech, match_thing(), NOTHING, safe_tprintf_str(), weaponstatus_func(), and WizR.
00987 { 00988 /* fargs[0] = id of the mech 00989 * fargs[1] = location to show 00990 */ 00991 dbref it; 00992 char *infostr; 00993 MECH *mech; 00994 00995 FUNCHECK(nfargs < 1 || nfargs > 2, 00996 "#-1 FUNCTION (BTWEAPONSTATUS) EXPECTS 1 OR 2 ARGUMENTS"); 00997 00998 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 00999 it = match_thing(player, fargs[0]); 01000 FUNCHECK(it == NOTHING || !Examinable(player, it), "#-1 NOT A MECH"); 01001 FUNCHECK(!IsMech(it), "#-1 NOT A MECH"); 01002 FUNCHECK(!(mech = FindObjectsData(it)), "#-1"); 01003 infostr = weaponstatus_func(mech, nfargs == 2 ? fargs[1] : NULL); 01004 safe_tprintf_str(buff, bufc, infostr ? infostr : "#-1 ERROR"); 01005 }
void fun_btweaponstatus_ref | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1039 of file glue.scode.c.
References FUNCHECK, load_refmech(), safe_tprintf_str(), weaponstatus_func(), and WizR.
01042 { 01043 /* fargs[0] = ref of the mech 01044 * fargs[1] = location to show 01045 */ 01046 char *infostr; 01047 MECH *mech; 01048 01049 FUNCHECK(nfargs < 1 || nfargs > 2, 01050 "#-1 FUNCTION (BTWEAPONREF) EXPECTS 1 OR 2 ARGUMENTS"); 01051 01052 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01053 FUNCHECK((mech = load_refmech(fargs[0])) == NULL, "#-1 NO SUCH MECH"); 01054 infostr = weaponstatus_func(mech, nfargs == 2 ? fargs[1] : NULL); 01055 safe_tprintf_str(buff, bufc, infostr ? infostr : "#-1 ERROR"); 01056 }
void fun_btweapstat | ( | char * | buff, | |
char ** | bufc, | |||
dbref | player, | |||
dbref | cause, | |||
char * | fargs[], | |||
int | nfargs, | |||
char * | cargs[], | |||
int | ncargs | |||
) |
Definition at line 1961 of file glue.scode.c.
References weapon_struct::ammoperton, weapon_struct::battlevalue, weapon_struct::criticals, weapon_struct::damage, find_matching_long_part(), find_matching_vlong_part(), FUNCHECK, weapon_struct::heat, IsWeapon, weapon_struct::longrange, MechWeapons, weapon_struct::medrange, weapon_struct::min, safe_tprintf_str(), weapon_struct::shortrange, weapon_struct::type, weapon_struct::vrt, Weapon2I, weapon_struct::weight, and WizR.
01963 { 01964 /* fargs[0] = weapon name 01965 * fargs[1] = stat type 01966 */ 01967 01968 int i = -1, p, weapindx, val = -1, b; 01969 01970 FUNCHECK(!WizR(player), "#-1 PERMISSION DENIED"); 01971 01972 if(!find_matching_long_part(fargs[0], &i, &p, &b)) { 01973 i = -1; 01974 FUNCHECK(!find_matching_vlong_part(fargs[0], &i, &p, &b), 01975 "#-1 INVALID PART NAME"); 01976 } 01977 if(!IsWeapon(p)) { 01978 safe_tprintf_str(buff, bufc, "#-1 NOT A WEAPON"); 01979 return; 01980 } 01981 weapindx = Weapon2I(p); 01982 if(strcasecmp("VRT", fargs[1]) == 0) 01983 val = MechWeapons[weapindx].vrt; 01984 else if(strcasecmp("TYPE", fargs[1]) == 0) 01985 val = MechWeapons[weapindx].type; 01986 else if(strcasecmp("HEAT", fargs[1]) == 0) 01987 val = MechWeapons[weapindx].heat; 01988 else if(strcasecmp("DAMAGE", fargs[1]) == 0) 01989 val = MechWeapons[weapindx].damage; 01990 else if(strcasecmp("MIN", fargs[1]) == 0) 01991 val = MechWeapons[weapindx].min; 01992 else if(strcasecmp("SR", fargs[1]) == 0) 01993 val = MechWeapons[weapindx].shortrange; 01994 else if(strcasecmp("MR", fargs[1]) == 0) 01995 val = MechWeapons[weapindx].medrange; 01996 else if(strcasecmp("LR", fargs[1]) == 0) 01997 val = MechWeapons[weapindx].longrange; 01998 else if(strcasecmp("CRIT", fargs[1]) == 0) 01999 val = MechWeapons[weapindx].criticals; 02000 else if(strcasecmp("AMMO", fargs[1]) == 0) 02001 val = MechWeapons[weapindx].ammoperton; 02002 else if(strcasecmp("WEIGHT", fargs[1]) == 0) 02003 val = MechWeapons[weapindx].weight; 02004 else if(strcasecmp("BV", fargs[1]) == 0) 02005 val = MechWeapons[weapindx].battlevalue; 02006 #if 0 02007 else if(strcasecmp("ABV", fargs[1]) == 0) 02008 val = MechWeapons[weapindx].abattlevalue; 02009 else if(strcasecmp("REP", fargs[1]) == 0) 02010 val = MechWeapons[weapindx].reptime; 02011 else if(strcasecmp("WCLASS", fargs[1]) == 0) 02012 val = MechWeapons[weapindx].class; 02013 #endif 02014 if(val == -1) 02015 safe_tprintf_str(buff, bufc, "#-1"); 02016 safe_tprintf_str(buff, bufc, "%d", val); 02017 }
void list_xcodestuff | ( | dbref | player, | |
void * | data, | |||
char * | buffer | |||
) |
Definition at line 741 of file glue.scode.c.
References addline, c, cent, CM_FOUR, CM_ONE, CM_TWO, DOCHECK, flag, KillCoolMenu(), Location, GMV::name, name, Name(), RetrieveValue(), SBUF_SIZE, scode_in_out, ShowCoolMenu(), sim, tprintf(), WhichSpecial(), and xcode_data.
00742 { 00743 int t, i, flag = CM_TWO, se_len = 37; 00744 coolmenu *c = NULL; 00745 00746 t = WhichSpecial(Location(player)); 00747 for(i = 0; xcode_data[i].name; i++) 00748 if(xcode_data[i].gtype == t && (scode_in_out[xcode_data[i].type] & 1)) 00749 break; 00750 DOCHECK(!xcode_data[i].name, 00751 "Error: No xcode values for this type of object found."); 00752 addline(); 00753 cent(tprintf("Data for %s (%s)", Name(Location(player)), 00754 SpecialObjects[t].type)); 00755 addline(); 00756 if(*buffer == '1') { 00757 flag = CM_ONE; 00758 se_len = se_len * 2; 00759 }; 00760 if(*buffer == '4') { 00761 flag = CM_FOUR; 00762 se_len = se_len / 2; 00763 }; 00764 if(*buffer == '1' || *buffer == '4') 00765 buffer++; 00766 for(i = 0; xcode_data[i].name; i++) { 00767 if(xcode_data[i].gtype == t && (scode_in_out[xcode_data[i].type] & 1)) { 00768 /* 1/3(left) = name, 2/3(right)=value */ 00769 char mask[SBUF_SIZE]; 00770 char lab[SBUF_SIZE]; 00771 00772 if(*buffer) 00773 if(strncasecmp(xcode_data[i].name, buffer, strlen(buffer))) 00774 continue; 00775 strcpy(lab, xcode_data[i].name); 00776 lab[se_len / 3] = 0; 00777 sprintf(mask, "%%-%ds%%%ds", se_len / 3, se_len * 2 / 3); 00778 sim(tprintf(mask, lab, RetrieveValue(data, i)), flag); 00779 } 00780 } 00781 addline(); 00782 ShowCoolMenu(player, c); 00783 KillCoolMenu(c); 00784 }
void list_xcodevalues | ( | dbref | player | ) |
Definition at line 906 of file glue.scode.c.
References GMV::name, name, notify, tprintf(), and xcode_data.
Referenced by do_show().
00907 { 00908 int i; 00909 00910 notify(player, "Xcode attributes accessible thru get/setxcodevalue:"); 00911 for(i = 0; xcode_data[i].name; i++) 00912 notify(player, tprintf("\t%d\t%s", xcode_data[i].gtype, 00913 xcode_data[i].name)); 00914 }
int MapLimitedBroadcast2d | ( | MAP * | map, | |
float | x, | |||
float | y, | |||
float | range, | |||
char * | message | |||
) |
Definition at line 1353 of file mech.notify.c.
References FindXYRange(), MAP::first_free, getMech(), mech_notify(), MechFX, MechFY, MAP::mechsOnMap, and MECHSTARTED.
Referenced by fun_btmapemit().
01355 { 01356 int loop, count = 0; 01357 MECH *mech; 01358 01359 for(loop = 0; loop < map->first_free; loop++) { 01360 if(map->mechsOnMap[loop] < 0) 01361 continue; 01362 mech = getMech(map->mechsOnMap[loop]); 01363 01364 if(mech && FindXYRange(x, y, MechFX(mech), MechFY(mech)) <= range) { 01365 mech_notify(mech, MECHSTARTED, message); 01366 count++; 01367 } 01368 } 01369 return count; 01370 }
int MapLimitedBroadcast3d | ( | MAP * | map, | |
float | x, | |||
float | y, | |||
float | z, | |||
float | range, | |||
char * | message | |||
) |
Definition at line 1372 of file mech.notify.c.
References FindRange(), MAP::first_free, getMech(), mech_notify(), MechFX, MechFY, MechFZ, MAP::mechsOnMap, and MECHSTARTED.
Referenced by fun_btmapemit().
01374 { 01375 int loop, count = 0; 01376 MECH *mech; 01377 01378 for(loop = 0; loop < map->first_free; loop++) { 01379 if(map->mechsOnMap[loop] == -1) 01380 continue; 01381 mech = getMech(map->mechsOnMap[loop]); 01382 if(mech 01383 && FindRange(x, y, z, MechFX(mech), MechFY(mech), 01384 MechFZ(mech)) <= range) { 01385 count++; 01386 mech_notify(mech, MECHSTARTED, message); 01387 } 01388 } 01389 return count; 01390 }
Definition at line 289 of file functions.c.
00290 { 00291 init_match(player, name, NOTYPE); 00292 match_everything(MAT_EXIT_PARENTS); 00293 return (noisy_match_result()); 00294 }
static char* mech_getset_ref | ( | int | mode, | |
MECH * | mech, | |||
char * | data | |||
) | [static] |
Definition at line 109 of file glue.scode.c.
References MechType_Ref.
00110 { 00111 if(mode) { 00112 strncpy(MechType_Ref(mech), data, 14); 00113 MechType_Ref(mech)[14] = '\0'; 00114 return NULL; 00115 } else 00116 return MechType_Ref(mech); 00117 }
char* mechCentBearingfunc | ( | int | mode, | |
MECH * | mech, | |||
char * | arg | |||
) |
Definition at line 299 of file glue.scode.c.
References FindBearing(), MapCoordToRealCoord(), MechFX, MechFY, MechX, MechY, SBUF_SIZE, x, and y.
00300 { 00301 int x = MechX(mech); 00302 int y = MechY(mech); 00303 float fx, fy; 00304 static char buf[SBUF_SIZE]; 00305 00306 MapCoordToRealCoord(x, y, &fx, &fy); 00307 sprintf(buf, "%d", FindBearing(MechFX(mech), MechFY(mech), fx, fy)); 00308 return buf; 00309 }
char* mechCentDistfunc | ( | int | mode, | |
MECH * | mech, | |||
char * | arg | |||
) |
Definition at line 311 of file glue.scode.c.
References FindHexRange(), MapCoordToRealCoord(), MechFX, MechFY, MechX, MechY, SBUF_SIZE, x, and y.
00312 { 00313 int x = MechX(mech); 00314 int y = MechY(mech); 00315 float fx, fy; 00316 static char buf[SBUF_SIZE]; 00317 00318 MapCoordToRealCoord(x, y, &fx, &fy); 00319 sprintf(buf, "%.2f", FindHexRange(fx, fy, MechFX(mech), MechFY(mech))); 00320 return buf; 00321 }
char* mechDamagefunc | ( | int | mode, | |
MECH * | mech, | |||
char * | arg | |||
) |
Definition at line 251 of file glue.scode.c.
References ADD, apply_mechDamage(), CritsInLoc(), FullAmmo(), GetPartData, GetPartType, GetSectArmor, GetSectInt, GetSectOArmor, GetSectOInt, GetSectORArmor, GetSectRArmor, IsAmmo, IsCrap, LBUF_SIZE, NUM_SECTIONS, PartIsDestroyed, and PartTempNuke.
00252 { 00253 /* Lists damage in form: 00254 A:LOC/num[,LOC/num[,LOC(R)/num]],I:LOC/num 00255 C:LOC/num,R:LOC/num(num),G:LOC/num(num) */ 00256 int i, j; 00257 static char buf[LBUF_SIZE]; 00258 int count = 0; 00259 00260 if(mode) { 00261 apply_mechDamage(mech, arg); 00262 return "?"; 00263 }; 00264 buf[0] = 0; 00265 for(i = 0; i < NUM_SECTIONS; i++) 00266 if(GetSectOInt(mech, i)) { 00267 if(GetSectArmor(mech, i) != GetSectOArmor(mech, i)) 00268 ADD("A:%d/%d", i, GetSectOArmor(mech, 00269 i) - GetSectArmor(mech, i)); 00270 if(GetSectRArmor(mech, i) != GetSectORArmor(mech, i)) 00271 ADD("A(R):%d/%d", i, GetSectORArmor(mech, 00272 i) - GetSectRArmor(mech, 00273 i)); 00274 } 00275 for(i = 0; i < NUM_SECTIONS; i++) 00276 if(GetSectOInt(mech, i)) 00277 if(GetSectInt(mech, i) != GetSectOInt(mech, i)) 00278 ADD("I:%d/%d", i, GetSectOInt(mech, i) - GetSectInt(mech, i)); 00279 for(i = 0; i < NUM_SECTIONS; i++) 00280 for(j = 0; j < CritsInLoc(mech, i); j++) { 00281 if(GetPartType(mech, i, j) && !IsCrap(GetPartType(mech, i, j))) { 00282 if(PartIsDestroyed(mech, i, j)) { 00283 ADD("C:%d/%d", i, j); 00284 } else { 00285 if(IsAmmo(GetPartType(mech, i, j))) { 00286 if(GetPartData(mech, i, j) != FullAmmo(mech, i, j)) 00287 ADD("R:%d/%d(%d)", i, j, FullAmmo(mech, 00288 i, 00289 j) - 00290 GetPartData(mech, i, j)); 00291 } else if(PartTempNuke(mech, i, j)) 00292 ADD("G:%d/%d(%d)", i, j, PartTempNuke(mech, i, j)); 00293 } 00294 } 00295 } 00296 return buf; 00297 }
char* mechIDfunc | ( | int | mode, | |
MECH * | mech | |||
) |
Definition at line 99 of file glue.scode.c.
References MechID.
00100 { 00101 static char buf[3]; 00102 00103 buf[0] = MechID(mech)[0]; 00104 buf[1] = MechID(mech)[1]; 00105 buf[2] = 0; 00106 return buf; 00107 }
char* mechMovefunc | ( | int | mode, | |
MECH * | mech, | |||
char * | arg | |||
) |
Definition at line 134 of file glue.scode.c.
References compare_array(), MechMove, and move_types.
00135 { 00136 int i; 00137 00138 if(!mode) 00139 return move_types[(short) MechMove(mech)]; 00140 if((i = compare_array(move_types, arg)) >= 0) 00141 MechMove(mech) = i; 00142 return NULL; 00143 }
char* mechref_path | ( | char * | id | ) |
Definition at line 546 of file mechrep.c.
References CACHE_MAXNAME, tmpldirent::dir, free_template_list(), MECH_PATH, tmpldirent::name, scan_templates(), subdirs, tmpl_list, tmpl_pos, and tmplcmp().
Referenced by fun_btdesignex(), load_mechdata(), and load_mechdata2().
00547 { 00548 static char openfile[1024]; 00549 FILE *fp; 00550 int i = 0; /* this int has double use... ugly, but effective */ 00551 00552 /* 00553 * If the template name doesn't have slash search for it in the 00554 * template name cache. 00555 */ 00556 redo: 00557 if(strchr(id, '/') == NULL && (tmpl_list != NULL || 00558 scan_templates(MECH_PATH) != -1)) { 00559 struct tmpldirent *ent; 00560 struct tmpldirent key; 00561 00562 strncpy(key.name, id, CACHE_MAXNAME); 00563 key.name[CACHE_MAXNAME] = '\0'; 00564 00565 ent = 00566 bsearch(&key, tmpl_list, tmpl_pos, sizeof tmpl_list[0], tmplcmp); 00567 if(ent == NULL) { 00568 return NULL; 00569 } 00570 if(ent->dir == NULL) { 00571 sprintf(openfile, "%s/%s", MECH_PATH, ent->name); 00572 } else { 00573 sprintf(openfile, "%s/%s/%s", MECH_PATH, ent->dir, ent->name); 00574 } 00575 if(access(openfile, R_OK) != 0) { 00576 /* The file is missing (or unreadable) 00577 invalidate the cache and try again, 00578 if *that* fails, fall back to the old version. */ 00579 if(!i) { 00580 i = 1; 00581 free_template_list(); 00582 goto redo; 00583 } else 00584 goto oldstyle; 00585 } 00586 return openfile; 00587 } 00588 oldstyle: 00589 /* 00590 * Look up a template name the old way... 00591 */ 00592 sprintf(openfile, "%s/%s", MECH_PATH, id); 00593 fp = fopen(openfile, "r"); 00594 for(i = 0; !fp && subdirs[i]; i++) { 00595 sprintf(openfile, "%s/%s/%s", MECH_PATH, subdirs[i], id); 00596 fp = fopen(openfile, "r"); 00597 } 00598 if(fp) { 00599 fclose(fp); 00600 return openfile; 00601 } 00602 return NULL; 00603 }
char* mechTechTimefunc | ( | int | mode, | |
MECH * | mech | |||
) |
Definition at line 145 of file glue.scode.c.
References figure_latest_tech_event(), and MBUF_SIZE.
00146 { 00147 static char buf[MBUF_SIZE]; 00148 int n = figure_latest_tech_event(mech); 00149 00150 sprintf(buf, "%d", n); 00151 return buf; 00152 }
char* mechTypefunc | ( | int | mode, | |
MECH * | mech, | |||
char * | arg | |||
) |
Definition at line 122 of file glue.scode.c.
References compare_array(), mech_types, and MechType.
00123 { 00124 int i; 00125 00126 if(!mode) 00127 return mech_types[(short) MechType(mech)]; 00128 /* Should _alter_ mechtype.. weeeel. */ 00129 if((i = compare_array(mech_types, arg)) >= 0) 00130 MechType(mech) = i; 00131 return NULL; 00132 }
static char* RetrieveValue | ( | void * | data, | |
int | i | |||
) | [static] |
Definition at line 585 of file glue.scode.c.
References bv2text(), LBUF_SIZE, TYPE_BV, TYPE_CBV, TYPE_CHAR, TYPE_CHAR_RO, TYPE_DBREF, TYPE_DBREF_RO, TYPE_FLOAT, TYPE_FLOAT_RO, TYPE_INT, TYPE_INT_RO, TYPE_SHORT, TYPE_SHORT_RO, TYPE_STRFUNC, TYPE_STRFUNC_BD, TYPE_STRING, and xcode_data.
Referenced by fun_btgetxcodevalue(), fun_btgetxcodevalue_ref(), and list_xcodestuff().
00586 { 00587 void *bar = (void *) ((int) data + xcode_data[i].rel_addr); 00588 static char buf[LBUF_SIZE]; 00589 char *(*tempfun) (); 00590 00591 switch (xcode_data[i].type) { 00592 case TYPE_STRFUNC_BD: 00593 case TYPE_STRFUNC: 00594 tempfun = (void *) xcode_data[i].rel_addr; 00595 sprintf(buf, "%s", (char *) tempfun(0, (MECH *) data)); 00596 break; 00597 case TYPE_STRING: 00598 sprintf(buf, "%s", (char *) bar); 00599 break; 00600 case TYPE_DBREF: 00601 case TYPE_DBREF_RO: 00602 sprintf(buf, "%d", (dbref) * ((dbref *) bar)); 00603 break; 00604 case TYPE_CHAR: 00605 case TYPE_CHAR_RO: 00606 sprintf(buf, "%d", (char) *((char *) bar)); 00607 break; 00608 case TYPE_SHORT: 00609 case TYPE_SHORT_RO: 00610 sprintf(buf, "%d", (short) *((short *) bar)); 00611 break; 00612 case TYPE_INT: 00613 case TYPE_INT_RO: 00614 sprintf(buf, "%d", (int) *((int *) bar)); 00615 break; 00616 case TYPE_FLOAT: 00617 case TYPE_FLOAT_RO: 00618 sprintf(buf, "%.2f", (float) *((float *) bar)); 00619 break; 00620 case TYPE_BV: 00621 strcpy(buf, bv2text((int) *((int *) bar))); 00622 break; 00623 case TYPE_CBV: 00624 strcpy(buf, bv2text((int) *((char *) bar))); 00625 break; 00626 } 00627 return buf; 00628 }
void set_xcodestuff | ( | dbref | player, | |
void * | data, | |||
char * | buffer | |||
) |
Definition at line 682 of file glue.scode.c.
References args, DOCHECK, FindObjectsData(), getMech(), Location, GMV::name, name, scode_in_out, silly_parseattributes(), GMV::size, text2bv(), TYPE_BV, TYPE_CBV, TYPE_CHAR, TYPE_DBREF, TYPE_FLOAT, TYPE_INT, TYPE_SHORT, TYPE_STRFUNC_BD, TYPE_STRFUNC_S, TYPE_STRING, WhichSpecial(), and xcode_data.
00683 { 00684 char *args[2]; 00685 int t, i; 00686 void *bar; 00687 void *(*tempfun) (); 00688 00689 memset(args, 0, sizeof(char *) * 2); 00690 00691 DOCHECK(silly_parseattributes(buffer, args, 2) != 2, 00692 "Invalid arguments!"); 00693 t = WhichSpecial(Location(player)); 00694 for(i = 0; xcode_data[i].name; i++) 00695 if(xcode_data[i].gtype == t) 00696 break; 00697 DOCHECK(!xcode_data[i].name, 00698 "Error: No xcode values for this type of object found."); 00699 for(i = 0; xcode_data[i].name; i++) 00700 if(!strcasecmp(args[0], xcode_data[i].name) && 00701 xcode_data[i].gtype == t && (scode_in_out[xcode_data[i].type] & 2)) 00702 break; 00703 DOCHECK(!xcode_data[i].name, 00704 "Error: No matching xcode value for this type of object found."); 00705 bar = 00706 (void *) ((int) FindObjectsData(Location(player)) + 00707 xcode_data[i].rel_addr); 00708 switch (xcode_data[i].type) { 00709 case TYPE_STRFUNC_BD: 00710 case TYPE_STRFUNC_S: 00711 tempfun = (void *) xcode_data[i].rel_addr; 00712 tempfun(1, getMech(Location(player)), (char *) args[1]); 00713 break; 00714 case TYPE_STRING: 00715 strncpy((char *) bar, args[1], xcode_data[i].size - 1); 00716 ((char *) bar)[xcode_data[i].size - 1] = '\0'; 00717 break; 00718 case TYPE_DBREF: 00719 *((dbref *) bar) = atoi(args[1]); 00720 break; 00721 case TYPE_CHAR: 00722 *((char *) bar) = atoi(args[1]); 00723 break; 00724 case TYPE_SHORT: 00725 *((short *) bar) = atoi(args[1]); 00726 break; 00727 case TYPE_INT: 00728 *((int *) bar) = atoi(args[1]); 00729 break; 00730 case TYPE_FLOAT: 00731 *((float *) bar) = atof(args[1]); 00732 break; 00733 case TYPE_BV: 00734 *((int *) bar) = text2bv(args[1]); 00735 break; 00736 case TYPE_CBV: 00737 *((byte *) bar) = (byte) text2bv(args[1]); 00738 } 00739 }
char* setarmorstatus_func | ( | MECH * | mech, | |
char * | sectstr, | |||
char * | typestr, | |||
char * | valuestr | |||
) |
Definition at line 1018 of file mech.damage.c.
References ArmorSectionFromString(), GetSectOInt, MechMove, MechType, SetSectArmor, SetSectInt, and SetSectRArmor.
Referenced by fun_btsetarmorstatus().
01020 { 01021 int index, type, value; 01022 01023 if(!sectstr || !*sectstr) 01024 return "#-1 INVALID SECTION"; 01025 index = ArmorSectionFromString(MechType(mech), MechMove(mech), sectstr); 01026 if(index == -1 || !GetSectOInt(mech, index)) 01027 return "#-1 INVALID SECTION"; 01028 if((value = atoi(valuestr)) < 0 || value > 255) 01029 return "#-1 INVALID ARMORVALUE"; 01030 switch (type = atoi(typestr)) { 01031 case 0: 01032 SetSectArmor(mech, index, value); 01033 break; 01034 case 1: 01035 SetSectInt(mech, index, value); 01036 break; 01037 case 2: 01038 SetSectRArmor(mech, index, value); 01039 break; 01040 default: 01041 return "#-1 INVALID ARMORTYPE"; 01042 } 01043 return "1"; 01044 }
static int text2bv | ( | char * | text | ) | [static] |
Definition at line 348 of file glue.scode.c.
References bv_val(), c, and Readnum.
Referenced by fun_btsetxcodevalue(), and set_xcodestuff().
00349 { 00350 char *c; 00351 int j = 0; 00352 int mode_not = 0; 00353 00354 if(!Readnum(j, text)) 00355 return j; /* Allow 'old style' as well */ 00356 00357 /* Valid bitvector letters are: a-z (=27), A-Z (=27 more) */ 00358 for(c = text; *c; c++) { 00359 if(*c == '!') { 00360 mode_not = 1; 00361 c++; 00362 }; 00363 if((*c >= 'a' && *c <= 'z') || (*c >= 'A' && *c <= 'Z')) { 00364 int k = bv_val(*c, 0); 00365 00366 if(k) { 00367 if(mode_not) 00368 j &= ~k; 00369 else 00370 j |= k; 00371 } 00372 } 00373 mode_not = 0; 00374 } 00375 return j; 00376 }
int xlate | ( | char * | ) |
Definition at line 2030 of file functions.c.
02031 { 02032 int temp; 02033 char *temp2; 02034 02035 if(arg[0] == '#') { 02036 arg++; 02037 /* #- anything is false */ 02038 if(arg[1] == '-') { 02039 return 0; 02040 } 02041 if(is_integer(arg)) { 02042 temp = atoi(arg); 02043 if(temp == -1) 02044 temp = 0; 02045 return temp; 02046 } 02047 return 0; 02048 } 02049 temp2 = trim_space_sep(arg, ' '); 02050 if(!*temp2) 02051 return 0; 02052 if(is_integer(temp2)) 02053 return atoi(temp2); 02054 return 1; 02055 }
char* mech_types[] |
Definition at line 1043 of file template.c.
Referenced by load_template(), mechTypefunc(), and save_template().
char* move_types[] |
Definition at line 1036 of file template.c.
Referenced by load_template(), mechMovefunc(), and save_template().
char radio_colorstr[] |
Definition at line 619 of file mech.notify.c.
Referenced by ccode(), fun_btmechfreqs(), mech_list_freqs(), and mech_set_channelmode().
int scode_in_out[TYPE_LAST_TYPE] [static] |
Initial value:
{ 3, 3, 3, 3, 3, 3, 1, 2, 3, 3, 3, 1, 1, 1, 1, 1 }
Definition at line 76 of file glue.scode.c.
Referenced by fun_btgetxcodevalue(), fun_btgetxcodevalue_ref(), fun_btsetxcodevalue(), list_xcodestuff(), and set_xcodestuff().
Definition at line 65 of file glue.scode.c.
Referenced by mech_enter_event(), and mech_enterbay_event().
Definition at line 67 of file glue.scode.c.
GMV xcode_data[] [static] |
Definition at line 403 of file glue.scode.c.
Referenced by fun_btgetxcodevalue(), fun_btgetxcodevalue_ref(), fun_btsetxcodevalue(), list_xcodestuff(), list_xcodevalues(), RetrieveValue(), and set_xcodestuff().