Browse Source

erro log fix and zerg mechanic manager

lakebane-master
FatBoy-DOTC 9 months ago
parent
commit
558b645274
  1. 161
      src/engine/gameManager/ZergManager.java
  2. 2
      src/engine/net/client/handlers/ManageCityAssetMsgHandler.java
  3. 168
      src/engine/objects/Mine.java

161
src/engine/gameManager/ZergManager.java

@ -0,0 +1,161 @@ @@ -0,0 +1,161 @@
package engine.gameManager;
public class ZergManager {
public static float getMultiplier5Man(int count){
float multiplier = 1.0f;
switch(count){
case 1:
case 2:
multiplier += 0.8f;
break;
case 3:
multiplier += 0.5f;
break;
case 4:
multiplier += 0.2f;
break;
case 5:
multiplier += 0.0f;
break;
case 6:
multiplier -= 0.2f;
break;
case 7:
multiplier -= 0.4f;
break;
case 8:
multiplier -= 0.6f;
break;
default:
multiplier -= 0.80f;
break;
}
return multiplier;
}
public static float getMultiplier10Man(int count){
float multiplier = 1.0f;
switch(count){
case 1:
multiplier += 1.0f;
break;
case 2:
multiplier += 1.0f;
break;
case 3:
multiplier += 1.0f;
break;
case 4:
multiplier += 1.0f;
break;
case 5:
multiplier += 0.8f;
break;
case 6:
multiplier += 0.55f;
break;
case 7:
multiplier += 0.35f;
break;
case 8:
multiplier += 0.2f;
break;
case 9:
multiplier += 0.1f;
break;
case 10:
multiplier += 0.0f;
break;
case 11:
multiplier -= 0.1f;
break;
case 12:
multiplier -= 0.2f;
break;
case 13:
multiplier -= 0.35f;
break;
case 14:
multiplier -= 0.55f;
break;
default:
multiplier -= 0.75f;
break;
}
return multiplier;
}
public static float getMultiplier20Man(int count){
float multiplier = 1.0f;
if(count < 10){
multiplier += 1.25f;
}else {
switch (count) {
case 10:
multiplier += 0.8f;
break;
case 11:
multiplier += 0.65f;
break;
case 12:
multiplier += 0.54f;
break;
case 13:
multiplier += 0.46f;
break;
case 14:
multiplier += 0.36f;
break;
case 15:
multiplier += 0.28f;
break;
case 16:
multiplier += 0.21f;
break;
case 17:
multiplier += 0.15f;
break;
case 18:
multiplier += 0.09f;
break;
case 19:
multiplier += 0.04f;
break;
case 20:
multiplier += 0.00f;
break;
case 21:
multiplier -= 0.04f;
break;
case 22:
multiplier -= 0.09f;
break;
case 23:
multiplier -= 0.15f;
break;
case 24:
multiplier -= 0.21f;
break;
case 25:
multiplier -= 0.28f;
break;
case 26:
multiplier -= 0.36f;
break;
case 27:
multiplier -= 0.46f;
break;
case 28:
multiplier -= 0.54f;
break;
case 29:
multiplier -= 0.65f;
break;
default:
multiplier -= 0.75f;
break;
}
}
return multiplier;
}
}

2
src/engine/net/client/handlers/ManageCityAssetMsgHandler.java

@ -294,7 +294,7 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler { @@ -294,7 +294,7 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler {
// Owner is obviously allowed to upgrade his own buildings
if (building.getOwner().equals(player)) {
if (building.getOwner() != null && building.getOwner().equals(player)) {
// Players cannot destroy or transfer a TOL.

168
src/engine/objects/Mine.java

@ -11,14 +11,10 @@ package engine.objects; @@ -11,14 +11,10 @@ package engine.objects;
import engine.Enum;
import engine.InterestManagement.WorldGrid;
import engine.gameManager.BuildingManager;
import engine.gameManager.ChatManager;
import engine.gameManager.DbManager;
import engine.gameManager.ZoneManager;
import engine.gameManager.*;
import engine.net.ByteBufferWriter;
import engine.net.client.msg.ErrorPopupMsg;
import engine.server.MBServerStatics;
import org.joda.time.DateTime;
import org.pmw.tinylog.Logger;
import java.net.UnknownHostException;
@ -27,7 +23,6 @@ import java.sql.SQLException; @@ -27,7 +23,6 @@ import java.sql.SQLException;
import java.time.LocalDateTime;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ThreadLocalRandom;
import static engine.gameManager.DbManager.MineQueries;
import static engine.gameManager.DbManager.getObject;
@ -652,13 +647,13 @@ public class Mine extends AbstractGameObject { @@ -652,13 +647,13 @@ public class Mine extends AbstractGameObject {
int count = this.dividedPlayers.get(player.getGuild().getNation()).size();
switch(this.capSize){
case 5:
player.ZergMultiplier = getMultiplier5Man(count);
player.ZergMultiplier = ZergManager.getMultiplier5Man(count);
break;
case 10:
player.ZergMultiplier = getMultiplier10Man(count);
player.ZergMultiplier = ZergManager.getMultiplier10Man(count);
break;
case 20:
player.ZergMultiplier = getMultiplier20Man(count);
player.ZergMultiplier = ZergManager.getMultiplier20Man(count);
break;
}
} else{
@ -710,159 +705,4 @@ public class Mine extends AbstractGameObject { @@ -710,159 +705,4 @@ public class Mine extends AbstractGameObject {
}
}
public static float getMultiplier5Man(int count){
float multiplier = 1.0f;
switch(count){
case 1:
case 2:
multiplier += 0.8f;
break;
case 3:
multiplier += 0.5f;
break;
case 4:
multiplier += 0.2f;
break;
case 5:
multiplier += 0.0f;
break;
case 6:
multiplier -= 0.2f;
break;
case 7:
multiplier -= 0.4f;
break;
case 8:
multiplier -= 0.6f;
break;
default:
multiplier -= 0.80f;
break;
}
return multiplier;
}
public static float getMultiplier10Man(int count){
float multiplier = 1.0f;
switch(count){
case 1:
multiplier += 1.0f;
break;
case 2:
multiplier += 1.0f;
break;
case 3:
multiplier += 1.0f;
break;
case 4:
multiplier += 1.0f;
break;
case 5:
multiplier += 0.8f;
break;
case 6:
multiplier += 0.55f;
break;
case 7:
multiplier += 0.35f;
break;
case 8:
multiplier += 0.2f;
break;
case 9:
multiplier += 0.1f;
break;
case 10:
multiplier += 0.0f;
break;
case 11:
multiplier -= 0.1f;
break;
case 12:
multiplier -= 0.2f;
break;
case 13:
multiplier -= 0.35f;
break;
case 14:
multiplier -= 0.55f;
break;
default:
multiplier -= 0.75f;
break;
}
return multiplier;
}
public static float getMultiplier20Man(int count){
float multiplier = 1.0f;
if(count < 10){
multiplier += 1.25f;
}else {
switch (count) {
case 10:
multiplier += 0.8f;
break;
case 11:
multiplier += 0.65f;
break;
case 12:
multiplier += 0.54f;
break;
case 13:
multiplier += 0.46f;
break;
case 14:
multiplier += 0.36f;
break;
case 15:
multiplier += 0.28f;
break;
case 16:
multiplier += 0.21f;
break;
case 17:
multiplier += 0.15f;
break;
case 18:
multiplier += 0.09f;
break;
case 19:
multiplier += 0.04f;
break;
case 20:
multiplier += 0.00f;
break;
case 21:
multiplier -= 0.04f;
break;
case 22:
multiplier -= 0.09f;
break;
case 23:
multiplier -= 0.15f;
break;
case 24:
multiplier -= 0.21f;
break;
case 25:
multiplier -= 0.28f;
break;
case 26:
multiplier -= 0.36f;
break;
case 27:
multiplier -= 0.46f;
break;
case 28:
multiplier -= 0.54f;
break;
case 29:
multiplier -= 0.65f;
break;
default:
multiplier -= 0.75f;
break;
}
}
return multiplier;
}
}

Loading…
Cancel
Save