VECTOR bullet_spd;
VECTOR bullet_pos;
var bullet_spd_x = 600;
function remove_()
{
if(event_type == EVENT_ENTITY)
{
if(you.skill47 == _enemy)
{
you._health -= weapon._damage + random(2);
}
else
{
if(you == player || you.skill47 == bullet_)
{
set(my,PASSABLE);
wait(3);
reset(my,PASSABLE);
}
}
wait(1);
ent_remove(my);
}
if(event_type == EVENT_BLOCK)
{
wait(1);
ent_remove(my);
}
}
function bullet()
{
my.scale_x = 1;
my.scale_y = my.scale_x;
my.scale_z = my.scale_x;
my.emask |= (ENABLE_BLOCK | ENABLE_ENTITY);
my.event = remove_;
my.ambient = 100;
my.push = -1;
my.skill47 = _p_bullet;
my.pan = camera.pan+(random(weapon._aim*2.5)-weapon._aim)/10;
my.tilt = camera.tilt+(random(weapon._aim*2.5)-weapon._aim)/10;
bullet_spd.x = bullet_spd_x*time_step;
bullet_spd.y = 0;
bullet_spd.z = 0;
while (my != NULL)
{
c_move(my,bullet_spd,nullvector, IGNORE_YOU + IGNORE_ME + IGNORE_PASSABLE + IGNORE_PUSH);
wait(1);
}
}
// player has my.push = -2
//weapon.aim depends on the weapon.
//weapon.damage depends on the weapon as well