mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-19 18:46:43 +00:00
Fixed radioactive obstacle.
Added "radioactive obstacle curruption block size" in config.properties and removed its getter and setter.
This commit is contained in:
parent
4b7ebd7ad6
commit
e8543082ce
@ -1,7 +1,6 @@
|
|||||||
package net.simon987.npcplugin;
|
package net.simon987.npcplugin;
|
||||||
|
|
||||||
import org.bson.Document;
|
import net.simon987.server.GameServer;
|
||||||
|
|
||||||
import net.simon987.server.game.objects.ControllableUnit;
|
import net.simon987.server.game.objects.ControllableUnit;
|
||||||
import net.simon987.server.game.objects.Enterable;
|
import net.simon987.server.game.objects.Enterable;
|
||||||
import net.simon987.server.game.objects.GameObject;
|
import net.simon987.server.game.objects.GameObject;
|
||||||
@ -9,38 +8,18 @@ import net.simon987.server.game.objects.Radioactive;
|
|||||||
|
|
||||||
public class RadioactiveObstacle extends GameObject implements Radioactive, Enterable {
|
public class RadioactiveObstacle extends GameObject implements Radioactive, Enterable {
|
||||||
|
|
||||||
private int corruptionBlockSize;
|
private final static int corruptionBlockSize = GameServer.INSTANCE.getConfig().getInt("radioactive_obstacle_corruption_block_size");
|
||||||
|
|
||||||
public RadioactiveObstacle(int corruptionBlockSize) {
|
|
||||||
this.corruptionBlockSize = corruptionBlockSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public char getMapInfo() {
|
public char getMapInfo() {
|
||||||
// TODO I don't know how this should be done.
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean enter(GameObject object) {
|
public boolean enter(GameObject object) {
|
||||||
if (object instanceof ControllableUnit)
|
if (object instanceof ControllableUnit) {
|
||||||
((ControllableUnit) object).getCpu().getMemory().corrupt(corruptionBlockSize);
|
((ControllableUnit) object).getCpu().getMemory().corrupt(corruptionBlockSize);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Document mongoSerialize() {
|
|
||||||
Document dbObject = super.mongoSerialise();
|
|
||||||
|
|
||||||
dbObject.put("corruptionBlockSize", corruptionBlockSize);
|
|
||||||
|
|
||||||
return dbObject;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBlockSize(int corruptionBlockSize) {
|
|
||||||
this.corruptionBlockSize = corruptionBlockSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getBlockSize() {
|
|
||||||
return corruptionBlockSize;
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -82,3 +82,5 @@ electric_box_hp=250
|
|||||||
electric_box_respawnTime=256
|
electric_box_respawnTime=256
|
||||||
electric_box_damage=5
|
electric_box_damage=5
|
||||||
electric_box_energy_given=70
|
electric_box_energy_given=70
|
||||||
|
#RadioactiveObstacle
|
||||||
|
radioactive_obstacle_corruption_block_size=10
|
Loading…
x
Reference in New Issue
Block a user