src/hcode/btech/p.mech.advanced.h File Reference

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

Go to the source code of this file.

Functions

void mech_ecm (dbref player, MECH *mech, char *buffer)
void mech_eccm (dbref player, MECH *mech, char *buffer)
void mech_perecm (dbref player, MECH *mech, char *buffer)
void mech_pereccm (dbref player, MECH *mech, char *buffer)
void mech_angelecm (dbref player, MECH *mech, char *buffer)
void mech_angeleccm (dbref player, MECH *mech, char *buffer)
void mech_stinger (dbref player, MECH *mech, char *buffer)
void mech_slite (dbref player, MECH *mech, char *buffer)
void mech_ams (dbref player, void *data, char *buffer)
void mech_fliparms (dbref player, void *data, char *buffer)
void mech_flamerheat (dbref player, void *data, char *buffer)
void mech_ultra (dbref player, void *data, char *buffer)
void mech_rac (dbref player, void *data, char *buffer)
void mech_rapidfire (dbref player, void *data, char *buffer)
void mech_unjamammo (dbref player, void *data, char *buffer)
void mech_gattling (dbref player, void *data, char *buffer)
void mech_inarc_ammo_toggle (dbref player, void *data, char *buffer)
void mech_explosive (dbref player, void *data, char *buffer)
void mech_lbx (dbref player, void *data, char *buffer)
void mech_armorpiercing (dbref player, void *data, char *buffer)
void mech_flechette (dbref player, void *data, char *buffer)
void mech_incendiary (dbref player, void *data, char *buffer)
void mech_precision (dbref player, void *data, char *buffer)
void mech_caseless (dbref plyaer, void *data, char *buffer)
void mech_artemis (dbref player, void *data, char *buffer)
void mech_narc (dbref player, void *data, char *buffer)
void mech_swarm (dbref player, void *data, char *buffer)
void mech_swarm1 (dbref player, void *data, char *buffer)
void mech_inferno (dbref player, void *data, char *buffer)
void mech_hotload (dbref player, void *data, char *buffer)
void mech_cluster (dbref player, void *data, char *buffer)
void mech_smoke (dbref player, void *data, char *buffer)
void mech_mine (dbref player, void *data, char *buffer)
void mech_masc (dbref player, void *data, char *buffer)
void mech_scharge (dbref player, void *data, char *buffer)
void mech_explode (dbref player, void *data, char *buffer)
void mech_dig (dbref player, void *data, char *buffer)
void mech_fixturret (dbref player, void *data, char *buffer)
void mech_disableweap (dbref player, void *data, char *buffer)
int FindMainWeapon (MECH *mech, int(*callback)(MECH *, int, int, int, int))
void mech_stealtharmor (dbref player, MECH *mech, char *buffer)
void mech_nullsig (dbref player, MECH *mech, char *buffer)
void show_narc_pods (dbref player, MECH *mech, char *buffer)
void remove_inarc_pods_mech (dbref player, MECH *mech, char *buffer)
void remove_inarc_pods_tank (dbref player, MECH *mech, char *buffer)
void mech_auto_turret (dbref player, MECH *mech, char *buffer)
void mech_usebin (dbref player, MECH *mech, char *buffer)
void mech_safety (dbref player, void *data, char *buffer)
void mech_mechprefs (dbref player, void *data, char *buffer)


Function Documentation

int FindMainWeapon ( MECH mech,
int(*)(MECH *, int, int, int, int)  callback 
)

void mech_ams ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 204 of file mech.advanced.c.

References AMS_ENABLED, cch, CL_ANTI_MISSILE_TECH, IS_ANTI_MISSILE_TECH, MECH_USUALMO, and SILLY_TOGGLE_MACRO.

00205 {
00206         MECH *mech = (MECH *) data;
00207 
00208         cch(MECH_USUALMO);
00209 
00210         SILLY_TOGGLE_MACRO(IS_ANTI_MISSILE_TECH | CL_ANTI_MISSILE_TECH,
00211                                            AMS_ENABLED, "Anti-Missile System turned ON",
00212                                            "Anti-Missile System turned OFF",
00213                                            "This mech is not equipped with AMS");
00214 }

void mech_angeleccm ( dbref  player,
MECH mech,
char *  buffer 
)

Definition at line 123 of file mech.advanced.c.

References ANGEL_ECCM_ENABLED, ANGEL_ECM_DESTROYED, ANGEL_ECM_ENABLED, ANGEL_ECM_TECH, cch, DOCHECK, MarkForLOSUpdate(), MECH_USUALO, MechCritStatus, and TOGGLE_SPECIALS_MACRO_CHECK2.

00124 {
00125         cch(MECH_USUALO);
00126         DOCHECK(MechCritStatus(mech) & ANGEL_ECM_DESTROYED,
00127                         "Your Angel ECM has been destroyed already!");
00128         TOGGLE_SPECIALS_MACRO_CHECK2(ANGEL_ECM_TECH, ANGEL_ECCM_ENABLED,
00129                                                                  ANGEL_ECM_ENABLED,
00130                                                                  "You turn your Angel ECM suite online (ECCM mode).",
00131                                                                  "You turn your Angel ECM suite offline.",
00132                                                                  "This unit isn't equipped with an Angel ECM suite!");
00133         MarkForLOSUpdate(mech);
00134 }

void mech_angelecm ( dbref  player,
MECH mech,
char *  buffer 
)

Definition at line 110 of file mech.advanced.c.

References ANGEL_ECCM_ENABLED, ANGEL_ECM_DESTROYED, ANGEL_ECM_ENABLED, ANGEL_ECM_TECH, cch, DOCHECK, MarkForLOSUpdate(), MECH_USUALO, MechCritStatus, and TOGGLE_SPECIALS_MACRO_CHECK2.

00111 {
00112         cch(MECH_USUALO);
00113         DOCHECK(MechCritStatus(mech) & ANGEL_ECM_DESTROYED,
00114                         "Your Angel ECM has been destroyed already!");
00115         TOGGLE_SPECIALS_MACRO_CHECK2(ANGEL_ECM_TECH, ANGEL_ECM_ENABLED,
00116                                                                  ANGEL_ECCM_ENABLED,
00117                                                                  "You turn your Angel ECM suite online (ECM mode).",
00118                                                                  "You turn your Angel ECM suite offline.",
00119                                                                  "This unit isn't equipped with an Angel ECM suite!");
00120         MarkForLOSUpdate(mech);
00121 }

void mech_armorpiercing ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 459 of file mech.advanced.c.

References AC_AP_MODE, cch, mech_toggle_mode_sub(), MECH_USUALMO, and RFAC.

00460 {
00461         MECH *mech = (MECH *) data;
00462 
00463         cch(MECH_USUALMO);
00464         mech_toggle_mode_sub(player, mech, buffer, 1, RFAC, AC_AP_MODE, 0,
00465                                                  "Weapon %d has been set to fire AP rounds",
00466                                                  "Weapon %d has been set to fire normal rounds",
00467                                                  "That weapon cannot fire AP rounds!");
00468 }

void mech_artemis ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 654 of file mech.advanced.c.

References ARTEMIS_MODE, cch, mech_toggle_mode_sub(), MECH_USUALMO, and TMISSILE.

00655 {
00656         MECH *mech = (MECH *) data;
00657 
00658         cch(MECH_USUALMO);
00659         mech_toggle_mode_sub(player, mech, buffer, -1, TMISSILE, ARTEMIS_MODE,
00660                                                  0,
00661                                                  "Weapon %d has been set to fire Artemis IV compatible missiles.",
00662                                                  "Weapon %d has been set to fire normal missiles",
00663                                                  "That weapon cannot be set ARTEMIS!");
00664 }

void mech_auto_turret ( dbref  player,
MECH mech,
char *  buffer 
)

Definition at line 1661 of file mech.advanced.c.

References AUTOTURN_TURRET, cch, DOCHECK, GetSectInt, mech_printf(), MECH_USUALSO, MECHALL, MechStatus2, and TURRET.

01662 {
01663         cch(MECH_USUALSO);
01664 
01665         DOCHECK(!GetSectInt(mech, TURRET), "You have no turret to autoturn!");
01666 
01667         mech_printf(mech, MECHALL,
01668                                 "Automatic turret turning is now %s",
01669                                 (MechStatus2(mech) & AUTOTURN_TURRET) ? "OFF" : "ON");
01670 
01671         if(MechStatus2(mech) & AUTOTURN_TURRET)
01672                 MechStatus2(mech) &= ~AUTOTURN_TURRET;
01673         else
01674                 MechStatus2(mech) |= AUTOTURN_TURRET;
01675 }

void mech_caseless ( dbref  plyaer,
void *  data,
char *  buffer 
)

Definition at line 470 of file mech.advanced.c.

References AC_CASELESS_MODE, cch, mech_toggle_mode_sub(), MECH_USUALMO, and RFAC.

00471 {
00472         MECH *mech = (MECH *) data;
00473         cch(MECH_USUALMO);
00474         mech_toggle_mode_sub(player, mech, buffer, 1, RFAC, AC_CASELESS_MODE, 0,
00475                         "Weapon %d has been set to fire CASELESS rounds",
00476                         "Weapon %d has been set to fire normal rounds",
00477                         "That weapon cannot fire CASELESS rounds!");
00478 }

void mech_cluster ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 731 of file mech.advanced.c.

References cch, CLUSTER_MODE, mech_toggle_mode_sub(), MECH_USUALMO, and TARTILLERY.

00732 {
00733         MECH *mech = (MECH *) data;
00734 
00735         cch(MECH_USUALMO);
00736         mech_toggle_mode_sub(player, mech, buffer, 0, TARTILLERY, CLUSTER_MODE,
00737                                                  0, "Weapon %d has been set to fire cluster rounds.",
00738                                                  "Weapon %d has been set to fire normal rounds",
00739                                                  "Invalid weapon type!");
00740 }

void mech_dig ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 1119 of file mech.advanced.c.

References BRIDGE, BUILDING, cch, Digging, DIGGING_IN, DOCHECK, EVENT_DIG, mech_dig_event(), mech_notify(), MECH_USUALO, MECHALL, MechDesiredFacing, MechDugIn, MECHEVENT, MechFacing, MechMove, MechRTerrain, MechSpeed, MechTankCritStatus, MOVE_NONE, OODing, ROAD, WALL, and WATER.

01120 {
01121         MECH *mech = (MECH *) data;
01122 
01123         cch(MECH_USUALO);
01124         DOCHECK(fabs(MechSpeed(mech)) > 0.0, "You are moving!");
01125         DOCHECK(MechFacing(mech) != MechDesiredFacing(mech), "You are turning!");
01126         DOCHECK(MechMove(mech) == MOVE_NONE, "You are stationary!");
01127         DOCHECK(MechDugIn(mech), "You are already dug in!");
01128         DOCHECK(Digging(mech), "You are already digging in!");
01129         DOCHECK(OODing(mech), "While dropping? I think not.");
01130         DOCHECK(MechRTerrain(mech) == ROAD ||
01131                         MechRTerrain(mech) == BRIDGE ||
01132                         MechRTerrain(mech) == BUILDING ||
01133                         MechRTerrain(mech) == WALL,
01134                         "The surface is slightly too hard for you to dig in.");
01135         DOCHECK(MechRTerrain(mech) == WATER, "In water? Who are you kidding?");
01136 
01137         MechTankCritStatus(mech) |= DIGGING_IN;
01138         MECHEVENT(mech, EVENT_DIG, mech_dig_event, 20, 0);
01139         mech_notify(mech, MECHALL, "You start digging yourself in a nice hole..");
01140 }

void mech_disableweap ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 1202 of file mech.advanced.c.

References args, cch, DOCHECK, mech_disableweap_func(), mech_parseattributes(), MECH_USUALO, and multi_weap_sel().

01203 {
01204         MECH *mech = (MECH *) data;
01205         char *args[1];
01206 
01207         cch(MECH_USUALO);
01208         DOCHECK(mech_parseattributes(buffer, args, 1) != 1,
01209                         "Please specify a weapon number.");
01210 
01211         multi_weap_sel(mech, player, args[0], 1, mech_disableweap_func);
01212 }

void mech_eccm ( dbref  player,
MECH mech,
char *  buffer 
)

Definition at line 76 of file mech.advanced.c.

References cch, DOCHECK, ECCM_ENABLED, ECM_DESTROYED, ECM_ENABLED, ECM_TECH, MarkForLOSUpdate(), MECH_USUALO, MechCritStatus, and TOGGLE_SPECIALS_MACRO_CHECK.

00077 {
00078         cch(MECH_USUALO);
00079         DOCHECK(MechCritStatus(mech) & ECM_DESTROYED,
00080                         "Your Guardian ECM has been destroyed already!");
00081         TOGGLE_SPECIALS_MACRO_CHECK(ECM_TECH, ECCM_ENABLED, ECM_ENABLED,
00082                                                                 "You turn your ECM suite online (ECCM mode).",
00083                                                                 "You turn your ECM suite offline.",
00084                                                                 "This unit isn't equipped with an ECM suite!");
00085         MarkForLOSUpdate(mech);
00086 }

void mech_ecm ( dbref  player,
MECH mech,
char *  buffer 
)

Definition at line 64 of file mech.advanced.c.

References cch, DOCHECK, ECCM_ENABLED, ECM_DESTROYED, ECM_ENABLED, ECM_TECH, MarkForLOSUpdate(), MECH_USUALO, MechCritStatus, and TOGGLE_SPECIALS_MACRO_CHECK.

00065 {
00066         cch(MECH_USUALO);
00067         DOCHECK(MechCritStatus(mech) & ECM_DESTROYED,
00068                         "Your Guardian ECM has been destroyed already!");
00069         TOGGLE_SPECIALS_MACRO_CHECK(ECM_TECH, ECM_ENABLED, ECCM_ENABLED,
00070                                                                 "You turn your ECM suite online (ECM mode).",
00071                                                                 "You turn your ECM suite offline.",
00072                                                                 "This unit isn't equipped with an ECM suite!");
00073         MarkForLOSUpdate(mech);
00074 }

void mech_explode ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 1019 of file mech.advanced.c.

References args, confdata::btech_explode_ammo, confdata::btech_explode_reactor, confdata::btech_explode_stop, confdata::btech_explode_time, cch, CLASS_MECH, DOCHECK, EVENT_EXPLODE, EXPLODE_SAFE, Exploding, FindDestructiveAmmo(), ICE_TECH, mech_explode_event(), mech_notify(), mech_parseattributes(), mech_printf(), MECH_USUALO, MECHALL, MECHEVENT, MechLOSBroadcast(), MechPilot, MechSections, MechSpecials, MechStatus, MechType, mudconf, MECH::mynum, NUM_SECTIONS, SectHasBusyWeap(), SectIsDestroyed, SendDebug, StopExploding, time(), tprintf(), and Wizard.

01020 {
01021         MECH *mech = (MECH *) data;
01022         char *args[3];
01023         int i;
01024         int ammoloc, ammocritnum;
01025         int time = mudconf.btech_explode_time;
01026         int ammo = 1;
01027         int argc;
01028         int override = 0;
01029 
01030         cch(MECH_USUALO);
01031         override = (strstr(buffer, "override") != NULL) && Wizard(player);
01032         argc = mech_parseattributes(buffer, args, 2);
01033         DOCHECK(argc < 1, "Invalid number of arguments!");
01034 
01035         /* Can't do any of the explosion routine if we're recycling! */
01036         if(!override) {
01037                 for(i = 0; i < NUM_SECTIONS; i++) {
01038                         if(!SectIsDestroyed(mech, i))
01039                                 DOCHECK(SectHasBusyWeap(mech, i), "You have weapons recycling!");
01040                         DOCHECK(MechSections(mech)[i].recycle,
01041                                         "You are still recovering from your last attack.");
01042                 }
01043         }
01044 
01045         if(!strcasecmp(buffer, "stop")) {
01046                 if(!override) {
01047                         DOCHECK(!mudconf.btech_explode_stop,
01048                                         "It's too late to turn back now!");
01049                 }
01050                 DOCHECK(!Exploding(mech),
01051                                 "Your mech isn't undergoing a self-destruct sequence!");
01052 
01053                 StopExploding(mech);
01054                 mech_notify(mech, MECHALL, "Self-destruction sequence aborted.");
01055                 SendDebug(tprintf
01056                                   ("#%d in #%d stopped the self-destruction sequence.",
01057                                    player, mech->mynum));
01058                 MechLOSBroadcast(mech, "regains control over itself.");
01059                 return;
01060         }
01061         DOCHECK(Exploding(mech),
01062                         "Your mech is already undergoing a self-destruct sequence!");
01063         if(!strcasecmp(buffer, "ammo")) {
01064                 /*
01065                    Find SOME ammo to explode ; if possible, we engage the 'boom' process
01066                  */
01067                 if(!override) {
01068                         DOCHECK(!mudconf.btech_explode_ammo,
01069                                         "You can't bring yourself to do it!");
01070                         DOCHECK(MechStatus(mech) & EXPLODE_SAFE,
01071                                         "That's not a possibility here.");
01072                 }
01073                 i = FindDestructiveAmmo(mech, &ammoloc, &ammocritnum);
01074                 DOCHECK(!i, "There is no 'damaging' ammo on your 'mech!");
01075                 /* Engage the boom-event */
01076                 SendDebug(tprintf
01077                                   ("#%d in #%d initiates the ammo explosion sequence.",
01078                                    player, mech->mynum));
01079                 MechLOSBroadcast(mech, "starts billowing smoke!");
01080                 time = time / 2;
01081         } else {
01082                 if(!override) {
01083                         DOCHECK(!mudconf.btech_explode_reactor,
01084                                         "You can't bring yourself to do it!");
01085                         DOCHECK(MechType(mech) != CLASS_MECH,
01086                                         "Only mechs can do the 'big boom' effect.");
01087                         DOCHECK(MechSpecials(mech) & ICE_TECH, "You need a fusion reactor.");
01088                 }
01089                 SendDebug(tprintf
01090                                   ("#%d in #%d initiates the reactor explosion sequence.",
01091                                    player, mech->mynum));
01092                 MechLOSBroadcast(mech, "loses reactions containment!");
01093                 ammo = 0;
01094         }
01095         if(override) time = 3;
01096         MECHEVENT(mech, EVENT_EXPLODE, mech_explode_event, 1, time);
01097         mech_notify(mech, MECHALL, "Self-destruction sequence engaged ; please stand by.");
01098         mech_printf(mech, MECHALL, "%s in %d seconds.", ammo ? "The ammunition will explode" :
01099                                 "The reactor will blow up", time);
01100         MechPilot(mech) = -1; /* Pilot gives up control */
01101 }

void mech_explosive ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 436 of file mech.advanced.c.

References cch, mech_toggle_mode_sub(), MECH_USUALMO, NARC, and NARC_MODE.

00437 {
00438         MECH *mech = (MECH *) data;
00439 
00440         cch(MECH_USUALMO);
00441 
00442         mech_toggle_mode_sub(player, mech, buffer, 1, NARC, NARC_MODE, 0,
00443                                                  "Weapon %d has been set to fire explosive rounds",
00444                                                  "Weapon %d has been set to fire NARC beacons",
00445                                                  "That weapon cannot be set to fire explosive rounds!");
00446 }

void mech_fixturret ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 1167 of file mech.advanced.c.

References cch, DOCHECK, EVENT_UNJAM_TURRET, mech_notify(), mech_unjam_turret_event(), MECH_USUALO, MECHALL, MECHEVENT, MechTankCritStatus, TURRET_JAMMED, and TURRET_LOCKED.

01168 {
01169         MECH *mech = (MECH *) data;
01170 
01171         cch(MECH_USUALO);
01172         DOCHECK(MechTankCritStatus(mech) & TURRET_LOCKED,
01173                         "Your turret is locked! You need a repairbay to fix it!");
01174         DOCHECK(!(MechTankCritStatus(mech) & TURRET_JAMMED),
01175                         "Your turret is not jammed!");
01176         MECHEVENT(mech, EVENT_UNJAM_TURRET, mech_unjam_turret_event, 60, 0);
01177         mech_notify(mech, MECHALL, "You start to repair your jammed turret.");
01178 }

void mech_flamerheat ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 348 of file mech.advanced.c.

References cch, CHEAT, HEAT_MODE, mech_toggle_mode_sub(), and MECH_USUALMO.

00349 {
00350         MECH *mech = (MECH *) data;
00351 
00352         cch(MECH_USUALMO);
00353         mech_toggle_mode_sub(player, mech, buffer, 1, CHEAT, HEAT_MODE, 1,
00354                                                  "Weapon %d has been set to HEAT mode",
00355                                                  "Weapon %d has been set to normal mode",
00356                                                  "That weapon cannot be set HEAT!");
00357 }

void mech_flechette ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 480 of file mech.advanced.c.

References AC_FLECHETTE_MODE, cch, mech_toggle_mode_sub(), MECH_USUALMO, and RFAC.

00481 {
00482         MECH *mech = (MECH *) data;
00483 
00484         cch(MECH_USUALMO);
00485         mech_toggle_mode_sub(player, mech, buffer, 1, RFAC, AC_FLECHETTE_MODE,
00486                                                  0, "Weapon %d has been set to fire Flechette rounds",
00487                                                  "Weapon %d has been set to fire normal rounds",
00488                                                  "That weapon cannot fire Flechette rounds!");
00489 }

void mech_fliparms ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 216 of file mech.advanced.c.

References cch, DOCHECK, Fallen, FLIPABLE_ARMS, FLIPPED_ARMS, MECH_USUALMO, and SILLY_TOGGLE_MACRO.

00217 {
00218         MECH *mech = (MECH *) data;
00219 
00220         cch(MECH_USUALMO);
00221         DOCHECK(Fallen(mech),
00222                         "You're using your arms to support yourself. Try flipping something else.");
00223         SILLY_TOGGLE_MACRO(FLIPABLE_ARMS, FLIPPED_ARMS,
00224                                            "Arms have been flipped to BACKWARD position",
00225                                            "Arms have been flipped to FORWARD position",
00226                                            "You cannot flip the arms in this mech");
00227 }

void mech_gattling ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 643 of file mech.advanced.c.

References cch, GATTLING_MODE, GMG, mech_toggle_mode_sub(), and MECH_USUALMO.

00644 {
00645         MECH *mech = (MECH *) data;
00646 
00647         cch(MECH_USUALMO);
00648         mech_toggle_mode_sub(player, mech, buffer, 1, GMG, GATTLING_MODE, 1,
00649                                                  "Weapon %d has been set to Gattling mode",
00650                                                  "Weapon %d has been set to normal fire mode",
00651                                                  "That weapon cannot be set to do gattling fire!");
00652 }

void mech_hotload ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 721 of file mech.advanced.c.

References cch, HOTLOAD_MODE, IDF, mech_toggle_mode_sub(), and MECH_USUALMO.

00722 {
00723         MECH *mech = (MECH *) data;
00724         cch(MECH_USUALMO);
00725         mech_toggle_mode_sub(player, mech, buffer, 1, IDF, HOTLOAD_MODE, 1,
00726                                                  "Hotloading for weapon %d has been toggled on.",
00727                                                  "Hotloading for weapon %d has been toggled off.",
00728                                                  "That weapon can not be hotloaded!");
00729 }

void mech_inarc_ammo_toggle ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 370 of file mech.advanced.c.

References AMMO_MODES, args, cch, DOCHECK, FindWeaponNumberOnMech(), GetPartAmmoMode, INARC, INARC_ECM_MODE, INARC_EXPLO_MODE, INARC_HAYWIRE_MODE, INARC_NEMESIS_MODE, isWeapAmmoFeedLocked(), mech_parseattributes(), mech_printf(), MECH_USUALO, MECHALL, MechWeapons, Readnum, and tprintf().

00371 {
00372         MECH *mech = (MECH *) data;
00373         int wSection, wCritSlot, wWeapType;
00374         int wWeapNum = 0;
00375         int wcArgs = 0;
00376         char *args[2];
00377         char strMode[30];
00378 
00379         cch(MECH_USUALO);
00380 
00381         wcArgs = mech_parseattributes(buffer, args, 2);
00382 
00383         DOCHECK(wcArgs < 1, "Please specify a weapon number.");
00384         DOCHECK(Readnum(wWeapNum, args[0]), tprintf("Invalid value: %s",
00385                                                                                                 args[0]));
00386 
00387         wWeapType = FindWeaponNumberOnMech(mech, wWeapNum, &wSection, &wCritSlot);
00388 
00389         DOCHECK(wWeapType == -1,
00390                         "The weapons system chirps: 'Illegal Weapon Number!'");
00391         DOCHECK(wWeapType == -2,
00392                         "The weapons system chirps: 'That Weapon has been destroyed!'");
00393         DOCHECK(wWeapType == -3,
00394                         "The weapon system chirps: 'That weapon is still reloading!'");
00395         DOCHECK(wWeapType == -4,
00396                         "The weapon system chirps: 'That weapon is still recharging!'");
00397         DOCHECK(!(MechWeapons[wWeapType].special & INARC),
00398                         "The weapon system chirps: 'That weapon is not an iNARC launcher!'");
00399         DOCHECK(isWeapAmmoFeedLocked(mech, wSection, wCritSlot),
00400                         "That weapon's ammo feed mechanism is damaged!");
00401 
00402         /* Change our modes... */
00403 
00404         GetPartAmmoMode(mech, wSection, wCritSlot) &= ~AMMO_MODES;
00405 
00406         if(wcArgs < 2)
00407                 strcpy(strMode, "Homing");
00408         else {
00409                 switch (toupper(args[1][0])) {
00410                 case 'X':
00411                         strcpy(strMode, "Explosive");
00412                         GetPartAmmoMode(mech, wSection, wCritSlot) |= INARC_EXPLO_MODE;
00413                         break;
00414                 case 'Y':
00415                         strcpy(strMode, "Haywire");
00416                         GetPartAmmoMode(mech, wSection, wCritSlot) |= INARC_HAYWIRE_MODE;
00417                         break;
00418                 case 'E':
00419                         strcpy(strMode, "ECM");
00420                         GetPartAmmoMode(mech, wSection, wCritSlot) |= INARC_ECM_MODE;
00421                         break;
00422                 case 'Z':
00423                         strcpy(strMode, "Nemesis");
00424                         GetPartAmmoMode(mech, wSection, wCritSlot) |= INARC_NEMESIS_MODE;
00425                         break;
00426                 default:
00427                         strcpy(strMode, "Homing");
00428                         break;
00429                 }
00430         }
00431 
00432         mech_printf(mech, MECHALL,
00433                                 "Weapon %d set to fire iNARC %s pods.", wWeapNum, strMode);
00434 }

void mech_incendiary ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 491 of file mech.advanced.c.

References AC_INCENDIARY_MODE, cch, mech_toggle_mode_sub(), MECH_USUALMO, and RFAC.

00492 {
00493         MECH *mech = (MECH *) data;
00494 
00495         cch(MECH_USUALMO);
00496         mech_toggle_mode_sub(player, mech, buffer, 1, RFAC, AC_INCENDIARY_MODE,
00497                                                  0,
00498                                                  "Weapon %d has been set to fire Incendiary rounds",
00499                                                  "Weapon %d has been set to fire normal rounds",
00500                                                  "That weapon cannot fire Incendiary rounds!");
00501 }

void mech_inferno ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 710 of file mech.advanced.c.

References cch, INFERNO_MODE, mech_toggle_mode_sub(), and MECH_USUALMO.

00711 {
00712         MECH *mech = (MECH *) data;
00713 
00714         cch(MECH_USUALMO);
00715         mech_toggle_mode_sub(player, mech, buffer, 4, 0, INFERNO_MODE, 0,
00716                                                  "Weapon %d has been set to fire Inferno missiles.",
00717                                                  "Weapon %d has been set to fire normal missiles",
00718                                                  "That weapon cannot be set to fire Inferno missiles!");
00719 }

void mech_lbx ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 448 of file mech.advanced.c.

References cch, LBX, LBX_MODE, mech_toggle_mode_sub(), and MECH_USUALMO.

00449 {
00450         MECH *mech = (MECH *) data;
00451 
00452         cch(MECH_USUALMO);
00453         mech_toggle_mode_sub(player, mech, buffer, 1, LBX, LBX_MODE, 0,
00454                                                  "Weapon %d has been set to LBX fire mode",
00455                                                  "Weapon %d has been set to normal fire mode",
00456                                                  "That weapon cannot be set LBX!");
00457 }

void mech_masc ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 830 of file mech.advanced.c.

References cch, DOCHECK, EVENT_MASC_FAIL, EVENT_MASC_REGEN, MASC_ENABLED, MASC_TECH, MASC_TICK, mech_masc_event(), mech_mascr_event(), mech_notify(), MECH_USUALMO, MECHALL, MechDesiredSpeed, MECHEVENT, MechSpecials, MechStatus, MMaxSpeed, MP1, StopMasc, and StopMascR.

00831 {
00832         MECH *mech = (MECH *) data;
00833 
00834         cch(MECH_USUALMO);
00835         DOCHECK(!(MechSpecials(mech) & MASC_TECH),
00836                         "Your toy ain't prepared for what you're askin' it!");
00837         DOCHECK(MMaxSpeed(mech) < MP1, "Uh huh.");
00838         if(MechStatus(mech) & MASC_ENABLED) {
00839                 mech_notify(mech, MECHALL, "MASC has been turned off.");
00840                 MechStatus(mech) &= ~MASC_ENABLED;
00841                 MechDesiredSpeed(mech) = MechDesiredSpeed(mech) * 3. / 4.;
00842                 StopMasc(mech);
00843                 MECHEVENT(mech, EVENT_MASC_REGEN, mech_mascr_event, MASC_TICK, 0);
00844                 return;
00845         }
00846         mech_notify(mech, MECHALL, "MASC has been turned on.");
00847         MechStatus(mech) |= MASC_ENABLED;
00848         StopMascR(mech);
00849         MechDesiredSpeed(mech) = MechDesiredSpeed(mech) * 4. / 3.;
00850         MECHEVENT(mech, EVENT_MASC_FAIL, mech_masc_event, 1, 0);
00851 }

void mech_mechprefs ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 1808 of file mech.advanced.c.

References args, mechpref_info::bit, c, cch, display_mechpref(), mechpref_info::flags, KillCoolMenu(), LBUF_SIZE, mech_parseattributes(), mech_preferences, MECH_USUALSMO, MECHPREF_FLAG_INVERTED, MECHPREF_FLAG_NEGATIVE, MechPrefs, mechpref_info::msg, name, notify, NUM_MECHPREFERENCES, SelCol_FunStringMenuK(), ShowCoolMenu(), and target_mech.

01809 {
01810         MECH *mech = (MECH *) data;
01811         int nargs;
01812         char *args[3];
01813         char buf[LBUF_SIZE];
01814         coolmenu *c;
01815 
01816         cch(MECH_USUALSMO);
01817         nargs = mech_parseattributes(buffer, args, 2);
01818 
01819         /* Default, no arguments passed */
01820         if(!nargs) {
01821 
01822                 /* Show mechprefs */
01823                 target_mech = mech;
01824                 c = SelCol_FunStringMenuK(1, "Mech Preferences", display_mechpref,
01825                                                                   NUM_MECHPREFERENCES);
01826                 ShowCoolMenu(player, c);
01827                 KillCoolMenu(c);
01828                 target_mech = NULL;
01829 
01830         } else {
01831 
01832                 int i;
01833                 struct mechpref_info info;
01834                 char *newstate;
01835 
01836                 /* Looking through the different mech preferences to find the
01837                  * one the user wants to change */
01838                 for(i = 0; i < NUM_MECHPREFERENCES; i++) {
01839                         if(strcasecmp(args[0], mech_preferences[i].name) == 0)
01840                                 break;
01841                 }
01842                 if(i == NUM_MECHPREFERENCES) {
01843                         snprintf(buf, LBUF_SIZE, "Unknown MechPreference: %s", args[0]);
01844                         notify(player, buf);
01845                         return;
01846                 }
01847 
01848                 /* Get the current setting */
01849                 info = mech_preferences[i];
01850 
01851                 /* Did they provide a ON or OFF flag */
01852                 if(nargs == 2) {
01853 
01854                         /* Check to make sure its either ON or OFF */
01855                         if((strcasecmp(args[1], "ON") != 0) &&
01856                            (strcasecmp(args[1], "OFF") != 0)) {
01857 
01858                                 /* Insert notify here */
01859                                 notify(player, "Only accept ON or OFF as valid extra "
01860                                            "parameter for mechprefs pref");
01861                                 return;
01862                         }
01863 
01864                         /* Set the value to what they want */
01865                         if(strcasecmp(args[1], "ON") == 0) {
01866 
01867                                 /* Set the bit */
01868                                 if(info.flags & MECHPREF_FLAG_INVERTED) {
01869                                         MechPrefs(mech) &= ~(info.bit);
01870                                 } else {
01871                                         MechPrefs(mech) |= (info.bit);
01872                                 }
01873 
01874                         } else {
01875 
01876                                 /* Unset the bit */
01877                                 if(info.flags & MECHPREF_FLAG_INVERTED) {
01878                                         MechPrefs(mech) |= (info.bit);
01879                                 } else {
01880                                         MechPrefs(mech) &= ~(info.bit);
01881                                 }
01882 
01883                         }
01884 
01885                 } else {
01886 
01887                         /* If set, unset it, otherwise set the preference */
01888                         if(MechPrefs(mech) & info.bit)
01889                                 MechPrefs(mech) &= ~(info.bit);
01890                         else
01891                                 MechPrefs(mech) |= (info.bit);
01892 
01893                 }
01894 
01895                 /* Which way did the preference get changed and
01896                  * is it the default or non-standard mode of
01897                  * the preference */
01898                 if(((MechPrefs(mech) & info.bit) &&
01899                         (info.flags & MECHPREF_FLAG_INVERTED)) ||
01900                    (!(MechPrefs(mech) & info.bit) &&
01901                         !(info.flags & MECHPREF_FLAG_INVERTED))) {
01902 
01903                         if(info.flags & MECHPREF_FLAG_NEGATIVE)
01904                                 newstate = "%ch%cgOFF%cn";
01905                         else
01906                                 newstate = "%ch%crOFF%cn";
01907 
01908                 } else {
01909 
01910                         if(info.flags & MECHPREF_FLAG_NEGATIVE)
01911                                 newstate = "%ch%crON%cn";
01912                         else
01913                                 newstate = "%ch%cgON%cn";
01914 
01915                 }
01916 
01917                 /* Tell them the preference has been changed */
01918                 snprintf(buf, LBUF_SIZE, "%s %s", info.msg, newstate);
01919                 notify(player, buf);
01920         }
01921 }

void mech_mine ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 753 of file mech.advanced.c.

References cch, mech_toggle_mode_sub(), MECH_USUALMO, MINE_MODE, and TARTILLERY.

00754 {
00755         MECH *mech = (MECH *) data;
00756 
00757         cch(MECH_USUALMO);
00758         mech_toggle_mode_sub(player, mech, buffer, 0, TARTILLERY, MINE_MODE, 0,
00759                                                  "Weapon %d has been set to fire mine rounds.",
00760                                                  "Weapon %d has been set to fire normal rounds",
00761                                                  "Invalid weapon type!");
00762 }

void mech_narc ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 666 of file mech.advanced.c.

References cch, mech_toggle_mode_sub(), MECH_USUALMO, NARC_MODE, and TMISSILE.

00667 {
00668         MECH *mech = (MECH *) data;
00669 
00670         cch(MECH_USUALMO);
00671         mech_toggle_mode_sub(player, mech, buffer, 0, TMISSILE, NARC_MODE, 0,
00672                                                  "Weapon %d has been set to fire Narc Beacon compatible missiles.",
00673                                                  "Weapon %d has been set to fire normal missiles",
00674                                                  "That weapon cannot be set NARC!");
00675 }

void mech_nullsig ( dbref  player,
MECH mech,
char *  buffer 
)

Definition at line 1341 of file mech.advanced.c.

References cch, changeNullSigSysEvent(), EVENT_NSS, mech_notify(), MECH_USUALO, MECHALL, MECHEVENT, MechSpecials2, NULLSIGSYS_TECH, NullSigSysActive, NullSigSysChanging, and NullSigSysDest.

01342 {
01343         cch(MECH_USUALO);
01344 
01345         if(!(MechSpecials2(mech) & NULLSIGSYS_TECH)) {
01346                 mech_notify(mech, MECHALL,
01347                                         "Your 'mech isn't equipped with a Null Signature System!");
01348 
01349                 return;
01350         }
01351 
01352         if(NullSigSysDest(mech)) {
01353                 mech_notify(mech, MECHALL,
01354                                         "Your Null Signature System is destroyed!");
01355 
01356                 return;
01357         }
01358 
01359         if(NullSigSysChanging(mech)) {
01360                 mech_notify(mech, MECHALL,
01361                                         "You are already changing the status of your Null Signature System!");
01362 
01363                 return;
01364         }
01365 
01366         if(!NullSigSysActive(mech)) {
01367                 mech_notify(mech, MECHALL,
01368                                         "Your Null Signature System begins to come online.");
01369 
01370                 MECHEVENT(mech, EVENT_NSS, changeNullSigSysEvent, 30, 1);
01371         } else {
01372                 mech_notify(mech, MECHALL,
01373                                         "Your Null Signature System begins to shutdown.");
01374 
01375                 MECHEVENT(mech, EVENT_NSS, changeNullSigSysEvent, 30, 0);
01376         }
01377 }

void mech_pereccm ( dbref  player,
MECH mech,
char *  buffer 
)

Definition at line 99 of file mech.advanced.c.

References cch, FC_INFILTRATORII_STEALTH_TECH, MarkForLOSUpdate(), MECH_USUALO, PER_ECCM_ENABLED, PER_ECM_ENABLED, and TOGGLE_INFANTRY_MACRO_CHECK.

00100 {
00101         cch(MECH_USUALO);
00102         TOGGLE_INFANTRY_MACRO_CHECK(FC_INFILTRATORII_STEALTH_TECH,
00103                                                                 PER_ECCM_ENABLED, PER_ECM_ENABLED,
00104                                                                 "You turn your Personal ECM suite online (ECCM mode).",
00105                                                                 "You turn your Personal ECM suite offline.",
00106                                                                 "This unit isn't equipped with a Personal ECM suite!");
00107         MarkForLOSUpdate(mech);
00108 }

void mech_perecm ( dbref  player,
MECH mech,
char *  buffer 
)

Definition at line 88 of file mech.advanced.c.

References cch, FC_INFILTRATORII_STEALTH_TECH, MarkForLOSUpdate(), MECH_USUALO, PER_ECCM_ENABLED, PER_ECM_ENABLED, and TOGGLE_INFANTRY_MACRO_CHECK.

00089 {
00090         cch(MECH_USUALO);
00091         TOGGLE_INFANTRY_MACRO_CHECK(FC_INFILTRATORII_STEALTH_TECH,
00092                                                                 PER_ECM_ENABLED, PER_ECCM_ENABLED,
00093                                                                 "You turn your Personal ECM suite online (ECM mode).",
00094                                                                 "You turn your Personal ECM suite offline.",
00095                                                                 "This unit isn't equipped with a Personal ECM suite!");
00096         MarkForLOSUpdate(mech);
00097 }

void mech_precision ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 503 of file mech.advanced.c.

References AC_PRECISION_MODE, cch, mech_toggle_mode_sub(), MECH_USUALMO, and RFAC.

00504 {
00505         MECH *mech = (MECH *) data;
00506 
00507         cch(MECH_USUALMO);
00508         mech_toggle_mode_sub(player, mech, buffer, 1, RFAC, AC_PRECISION_MODE,
00509                                                  0, "Weapon %d has been set to fire Precision rounds",
00510                                                  "Weapon %d has been set to fire normal rounds",
00511                                                  "That weapon cannot fire Precision rounds!");
00512 }

void mech_rac ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 536 of file mech.advanced.c.

References args, cch, DOCHECK, FindWeaponNumberOnMech(), FIRE_MODES, GetPartFireMode, mech_parseattributes(), mech_printf(), MECH_USUALO, MECHALL, MechWeapons, RAC, RAC_FOURSHOT_MODE, RAC_SIXSHOT_MODE, RAC_TWOSHOT_MODE, Readnum, and tprintf().

00537 {
00538         MECH *mech = (MECH *) data;
00539         int wSection, wCritSlot, wWeapType;
00540         int wWeapNum = 0;
00541         int wcArgs = 0;
00542         char *args[2];
00543         char strMode[30];
00544 
00545         cch(MECH_USUALO);
00546 
00547         wcArgs = mech_parseattributes(buffer, args, 2);
00548 
00549         DOCHECK(wcArgs < 1, "Please specify a weapon number.");
00550         DOCHECK(Readnum(wWeapNum, args[0]), tprintf("Invalid value: %s",
00551                                                                                                 args[0]));
00552 
00553         wWeapType = FindWeaponNumberOnMech(mech, wWeapNum, &wSection, &wCritSlot);
00554 
00555         DOCHECK(wWeapType == -1,
00556                         "The weapons system chirps: 'Illegal Weapon Number!'");
00557         DOCHECK(wWeapType == -2,
00558                         "The weapons system chirps: 'That Weapon has been destroyed!'");
00559         DOCHECK(wWeapType == -3,
00560                         "The weapon system chirps: 'That weapon is still reloading!'");
00561         DOCHECK(wWeapType == -4,
00562                         "The weapon system chirps: 'That weapon is still recharging!'");
00563         DOCHECK(!(MechWeapons[wWeapType].special & RAC),
00564                         "The weapon system chirps: 'That weapon is not an Rotary AC!'");
00565 
00566         /* Change our modes... */
00567 
00568         GetPartFireMode(mech, wSection, wCritSlot) &= ~FIRE_MODES;
00569         GetPartFireMode(mech, wSection, wCritSlot) &=
00570                 ~(RAC_TWOSHOT_MODE | RAC_FOURSHOT_MODE | RAC_SIXSHOT_MODE);
00571 
00572         if(wcArgs < 2)
00573                 strcpy(strMode, "one shot");
00574         else {
00575                 switch (args[1][0]) {
00576                 case '2':
00577                         strcpy(strMode, "two shots");
00578                         GetPartFireMode(mech, wSection, wCritSlot) |= RAC_TWOSHOT_MODE;
00579                         break;
00580                 case '4':
00581                         strcpy(strMode, "four shots");
00582                         GetPartFireMode(mech, wSection, wCritSlot) |= RAC_FOURSHOT_MODE;
00583                         break;
00584                 case '6':
00585                         strcpy(strMode, "six shots");
00586                         GetPartFireMode(mech, wSection, wCritSlot) |= RAC_SIXSHOT_MODE;
00587                         break;
00588                 default:
00589                         strcpy(strMode, "one shot");
00590                         break;
00591                 }
00592         }
00593 
00594         mech_printf(mech, MECHALL,
00595                                 "Weapon %d set to fire %s at a time.", wWeapNum, strMode);
00596 }

void mech_rapidfire ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 514 of file mech.advanced.c.

References cch, mech_toggle_mode_sub(), MECH_USUALMO, RFAC, and RFAC_MODE.

00515 {
00516         MECH *mech = (MECH *) data;
00517 
00518         cch(MECH_USUALMO);
00519         mech_toggle_mode_sub(player, mech, buffer, 1, RFAC, RFAC_MODE, 1,
00520                                                  "Weapon %d has been set to Rapid Fire mode",
00521                                                  "Weapon %d has been set to normal fire mode",
00522                                                  "That weapon cannot be set to do rapid fire!");
00523 }

void mech_safety ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 1729 of file mech.advanced.c.

References CLASS_MW, DOCHECK, mech_notify(), mech_printf(), MECHALL, MECHPILOT, MechPKiller, MechType, SetMechPKiller, and UnSetMechPKiller.

01730 {
01731         MECH *mech = (MECH *) data;
01732 
01733         DOCHECK(MechType(mech) == CLASS_MW, "Your weapons dont have safeties.");
01734         if(buffer && !strcasecmp(buffer, "on")) {
01735                 UnSetMechPKiller(mech);
01736                 mech_notify(mech, MECHALL, "Safeties flipped %ch%cgON%cn.");
01737                 return;
01738         }
01739         if(buffer && !strcasecmp(buffer, "off")) {
01740                 SetMechPKiller(mech);
01741                 mech_notify(mech, MECHALL, "Safeties flipped %ch%crOFF%cn.");
01742                 return;
01743         }
01744 
01745         mech_printf(mech, MECHPILOT, "Weapon safeties are %%ch%s%%cn",
01746                                 MechPKiller(mech) ? "%crOFF" : "%cgON");
01747         return;
01748 }

void mech_scharge ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 944 of file mech.advanced.c.

References cch, DOCHECK, EVENT_SCHARGE_FAIL, EVENT_SCHARGE_REGEN, mech_notify(), mech_scharge_event(), mech_scharger_event(), MECH_USUALMO, MECHALL, MechDesiredSpeed, MECHEVENT, MechSpecials2, MechStatus, MMaxSpeed, MP1, SCHARGE_ENABLED, SCHARGE_TICK, StopSCharge, StopSChargeR, and SUPERCHARGER_TECH.

00945 {
00946         MECH *mech = (MECH *) data;
00947 
00948         cch(MECH_USUALMO);
00949         DOCHECK(!(MechSpecials2(mech) & SUPERCHARGER_TECH),
00950                         "Your toy ain't prepared for what you're askin' it!");
00951         DOCHECK(MMaxSpeed(mech) < MP1, "Uh huh.");
00952         if(MechStatus(mech) & SCHARGE_ENABLED) {
00953                 mech_notify(mech, MECHALL, "Supercharger has been turned off.");
00954                 MechStatus(mech) &= ~SCHARGE_ENABLED;
00955                 MechDesiredSpeed(mech) = MechDesiredSpeed(mech) * 3. / 4.;
00956                 StopSCharge(mech);
00957                 MECHEVENT(mech, EVENT_SCHARGE_REGEN, mech_scharger_event,
00958                                   SCHARGE_TICK, 0);
00959                 return;
00960         }
00961         mech_notify(mech, MECHALL, "Supercharger has been turned on.");
00962         MechStatus(mech) |= SCHARGE_ENABLED;
00963         StopSChargeR(mech);
00964         MechDesiredSpeed(mech) = MechDesiredSpeed(mech) * 4. / 3.;
00965         MECHEVENT(mech, EVENT_SCHARGE_FAIL, mech_scharge_event, 1, 0);
00966 }

void mech_slite ( dbref  player,
MECH mech,
char *  buffer 
)

Definition at line 171 of file mech.advanced.c.

References cch, DOCHECK, EVENT_SLITECHANGING, mech_notify(), MECH_USUALO, MECHALL, MechCritStatus, MECHEVENT, MechSliteChangeEvent(), MechSpecials, MechStatus2, SearchlightChanging, SLITE_DEST, SLITE_ON, and SLITE_TECH.

00172 {
00173         cch(MECH_USUALO);
00174 
00175         if(!(MechSpecials(mech) & SLITE_TECH)) {
00176                 mech_notify(mech, MECHALL,
00177                                         "Your 'mech isn't equipped with searchlight!");
00178                 return;
00179         }
00180 
00181         DOCHECK(MechCritStatus(mech) & SLITE_DEST,
00182                         "Your searchlight has been destroyed already!");
00183 
00184         if(SearchlightChanging(mech)) {
00185                 if(MechStatus2(mech) & SLITE_ON)
00186                         mech_notify(mech, MECHALL,
00187                                                 "Your searchlight is already in the process of turning off.");
00188                 else
00189                         mech_notify(mech, MECHALL,
00190                                                 "Your searchlight is already in the process of turning on.");
00191 
00192                 return;
00193         }
00194 
00195         if(MechStatus2(mech) & SLITE_ON) {
00196                 mech_notify(mech, MECHALL, "Your searchlight starts to cool down.");
00197                 MECHEVENT(mech, EVENT_SLITECHANGING, MechSliteChangeEvent, 5, 0);
00198         } else {
00199                 mech_notify(mech, MECHALL, "Your searchlight starts to warm up.");
00200                 MECHEVENT(mech, EVENT_SLITECHANGING, MechSliteChangeEvent, 5, 1);
00201         }
00202 }

void mech_smoke ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 742 of file mech.advanced.c.

References cch, mech_toggle_mode_sub(), MECH_USUALMO, SMOKE_MODE, and TARTILLERY.

00743 {
00744         MECH *mech = (MECH *) data;
00745 
00746         cch(MECH_USUALMO);
00747         mech_toggle_mode_sub(player, mech, buffer, 0, TARTILLERY, SMOKE_MODE,
00748                                                  0, "Weapon %d has been set to fire smoke rounds.",
00749                                                  "Weapon %d has been set to fire normal rounds",
00750                                                  "Invalid weapon type!");
00751 }

void mech_stealtharmor ( dbref  player,
MECH mech,
char *  buffer 
)

Definition at line 1279 of file mech.advanced.c.

References cch, changeStealthArmorEvent(), EVENT_STEALTH_ARMOR, HasWorkingECMSuite, mech_notify(), MECH_USUALO, MECHALL, MECHEVENT, MechSpecials2, STEALTH_ARMOR_TECH, StealthArmorActive, and StealthArmorChanging.

01280 {
01281         cch(MECH_USUALO);
01282 
01283         if(!(MechSpecials2(mech) & STEALTH_ARMOR_TECH)) {
01284                 mech_notify(mech, MECHALL,
01285                                         "Your 'mech isn't equipped with a Stealth Armor system!");
01286 
01287                 return;
01288         }
01289 
01290         if(!HasWorkingECMSuite(mech)) {
01291                 mech_notify(mech, MECHALL,
01292                                         "Your 'mech doesn't have a working Guardian ECM suite!");
01293 
01294                 return;
01295         }
01296 
01297         if(StealthArmorChanging(mech)) {
01298                 mech_notify(mech, MECHALL,
01299                                         "You are already changing the status of your Stealth Armor system!");
01300 
01301                 return;
01302         }
01303 
01304         if(!StealthArmorActive(mech)) {
01305                 mech_notify(mech, MECHALL,
01306                                         "Your Stealth Armor system begins to come online.");
01307 
01308                 MECHEVENT(mech, EVENT_STEALTH_ARMOR, changeStealthArmorEvent, 30, 1);
01309         } else {
01310                 mech_notify(mech, MECHALL,
01311                                         "Your Stealth Armor system begins to shutdown.");
01312 
01313                 MECHEVENT(mech, EVENT_STEALTH_ARMOR, changeStealthArmorEvent, 30, 0);
01314         }
01315 }

void mech_stinger ( dbref  player,
MECH mech,
char *  buffer 
)

void mech_swarm ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 677 of file mech.advanced.c.

References cch, mech_toggle_mode_sub(), MECH_USUALMO, and SWARM_MODE.

00678 {
00679         MECH *mech = (MECH *) data;
00680 
00681         cch(MECH_USUALMO);
00682         mech_toggle_mode_sub(player, mech, buffer, 2, 0, SWARM_MODE, 0,
00683                                                  "Weapon %d has been set to fire Swarm missiles.",
00684                                                  "Weapon %d has been set to fire normal missiles",
00685                                                  "That weapon cannot be set to fire Swarm missiles!");
00686 }

void mech_swarm1 ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 699 of file mech.advanced.c.

References cch, mech_toggle_mode_sub(), MECH_USUALMO, and SWARM1_MODE.

00700 {
00701         MECH *mech = (MECH *) data;
00702 
00703         cch(MECH_USUALMO);
00704         mech_toggle_mode_sub(player, mech, buffer, 2, 0, SWARM1_MODE, 0,
00705                                                  "Weapon %d has been set to fire Swarm1 missiles.",
00706                                                  "Weapon %d has been set to fire normal missiles",
00707                                                  "That weapon cannot be set to fire Swarm1 missiles!");
00708 }

void mech_ultra ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 359 of file mech.advanced.c.

References cch, mech_toggle_mode_sub(), MECH_USUALMO, ULTRA, and ULTRA_MODE.

00360 {
00361         MECH *mech = (MECH *) data;
00362 
00363         cch(MECH_USUALMO);
00364         mech_toggle_mode_sub(player, mech, buffer, 1, ULTRA, ULTRA_MODE, 1,
00365                                                  "Weapon %d has been set to ultra fire mode",
00366                                                  "Weapon %d has been set to normal fire mode",
00367                                                  "That weapon cannot be set ULTRA!");
00368 }

void mech_unjamammo ( dbref  player,
void *  data,
char *  buffer 
)

Definition at line 632 of file mech.advanced.c.

References args, cch, DOCHECK, mech_parseattributes(), mech_unjamammo_func(), MECH_USUALMO, and multi_weap_sel().

00633 {
00634         MECH *mech = (MECH *) data;
00635         char *args[1];
00636 
00637         cch(MECH_USUALMO);
00638         DOCHECK(mech_parseattributes(buffer, args, 1) != 1,
00639                         "Please specify a weapon number.");
00640         multi_weap_sel(mech, player, args[0], 1, mech_unjamammo_func);
00641 }

void mech_usebin ( dbref  player,
MECH mech,
char *  buffer 
)

Definition at line 1677 of file mech.advanced.c.

References args, ArmorSectionFromString(), ArmorStringFromIndex(), cch, DOCHECK, FindWeaponNumberOnMech(), GetPartDesiredAmmoLoc, GetSectInt, GetSectOInt, IsEnergy, mech_parseattributes(), mech_printf(), MECH_USUALSO, MECHALL, MechMove, MechType, Readnum, SetPartDesiredAmmoLoc, and tprintf().

01678 {
01679         char strLocation[80];
01680         int wLoc, wCurLoc;
01681         int wSection, wCritSlot, wWeapNum, wWeapType;
01682         char *args[2];
01683 
01684         cch(MECH_USUALSO);
01685 
01686         DOCHECK(mech_parseattributes(buffer, args, 2) != 2,
01687                         "Invalid number of arguments!");
01688 
01689         DOCHECK(Readnum(wWeapNum, args[0]), tprintf("Invalid value: %s",
01690                                                                                                 args[0]));
01691         wWeapType = FindWeaponNumberOnMech(mech, wWeapNum, &wSection, &wCritSlot);
01692 
01693         DOCHECK(wWeapType == -1,
01694                         "The weapons system chirps: 'Illegal Weapon Number!'");
01695         DOCHECK(wWeapType == -2,
01696                         "The weapons system chirps: 'That Weapon has been destroyed!'");
01697         DOCHECK(wWeapType == -3,
01698                         "The weapon system chirps: 'That weapon is still reloading!'");
01699         DOCHECK(wWeapType == -4,
01700                         "The weapon system chirps: 'That weapon is still recharging!'");
01701         DOCHECK(IsEnergy(wWeapType), "Energy weapons do not use ammo!");
01702 
01703         if(args[1][0] == '-') {
01704                 mech_printf(mech, MECHALL,
01705                                         "Prefered ammo source reset for weapon #%d", wWeapNum);
01706                 SetPartDesiredAmmoLoc(mech, wSection, wCritSlot, -1);
01707                 return;
01708         }
01709 
01710         wLoc = ArmorSectionFromString(MechType(mech), MechMove(mech), args[1]);
01711 
01712         DOCHECK(wLoc == -1, "Invalid section!");
01713         DOCHECK(!GetSectOInt(mech, wLoc), "Invalid section!");
01714         DOCHECK(!GetSectInt(mech, wLoc), "That section is destroyed!");
01715 
01716         ArmorStringFromIndex(wLoc, strLocation, MechType(mech), MechMove(mech));
01717         wCurLoc = GetPartDesiredAmmoLoc(mech, wSection, wCritSlot);
01718 
01719         DOCHECK(wCurLoc == wLoc,
01720                         tprintf("Prefered ammo source already set to %s for weapon #%d",
01721                                         strLocation, wWeapNum));
01722 
01723         mech_printf(mech, MECHALL,
01724                                 "Prefered ammo source set to %s for weapon #%d",
01725                                 strLocation, wWeapNum);
01726         SetPartDesiredAmmoLoc(mech, wSection, wCritSlot, wLoc);
01727 }

void remove_inarc_pods_mech ( dbref  player,
MECH mech,
char *  buffer 
)

Definition at line 1450 of file mech.advanced.c.

References args, ArmorSectionFromString(), ArmorStringFromIndex(), cch, checkSectionForSpecial(), DamageMech(), DOCHECK, findArmBTHMod(), FindPilotPiloting(), GetSectInt, GetSectOInt, INARC_ECM_ATTACHED, INARC_HAYWIRE_ATTACHED, INARC_HOMING_ATTACHED, LARM, LOWER_ACTUATOR, mech_notify(), mech_parseattributes(), mech_printf(), MECH_USUALO, MECHALL, MechIsQuad, MechLOSBroadcast(), MechMove, MechPilot, MechSections, MechTons, MechType, OkayCritSectS, PHYSICAL_RECYCLE_TIME, RARM, Roll(), SectHasBusyWeap(), SetRecycleLimb, tprintf(), and UPPER_ACTUATOR.

01451 {
01452         int wLoc;
01453         int wArmToUse = -1;
01454         char *args[2];
01455         char strLocation[50], strPunchWith[50];
01456         int wBTH = 0;
01457         int wBTHModLARM = 0;
01458         int wBTHModRARM = 0;
01459         int wRAAvail = 1;
01460         int wLAAvail = 1;
01461         int wRoll;
01462         int wSelfDamage;
01463         int wPodType = INARC_HOMING_ATTACHED;
01464         char strPodType[30];
01465 
01466         cch(MECH_USUALO);
01467 
01468         DOCHECK(MechIsQuad(mech), "Quads can not knock of iNARC pods!");
01469         DOCHECK(mech_parseattributes(buffer, args, 2) != 2,
01470                         "Invalid number of arguments!");
01471 
01472         wLoc = ArmorSectionFromString(MechType(mech), MechMove(mech), args[0]);
01473 
01474         DOCHECK(wLoc == -1, "Invalid section!");
01475         DOCHECK(!GetSectOInt(mech, wLoc), "Invalid section!");
01476         DOCHECK(!GetSectInt(mech, wLoc), "That section is destroyed!");
01477 
01478         ArmorStringFromIndex(wLoc, strLocation, MechType(mech), MechMove(mech));
01479 
01480         /* Figure out wot type of pods we want to remove */
01481         switch (toupper(args[1][0])) {
01482         case 'Y':
01483                 strcpy(strPodType, "Haywire");
01484                 wPodType = INARC_HAYWIRE_ATTACHED;
01485                 break;
01486 
01487         case 'E':
01488                 strcpy(strPodType, "ECM");
01489                 wPodType = INARC_ECM_ATTACHED;
01490                 break;
01491 
01492         default:
01493                 strcpy(strPodType, "Homing");
01494                 wPodType = INARC_HOMING_ATTACHED;
01495                 break;
01496         }
01497 
01498         DOCHECK(!checkSectionForSpecial(mech, wPodType, wLoc),
01499                         tprintf("There are no iNarc %s pods attached to your %s!",
01500                                         strPodType, strLocation));
01501 
01502         DOCHECK(((!GetSectInt(mech, RARM)) &&
01503                          (!GetSectInt(mech, LARM))),
01504                         "You need atleast one functioning arm to remove iNarc pods!");
01505 
01506         if(wLoc == RARM) {
01507                 DOCHECK(!GetSectInt(mech, LARM),
01508                                 "Your Left Arm needs to be intact to take iNarc pods off your right arm!");
01509                 DOCHECK(SectHasBusyWeap(mech, LARM),
01510                                 "You have weapons recycling on your Left Arm.");
01511                 DOCHECK(MechSections(mech)[LARM].recycle,
01512                                 "Your Left Arm is still recovering from your last attack.");
01513 
01514                 wArmToUse = LARM;
01515         }
01516 
01517         if(wLoc == LARM) {
01518                 DOCHECK(!GetSectInt(mech, RARM),
01519                                 "Your Right Arm needs to be intact to take iNarc pods off your Left Arm!");
01520                 DOCHECK(SectHasBusyWeap(mech, RARM),
01521                                 "You have weapons recycling on your Right Arm.");
01522                 DOCHECK(MechSections(mech)[RARM].recycle,
01523                                 "Your Right Arm is still recovering from your last attack.");
01524 
01525                 wArmToUse = RARM;
01526         }
01527 
01528         if(wArmToUse == -1) {
01529                 if(SectHasBusyWeap(mech, RARM) || MechSections(mech)[RARM].recycle
01530                    || (!GetSectInt(mech, RARM)))
01531                         wRAAvail = 0;
01532 
01533                 if(SectHasBusyWeap(mech, LARM) || MechSections(mech)[LARM].recycle
01534                    || (!GetSectInt(mech, LARM)))
01535                         wLAAvail = 0;
01536 
01537                 DOCHECK(!(wLAAvail ||
01538                                   wRAAvail),
01539                                 "You need atleast one arm that is not recycling and does not have weapons recycling in it!");
01540 
01541                 if(!wLAAvail)
01542                         wBTHModLARM = 1000;
01543                 else
01544                         wBTHModLARM = findArmBTHMod(mech, LARM);
01545 
01546                 if(!wRAAvail)
01547                         wBTHModRARM = 1000;
01548                 else
01549                         wBTHModRARM = findArmBTHMod(mech, RARM);
01550 
01551                 if(wBTHModRARM < wBTHModLARM) {
01552                         wBTH = wBTHModRARM;
01553                         wArmToUse = RARM;
01554                 } else {
01555                         wBTH = wBTHModLARM;
01556                         wArmToUse = LARM;
01557                 }
01558         } else {
01559                 wBTH = findArmBTHMod(mech, wArmToUse);
01560         }
01561 
01562         wBTH += FindPilotPiloting(mech) + 4;
01563         wRoll = Roll();
01564 
01565         ArmorStringFromIndex(wArmToUse, strPunchWith, MechType(mech),
01566                                                  MechMove(mech));
01567 
01568         mech_printf(mech, MECHALL,
01569                                 "You try to swat at the iNarc pods attached to your %s with your %s.  BTH:  %d,\tRoll:  %d",
01570                                 strLocation, strPunchWith, wBTH, wRoll);
01571 
01572         /* Oops, we failed! */
01573         if(wRoll < wBTH) {
01574                 mech_notify(mech, MECHALL,
01575                                         "Uh oh. You miss the pod and hit yourself!");
01576                 MechLOSBroadcast(mech,
01577                                                  "tries to swat off an iNarc pod, but misses and hits itself!");
01578 
01579                 wSelfDamage = (MechTons(mech) + 10 / 2) / 10;
01580 
01581                 if(!OkayCritSectS(wArmToUse, 2, LOWER_ACTUATOR))
01582                         wSelfDamage = wSelfDamage / 2;
01583 
01584                 if(!OkayCritSectS(wArmToUse, 1, UPPER_ACTUATOR))
01585                         wSelfDamage = wSelfDamage / 2;
01586 
01587                 DamageMech(mech, mech, 1, MechPilot(mech), wLoc, 0, 0, wSelfDamage,
01588                                    0, -1, 0, -1, 0, 0);
01589         } else {
01590                 MechSections(mech)[wLoc].specials &= ~wPodType;
01591 
01592                 mech_printf(mech, MECHALL,
01593                                         "You knock a %s pod off your %s!", strPodType,
01594                                         strLocation);
01595                 MechLOSBroadcast(mech, "knocks an iNarc pod off itself.");
01596         }
01597 
01598         SetRecycleLimb(mech, wArmToUse, PHYSICAL_RECYCLE_TIME);
01599 }

void remove_inarc_pods_tank ( dbref  player,
MECH mech,
char *  buffer 
)

Definition at line 1625 of file mech.advanced.c.

References cch, checkAllSections(), CLASS_VTOL, CrewStunned, DOCHECK, EVENT_REMOVE_PODS, INARC_ECM_ATTACHED, INARC_HAYWIRE_ATTACHED, INARC_HOMING_ATTACHED, INARC_NEMESIS_ATTACHED, Landed, mech_notify(), MECH_USUALSO, MECHALL, MechDesiredSpeed, MECHEVENT, MechSpeed, MechType, removeiNarcPodsTank(), UnJammingAmmo, and UnjammingTurret.

01626 {
01627         cch(MECH_USUALSO);
01628 
01629         DOCHECK((MechDesiredSpeed(mech) > 0),
01630                         "You can not be moving when attempting to remove iNarc pods!");
01631         DOCHECK((MechSpeed(mech) > 0),
01632                         "You can not be moving when attempting to remove iNarc pods!");
01633 
01634         if(MechType(mech) == CLASS_VTOL)
01635                 DOCHECK(!Landed(mech),
01636                                 "You must land before attempting to remove iNarc pods!");
01637 
01638         DOCHECK(CrewStunned(mech), "You're too stunned to remove iNarc pods!");
01639         DOCHECK(UnjammingTurret(mech),
01640                         "You're too busy unjamming your turret to remove iNarc pods!");
01641         DOCHECK(UnJammingAmmo(mech),
01642                         "You're too busy unjamming a weapon to remove iNarc pods!");
01643 
01644         if(!(checkAllSections(mech, INARC_HOMING_ATTACHED) ||
01645                  checkAllSections(mech, INARC_HAYWIRE_ATTACHED) ||
01646                  checkAllSections(mech, INARC_ECM_ATTACHED) ||
01647                  checkAllSections(mech, INARC_NEMESIS_ATTACHED))) {
01648 
01649                 mech_notify(mech, MECHALL,
01650                                         "There are no iNarc pods attached to this unit.");
01651 
01652                 return;
01653         }
01654 
01655         mech_notify(mech, MECHALL,
01656                                 "You begin to systematically remove all the iNarc pods from your unit.");
01657 
01658         MECHEVENT(mech, EVENT_REMOVE_PODS, removeiNarcPodsTank, 60, 0);
01659 }

void show_narc_pods ( dbref  player,
MECH mech,
char *  buffer 
)

Definition at line 1379 of file mech.advanced.c.

References ArmorStringFromIndex(), cch, checkAllSections(), checkSectionForSpecial(), GetSectOInt, INARC_ECM_ATTACHED, INARC_HAYWIRE_ATTACHED, INARC_HOMING_ATTACHED, INARC_NEMESIS_ATTACHED, MECH_USUALO, MechMove, MechType, NARC_ATTACHED, notify, notify_printf(), NUM_SECTIONS, and SectIsDestroyed.

01380 {
01381         char location[50];
01382         int i;
01383 
01384         cch(MECH_USUALO);
01385 
01386         if(!(checkAllSections(mech, NARC_ATTACHED) ||
01387                  checkAllSections(mech, INARC_HOMING_ATTACHED) ||
01388                  checkAllSections(mech, INARC_HAYWIRE_ATTACHED) ||
01389                  checkAllSections(mech, INARC_ECM_ATTACHED) ||
01390                  checkAllSections(mech, INARC_NEMESIS_ATTACHED))) {
01391 
01392                 notify(player,
01393                            "There are no NARC or iNARC pods attached to this unit.");
01394 
01395                 return;
01396         }
01397 
01398         notify(player,
01399                    "=========================Attached NARC and iNARC Pods========================");
01400         notify(player,
01401                    "-- Location ---||- NARC -||- iHoming -||- iHaywire -||- iECM -||- iNemesis --");
01402 
01403         for(i = 0; i < NUM_SECTIONS; i++) {
01404                 if(GetSectOInt(mech, i) > 0) {
01405                         ArmorStringFromIndex(i, location, MechType(mech), MechMove(mech));
01406 
01407                         if(SectIsDestroyed(mech, i)) {
01408                                 notify_printf(player,
01409                                                           " %-14.13s||********||***********||************||********||************* ",
01410                                                           location);
01411                         } else {
01412                                 notify_printf(player,
01413                                                           " %-14.13s||....%s...||.....%s.....||......%s.....||....%s...||......%s...... ",
01414                                                           location, checkSectionForSpecial(mech,
01415                                                                                                                            NARC_ATTACHED,
01416                                                                                                                            i) ? "X" : ".",
01417                                                           checkSectionForSpecial(mech,
01418                                                                                                          INARC_HOMING_ATTACHED,
01419                                                                                                          i) ? "X" : ".",
01420                                                           checkSectionForSpecial(mech,
01421                                                                                                          INARC_HAYWIRE_ATTACHED,
01422                                                                                                          i) ? "X" : ".",
01423                                                           checkSectionForSpecial(mech, INARC_ECM_ATTACHED,
01424                                                                                                          i) ? "X" : ".",
01425                                                           checkSectionForSpecial(mech,
01426                                                                                                          INARC_NEMESIS_ATTACHED,
01427                                                                                                          i) ? "X" : ".");
01428                         }
01429                 }
01430         }
01431 }


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