/*QUAKED shooter_grenade (1 0 0) (-16 -16 -16) (16 16 16) Fires at either the target or the current direction. "random" is the number of degrees of deviance from the taget. (1.0 default) */ void SP_shooter_grenade( gentity_t *ent ) { InitShooter( ent, WP_GRENADE_LAUNCHER); }
/*QUAKED shooter_rocket (1 0 0) (-16 -16 -16) (16 16 16) Fires at either the target or the current direction. "random" the number of degrees of deviance from the taget. (1.0 default) */ void SP_shooter_rocket( gentity_t *ent ) { InitShooter( ent, WP_ROCKET_LAUNCHER ); }
/*QUAKED shooter_plasma (1 0 0) (-16 -16 -16) (16 16 16) Fires at either the target or the current direction. "random" is the number of degrees of deviance from the taget. (1.0 default) */ void SP_shooter_plasma( gentity_t *ent ) { InitShooter( ent, WP_PLASMAGUN); }
Shooter::Shooter( MyRobot& theRobot, int bottom_motor_channel, int top_motor_channel, int bottom_geartooth_channel, int top_geartooth_channel, int injector_channel ) : m_robot(theRobot), motor_bottom(bottom_motor_channel), motor_top(top_motor_channel), geartooth_bottom(bottom_geartooth_channel), geartooth_top(top_geartooth_channel), injector(injector_channel), pid_p(SHOOTER_P), pid_i(SHOOTER_I), pid_d(SHOOTER_D), drive_ratio(DRIVE_RATIO), tolerance(TOLERANCE), shot_time(SHOT_TIME), release_time(RELEASE_TIME), pid_bottom( pid_p, pid_i, pid_d, &geartooth_bottom, &motor_bottom ), pid_top( pid_p, pid_i, pid_d, &geartooth_top, &motor_top ), m_auto(false), m_speed(0.0F), speed_bottom(0.0F), speed_top(0.0F), running(false), shooting(kIdle) { Preferences *pref = Preferences::GetInstance(); bool saveNeeded = false; printf("In Shooter constructor, pref = 0x%p\n", pref); if (!pref->ContainsKey( "Shooter.pid_p" )) { pref->PutDouble( "Shooter.pid_p", SHOOTER_P ); printf("Preferences: save P\n"); saveNeeded = true; } if (!pref->ContainsKey( "Shooter.pid_i" )) { pref->PutDouble( "Shooter.pid_i", SHOOTER_I ); printf("Preferences: save I\n"); saveNeeded = true; } if (!pref->ContainsKey( "Shooter.pid_d" )) { pref->PutDouble( "Shooter.pid_d", SHOOTER_D ); printf("Preferences: save D\n"); saveNeeded = true; } if (!pref->ContainsKey( "Shooter.drive_ratio" )) { pref->PutDouble( "Shooter.drive_ratio", DRIVE_RATIO ); printf("Preferences: save drive_ratio\n"); saveNeeded = true; } if (!pref->ContainsKey( "Shooter.tolerance" )) { pref->PutDouble( "Shooter.tolerance", TOLERANCE ); printf("Preferences: save tolerance\n"); saveNeeded = true; } if (!pref->ContainsKey( "Shooter.shot_time" )) { pref->PutDouble( "Shooter.shot_time", SHOT_TIME ); printf("Preferences: save shot_time\n"); saveNeeded = true; } if (!pref->ContainsKey( "Shooter.release_time" )) { pref->PutDouble( "Shooter.release_time", RELEASE_TIME ); printf("Preferences: save release_time\n"); saveNeeded = true; } if (saveNeeded) { pref->Save(); printf("Preferences: saved\n"); } InitShooter(); }
/*QUAKED shooter_grenade (1 0 0) (-16 -16 -16) (16 16 16) Fires at either the target or the current direction. "random" is the number of degrees of deviance from the taget. (1.0 default) Tequila: Smokin'Guns attribut: "speed" is the speed of the thrown dynamite (700 default) "wait" is the number of seconds before dynamite explodes (2.5 default) */ void SP_shooter_dynamite( gentity_t *ent ) { InitShooter( ent, WP_DYNAMITE); }
/*QUAKED shooter_plasma (1 0 0) (-16 -16 -16) (16 16 16) Fires at either the target or the current direction. "random" is the number of degrees of deviance from the taget. (1.0 default) "speed" is the speed of the thrown molotov (700 default) "wait" is the number of seconds before molotov explodes (0.0 default for disabled) */ void SP_shooter_molotov( gentity_t *ent ) { InitShooter( ent, WP_MOLOTOV); }
/*QUAKED shooter_blaster (1 0 0) (-16 -16 -16) (16 16 16) Fires at either the target or the current direction. "random" is the number of degrees of deviance from the taget. (1.0 default) */ void SP_shooter_blaster( gentity_t *ent ) { InitShooter( ent, WP_BLASTER); }
/*QUAKED shooter_grenade (1 0 0) (-16 -16 -16) (16 16 16) Fires at either the target or the current direction. "random" is the number of degrees of deviance from the taget. (1.0 default) */ void SP_shooter_grenade( gentity_t *ent ) { InitShooter( ent, WP_HK69); }