68 Mount::Mount(
const string &filename,
int am,
int vol,
float xyscale,
float zscale,
float func,
float maxfunc,
69 bool banked ) : bank( banked )
80 xyscale = xyscalestat;
109 AdjustMatrix( mat, velocity, target, speed, lead, cone );
125 float zscale = this->
zscale;
126 bool thisbank = this->
bank;
130 this->
size = thissize;
136 this->
bank = thisbank;
141 if (other->
ammo == -1)
143 else if (other->
ammo != -1 &&
ammo == -1)
149 float percentage = 1./1024;
150 int thingstocompare = 0;
153 if (newammo->
ammo == -1) {
163 }
else if (newammo->
ammo > 0) {
183 return percentage/thingstocompare;
196 signed char autotrack,
200 using namespace VSFileSystem;
203 static bool lock_disrupted_by_false_fire =
205 if (lock_disrupted_by_false_fire)
219 tmp.to_matrix( mat );
221 static bool firemissingautotrackers =
223 if (autotrack && NULL != target) {
225 if (!firemissingautotrackers)
228 if (!firemissingautotrackers)
237 if (
ammo > 0 && reduce_beam_ammo)
258 static bool match_speed_with_target =
260 string skript =
type->
file+string(
".xai" );
266 if (!match_speed_with_target) {
272 if (testfg == NULL) {
277 if (testfg->
name ==
"Base") {
291 fg->
name =
"Base_Patrol";
320 if (target && target != owner) {
326 if (match_speed_with_target)
332 temp->
owner = caller;
341 while (relat < temp->getRelation( target ) && i++ < 100)
358 hint[locind] = temp->
location[locind];
362 static bool use_separate_sound =
364 static bool ai_use_separate_sound =
370 static double maxdistancesqr =
374 static float weapon_gain =
376 static float exterior_weapon_gain =
378 static float min_weapon_sound_refire =
389 if (ips && cp != NULL && cp->GetView() <=
CP_RIGHT) {
391 sound_vel =
Vector(0, 0, 0);
392 sound_gain = weapon_gain;
394 sound_pos = tmp.position;
395 sound_vel = velocity;
396 sound_gain = exterior_weapon_gain;
399 if ( ( ( (!use_separate_sound)
401 || ( (!ai_use_separate_sound) && !ips ) ) && (
isMissile(
type ) ==
false) ) {
406 if (distancesqr < maxdistancesqr) {
421 }
else if ( (ai_sound || ips) && distancesqr < maxdistancesqr ) {
434 if ( nextmount && ( target = firer->
Target() ) ) {
440 Vector nextmountnorm = diff-nextmount->
pos;
441 nextmountnorm.Normalize();
443 thismountnorm.Normalize();
444 return nextR.Dot( nextmountnorm ) > mat.
getR().Dot( thismountnorm );
455 bool fireit =
ref.
gun == NULL;