Browse Source

Zerg Mechanic Completed

lakebane-master
FatBoy-DOTC 9 months ago
parent
commit
c640caeb54
  1. 3
      src/engine/gameManager/CombatManager.java
  2. 2
      src/engine/gameManager/SimulationManager.java
  3. 196
      src/engine/objects/Mine.java
  4. 1
      src/engine/objects/PlayerCharacter.java
  5. 4
      src/engine/powers/effectmodifiers/HealthEffectModifier.java
  6. 3
      src/engine/powers/effectmodifiers/ManaEffectModifier.java
  7. 3
      src/engine/powers/effectmodifiers/StaminaEffectModifier.java
  8. 1
      src/engine/powers/poweractions/TransferStatPowerAction.java

3
src/engine/gameManager/CombatManager.java

@ -814,6 +814,9 @@ public enum CombatManager { @@ -814,6 +814,9 @@ public enum CombatManager {
else
damage = calculateDamage(ac, tarAc, minDamage, maxDamage, damageType, resists);
if(ac.getObjectType().equals(GameObjectType.PlayerCharacter)){
damage *= ((PlayerCharacter)ac).ZergMultiplier;
}
float d = 0f;
errorTrack = 12;

2
src/engine/gameManager/SimulationManager.java

@ -238,7 +238,7 @@ public enum SimulationManager { @@ -238,7 +238,7 @@ public enum SimulationManager {
for (AbstractGameObject mineObject : mineList) {
mine = (Mine) mineObject;
//if(mine.isActive)
if(mine.isActive)
mine.onEnter();
}

196
src/engine/objects/Mine.java

@ -18,6 +18,7 @@ import engine.gameManager.ZoneManager; @@ -18,6 +18,7 @@ import engine.gameManager.ZoneManager;
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;
@ -55,6 +56,7 @@ public class Mine extends AbstractGameObject { @@ -55,6 +56,7 @@ public class Mine extends AbstractGameObject {
public int capSize;
public final HashSet<Integer> _playerMemory = new HashSet<>();
public final HashMap<Integer,Long> _recentMemory = new HashMap<>();
HashMap<Guild,ArrayList<Integer>> dividedPlayers;
public Integer totalPlayers;
@ -609,6 +611,8 @@ public class Mine extends AbstractGameObject { @@ -609,6 +611,8 @@ public class Mine extends AbstractGameObject {
player = (PlayerCharacter) playerObject;
// Player is already in our memory
if (_recentMemory.containsKey(player.getObjectUUID()))
_recentMemory.remove(player.getObjectUUID());
if (_playerMemory.contains(player.getObjectUUID()))
continue;
@ -644,10 +648,21 @@ public class Mine extends AbstractGameObject { @@ -644,10 +648,21 @@ public class Mine extends AbstractGameObject {
if(updated == true){
for(Integer playerID : this._playerMemory){
player = PlayerCharacter.getFromCache(playerID);
for(Guild present : this.dividedPlayers.keySet()) {
int count = this.dividedPlayers.get(present).size();
float multiplier = (float)(count / this.totalPlayers);
ChatManager.chatSystemInfo(player,present.getName() + " COUNT: " + count + " / " + this.totalPlayers);
if(this.dividedPlayers.containsKey(player.getGuild().getNation())){
int count = this.dividedPlayers.get(player.getGuild().getNation()).size();
switch(this.capSize){
case 5:
player.ZergMultiplier = getMultiplier5Man(count);
break;
case 10:
player.ZergMultiplier = getMultiplier10Man(count);
break;
case 20:
player.ZergMultiplier = getMultiplier20Man(count);
break;
}
} else{
player.ZergMultiplier = 1.0f; //something went wrong reset to default until next cycle
}
}
}
@ -670,15 +685,186 @@ public class Mine extends AbstractGameObject { @@ -670,15 +685,186 @@ public class Mine extends AbstractGameObject {
continue;
toRemove.add(playerUUID);
if(_recentMemory.containsKey(playerUUID) == false) {
_recentMemory.put(playerUUID, System.currentTimeMillis());
}
player.ZergMultiplier = 1.0f; // reset damage modifier to 1.0
}
// Remove players from mine memory
_playerMemory.removeAll(toRemove);
//_playerMemory.removeAll(toRemove);
HashSet<Integer> purge = new HashSet<>();
for(Integer id : _recentMemory.keySet()){
if(System.currentTimeMillis() > _recentMemory.get(playerUUID) + 60000){
purge.add(id);
}
}
for(Integer id : purge){
_recentMemory.remove(id);
}
if(toRemove.isEmpty()){
return false;
}else{
return true;
}
}
public static float getMultiplier5Man(int count){
float multiplier = 1.0f;
switch(count){
case 1:
multiplier += 0.5f;
break;
case 2:
multiplier += 0.5f;
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.45f;
break;
case 8:
multiplier -= 0.6f;
break;
default:
multiplier -= 0.75f;
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;
}
}

1
src/engine/objects/PlayerCharacter.java

@ -176,6 +176,7 @@ public class PlayerCharacter extends AbstractCharacter { @@ -176,6 +176,7 @@ public class PlayerCharacter extends AbstractCharacter {
public boolean isBoxed = false;
public float ZergMultiplier = 1.0f;
/**
* No Id Constructor
*/

4
src/engine/powers/effectmodifiers/HealthEffectModifier.java

@ -176,6 +176,10 @@ public class HealthEffectModifier extends AbstractEffectModifier { @@ -176,6 +176,10 @@ public class HealthEffectModifier extends AbstractEffectModifier {
if (!ac.isAlive())
return;
if(awo.getObjectType().equals(GameObjectType.PlayerCharacter)){
modAmount *= ((PlayerCharacter)ac).ZergMultiplier;
}
int powerID = 0, effectID = 0;
String powerName = "";
if (effect.getPower() != null) {

3
src/engine/powers/effectmodifiers/ManaEffectModifier.java

@ -157,6 +157,9 @@ public class ManaEffectModifier extends AbstractEffectModifier { @@ -157,6 +157,9 @@ public class ManaEffectModifier extends AbstractEffectModifier {
skipImmune = true;
}
}
if(awo.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){
modAmount *= ((PlayerCharacter)ac).ZergMultiplier;
}
PlayerBonuses bonus = ac.getBonuses();
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Heal) >= trains) {
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);

3
src/engine/powers/effectmodifiers/StaminaEffectModifier.java

@ -153,6 +153,9 @@ public class StaminaEffectModifier extends AbstractEffectModifier { @@ -153,6 +153,9 @@ public class StaminaEffectModifier extends AbstractEffectModifier {
skipImmune = true;
}
}
if(awo.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)){
modAmount *= ((PlayerCharacter)ac).ZergMultiplier;
}
PlayerBonuses bonus = ac.getBonuses();
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Heal) >= trains) {
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);

1
src/engine/powers/poweractions/TransferStatPowerAction.java

@ -213,6 +213,7 @@ public class TransferStatPowerAction extends AbstractPowerAction { @@ -213,6 +213,7 @@ public class TransferStatPowerAction extends AbstractPowerAction {
// put it back between min and max
damage += min;
damage *= ((PlayerCharacter) source).ZergMultiplier;
}
// Apply any power effect modifiers (such as stances)

Loading…
Cancel
Save