Package ru.vagrant_ai.questionmarkgame.obj.mob

Examples of ru.vagrant_ai.questionmarkgame.obj.mob.Monster


    if (bullet.intersects(GameplayState.border))
      return 0;
    boolean crit = false;
    for (int i = 0; i < MonsterHandler.monster_array.size(); ++i)
    {
      Monster monster = MonsterHandler.monster_array.get(i);
      if (monster.state != MS.NULL && monster.state != MS.DEAD && mobNotPierced(monster))
      {
        if (bullet.intersects(monster.hitbox) || bullet.intersects(monster.hitbox_crit))
        {
          if (bullet.intersects(monster.hitbox_crit))
            crit = true;
          if (GameplayState.player.gun.opt_poison)
            monster.addPoison((byte) ((crit?7:5)+Elements.extractLevel(ITEM.P_GUN_POISON_BULLET)*(crit?2:1)), (byte) (power/((crit?1.12f:0.9f)+Elements.extractLevel(ITEM.P_GUN_POISON_BULLET)*(0.15f+(crit?0.1f:0)))));
          int damage = (int) (power + power_add); //calculate damage
          damage = (short) (power * ((crit?2.4f:1) + (GameplayState.player.gun.opt_crit_up && crit?0.5f+Elements.extractLevel(ITEM.P_GUN_CRIT_UP)*0.24f:0)));
          damage /= (pierced.size()>0?pierced.size()+1-Elements.extractLevel(ITEM.P_GUN_PIERCE)*0.65f:1);
          monster.onDamage(damage, true);
          if (pierce > 0)
          {
            pierce--;
            pierced.add(monster);
            return 1;
View Full Code Here


  private boolean checkCollision()
  {
    if (bullet.intersects(GameplayState.border)) return true;
    for (int i = 0; i < MonsterHandler.Monster_array.size(); ++i)
    {
      Monster monster = MonsterHandler.Monster_array.get(i);
      if (bullet.intersects(monster.hitbox) && monster.state != MS.NULL && monster.state != MS.DEAD)
        {
          monster.onDamage(GameplayState.player.gun.opt_power);     
          return true;
        }
    }
    return false;
  }
View Full Code Here

  private boolean checkCollision()
  {
    if (bullet.intersects(GameplayState.border)) return true;
    for (int i = 0; i < MonsterHandler.monster_array.size(); ++i)
    {
      Monster monster = MonsterHandler.monster_array.get(i);
      if (monster.state != MS.NULL && monster.state != MS.DEAD)
      {
        if (bullet.intersects(monster.hitbox_crit))
        {
          monster.onDamage((int) ((float)GameplayState.player.gun.opt_power/6*2.8f), true);     
          return true;
        }
        else if (bullet.intersects(monster.hitbox))
          {
            monster.onDamage((int)((float)(GameplayState.player.gun.opt_power/6)*1.6f), false);     
            return true;
          }
      }
    }
    return false;
View Full Code Here

    if (util_speed < 0+add*2)
    {
      util_speed = speed;
      for (int i = 0; i < MonsterHandler.monster_array.size(); ++i)
      {
        Monster monster = MonsterHandler.monster_array.get(i);
        MS state = monster.state;
        if ((zone.intersects(monster.hitbox) || zone.contains(monster.hitbox)) && state != MS.NULL && state != MS.DEAD)
        {
          monster.onDamage(damage+(type == 1?(int) (Elements.extractLevel(ITEM.P_UPG_SMALL_LIGHT)*2):0)+(type == 2?Elements.extractLevel(ITEM.P_UPG_LIGHT)*2:0)+(type == 3?(int) (Elements.extractLevel(ITEM.P_UPG_STRONG_LIGHT)*2.5f):0), false, false);
        }
       
      }
    }
  }
View Full Code Here

    {
      chooseNearest(); //to flip or not to flip
    }
    if (opt_firerate == shoot_moment-Elements.extractLevel(ITEM.P_UPG_SNIPER)*30)
    {
      Monster mob = chooseNearest();
      if (mob == null || mob.state == MS.DEAD || mob.state == MS.NULL)
        opt_firerate--;
      else
      {
        if (new Random().nextInt(50) > 30-Elements.extractLevel(ITEM.P_UPG_SNIPER)*8)
          mob.onDamage(40+Elements.extractLevel(ITEM.P_UPG_SNIPER)*12, true, false);
        else
          mob.onDamage(120+Elements.extractLevel(ITEM.P_UPG_SNIPER)*30, true, true);   
      }
    }
    if (opt_firerate > shoot_moment+5-Elements.extractLevel(ITEM.P_UPG_SNIPER)*30)
    {
      opt_firerate = -5;
View Full Code Here

  public void render(Graphics g)
  {
    for (int i = 0; i < monster_array.size(); ++i)
    {
      Monster monster = monster_array.get(i);
      if (!GameplayState.gamePaused() && !GameplayState.gameStateChanging())
      {
        monster.update();
        if (monster.state == MS.NULL)
        {
          monster_array.remove(i);
          i--;     
        }
      }
      monster.render(g);
    }
  }
View Full Code Here

      if (util_timer > 0)
        return;
      else
        util_timer = horde_timer;
      ML mob = monster_queue.get(0);
      Monster monster = null;
      switch(mob)
      {
      case WHIM:
        monster = new Whim();
        break;
View Full Code Here

      g.setLineWidth(1);
      g.setColor(Color.red);
      g.draw(rect);
      for (int i = 0; i < MonsterHandler.monster_array.size(); ++i)
      {
        Monster mob = MonsterHandler.monster_array.get(i);
        if ((rect.intersects(mob.hitbox) || rect.contains(mob.hitbox)) && mob.state != MS.DEAD && mob.state != MS.NULL)
        {
          util_knife = (byte) (40-Elements.extractLevel(ITEM.P_UPG_KNIFE)*5);
          Particle.addNew(PT.KNIFE, (int) GameplayState.player.pl_center.getX(), (int) GameplayState.player.pl_center.getY());
          mob.onDamage(25+Elements.extractLevel(ITEM.P_UPG_KNIFE)*8, true, false);
          break;
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of ru.vagrant_ai.questionmarkgame.obj.mob.Monster

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.