This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Functions | |
int | valid_ammo_mode (MECH *mech, int loc, int part, int let) |
int | FindAmmoType (MECH *mech, int loc, int part) |
int | replace_econ (dbref player, MECH *mech, int loc, int part) |
int | reload_econ (dbref player, MECH *mech, int loc, int part, int *val) |
int | fixarmor_econ (dbref player, MECH *mech, int loc, int *val) |
int | fixinternal_econ (dbref player, MECH *mech, int loc, int *val) |
int | repair_econ (dbref player, MECH *mech, int loc, int part) |
int | repairenhcrit_econ (dbref player, MECH *mech, int loc, int part) |
int | reattach_econ (dbref player, MECH *mech, int loc) |
int | replacesuit_econ (dbref player, MECH *mech, int loc) |
int | reseal_econ (dbref player, MECH *mech, int loc) |
int | replacep_succ (dbref player, MECH *mech, int loc, int part) |
int | replaceg_succ (dbref player, MECH *mech, int loc, int part) |
int | reload_succ (dbref player, MECH *mech, int loc, int part, int *val) |
int | fixinternal_succ (dbref player, MECH *mech, int loc, int *val) |
int | fixarmor_succ (dbref player, MECH *mech, int loc, int *val) |
int | reattach_succ (dbref player, MECH *mech, int loc) |
int | replacesuit_succ (dbref player, MECH *mech, int loc) |
int | reseal_succ (dbref player, MECH *mech, int loc) |
int | repairg_succ (dbref player, MECH *mech, int loc, int part) |
int | repairenhcrit_succ (dbref player, MECH *mech, int loc, int part) |
int | repairp_succ (dbref player, MECH *mech, int loc, int part) |
int | replacep_fail (dbref player, MECH *mech, int loc, int part) |
int | repairp_fail (dbref player, MECH *mech, int loc, int part) |
int | replaceg_fail (dbref player, MECH *mech, int loc, int part) |
int | repairg_fail (dbref player, MECH *mech, int loc, int part) |
int | repairenhcrit_fail (dbref player, MECH *mech, int loc, int part) |
int | reload_fail (dbref player, MECH *mech, int loc, int part, int *val) |
int | fixarmor_fail (dbref player, MECH *mech, int loc, int *val) |
int | fixinternal_fail (dbref player, MECH *mech, int loc, int *val) |
int | reattach_fail (dbref player, MECH *mech, int loc) |
int | replacesuit_fail (dbref player, MECH *mech, int loc) |
int | reseal_fail (dbref player, MECH *mech, int loc) |
int FindAmmoType | ( | MECH * | mech, | |
int | loc, | |||
int | part | |||
) |
Definition at line 130 of file mech.tech.do.c.
References AC10_AP_AMMO, AC10_CASELESS_AMMO, AC10_FLECHETTE_AMMO, AC10_INCENDIARY_AMMO, AC10_PRECISION_AMMO, AC20_AP_AMMO, AC20_CASELESS_AMMO, AC20_FLECHETTE_AMMO, AC20_INCENDIARY_AMMO, AC20_PRECISION_AMMO, AC2_AP_AMMO, AC2_CASELESS_AMMO, AC2_FLECHETTE_AMMO, AC2_INCENDIARY_AMMO, AC2_PRECISION_AMMO, AC5_AP_AMMO, AC5_CASELESS_AMMO, AC5_FLECHETTE_AMMO, AC5_INCENDIARY_AMMO, AC5_PRECISION_AMMO, AC_AP_MODE, AC_CASELESS_MODE, AC_FLECHETTE_MODE, AC_INCENDIARY_MODE, AC_MODES, AC_PRECISION_MODE, Ammo2I, AMMO_LRM_SGUIDED, AMMO_LRM_STINGER, AMMO_MODES, ARTEMIS_LRM_AMMO, ARTEMIS_MODE, Cargo, ELRM_AMMO, GetPartAmmoMode, GetPartType, I2Ammo, INARC_ECM_AMMO, INARC_ECM_MODE, INARC_EXPLO_AMMO, INARC_EXPLO_MODE, INARC_HAYWIRE_AMMO, INARC_HAYWIRE_MODE, INARC_NEMESIS_AMMO, INARC_NEMESIS_MODE, INFERNO_MODE, INFERNO_SRM_AMMO, IsAmmo, LAC2_AP_AMMO, LAC2_CASELESS_AMMO, LAC2_FLECHETTE_AMMO, LAC2_INCENDIARY_AMMO, LAC2_PRECISION_AMMO, LAC5_AP_AMMO, LAC5_CASELESS_AMMO, LAC5_FLECHETTE_AMMO, LAC5_INCENDIARY_AMMO, LAC5_PRECISION_AMMO, LBX10_AMMO, LBX20_AMMO, LBX2_AMMO, LBX5_AMMO, LBX_MODE, LR_DFM_AMMO, LRM_AMMO, MechWeapons, MRM_AMMO, name, NARC_LRM_AMMO, NARC_MODE, SGUIDED_MODE, SLRM_AMMO, SR_DFM_AMMO, SRM_AMMO, SSRM_AMMO, STINGER_MODE, SWARM1_LRM_AMMO, SWARM1_MODE, SWARM_LRM_AMMO, and SWARM_MODE.
Referenced by critslot_func(), critstatus_func(), muxevent_tickmech_reload(), muxevent_tickmech_removegun(), muxevent_tickmech_removepart(), TFUNC_LOCPOS(), and TFUNC_LOCPOS_VAL().
00131 { 00132 int t = GetPartType(mech, loc, part); 00133 int m = GetPartAmmoMode(mech, loc, part); 00134 int base = -1; 00135 00136 if(!IsAmmo(t)) 00137 return t; 00138 t = Ammo2I(t); 00139 00140 if(strstr(MechWeapons[t].name, "StreakSRM")) 00141 base = SSRM_AMMO; 00142 else if(strstr(MechWeapons[t].name, "StreakLRM")) 00143 base = SLRM_AMMO; 00144 else if(strstr(MechWeapons[t].name, "ELRM")) 00145 base = ELRM_AMMO; 00146 else if(strstr(MechWeapons[t].name, "LR_DFM")) 00147 base = LR_DFM_AMMO; 00148 else if(strstr(MechWeapons[t].name, "SR_DFM")) 00149 base = SR_DFM_AMMO; 00150 else if(strstr(MechWeapons[t].name, "LRM")) 00151 base = LRM_AMMO; 00152 else if(strstr(MechWeapons[t].name, "SRM")) 00153 base = SRM_AMMO; 00154 else if(strstr(MechWeapons[t].name, "MRM")) 00155 base = MRM_AMMO; 00156 00157 if(!(m & AMMO_MODES)) { 00158 if(base < 0) 00159 return I2Ammo(t); 00160 else 00161 return Cargo(base); 00162 } 00163 00164 if(m & LBX_MODE) { 00165 if(strstr(MechWeapons[t].name, "LB20")) 00166 base = LBX20_AMMO; 00167 else if(strstr(MechWeapons[t].name, "LB10")) 00168 base = LBX10_AMMO; 00169 else if(strstr(MechWeapons[t].name, "LB5")) 00170 base = LBX5_AMMO; 00171 else if(strstr(MechWeapons[t].name, "LB2")) 00172 base = LBX2_AMMO; 00173 if(base < 0) 00174 return I2Ammo(t); 00175 return Cargo(base); 00176 } 00177 00178 if(m & AC_MODES) { 00179 if(m & AC_AP_MODE) { 00180 if(strstr(MechWeapons[t].name, "AC/2")) 00181 base = AC2_AP_AMMO; 00182 if(strstr(MechWeapons[t].name, "AC/5")) 00183 base = AC5_AP_AMMO; 00184 if(strstr(MechWeapons[t].name, "AC/10")) 00185 base = AC10_AP_AMMO; 00186 if(strstr(MechWeapons[t].name, "AC/20")) 00187 base = AC20_AP_AMMO; 00188 if(strstr(MechWeapons[t].name, "LightAC/2")) 00189 base = LAC2_AP_AMMO; 00190 if(strstr(MechWeapons[t].name, "LightAC/5")) 00191 base = LAC5_AP_AMMO; 00192 } 00193 00194 if(m & AC_FLECHETTE_MODE) { 00195 if(strstr(MechWeapons[t].name, "AC/2")) 00196 base = AC2_FLECHETTE_AMMO; 00197 if(strstr(MechWeapons[t].name, "AC/5")) 00198 base = AC5_FLECHETTE_AMMO; 00199 if(strstr(MechWeapons[t].name, "AC/10")) 00200 base = AC10_FLECHETTE_AMMO; 00201 if(strstr(MechWeapons[t].name, "AC/20")) 00202 base = AC20_FLECHETTE_AMMO; 00203 if(strstr(MechWeapons[t].name, "LightAC/2")) 00204 base = LAC2_FLECHETTE_AMMO; 00205 if(strstr(MechWeapons[t].name, "LightAC/5")) 00206 base = LAC5_FLECHETTE_AMMO; 00207 } 00208 00209 if(m & AC_INCENDIARY_MODE) { 00210 if(strstr(MechWeapons[t].name, "AC/2")) 00211 base = AC2_INCENDIARY_AMMO; 00212 if(strstr(MechWeapons[t].name, "AC/5")) 00213 base = AC5_INCENDIARY_AMMO; 00214 if(strstr(MechWeapons[t].name, "AC/10")) 00215 base = AC10_INCENDIARY_AMMO; 00216 if(strstr(MechWeapons[t].name, "AC/20")) 00217 base = AC20_INCENDIARY_AMMO; 00218 if(strstr(MechWeapons[t].name, "LightAC/2")) 00219 base = LAC2_INCENDIARY_AMMO; 00220 if(strstr(MechWeapons[t].name, "LightAC/5")) 00221 base = LAC5_INCENDIARY_AMMO; 00222 } 00223 00224 if(m & AC_PRECISION_MODE) { 00225 if(strstr(MechWeapons[t].name, "AC/2")) 00226 base = AC2_PRECISION_AMMO; 00227 if(strstr(MechWeapons[t].name, "AC/5")) 00228 base = AC5_PRECISION_AMMO; 00229 if(strstr(MechWeapons[t].name, "AC/10")) 00230 base = AC10_PRECISION_AMMO; 00231 if(strstr(MechWeapons[t].name, "AC/20")) 00232 base = AC20_PRECISION_AMMO; 00233 if(strstr(MechWeapons[t].name, "LightAC/2")) 00234 base = LAC2_PRECISION_AMMO; 00235 if(strstr(MechWeapons[t].name, "LightAC/5")) 00236 base = LAC5_PRECISION_AMMO; 00237 } 00238 00239 if(m & AC_CASELESS_MODE) { 00240 if(strstr(MechWeapons[t].name, "AC/2")) 00241 base = AC2_CASELESS_AMMO; 00242 if(strstr(MechWeapons[t].name, "AC/5")) 00243 base = AC5_CASELESS_AMMO; 00244 if(strstr(MechWeapons[t].name, "AC/10")) 00245 base = AC10_CASELESS_AMMO; 00246 if(strstr(MechWeapons[t].name, "AC/20")) 00247 base = AC20_CASELESS_AMMO; 00248 if(strstr(MechWeapons[t].name, "LightAC/2")) 00249 base = LAC2_CASELESS_AMMO; 00250 if(strstr(MechWeapons[t].name, "LightAC/5")) 00251 base = LAC5_CASELESS_AMMO; 00252 } 00253 if(base < 0) 00254 return I2Ammo(t); 00255 return Cargo(base); 00256 } 00257 00258 if(m & INARC_EXPLO_MODE) 00259 return Cargo(INARC_EXPLO_AMMO); 00260 else if(m & INARC_HAYWIRE_MODE) 00261 return Cargo(INARC_HAYWIRE_AMMO); 00262 else if(m & INARC_ECM_MODE) 00263 return Cargo(INARC_ECM_AMMO); 00264 else if(m & INARC_NEMESIS_MODE) 00265 return Cargo(INARC_NEMESIS_AMMO); 00266 00267 if(base < 0) 00268 return I2Ammo(t); 00269 if(m & NARC_MODE) 00270 return Cargo(base) + NARC_LRM_AMMO - LRM_AMMO; 00271 if(m & ARTEMIS_MODE) 00272 return Cargo(base) + ARTEMIS_LRM_AMMO - LRM_AMMO; 00273 if(m & SWARM_MODE) 00274 return Cargo(base) + SWARM_LRM_AMMO - LRM_AMMO; 00275 if(m & SWARM1_MODE) 00276 return Cargo(base) + SWARM1_LRM_AMMO - LRM_AMMO; 00277 if(m & INFERNO_MODE) 00278 return Cargo(base) + INFERNO_SRM_AMMO - SRM_AMMO; 00279 if(m & STINGER_MODE) 00280 return Cargo(base) + AMMO_LRM_STINGER - LRM_AMMO; 00281 if(m & SGUIDED_MODE) 00282 return Cargo(base) + AMMO_LRM_SGUIDED - LRM_AMMO; 00283 return Cargo(base); 00284 }
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH(), and TFUNC_LOCPOS().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
Referenced by TECHCOMMANDH().
int valid_ammo_mode | ( | MECH * | mech, | |
int | loc, | |||
int | part, | |||
int | let | |||
) |
Definition at line 98 of file mech.tech.do.c.
References Ammo2I, ammo_types, GetPartType, IsAmmo, MechWeapons, name, NOSPA, nspec, ntype, rspec, and rtype.
Referenced by TECHCOMMANDH().
00099 { 00100 int w, i; 00101 00102 if(!IsAmmo(GetPartType(mech, loc, part)) || !let) 00103 return -1; 00104 let = toupper(let); 00105 w = Ammo2I(GetPartType(mech, loc, part)); 00106 00107 if(MechWeapons[w].special & NOSPA) 00108 return -1; 00109 00110 for(i = 0; ammo_types[i].name; i++) { 00111 if(ammo_types[i].name != let) 00112 continue; 00113 if(ammo_types[i].rtype >= 0 && 00114 MechWeapons[w].type != ammo_types[i].rtype) 00115 continue; 00116 if(ammo_types[i].rspec && 00117 !(MechWeapons[w].special & ammo_types[i].rspec)) 00118 continue; 00119 if(ammo_types[i].ntype >= 0 && 00120 MechWeapons[w].type == ammo_types[i].ntype) 00121 continue; 00122 if(ammo_types[i].nspec && 00123 (MechWeapons[w].special & ammo_types[i].nspec)) 00124 continue; 00125 return ammo_types[i].aflag; 00126 } 00127 return -1; 00128 }