obj1r = ms.getBounds();
}
if (obj instanceof Missile) {
misile = true;
Missile mis = (Missile) obj;
inittr = mis;
obj1r = mis.getBounds();
}
for (Entity chCol : World.objecz) {
if ( chCol instanceof StaticObj) {
StaticObj ob = (StaticObj) chCol;
obj2r = ob.getBounds();
if (ismouse) {
statObj = true;
}
if (misile) {
tgt = chCol;
}
}
if ( chCol instanceof Animal && !chCol.equals(obj) && !player) {
animal = true;
Animal an = (Animal) chCol;
if (!an.dead) {
obj2r = an.getBounds();
if (misile || ismouse) {
tgt = chCol;
}
}
}
if ( chCol instanceof Missile) {
Missile an = (Missile) chCol;
if (an.stuck && !anical) {
misileget = true;
obj2r = an.getBounds();
}
}
if (obj1r.intersects(obj2r)) {
if (misile) {
Missile mis = (Missile) inittr;
if (!mis.stuck && animal) {
//System.out.println("olen ranen");
Animal an = (Animal) tgt;
tgt = an;
mis.stuck = true;
// kopie
playSound(5,getDRX(an.x),getDRY(an.y));
an.criticalWound = true;
an.hp -= 50;
an.attacked(mis.host);
switch (an.type) {
case 0:
playSound(9,getDRX(an.x),getDRY(an.y));
break;
case 1:
playSound(13,getDRX(an.x),getDRY(an.y));
break;
}
//System.out.println(" olens hp = " + an.hp);
}
else if (!mis.stuck && !player && !misileget) {
Missile misa = (Missile) inittr;
misa.stuck = true;
}
else if ( misileget ) return false;
}
if (ismouse && playerC.attacking) {