Browse Source

Update sourcetype

bugfix-sources
MagicBot 4 months ago
parent
commit
cdf3e4db8a
  1. 8
      src/engine/gameManager/PowersManager.java
  2. 2
      src/engine/jobs/FinishSummonsJob.java
  3. 2
      src/engine/net/client/handlers/RecvSummonsMsgHandler.java
  4. 2
      src/engine/powers/effectmodifiers/BlackMantleEffectModifier.java
  5. 2
      src/engine/powers/effectmodifiers/NoModEffectModifier.java

8
src/engine/gameManager/PowersManager.java

@ -348,7 +348,7 @@ public enum PowersManager {
// verify player is not stunned or prohibited from casting // verify player is not stunned or prohibited from casting
PlayerBonuses bonus = playerCharacter.getBonuses(); PlayerBonuses bonus = playerCharacter.getBonuses();
SourceType sourceType = EffectSourceType.GetSourceType(pb.getCategory()); EffectSourceType sourceType = EffectSourceType.getEffectSourceType(pb.getCategory());
if (bonus != null && (bonus.getBool(ModType.Stunned, EffectSourceType.None) || bonus.getBool(ModType.CannotCast, EffectSourceType.None) || bonus.getBool(ModType.BlockedPowerType, sourceType))) if (bonus != null && (bonus.getBool(ModType.Stunned, EffectSourceType.None) || bonus.getBool(ModType.CannotCast, EffectSourceType.None) || bonus.getBool(ModType.BlockedPowerType, sourceType)))
return true; return true;
@ -631,7 +631,7 @@ public enum PowersManager {
// verify player is in correct mode (combat/nonCombat) // verify player is in correct mode (combat/nonCombat)
// verify player is not stunned or prohibited from casting // verify player is not stunned or prohibited from casting
PlayerBonuses bonus = caster.getBonuses(); PlayerBonuses bonus = caster.getBonuses();
SourceType sourceType = EffectSourceType.GetSourceType(pb.getCategory()); EffectSourceType sourceType = EffectSourceType.getEffectSourceType(pb.getCategory());
if (bonus != null && (bonus.getBool(ModType.Stunned, EffectSourceType.None) || bonus.getBool(ModType.CannotCast, EffectSourceType.None) || bonus.getBool(ModType.BlockedPowerType, sourceType))) if (bonus != null && (bonus.getBool(ModType.Stunned, EffectSourceType.None) || bonus.getBool(ModType.CannotCast, EffectSourceType.None) || bonus.getBool(ModType.BlockedPowerType, sourceType)))
return true; return true;
@ -795,7 +795,7 @@ public enum PowersManager {
if (bonus.getBool(ModType.Stunned, EffectSourceType.None)) if (bonus.getBool(ModType.Stunned, EffectSourceType.None))
return; return;
SourceType sourceType = EffectSourceType.GetSourceType(pb.getCategory()); EffectSourceType sourceType = EffectSourceType.getEffectSourceType(pb.getCategory());
if (bonus.getBool(ModType.BlockedPowerType, sourceType)) { if (bonus.getBool(ModType.BlockedPowerType, sourceType)) {
finishRecycleTime(msg.getPowerUsedID(), playerCharacter, true); finishRecycleTime(msg.getPowerUsedID(), playerCharacter, true);
return; return;
@ -1067,7 +1067,7 @@ public enum PowersManager {
if (bonus != null) { if (bonus != null) {
if (bonus.getBool(ModType.Stunned, EffectSourceType.None)) if (bonus.getBool(ModType.Stunned, EffectSourceType.None))
return; return;
SourceType sourceType = EffectSourceType.GetSourceType(pb.getCategory()); EffectSourceType sourceType = EffectSourceType.getEffectSourceType(pb.getCategory());
if (bonus.getBool(ModType.BlockedPowerType, sourceType)) if (bonus.getBool(ModType.BlockedPowerType, sourceType))
return; return;
} }

2
src/engine/jobs/FinishSummonsJob.java

@ -55,7 +55,7 @@ public class FinishSummonsJob extends AbstractScheduleJob {
return; return;
} }
if (this.target.getBonuses() != null && this.target.getBonuses().getBool(ModType.BlockedPowerType, EffectSourceType.SUMMON)) { if (this.target.getBonuses() != null && this.target.getBonuses().getBool(ModType.BlockedPowerType, EffectSourceType.Summon)) {
ErrorPopupMsg.sendErrorMsg(this.target, "You have been blocked from receiving summons!"); ErrorPopupMsg.sendErrorMsg(this.target, "You have been blocked from receiving summons!");
ErrorPopupMsg.sendErrorMsg(this.source, "Target is blocked from receiving summons!"); ErrorPopupMsg.sendErrorMsg(this.source, "Target is blocked from receiving summons!");
return; return;

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

@ -58,7 +58,7 @@ public class RecvSummonsMsgHandler extends AbstractClientMsgHandler {
return true; return true;
} }
if (playerCharacter.getBonuses() != null && playerCharacter.getBonuses().getBool(mbEnums.ModType.BlockedPowerType, mbEnums.EffectSourceType.SUMMON)) { if (playerCharacter.getBonuses() != null && playerCharacter.getBonuses().getBool(mbEnums.ModType.BlockedPowerType, mbEnums.EffectSourceType.Summon)) {
ErrorPopupMsg.sendErrorMsg(playerCharacter, "You have been blocked from receiving summons!"); ErrorPopupMsg.sendErrorMsg(playerCharacter, "You have been blocked from receiving summons!");
ErrorPopupMsg.sendErrorMsg(source, "Target is blocked from receiving summons!"); ErrorPopupMsg.sendErrorMsg(source, "Target is blocked from receiving summons!");
playerCharacter.removeSummoner(source.getObjectUUID()); playerCharacter.removeSummoner(source.getObjectUUID());

2
src/engine/powers/effectmodifiers/BlackMantleEffectModifier.java

@ -33,7 +33,7 @@ public class BlackMantleEffectModifier extends AbstractEffectModifier {
@Override @Override
public void applyBonus(AbstractCharacter ac, int trains) { public void applyBonus(AbstractCharacter ac, int trains) {
PlayerBonuses bonus = ac.getBonuses(); PlayerBonuses bonus = ac.getBonuses();
SourceType sourceType = EffectSourceType.valueOf(this.type); EffectSourceType sourceType = EffectSourceType.valueOf(this.type);
if (sourceType == null) { if (sourceType == null) {
Logger.error("Bad Source Type for " + this.type); Logger.error("Bad Source Type for " + this.type);

2
src/engine/powers/effectmodifiers/NoModEffectModifier.java

@ -33,7 +33,7 @@ public class NoModEffectModifier extends AbstractEffectModifier {
bonus.setBool(this.modType, this.sourceType, true); bonus.setBool(this.modType, this.sourceType, true);
switch (this.sourceType) { switch (this.sourceType) {
case Fly: case Flight:
if (!ac.getObjectType().equals(GameObjectType.PlayerCharacter)) if (!ac.getObjectType().equals(GameObjectType.PlayerCharacter))
return; return;
PlayerCharacter flyer = (PlayerCharacter) ac; PlayerCharacter flyer = (PlayerCharacter) ac;

Loading…
Cancel
Save