Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***** Make the bot MOVE ******/
- // Did we successfully just take a big step?
- if (walkmove(angle, dist))
- {
- if(agr_server & IS_TEST_SERVER)
- bprint(#PRINT_HIGH, "bmd 1, ");
- // Success, we're walking normally
- self.time_till_next_jump = time + BOT_JUMP_INTERVAL;
- self.jumping_time = 0; // reset the jump counter (we didnt jump)
- return; // back to the loop
- }
- // we COULDN'T take big steps (We just ran into something...)
- // are we on 'stop on obstacles' mode?
- if (self.stop_on_obstacle==1)
- {
- if(agr_server & IS_TEST_SERVER)
- bprint(#PRINT_HIGH, "botmovedist stop on obstacles mode\n");
- self.time_till_next_jump = time + BOT_JUMP_INTERVAL;
- if (self.attack_finished < time)
- GruntyAnim_Stuck();
- return;
- }
- // MAKING BOTS CLIMB LADDERS!!!!
- // Did we successfully just take a small step?
- if (walkmove(angle, 0.25))
- {
- if(agr_server & IS_TEST_SERVER)
- bprint(#PRINT_HIGH, "bmd 2 walkmove(angle, 0.25\n");
- // not sure what "not all corners are valid" means (defs.qc)
- self.flags = self.flags | #FL_PARTIALGROUND;
- self.time_till_next_jump = time + BOT_JUMP_INTERVAL;
- // we're climbing a ladder!
- self.jumping_time = 0; // reset the jump counter (we didnt jump)
- return;
- }
- else
- {
- makevectors(self.v_angle);
- tracebox (self.origin, #VEC_HULL_MIN,#VEC_HULL_MAX, self.origin + v_forward*8, MOVE_EVERYTHING, self);
- setorigin (self, trace_endpos + '0 0 2');
- bprint(#PRINT_HIGH, "bmd 2B the tracebox");
- return;
- }
- if (self.grunty_tacticMode == GRUNTY_TACTICMODE_STATIC)
- return;
- // BELOW THIS LINE: we couldn't take big OR small steps. so it's:
- // JUMP TIME! JUMP TIME! JUMP TIME! JUMP TIME! JUMP TIME! JUMP TIME!
- // JUMP TIME! JUMP TIME! JUMP TIME! JUMP TIME! JUMP TIME! JUMP TIME!
- // JUMP TIME! JUMP TIME! JUMP TIME! JUMP TIME! JUMP TIME! JUMP TIME!
- // need to reset this so that jumping is possible:
- self.flags = self.flags - (self.flags & #FL_PARTIALGROUND);
- if (self.time_till_next_jump > time)
- return;
- self.grunty_movement_type = MOV_FORWARD; // abort dodging
- makevectors(self.angles);
- // Assess a potential jump
- // Are we on the ground?
- if (self.flags & #FL_ONGROUND)
- traceline(self.origin + '0 0 20', self.origin + '0 0 20' + v_forward * 10, #MOVE_NORMAL, self);
- if (trace_fraction == 1.0)
- {
- // OMC: THIS IS WHERE THE BOT DOES TTHE STUPID JUMPING
- // this stops grunty moving when attacking but he still moves while shooting
- // OMC this is the Grunty blocked and jumping forward
- //self.velocity = self.velocity + v_forward * 20;
- if(agr_server & IS_TEST_SERVER)
- dprint("bmd, 2\n");
- //self.velocity_z = self.velocity_z + 270; // jump
- self.velocity = self.velocity + '0 0 300'; // jump
- //self.velocity += v_forward * 20;
- //self.velocity_z += 270;
- //sound (self, #CHAN_BODY, "player/plyrjmp8.wav", 1, #ATTN_NORM);
- sound (self, #CHAN_VOICE, "player/plyrjmp8.wav", 1, #ATTN_NORM);
- self.time_till_next_jump = time + BOT_JUMP_INTERVAL;
- if(sexy)
- {
- // if but has jumped over 6 times bot gives up
- if(!self.jumping_time)
- self.jumping_time = 6;
- else
- if(self.jumping_time <= 1)
- {
- if(agr_server & IS_TEST_SERVER)
- bprint(#PRINT_HIGH, "botmovedist 4 too many jumps\n");
- // get me a waypoint
- self.ai_state = AI_STUCK;
- self.jumping_time = 0; // reset the jump counter
- }
- else self.jumping_time--;
- }
- return;
- }
- else // trace fraction didnt find anything
- self.time_till_next_jump = time + BOT_JUMP_INTERVAL;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement