#include "config.h"
Include dependency graph for p.mech.status.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Functions | |
void | DisplayTarget (dbref player, MECH *mech) |
void | show_miscbrands (MECH *mech, dbref player) |
void | PrintGenericStatus (dbref player, MECH *mech, int own, int usex) |
void | PrintHeatBar (dbref player, MECH *mech) |
void | PrintInfoStatus (dbref player, MECH *mech, int own) |
void | PrintShortInfo (dbref player, MECH *mech) |
void | mech_status (dbref player, void *data, char *buffer) |
void | mech_critstatus (dbref player, void *data, char *buffer) |
char * | part_name (int type, int brand) |
char * | part_name_long (int type, int brand) |
char * | pos_part_name (MECH *mech, int index, int loop) |
void | mech_weaponspecs (dbref player, void *data, char *buffer) |
char * | critstatus_func (MECH *mech, char *arg) |
char * | armorstatus_func (MECH *mech, char *arg) |
char * | weaponstatus_func (MECH *mech, char *arg) |
char * | critslot_func (MECH *mech, char *buf_section, char *buf_critnum, char *buf_flag) |
void | CriticalStatus (dbref player, MECH *mech, int index) |
char * | evaluate_ammo_amount (int now, int max) |
void | PrintWeaponStatus (MECH *mech, dbref player) |
int | ArmorEvaluateSerious (MECH *mech, int loc, int flag, int *opt) |
char * | PrintArmorDamageColor (MECH *mech, int loc, int flag) |
char * | PrintArmorDamageString (MECH *mech, int loc, int flag) |
char * | ArmorKeyInfo (dbref player, int keyn, int owner) |
char * | show_armor (MECH *mech, int loc, int flag) |
void | PrintArmorStatus (dbref player, MECH *mech, int owner) |
int | hasPhysical (MECH *objMech, int wLoc, int wPhysType) |
int | canUsePhysical (MECH *objMech, int wLoc, int wPhysType) |
int ArmorEvaluateSerious | ( | MECH * | mech, | |
int | loc, | |||
int | flag, | |||
int * | opt | |||
) |
Definition at line 1637 of file mech.status.c.
References AeroSI, AeroSIOrig, c, GetSectArmor, GetSectInt, GetSectOArmor, GetSectOInt, GetSectORArmor, GetSectRArmor, SectArmorRepair, SectIntsRepair, and SectRArmorRepair.
Referenced by PrintArmorDamageColor(), and PrintArmorDamageString().
01638 { 01639 int a = -1; 01640 int b = -1; 01641 int c = -1; 01642 01643 if(flag & 256) { 01644 // Aero SI 01645 a = ((1 + (b = AeroSI(mech))) * 100) / (AeroSIOrig(mech) + 1); 01646 } else if(flag & 2) { 01647 if(SectIntsRepair(mech, loc)) 01648 c = 5; /* Blue */ 01649 a = (((b = GetSectInt(mech, loc)) + 1) * 100) / (GetSectOInt(mech, loc) + 1); 01650 } else if(flag & 4) { 01651 if(SectRArmorRepair(mech, loc)) 01652 c = 5; /* Blue */ 01653 a = ((1 + (b = GetSectRArmor(mech, loc))) * 100) / (GetSectORArmor(mech, loc) + 1); 01654 } else { 01655 if(SectArmorRepair(mech, loc)) 01656 c = 5; /* Blue */ 01657 a = ((1 + (b = GetSectArmor(mech, loc))) * 100) / (GetSectOArmor(mech, loc) + 1); 01658 } 01659 01660 *opt = b; 01661 // Blue (Character 5 in armordamltrstr) 01662 if(c > 0) 01663 return c; 01664 // Yarr, we're breached. 01665 if(!b) 01666 return 4; 01667 // Armor condition level characters. 01668 if(a > 90) 01669 return 0; 01670 if(a > 70) 01671 return 1; 01672 if(a > 45) 01673 return 2; 01674 return 3; 01675 }
char* ArmorKeyInfo | ( | dbref | player, | |
int | keyn, | |||
int | owner | |||
) |
Definition at line 1716 of file mech.status.c.
References armordamcolorstr, and armordamltrstr.
Referenced by PrintArmorStatus().
01717 { 01718 static char str[20]; 01719 01720 if(owner) { 01721 str[0] = 0; 01722 return str; 01723 } 01724 if(keyn == 1) { 01725 strcpy(str, "Key"); 01726 return str; 01727 } 01728 if(keyn > 6) { 01729 strcpy(str, " "); 01730 return str; 01731 } 01732 sprintf(str, "%s%c%c%%c ", armordamcolorstr[6 - keyn], 01733 armordamltrstr[6 - keyn], armordamltrstr[6 - keyn]); 01734 return str; 01735 }
char* armorstatus_func | ( | MECH * | mech, | |
char * | arg | |||
) |
Definition at line 896 of file mech.status.c.
References ArmorSectionFromString(), GetSectArmor, GetSectInt, GetSectOArmor, GetSectOInt, GetSectORArmor, GetSectRArmor, MBUF_SIZE, MechMove, MechType, and ProperSectionStringFromType().
Referenced by fun_btarmorstatus(), and fun_btarmorstatus_ref().
00897 { 00898 static char buffer[MBUF_SIZE]; 00899 char **locs; 00900 int index; 00901 int iter, curarm, curint, totarm, totint; 00902 00903 if(!arg || !*arg) 00904 return "#-1 INVALID SECTION"; 00905 00906 if(strcmp(arg, "all") == 0) { 00907 locs = ProperSectionStringFromType(MechType(mech), MechMove(mech)); 00908 curarm = totarm = curint = totint = 0; 00909 for(iter = 0; locs[iter]; iter++) { 00910 curarm += GetSectArmor(mech, iter) + GetSectRArmor(mech, iter); 00911 totarm += GetSectOArmor(mech, iter) + GetSectORArmor(mech, iter); 00912 curint += GetSectInt(mech, iter); 00913 totint += GetSectOInt(mech, iter); 00914 } 00915 buffer[0] = '\0'; 00916 snprintf(buffer, MBUF_SIZE, "%d/%d|%d/%d", curarm, totarm, curint, 00917 totint); 00918 return buffer; 00919 } 00920 00921 index = ArmorSectionFromString(MechType(mech), MechMove(mech), arg); 00922 if(index == -1 || !GetSectOInt(mech, index)) 00923 return "#-1 INVALID SECTION"; 00924 00925 buffer[0] = '\0'; 00926 snprintf(buffer, MBUF_SIZE, "%d/%d|%d/%d|%d/%d", 00927 GetSectArmor(mech, index), GetSectOArmor(mech, index), 00928 GetSectInt(mech, index), GetSectOInt(mech, index), 00929 GetSectRArmor(mech, index), GetSectORArmor(mech, index)); 00930 return buffer; 00931 }
int canUsePhysical | ( | MECH * | objMech, | |
int | wLoc, | |||
int | wPhysType | |||
) |
Definition at line 2345 of file mech.status.c.
References HAND_OR_FOOT_ACTUATOR, LARM, OkayCritSectS2, PHY_AXE, PHY_MACE, PHY_SAW, PHY_SWORD, RARM, SectIsDestroyed, and SHOULDER_OR_HIP.
02346 { 02347 int tRet = 1; 02348 02349 switch (wPhysType) { 02350 case PHY_AXE: 02351 case PHY_SWORD: 02352 if(SectIsDestroyed(objMech, wLoc)) 02353 tRet = 0; 02354 else if(!OkayCritSectS2(objMech, wLoc, 0, SHOULDER_OR_HIP)) 02355 tRet = 0; 02356 else if(!OkayCritSectS2(objMech, wLoc, 3, HAND_OR_FOOT_ACTUATOR)) 02357 tRet = 0; 02358 break; 02359 02360 case PHY_MACE: 02361 if(SectIsDestroyed(objMech, LARM) || SectIsDestroyed(objMech, RARM)) 02362 tRet = 0; 02363 else if((!OkayCritSectS2(objMech, LARM, 0, SHOULDER_OR_HIP)) || 02364 (!OkayCritSectS2(objMech, RARM, 0, SHOULDER_OR_HIP))) 02365 tRet = 0; 02366 else if((!OkayCritSectS2(objMech, LARM, 3, HAND_OR_FOOT_ACTUATOR)) 02367 || (!OkayCritSectS2(objMech, RARM, 3, HAND_OR_FOOT_ACTUATOR))) 02368 tRet = 0; 02369 break; 02370 02371 case PHY_SAW: 02372 if(SectIsDestroyed(objMech, wLoc)) 02373 tRet = 0; 02374 else if(!OkayCritSectS2(objMech, wLoc, 0, SHOULDER_OR_HIP)) 02375 tRet = 0; 02376 break; 02377 02378 default: 02379 tRet = 0; 02380 } // end switch() 02381 02382 return tRet; 02383 } // end canUsePhysical()
Definition at line 1091 of file mech.status.c.
References Ammo2WeaponI, ArmorStringFromIndex(), Create, CritsInLoc(), EMPTY, GetAmmoDesc_Model_Mode(), GetPartAmmoMode, GetPartData, GetPartFireMode, GetPartType, IsAmmo, IsCrap, IsWeapon, KillCoolMenu(), KillText(), MBUF_SIZE, MechMove, MechType, MechWeapons, name, NUM_CRITICALS, OS_MODE, OS_USED, PartIsBroken, PartIsDamaged, PartIsDestroyed, PartIsDisabled, PartIsNonfunctional, pos_part_name(), ROCKET_FIRED, SectIsDestroyed, SelCol_StringMenu, ShowCoolMenu(), and WILL_JETTISON_MODE.
Referenced by mech_critstatus(), and mechrep_Rdisplaysection().
01092 { 01093 int loop, i; 01094 char buffer[MBUF_SIZE]; 01095 int type, data, wFireMode; 01096 int max_crits = CritsInLoc(mech, index); 01097 char **foo; 01098 int count = 0; 01099 coolmenu *cm; 01100 01101 Create(foo, char *, NUM_CRITICALS + 1); 01102 01103 for(i = 0; i < max_crits; i++) { 01104 loop = ((i % 2) ? (max_crits / 2) : 0) + i / 2; 01105 sprintf(buffer, "%2d ", loop + 1); 01106 type = GetPartType(mech, index, loop); 01107 data = GetPartData(mech, index, loop); 01108 wFireMode = GetPartFireMode(mech, index, loop); 01109 if(IsAmmo(type)) { 01110 char trash[50]; 01111 01112 strcat(buffer, &MechWeapons[Ammo2WeaponI(type)].name[3]); 01113 strcat(buffer, GetAmmoDesc_Model_Mode(Ammo2WeaponI(type), 01114 GetPartAmmoMode(mech, index, 01115 loop))); 01116 strcat(buffer, " Ammo"); 01117 01118 if(!PartIsNonfunctional(mech, index, loop)) { 01119 sprintf(trash, " (%d)", data); 01120 strcat(buffer, trash); 01121 } 01122 01123 } else { 01124 if(IsWeapon(type) && (wFireMode & OS_MODE)) 01125 strcat(buffer, "OS "); 01126 strcat(buffer, pos_part_name(mech, index, loop)); 01127 if(IsWeapon(type) && (((wFireMode & OS_MODE) && 01128 (wFireMode & OS_USED)) || 01129 (wFireMode & ROCKET_FIRED))) 01130 strcat(buffer, " (Empty)"); 01131 if(wFireMode & WILL_JETTISON_MODE) 01132 strcat(buffer, " (backpack)"); 01133 } 01134 01135 if(PartIsBroken(mech, index, loop) && type != EMPTY && 01136 (!IsCrap(type) || SectIsDestroyed(mech, index))) 01137 strcat(buffer, PartIsDestroyed(mech, index, loop) ? 01138 " (Destroyed)" : " (Broken)"); 01139 else if(PartIsDisabled(mech, index, loop) && type != EMPTY) 01140 strcat(buffer, " (Disabled)"); 01141 else if(PartIsDamaged(mech, index, loop) && type != EMPTY) 01142 strcat(buffer, " (Damaged)"); 01143 01144 foo[count++] = strdup(buffer); 01145 } 01146 01147 ArmorStringFromIndex(index, buffer, MechType(mech), MechMove(mech)); 01148 strcat(buffer, " Criticals"); 01149 cm = SelCol_StringMenu(2, buffer, foo); 01150 ShowCoolMenu(player, cm); 01151 KillCoolMenu(cm); 01152 KillText(foo); 01153 }
char* critslot_func | ( | MECH * | mech, | |
char * | buf_section, | |||
char * | buf_critnum, | |||
char * | buf_flag | |||
) |
Definition at line 998 of file mech.status.c.
References alias_part, ArmorSectionFromString(), CritsInLoc(), EMPTY, FindAmmoType(), flag, FullAmmo(), get_parts_vlong_name(), GetPartAmmoMode, GetPartBrand, GetPartData, GetPartFireMode, GetPartType, GetSectOInt, GetWeaponAmmoModeLetter_Model_Mode(), GetWeaponFireModeLetter_Model_Mode(), HALFTON_MODE, IsAmmo, IsCrap, IsWeapon, MBUF_SIZE, MechMove, MechType, PartIsDestroyed, PartIsDisabled, and Weapon2I.
Referenced by fun_btcritslot(), and fun_btcritslot_ref().
01000 { 01001 int index, crit, flag, type; 01002 static char buffer[MBUF_SIZE]; 01003 01004 index = 01005 ArmorSectionFromString(MechType(mech), MechMove(mech), buf_section); 01006 if(index == -1) 01007 return "#-1 INVALID SECTION"; 01008 if(!GetSectOInt(mech, index)) 01009 return "#-1 INVALID SECTION"; 01010 crit = atoi(buf_critnum); 01011 if(crit < 1 || crit > CritsInLoc(mech, index)) 01012 return "#-1 INVALID CRITICAL"; 01013 crit--; 01014 if(!buf_flag) 01015 flag = 0; 01016 else if(strcasecmp(buf_flag, "NAME") == 0) 01017 flag = 0; 01018 else if(strcasecmp(buf_flag, "STATUS") == 0) 01019 flag = 1; 01020 else if(strcasecmp(buf_flag, "DATA") == 0) 01021 flag = 2; 01022 else if(strcasecmp(buf_flag, "MAXAMMO") == 0) 01023 flag = 3; 01024 else if(strcasecmp(buf_flag, "AMMOTYPE") == 0) 01025 flag = 4; 01026 else if(strcasecmp(buf_flag, "MODE") == 0) 01027 flag = 5; 01028 else if(strcasecmp(buf_flag, "HALFTON") == 0) 01029 flag = 6; 01030 else 01031 flag = 0; 01032 01033 type = GetPartType(mech, index, crit); 01034 01035 if(flag == 1) { 01036 if(PartIsDisabled(mech, index, crit)) 01037 return "Disabled"; 01038 if(PartIsDestroyed(mech, index, crit)) 01039 return "Destroyed"; 01040 return "Operational"; 01041 } else if(flag == 2) { 01042 snprintf(buffer, MBUF_SIZE, "%d", GetPartData(mech, index, crit)); 01043 return buffer; 01044 } else if(flag == 3) { 01045 if(!IsAmmo(type)) 01046 return "#-1 NOT AMMO"; 01047 snprintf(buffer, MBUF_SIZE, "%d", FullAmmo(mech, index, crit)); 01048 return buffer; 01049 } else if(flag == 4) { 01050 if(!IsAmmo(type)) 01051 return "#-1 NOT AMMO"; 01052 type = FindAmmoType(mech, index, crit); 01053 } else if(flag == 5) { 01054 int weapindex; 01055 if(!IsWeapon(type)) 01056 return "#-1 NOT AMMO OR WEAPON"; 01057 else { 01058 weapindex = Weapon2I(type); 01059 snprintf(buffer, MBUF_SIZE, "%c%c", 01060 GetWeaponFireModeLetter_Model_Mode(weapindex, 01061 GetPartFireMode(mech, 01062 index, 01063 crit)), 01064 GetWeaponAmmoModeLetter_Model_Mode(weapindex, 01065 GetPartAmmoMode(mech, 01066 index, 01067 crit))); 01068 return buffer; 01069 } 01070 } else if(flag == 6) { 01071 if(!IsAmmo(type)) 01072 return "#-1 NOT AMMO"; 01073 snprintf(buffer, MBUF_SIZE, "%d", GetPartFireMode(mech, index, crit) & HALFTON_MODE ? 1 : 0); 01074 return buffer; 01075 01076 } 01077 01078 if(type == EMPTY || IsCrap(type)) 01079 return "Empty"; 01080 if(flag == 0) 01081 #ifndef BT_COMPLEXREPAIRS 01082 type = alias_part(mech, type); 01083 #else 01084 type = alias_part(mech, type, index); 01085 #endif 01086 snprintf(buffer, MBUF_SIZE, "%s", 01087 get_parts_vlong_name(type, GetPartBrand(mech, index, crit))); 01088 return buffer; 01089 }
char* critstatus_func | ( | MECH * | mech, | |
char * | arg | |||
) |
Definition at line 856 of file mech.status.c.
References ArmorSectionFromString(), CritsInLoc(), EMPTY, FindAmmoType(), get_parts_long_name(), GetPartBrand, GetPartType, GetSectOInt, IsActuator, IsAmmo, IsCargo, IsCrap, IsWeapon, MBUF_SIZE, MechMove, MechType, PartIsNonfunctional, PartTempNuke, and SectIsDestroyed.
Referenced by fun_btcritstatus(), and fun_btcritstatus_ref().
00857 { 00858 static char buffer[MBUF_SIZE]; 00859 char *tmp; 00860 int index, i, max_crits; 00861 int type; 00862 00863 if(!arg || !*arg) 00864 return "#-1 INVALID SECTION"; 00865 00866 index = ArmorSectionFromString(MechType(mech), MechMove(mech), arg); 00867 if(index == -1 || !GetSectOInt(mech, index)) 00868 return "#-1 INVALID SECTION"; 00869 00870 buffer[0] = '\0'; 00871 max_crits = CritsInLoc(mech, index); 00872 for(i = 0; i < max_crits; i++) { 00873 if(buffer[0]) 00874 sprintf(buffer, "%s,", buffer); 00875 sprintf(buffer, "%s%d|", buffer, i + 1); 00876 type = GetPartType(mech, index, i); 00877 if(IsAmmo(type)) 00878 type = FindAmmoType(mech, index, i); 00879 tmp = get_parts_long_name(type, GetPartBrand(mech, index, i)); 00880 sprintf(buffer, "%s|%s", buffer, tmp ? tmp : "Empty"); 00881 sprintf(buffer, "%s|%d", buffer, (PartIsNonfunctional(mech, index, 00882 i) 00883 && type != EMPTY && (!IsCrap(type) 00884 || 00885 SectIsDestroyed 00886 (mech, 00887 index))) ? -1 00888 : PartTempNuke(mech, index, i)); 00889 sprintf(buffer, "%s|%d", buffer, 00890 IsWeapon(type) ? 1 : IsAmmo(type) ? 2 : IsActuator(type) ? 3 : 00891 IsCargo(type) ? 4 : (IsCrap(type) || type == EMPTY) ? 5 : 0); 00892 } 00893 return buffer; 00894 }
Definition at line 50 of file mech.status.c.
References ArmorStringFromIndex(), confdata::btech_newcharge, FaMechRange, FindBearing(), GetArcID(), getMech(), GetMechToMechID(), GetTurnMode, GotPilot, HasBoolAdvantage(), InLineOfSight(), InWeaponArc(), LOCK_BUILDING, LOCK_HEX, MechAim, MechAimType, MechChargeTarget, MechChargeTimer, MechFX, MechFY, MechMove, MechPilot, MechPKiller, MechStatus, MechTarget, MechTargX, MechTargY, MechType, MechX, MechY, mudconf, notify, notify_printf(), NUM_SECTIONS, tprintf(), and TURRETARC.
Referenced by PrintInfoStatus(), and PrintShortInfo().
00051 { 00052 int arc; 00053 MECH *tempMech = NULL; 00054 char location[50]; 00055 char buff[100], buff1[100]; 00056 00057 if(MechTarget(mech) != -1) { 00058 tempMech = getMech(MechTarget(mech)); 00059 if(tempMech) { 00060 if(InLineOfSight(mech, tempMech, MechX(tempMech), 00061 MechY(tempMech), FaMechRange(mech, tempMech))) { 00062 sprintf(buff, 00063 "Target: %s\t Range: %.1f hexes Bearing: %d deg\n", 00064 GetMechToMechID(mech, tempMech), FaMechRange(mech, 00065 tempMech), 00066 FindBearing(MechFX(mech), MechFY(mech), 00067 MechFX(tempMech), MechFY(tempMech))); 00068 notify(player, buff); 00069 arc = InWeaponArc(mech, MechFX(tempMech), MechFY(tempMech)); 00070 strcpy(buff, tprintf("Target in %s Weapons Arc", 00071 (arc & TURRETARC) ? "Turret" : 00072 GetArcID(mech, arc))); 00073 if(MechAim(mech) == NUM_SECTIONS 00074 || MechAimType(mech) != MechType(tempMech)) 00075 strcpy(location, "None"); 00076 else 00077 ArmorStringFromIndex(MechAim(mech), location, 00078 MechType(tempMech), 00079 MechMove(tempMech)); 00080 sprintf(buff1, "\t Aimed Shot Location: %s", location); 00081 strcat(buff, buff1); 00082 } else 00083 sprintf(buff, "Target: NOT in line of sight!\n"); 00084 } 00085 notify(player, buff); 00086 } else if(MechTargX(mech) != -1 && MechTargY(mech) != -1) { 00087 if(MechStatus(mech) & LOCK_BUILDING) 00088 notify_printf(player, "Target: Building at %d %d\n", 00089 MechTargX(mech), MechTargY(mech)); 00090 else if(MechStatus(mech) & LOCK_HEX) 00091 notify_printf(player, "Target: Hex %d %d\n", MechTargX(mech), 00092 MechTargY(mech)); 00093 else 00094 notify_printf(player, "Target: %d %d\n", MechTargX(mech), 00095 MechTargY(mech)); 00096 00097 } 00098 if(MechPKiller(mech)) 00099 notify(player, "Weapon Safeties are %ch%crOFF%cn.\n"); 00100 if(GotPilot(mech) && HasBoolAdvantage(MechPilot(mech), "maneuvering_ace")) 00101 notify_printf(player, "Turn Mode: %s", 00102 GetTurnMode(mech) ? "TIGHT" : "NORMAL"); 00103 if(MechChargeTarget(mech) > 0 && mudconf.btech_newcharge) { 00104 tempMech = getMech(MechChargeTarget(mech)); 00105 if(!tempMech) 00106 return; 00107 if(InLineOfSight(mech, tempMech, MechX(tempMech), MechY(tempMech), 00108 FaMechRange(mech, tempMech))) { 00109 notify_printf(player, "ChargeTarget: %s\t ChargeTimer: %d\n", 00110 GetMechToMechID(mech, tempMech), 00111 MechChargeTimer(mech) / 2); 00112 } else { 00113 notify_printf(player, 00114 "ChargeTarget: NOT in line of sight!\t Timer: %d\n", 00115 MechChargeTimer(mech) / 2); 00116 } 00117 } 00118 }
char* evaluate_ammo_amount | ( | int | now, | |
int | max | |||
) |
Definition at line 1155 of file mech.status.c.
Referenced by PrintWeaponStatus().
01156 { 01157 int f = (now * 100) / max; 01158 01159 if(f >= 50) 01160 return "%ch%cg"; 01161 if(f >= 25) 01162 return "%ch%cy"; 01163 return "%ch%cr"; 01164 }
int hasPhysical | ( | MECH * | objMech, | |
int | wLoc, | |||
int | wPhysType | |||
) |
Definition at line 2312 of file mech.status.c.
References AXE, DUAL_SAW, FindObjWithDest(), I2Special, MACE, MechTons, PHY_AXE, PHY_MACE, PHY_SAW, PHY_SWORD, and SWORD.
Referenced by PrintWeaponStatus().
02313 { 02314 int wType; 02315 int wSize; 02316 02317 switch (wPhysType) { 02318 case PHY_AXE: 02319 wType = AXE; 02320 wSize = MechTons(objMech) / 15; 02321 break; 02322 02323 case PHY_SWORD: 02324 wType = SWORD; 02325 wSize = MechTons(objMech) / 15; 02326 break; 02327 02328 case PHY_MACE: 02329 wType = MACE; 02330 wSize = MechTons(objMech) / 15; 02331 break; 02332 02333 case PHY_SAW: 02334 wType = DUAL_SAW; 02335 wSize = 7; 02336 break; 02337 02338 default: 02339 return 0; 02340 } // end switch() 02341 02342 return FindObjWithDest(objMech, wLoc, I2Special(wType)) >= wSize; 02343 } // end hasPhysical()
void mech_critstatus | ( | dbref | player, | |
void * | data, | |||
char * | buffer | |||
) |
Definition at line 680 of file mech.status.c.
References args, ArmorSectionFromString(), cch, CheckData(), CLASS_MW, CriticalStatus(), DOCHECK, GetSectOInt, mech_parseattributes(), MECH_USUALSM, MechMove, and MechType.
Referenced by fun_btshowcritstatus_ref(), and turret_critstatus().
00681 { 00682 MECH *mech = (MECH *) data; 00683 char *args[1]; 00684 int index; 00685 00686 cch(MECH_USUALSM); 00687 if(!CheckData(player, mech)) 00688 return; 00689 DOCHECK(MechType(mech) == CLASS_MW, "Huh?"); 00690 DOCHECK(mech_parseattributes(buffer, args, 1) != 1, 00691 "You must specify a section to list the criticals for!"); 00692 index = ArmorSectionFromString(MechType(mech), MechMove(mech), args[0]); 00693 DOCHECK(index == -1, "Invalid section!"); 00694 DOCHECK(!GetSectOInt(mech, index), "Invalid section!"); 00695 CriticalStatus(player, mech, index); 00696 }
void mech_status | ( | dbref | player, | |
void * | data, | |||
char * | buffer | |||
) |
Definition at line 565 of file mech.status.c.
References cch, doweird, GetSectOArmor, GetSectOInt, GetSectORArmor, LBUF_SIZE, MECH_USUALSM, MechActiveNumsinks, MechHasHeat, MechJumpSpeed, MechMaxSpeed, MechTons, MechType_Name, MechType_Ref, MP1, notify, NUM_SECTIONS, PrintArmorStatus(), PrintGenericStatus(), PrintHeatBar(), PrintInfoStatus(), PrintShortInfo(), PrintWeaponStatus(), and weirdbuf.
Referenced by fun_btshowstatus_ref(), and turret_status().
00566 { 00567 MECH *mech = (MECH *) data; 00568 int doweap = 0, doinfo = 0, doarmor = 0, doshort = 0, doheat = 0, loop; 00569 int i; 00570 int usex = 0; 00571 char buf[LBUF_SIZE]; 00572 char subbuff[256]; 00573 00574 doweird = 0; 00575 cch(MECH_USUALSM); 00576 if(!buffer || !strlen(buffer)) 00577 // No arguments, we'll go with our default 'status' output. 00578 doweap = doinfo = doarmor = doheat = 1; 00579 else { 00580 // Argument provided, only show certain parts. 00581 for(loop = 0; buffer[loop]; loop++) { 00582 switch (toupper(buffer[loop])) { 00583 case 'R': 00584 doweap = doinfo = doarmor = doheat = usex = 1; 00585 break; 00586 case 'A': 00587 // Armor status 00588 if(toupper(buffer[loop + 1]) == 'R') 00589 while (buffer[loop + 1] && buffer[loop + 1] != ' ') 00590 loop++; 00591 doarmor = 1; 00592 break; 00593 case 'I': 00594 // Speed/Heading/Heat 00595 doinfo = 1; 00596 if(toupper(buffer[loop + 1]) == 'N') 00597 while (buffer[loop + 1] && buffer[loop + 1] != ' ') 00598 loop++; 00599 break; 00600 case 'W': 00601 // Weapons list. 00602 doweap = 1; 00603 if(toupper(buffer[loop + 1]) == 'E') 00604 while (buffer[loop + 1] && buffer[loop + 1] != ' ') 00605 loop++; 00606 break; 00607 case 'N': 00608 // Really weird status display. 00609 doweird = 1; 00610 break; 00611 case 'S': 00612 // Very short one-line status. 00613 doshort = 1; 00614 break; 00615 case 'H': 00616 // Just the heat bar. 00617 doheat = 1; 00618 break; 00619 } 00620 } 00621 } 00622 00623 // Very short one-line status. 00624 if(doshort) { 00625 PrintShortInfo(player, mech); 00626 return; 00627 } 00628 00629 // Really weird status display. 00630 if(doweird) { 00631 sprintf(buf, "%s %s %d %d/%d/%d %d ", MechType_Ref(mech), 00632 MechType_Name(mech), MechTons(mech), 00633 (int) (MechMaxSpeed(mech) / MP1) * 2 / 3, 00634 (int) (MechMaxSpeed(mech) / MP1), 00635 (int) (MechJumpSpeed(mech) / MP1), MechActiveNumsinks(mech)); 00636 weirdbuf = buf; 00637 00638 } else if(!doheat || (doarmor | doinfo | doweap)) 00639 PrintGenericStatus(player, mech, 1, usex); 00640 00641 // Show our armor diagram. 00642 if(doarmor) { 00643 if(!doweird) { 00644 PrintArmorStatus(player, mech, 1); 00645 notify(player, " "); 00646 } else { 00647 for(i = 0; i < NUM_SECTIONS; i++) 00648 if(GetSectOArmor(mech, i)) { 00649 if(GetSectORArmor(mech, i)) 00650 sprintf(buf + strlen(buf), "%d|%d|%d ", 00651 GetSectOArmor(mech, i), GetSectOInt(mech, i), 00652 GetSectORArmor(mech, i)); 00653 else 00654 sprintf(buf + strlen(buf), "%d|%d ", 00655 GetSectOArmor(mech, i), GetSectOInt(mech, i)); 00656 } 00657 } 00658 } 00659 00660 // Standard heat/heading/dive/etc. 00661 if(doinfo && !doweird) { 00662 PrintInfoStatus(player, mech, 1); 00663 //notify(player, " "); 00664 } 00665 00666 // Show our heat bar by itself. 00667 if(!doinfo && doheat && MechHasHeat(mech)) { 00668 PrintHeatBar(player, mech); 00669 } 00670 00671 // Weapons readout. 00672 if(doweap) 00673 PrintWeaponStatus(mech, player); 00674 00675 // Really strange, short status info. 00676 if(doweird) 00677 notify(player, buf); 00678 }
void mech_weaponspecs | ( | dbref | player, | |
void * | data, | |||
char * | buffer | |||
) |
Definition at line 813 of file mech.status.c.
References c, CheckData(), DOCHECK, FindWeapons, KillCoolMenu(), MAX_WEAPONS_PER_MECH, MAX_WEAPS_SECTION, MechType_Name, MechType_Ref, NUM_SECTIONS, SelCol_FunStringMenuK(), ShowCoolMenu(), tprintf(), wspec_fun(), wspec_weapcount, and wspec_weaps.
Referenced by fun_btshowwspecs_ref(), and turret_weaponspecs().
00814 { 00815 MECH *mech = (MECH *) data; 00816 int loop; 00817 unsigned char weaparray[MAX_WEAPS_SECTION]; 00818 unsigned char weapdata[MAX_WEAPS_SECTION]; 00819 int critical[MAX_WEAPS_SECTION]; 00820 00821 /* unsigned char weaps[8 * MAX_WEAPS_SECTION]; */ 00822 int num_weaps; 00823 int index; 00824 int duplicate, ii; 00825 coolmenu *c; 00826 00827 wspec_weapcount = 0; 00828 if(!CheckData(player, mech)) 00829 return; 00830 for(loop = 0; loop < NUM_SECTIONS; loop++) { 00831 num_weaps = FindWeapons(mech, loop, weaparray, weapdata, critical); 00832 for(index = 0; index < num_weaps; index++) { 00833 duplicate = 0; 00834 for(ii = 0; ii < wspec_weapcount; ii++) 00835 if(weaparray[index] == wspec_weaps[ii]) 00836 duplicate = 1; 00837 if(!duplicate && wspec_weapcount < MAX_WEAPONS_PER_MECH) 00838 wspec_weaps[wspec_weapcount++] = weaparray[index]; 00839 } 00840 } 00841 DOCHECK(!wspec_weapcount, "You have no weapons!"); 00842 if(strcmp(MechType_Name(mech), MechType_Ref(mech))) 00843 c = SelCol_FunStringMenuK(1, 00844 tprintf("Weapons statistics for %s: %s", 00845 MechType_Name(mech), 00846 MechType_Ref(mech)), wspec_fun, 00847 wspec_weapcount + 1); 00848 else 00849 c = SelCol_FunStringMenuK(1, tprintf("Weapons statistics for %s", 00850 MechType_Ref(mech)), wspec_fun, 00851 wspec_weapcount + 1); 00852 ShowCoolMenu(player, c); 00853 KillCoolMenu(c); 00854 }
char* part_name | ( | int | type, | |
int | brand | |||
) |
Definition at line 701 of file mech.status.c.
References c, EMPTY, get_parts_long_name(), and SBUF_SIZE.
Referenced by pos_part_name().
00702 { 00703 char *c; 00704 static char buffer[SBUF_SIZE]; 00705 00706 if(type == EMPTY) 00707 return "Empty"; 00708 c = get_parts_long_name(type, brand); 00709 if(!c) 00710 return NULL; 00711 strcpy(buffer, c); 00712 if(!strcmp(c, "LifeSupport")) 00713 strcpy(buffer, "Life Support"); 00714 else if(!strcmp(c, "TripleStrengthMyomer")) 00715 strcpy(buffer, "Triple Strength Myomer"); 00716 else 00717 strcpy(buffer, c); 00718 if((c = strstr(buffer, "Actuator"))) 00719 if(c != buffer) 00720 strcpy(c, " Actuator"); 00721 while ((c = strchr(buffer, '_'))) 00722 *c = ' '; 00723 while ((c = strchr(buffer, '.'))) 00724 *c = ' '; 00725 return buffer; 00726 }
char* part_name_long | ( | int | type, | |
int | brand | |||
) |
Definition at line 728 of file mech.status.c.
References c, EMPTY, get_parts_vlong_name(), and SBUF_SIZE.
Referenced by fun_btstores(), and list_matching().
00729 { 00730 char *c; 00731 static char buffer[SBUF_SIZE]; 00732 00733 if(type == EMPTY) 00734 return "Empty"; 00735 c = get_parts_vlong_name(type, brand); 00736 if(!c) 00737 return NULL; 00738 strcpy(buffer, c); 00739 if(!strcmp(c, "LifeSupport")) 00740 strcpy(buffer, "Life Support"); 00741 else if(!strcmp(c, "TripleStrengthMyomer")) 00742 strcpy(buffer, "Triple Strength Myomer"); 00743 else 00744 strcpy(buffer, c); 00745 if((c = strstr(buffer, "Actuator"))) 00746 if(c != buffer) 00747 strcpy(c, " Actuator"); 00748 while ((c = strchr(buffer, '_'))) 00749 *c = ' '; 00750 while ((c = strchr(buffer, '.'))) 00751 *c = ' '; 00752 return buffer; 00753 }
char* pos_part_name | ( | MECH * | mech, | |
int | index, | |||
int | loop | |||
) |
Definition at line 755 of file mech.status.c.
References c, GetPartBrand, GetPartType, HAND_OR_FOOT_ACTUATOR, LLEG, MechIsQuad, MECH::mynum, NUM_CRITICALS, NUM_SECTIONS, part_name(), RLEG, SendError, SHOULDER_OR_HIP, Special, and tprintf().
Referenced by CriticalStatus(), damages_func(), describe_repairs(), muxevent_tickmech_reload(), muxevent_tickmech_removegun(), muxevent_tickmech_removepart(), muxevent_tickmech_repairenhcrit(), muxevent_tickmech_repairgun(), muxevent_tickmech_repairpart(), muxevent_tickmech_replacegun(), and show_mechs_damage().
00756 { 00757 int t, b; 00758 char *c; 00759 00760 if(index < 0 || index >= NUM_SECTIONS || loop < 0 || 00761 loop >= NUM_CRITICALS) { 00762 SendError(tprintf("INVALID: For mech #%d, %d/%d was requested.", 00763 mech->mynum, index, loop)); 00764 return "--?LocationBug?--"; 00765 } 00766 t = GetPartType(mech, index, loop); 00767 b = GetPartBrand(mech, index, loop); 00768 if(t == Special(HAND_OR_FOOT_ACTUATOR)) { 00769 if(index == LLEG || index == RLEG || MechIsQuad(mech)) 00770 return "Foot Actuator"; 00771 return "Hand Actuator"; 00772 } 00773 if(t == Special(SHOULDER_OR_HIP)) { 00774 if(index == LLEG || index == RLEG || MechIsQuad(mech)) 00775 return "Hip"; 00776 return "Shoulder"; 00777 } 00778 if(!(c = part_name(t, b))) 00779 return "--?ErrorInTemplate?--"; 00780 return c; 00781 00782 }
char* PrintArmorDamageColor | ( | MECH * | mech, | |
int | loc, | |||
int | flag | |||
) |
Definition at line 1682 of file mech.status.c.
References armordamcolorstr, and ArmorEvaluateSerious().
Referenced by show_armor().
01683 { 01684 int a; 01685 01686 return armordamcolorstr[ArmorEvaluateSerious(mech, loc, flag, &a)]; 01687 }
char* PrintArmorDamageString | ( | MECH * | mech, | |
int | loc, | |||
int | flag | |||
) |
Definition at line 1689 of file mech.status.c.
References armordamltrstr, and ArmorEvaluateSerious().
Referenced by show_armor().
01690 { 01691 int a; 01692 static char foo[6]; 01693 01694 // Zero out our armor string. 01695 for(a = 0; a < 4; a++) 01696 foo[a] = 0; 01697 01698 // Put a single character representing the section's health in front of array. 01699 foo[0] = armordamltrstr[ArmorEvaluateSerious(mech, loc, flag, &a)]; 01700 01701 if(flag & 1) { 01702 if(flag & 8) 01703 sprintf(foo, "%1d", (flag & 32) ? ((a + 9) / 10) : a); 01704 else if(flag & 128) 01705 sprintf(foo, "%3d", a); 01706 else 01707 sprintf(foo, "%2d", a); 01708 01709 if((flag & 16) && foo[0] == ' ') 01710 foo[0] = '0'; 01711 } else 01712 foo[1] = (flag & 8 ? 0 : foo[0]); 01713 return foo; 01714 }
Definition at line 2167 of file mech.status.c.
References aerod_ds_desc, aerodesc, ArmorKeyInfo(), bsuitdesc, CLASS_AERO, CLASS_BSUIT, CLASS_DS, CLASS_MECH, CLASS_MW, CLASS_SPHEROID_DS, CLASS_VEH_GROUND, CLASS_VEH_NAVAL, CLASS_VTOL, flag, foildesc, get_statustemplate_attr(), GetSectInt, GetSectOInt, mechdesc, MechIsQuad, MechMove, MechTons, MechType, MOVE_FOIL, MOVE_HULL, mwdesc, notify, quaddesc, shipdesc, show_armor(), spher_ds_desc, strtok(), subdesc, TURRET, veh_not_desc, vehdesc, and vtoldesc.
Referenced by mech_status(), and PrintEnemyStatus().
02168 { 02169 char tmpbuf[8192]; 02170 char *p, *q, *r; 02171 char destbuf[8192]; 02172 int flag; 02173 int gflag = 0; 02174 int odd = 0; 02175 02176 /* All we need is proper source for stuff */ 02177 if(!get_statustemplate_attr(player, mech, tmpbuf)) { 02178 switch (MechType(mech)) { 02179 case CLASS_MW: 02180 strcpy(tmpbuf, mwdesc); 02181 gflag |= 8 | 32; 02182 break; 02183 case CLASS_MECH: 02184 if(MechIsQuad(mech)) 02185 strcpy(tmpbuf, quaddesc); 02186 #ifdef WEIGHTVARIABLE_STATUS 02187 else { 02188 if(MechTons(mech) <= 35) 02189 strcpy(tmpbuf, lightmechdesc); 02190 else if(MechTons(mech) > 35 && MechTons(mech) <= 55) 02191 strcpy(tmpbuf, mediummechdesc); 02192 else if(MechTons(mech) > 55 && MechTons(mech) <= 75) 02193 strcpy(tmpbuf, heavymechdesc); 02194 else if(MechTons(mech) > 75) 02195 strcpy(tmpbuf, assaultmechdesc); 02196 else 02197 strcpy(tmpbuf, heavymechdesc); 02198 } 02199 #else /* WEIGHTVARIABLE_STATUS */ 02200 else 02201 strcpy(tmpbuf, mechdesc); 02202 #endif /* WEIGHTVARIABLE_STATUS */ 02203 break; 02204 case CLASS_BSUIT: 02205 strcpy(tmpbuf, bsuitdesc); 02206 break; 02207 case CLASS_VTOL: 02208 strcpy(tmpbuf, vtoldesc); 02209 break; 02210 case CLASS_AERO: 02211 gflag |= 16; 02212 strcpy(tmpbuf, aerodesc); 02213 break; 02214 case CLASS_DS: 02215 strcpy(tmpbuf, aerod_ds_desc); 02216 gflag |= 64; 02217 break; 02218 case CLASS_SPHEROID_DS: 02219 strcpy(tmpbuf, spher_ds_desc); 02220 break; 02221 case CLASS_VEH_GROUND: 02222 if(GetSectOInt(mech, TURRET)) 02223 strcpy(tmpbuf, vehdesc); 02224 else 02225 strcpy(tmpbuf, veh_not_desc); 02226 break; 02227 case CLASS_VEH_NAVAL: 02228 if(MechMove(mech) == MOVE_FOIL) 02229 strcpy(tmpbuf, foildesc); 02230 else if(MechMove(mech) == MOVE_HULL) 02231 strcpy(tmpbuf, shipdesc); 02232 else 02233 strcpy(tmpbuf, subdesc); 02234 break; 02235 default: 02236 strcpy(tmpbuf, 02237 " This 'toy' is of unknown type. It has yet to be templated\n for status.\n0"); 02238 break; 02239 } 02240 } 02241 p = strtok(tmpbuf, "\n"); 02242 while (p && *p != '0') { 02243 if(*p >= '1' && *p <= '7') 02244 strcpy(destbuf, ArmorKeyInfo(player, (int) *p - '0', owner)); 02245 else 02246 destbuf[0] = 0; 02247 r = &destbuf[strlen(destbuf)]; 02248 for(q = p + 1; *q; q++) 02249 if(*q == '@' && isdigit(*(q + 1))) { 02250 q++; 02251 if(GetSectInt(mech, (int) (*q - '0'))) 02252 *r++ = *(q + 1); 02253 else 02254 *r++ = ' '; 02255 q++; 02256 } else if(*q == '!' && isdigit(*(q + 1)) && isdigit(*(q + 2))) { 02257 q++; 02258 if(GetSectInt(mech, (int) (*q - '0')) || 02259 GetSectInt(mech, (int) (*(q + 1) - '0'))) 02260 *r++ = *(q + 2); 02261 else 02262 *r++ = ' '; 02263 q++; 02264 q++; 02265 } else if(*q == '&' && (*(q + 1) == '+' || *(q + 1) == '-' || 02266 *(q + 1) == ':' || *(q + 1) == '(' || 02267 *(q + 1) == ')' || *(q + 1) == 'S')) { 02268 if(*(q + 1) == '(') { 02269 gflag |= 8; 02270 q++; 02271 odd = 1; 02272 } 02273 if(*(q + 1) == ')') { 02274 gflag |= 128; 02275 q++; 02276 odd = 1; 02277 } 02278 if(*(q + 1) == 'S') { 02279 gflag |= 256; 02280 q++; 02281 odd = 1; 02282 } 02283 /* Geez, we got armor token to distribute here. */ 02284 flag = owner; 02285 q++; 02286 switch (*q) { 02287 case '-': 02288 flag += 2; 02289 case ':': 02290 flag += 2; 02291 break; 02292 } 02293 strcpy(r, show_armor(mech, (int) (*(q + 1) - '0'), 02294 flag | gflag)); 02295 r += strlen(r); 02296 if(odd) { 02297 gflag = 0; 02298 odd = 0; 02299 } 02300 q++; 02301 } else 02302 *r++ = *q; 02303 *r = 0; 02304 notify(player, destbuf); 02305 p = strtok(NULL, "\n"); 02306 } 02307 }
Definition at line 125 of file mech.status.c.
References A_MECHNAME, A_MECHREF, CLASS_AERO, CLASS_BSUIT, CLASS_DS, CLASS_MECH, CLASS_MW, CLASS_SPHEROID_DS, CLASS_VEH_GROUND, CLASS_VEH_NAVAL, CLASS_VTOL, DFA_ATTACK, Fallen, FindObjectsData(), FlyingT, GetBSuitName(), getMech(), GetMechToMechID(), GetSectInt, is_aero, Jumping, JumpSpeedMP, Landed, MECH::mapindex, Mech_ShowFlags(), MechChargeTarget, MechDFATarget, MechGoingX, MechGoingY, MechIDS(), MechMaxSuits, MechMove, MechPilot, MechPilotStatus, MechStatus, MechTankCritStatus, MechTons, MechType, MechType_Name, MechType_Ref, MMaxSpeed, MOVE_FLY, MOVE_FOIL, MOVE_HOVER, MOVE_HULL, MOVE_NONE, MOVE_SUB, MOVE_TRACK, MOVE_VTOL, MOVE_WHEEL, Name(), notify, notify_printf(), show_miscbrands(), silly_atr_get(), Started, TURRET, TURRET_JAMMED, and TURRET_LOCKED.
Referenced by mech_status().
00126 { 00127 MECH *tempMech = NULL; 00128 MAP *map = FindObjectsData(mech->mapindex); 00129 char buff[100]; 00130 char mech_name[100]; 00131 char mech_ref[100]; 00132 char move_type[50]; 00133 00134 strcpy(mech_name, 00135 usex ? MechType_Name(mech) : silly_atr_get(mech->mynum, 00136 A_MECHNAME)); 00137 strcpy(mech_ref, 00138 usex ? MechType_Ref(mech) : silly_atr_get(mech->mynum, A_MECHREF)); 00139 00140 switch (MechType(mech)) { 00141 case CLASS_MW: 00142 notify_printf(player, "MechWarrior: %-18.18s ID:[%s]", 00143 Name(player), MechIDS(mech, 0)); 00144 notify_printf(player, "MaxSpeed: %3d", (int) MMaxSpeed(mech)); 00145 break; 00146 case CLASS_BSUIT: 00147 sprintf(buff, "%s Name: %-18.18s ID:[%s] %s Reference: %s", 00148 GetBSuitName(mech), mech_name, MechIDS(mech, 0), 00149 GetBSuitName(mech), mech_ref); 00150 notify(player, buff); 00151 notify_printf(player, 00152 "MaxSpeed: %3d JumpRange: %d", 00153 (int) MMaxSpeed(mech), JumpSpeedMP(mech, map)); 00154 show_miscbrands(mech, player); 00155 if(MechPilot(mech) == -1) 00156 notify(player, "Leader: NONE"); 00157 else { 00158 sprintf(buff, "%s Leader Name: %-16.16s %s Leader injury: %d", 00159 GetBSuitName(mech), Name(MechPilot(mech)), 00160 GetBSuitName(mech), MechPilotStatus(mech)); 00161 notify(player, buff); 00162 } 00163 00164 sprintf(buff, "Max Suits: %d", MechMaxSuits(mech)); 00165 notify(player, buff); 00166 00167 Mech_ShowFlags(player, mech, 0, 0); 00168 00169 if(Jumping(mech)) { 00170 sprintf(buff, "JUMPING --> %3d,%3d", MechGoingX(mech), 00171 MechGoingY(mech)); 00172 if((MechStatus(mech) & DFA_ATTACK) && MechDFATarget(mech) != -1) { 00173 tempMech = getMech(MechDFATarget(mech)); 00174 sprintf(buff + strlen(buff), 00175 " Death From Above Target: %s", 00176 GetMechToMechID(mech, tempMech)); 00177 } 00178 notify(player, buff); 00179 } 00180 break; 00181 case CLASS_MECH: 00182 sprintf(buff, "Mech Name: %-18.18s ID:[%s] Mech Reference: %s", 00183 mech_name, MechIDS(mech, 0), mech_ref); 00184 notify(player, buff); 00185 notify_printf(player, 00186 "Tonnage: %3d MaxSpeed: %3d JumpRange: %d", 00187 MechTons(mech), (int) MMaxSpeed(mech), JumpSpeedMP(mech, 00188 map)); 00189 show_miscbrands(mech, player); 00190 if(MechPilot(mech) == -1) 00191 notify(player, "Pilot: NONE"); 00192 else { 00193 sprintf(buff, "Pilot Name: %-28.28s Pilot Injury: %d", 00194 Name(MechPilot(mech)), MechPilotStatus(mech)); 00195 notify(player, buff); 00196 } 00197 Mech_ShowFlags(player, mech, 0, 0); 00198 if(!Jumping(mech) && !Fallen(mech) && Started(mech) && 00199 (MechChargeTarget(mech) != -1)) { 00200 tempMech = getMech(MechChargeTarget(mech)); 00201 if(tempMech) { 00202 sprintf(buff, "CHARGING --> %s", GetMechToMechID(mech, 00203 tempMech)); 00204 notify(player, buff); 00205 } 00206 } 00207 if(Jumping(mech)) { 00208 sprintf(buff, "JUMPING --> %3d,%3d", MechGoingX(mech), 00209 MechGoingY(mech)); 00210 if((MechStatus(mech) & DFA_ATTACK) && MechDFATarget(mech) != -1) { 00211 tempMech = getMech(MechDFATarget(mech)); 00212 sprintf(buff + strlen(buff), 00213 " Death From Above Target: %s", 00214 GetMechToMechID(mech, tempMech)); 00215 } 00216 notify(player, buff); 00217 } 00218 break; 00219 case CLASS_VTOL: 00220 case CLASS_VEH_GROUND: 00221 case CLASS_VEH_NAVAL: 00222 case CLASS_AERO: 00223 case CLASS_DS: 00224 case CLASS_SPHEROID_DS: 00225 switch (MechMove(mech)) { 00226 case MOVE_TRACK: 00227 strcpy(move_type, "Tracked"); 00228 break; 00229 case MOVE_WHEEL: 00230 strcpy(move_type, "Wheeled"); 00231 break; 00232 case MOVE_HOVER: 00233 strcpy(move_type, "Hover"); 00234 break; 00235 case MOVE_VTOL: 00236 strcpy(move_type, "VTOL"); 00237 break; 00238 case MOVE_FLY: 00239 strcpy(move_type, "Flight"); 00240 break; 00241 case MOVE_HULL: 00242 strcpy(move_type, "Displacement Hull"); 00243 break; 00244 case MOVE_SUB: 00245 strcpy(move_type, "Submarine"); 00246 break; 00247 case MOVE_FOIL: 00248 strcpy(move_type, "Hydrofoil"); 00249 break; 00250 default: 00251 strcpy(move_type, "Magic"); 00252 break; 00253 } 00254 if(MechMove(mech) != MOVE_NONE) { 00255 sprintf(buff, 00256 "Vehicle Name: %-15.15s ID:[%s] Vehicle Reference: %s", 00257 mech_name, MechIDS(mech, 0), mech_ref); 00258 notify(player, buff); 00259 sprintf(buff, 00260 "Tonnage: %3d %s: %3d Movement Type: %s", 00261 MechTons(mech), 00262 is_aero(mech) ? "Max thrust" : "FlankSpeed", 00263 (int) MMaxSpeed(mech), move_type); 00264 notify(player, buff); 00265 show_miscbrands(mech, player); 00266 if(MechPilot(mech) == -1) 00267 notify(player, "Pilot: NONE"); 00268 else { 00269 sprintf(buff, "Pilot Name: %-28.28s Pilot Injury: %d", 00270 Name(MechPilot(mech)), MechPilotStatus(mech)); 00271 notify(player, buff); 00272 } 00273 } else { 00274 sprintf(buff, "Name: %-15.15s ID:[%s] Reference: %s", 00275 mech_name, MechIDS(mech, 0), mech_ref); 00276 notify(player, buff); 00277 } 00278 if(MechType(mech) != CLASS_VTOL && !is_aero(mech)) 00279 if(GetSectInt(mech, TURRET)) { 00280 if(MechTankCritStatus(mech) & TURRET_JAMMED) 00281 notify(player, " TURRET JAMMED"); 00282 else if(MechTankCritStatus(mech) & TURRET_LOCKED) 00283 notify(player, " TURRET LOCKED"); 00284 } 00285 if(FlyingT(mech) && Landed(mech)) 00286 notify(player, "LANDED"); 00287 Mech_ShowFlags(player, mech, 0, 0); 00288 } 00289 }
Definition at line 439 of file mech.status.c.
References MakeHeatScaleInfo(), and notify.
Referenced by mech_status(), and PrintInfoStatus().
00440 { 00441 char subbuff[256]; 00442 char buff[256]; 00443 char heatstr[9] = ".:::::::"; 00444 00445 MakeHeatScaleInfo(mech, heatstr, subbuff, 256); 00446 snprintf(buff, 256, "Temp:%s", subbuff); 00447 notify(player, buff); 00448 }
Definition at line 450 of file mech.status.c.
References AeroFreeFuel, AeroFuel, AeroFuelOrig, CLASS_AERO, CLASS_BSUIT, CLASS_DS, CLASS_MECH, CLASS_MW, CLASS_SPHEROID_DS, CLASS_VEH_GROUND, CLASS_VEH_NAVAL, CLASS_VTOL, DisplayTarget(), FlyingT, getMech(), GetMechToMechID(), is_aero, LateralDesc(), MAX, MechActiveNumsinks, MechCarrying, MechDesiredAngle, MechDesiredFacing, MechDesiredSpeed, MechFacing, MechHasHeat, MechHeat, MechLateral, MechMinusHeat, MechMove, MechPlusHeat, MechSpeed, MechType, MechVerticalSpeed, MechX, MechY, MechZ, MOVE_NONE, MOVE_SUB, notify, notify_printf(), PrintHeatBar(), ShowTurretFacing(), and tprintf().
Referenced by mech_status().
00451 { 00452 char buff[256]; 00453 MECH *tempMech; 00454 int f; 00455 00456 switch (MechType(mech)) { 00457 case CLASS_MECH: 00458 snprintf(buff, 256, 00459 "X, Y, Z:%3d,%3d,%3d Excess Heat: %3d deg C. Heat Production: %3d deg C.", 00460 MechX(mech), MechY(mech), MechZ(mech), 00461 (int) (10. * MechHeat(mech)), 00462 (int) (10. * MechPlusHeat(mech))); 00463 notify(player, buff); 00464 snprintf(buff, 256, 00465 "Speed: %%ch%%cg%3d%%cn KPH Heading: %%ch%%cg%3d%%cn deg Heat Sinks: %3d", 00466 (int) (MechSpeed(mech)), MechFacing(mech), 00467 MechActiveNumsinks(mech)); 00468 notify(player, buff); 00469 sprintf(buff, 00470 "Des. Speed: %3d KPH Des. Heading: %3d deg Heat Dissipation: %3d deg C.", 00471 (int) MechDesiredSpeed(mech), MechDesiredFacing(mech), 00472 (int) (10. * MechMinusHeat(mech))); 00473 notify(player, buff); 00474 00475 if(MechLateral(mech)) 00476 notify_printf(player, "You are moving laterally %s", 00477 LateralDesc(mech)); 00478 break; 00479 case CLASS_VEH_GROUND: 00480 case CLASS_VEH_NAVAL: 00481 case CLASS_VTOL: 00482 case CLASS_AERO: 00483 case CLASS_DS: 00484 case CLASS_SPHEROID_DS: 00485 snprintf(buff, 256, 00486 "X, Y, Z:%3d,%3d,%3d Heat Sinks: %3d %s", 00487 MechX(mech), MechY(mech), MechZ(mech), 00488 MechActiveNumsinks(mech), 00489 is_aero(mech) ? tprintf("%s angle: %%ch%%cg%d%%cn", 00490 MechDesiredAngle(mech) >= 00491 0 ? "Climbing" : "Diving", 00492 abs(MechDesiredAngle(mech))) : ""); 00493 notify(player, buff); 00494 if(FlyingT(mech) || MechMove(mech) == MOVE_SUB) { 00495 sprintf(buff, 00496 "Speed: %%ch%%cg%3d%%cn KPH Vertical Speed: %%ch%%cg%3d%%cn KPH Des. Speed %3d KPH", 00497 (int) (MechSpeed(mech)), (int) (MechVerticalSpeed(mech)), 00498 (int) (MechDesiredSpeed(mech))); 00499 notify(player, buff); 00500 f = MAX(0, AeroFuel(mech)); 00501 if(MechMove(mech) == MOVE_SUB) { 00502 sprintf(buff, "Heading: %3d KPH Des. Heading: %3d deg", 00503 (int) MechFacing(mech), MechDesiredFacing(mech)); 00504 } else if(AeroFreeFuel(mech)) { 00505 sprintf(buff, 00506 "Heading: %%ch%%cg%3d%%cn deg Des. Heading: %3d deg Fuel: Unlimited", 00507 MechFacing(mech), MechDesiredFacing(mech)); 00508 } else { 00509 sprintf(buff, 00510 "Heading: %%ch%%cg%3d%%cn deg Des. Heading: %3d deg Fuel: %d (%.2f %%)", 00511 MechFacing(mech), MechDesiredFacing(mech), f, 00512 100.0 * f / AeroFuelOrig(mech)); 00513 } 00514 00515 notify(player, buff); 00516 } else if(MechMove(mech) != MOVE_NONE) { 00517 sprintf(buff, 00518 "Speed: %%ch%%cg%3d%%cn KPH Heading: %%ch%%cg%3d%%cn deg", 00519 (int) (MechSpeed(mech)), MechFacing(mech)); 00520 notify(player, buff); 00521 sprintf(buff, "Des. Speed: %3d KPH Des. Heading: %3d deg", 00522 (int) MechDesiredSpeed(mech), MechDesiredFacing(mech)); 00523 notify(player, buff); 00524 00525 } 00526 ShowTurretFacing(player, 0, mech); 00527 if(MechHasHeat(mech)) { 00528 notify_printf(player, "Excess Heat:%3d deg Heat Production: %3d deg Heat Dissipation: %3d deg", 00529 (int) (10. * MechHeat(mech)), (int) (10. * MechPlusHeat(mech)), 00530 (int) (10. * MechMinusHeat(mech))); 00531 } 00532 break; 00533 case CLASS_MW: 00534 case CLASS_BSUIT: 00535 sprintf(buff, 00536 "X, Y, Z:%3d,%3d,%3d Speed: %%ch%%cg%3d%%cn KPH Heading: %%ch%%cg%3d%%cn deg", 00537 MechX(mech), MechY(mech), MechZ(mech), 00538 (int) (MechSpeed(mech)), MechFacing(mech)); 00539 notify(player, buff); 00540 sprintf(buff, 00541 " Des. Speed: %3d KPH Des. Heading: %3d deg", 00542 (int) MechDesiredSpeed(mech), MechDesiredFacing(mech)); 00543 notify(player, buff); 00544 break; 00545 } 00546 00547 if(MechHasHeat(mech)) { 00548 PrintHeatBar(player, mech); 00549 00550 // Little extra space to preserve formatting. 00551 // if(MechTarget(mech) == -1 && MechTargX(mech) == -1) 00552 // notify(player, " "); 00553 } 00554 notify(player, " "); 00555 // Show our locked target info (hex or unit). 00556 DisplayTarget(player, mech); 00557 00558 if(MechCarrying(mech) > 0) 00559 if((tempMech = getMech(MechCarrying(mech)))) 00560 notify_printf(player, "Towing %s.", GetMechToMechID(mech, 00561 tempMech)); 00562 }
Definition at line 291 of file mech.status.c.
References AcceptableDegree(), CLASS_AERO, CLASS_DS, CLASS_MECH, CLASS_SPHEROID_DS, CLASS_VEH_GROUND, CLASS_VEH_NAVAL, CLASS_VTOL, DisplayTarget(), GetSectOInt, getStatusString(), MechActiveNumsinks, MechDesiredAngle, MechDesiredFacing, MechDesiredSpeed, MechFacing, MechMinusHeat, MechMove, MechPlusHeat, MechSpeed, MechTurretFacing, MechType, MechVerticalSpeed, MechX, MechY, MechZ, MOVE_FOIL, notify, and TURRET.
Referenced by mech_status().
00292 { 00293 char buff[100]; 00294 char typespecific[50]; 00295 00296 switch (MechType(mech)) { 00297 case CLASS_VTOL: 00298 sprintf(typespecific, " VSPD: %3.1f ", MechVerticalSpeed(mech)); 00299 break; 00300 case CLASS_MECH: 00301 sprintf(typespecific, " HT: %3d/%3d/%-3d ", 00302 (int) (10. * MechPlusHeat(mech)), 00303 (int) (10. * MechActiveNumsinks(mech)), (int) (10. * MechMinusHeat(mech))); 00304 break; 00305 case CLASS_AERO: 00306 case CLASS_DS: 00307 case CLASS_SPHEROID_DS: 00308 sprintf(typespecific, " VSPD: %3.1f ANG: %2d HT: %3d/%3d ", 00309 MechVerticalSpeed(mech), MechDesiredAngle(mech), 00310 (int) (10 * MechPlusHeat(mech)), 00311 (int) (10 * MechActiveNumsinks(mech))); 00312 break; 00313 case CLASS_VEH_NAVAL: 00314 if(MechMove(mech) == MOVE_FOIL) 00315 sprintf(typespecific, " VSPD: %3.1f ", MechVerticalSpeed(mech)); 00316 /* FALLTHROUGH */ 00317 case CLASS_VEH_GROUND: 00318 /* XXX This won't work for subs with turrets.. are they possible ? */ 00319 if(GetSectOInt(mech, TURRET)) { 00320 sprintf(typespecific, " TUR: %3d ", 00321 AcceptableDegree(MechTurretFacing(mech) + 00322 MechFacing(mech))); 00323 break; 00324 } 00325 /* FALLTHROUGH */ 00326 default: 00327 typespecific[0] = '\0'; 00328 break; 00329 } 00330 00331 snprintf(buff, 100, 00332 "LOC: %3d,%3d,%3d HD: %3d/%3d SP: %3.1f/%3.1f %s ST:%s", 00333 MechX(mech), MechY(mech), MechZ(mech), MechFacing(mech), 00334 MechDesiredFacing(mech), MechSpeed(mech), MechDesiredSpeed(mech), 00335 typespecific, getStatusString(mech, 2)); 00336 buff[99] = '\0'; 00337 notify(player, buff); 00338 DisplayTarget(player, mech); 00339 }
Definition at line 1166 of file mech.status.c.
References AA_TECH, AMS_ENABLED, ANGEL_ECM_TECH, AngelECCMEnabled, AngelECMActive, AngelECMEnabled, AnyECMDisturbed, ArmorStringFromIndex(), BEAGLE_PROBE_TECH, BLOODHOUND_PROBE_TECH, C3Destroyed, C3iDestroyed, CAN_JETTISON_TECH, CargoSpace, CarMaxTon, CARRIER_TECH, CLASS_BSUIT, CLASS_MECH, CLASS_VEH_GROUND, CLASS_VTOL, countDamagedSlotsFromCrit(), CS_PURIFIER_STEALTH_TECH, DC_KAGE_STEALTH_TECH, doweird, ECCMEnabled, ECM_DESTROYED, ECM_TECH, ECMActive, ECMCountered, ECMEnabled, evaluate_ammo_amount(), FAIL_AMMOJAMMED, FAIL_DESTROYED, FAIL_DUD, FAIL_EMPTY, FAIL_JAMMED, FAIL_SHORTED, FC_INFILTRATOR_STEALTH_TECH, FC_INFILTRATORII_STEALTH_TECH, FindAmmunition(), FindWeapons, FLIPPED_ARMS, FSIDE, FWL_ACHILEUS_STEALTH_TECH, getMech(), GetMechToMechID(), GetPartFireMode, GetSectInt, GetWeaponAmmoModeLetter(), GetWeaponAmmoModeLetter_Model_Mode(), GetWeaponFireModeLetter(), HasC3, HasC3i, HasC3m, HasC3s, hasPhysical(), HasTAG, HasWorkingAngelECMSuite, INF_ANTILEG_TECH, INF_MOUNT_TECH, INF_SWARM_TECH, IS_JETTISONED_MODE, IsAMS, isTAGDestroyed(), LARM, LLEG, MASC_ENABLED, MASC_TECH, MAX_WEAPS_SECTION, MBUF_SIZE, MechC3iNetworkSize, MechC3NetworkSize, MechCritStatus, MechHeat, MechInfantrySpecials, MechIsQuad, MechMASCCounter, MechMove, MechSChargeCounter, MechSections, MechSpecials, MechSpecials2, MechStatus, MechStatus2, MechType, MechWeapons, MUST_JETTISON_TECH, name, notify, NULLSIGSYS_TECH, NullSigSysActive, NullSigSysDest, NUM_BSUIT_MEMBERS, NUM_SECTIONS, ON_TC, OS_MODE, OS_USED, PartIsBroken, PartIsDisabled, PartTempNuke, PerECCMEnabled, PerECMActive, PerECMEnabled, PHY_AXE, PHY_MACE, PHY_SAW, PHY_SWORD, RARM, REAR_MOUNT, RLEG, ROCKET_FIRED, SCHARGE_ENABLED, SHOW, SHOWPHYSTATUS, SHOWSECTSTAT, SLITE_DEST, SLITE_ON, SLITE_TECH, STEALTH_ARMOR_TECH, StealthArmorActive, SUPERCHARGER_TECH, TaggedBy, TagRecycling, TAGTarget, TC_DESTROYED, tprintf(), TRIPLE_MYOMER_TECH, UpdateRecycling, WEAPON_TICK, weirdbuf, and WILL_JETTISON_MODE.
Referenced by mech_status(), and PrintEnemyStatus().
01167 { 01168 unsigned char weaparray[MAX_WEAPS_SECTION]; 01169 unsigned char weapdata[MAX_WEAPS_SECTION]; 01170 int critical[MAX_WEAPS_SECTION]; 01171 unsigned char ammoweap[8 * MAX_WEAPS_SECTION]; 01172 unsigned short ammo[8 * MAX_WEAPS_SECTION]; 01173 unsigned short ammomax[8 * MAX_WEAPS_SECTION]; 01174 unsigned int modearray[8 * MAX_WEAPS_SECTION]; 01175 char tmpbuf[MBUF_SIZE]; 01176 int count, ammoweapcount; 01177 int loop; 01178 int ii, i = 0; 01179 char weapname[80], *tmpc; 01180 char weapbuff[120]; 01181 char tempbuff[160]; 01182 char location[80]; 01183 char astrAmmoSpacer[52]; 01184 int running_sum = 0; 01185 short ammo_mode; 01186 01187 if((MechSpecials(mech) & ECM_TECH) || 01188 (MechSpecials2(mech) & STEALTH_ARMOR_TECH) || 01189 (MechSpecials2(mech) & NULLSIGSYS_TECH) || 01190 (MechSpecials(mech) & SLITE_TECH) || 01191 HasC3(mech) || 01192 HasC3i(mech) || 01193 (MechSpecials(mech) & MASC_TECH) || 01194 (MechSpecials2(mech) & SUPERCHARGER_TECH) || 01195 (MechSpecials(mech) & TRIPLE_MYOMER_TECH) || 01196 (MechSpecials2(mech) & ANGEL_ECM_TECH) || HasTAG(mech) || 01197 (MechInfantrySpecials(mech) & FC_INFILTRATORII_STEALTH_TECH)) { 01198 strcpy(tempbuff, "AdvTech: "); 01199 01200 if(MechSpecials(mech) & ECM_TECH) { 01201 sprintf(tempbuff + strlen(tempbuff), "ECM(%s) ", 01202 (MechStatus2(mech) & ECM_DESTROYED) ? "%ch%crXX%cn" 01203 : ECMEnabled(mech) ? (ECMActive(mech) ? "%ch%cgECM%cn" : 01204 "%ch%crECM%cn") : ECCMEnabled(mech) 01205 ? "%ch%cgECCM%cn" : ECMCountered(mech) ? "%crOff%cn" : 01206 "%cgOff%cn"); 01207 } 01208 01209 if(MechSpecials2(mech) & ANGEL_ECM_TECH) { 01210 sprintf(tempbuff + strlen(tempbuff), "AngelECM(%s) ", 01211 (!HasWorkingAngelECMSuite(mech)) ? "%ch%crXX%cn" 01212 : AngelECMEnabled(mech) ? (AngelECMActive(mech) ? 01213 "%ch%cgECM%cn" : 01214 "%ch%crECM%cn") : 01215 AngelECCMEnabled(mech) ? "%ch%cgECCM%cn" : 01216 ECMCountered(mech) ? "%crOff%cn" : "%cgOff%cn"); 01217 01218 } 01219 01220 if(MechInfantrySpecials(mech) & FC_INFILTRATORII_STEALTH_TECH) { 01221 sprintf(tempbuff + strlen(tempbuff), "PersonalECM(%s) ", 01222 PerECMEnabled(mech) ? (PerECMActive(mech) ? 01223 "%ch%cgECM%cn" : "%ch%crECM%cn") : 01224 PerECCMEnabled(mech) ? "%ch%cgECCM%cn" : 01225 ECMCountered(mech) ? "%crOff%cn" : "%cgOff%cn"); 01226 01227 } 01228 01229 if(MechSpecials2(mech) & STEALTH_ARMOR_TECH) { 01230 sprintf(tempbuff + strlen(tempbuff), "SthArmor(%s) ", 01231 (MechStatus2(mech) & ECM_DESTROYED) ? "%ch%crXX%cn" 01232 : StealthArmorActive(mech) ? "%ch%cgOn%cn" : "%cgRdy%cn"); 01233 } 01234 01235 if(MechSpecials2(mech) & NULLSIGSYS_TECH) { 01236 sprintf(tempbuff + strlen(tempbuff), "NullSigSys(%s) ", 01237 NullSigSysDest(mech) ? "%ch%crXX%cn" : 01238 NullSigSysActive(mech) ? "%ch%cgOn%cn" : "%cgRdy%cn"); 01239 } 01240 01241 if(MechSpecials(mech) & SLITE_TECH) { 01242 sprintf(tempbuff + strlen(tempbuff), "SLITE(%s) ", 01243 (MechCritStatus(mech) & SLITE_DEST) ? "%cr%chXX%cn" 01244 : (MechStatus2(mech) & SLITE_ON) ? "%ch%cgOn%cn" : 01245 "%cgOff%cn"); 01246 } 01247 01248 if(HasC3m(mech)) 01249 sprintf(tempbuff + strlen(tempbuff), "%sC3M%%cn ", 01250 C3Destroyed(mech) ? "%cr" : 01251 AnyECMDisturbed(mech) ? "%cy" : 01252 MechC3NetworkSize(mech) > 0 ? "%cg%ch" : "%cg"); 01253 01254 if(HasC3s(mech)) 01255 sprintf(tempbuff + strlen(tempbuff), "%sC3S%%cn ", 01256 C3Destroyed(mech) ? "%cr" : 01257 AnyECMDisturbed(mech) ? "%cy" : 01258 MechC3NetworkSize(mech) > 0 ? "%cg%ch" : "%cg"); 01259 01260 if(HasC3i(mech)) 01261 sprintf(tempbuff + strlen(tempbuff), "%sC3i%%cn ", 01262 C3iDestroyed(mech) ? "%cr" : 01263 AnyECMDisturbed(mech) ? "%cy" : 01264 MechC3iNetworkSize(mech) > 0 ? "%cg%ch" : "%cg"); 01265 01266 if(MechSpecials(mech) & TRIPLE_MYOMER_TECH) 01267 sprintf(tempbuff + strlen(tempbuff), "TSM(%s) ", 01268 ((MechHeat(mech) >= 9.0) ? "%ch%cgOn%cn" : "%cgOff%cn")); 01269 01270 if(HasTAG(mech)) { 01271 sprintf(tempbuff + strlen(tempbuff), "TAG(%s) ", 01272 isTAGDestroyed(mech) ? "%cr%chXX%cn" : 01273 ((getMech(TAGTarget(mech)) <= 0) || 01274 (TaggedBy(getMech(TAGTarget(mech))) != 01275 mech->mynum)) ? (TagRecycling(mech) ? 01276 "%cy%chNot Rdy%cn" : "%cgRdy%cn") : 01277 tprintf("%s%s%%cn", 01278 (TagRecycling(mech) ? "%cy%ch" : "%ch"), 01279 GetMechToMechID(mech, getMech(TAGTarget(mech))))); 01280 } 01281 01282 if(MechSpecials2(mech) & SUPERCHARGER_TECH) 01283 sprintf(tempbuff + strlen(tempbuff), "SCHARGE: %s%d%%cn (%s)", 01284 MechSChargeCounter(mech) > 01285 3 ? "%ch%cr" : MechSChargeCounter(mech) > 01286 0 ? "%ch%cy" : "%cg", MechSChargeCounter(mech), 01287 MechStatus(mech) & SCHARGE_ENABLED ? "On" : "Off"); 01288 01289 if(MechSpecials(mech) & MASC_TECH) 01290 sprintf(tempbuff + strlen(tempbuff), "MASC: %s%d%%cn (%s)", 01291 MechMASCCounter(mech) > 01292 3 ? "%ch%cr" : MechMASCCounter(mech) > 01293 0 ? "%ch%cy" : "%cg", MechMASCCounter(mech), 01294 MechStatus(mech) & MASC_ENABLED ? "On" : "Off"); 01295 01296 notify(player, tempbuff); 01297 tempbuff[0] = 0; 01298 } 01299 01300 if(MechSpecials2(mech) & CARRIER_TECH) { 01301 strcpy(tempbuff, "Carrier: "); 01302 01303 sprintf(tempbuff + strlen(tempbuff), 01304 "%d tons free, %d tons max unit size", 01305 (CargoSpace(mech) / 100), CarMaxTon(mech)); 01306 notify(player, tempbuff); 01307 tempbuff[0] = 0; 01308 } 01309 01310 if((MechSpecials(mech) & AA_TECH) || 01311 (MechSpecials(mech) & BEAGLE_PROBE_TECH) || 01312 (MechSpecials2(mech) & BLOODHOUND_PROBE_TECH)) { 01313 01314 strcpy(tempbuff, "AdvSensors:"); 01315 01316 if(MechSpecials(mech) & AA_TECH) 01317 sprintf(tempbuff + strlen(tempbuff), " Radar"); 01318 01319 if(MechSpecials(mech) & BEAGLE_PROBE_TECH) 01320 sprintf(tempbuff + strlen(tempbuff), " BeagleProbe"); 01321 01322 if(MechSpecials2(mech) & BLOODHOUND_PROBE_TECH) 01323 sprintf(tempbuff + strlen(tempbuff), " BloodhoundProbe"); 01324 01325 notify(player, tempbuff); 01326 tempbuff[0] = 0; 01327 } 01328 01329 if((MechInfantrySpecials(mech) & CS_PURIFIER_STEALTH_TECH) || 01330 (MechInfantrySpecials(mech) & DC_KAGE_STEALTH_TECH) || 01331 (MechInfantrySpecials(mech) & FWL_ACHILEUS_STEALTH_TECH) || 01332 (MechInfantrySpecials(mech) & FC_INFILTRATOR_STEALTH_TECH) || 01333 (MechInfantrySpecials(mech) & FC_INFILTRATORII_STEALTH_TECH)) { 01334 01335 strcpy(tempbuff, "AdvItems:"); 01336 01337 if(MechInfantrySpecials(mech) & CS_PURIFIER_STEALTH_TECH) 01338 sprintf(tempbuff + strlen(tempbuff), " PurifierStealth"); 01339 01340 if(MechInfantrySpecials(mech) & DC_KAGE_STEALTH_TECH) 01341 sprintf(tempbuff + strlen(tempbuff), " KageStealth"); 01342 01343 if(MechInfantrySpecials(mech) & FWL_ACHILEUS_STEALTH_TECH) 01344 sprintf(tempbuff + strlen(tempbuff), " AchileusStealth"); 01345 01346 if(MechInfantrySpecials(mech) & FC_INFILTRATOR_STEALTH_TECH) 01347 sprintf(tempbuff + strlen(tempbuff), " InfiltratorStealth"); 01348 01349 if(MechInfantrySpecials(mech) & FC_INFILTRATORII_STEALTH_TECH) 01350 sprintf(tempbuff + strlen(tempbuff), " InfiltratorIIStealth"); 01351 01352 notify(player, tempbuff); 01353 tempbuff[0] = 0; 01354 } 01355 01356 if((MechInfantrySpecials(mech) & INF_SWARM_TECH) || 01357 (MechInfantrySpecials(mech) & INF_MOUNT_TECH) || 01358 (MechInfantrySpecials(mech) & INF_ANTILEG_TECH) || 01359 (MechInfantrySpecials(mech) & CAN_JETTISON_TECH)) { 01360 01361 strcpy(tempbuff, "Special Actions:"); 01362 01363 if(MechInfantrySpecials(mech) & INF_MOUNT_TECH) 01364 sprintf(tempbuff + strlen(tempbuff), " MountFriends"); 01365 01366 if(MechInfantrySpecials(mech) & INF_SWARM_TECH) 01367 sprintf(tempbuff + strlen(tempbuff), " SwarmAttack"); 01368 01369 if(MechInfantrySpecials(mech) & INF_ANTILEG_TECH) 01370 sprintf(tempbuff + strlen(tempbuff), " AntiLegAttack"); 01371 01372 if(MechInfantrySpecials(mech) & CAN_JETTISON_TECH) 01373 sprintf(tempbuff + strlen(tempbuff), " BackPackJettison"); 01374 01375 notify(player, tempbuff); 01376 tempbuff[0] = 0; 01377 } 01378 01379 if(MechInfantrySpecials(mech) & MUST_JETTISON_TECH) { 01380 strcpy(tempbuff, 01381 "Requirements: Must jettison backpack before using special abilities or jumping"); 01382 notify(player, tempbuff); 01383 tempbuff[0] = 0; 01384 } 01385 #define SHOWSECTSTAT(a) \ 01386 (SectIsDestroyed(mech, a) ? "%ch%cx*****%c" : \ 01387 (MechSections(mech)[(a)].recycle > 0) ? \ 01388 tprintf("%-5d", (MechSections(mech)[(a)].recycle / WEAPON_TICK) \ 01389 + (MechSections(mech)[(a)].recycle%WEAPON_TICK)) : "%cgReady%c") 01390 01391 UpdateRecycling(mech); 01392 if(MechType(mech) == CLASS_MECH && !doweird) { 01393 tempbuff[0] = 0; 01394 01395 #define SHOWPHYSTATUS(a,b) \ 01396 (!canUsePhysical(mech,a,b) ? "%ch%crXX%c" : \ 01397 (MechSections(mech)[(a)].recycle > 0) ? \ 01398 tprintf("%-3d", (MechSections(mech)[(a)].recycle / WEAPON_TICK) + \ 01399 + (MechSections(mech)[(a)].recycle%WEAPON_TICK)) : "%cgRdy%c") 01400 01401 #define SHOW(part,loc) \ 01402 sprintf(tempbuff + strlen(tempbuff), "%s: %s ", part, loc) 01403 01404 SHOW(MechIsQuad(mech) ? "FLLEG" : "LARM", SHOWSECTSTAT(LARM)); 01405 SHOW(MechIsQuad(mech) ? "FRLEG" : "RARM", SHOWSECTSTAT(RARM)); 01406 SHOW(MechIsQuad(mech) ? "RLLEG" : "LLEG", SHOWSECTSTAT(LLEG)); 01407 SHOW(MechIsQuad(mech) ? "RRLEG" : "RLEG", SHOWSECTSTAT(RLEG)); 01408 01409 if(hasPhysical(mech, LARM, PHY_AXE)) 01410 SHOW("Axe[LA]", SHOWPHYSTATUS(LARM, PHY_AXE)); 01411 01412 if(hasPhysical(mech, RARM, PHY_AXE)) 01413 SHOW("Axe[RA]", SHOWPHYSTATUS(RARM, PHY_AXE)); 01414 01415 if(hasPhysical(mech, LARM, PHY_SWORD)) 01416 SHOW("Sword[LA]", SHOWPHYSTATUS(LARM, PHY_SWORD)); 01417 01418 if(hasPhysical(mech, RARM, PHY_SWORD)) 01419 SHOW("Sword[RA]", SHOWPHYSTATUS(RARM, PHY_SWORD)); 01420 01421 if(hasPhysical(mech, LARM, PHY_MACE)) 01422 SHOW("Mace[LA]", SHOWPHYSTATUS(LARM, PHY_MACE)); 01423 01424 if(hasPhysical(mech, RARM, PHY_MACE)) 01425 SHOW("Mace[RA]", SHOWPHYSTATUS(RARM, PHY_MACE)); 01426 01427 if(hasPhysical(mech, LARM, PHY_SAW)) 01428 SHOW("Saw[LA]", SHOWPHYSTATUS(LARM, PHY_SAW)); 01429 01430 if(hasPhysical(mech, RARM, PHY_SAW)) 01431 SHOW("Saw[RA]", SHOWPHYSTATUS(RARM, PHY_SAW)); 01432 01433 notify(player, tempbuff); 01434 01435 if(MechStatus(mech) & FLIPPED_ARMS) 01436 notify(player, "*** Mech arms are flipped into the rear arc ***"); 01437 } else if(MechType(mech) == CLASS_BSUIT && !doweird) { 01438 for(i = 0; i < NUM_BSUIT_MEMBERS; i++) 01439 if(GetSectInt(mech, i)) 01440 break; 01441 if(i < NUM_BSUIT_MEMBERS) { 01442 sprintf(tempbuff, "Team status (special attacks): %s", 01443 SHOWSECTSTAT(i)); 01444 notify(player, tempbuff); 01445 } 01446 01447 } else if(((MechType(mech) == CLASS_VEH_GROUND) || 01448 (MechType(mech) == CLASS_VTOL)) && !doweird) { 01449 01450 *tempbuff = 0; 01451 01452 if(MechSections(mech)[FSIDE].recycle) { 01453 sprintf(tempbuff + strlen(tempbuff), 01454 "Vehicle status (charge): %s", SHOWSECTSTAT(FSIDE)); 01455 } 01456 01457 if(*tempbuff) 01458 notify(player, tempbuff); 01459 } 01460 01461 ammoweapcount = FindAmmunition(mech, ammoweap, ammo, ammomax, modearray, 0); 01462 if(!doweird) { 01463 notify(player, 01464 "==================WEAPON SYSTEMS===========================AMMUNITION========"); 01465 if(MechType(mech) == CLASS_BSUIT) 01466 notify(player, 01467 "------ Weapon --------- [##] Holder ------ Status ||--- Ammo Type ---- Rounds"); 01468 else 01469 notify(player, 01470 "------ Weapon --------- [##] Location ---- Status ||--- Ammo Type ---- Rounds"); 01471 } 01472 for(loop = 0; loop < NUM_SECTIONS; loop++) { 01473 count = FindWeapons(mech, loop, weaparray, weapdata, critical); 01474 if(count <= 0) 01475 continue; 01476 ArmorStringFromIndex(loop, tempbuff, MechType(mech), MechMove(mech)); 01477 sprintf(location, "%-14.14s", tempbuff); 01478 if(doweird) { 01479 strcpy(location, tempbuff); 01480 if((tmpc = strchr(location, ' '))) 01481 *tmpc = '_'; 01482 } 01483 for(ii = 0; ii < count; ii++) { 01484 if(IsAMS(weaparray[ii])) 01485 sprintf(weapbuff, " %-16.16s %c%c%c%c%c [%2d] ", 01486 &MechWeapons[weaparray[ii]].name[3], 01487 ' ', 01488 (MechStatus(mech) & AMS_ENABLED) ? ' ' : 'O', 01489 (MechStatus(mech) & AMS_ENABLED) ? 'O' : 'F', 01490 (MechStatus(mech) & AMS_ENABLED) ? 'N' : 'F', 01491 ' ', running_sum + ii); 01492 else { 01493 if(GetPartFireMode(mech, loop, critical[ii]) & OS_MODE) 01494 strcpy(tmpbuf, "OS "); 01495 else 01496 tmpbuf[0] = 0; 01497 strcat(tmpbuf, &MechWeapons[weaparray[ii]].name[3]); 01498 sprintf(weapbuff, " %-16.16s %c%c%c%c%c [%2d] ", tmpbuf, 01499 (GetPartFireMode(mech, loop, 01500 critical[ii]) & REAR_MOUNT) ? 'R' : 01501 ' ', 01502 (((GetPartFireMode(mech, loop, critical[ii]) & 01503 OS_USED) 01504 || (GetPartFireMode(mech, loop, critical[ii]) & 01505 ROCKET_FIRED)) ? '-' : (GetPartFireMode(mech, 01506 loop, 01507 critical 01508 [ii]) & 01509 OS_MODE) ? 'O' : ' '), 01510 GetWeaponAmmoModeLetter(mech, loop, critical[ii]), 01511 GetWeaponFireModeLetter(mech, loop, critical[ii]), 01512 ((GetPartFireMode(mech, loop, critical[ii]) & ON_TC) 01513 && (!(MechCritStatus(mech) & TC_DESTROYED))) ? 'T' 01514 : (GetPartFireMode(mech, loop, critical[ii]) & 01515 IS_JETTISONED_MODE) ? 'J' : (GetPartFireMode(mech, 01516 loop, 01517 critical 01518 [ii]) 01519 & WILL_JETTISON_MODE) 01520 ? 'P' : ' ', running_sum + ii); 01521 } 01522 if(doweird) 01523 sprintf(weirdbuf + strlen(weirdbuf), "%s|%s", 01524 &MechWeapons[weaparray[ii]].name[3], location); 01525 strcat(weapbuff, location); 01526 01527 if(PartIsBroken(mech, loop, critical[ii]) || 01528 PartTempNuke(mech, loop, critical[ii]) == FAIL_DESTROYED) 01529 strcat(weapbuff, "%ch%cx*****%c || "); 01530 else if(PartIsDisabled(mech, loop, critical[ii])) 01531 strcat(weapbuff, "%crDISABLE%c|| "); 01532 else if(PartTempNuke(mech, loop, critical[ii])) { 01533 switch (PartTempNuke(mech, loop, critical[ii])) { 01534 case FAIL_JAMMED: 01535 strcat(weapbuff, "%crJAMMED%c || "); 01536 break; 01537 case FAIL_SHORTED: 01538 strcat(weapbuff, "%crSHORTED%c|| "); 01539 break; 01540 case FAIL_EMPTY: 01541 strcat(weapbuff, " %crEMPTY%c || "); 01542 break; 01543 case FAIL_DUD: 01544 strcat(weapbuff, "%crDUD%c || "); 01545 break; 01546 case FAIL_AMMOJAMMED: 01547 strcat(weapbuff, "%crAMMOJAM%c|| "); 01548 break; 01549 } 01550 } else if(GetPartFireMode(mech, loop, 01551 critical[ii]) & ROCKET_FIRED) 01552 strcat(weapbuff, "%ch%cxEmpty%c || "); 01553 else if(weapdata[ii]) 01554 strcat(weapbuff, 01555 tprintf(" %2d || ", 01556 weapdata[ii] / WEAPON_TICK + 01557 (weapdata[ii] % WEAPON_TICK ? 1 : 0))); 01558 else if(countDamagedSlotsFromCrit(mech, loop, critical[ii])) 01559 strcat(weapbuff, "%crDAMAGED%c|| "); 01560 else 01561 strcat(weapbuff, "%cgReady%c || "); 01562 01563 if((ii + running_sum) < ammoweapcount) { 01564 ammo_mode = 01565 GetWeaponAmmoModeLetter_Model_Mode(ammoweap[ii + 01566 running_sum], 01567 modearray[ii + 01568 running_sum]); 01569 sprintf(weapname, "%-16.16s %c", 01570 &MechWeapons[ammoweap[ii + running_sum]].name[3], 01571 ammo_mode); 01572 sprintf(tempbuff, " %s%3d%s", 01573 evaluate_ammo_amount(ammo[ii + running_sum], 01574 ammomax[ii + running_sum]), 01575 ammo[ii + running_sum], "%cn"); 01576 strcat(weapname, tempbuff); 01577 if(doweird) { 01578 if(ammo_mode && ammo_mode != ' ') 01579 sprintf(weirdbuf + strlen(weirdbuf), "|%s|%d|%c ", 01580 &MechWeapons[ammoweap[ii + 01581 running_sum]].name[3], 01582 ammo[ii + running_sum], ammo_mode); 01583 else 01584 sprintf(weirdbuf + strlen(weirdbuf), "|%s|%d ", 01585 &MechWeapons[ammoweap[ii + 01586 running_sum]].name[3], 01587 ammo[ii + running_sum]); 01588 } 01589 } else { 01590 if(doweird) 01591 strcat(weirdbuf, " "); 01592 sprintf(weapname, " "); 01593 } 01594 strcat(weapbuff, weapname); 01595 if(!doweird) 01596 notify(player, weapbuff); 01597 } 01598 running_sum += count; 01599 } 01600 01601 if(running_sum < ammoweapcount) { 01602 while (running_sum < ammoweapcount) { 01603 strcpy(astrAmmoSpacer, 01604 " || "); 01605 ammo_mode = 01606 GetWeaponAmmoModeLetter_Model_Mode(ammoweap[running_sum], 01607 modearray[running_sum]); 01608 sprintf(weapname, "%-16.16s %c", 01609 &MechWeapons[ammoweap[running_sum]].name[3], ammo_mode); 01610 sprintf(tempbuff, " %s%3d%s", 01611 evaluate_ammo_amount(ammo[running_sum], 01612 ammomax[running_sum]), 01613 ammo[running_sum], "%cn"); 01614 strcat(astrAmmoSpacer, weapname); 01615 strcat(astrAmmoSpacer, tempbuff); 01616 01617 notify(player, astrAmmoSpacer); 01618 01619 /* 01620 if (doweird) { 01621 if (ammo_mode && ammo_mode != ' ') 01622 sprintf(weirdbuf + strlen(weirdbuf), "|%s|%d|%c ", 01623 &MechWeapons[ammoweap[running_sum]].name[3], ammo[running_sum], ammo_mode); 01624 else 01625 sprintf(weirdbuf + strlen(weirdbuf), "|%s|%d ", 01626 &MechWeapons[ammoweap[running_sum]].name[3], ammo[running_sum]); 01627 } 01628 */ 01629 running_sum++; 01630 } 01631 } 01632 }
char* show_armor | ( | MECH * | mech, | |
int | loc, | |||
int | flag | |||
) |
Definition at line 1739 of file mech.status.c.
References GetSectInt, PrintArmorDamageColor(), and PrintArmorDamageString().
Referenced by PrintArmorStatus().
01740 { 01741 static char foo[32]; 01742 01743 if(flag & 256) 01744 sprintf(foo, "%s%s%%c", PrintArmorDamageColor(mech, 0, flag), PrintArmorDamageString(mech, loc, flag)); 01745 else if(!GetSectInt(mech, loc) && !(flag & 64)) 01746 sprintf(foo, (flag & 32) ? " " : (flag & 128) ? " " : " "); 01747 else 01748 sprintf(foo, "%s%s%%c", PrintArmorDamageColor(mech, loc, flag), 01749 PrintArmorDamageString(mech, loc, flag)); 01750 return foo; 01751 }
Definition at line 120 of file mech.status.c.
Referenced by PrintGenericStatus().
00121 { 00122 /* notify(player, tprintf("Radio: %s (%3d range) Computer: %s (%d Scan / %d LRS / %d Tac)", brands[BOUNDED(1, MechRadio(mech), 5)+RADIO_INDEX].name, (int) MechRadioRange(mech), brands[BOUNDED(1, MechComputer(mech), 5)+COMPUTER_INDEX].name, (int) MechScanRange(mech), (int) MechLRSRange(mech), (int) MechTacRange(mech))); */ 00123 }
char* weaponstatus_func | ( | MECH * | mech, | |
char * | arg | |||
) |
Definition at line 954 of file mech.status.c.
References ArmorSectionFromString(), FindWeapons, get_parts_long_name(), GetPartBrand, GetPartType, GetSectOInt, GetWeaponCrits(), I2Weapon, MAX_WEAPS_SECTION, MBUF_SIZE, MechMove, MechType, MechWeapons, NUM_SECTIONS, PartIsNonfunctional, PartTempNuke, and Weapon2I.
Referenced by fun_btweaponstatus(), and fun_btweaponstatus_ref().
00955 { 00956 static char buffer[MBUF_SIZE]; 00957 int count, sect, loopsect, i, type, totalcount = 0; 00958 unsigned char weaparray[MAX_WEAPS_SECTION]; 00959 unsigned char weapdata[MAX_WEAPS_SECTION]; 00960 int criticals[MAX_WEAPS_SECTION]; 00961 00962 if(!arg) 00963 sect = -1; 00964 else if(!*arg) 00965 return "#-1 INVALID SECTION"; 00966 else if((sect = ArmorSectionFromString(MechType(mech), 00967 MechMove(mech), arg)) == -1 00968 || !GetSectOInt(mech, sect)) 00969 return "#-1 INVALID SECTION"; 00970 00971 buffer[0] = '\0'; 00972 for((sect == -1) ? (loopsect = 0) : (loopsect = sect); 00973 (sect == -1) ? (loopsect < NUM_SECTIONS) : (loopsect < sect + 1); 00974 loopsect++) { 00975 count = FindWeapons(mech, loopsect, weaparray, weapdata, criticals); 00976 for(i = 0; i < count; i++, totalcount++) { 00977 if(buffer[0]) 00978 sprintf(buffer, "%s,", buffer); 00979 type = Weapon2I(GetPartType(mech, loopsect, criticals[i])); 00980 sprintf(buffer, "%s%d|%s|%d|%d|%d|%d|%d|%d", buffer, 00981 totalcount, get_parts_long_name(I2Weapon(type), 00982 GetPartBrand(mech, 00983 loopsect, 00984 criticals 00985 [i])), 00986 GetWeaponCrits(mech, type), GetPartBrand(mech, loopsect, 00987 criticals[i]), 00988 MechWeapons[type].vrt, weapdata[i], 00989 MechWeapons[type].type, PartIsNonfunctional(mech, 00990 loopsect, 00991 criticals[i]) 00992 ? 2 : PartTempNuke(mech, loopsect, criticals[i]) ? 1 : 0); 00993 } 00994 } 00995 return buffer; 00996 }