Files
BattleBane/src/engine/jobs/AttackJob.java
T

45 lines
1.7 KiB
Java
Raw Normal View History

2022-04-30 09:41:17 -04:00
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2022
// www.magicbane.com
2023-07-15 09:23:48 -04:00
package engine.jobs;
2022-04-30 09:41:17 -04:00
2024-05-17 17:05:21 -05:00
import engine.Enum;
2022-04-30 09:41:17 -04:00
import engine.gameManager.CombatManager;
import engine.job.AbstractJob;
import engine.objects.AbstractCharacter;
2024-05-17 17:05:21 -05:00
import engine.objects.PlayerCharacter;
2022-04-30 09:41:17 -04:00
public class AttackJob extends AbstractJob {
2023-07-15 09:23:48 -04:00
private final AbstractCharacter source;
private final int slot;
private final boolean success;
public AttackJob(AbstractCharacter source, int slot, boolean success) {
super();
this.source = source;
this.slot = slot;
this.success = success;
}
@Override
protected void doJob() {
CombatManager.doCombat(this.source, slot);
2024-05-17 17:05:21 -05:00
if(this.source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter))
if(((PlayerCharacter)this.source).getHidden() > 0)
this.source.removeEffectBySource(Enum.EffectSourceType.Invisibility,41,true);
2023-07-15 09:23:48 -04:00
}
public boolean success() {
return this.success;
}
protected void _cancelJob() {
}
2022-04-30 09:41:17 -04:00
}