src/hcode/btech/p.mech.utils.h

Go to the documentation of this file.
00001 #include "config.h"
00002 
00003 #ifndef _P_MECH_UTILS_H
00004 #define _P_MECH_UTILS_H
00005 
00006 /* mech.utils.c */
00007 /* Misc Functions */
00008 const char *mechtypename(MECH * foo);
00009 int MNumber(MECH * mech, int low, int high);
00010 char *MechIDS(MECH * mech, int islower);
00011 char *MyToUpper(char *string);
00012 void MarkForLOSUpdate(MECH * mech);
00013 void ChannelEmitKill(MECH * mech, MECH * attacker);
00014 
00015 MAP *ValidMap(dbref player, dbref map);
00016 dbref FindMechOnMap(MAP *map, char *mechid);
00017 MECH *find_mech_in_hex(MECH * mech, MAP * mech_map, int x, int y, int needlos);
00018 dbref FindTargetDBREFFromMapNumber(MECH * mech, char *mapnum);
00019 
00020 /* Map Math */
00021 int AcceptableDegree(int d);
00022 void FindXY(float x0, float y0, int bearing, float range, float *x1, float *y1);
00023 float FindRange(float x0, float y0, float z0, float x1, float y1, float z1);
00024 int MyHexDist(int x1, int y1, int x2, int y2, int tc);
00025 float FindXYRange(float x0, float y0, float x1, float y1);
00026 float FindHexRange(float x0, float y0, float x1, float y1);
00027 void RealCoordToMapCoord(short *hex_x, short *hex_y, float cart_x, float cart_y);
00028 void MapCoordToRealCoord(int hex_x, int hex_y, float *cart_x, float *cart_y);
00029 void visit_neighbor_hexes(MAP *map, int x, int y, void (*callback)(MAP *, int, int));
00030 void FindComponents(float magnitude, int degrees, float *x, float *y);
00031 void CheckEdgeOfMap(MECH * mech);
00032 int FindZBearing(float x0, float y0, float z0, float x1, float y1, float z1);
00033 int FindBearing(float x0, float y0, float x1, float y1);
00034 int InWeaponArc(MECH * mech, float x, float y);
00035 int IsInWeaponArc(MECH * mech, float x, float y, int section, int critical);
00036 void navigate_sketch_mechs(MECH *mech, MAP *map, int x, int y,
00037    char buff[NAVIGATE_LINES][MBUF_SIZE]);
00038 int FindTargetXY(MECH * mech, float *x, float *y, float *z);
00039 
00040 /* Skill lookups */
00041 char *FindGunnerySkillName(MECH * mech, int weapindx);
00042 char *FindPilotingSkillName(MECH * mech);
00043 int FindPilotPiloting(MECH * mech);
00044 int FindSPilotPiloting(MECH * mech);
00045 int FindPilotSpotting(MECH * mech);
00046 int FindPilotArtyGun(MECH * mech);
00047 int FindPilotGunnery(MECH * mech, int weapindx);
00048 char *FindTechSkillName(MECH * mech);
00049 int FindTechSkill(dbref player, MECH * mech);
00050 
00051 /* Skill rolls */
00052 int MadePilotSkillRoll(MECH * mech, int mods);
00053 int MechPilotSkillRoll_BTH(MECH *mech, int mods);
00054 int MadePilotSkillRoll_Advanced(MECH * mech, int mods, int succeedWhenFallen);
00055 int MadePilotSkillRoll_NoXP(MECH * mech, int mods, int succeedWhenFallen);
00056 int Roll(void);
00057 
00058 /* Section/Crit Functions */
00059 int CritsInLoc(MECH * mech, int index);
00060 int SectHasBusyWeap(MECH * mech, int sect);
00061 int FindWeapons_Advanced(MECH * mech, int index, unsigned char *weaparray,
00062     unsigned char *weapdataarray, int *critical, int whine);
00063 int FindAmmunition(MECH * mech, unsigned char *weaparray,
00064     unsigned short *ammoarray, unsigned short *ammomaxarray,
00065     unsigned int *modearray, int returnall);
00066 int FindLegHeatSinks(MECH * mech);
00067 int FindWeaponNumberOnMech_Advanced(MECH * mech, int number, int *section,
00068     int *crit, int sight);
00069 int FindWeaponNumberOnMech(MECH * mech, int number, int *section, int *crit);
00070 int FindWeaponFromIndex(MECH * mech, int weapindx, int *section, int *crit);
00071 int FindWeaponIndex(MECH * mech, int number);
00072 int findAmmoInSection(MECH * mech, int section, int type, int nogof, int gof);
00073 int FullAmmo(MECH * mech, int loc, int pos);
00074 int FindAmmoForWeapon_sub(MECH * mech, int weapSection, int weapCritical,
00075     int weapindx, int start, int *section, int *critical, int nogof, int gof);
00076 int FindAmmoForWeapon(MECH * mech, int weapindx, int start, int *section,
00077     int *critical);
00078 int CountAmmoForWeapon(MECH * mech, int weapindx);
00079 int FindArtemisForWeapon(MECH * mech, int section, int critical);
00080 int FindDestructiveAmmo(MECH * mech, int *section, int *critical);
00081 int FindInfernoAmmo(MECH * mech, int *section, int *critical);
00082 int FindRoundsForWeapon(MECH * mech, int weapindx);
00083 int HeatFactor(MECH * mech);
00084 int WeaponIsNonfunctional(MECH * mech, int section, int crit, int numcrits);
00085 char **ProperSectionStringFromType(int type, int mtype);
00086 void ArmorStringFromIndex(int index, char *buffer, char type, char mtype);
00087 int GetWeaponCrits(MECH * mech, int weapindx);
00088 int listmatch(char **foo, char *mat);
00089 int GetPartWeight(int part);
00090 void multi_weap_sel(MECH * mech, dbref player, char *buffer, int bitbybit,
00091     int (*foo) (MECH *, dbref, int, int));
00092 int MechNumHeatsinksInEngine(MECH * mech);
00093 
00094 /* Tech/Repair functions */
00095 void do_sub_magic(MECH * mech, int loud);
00096 void do_magic(MECH * mech);
00097 void mech_RepairPart(MECH * mech, int loc, int pos);
00098 int no_locations_destroyed(MECH * mech);
00099 void mech_ReAttach(MECH * mech, int loc);
00100 void mech_ReplaceSuit(MECH * mech, int loc);
00101 void mech_ReSeal(MECH * mech, int loc);
00102 void mech_Detach(MECH * mech, int loc);
00103 void mech_FillPartAmmo(MECH * mech, int loc, int pos);
00104 
00105 int CountDestroyedLegs(MECH * objMech);
00106 int IsLegDestroyed(MECH * objMech, int wLoc);
00107 int IsMechLegLess(MECH * objMech);
00108 int FindFirstWeaponCrit(MECH * objMech, int wLoc, int wSlot, int wStartSlot, 
00109    int wCritType, int wMaxCrits);
00110 int checkAllSections(MECH * mech, int specialToFind);
00111 int checkSectionForSpecial(MECH * mech, int specialToFind, int wSec);
00112 int getRemainingInternalPercent(MECH * mech);
00113 int getRemainingArmorPercent(MECH * mech);
00114 int FindObj(MECH * mech, int loc, int type);
00115 int FindObjWithDest(MECH * mech, int loc, int type);
00116 int FindAndCheckAmmo(MECH * mech, int weapindx, int section, int critical,
00117    int *ammoLoc, int *ammoCrit, int *ammoLoc1, int *ammoCrit1,
00118    int *wGattlingShots);
00119 
00120 #ifdef BT_ADVANCED_ECON
00121 unsigned long long int GetPartCost(int p);
00122 void SetPartCost(int p, unsigned long long int cost);
00123 void CalcFasaCost_DoLegMath(MECH * mech, int loc, float * total);
00124 void CalcFasaCost_DoArmMath(MECH * mech, int loc, float * total);
00125 void CalcFasaCost_AddPrice(float *total, char * desc, float value);
00126 unsigned long long int CalcFasaCost(MECH * mech);
00127 #endif
00128 #ifdef BT_CALCULATE_BV
00129 int FindAverageGunnery(MECH * mech);
00130 int CalculateBV(MECH *mech, int gunstat, int pilstat);
00131 #endif
00132 int MechFullNoRecycle(MECH * mech, int num);
00133 #ifdef BT_COMPLEXREPAIRS
00134 int GetPartMod(MECH * mech, int t);
00135 int ProperArmor(MECH* mech);
00136 int ProperInternal(MECH * mech);
00137 int alias_part(MECH * mech, int t, int loc);
00138 int ProperMyomer(MECH * mech);
00139 #endif
00140 #endif                          /* _P_MECH_UTILS_H */

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