mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-24 13:05:51 +00:00
Bug fixes: maxShield is now set on user creation and vault objectId is set on world generation
This commit is contained in:
parent
1d780f7d9b
commit
cbde2450fa
@ -463,4 +463,12 @@ public class Cubot extends GameObject implements Updatable, ControllableUnit, Pr
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getMaxShield() {
|
||||||
|
return maxShield;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxShield(int maxShield) {
|
||||||
|
this.maxShield = maxShield;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ public class UserCreationListener implements GameEventListener {
|
|||||||
cubot.addStatus(CubotStatus.FACTORY_NEW);
|
cubot.addStatus(CubotStatus.FACTORY_NEW);
|
||||||
cubot.setObjectId(GameServer.INSTANCE.getGameUniverse().getNextObjectId());
|
cubot.setObjectId(GameServer.INSTANCE.getGameUniverse().getNextObjectId());
|
||||||
ServerConfiguration config = GameServer.INSTANCE.getConfig();
|
ServerConfiguration config = GameServer.INSTANCE.getConfig();
|
||||||
|
|
||||||
Point point = null;
|
Point point = null;
|
||||||
while (point == null || cubot.getWorld() == null) {
|
while (point == null || cubot.getWorld() == null) {
|
||||||
int spawnX = config.getInt("new_user_worldX") + random.nextInt(5);
|
int spawnX = config.getInt("new_user_worldX") + random.nextInt(5);
|
||||||
@ -50,6 +50,8 @@ public class UserCreationListener implements GameEventListener {
|
|||||||
cubot.setMaxEnergy(config.getInt("battery_max_energy"));
|
cubot.setMaxEnergy(config.getInt("battery_max_energy"));
|
||||||
|
|
||||||
cubot.setHp(config.getInt("cubot_max_hp"));
|
cubot.setHp(config.getInt("cubot_max_hp"));
|
||||||
|
cubot.setMaxHp(config.getInt("cubot_max_hp"));
|
||||||
|
cubot.setMaxShield(config.getInt("cubot_max_hp"));
|
||||||
|
|
||||||
cubot.setParent(user);
|
cubot.setParent(user);
|
||||||
user.setControlledUnit(cubot);
|
user.setControlledUnit(cubot);
|
||||||
|
@ -123,6 +123,7 @@ public class WorldCreationListener implements GameEventListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vaultDoor.setObjectId(GameServer.INSTANCE.getGameUniverse().getNextObjectId());
|
||||||
world.addObject(vaultDoor);
|
world.addObject(vaultDoor);
|
||||||
world.incUpdatable(); //In case the Factory & Radio Tower couldn't be spawned.
|
world.incUpdatable(); //In case the Factory & Radio Tower couldn't be spawned.
|
||||||
vaultDoor.setWorld(world);
|
vaultDoor.setWorld(world);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user