Browse Source

Track poweraction work

feature-config-usage
MagicBot 4 months ago
parent
commit
a41288ac78
  1. 12
      src/engine/net/client/handlers/TrackWindowMsgHandler.java
  2. 47
      src/engine/powers/poweractions/TrackPowerAction.java

12
src/engine/net/client/handlers/TrackWindowMsgHandler.java

@ -86,15 +86,15 @@ public class TrackWindowMsgHandler extends AbstractClientMsgHandler {
if (ablist == null) if (ablist == null)
return true; return true;
TrackPowerAction tpa = null; TrackPowerAction trackPowerAction = null;
for (ActionsBase ab : ablist) { for (ActionsBase ab : ablist) {
AbstractPowerAction apa = ab.getPowerAction(); AbstractPowerAction apa = ab.getPowerAction();
if (apa != null && apa instanceof TrackPowerAction) if (apa != null && apa instanceof TrackPowerAction)
tpa = (TrackPowerAction) apa; trackPowerAction = (TrackPowerAction) apa;
} }
if (tpa == null) if (trackPowerAction == null)
return true; return true;
// Check powers for normal users // Check powers for normal users
@ -111,16 +111,16 @@ public class TrackWindowMsgHandler extends AbstractClientMsgHandler {
int mask = 0; int mask = 0;
if (pb.targetPlayer()) if (pb.targetPlayer())
if (tpa.trackVampire()) // track vampires if (trackPowerAction.powerAction.trackEntry.filter.equals(mbEnums.MonsterType.Vampire)) // track vampires
mask = MBServerStatics.MASK_PLAYER | MBServerStatics.MASK_UNDEAD; mask = MBServerStatics.MASK_PLAYER | MBServerStatics.MASK_UNDEAD;
else else
// track all players // track all players
mask = MBServerStatics.MASK_PLAYER; mask = MBServerStatics.MASK_PLAYER;
else if (pb.targetCorpse()) // track corpses else if (pb.targetCorpse()) // track corpses
mask = MBServerStatics.MASK_CORPSE; mask = MBServerStatics.MASK_CORPSE;
else if (tpa.trackNPC()) // Track NPCs else if (trackPowerAction.powerAction.trackEntry.filter.equals(mbEnums.MonsterType.NPC)) // Track NPCs
mask = MBServerStatics.MASK_NPC; mask = MBServerStatics.MASK_NPC;
else if (tpa.trackUndead()) // Track Undead else if (trackPowerAction.powerAction.trackEntry.filter.equals(mbEnums.MonsterType.Undead)) // Track Undead
mask = MBServerStatics.MASK_MOB | MBServerStatics.MASK_UNDEAD; mask = MBServerStatics.MASK_MOB | MBServerStatics.MASK_UNDEAD;
else else
// Track All // Track All

47
src/engine/powers/poweractions/TrackPowerAction.java

@ -25,63 +25,20 @@ import java.util.HashMap;
public class TrackPowerAction extends AbstractPowerAction { public class TrackPowerAction extends AbstractPowerAction {
private String effectID; private String effectID;
private boolean trackPlayer;
private boolean trackCorpse;
private boolean trackAll;
private boolean trackDragon;
private boolean trackGiant;
private boolean trackNPC;
private boolean trackUndead;
private boolean trackVampire;
private int maxTrack;
private EffectsBase effect; private EffectsBase effect;
public PowerAction powerAction;
public TrackPowerAction(PowerAction powerAction, HashMap<String, EffectsBase> effects) { public TrackPowerAction(PowerAction powerAction, HashMap<String, EffectsBase> effects) {
super(powerAction); super(powerAction);
this.effectID = powerAction.effects.get(0).effect_id; this.effectID = powerAction.effects.get(0).effect_id;
this.effect = effects.get(this.effectID); this.effect = effects.get(this.effectID);
this.powerAction = powerAction;
} }
public String getEffectID() { public String getEffectID() {
return this.effectID; return this.effectID;
} }
public boolean trackPlayer() {
return this.trackPlayer;
}
public boolean trackCorpse() {
return this.trackCorpse;
}
public boolean trackAll() {
return this.trackAll;
}
public boolean trackDragon() {
return this.trackDragon;
}
public boolean trackGiant() {
return this.trackGiant;
}
public boolean trackNPC() {
return this.trackNPC;
}
public boolean trackUndead() {
return this.trackUndead;
}
public boolean trackVampire() {
return this.trackVampire;
}
public int getMaxTrack() {
return this.maxTrack;
}
public EffectsBase getEffect() { public EffectsBase getEffect() {
return this.effect; return this.effect;
} }

Loading…
Cancel
Save