-
Notifications
You must be signed in to change notification settings - Fork 88
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2597b55
commit 4c81937
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
30 changes: 29 additions & 1 deletion
30
...Radioactive Cloud/src/main/java/net/simon987/pluginradioactivecloud/RadioactiveCloud.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,32 @@ | ||
package net.simon987.pluginradioactivecloud; | ||
|
||
public class RadioactiveCloud { | ||
import net.simon987.server.GameServer; | ||
import net.simon987.server.game.objects.ControllableUnit; | ||
import net.simon987.server.game.objects.Enterable; | ||
import net.simon987.server.game.objects.GameObject; | ||
import net.simon987.server.game.objects.Radioactive; | ||
|
||
public class RadioactiveCloud extends GameObject implements Radioactive, Enterable { | ||
private final static int CORRUPTION_BLOCK_SIZE = | ||
GameServer.INSTANCE.getConfig().getInt("radioactive_cloud_corruption_block_size"); | ||
|
||
/** | ||
* Called when an object attempts to walk directly into a Enterable object | ||
* | ||
* @param object The game object that attempted to enter | ||
* @return true if successful, false to block the object | ||
*/ | ||
@Override | ||
public boolean enter(GameObject object) { | ||
if (object instanceof ControllableUnit) { | ||
((ControllableUnit) object).getCpu().getMemory().corrupt(CORRUPTION_BLOCK_SIZE); | ||
} | ||
|
||
return true; | ||
} | ||
|
||
@Override | ||
public char getMapInfo() { | ||
return 0; | ||
} | ||
} |
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