Move vehicle fightprop hacks

This commit is contained in:
AnimeGitB
2022-08-25 00:15:57 +09:30
parent 9970aeb94d
commit fbf3dbbf77
5 changed files with 45 additions and 134 deletions

View File

@@ -83,33 +83,18 @@ public final class SpawnCommand implements CommandHandler {
}
double maxRadius = Math.sqrt(amount * 0.2 / Math.PI);
Position center = (x != 0 && y != 0 && z != 0)
? (new Position(x, y, z))
: (targetPlayer.getPosition());
for (int i = 0; i < amount; i++) {
Position pos = GetRandomPositionInCircle(targetPlayer.getPosition(), maxRadius).addY(3);
if (x != 0 && y != 0 && z != 0) {
pos = GetRandomPositionInCircle(new Position(x, y, z), maxRadius).addY(3);
}
Position pos = GetRandomPositionInCircle(center, maxRadius).addY(3);
GameEntity entity = null;
if (itemData != null) {
entity = new EntityItem(scene, null, itemData, pos, 1, true);
}
if (gadgetData != null) {
pos.addY(-3);
entity = new EntityVehicle(scene, targetPlayer.getSession().getPlayer(), gadgetData.getId(), 0, pos, targetPlayer.getRotation()); // TODO: does targetPlayer.getSession().getPlayer() have some meaning?
int gadgetId = gadgetData.getId();
switch (gadgetId) {
// TODO: Not hardcode this. Waverider (skiff)
case 45001001, 45001002 -> {
entity.addFightProperty(FightProperty.FIGHT_PROP_BASE_HP, 10000);
entity.addFightProperty(FightProperty.FIGHT_PROP_BASE_ATTACK, 100);
entity.addFightProperty(FightProperty.FIGHT_PROP_CUR_ATTACK, 100);
entity.addFightProperty(FightProperty.FIGHT_PROP_CUR_HP, 10000);
entity.addFightProperty(FightProperty.FIGHT_PROP_CUR_DEFENSE, 0);
entity.addFightProperty(FightProperty.FIGHT_PROP_CUR_SPEED, 0);
entity.addFightProperty(FightProperty.FIGHT_PROP_CHARGE_EFFICIENCY, 0);
entity.addFightProperty(FightProperty.FIGHT_PROP_MAX_HP, 10000);
}
default -> {}
}
entity = new EntityVehicle(scene, targetPlayer, id, 0, pos, targetPlayer.getRotation());
}
if (monsterData != null) {
entity = new EntityMonster(scene, monsterData, pos, level);