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;