include ; include ; var video_mode=8; var video_screen=1; var video_depth = 32; //bmap adam2 = ; //bmap adam2 = ; bmap adam_f = ; bmap gon1 = ; bmap ggg = ; bmap kol = ; var gad; var attack_percentage; var speed1=0; var speed2=0; var shot; var sss; var h=off; var d_x; var d_y; var read_arctan; var x1; var y1; var x2; var y2; var t; var cn; var rn; var tm; var tm2; entity* en1; entity* pl1; var ya=off; /////////////////////////////////////// ////////sousnds/////////////////////// sound open_door = "gunshot2.wav"; //var temp; var ATTACK_RANGE = 100; var speed_walk =0; //var speed_run =0; define healthpoints, skill99; Function main() { //on_mouse_left = attack; fps_max=60; Level_load("FAR.wmb"); wait(1); var i=900; camera.z=300; while(i>300) { camera.x=player.x-(i*cos(player.pan-180)); camera.y=player.y-(i*sin(camera.pan-180)); camera.z-=1; camera.pan=player.pan-180; freeze_mode=1; i-=2.5; if key_space==on { continue; } wait(1); } i=100; while(i<200) { camera.x=player.x-(i*cos(camera.pan)); camera.y=player.y-(i*sin(camera.pan)); camera.z=100; camera.pan-=1; freeze_mode=1; i+=2.5; if key_space==on { continue; } wait(1); } i=0; while(i<100) { freeze_mode=1; i+=2.5; if key_space==on { continue; } wait(1); } freeze_mode=0; } panel gon{ bmap=gon1; pos_x=10; pos_y=10; layer=1; flags=overlay,refresh,visible; } panel adam{ bmap=ggg; pos_x=340; pos_y=2; layer=2; flags=overlay,refresh,visible; } panel koly{ bmap=kol; pos_x=0; pos_y=0; layer=1; flags=overlay,refresh,visible; } //SKY skycube = //{ // type = "sky10.bmp"; // the image for a backdrop scene // flags = DOME | VISIBLE; // sky cube, visible //} var dangle; var speed=0; var i=0; var pp; function attack(code) { if (code == 280) { me = player; you = NULL; c_scan(player.x,player.pan,vector(180,180,ATTACK_RANGE),IGNORE_ME | SCAN_ENTS); if (you != NULL) { // if(is(you,FLAG3)) { you.skill3 -=10; } } } } var s=off; var a; var sorat_a; var goon=1; var sora; var ban; var gang_sor; var rang; VAR WALK_SPEED; VAR SPEED_GANG; var fas; var soran; VAR BAS=ON; var walk_speed2; entity* doshman_ent; var play_do=off; var sword; var sword_t; function check_my() { if(player == you) { play_do = on; } if(play_do == on ) { c_move(me,vector(0,0*time,0), NULLVECTOR ,glide+ACTIVATE_TRIGGER); ent_animate(my,"attack",ban,anm_cycle); ban +=5*time; // wait(1); // goon =0; }else{ s=on; } } // rang = 0; // reset the "attack" animation frames // while (rang < 100) // { // vec_for_vertex (sword_t, my, 456); // sword tip vertex - get the value in Med // vec_for_vertex (sword, my, 512); // sword base vertex - get the value in Med // if (c_trace (sword, sword_t, ignore_me | ignore_passable) > 0) // the player has hit something? // { // //snd_play (sword_wav, 10, 0); // sword sound /// if (you != null) // { // you.healthpoints -= 10 * time_step; // if the player has hit an entity, decrease its health // } // } // ent_animate(my, "attack", rang, null); // rang += 4 * time_step; /// wait (1); // } //} VAR GON_DOSH=100; var speed_a; action doshman() { VAR SPEED_GANG; en1=me; // doshman_ent = me; my.fat=on; my.skill100=10; while(my.skill100>0) { if attack_percentage>94 && attack_percentage<95 && vec_dist(player.x,my.x)<120 && abs(ang((my.pan-player.pan-180)))<45 { my.skill100-=2; } vec_set(temp,player.x); vec_sub(temp,my.x); vec_to_angle(my.pan,temp); my.tilt=0; if vec_dist(my.x,player.x)>80 { c_move(me,vector(3,0,0),nullvector,0); my.skill99+=1; if my.skill99>100 { my.skill99=0; } ent_animate(me,"run",my.skill99,ANM_CYCLE); } if vec_dist(my.x,player.x)<80 { my.skill98+=1; if my.skill98>100 { my.skill98=0; GON_DOSH-=10; } ent_animate(me,"attack",my.skill98,ANM_CYCLE); } wait(1); } my.skill99=0; my.TRANSLUCENT=on; while(my.alpha>0) { my.skill99+=2; ent_animate(me,"death",my.skill99,ANM_CYCLE); my.alpha-=1; wait(1); } ent_remove(me); } ///////////////////////////////// // wait(1); // x2=en1.x; // y2=en1.y; // x1=player.x; // y1=player.y; /// d_x=x2-x1; // d_y=y2-y1; // read_arctan=d_y/d_x; //my.pan = player.pan+180; // c_move(me,vector(4*time,0,0), NULLVECTOR ,IGNORE_PASSABLE); //vec_set (temp.x, my.x); // trace 1,000 quants below the player // temp.z -= 5000; //fas = c_trace (my.x, temp.x,ignore_me | ignore_passable | use_box ); // ent_animate(my, "walk", soran, anm_cycle); // soran += 3 * time; // }else{ // ent_animate(my, "stand", soran, anm_cycle); // soran += 4 * time; // } var play_doing; var gang; action player_action { var anim_percentage; // animation percentage var movement_speed; // player's movement speed var distance_to_ground; // the distance between player's origin and the ground var speed6; player = my; // I'm the player my.shadow=on; my.event=attack; my.polygon = on; var players_distance; var anim_percentage; var sor; var sword_base; var sword_tip; if(goon==0){ ent_animate(my,"death",sor,anm_cycle); sor +=4*time; } while (1) { ph_setgravity(vector(0,0,-386)); // place the camera 230 quants behind the player and 150 quants above it camera.x=my.x-(180*cos(my.pan)); camera.y=my.y-(180*sin(my.pan)); camera.z=my.z+60; camera.pan = player.pan; camera.tilt = -10; // look down at the player //// //camera.pan-=mouse_force.x*1.5; //camera.x=my.x-(300*cos(camera.pan)); //camera.y=my.y-(300*sin(camera.pan)); //ignore_me | use_box my.pan += 6 * (key_a - key_d) * time; vec_set (temp.x, my.x); // trace 1,000 quants below the player temp.z -= 5000; // temp.z = -c_trace (my.x, temp.x, ignore_me | ignore_passable | use_box); //IGNORE_PASSABLE // vec_set (temp, my.x); // copy player's position to temp // temp.z -= 5000; // set temp.z 5000 quants below player's origin // distance_to_ground = c_trace (my.x, temp.x,ignore_me | ignore_passable | use_box | GLIDE + ACTIVATE_TRIGGER ); movement_speed.x = 10 * (key_w - key_s) * time; // move the player using "W" and "S" movement_speed.y = 0; // don't move sideways movement_speed.z = - (distance_to_ground - 22); // 17 = experimental value movement_speed.z = max (-35 * time, movement_speed.z); // 35 = falling speed c_move (my, movement_speed.x, nullvector,GLIDE + ACTIVATE_TRIGGER ); // move the player if ((key_w == off) && (key_s == off)) // the player isn't moving? { ent_animate(my, "idle",1, anm_cycle); // play the "stand" animation } else // the player is moving? { ent_animate(my, "walk", speed_walk, anm_cycle); // play the "walk" animation } anim_percentage += 3 * time; // 5 = animation speed speed_walk +=4*time; // my.pan += 5 * (key_a - key_d) * time_step - 10 * mouse_force.x * time_step; // rotate with the keys A and D or with the mouse // players_distance.x = 10 * (key_w - key_s) * time_step; // move forward / backward with W / S, 10 gives the movement speed // players_distance.y = 0; // players_distance.z = 0; // c_move (my, players_distance, nullvector, glide); // // if ((key_w == 1) || (key_s == 1)) // the player is walking? // { // ent_animate(my, "walk", anim_percentage, anm_cycle); // anim_percentage += 8 * time_step; // "8" controls the animation speed // } // else // the player is standing still? // { // ent_animate(my, "idle", anim_percentage, anm_cycle); // anim_percentage += 1 * time_step; // "1" controls the animation speed // } if (mouse_left == 1) // if we press the left mouse button { h=on; attack_percentage = 0; // reset the "attack" animation frames while (attack_percentage < 100) { vec_for_vertex (sword_tip, my, 456); // sword tip vertex - get the value in Med vec_for_vertex (sword_base, my, 512); // sword base vertex - get the value in Med if (c_trace (sword_base, sword_tip, ignore_me | ignore_passable) > 0) // the player has hit something? { //snd_play (sword_wav, 10, 0); // sword sound if (you != null) { you.healthpoints -= 10 * time_step; // if the player has hit an entity, decrease its health } } ent_animate(my, "fight", attack_percentage, null); attack_percentage += 4 * time_step; wait (1); } } if (mouse_right == 1) // if we press the left mouse button { h=on; attack_percentage = 0; // reset the "attack" animation frames while (attack_percentage < 100) { vec_for_vertex (sword_tip, my, 456); // sword tip vertex - get the value in Med vec_for_vertex (sword_base, my, 512); // sword base vertex - get the value in Med if (c_trace (sword_base, sword_tip, ignore_me | ignore_passable) > 0) // the player has hit something? { //snd_play (sword_wav, 10, 0); // sword sound if (you != null) { you.healthpoints -= 10 * time_step; // if the player has hit an entity, decrease its health } } ent_animate(my, "sar", attack_percentage, null); attack_percentage += 6 * time_step; ent_move(vector(2,0,0),nullvector); wait(1); } } if(key_w ==on && key_space == on){ temp.z = -c_trace (my.x, temp.x, ignore_me | ignore_passable | use_box); vec_set (temp, my.x); // copy player's position to temp temp.z -= 5000; // set temp.z 5000 quants below player's origin distance_to_ground = c_trace (my.x, temp.x,ignore_me | ignore_passable | use_box ); movement_speed.x = 12 * (key_w && key_space) * time; // move the player using "W" and "S" movement_speed.y = 0; // don't move sideways movement_speed.z = - (distance_to_ground - 24); // 17 = experimental value movement_speed.z = max (-35 * time, movement_speed.z); // 35 = falling speed c_move (my, movement_speed.x, nullvector, IGNORE_PASSABLE); // move the player ent_animate(my,"RUN",speed6,anm_cycle); speed6 += 4*time; } if(goon == 0) { ent_remove(me); } wait (1); } } //action enemy() //{ //set(me,FLAG3); // my.skill3 = 100; //while(me) // { // if (me.skill3 < 0) // { // ent_remove(me); // } // wait(1); // } //} //player=my; //wait(1); //while(1) //{ //Distance_traced = trace(player.x,temp.x); // vec_set(temp,my.x); // temp.z -= 4000; //trace_mode = ignore_me+ignore_sprites+ACTIVATE_SONAR+IGNORE_MODELS+USE_BOX; //move_vec.z = (-trace(my.x,temp))*3*time; //my.shadow=on; //my.bright=on; //camera.pan-=mouse_force.x*1.5; // camera.x=my.x-(300*cos(camera.pan)); // camera.y=my.y-(300*sin(camera.pan)); //camera.z=my.z+30; // speed=0; //if key_w==on // { // dangle=camera.pan; // speed=5+(key_shift*2.5); //} // if key_a==on // { //dangle=camera.pan+90; // speed=5+(key_shift*2.5); // } //if key_d==on // { // dangle=camera.pan-90; // speed=5+(key_shift*2.5); // } //if key_s==on // { // dangle=camera.pan-180; // speed=5+(key_shift*2.5); // } // if key_w==on //{ // if key_a==on // { // dangle=camera.pan+45; // } // if key_d // { // dangle=camera.pan-45; // } // } // if key_s==on // { // if key_d==on // { // dangle=camera.pan+45-180; //} // if key_a==on // { // dangle=camera.pan-45-180; // } // } // dangle=integer(dangle); // while(i<10) // { // if my.pan>dangle //{ // my.pan-=1; // } // if my.pan99 // { // MY.SKILL25=1; //} //if key_shift==off //{ // ent_animate(player,"walk",my.skill25,ANM_CYCLE); //} //if key_shift==on //{ // ent_animate(player,"run",my.skill25,ANM_CYCLE); //} // c_move(player,vector(speed,0,0),NULLVECTOR,0); //} //IF shot==0 && mouse_left==on //{ // shot=1; //my.skill25=0; //} //if shot==1 //{ //ent_animate(player,"fight",my.skill25,ANM_CYCLE); //my.skill25+=1.5; //if my.skill25>99 //{ // shot=0; //} //} //IF sss==0 && mouse_right==on //{ // sss=1; //my.skill25=0; //} //if sss==1 //{ //ent_animate(player,"sar",my.skill25,ANM_CYCLE); //ent_move(vector(3,0,0),nullvector); //my.skill25+=1.5; //if my.skill25>99 //{ //sss=0; //} //} //wait(1); //} //} //var healthpoints; ENTITY* dosh; action enemy_action // attached to the dummy enemy that is sensitive to player's sword { var sorat; dosh=my; c_trace(dosh.x,vector(dosh.x,dosh.y,dosh.z-1000),IGNORE_ME|IGNORE_PASSABLE|SCAN_TEXTURE); dosh.flag3=on; if(dosh.flag3){ ent_move(vector(3,0,0),nullvector); ent_animate(my,"walk",sorat ,anm_cycle); sorat +=4*time; } my.healthpoints = 50; // give the enemies few health points - they'll die immediately while (my.healthpoints > 0) // still alive? { vec_set(temp, player.x); vec_sub(temp, my.x); vec_to_angle(my.pan, temp); // rotate towards the player at all times my.tilt = 0; wait (1); } my.passable = on; // the corpse can't be hit by the sword from now on; the enemy is dead here //snd_play (dead_wav, 50, 0); // sword sound while (my.skill10 < 99) { ent_animate(my, "death", my.skill10, null); my.skill10 += 4 * time_step; // "death" animation speed wait (1); } my.transparent = on; my.alpha = 100; while (my.alpha > 0) { my.alpha -= 4 * time_step; wait (1); } ent_remove (my); } Entity* da; action dar{ da=my; my.shadow=on; } var darh; ENTITY* docm; function bar(){ docm=my; if(event_type == event_impact ) { darh=on; docm.x=-1; } if(darh == on){ da.z=350; snd_play (open_door, 100, 0); wait(5); } } action doc{ my.shadow=on; my.enable_impact=on; my.event=bar; } /////////////////////////////////////////gadid montagl shid ////////////////////////////////////////// //my.pan = player.pan+180; // c_move(me,vector(4*time,0,0), NULLVECTOR ,IGNORE_PASSABLE); //vec_set (temp.x, my.x); // trace 1,000 quants below the player // temp.z -= 5000; //fas = c_trace (my.x, temp.x,ignore_me | ignore_passable | use_box ); // ent_animate(my, "walk", soran, anm_cycle); // soran += 3 * time; // }else{ // ent_animate(my, "stand", soran, anm_cycle); // soran += 4 * time; // } //if(my.trigger_range <300){ // play_do == off; ////////////////////////////////////////////tamam /////////////////////////////////////////////////////