2014-02-02 18:39:08 -03:00
|
|
|
package com.droidquest.materials;
|
|
|
|
|
|
|
|
import com.droidquest.Room;
|
|
|
|
import com.droidquest.items.Item;
|
|
|
|
|
2014-04-09 00:04:44 -03:00
|
|
|
import java.awt.*;
|
|
|
|
|
|
|
|
public class MineField extends Material {
|
|
|
|
private int hit = 0;
|
|
|
|
private Item target = null;
|
2014-02-02 18:39:08 -03:00
|
|
|
|
2014-04-09 00:04:44 -03:00
|
|
|
public MineField() {
|
|
|
|
super(Color.black, false, false);
|
|
|
|
}
|
2014-02-02 18:39:08 -03:00
|
|
|
|
2014-04-09 00:04:44 -03:00
|
|
|
public boolean Passable(Item item) {
|
|
|
|
hit += 2;
|
|
|
|
target = item;
|
|
|
|
return false;
|
|
|
|
}
|
2014-02-02 18:39:08 -03:00
|
|
|
|
2014-04-09 00:04:44 -03:00
|
|
|
public void Animate() {
|
|
|
|
if (hit > 0) {
|
|
|
|
hit--;
|
|
|
|
}
|
|
|
|
if (hit >= 2) {
|
|
|
|
target.room = level.rooms.elementAt(58);
|
|
|
|
target.charge = 0;
|
|
|
|
if (target.InternalRoom != null) {
|
|
|
|
Room room = target.InternalRoom;
|
|
|
|
if (room.wires.size() > 0) {
|
|
|
|
for (int a = 0; a < room.wires.size(); a++) {
|
|
|
|
room.wires.elementAt(0).Remove();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-02-02 18:39:08 -03:00
|
|
|
|
|
|
|
}
|