Merge pull request #168 from Mozzi20/master

Added radioactive obstacle
This commit is contained in:
Simon Fortier 2018-06-08 12:09:36 -04:00 committed by GitHub
commit e7e9a3e6fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 1 deletions

View File

@ -0,0 +1,25 @@
package net.simon987.pluginradioactivecloud;
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 RadioactiveObstacle extends GameObject implements Radioactive, Enterable {
private final static int corruptionBlockSize = GameServer.INSTANCE.getConfig().getInt("radioactive_obstacle_corruption_block_size");
@Override
public char getMapInfo() {
return 0;
}
@Override
public boolean enter(GameObject object) {
if (object instanceof ControllableUnit) {
((ControllableUnit) object).getCpu().getMemory().corrupt(corruptionBlockSize);
}
return false;
}
}

View File

@ -81,4 +81,6 @@ vault_wg_max_electric_box_count=4
electric_box_hp=250
electric_box_respawnTime=256
electric_box_damage=5
electric_box_energy_given=70
electric_box_energy_given=70
#RadioactiveObstacle
radioactive_obstacle_corruption_block_size=10