FUNCTION Waffe()
{
Bolter = me;
WHILE(1)
{
bone_angle.pan = (screen_size.x / 2 - mouse_pos.x ) / 10;
bone_angle.tilt = (screen_size.y / 2 - mouse_pos.y) / 10;
ent_bonereset(my,"Bone1");
ent_bonerotate(my,"Bone1",bone_angle);
my.pan = player.pan; my.tilt = player.tilt; my.x = player.x; my.y = player.y;my.z = player.z + 130;
my.visible = on;
my.passable = on;
WAIT(1);
}
}
ACTION Bolt
{
my.pan = (screen_size.x - mouse_pos.x ) / 10;
my.tilt =(screen_size.y / 2 - mouse_pos.y) / 10;
my.push = 1;
Geschoss = me;
WHILE(1)
{
Bewegung.x = 15 * time_step; Bewegung.y = 0;
my.scale_x = 0.1; my.scale_y = 0.1; my.scale_z = 0.1;
c_move(me,Bewegung,nullvector,ignore_passable | IGNORE_MODELS);
WAIT(1);
}
}
FUNCTION schiessen()
{
WHILE(key_pressed(280) == on)
{
Abschuss.x = Bolter.x; Abschuss.y = Bolter.y; Abschuss.z = Bolter.z;
mouse3D.x = mouse_pos.x;
mouse3D.y = 0;
mouse3D.z = 15000 + mouse_pos.y;
vec_for_screen(mouse3D,Sicht);
c_trace(player.x,mouse3D.x,IGNORE_ME | IGNORE_PASSABLE | ACTIVATE_SHOOT | use_box);
ent_create("rocket.mdl",Abschuss.x,Bolt);
WAIT(1);
}
IF(key_pressed(57) == on)
{
mouse3D.x = mouse_pos.x;
mouse3D.y = 0;
mouse3D.z = 15000 + mouse_pos.y;
vec_for_screen(mouse3D,Sicht);
c_trace(player.x,mouse3D.x,IGNORE_ME | ACTIVATE_SONAR | use_box);
WAIT(1);
}
}