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

#include "config.h"

Include dependency graph for p.mech.consistency.h:

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

Go to the source code of this file.

Functions

int susp_factor (MECH *mech)
int engine_weight (MECH *mech)
int mech_weight_sub_mech (dbref player, MECH *mech, int interactive)
int mech_weight_sub_veh (dbref player, MECH *mech, int interactive)
int mech_weight_sub (dbref player, MECH *mech, int interactive)
void mech_weight (dbref player, void *data, char *buffer)
void vehicle_int_check (MECH *mech, int noisy)
void mech_int_check (MECH *mech, int noisy)
int crit_weight (MECH *mech, int t)


Function Documentation

int crit_weight ( MECH mech,
int  t 
)

Definition at line 214 of file mech.consistency.c.

References ANGELECM, ARTEMIS_IV, AXE, BEAGLE_PROBE, BLOODHOUND_PROBE, C3_MASTER, C3_SLAVE, C3I, CASE, CLAN_TECH, CLASS_MECH, DUAL_SAW, ECM, GetWeaponCrits(), HEAT_SINK, HS_Size, IsAmmo, IsSpecial, IsWeapon, JUMP_JET, LAMEQUIP, MACE, MASC, MechSpecials, MechTons, MechType, MechWeapons, Special2I, SWORD, TAG, TARGETING_COMPUTER, Weapon2I, and weapon_struct::weight.

Referenced by mech_weight_sub_mech(), and mech_weight_sub_veh().

00215 {
00216         int cl;
00217 
00218         if(IsWeapon(t))
00219                 return MechWeapons[Weapon2I(t)].weight * 1024 / 100 /
00220                         GetWeaponCrits(mech, Weapon2I(t));
00221         if(IsAmmo(t))
00222                 return 512;
00223         if(!(IsSpecial(t)))
00224                 return 1024;
00225 
00226         t = Special2I(t);
00227         cl = MechSpecials(mech) & CLAN_TECH;
00228 
00229         switch (t) {
00230         case HEAT_SINK:
00231                 return 1024 / HS_Size(mech);
00232         case TARGETING_COMPUTER:
00233         case AXE:
00234         case MACE:
00235                 return 1024;
00236         case DUAL_SAW:
00237                 return 1024;
00238         case ARTEMIS_IV:
00239         case MASC:
00240         case C3_SLAVE:
00241         case TAG:
00242         case LAMEQUIP:
00243                 return 1024;
00244         case C3I:
00245                 return 1280 * (MechType(mech) == CLASS_MECH ? 1 : 2);
00246         case ANGELECM:
00247         case BLOODHOUND_PROBE:
00248                 return 1024 * (MechType(mech) == CLASS_MECH ? 1 : 2);
00249         case C3_MASTER:
00250                 return 1024 * (MechType(mech) == CLASS_MECH ? 1 : 5);
00251         case SWORD:
00252                 /* A Sword weighs 1/20th of the 'mech tonnage, rounded up to the half
00253                    ton, and is 1/15th (rounded up to int) number of crits. */
00254                 return (ceil(MechTons(mech) / 10.) * 512) /
00255                         (ceil(MechTons(mech) / 15.));
00256         case BEAGLE_PROBE:
00257                 return 1024 * 3 / (MechType(mech) == CLASS_MECH ? 4 : 2);
00258         case ECM:
00259                 /* IS ECM is 1.5 tons for 2 crits, Clan ECM 1 ton for 1 crit. */
00260                 return 1024 * (cl ? 4 : MechType(mech) == CLASS_MECH ? 3 : 6) / 4;
00261         case CASE:
00262                 return 512;
00263         case JUMP_JET:
00264                 if(MechTons(mech) <= 55)
00265                         return 512;
00266                 if(MechTons(mech) <= 85)
00267                         return 1024;
00268                 return 2048;
00269         default:
00270                 return 0;
00271         }
00272 }

int engine_weight ( MECH mech  ) 

void mech_int_check ( MECH mech,
int  noisy 
)

Definition at line 684 of file mech.consistency.c.

References CLASS_MECH, CLASS_VEH_GROUND, CLASS_VEH_NAVAL, CLASS_VTOL, GetSectOInt, int_data, MechTons, MechType, MechType_Ref, NUM_SECTIONS, real_int(), SendError, SetSectInt, SetSectOInt, tprintf(), and vehicle_int_check().

Referenced by load_template(), and TECHCOMMANDH().

00685 {
00686         int i, j, k;
00687 
00688         if(MechType(mech) != CLASS_MECH) {
00689                 if(MechType(mech) == CLASS_VEH_GROUND ||
00690                    MechType(mech) == CLASS_VTOL || MechType(mech) == CLASS_VEH_NAVAL)
00691                         vehicle_int_check(mech, noisy);
00692                 return;
00693         }
00694         for(i = 0; int_data[i][0] >= 0; i++)
00695                 if(MechTons(mech) == int_data[i][0])
00696                         break;
00697         if(int_data[i][0] < 0) {
00698                 if(noisy)
00699                         SendError(tprintf("VERY odd tonnage for #%d: %d.", mech->mynum,
00700                                                           MechTons(mech)));
00701                 return;
00702         }
00703         k = i;
00704         for(i = 0; i < NUM_SECTIONS; i++) {
00705                 if(GetSectOInt(mech, i) != (j = real_int(mech, i, k))) {
00706                         if(noisy)
00707                                 SendError(tprintf
00708                                                   ("Template %s / mech #%d: Invalid internals in loc %d (should be %d, are %d)",
00709                                                    MechType_Ref(mech), mech->mynum, i, j,
00710                                                    GetSectOInt(mech, i)));
00711                         SetSectOInt(mech, i, j);
00712                         SetSectInt(mech, i, j);
00713                 }
00714         }
00715 }

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

Definition at line 641 of file mech.consistency.c.

References mech_weight_sub().

00642 {
00643         MECH *mech = (MECH *) data;
00644 
00645         mech_weight_sub(player, mech, 1);
00646 }

int mech_weight_sub ( dbref  player,
MECH mech,
int  interactive 
)

Definition at line 629 of file mech.consistency.c.

References CLASS_MECH, CLASS_VEH_GROUND, CLASS_VEH_NAVAL, CLASS_VTOL, mech_weight_sub_mech(), mech_weight_sub_veh(), MechType, and notify.

Referenced by get_weight(), load_template(), mech_weight(), and mechrep_Rsavetemp2().

00630 {
00631         if(MechType(mech) == CLASS_MECH)
00632                 return mech_weight_sub_mech(player, mech, interactive);
00633         if(MechType(mech) == CLASS_VEH_GROUND ||
00634            MechType(mech) == CLASS_VTOL || MechType(mech) == CLASS_VEH_NAVAL)
00635                 return mech_weight_sub_veh(player, mech, interactive);
00636         if(interactive > 0)
00637                 notify(player, "Invalid vehicle type!");
00638         return 1;
00639 }

int mech_weight_sub_mech ( dbref  player,
MECH mech,
int  interactive 
)

Definition at line 347 of file mech.consistency.c.

References ADDENTRY, ADDENTRY_C, addline, ammo_weight(), AmmoMod, c, calc_ints(), CARGO_TECH, CargoSpace, CARRIER_TECH, CE_TECH, cent, CGYRO_TECH, CLAN_TECH, COMPI_TECH, crit_weight(), CTORSO, engine_weight(), ES_TECH, FF_TECH, get_parts_long_name(), GetMechID(), GetPartType, GetSectOInt, GetWeaponCrits(), HARDA_TECH, HDGYRO_TECH, HEAD, HEAT_SINK, HS_Efficiency, HS_Size, HVY_FF_ARMOR_TECH, ICE_TECH, IsAmmo, IsWeapon, KillCoolMenu(), LE_TECH, LT_FF_ARMOR_TECH, MAX, MBUF_SIZE, MechEngineSize, MechSpecials, MechSpecials2, MechTons, MechWeapons, MyGetSectOArmor, MyGetSectORArmor, MyMechNumOsinks, name, NUM_CRITICALS, NUM_ITEMS_M, NUM_SECTIONS, PLOC, REINFI_TECH, round_to_halfton(), ShowCoolMenu(), Special, STEALTH_ARMOR_TECH, total, tprintf(), vsi, Weapon2I, XL_TECH, XLGYRO_TECH, and XXL_TECH.

Referenced by mech_weight_sub().

00348 {
00349         int pile[NUM_ITEMS_M];
00350         int i, j, w, cl, id;
00351         int armor = 0, armor_o;
00352         int total = 0;
00353         coolmenu *c = NULL;
00354         int shs_size;
00355         int hs_eff;
00356         char buf[MBUF_SIZE];
00357         int ints_c, ints_tot;
00358         float gyro_calc = -1;
00359 
00360         bzero(pile, sizeof(pile));
00361         if(interactive > 0) {
00362                 addline();
00363                 cent(tprintf("Weight totals for %s", GetMechID(mech)));
00364                 addline();
00365         }
00366         calc_ints(mech, &ints_c, &ints_tot);
00367         for(i = 0; i < NUM_SECTIONS; i++) {
00368                 if(!GetSectOInt(mech, i))
00369                         continue;
00370                 armor += MyGetSectOArmor(mech, i);
00371                 armor += MyGetSectORArmor(mech, i);
00372                 PLOC(i)
00373                         for(j = 0; j < NUM_CRITICALS; j++)
00374                         if(interactive >= 0 || !IsAmmo(GetPartType(mech, i, j)))
00375                                 pile[GetPartType(mech, i, j)] += AmmoMod(mech, i, j);
00376         }
00377         shs_size = HS_Size(mech);
00378         hs_eff = HS_Efficiency(mech);
00379         cl = MechSpecials(mech) & CLAN_TECH;
00380 #define ADDENTRY(text,weight) \
00381     if (weight) { if (interactive>0) { addmenu(text);addmenu(tprintf("      %6.1f", (float) (weight) / 1024.0));}; total += weight; }
00382 #define ADDENTRY_C(text,count,weight) \
00383     if (weight) { if (interactive>0) { addmenu(text);addmenu(tprintf("%5d %6.1f", count, (float) (weight) / 1024.0)); }; total += weight; }
00384         sprintf(buf, "%-12s(%d rating)",
00385                         MechSpecials(mech) & XL_TECH ? "Engine (XL)" : MechSpecials(mech)
00386                         & XXL_TECH ? "Engine (XXL)" : MechSpecials(mech) & CE_TECH ?
00387                         "Engine (Compact)" : MechSpecials(mech) & LE_TECH ?
00388                         "Engine (Light)" : "Engine", MechEngineSize(mech));
00389         PLOC(CTORSO)
00390                 ADDENTRY(buf, engine_weight(mech));
00391         PLOC(HEAD)
00392                 ADDENTRY("Cockpit", 3 * 1024);
00393         PLOC(CTORSO)
00394                 /* Store the base-line gyro weight */
00395                 gyro_calc = (MechEngineSize(mech) / 100.0) * 1024;
00396 
00397         /* Figure out what kind of gyro we have and adjust weight accordingly */
00398         if(MechSpecials2(mech) & XLGYRO_TECH) {
00399                 /* XL Gyro is 1/2 normal gyro weight. */
00400                 ADDENTRY("Gyro (XL)", (int) ceil(gyro_calc * 0.5));
00401         } else if(MechSpecials2(mech) & HDGYRO_TECH) {
00402                 /* Hardened Gyro is 2x normal gyro weight. */
00403                 ADDENTRY("Gyro (Hardened)", (int) ceil(gyro_calc * 2));
00404         } else if(MechSpecials2(mech) & CGYRO_TECH) {
00405                 /* Compact Gyro is 1.5x normal gyro weight. */
00406                 ADDENTRY("Gyro (Compact)", (int) ceil(gyro_calc * 1.5));
00407         } else {
00408                 /* Standard Gyro. */
00409                 ADDENTRY("Gyro", (int) ceil(gyro_calc));
00410         }
00411 
00412         ADDENTRY(MechSpecials(mech) & REINFI_TECH ? "Internals (Reinforced)" :
00413                          MechSpecials(mech) & COMPI_TECH ? "Internals (Composite)" :
00414                          MechSpecials(mech) & ES_TECH ? "Internals (ES)" : "Internals",
00415                          round_to_halfton(MechTons(mech) * 1024 * (interactive >=
00416                                                                                                            0 ? ints_tot : ints_c)
00417                                                           / 5 / ints_tot /
00418                                                           (MechSpecials(mech) & REINFI_TECH ? 1
00419                                                            : (MechSpecials(mech) & (ES_TECH | COMPI_TECH))
00420                                                            ? 4 : 2)));
00421         armor_o = armor;
00422         if(MechSpecials(mech) & FF_TECH)
00423                 armor = armor * 50 / (cl ? 60 : 56);
00424         else if(MechSpecials2(mech) & HVY_FF_ARMOR_TECH)
00425                 armor = armor * 50 / 62;
00426         else if(MechSpecials2(mech) & LT_FF_ARMOR_TECH)
00427                 armor = armor * 50 / 53;
00428 
00429         ADDENTRY_C(MechSpecials2(mech) & STEALTH_ARMOR_TECH ? "Armor (Stealth)"
00430                            : MechSpecials2(mech) & HVY_FF_ARMOR_TECH ? "Armor (Hvy FF)" :
00431                            MechSpecials2(mech) & LT_FF_ARMOR_TECH ? "Armor (Lt FF)" :
00432                            MechSpecials(mech) & HARDA_TECH ? "Armor (Hardened)" :
00433                            MechSpecials(mech) & FF_TECH ? "Armor (FF)" : "Armor", armor_o,
00434                            ceil(armor /
00435                                         (8. * (MechSpecials(mech) & HARDA_TECH ? 2 : 1))) * 512);
00436 
00437         if(MyMechNumOsinks(mech)) {
00438                 pile[Special(HEAT_SINK)] =
00439                         MAX(0, MyMechNumOsinks(mech) * shs_size / hs_eff -
00440                                 (MechSpecials(mech) & ICE_TECH ? 0 : 10) * shs_size);
00441         } else if(interactive > 0)
00442                 cent(tprintf
00443                          ("WARNING: HS count may be off, due to certain odd things."));
00444         for(i = 1; i < NUM_ITEMS_M; i++)
00445                 if(pile[i]) {
00446                         if(IsWeapon(i)) {
00447                                 id = Weapon2I(i);
00448                                 ADDENTRY_C(MechWeapons[id].name,
00449                                                    pile[i] / GetWeaponCrits(mech, id),
00450                                                    crit_weight(mech, i) * pile[i]);
00451                         } else {
00452                                 if((w = crit_weight(mech, i)))
00453                                         ADDENTRY_C(get_parts_long_name(i, 0), pile[i],
00454                                                            w * pile[i]);
00455                         }
00456                 }
00457         if(CargoSpace(mech))
00458                 ADDENTRY(tprintf
00459                                  ("CargoSpace (%.2ft)", (float) CargoSpace(mech) / 100),
00460                                  (int) (((float) CargoSpace(mech) /
00461                                                  (MechSpecials2(mech) & CARRIER_TECH ? 1000 :
00462                                                   MechSpecials(mech) & CARGO_TECH ? 100 : 500)) *
00463                                                 1024));
00464 
00465         if(interactive > 0) {
00466                 addline();
00467                 vsi(tprintf("%%cgTotal: %s%.1f tons (offset: %.1f)%%cn",
00468                                         (total / 1024) > MechTons(mech) ? "%ch%cr" : "",
00469                                         (float) (total) / 1024.0,
00470                                         MechTons(mech) - (float) (total) / 1024.0));
00471                 addline();
00472                 ShowCoolMenu(player, c);
00473         }
00474         KillCoolMenu(c);
00475         if(interactive < 0)
00476                 total += ammo_weight(mech);
00477         return MAX(1, total);
00478 }

int mech_weight_sub_veh ( dbref  player,
MECH mech,
int  interactive 
)

Definition at line 490 of file mech.consistency.c.

References ADDENTRY, ADDENTRY_C, addline, ammo_weight(), AmmoMod, c, calc_ints(), CARGO_TECH, CargoSpace, CARRIER_TECH, CE_TECH, cent, CLAN_TECH, CLASS_VEH_GROUND, CLASS_VEH_NAVAL, CLASS_VTOL, COMPI_TECH, crit_weight(), CritsInLoc(), engine_weight(), ES_TECH, FF_TECH, get_parts_long_name(), GetMechID(), GetPartType, GetSectOInt, GetWeaponCrits(), HARDA_TECH, HEAT_SINK, HS_Efficiency, HS_Size, HVY_FF_ARMOR_TECH, ICE_TECH, IsAmmo, IsWeapon, KillCoolMenu(), LE_TECH, LT_FF_ARMOR_TECH, MAX, MBUF_SIZE, MechEngineSize, MechMove, MechRealNumsinks, MechSpecials, MechSpecials2, MechTons, MechType, MechWeapons, MOVE_HOVER, MOVE_HULL, MOVE_SUB, MyGetSectOArmor, MyGetSectORArmor, name, NUM_ITEMS_M, NUM_SECTIONS, PLOC, REINFI_TECH, round_to_halfton(), SectIsDestroyed, ShowCoolMenu(), Special, STEALTH_ARMOR_TECH, susp_factor(), tank_in_pieces(), total, tprintf(), TURRET, vsi, Weapon2I, XL_TECH, and XXL_TECH.

Referenced by mech_weight_sub().

00491 {
00492         int pile[NUM_ITEMS_M];
00493         int i, j, w, cl, id, t;
00494         int armor = 0, armor_o;
00495         int total = 0;
00496         coolmenu *c = NULL;
00497         int shs_size;
00498         int hs_eff;
00499         char buf[MBUF_SIZE];
00500         int es;
00501         int turr_stuff = 0;
00502         int ints_c, ints_tot;
00503 
00504         bzero(pile, sizeof(pile));
00505         calc_ints(mech, &ints_c, &ints_tot);
00506         if(interactive > 0) {
00507                 addline();
00508                 cent(tprintf("Weight totals for %s", GetMechID(mech)));
00509                 addline();
00510         }
00511         for(i = 0; i < NUM_SECTIONS; i++) {
00512                 if(!(GetSectOInt(mech, i)))
00513                         continue;
00514                 armor += MyGetSectOArmor(mech, i);
00515                 armor += MyGetSectORArmor(mech, i);
00516                 for(j = 0; j < CritsInLoc(mech, i); j++) {
00517                         if(!(t = GetPartType(mech, i, j)))
00518                                 continue;
00519                         if(interactive >= 0 || !SectIsDestroyed(mech, i)) {
00520                                 if(interactive >= 0 || !IsAmmo(t))
00521                                         pile[t] += AmmoMod(mech, i, j);
00522                                 if(i == TURRET && (MechType(mech) == CLASS_VEH_GROUND ||
00523                                                                    MechType(mech) == CLASS_VEH_NAVAL))
00524                                         if(IsWeapon(t))
00525                                                 turr_stuff += crit_weight(mech, t);
00526                         }
00527                 }
00528         }
00529         shs_size = HS_Size(mech);
00530         hs_eff = HS_Efficiency(mech);
00531         cl = MechSpecials(mech) & CLAN_TECH;
00532         es = susp_factor(mech);
00533         if(es)
00534                 sprintf(buf, "%-12s(%d->%d eff/wt rat)",
00535                                 MechSpecials(mech) & LE_TECH ? "Engine (Light)" :
00536                                 MechSpecials(mech) & CE_TECH ? "Engine (Compact)" :
00537                                 MechSpecials(mech) & XXL_TECH ? "Engine (XXL)" :
00538                                 MechSpecials(mech) & XL_TECH ? "Engine (XL)" :
00539                                 MechSpecials(mech) & ICE_TECH ? "Engine (ICE)" : "Engine",
00540                                 MechEngineSize(mech),
00541                                 MechEngineSize(mech) - susp_factor(mech));
00542         else
00543                 sprintf(buf, "%-12s(%d rating)",
00544                                 MechSpecials(mech) & LE_TECH ? "Engine (Light)" :
00545                                 MechSpecials(mech) & CE_TECH ? "Engine (Compact)" :
00546                                 MechSpecials(mech) & XXL_TECH ? "Engine (XXL)" :
00547                                 MechSpecials(mech) & XL_TECH ? "Engine (XL)" :
00548                                 MechSpecials(mech) & ICE_TECH ? "Engine (ICE)" : "Engine",
00549                                 MechEngineSize(mech));
00550         if(!tank_in_pieces(mech)) {
00551                 ADDENTRY(buf, (es = engine_weight(mech)));
00552                 if(MechMove(mech) == MOVE_HOVER && es < (MechTons(mech) * 1024 / 5))
00553                         ADDENTRY("Engine size fix (-> 1/5 hover wt.)",
00554                                          MechTons(mech) * 1024 / 5 - es);
00555                 ADDENTRY("Cockpit", round_to_halfton(MechTons(mech) * 1024 / 20));
00556                 if(MechType(mech) == CLASS_VTOL ||
00557                    MechMove(mech) == MOVE_HOVER || MechMove(mech) == MOVE_HULL ||
00558                    MechMove(mech) == MOVE_SUB)
00559                         ADDENTRY("SpecialComponents",
00560                                          round_to_halfton(MechTons(mech) * 1024 / 10));
00561         }
00562         PLOC(TURRET)
00563                 if(turr_stuff)
00564                 ADDENTRY("Turret", round_to_halfton(turr_stuff / 10));
00565         ADDENTRY(MechSpecials(mech) & REINFI_TECH ? "Internals (Reinforced)" :
00566                          MechSpecials(mech) & COMPI_TECH ? "Internals (Composite)" :
00567                          MechSpecials(mech) & ES_TECH ? "Internals (ES)" : "Internals",
00568                          round_to_halfton(MechTons(mech) * 1024 * (interactive >=
00569                                                                                                            0 ? ints_tot : ints_c)
00570                                                           / 5 / ints_tot /
00571                                                           (MechSpecials(mech) & REINFI_TECH ? 1
00572                                                            : (MechSpecials(mech) & (ES_TECH | COMPI_TECH))
00573                                                            ? 4 : 2)));
00574         armor_o = armor;
00575 
00576         if(MechSpecials(mech) & FF_TECH)
00577                 armor = armor * 50 / (cl ? 60 : 56);
00578         else if(MechSpecials2(mech) & HVY_FF_ARMOR_TECH)
00579                 armor = armor * 50 / 62;
00580         else if(MechSpecials2(mech) & LT_FF_ARMOR_TECH)
00581                 armor = armor * 50 / 53;
00582         else if(MechSpecials(mech) & HARDA_TECH)
00583                 armor *= 2;
00584 
00585         ADDENTRY_C(MechSpecials2(mech) & STEALTH_ARMOR_TECH ? "Armor (Stealth)"
00586                            : MechSpecials2(mech) & HVY_FF_ARMOR_TECH ? "Armor (Hvy FF)" :
00587                            MechSpecials2(mech) & LT_FF_ARMOR_TECH ? "Armor (Lt FF)" :
00588                            MechSpecials(mech) & HARDA_TECH ? "Armor (Hardened)" :
00589                            MechSpecials(mech) & FF_TECH ? "Armor (FF)" : "Armor", armor_o,
00590                            round_to_halfton(armor * 1024 / 16));
00591 
00592         pile[Special(HEAT_SINK)] =
00593                 MAX(0, MechRealNumsinks(mech) * shs_size / hs_eff -
00594                         (MechSpecials(mech) & ICE_TECH ? 0 : 10) * shs_size);
00595         for(i = 1; i < NUM_ITEMS_M; i++)
00596                 if(pile[i]) {
00597                         if(IsWeapon(i)) {
00598                                 id = Weapon2I(i);
00599                                 ADDENTRY_C(MechWeapons[id].name,
00600                                                    pile[i] / GetWeaponCrits(mech, id),
00601                                                    crit_weight(mech, i) * pile[i]);
00602                         } else if((w = crit_weight(mech, i)))
00603                                 ADDENTRY_C(get_parts_long_name(i, 0), pile[i], w * pile[i]);
00604                 }
00605         if(CargoSpace(mech))
00606                 ADDENTRY(tprintf
00607                                  ("CargoSpace (%.2ft)", (float) CargoSpace(mech) / 100),
00608                                  (int) (((float) CargoSpace(mech) /
00609                                                  (MechSpecials2(mech) & CARRIER_TECH ? 1000 :
00610                                                   MechSpecials(mech) & CARGO_TECH ? 100 : 500)) *
00611                                                 1024));
00612 
00613         if(interactive > 0) {
00614                 addline();
00615                 vsi(tprintf("%%cgTotal: %s%.1f tons (offset: %.1f)%%cn",
00616                                         (total / 1024) > MechTons(mech) ? "%ch%cr" : "",
00617                                         (float) (total) / 1024.0,
00618                                         MechTons(mech) - (float) (total) / 1024.0));
00619                 addline();
00620                 ShowCoolMenu(player, c);
00621         }
00622         KillCoolMenu(c);
00623         if(interactive < 0)
00624                 total += ammo_weight(mech);
00625         return MAX(1, total);
00626 }

int susp_factor ( MECH mech  ) 

Definition at line 166 of file mech.consistency.c.

References MechMove, MechTons, MOVE_FOIL, MOVE_HOVER, MOVE_HULL, MOVE_SUB, MOVE_TRACK, MOVE_VTOL, and MOVE_WHEEL.

Referenced by engine_weight(), fun_btengrate(), fun_btengrate_ref(), and mech_weight_sub_veh().

00167 {
00168         int t = MechTons(mech);
00169 
00170         if(MechMove(mech) == MOVE_TRACK)
00171                 return 0;
00172         if(MechMove(mech) == MOVE_WHEEL)
00173                 return 20;
00174 #define MAP(a,b) if (t <= a) return b
00175         if(MechMove(mech) == MOVE_FOIL) {
00176                 MAP(10, 60);
00177                 MAP(20, 105);
00178                 MAP(30, 150);
00179                 MAP(40, 195);
00180                 MAP(50, 255);
00181                 MAP(60, 300);
00182                 MAP(70, 345);
00183                 MAP(80, 390);
00184                 MAP(90, 435);
00185                 return 480;
00186         }
00187         if(MechMove(mech) == MOVE_HOVER) {
00188                 MAP(10, 40);
00189                 MAP(20, 85);
00190                 MAP(30, 130);
00191                 MAP(40, 175);
00192                 return 235;
00193         }
00194         if(MechMove(mech) == MOVE_HULL || MechMove(mech) == MOVE_SUB)
00195                 return 30;
00196         if(MechMove(mech) == MOVE_VTOL) {
00197                 MAP(10, 50);
00198                 MAP(20, 95);
00199                 return 140;
00200         }
00201         return 0;
00202 }

void vehicle_int_check ( MECH mech,
int  noisy 
)

Definition at line 667 of file mech.consistency.c.

References GetSectOInt, MechType_Ref, NUM_SECTIONS, SendError, SetSectInt, SetSectOInt, tank_int, and tprintf().

Referenced by mech_int_check().

00668 {
00669         int i, j;
00670 
00671         j = tank_int(mech);
00672         for(i = 0; i < NUM_SECTIONS; i++)
00673                 if(GetSectOInt(mech, i) && GetSectOInt(mech, i) != j) {
00674                         if(noisy)
00675                                 SendError(tprintf
00676                                                   ("Template %s / mech #%d: Invalid internals in loc %d (should be %d, are %d)",
00677                                                    MechType_Ref(mech), mech->mynum, i, j,
00678                                                    GetSectOInt(mech, i)));
00679                         SetSectOInt(mech, i, j);
00680                         SetSectInt(mech, i, j);
00681                 }
00682 }


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