Created
July 31, 2012 18:59
-
-
Save pxpc2/3219497 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param trap the trap SceneObject | |
*/ | |
public static void activateTrap(SceneObject trap) | |
{ | |
if ((trap != null) && (trap.isOnScreen())) | |
{ | |
Tile loc = trap.getLocation(); | |
trap.interact("Set-trap"); | |
Time.sleep(2000); | |
System.out.println("trap id: " + trap.getId()); | |
SFields.inactivity = new Timer(0); | |
while (SceneEntities.getAt(loc.getX(), loc.getY()).getId() != SConstants.SWAMP_LIZARD_TRAP_WAITING) | |
{ | |
Time.sleep(700); | |
if (SFields.inactivity.getElapsed() > 7000) | |
return; | |
} | |
System.out.println(SceneEntities.getAt(loc.getX(), loc.getY()).getId()); | |
if (SceneEntities.getAt(loc.getX(), loc.getY()).getId() == SConstants.SWAMP_LIZARD_TRAP_WAITING) | |
{ | |
System.out.println("io"); | |
SFields.trapTiles.add(loc); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment