FatBoy-DOTC
5 months ago
5 changed files with 90 additions and 39 deletions
@ -0,0 +1,73 @@
@@ -0,0 +1,73 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.workthreads; |
||||
|
||||
import engine.Enum; |
||||
import engine.InterestManagement.InterestManager; |
||||
import engine.InterestManagement.WorldGrid; |
||||
import engine.gameManager.BuildingManager; |
||||
import engine.gameManager.PowersManager; |
||||
import engine.gameManager.SessionManager; |
||||
import engine.gameManager.ZergManager; |
||||
import engine.math.Vector3fImmutable; |
||||
import engine.objects.*; |
||||
import engine.server.MBServerStatics; |
||||
import org.pmw.tinylog.Logger; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.HashMap; |
||||
import java.util.HashSet; |
||||
|
||||
public class BoxFlagThread implements Runnable { |
||||
|
||||
public final static int THREAD_DELAY = 5000; |
||||
public BoxFlagThread() { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void run() { |
||||
long nextPulse = System.currentTimeMillis(); |
||||
while(true){ |
||||
if(System.currentTimeMillis() > nextPulse) { |
||||
for(PlayerCharacter pc : SessionManager.getAllActivePlayerCharacters()){ |
||||
if(pc.isEnteredWorld() && pc.isActive()){ |
||||
|
||||
if(PlayerCharacter.checkIfBoxed(pc)) { |
||||
if(pc.title.equals(CharacterTitle.BOX) == false) { |
||||
pc.title = CharacterTitle.BOX; |
||||
//InterestManager.reloadCharacter(pc);
|
||||
InterestManager.setObjectDirty(pc); |
||||
} |
||||
if (pc.containsEffect(1672601862) == false) {//Deathshroud
|
||||
PowersManager.applyPower(pc, pc, Vector3fImmutable.ZERO, 1672601862, 40, false); |
||||
} |
||||
}else{ |
||||
if(pc.title.equals(CharacterTitle.NONE) == false) { |
||||
pc.title = CharacterTitle.NONE; |
||||
//InterestManager.reloadCharacter(pc);
|
||||
InterestManager.setObjectDirty(pc); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
nextPulse += THREAD_DELAY; |
||||
} |
||||
} |
||||
} |
||||
public static void startBoxFlagThread() { |
||||
|
||||
Thread boxFlag; |
||||
boxFlag = new Thread(new BoxFlagThread()); |
||||
|
||||
boxFlag.setName("boxFlagThread"); |
||||
boxFlag.start(); |
||||
} |
||||
} |
@ -1,24 +0,0 @@
@@ -1,24 +0,0 @@
|
||||
package engine.workthreads; |
||||
|
||||
import engine.gameManager.PowersManager; |
||||
|
||||
import java.util.ArrayList; |
||||
|
||||
public class PowersThread implements Runnable { |
||||
|
||||
public PowersThread(){ |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void run() { |
||||
while(true){ |
||||
ArrayList<PowersManager.PowerQueObject> purge = new ArrayList<>(); |
||||
for(PowersManager.PowerQueObject pqo : PowersManager.static_power_que){ |
||||
purge.add(pqo); |
||||
PowersManager.usePower(pqo.msg,pqo.origin,pqo.sendCastToSelf); |
||||
} |
||||
PowersManager.static_power_que.removeAll(purge); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue