Skip to content

Commit

Permalink
Added Radioactive Cloud object.
Browse files Browse the repository at this point in the history
  • Loading branch information
OrdoFlammae committed Nov 28, 2019
1 parent 2597b55 commit 4c81937
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
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;
}
}
1 change: 1 addition & 0 deletions Server/src/main/resources/config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ electric_box_damage=5
electric_box_energy_given=70
#RadioactiveObstacle
radioactive_obstacle_corruption_block_size=10
radioactive_cloud_corruption_block_size=40

#SecretKey
secret_key=<your_secret_key>
Expand Down

0 comments on commit 4c81937

Please sign in to comment.