gt:             float[] forward = { 0, 0, 0 }, right = { 0, 0, 0 };
context: /*
   * Copyright (C) 1997-2001 Id Software, Inc.
   * 
   * This program is free software; you can redistribute it and/or modify it under
   * the terms of the GNU General Public License as published by the Free Software
   * Foundation; either version 2 of the License, or (at your option) any later
   * version.
   * 
   * This program is distributed in the hope that it will be useful, but WITHOUT
   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
   * FOR A PARTICULAR PURPOSE.
   * 
   * See the GNU General Public License for more details.
   * 
   * You should have received a copy of the GNU General Public License along with
   * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   * Place - Suite 330, Boston, MA 02111-1307, USA.
   *  
   */
  /* Modifications
     Copyright 2003-2004 Bytonic Software
     Copyright 2010 Google Inc.
  */
  package com.googlecode.gwtquake.shared.game.monsters;
  
  import com.googlecode.gwtquake.shared.common.Constants;
  import com.googlecode.gwtquake.shared.game.*;
  import com.googlecode.gwtquake.shared.game.adapters.EntityDieAdapter;
  import com.googlecode.gwtquake.shared.game.adapters.EntInteractAdapter;
  import com.googlecode.gwtquake.shared.game.adapters.EntityThinkAdapter;
  import com.googlecode.gwtquake.shared.game.adapters.EntityPainAdapter;
  import com.googlecode.gwtquake.shared.server.ServerGame;
  import com.googlecode.gwtquake.shared.server.ServerInit;
  import com.googlecode.gwtquake.shared.server.World;
  import com.googlecode.gwtquake.shared.util.Lib;
  import com.googlecode.gwtquake.shared.util.Math3D;
  
  
  public class MonsterGladiator {
  
      //	This file generated by ModelGen - Do NOT Modify
  
      public final static int FRAME_stand1 = 0;
  
      public final static int FRAME_stand2 = 1;
  
      public final static int FRAME_stand3 = 2;
  
      public final static int FRAME_stand4 = 3;
  
      public final static int FRAME_stand5 = 4;
  
      public final static int FRAME_stand6 = 5;
  
      public final static int FRAME_stand7 = 6;
  
      public final static int FRAME_walk1 = 7;
  
      public final static int FRAME_walk2 = 8;
  
      public final static int FRAME_walk3 = 9;
  
      public final static int FRAME_walk4 = 10;
  
      public final static int FRAME_walk5 = 11;
  
      public final static int FRAME_walk6 = 12;
  
      public final static int FRAME_walk7 = 13;
  
      public final static int FRAME_walk8 = 14;
  
      public final static int FRAME_walk9 = 15;
  
      public final static int FRAME_walk10 = 16;
  
      public final static int FRAME_walk11 = 17;
  
      public final static int FRAME_walk12 = 18;
  
      public final static int FRAME_walk13 = 19;
  
      public final static int FRAME_walk14 = 20;
  
      public final static int FRAME_walk15 = 21;
  
      public final static int FRAME_walk16 = 22;
  
      public final static int FRAME_run1 = 23;
  
      public final static int FRAME_run2 = 24;
  
      public final static int FRAME_run3 = 25;
  
      public final static int FRAME_run4 = 26;
  
      public final static int FRAME_run5 = 27;
  
      public final static int FRAME_run6 = 28;
  
      public final static int FRAME_melee1 = 29;
  
      public final static int FRAME_melee2 = 30;
  
      public final static int FRAME_melee3 = 31;
  
      public final static int FRAME_melee4 = 32;
  
      public final static int FRAME_melee5 = 33;
  
      public final static int FRAME_melee6 = 34;
  
      public final static int FRAME_melee7 = 35;
  
      public final static int FRAME_melee8 = 36;
  
      public final static int FRAME_melee9 = 37;
  
      public final static int FRAME_melee10 = 38;
  
      public final static int FRAME_melee11 = 39;
  
      public final static int FRAME_melee12 = 40;
  
      public final static int FRAME_melee13 = 41;
  
      public final static int FRAME_melee14 = 42;
  
      public final static int FRAME_melee15 = 43;
  
      public final static int FRAME_melee16 = 44;
  
      public final static int FRAME_melee17 = 45;
  
      public final static int FRAME_attack1 = 46;
  
      public final static int FRAME_attack2 = 47;
  
      public final static int FRAME_attack3 = 48;
  
      public final static int FRAME_attack4 = 49;
  
      public final static int FRAME_attack5 = 50;
  
      public final static int FRAME_attack6 = 51;
  
      public final static int FRAME_attack7 = 52;
  
      public final static int FRAME_attack8 = 53;
  
      public final static int FRAME_attack9 = 54;
  
      public final static int FRAME_pain1 = 55;
  
      public final static int FRAME_pain2 = 56;
  
      public final static int FRAME_pain3 = 57;
  
      public final static int FRAME_pain4 = 58;
  
      public final static int FRAME_pain5 = 59;
  
      public final static int FRAME_pain6 = 60;
  
      public final static int FRAME_death1 = 61;
  
      public final static int FRAME_death2 = 62;
  
      public final static int FRAME_death3 = 63;
  
      public final static int FRAME_death4 = 64;
  
      public final static int FRAME_death5 = 65;
  
      public final static int FRAME_death6 = 66;
  
      public final static int FRAME_death7 = 67;
  
      public final static int FRAME_death8 = 68;
  
      public final static int FRAME_death9 = 69;
  
      public final static int FRAME_death10 = 70;
  
      public final static int FRAME_death11 = 71;
  
      public final static int FRAME_death12 = 72;
  
      public final static int FRAME_death13 = 73;
  
      public final static int FRAME_death14 = 74;
  
      public final static int FRAME_death15 = 75;
  
      public final static int FRAME_death16 = 76;
  
      public final static int FRAME_death17 = 77;
  
      public final static int FRAME_death18 = 78;
  
      public final static int FRAME_death19 = 79;
  
      public final static int FRAME_death20 = 80;
  
      public final static int FRAME_death21 = 81;
  
      public final static int FRAME_death22 = 82;
  
      public final static int FRAME_painup1 = 83;
  
      public final static int FRAME_painup2 = 84;
  
      public final static int FRAME_painup3 = 85;
  
      public final static int FRAME_painup4 = 86;
  
      public final static int FRAME_painup5 = 87;
  
      public final static int FRAME_painup6 = 88;
  
      public final static int FRAME_painup7 = 89;
  
      public final static float MODEL_SCALE = 1.000000f;
  
      static int sound_pain1;
  
      static int sound_pain2;
  
      static int sound_die;
  
      static int sound_gun;
  
      static int sound_cleaver_swing;
  
      static int sound_cleaver_hit;
  
      static int sound_cleaver_miss;
  
      static int sound_idle;
  
      static int sound_search;
  
      static int sound_sight;
  
      static EntityThinkAdapter gladiator_idle = new EntityThinkAdapter() {
      	public String getID() { return "gladiator_idle"; }
          public boolean think(Entity self) {
  
              ServerGame.PF_StartSound(self, Constants.CHAN_VOICE, sound_idle, (float) 1, (float) Constants.ATTN_IDLE,
              (float) 0);
              return true;
          }
      };
  
      static EntInteractAdapter gladiator_sight = new EntInteractAdapter() {
      	public String getID() { return "gladiator_sight"; }
          public boolean interact(Entity self, Entity other) {
  
              ServerGame.PF_StartSound(self, Constants.CHAN_VOICE, sound_sight, (float) 1, (float) Constants.ATTN_NORM,
              (float) 0);
              return true;
          }
      };
  
      static EntityThinkAdapter gladiator_search = new EntityThinkAdapter() {
      	public String getID() { return "gladiator_search"; }
          public boolean think(Entity self) {
  
              ServerGame.PF_StartSound(self, Constants.CHAN_VOICE, sound_search, (float) 1, (float) Constants.ATTN_NORM,
              (float) 0);
              return true;
          }
      };
  
      static EntityThinkAdapter gladiator_cleaver_swing = new EntityThinkAdapter() {
      	public String getID() { return "gladiator_cleaver_swing"; }
          public boolean think(Entity self) {
  
              ServerGame.PF_StartSound(self, Constants.CHAN_WEAPON, sound_cleaver_swing, (float) 1, (float) Constants.ATTN_NORM,
              (float) 0);
              return true;
          }
      };
  
      static Frame gladiator_frames_stand[] = new Frame[] {
              new Frame(GameAI.ai_stand, 0, null),
              new Frame(GameAI.ai_stand, 0, null),
              new Frame(GameAI.ai_stand, 0, null),
              new Frame(GameAI.ai_stand, 0, null),
              new Frame(GameAI.ai_stand, 0, null),
              new Frame(GameAI.ai_stand, 0, null),
              new Frame(GameAI.ai_stand, 0, null) };
  
      static MonsterMove gladiator_move_stand = new MonsterMove(FRAME_stand1,
              FRAME_stand7, gladiator_frames_stand, null);
  
      static EntityThinkAdapter gladiator_stand = new EntityThinkAdapter() {
      	public String getID() { return "gladiator_stand"; }
          public boolean think(Entity self) {
  
              self.monsterinfo.currentmove = gladiator_move_stand;
              return true;
          }
      };
  
      static Frame gladiator_frames_walk[] = new Frame[] {
              new Frame(GameAI.ai_walk, 15, null),
              new Frame(GameAI.ai_walk, 7, null),
              new Frame(GameAI.ai_walk, 6, null),
              new Frame(GameAI.ai_walk, 5, null),
              new Frame(GameAI.ai_walk, 2, null),
              new Frame(GameAI.ai_walk, 0, null),
              new Frame(GameAI.ai_walk, 2, null),
              new Frame(GameAI.ai_walk, 8, null),
              new Frame(GameAI.ai_walk, 12, null),
              new Frame(GameAI.ai_walk, 8, null),
              new Frame(GameAI.ai_walk, 5, null),
              new Frame(GameAI.ai_walk, 5, null),
              new Frame(GameAI.ai_walk, 2, null),
              new Frame(GameAI.ai_walk, 2, null),
              new Frame(GameAI.ai_walk, 1, null),
              new Frame(GameAI.ai_walk, 8, null) };
  
      static MonsterMove gladiator_move_walk = new MonsterMove(FRAME_walk1, FRAME_walk16,
              gladiator_frames_walk, null);
  
      static EntityThinkAdapter gladiator_walk = new EntityThinkAdapter() {
      	public String getID() { return "gladiator_walk"; }
          public boolean think(Entity self) {
  
              self.monsterinfo.currentmove = gladiator_move_walk;
  
              return true;
          }
      };
  
      static Frame gladiator_frames_run[] = new Frame[] {
              new Frame(GameAI.ai_run, 23, null),
              new Frame(GameAI.ai_run, 14, null),
              new Frame(GameAI.ai_run, 14, null),
              new Frame(GameAI.ai_run, 21, null),
              new Frame(GameAI.ai_run, 12, null),
              new Frame(GameAI.ai_run, 13, null) };
  
      static MonsterMove gladiator_move_run = new MonsterMove(FRAME_run1, FRAME_run6,
              gladiator_frames_run, null);
  
      static EntityThinkAdapter gladiator_run = new EntityThinkAdapter() {
      	public String getID() { return "gladiator_run"; }
          public boolean think(Entity self) {
  
              if ((self.monsterinfo.aiflags & Constants.AI_STAND_GROUND) != 0)
                  self.monsterinfo.currentmove = gladiator_move_stand;
              else
                  self.monsterinfo.currentmove = gladiator_move_run;
  
              return true;
          }
      };
  
      static EntityThinkAdapter GaldiatorMelee = new EntityThinkAdapter() {
      	public String getID() { return "GaldiatorMelee"; }
          public boolean think(Entity self) {
  
              float[] aim = { 0, 0, 0 };
  
              Math3D.VectorSet(aim, Constants.MELEE_DISTANCE, self.mins[0], -4);
              if (GameWeapon.fire_hit(self, aim, (20 + (Lib.rand() % 5)), 300))
                ServerGame.PF_StartSound(self, Constants.CHAN_AUTO, sound_cleaver_hit, (float) 1, (float) Constants.ATTN_NORM,
                (float) 0);
              else
                ServerGame.PF_StartSound(self, Constants.CHAN_AUTO, sound_cleaver_miss, (float) 1, (float) Constants.ATTN_NORM,
                (float) 0);
              return true;
          }
      };
  
      static Frame gladiator_frames_attack_melee[] = new Frame[] {
              new Frame(GameAI.ai_charge, 0, null),
              new Frame(GameAI.ai_charge, 0, null),
              new Frame(GameAI.ai_charge, 0, null),
              new Frame(GameAI.ai_charge, 0, null),
              new Frame(GameAI.ai_charge, 0, gladiator_cleaver_swing),
              new Frame(GameAI.ai_charge, 0, null),
              new Frame(GameAI.ai_charge, 0, GaldiatorMelee),
              new Frame(GameAI.ai_charge, 0, null),
              new Frame(GameAI.ai_charge, 0, null),
              new Frame(GameAI.ai_charge, 0, null),
              new Frame(GameAI.ai_charge, 0, gladiator_cleaver_swing),
              new Frame(GameAI.ai_charge, 0, null),
              new Frame(GameAI.ai_charge, 0, null),
              new Frame(GameAI.ai_charge, 0, GaldiatorMelee),
              new Frame(GameAI.ai_charge, 0, null),
              new Frame(GameAI.ai_charge, 0, null),
              new Frame(GameAI.ai_charge, 0, null) };
  
      static MonsterMove gladiator_move_attack_melee = new MonsterMove(FRAME_melee1,
              FRAME_melee17, gladiator_frames_attack_melee, gladiator_run);
  
      static EntityThinkAdapter gladiator_melee = new EntityThinkAdapter() {
      	public String getID() { return "gladiator_melee"; }
          public boolean think(Entity self) {
  
              self.monsterinfo.currentmove = gladiator_move_attack_melee;
              return true;
          }
      };
  
      static EntityThinkAdapter GladiatorGun = new EntityThinkAdapter() {
      	public String getID() { return "GladiatorGun"; }
          public boolean think(Entity self) {
  
              float[] start = { 0, 0, 0 };
  
              float[] dir = { 0, 0, 0 };
  