src/hcode/btech/mech.tech.h File Reference

#include "config.h"
#include "mech.events.h"

Include dependency graph for mech.tech.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define MAX_TECHTIME   600
#define TECH_TICK   60
#define TECH_UNIT   "minute"
#define PARTTYPE_DIFFICULTY(a)   (1)
#define WEAPTYPE_DIFFICULTY(a)   ((int) (sqrt(MechWeapons[Weapon2I(a)].criticals)*1.5-1.1))
#define REPAIR_DIFFICULTY   0
#define REPLACE_DIFFICULTY   1
#define RELOAD_DIFFICULTY   1
#define FIXARMOR_DIFFICULTY   1
#define FIXINTERNAL_DIFFICULTY   2
#define REATTACH_DIFFICULTY   3
#define REMOVEG_DIFFICULTY   1
#define REMOVEP_DIFFICULTY   0
#define REMOVES_DIFFICULTY   2
#define RESEAL_DIFFICULTY   0
#define REPLACESUIT_DIFFICULTY   3
#define ENHCRIT_DIFFICULTY   0
#define MOUNT_BOMB_TIME   5
#define UMOUNT_BOMB_TIME   5
#define REPLACEGUN_TIME   60
#define REPLACEPART_TIME   45
#define REPAIRGUN_TIME   20
#define REPAIRENHCRIT_TIME   15
#define REPAIRPART_TIME   15
#define RELOAD_TIME   10
#define FIXARMOR_TIME   3
#define FIXINTERNAL_TIME   9
#define REATTACH_TIME   240
#define REMOVEP_TIME   40
#define REMOVEG_TIME   40
#define REMOVES_TIME   120
#define RESEAL_TIME   60
#define REPLACESUIT_TIME   120
#define TECHCOMMANDH(a)   void a (dbref player, void * data, char * buffer)
#define TECHCOMMANDB
#define TECHCOMMANDC
#define TECHCOMMANDD
#define ETECHCOMMAND(a)   void a (dbref player, void *data, char *buffer)
#define LOCMAX   16
#define POSMAX   16
#define EXTMAX   256
#define PLAYERPOS   (LOCMAX*POSMAX*EXTMAX)
#define TECHEVENT(a)
#define ETECHEVENT(a)   extern void a (MUXEVENT *e)
#define START(a)   notify(player, a)
#define FIXEVENT(time, d1, d2, fu, type)   muxevent_add(MAX(1, time), 0, type, fu, (void *) d1, (void *) ((d2) + player * PLAYERPOS))
#define REPAIREVENT(time, d1, d2, fu, type)   FIXEVENT((time)*TECH_TICK,d1,d2,fu,type)
#define STARTREPAIR(time, d1, d2, fu, type)   FIXEVENT(tech_addtechtime(player, (time * mod) / 2),d1,d2,fu,type)
#define STARTIREPAIR(time, d1, d2, fu, type, amount)   FIXEVENT((tech_addtechtime(player, (time * mod) / 2) - (amount > 0 ? TECH_TICK * (time * (amount - 1) / (amount)) : 0)), d1, d2, fu, type)
#define FAKEREPAIR(time, type, d1, d2)   FIXEVENT(tech_addtechtime(player, (time * mod) / 2),d1,d2,very_fake_func,type)
#define DOTECH_LOCPOS(diff, flunkfunc, succfunc, resourcefunc, time, d1, d2, fu, type, msg, isgun)
#define DOTECH_LOCPOS_VAL(diff, flunkfunc, succfunc, resourcefunc, amo, time, d1, d2, fu, type, msg)
#define DOTECH_LOC_VAL_S(diff, flunkfunc, succfunc, resourcefunc, amo, time, type, d1, d2, msg)
#define DOTECH_LOC_VAL(diff, flunkfunc, succfunc, resourcefunc, amo, time, d1, d2, fu, type, msg)
#define DOTECH_LOC(diff, flunkfunc, succfunc, resourcefunc, time, d1, d2, fu, type, msg)
#define TFUNC_LOCPOS_VAL(name)   int name (dbref player,MECH *mech,int loc,int part, int * val)
#define TFUNC_LOC_VAL(name)   int name (dbref player, MECH *mech, int loc, int * val)
#define TFUNC_LOCPOS(name)   int name (dbref player, MECH *mech, int loc, int part)
#define TFUNC_LOC(name)   int name (dbref player, MECH *mech, int loc)
#define TFUNC_LOC_RESEAL(name)   int name (dbref player, MECH *mech, int loc)
#define NFUNC(a)   a { return 0; }
#define PACK_LOCPOS(loc, pos)   ((loc) + (pos)*LOCMAX)
#define PACK_LOCPOS_E(loc, pos, extra)   ((loc) + (pos)*LOCMAX + (extra)*LOCMAX*POSMAX)
#define UNPACK_LOCPOS(var, loc, pos)   loc = (var % LOCMAX);pos = (var / LOCMAX) % POSMAX
#define UNPACK_LOCPOS_E(var, loc, pos, extra)   UNPACK_LOCPOS(var,loc,pos);extra = var / (LOCMAX * POSMAX)
#define ProperArmor(mech)
#define ProperInternal(mech)
#define GrabPartsM(m, a, b, c)   econ_change_items(IsDS(m) ? AeroBay(m,0) : Location(m->mynum),a,b,0-c)
#define PartAvailM(m, a, b, c)   (econ_find_items(IsDS(m) ? AeroBay(m,0) : Location(m->mynum),a,b)>=c)
#define AddPartsM(m, a, b, c)   econ_change_items(IsDS(m) ? AeroBay(m,0) : Location(m->mynum), alias_part(m, a) , b, c)
#define AVCHECKM(m, a, b, c)   DOCHECK1(!PartAvailM(m,a,b,c), tprintf("Not enough %ss in store! You need to have atleast %d.",part_name(a,b),c));
#define alias_part(m, t)

Functions

 ETECHCOMMAND (tech_removegun)
 ETECHCOMMAND (tech_removepart)
 ETECHCOMMAND (tech_removesection)
 ETECHCOMMAND (tech_replacegun)
 ETECHCOMMAND (tech_repairgun)
 ETECHCOMMAND (tech_fixenhcrit)
 ETECHCOMMAND (tech_replacepart)
 ETECHCOMMAND (tech_repairpart)
 ETECHCOMMAND (tech_toggletype)
 ETECHCOMMAND (tech_reload)
 ETECHCOMMAND (tech_unload)
 ETECHCOMMAND (tech_fixarmor)
 ETECHCOMMAND (tech_fixinternal)
 ETECHCOMMAND (tech_reattach)
 ETECHCOMMAND (tech_checkstatus)
 ETECHCOMMAND (tech_reseal)
 ETECHCOMMAND (tech_replacesuit)
 ECMD (show_mechs_damage)
 ECMD (tech_fix)
 ETECHEVENT (muxevent_tickmech_reattach)
 ETECHEVENT (muxevent_tickmech_reseal)
 ETECHEVENT (muxevent_tickmech_reload)
 ETECHEVENT (muxevent_tickmech_removegun)
 ETECHEVENT (muxevent_tickmech_removepart)
 ETECHEVENT (muxevent_tickmech_removesection)
 ETECHEVENT (muxevent_tickmech_repairarmor)
 ETECHEVENT (muxevent_tickmech_repairgun)
 ETECHEVENT (muxevent_tickmech_repairenhcrit)
 ETECHEVENT (muxevent_tickmech_repairinternal)
 ETECHEVENT (muxevent_tickmech_repairpart)
 ETECHEVENT (muxevent_tickmech_replacegun)
 ETECHEVENT (muxevent_tickmech_mountbomb)
 ETECHEVENT (muxevent_tickmech_umountbomb)
 ETECHEVENT (muxevent_tickmech_replacesuit)
 ETECHEVENT (very_fake_func)
void loadrepairs (FILE *f)
void saverepairs (FILE *f)
int valid_ammo_mode (MECH *mech, int loc, int part, int let)


Define Documentation

#define AddPartsM ( m,
a,
b,
c   )     econ_change_items(IsDS(m) ? AeroBay(m,0) : Location(m->mynum), alias_part(m, a) , b, c)

Definition at line 235 of file mech.tech.h.

Referenced by muxevent_tickmech_reload(), muxevent_tickmech_removegun(), muxevent_tickmech_removepart(), muxevent_tickmech_removesection(), TFUNC_LOC(), TFUNC_LOC_RESEAL(), and TFUNC_LOCPOS().

#define alias_part ( m,
 ) 

Value:

Definition at line 242 of file mech.tech.h.

Referenced by critslot_func().

#define AVCHECKM ( m,
a,
b,
c   )     DOCHECK1(!PartAvailM(m,a,b,c), tprintf("Not enough %ss in store! You need to have atleast %d.",part_name(a,b),c));

Definition at line 239 of file mech.tech.h.

#define DOTECH_LOC ( diff,
flunkfunc,
succfunc,
resourcefunc,
time,
d1,
d2,
fu,
type,
msg   ) 

Value:

if (resourcefunc(player,mech,loc)<0) return; \
   START(msg); \
   if (tech_roll(player, mech, diff) < 0) { mod = 3; \
   if (flunkfunc(player,mech,loc)<0) { FAKEREPAIR(time,type,d1,d2);return; }} \
    else \
   { if (succfunc(player,mech,loc)<0) return; } \
   STARTREPAIR(time,d1,d2,fu,type)

Definition at line 165 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define DOTECH_LOC_VAL ( diff,
flunkfunc,
succfunc,
resourcefunc,
amo,
time,
d1,
d2,
fu,
type,
msg   ) 

Value:

if (resourcefunc(player,mech,loc,amo)<0) return; \
   START(msg); \
   if (tech_roll(player, mech, diff) < 0) { mod = 3; \
   if (flunkfunc(player,mech,loc,amo)<0) { FAKEREPAIR(time,type,d1,d2); return; }} \
   else \
     { if (succfunc(player,mech,loc,amo)<0) return; } \
   STARTREPAIR(time,d1,d2,fu,type)

Definition at line 155 of file mech.tech.h.

#define DOTECH_LOC_VAL_S ( diff,
flunkfunc,
succfunc,
resourcefunc,
amo,
time,
type,
d1,
d2,
msg   ) 

Value:

if (resourcefunc(player,mech,loc,amo)<0) return; \
   START(msg); \
   if (tech_roll(player, mech, diff) < 0) { mod = 3; \
   if (flunkfunc(player,mech,loc,amo)<0) { FAKEREPAIR(time,type,d1,d2); return; }} \
   else \
     { if (succfunc(player,mech,loc,amo)<0) return; }

Definition at line 147 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define DOTECH_LOCPOS ( diff,
flunkfunc,
succfunc,
resourcefunc,
time,
d1,
d2,
fu,
type,
msg,
isgun   ) 

Value:

if (resourcefunc(player,mech,loc,part)>=0) { START(msg); \
   if ((!isgun && tech_roll(player, mech, diff) < 0) || \
       (isgun && tech_weapon_roll(player, mech, diff) < 0)) { mod = 3;  \
   if (flunkfunc(player,mech,loc,part)<0) { FAKEREPAIR(time,type,d1,d2); return;}} \
    else \
     { if (succfunc(player,mech,loc,part)<0) return; } \
     STARTREPAIR(time,d1,d2,fu,type); }

Definition at line 126 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define DOTECH_LOCPOS_VAL ( diff,
flunkfunc,
succfunc,
resourcefunc,
amo,
time,
d1,
d2,
fu,
type,
msg   ) 

Value:

if (resourcefunc(player,mech,loc,part,amo)<0) return; \
   START(msg); \
   if (tech_roll(player, mech, diff) < 0) { mod = 3; \
   if (flunkfunc(player,mech,loc,part,amo)<0) {FAKEREPAIR(time,type,d1,d2);return;}}\
     else \
   { if (succfunc(player,mech,loc,part,amo)<0) return; } \
   STARTREPAIR(time,d1,d2,fu,type)

Definition at line 136 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define ENHCRIT_DIFFICULTY   0

Definition at line 48 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define ETECHCOMMAND (  )     void a (dbref player, void *data, char *buffer)

Definition at line 92 of file mech.tech.h.

#define ETECHEVENT (  )     extern void a (MUXEVENT *e)

Definition at line 105 of file mech.tech.h.

#define EXTMAX   256

Definition at line 97 of file mech.tech.h.

#define FAKEREPAIR ( time,
type,
d1,
d2   )     FIXEVENT(tech_addtechtime(player, (time * mod) / 2),d1,d2,very_fake_func,type)

Definition at line 122 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define FIXARMOR_DIFFICULTY   1

Definition at line 40 of file mech.tech.h.

Referenced by TECHCOMMANDH(), and TFUNC_LOC_VAL().

#define FIXARMOR_TIME   3

Definition at line 59 of file mech.tech.h.

Referenced by cheat_find_last(), muxevent_tickmech_repairarmor(), and TECHCOMMANDH().

#define FIXEVENT ( time,
d1,
d2,
fu,
type   )     muxevent_add(MAX(1, time), 0, type, fu, (void *) d1, (void *) ((d2) + player * PLAYERPOS))

Definition at line 110 of file mech.tech.h.

Referenced by loadrepairs().

#define FIXINTERNAL_DIFFICULTY   2

Definition at line 41 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define FIXINTERNAL_TIME   9

Definition at line 60 of file mech.tech.h.

Referenced by cheat_find_last(), muxevent_tickmech_repairinternal(), and TECHCOMMANDH().

#define GrabPartsM ( m,
a,
b,
c   )     econ_change_items(IsDS(m) ? AeroBay(m,0) : Location(m->mynum),a,b,0-c)

Definition at line 232 of file mech.tech.h.

#define LOCMAX   16

Definition at line 95 of file mech.tech.h.

#define MAX_TECHTIME   600

Definition at line 25 of file mech.tech.h.

Referenced by tech_status().

#define MOUNT_BOMB_TIME   5

Definition at line 51 of file mech.tech.h.

#define NFUNC (  )     a { return 0; }

Definition at line 183 of file mech.tech.h.

#define PACK_LOCPOS ( loc,
pos   )     ((loc) + (pos)*LOCMAX)

Definition at line 207 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define PACK_LOCPOS_E ( loc,
pos,
extra   )     ((loc) + (pos)*LOCMAX + (extra)*LOCMAX*POSMAX)

Definition at line 208 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define PartAvailM ( m,
a,
b,
c   )     (econ_find_items(IsDS(m) ? AeroBay(m,0) : Location(m->mynum),a,b)>=c)

Definition at line 233 of file mech.tech.h.

#define PARTTYPE_DIFFICULTY (  )     (1)

Definition at line 35 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define PLAYERPOS   (LOCMAX*POSMAX*EXTMAX)

Definition at line 98 of file mech.tech.h.

Referenced by cheat_find_last(), describe_repairs(), loadrepairs(), muxevent_tickmech_reattach(), muxevent_tickmech_reload(), muxevent_tickmech_removegun(), muxevent_tickmech_removepart(), muxevent_tickmech_removesection(), muxevent_tickmech_repairarmor(), muxevent_tickmech_repairenhcrit(), muxevent_tickmech_repairgun(), muxevent_tickmech_repairinternal(), muxevent_tickmech_repairpart(), muxevent_tickmech_replacegun(), muxevent_tickmech_replacesuit(), and muxevent_tickmech_reseal().

#define POSMAX   16

Definition at line 96 of file mech.tech.h.

#define ProperArmor ( mech   ) 

Value:

Definition at line 214 of file mech.tech.h.

Referenced by muxevent_tickmech_removesection(), and TFUNC_LOC_VAL().

#define ProperInternal ( mech   ) 

Value:

Definition at line 224 of file mech.tech.h.

Referenced by muxevent_tickmech_removesection(), TFUNC_LOC(), TFUNC_LOC_RESEAL(), TFUNC_LOC_VAL(), and TFUNC_LOCPOS().

#define REATTACH_DIFFICULTY   3

Definition at line 42 of file mech.tech.h.

Referenced by TECHCOMMANDH(), and TFUNC_LOC().

#define REATTACH_TIME   240

Definition at line 61 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define RELOAD_DIFFICULTY   1

Definition at line 39 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define RELOAD_TIME   10

Definition at line 58 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define REMOVEG_DIFFICULTY   1

Definition at line 43 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define REMOVEG_TIME   40

Definition at line 63 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define REMOVEP_DIFFICULTY   0

Definition at line 44 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define REMOVEP_TIME   40

Definition at line 62 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define REMOVES_DIFFICULTY   2

Definition at line 45 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define REMOVES_TIME   120

Definition at line 64 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define REPAIR_DIFFICULTY   0

Definition at line 37 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define REPAIRENHCRIT_TIME   15

Definition at line 56 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define REPAIREVENT ( time,
d1,
d2,
fu,
type   )     FIXEVENT((time)*TECH_TICK,d1,d2,fu,type)

Definition at line 116 of file mech.tech.h.

Referenced by muxevent_tickmech_repairarmor(), and muxevent_tickmech_repairinternal().

#define REPAIRGUN_TIME   20

Definition at line 55 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define REPAIRPART_TIME   15

Definition at line 57 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define REPLACE_DIFFICULTY   1

Definition at line 38 of file mech.tech.h.

Referenced by TECHCOMMANDH(), and TFUNC_LOCPOS().

#define REPLACEGUN_TIME   60

Definition at line 53 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define REPLACEPART_TIME   45

Definition at line 54 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define REPLACESUIT_DIFFICULTY   3

Definition at line 47 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define REPLACESUIT_TIME   120

Definition at line 66 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define RESEAL_DIFFICULTY   0

Definition at line 46 of file mech.tech.h.

Referenced by TECHCOMMANDH(), and TFUNC_LOC_RESEAL().

#define RESEAL_TIME   60

Definition at line 65 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define START (  )     notify(player, a)

Definition at line 108 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define STARTIREPAIR ( time,
d1,
d2,
fu,
type,
amount   )     FIXEVENT((tech_addtechtime(player, (time * mod) / 2) - (amount > 0 ? TECH_TICK * (time * (amount - 1) / (amount)) : 0)), d1, d2, fu, type)

Definition at line 120 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define STARTREPAIR ( time,
d1,
d2,
fu,
type   )     FIXEVENT(tech_addtechtime(player, (time * mod) / 2),d1,d2,fu,type)

Definition at line 118 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define TECH_TICK   60

Definition at line 27 of file mech.tech.h.

Referenced by cheat_find_last(), tech_addtechtime(), and tech_status().

#define TECH_UNIT   "minute"

Definition at line 28 of file mech.tech.h.

Referenced by tech_status().

#define TECHCOMMANDB

Value:

MECH *mech = (MECH *) data; \
 int loc, part, t, full, now, from, to, change, mod=2, isds=0; \
 char *c;

Definition at line 70 of file mech.tech.h.

Referenced by TECHCOMMANDH().

#define TECHCOMMANDC

Value:

DOCHECK(!(Tech(player)),"Insufficient clearance to access the command."); \
DOCHECK(!mech, "Error has occured in techcommand ; please contact a wiz"); \
isds = DropShip(MechType(mech)); \
DOCHECK(Starting(mech) && !Wiz(player), "The mech's starting up! Please stop the sequence first."); \
DOCHECK(Started(mech) && !Wiz(player), "The mech's started up ; please shut it down first."); \
DOCHECK(!isds && !MechStall(mech) && !Wiz(player), "The 'mech isn't in a repair stall!");

Definition at line 76 of file mech.tech.h.

Referenced by tech_fix(), and TECHCOMMANDH().

#define TECHCOMMANDD

Value:

DOCHECK(!(Tech(player)),"Insufficient clearance to access the command."); \
DOCHECK(!mech, "Error has occured in techcommand ; please contact a wiz"); \
isds = DropShip(MechType(mech)); \
DOCHECK(Starting(mech) && !Wiz(player), "The mech's starting up! Please stop the sequence first."); \
DOCHECK(Started(mech) && !Wiz(player), "The mech's started up ; please shut it down first."); \
DOCHECK(mudconf.btech_limitedrepairs && !isds && !MechStall(mech) && !Wiz(player), "The 'mech isn't in a repair stall!");

Definition at line 84 of file mech.tech.h.

Referenced by show_mechs_damage(), tech_repairs(), and TECHCOMMANDH().

#define TECHCOMMANDH (  )     void a (dbref player, void * data, char * buffer)

Definition at line 68 of file mech.tech.h.

#define TECHEVENT (  ) 

Value:

void a (MUXEVENT *e) \
     { MECH *mech = (MECH *) e->data;  \
       int earg = (int) (e->data2) % PLAYERPOS;

Definition at line 100 of file mech.tech.h.

#define TFUNC_LOC ( name   )     int name (dbref player, MECH *mech, int loc)

Definition at line 180 of file mech.tech.h.

#define TFUNC_LOC_RESEAL ( name   )     int name (dbref player, MECH *mech, int loc)

Definition at line 182 of file mech.tech.h.

#define TFUNC_LOC_VAL ( name   )     int name (dbref player, MECH *mech, int loc, int * val)

Definition at line 176 of file mech.tech.h.

#define TFUNC_LOCPOS ( name   )     int name (dbref player, MECH *mech, int loc, int part)

Definition at line 178 of file mech.tech.h.

#define TFUNC_LOCPOS_VAL ( name   )     int name (dbref player,MECH *mech,int loc,int part, int * val)

Definition at line 174 of file mech.tech.h.

#define UMOUNT_BOMB_TIME   5

Definition at line 52 of file mech.tech.h.

#define UNPACK_LOCPOS ( var,
loc,
pos   )     loc = (var % LOCMAX);pos = (var / LOCMAX) % POSMAX

Definition at line 210 of file mech.tech.h.

Referenced by muxevent_tickmech_repairenhcrit(), muxevent_tickmech_repairgun(), muxevent_tickmech_repairpart(), and tech_check_locpart().

#define UNPACK_LOCPOS_E ( var,
loc,
pos,
extra   )     UNPACK_LOCPOS(var,loc,pos);extra = var / (LOCMAX * POSMAX)

Definition at line 211 of file mech.tech.h.

Referenced by describe_repairs(), muxevent_tickmech_reload(), muxevent_tickmech_removegun(), muxevent_tickmech_removepart(), muxevent_tickmech_removesection(), and muxevent_tickmech_replacegun().

#define WEAPTYPE_DIFFICULTY (  )     ((int) (sqrt(MechWeapons[Weapon2I(a)].criticals)*1.5-1.1))

Definition at line 36 of file mech.tech.h.

Referenced by TECHCOMMANDH().


Function Documentation

ECMD ( tech_fix   ) 

ECMD ( show_mechs_damage   ) 

ETECHCOMMAND ( tech_replacesuit   ) 

ETECHCOMMAND ( tech_reseal   ) 

ETECHCOMMAND ( tech_checkstatus   ) 

ETECHCOMMAND ( tech_reattach   ) 

ETECHCOMMAND ( tech_fixinternal   ) 

ETECHCOMMAND ( tech_fixarmor   ) 

ETECHCOMMAND ( tech_unload   ) 

ETECHCOMMAND ( tech_reload   ) 

ETECHCOMMAND ( tech_toggletype   ) 

ETECHCOMMAND ( tech_repairpart   ) 

ETECHCOMMAND ( tech_replacepart   ) 

ETECHCOMMAND ( tech_fixenhcrit   ) 

ETECHCOMMAND ( tech_repairgun   ) 

ETECHCOMMAND ( tech_replacegun   ) 

ETECHCOMMAND ( tech_removesection   ) 

ETECHCOMMAND ( tech_removepart   ) 

ETECHCOMMAND ( tech_removegun   ) 

ETECHEVENT ( very_fake_func   ) 

ETECHEVENT ( muxevent_tickmech_replacesuit   ) 

ETECHEVENT ( muxevent_tickmech_umountbomb   ) 

ETECHEVENT ( muxevent_tickmech_mountbomb   ) 

ETECHEVENT ( muxevent_tickmech_replacegun   ) 

ETECHEVENT ( muxevent_tickmech_repairpart   ) 

ETECHEVENT ( muxevent_tickmech_repairinternal   ) 

ETECHEVENT ( muxevent_tickmech_repairenhcrit   ) 

ETECHEVENT ( muxevent_tickmech_repairgun   ) 

ETECHEVENT ( muxevent_tickmech_repairarmor   ) 

ETECHEVENT ( muxevent_tickmech_removesection   ) 

ETECHEVENT ( muxevent_tickmech_removepart   ) 

ETECHEVENT ( muxevent_tickmech_removegun   ) 

ETECHEVENT ( muxevent_tickmech_reload   ) 

ETECHEVENT ( muxevent_tickmech_reseal   ) 

ETECHEVENT ( muxevent_tickmech_reattach   ) 

void loadrepairs ( FILE *  f  ) 

Definition at line 56 of file mech.tech.saverepair.c.

Referenced by load_xcode().

00057 {
00058         dbref d, player;
00059         int type;
00060         int data;
00061         int time;
00062         MECH *mech;
00063         int loaded = 0;
00064         int fake;
00065 
00066         if(feof(f))
00067                 return;
00068         fread(&d, sizeof(d), 1, f);
00069         while (d > 0 && !feof(f)) {
00070                 loaded++;
00071                 CHELO(type);
00072                 CHELO(time);
00073                 CHELO(data);
00074                 fake = (time < 0);
00075                 time = abs(time);
00076                 if(!(mech = FindObjectsData(d)))
00077                         continue;
00078                 player = data / PLAYERPOS;
00079                 data = data % PLAYERPOS;
00080                 if(fake)
00081                         FIXEVENT(time, mech, data, very_fake_func, type);
00082                 else
00083                         switch (type) {
00084                         case EVENT_REPAIR_MOB:
00085                                 FIXEVENT(time, mech, data, muxevent_tickmech_mountbomb, type);
00086                                 break;
00087                         case EVENT_REPAIR_UMOB:
00088                                 FIXEVENT(time, mech, data, muxevent_tickmech_umountbomb,
00089                                                  type);
00090                                 break;
00091                         case EVENT_REPAIR_REPL:
00092                                 FIXEVENT(time, mech, data, muxevent_tickmech_repairpart,
00093                                                  type);
00094                                 break;
00095                         case EVENT_REPAIR_REPLG:
00096                                 FIXEVENT(time, mech, data, muxevent_tickmech_replacegun,
00097                                                  type);
00098                                 break;
00099                         case EVENT_REPAIR_REPAP:
00100                                 FIXEVENT(time, mech, data, muxevent_tickmech_repairpart,
00101                                                  type);
00102                                 break;
00103                         case EVENT_REPAIR_REPENHCRIT:
00104                                 FIXEVENT(time, mech, data, muxevent_tickmech_repairenhcrit,
00105                                                  type);
00106                                 break;
00107                         case EVENT_REPAIR_REPAG:
00108                                 FIXEVENT(time, mech, data, muxevent_tickmech_repairgun, type);
00109                                 break;
00110                         case EVENT_REPAIR_REAT:
00111                                 FIXEVENT(time, mech, data, muxevent_tickmech_reattach, type);
00112                                 break;
00113                         case EVENT_REPAIR_RELO:
00114                                 FIXEVENT(time, mech, data, muxevent_tickmech_reload, type);
00115                                 break;
00116                         case EVENT_REPAIR_FIX:
00117                                 FIXEVENT(time, mech, data, muxevent_tickmech_repairarmor,
00118                                                  type);
00119                                 break;
00120                         case EVENT_REPAIR_FIXI:
00121                                 FIXEVENT(time, mech, data, muxevent_tickmech_repairinternal,
00122                                                  type);
00123                                 break;
00124                         case EVENT_REPAIR_SCRL:
00125                                 FIXEVENT(time, mech, data, muxevent_tickmech_removesection,
00126                                                  type);
00127                                 break;
00128                         case EVENT_REPAIR_SCRG:
00129                                 FIXEVENT(time, mech, data, muxevent_tickmech_removegun, type);
00130                                 break;
00131                         case EVENT_REPAIR_SCRP:
00132                                 FIXEVENT(time, mech, data, muxevent_tickmech_removepart,
00133                                                  type);
00134                                 break;
00135                         case EVENT_REPAIR_REPSUIT:
00136                                 FIXEVENT(time, mech, data, muxevent_tickmech_replacesuit,
00137                                                  type);
00138                                 break;
00139                         }
00140                 CHELO(d);
00141         }
00142         if(loaded)
00143                 fprintf(stderr, "LOADED: %d tech events.\n", loaded);
00144 }

void saverepairs ( FILE *  f  ) 

Definition at line 43 of file mech.tech.saverepair.c.

Referenced by SaveSpecialObjects().

00044 {
00045         int i;
00046         dbref d = -1;
00047 
00048         cheat_file = f;
00049         for(i = FIRST_TECH_EVENT; i <= LAST_TECH_EVENT; i++) {
00050                 ev_type = i;
00051                 muxevent_gothru_type(i, save_event);
00052         }
00053         CHESA(d);
00054 }

int valid_ammo_mode ( MECH mech,
int  loc,
int  part,
int  let 
)

Definition at line 98 of file mech.tech.do.c.

00099 {
00100         int w, i;
00101 
00102         if(!IsAmmo(GetPartType(mech, loc, part)) || !let)
00103                 return -1;
00104         let = toupper(let);
00105         w = Ammo2I(GetPartType(mech, loc, part));
00106 
00107         if(MechWeapons[w].special & NOSPA)
00108                 return -1;
00109 
00110         for(i = 0; ammo_types[i].name; i++) {
00111                 if(ammo_types[i].name != let)
00112                         continue;
00113                 if(ammo_types[i].rtype >= 0 &&
00114                    MechWeapons[w].type != ammo_types[i].rtype)
00115                         continue;
00116                 if(ammo_types[i].rspec &&
00117                    !(MechWeapons[w].special & ammo_types[i].rspec))
00118                         continue;
00119                 if(ammo_types[i].ntype >= 0 &&
00120                    MechWeapons[w].type == ammo_types[i].ntype)
00121                         continue;
00122                 if(ammo_types[i].nspec &&
00123                    (MechWeapons[w].special & ammo_types[i].nspec))
00124                         continue;
00125                 return ammo_types[i].aflag;
00126         }
00127         return -1;
00128 }


Generated on Mon May 28 04:25:38 2007 for BattletechMUX by  doxygen 1.4.7