示例#1
0
/*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);
}
示例#2
0
/*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 );
}
示例#3
0
/*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);
}
示例#4
0
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();
}
示例#5
0
/*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);
}
示例#6
0
/*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);
}
示例#7
0
/*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);
}
示例#8
0
文件: g_misc.c 项目: bludshot/alturt
/*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);
}