Пример #1
0
void PulseLaser2::inflict_damage(SpaceObject *other)
{
	STACKTRACE;
	// copied from space_line:
	int i;
	i = iround_down(damage_factor / 2);
	if (i >= BOOM_SAMPLES)
		i = BOOM_SAMPLES - 1;
	play_sound((SAMPLE *)(melee[MELEE_BOOM + i].dat));
	damage(other, damage_factor);

	state = 0;					 // this is different from space_line :)
	return;
}
Пример #2
0
void SpaceLineArc::inflict_damage(SpaceObject *other)
{
	STACKTRACE;

	// copied from space_line:
	int i;
	i = iround_down(damage_factor / 2);
	if (i >= BOOM_SAMPLES)
		i = BOOM_SAMPLES - 1;
	play_sound((SAMPLE *)(melee[MELEE_BOOM + i].dat));
	damage(other, damage_factor);

	return;
}
Пример #3
0
void AndrosynthGuardian::inflict_damage(SpaceObject *other)
{
	STACKTRACE;
	if (damage_factor > 0) {
		if (other->mass) {
			game->add(new Animation(this,
				pos + unit_vector(trajectory_angle(other)) * 20.0,
				meleedata.sparkSprite, 0, SPARK_FRAMES, 50, DEPTH_EXPLOSIONS));
			translate(-specialBounceDistance*unit_vector(angle));
			bounce_status = specialBounceTime;
			int i = iround_down(damage_factor / 2);
			if (i >= BOOM_SAMPLES) i = BOOM_SAMPLES - 1;
			play_sound((SAMPLE *)(melee[MELEE_BOOM + i].dat));
		}
		if (!other->isProtected()) damage(other, damage_factor);
	}
	else damage(other, 0);
	return;
}