Skip to content

Commit

Permalink
Merge pull request #25 from PixelOutlaw/develop
Browse files Browse the repository at this point in the history
Large refactor of barrier, energy, spawner, minion, life, and combat …
  • Loading branch information
UltraFaceguy authored Feb 16, 2021
2 parents 0b9346e + 8c0a8a1 commit 6339164
Show file tree
Hide file tree
Showing 59 changed files with 812 additions and 752 deletions.
18 changes: 9 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</parent>

<artifactId>strife</artifactId>
<version>3.3.2</version>
<version>3.4.0</version>
<packaging>jar</packaging>

<name>strife</name>
Expand Down Expand Up @@ -85,13 +85,19 @@
<dependency>
<groupId>io.pixeloutlaw</groupId>
<artifactId>facecore</artifactId>
<version>1.16.4.1</version>
<version>master-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.pixeloutlaw</groupId>
<artifactId>bullion</artifactId>
<version>2.2.4</version>
<version>master-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.UltraFaceguy</groupId>
<artifactId>SnazzyParties</artifactId>
<version>master-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -112,12 +118,6 @@
<version>1.18.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.UltraFaceguy</groupId>
<artifactId>SnazzyParties</artifactId>
<version>1.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.glaremasters</groupId>
<artifactId>guilds</artifactId>
Expand Down
57 changes: 19 additions & 38 deletions src/main/java/land/face/strife/StrifePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ The MIT License Copyright (c) 2015 Teal Cube Games
import io.pixeloutlaw.minecraft.spigot.config.VersionedSmartYamlConfiguration;
import io.pixeloutlaw.minecraft.spigot.garbage.StringExtensionsKt;
import java.io.File;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
Expand All @@ -51,6 +52,7 @@ The MIT License Copyright (c) 2015 Teal Cube Games
import land.face.strife.data.ability.Ability;
import land.face.strife.data.champion.LifeSkillType;
import land.face.strife.data.effects.ShootBlock;
import land.face.strife.data.effects.TriggerLoreAbility;
import land.face.strife.hooks.SnazzyPartiesHook;
import land.face.strife.listeners.BullionListener;
import land.face.strife.listeners.ChatListener;
Expand All @@ -65,7 +67,6 @@ The MIT License Copyright (c) 2015 Teal Cube Games
import land.face.strife.listeners.EntityHider;
import land.face.strife.listeners.EntityHider.Policy;
import land.face.strife.listeners.EntityMagicListener;
import land.face.strife.listeners.EvokerFangEffectListener;
import land.face.strife.listeners.ExperienceListener;
import land.face.strife.listeners.FallListener;
import land.face.strife.listeners.FishingListener;
Expand Down Expand Up @@ -95,7 +96,6 @@ The MIT License Copyright (c) 2015 Teal Cube Games
import land.face.strife.managers.BuffManager;
import land.face.strife.managers.ChampionManager;
import land.face.strife.managers.ChaserManager;
import land.face.strife.managers.CombatStatusManager;
import land.face.strife.managers.CorruptionManager;
import land.face.strife.managers.CounterManager;
import land.face.strife.managers.DamageManager;
Expand All @@ -104,7 +104,7 @@ The MIT License Copyright (c) 2015 Teal Cube Games
import land.face.strife.managers.ExperienceManager;
import land.face.strife.managers.IndicatorManager;
import land.face.strife.managers.LoreAbilityManager;
import land.face.strife.managers.MinionManager;
import land.face.strife.managers.LoreAbilityManager.TriggerType;
import land.face.strife.managers.MobModManager;
import land.face.strife.managers.MonsterManager;
import land.face.strife.managers.PathManager;
Expand Down Expand Up @@ -132,18 +132,17 @@ The MIT License Copyright (c) 2015 Teal Cube Games
import land.face.strife.tasks.AbilityTickTask;
import land.face.strife.tasks.BoostTickTask;
import land.face.strife.tasks.BossBarsTask;
import land.face.strife.tasks.CombatStatusTask;
import land.face.strife.tasks.DamageOverTimeTask;
import land.face.strife.tasks.EnergyTask;
import land.face.strife.tasks.EveryTickTask;
import land.face.strife.tasks.ForceAttackSpeed;
import land.face.strife.tasks.IndicatorTask;
import land.face.strife.tasks.MinionDecayTask;
import land.face.strife.tasks.ParticleTask;
import land.face.strife.tasks.SaveTask;
import land.face.strife.tasks.SpawnerSpawnTask;
import land.face.strife.tasks.StealthParticleTask;
import land.face.strife.tasks.StrifeMobTracker;
import land.face.strife.tasks.VirtualEntityTask;
import land.face.strife.util.ChunkUtil;
import land.face.strife.util.DamageUtil;
import land.face.strife.util.LogUtil;
import land.face.strife.util.LogUtil.LogLevel;
Expand Down Expand Up @@ -197,7 +196,6 @@ public class StrifePlugin extends FacePlugin {
private StealthManager stealthManager;
private UniqueEntityManager uniqueEntityManager;
private BossBarManager bossBarManager;
private MinionManager minionManager;
private DamageManager damageManager;
private ChaserManager chaserManager;
private EntityEquipmentManager equipmentManager;
Expand All @@ -207,7 +205,6 @@ public class StrifePlugin extends FacePlugin {
private AbilityIconManager abilityIconManager;
private BuffManager buffManager;
private PathManager pathManager;
private CombatStatusManager combatStatusManager;
private SpawnerManager spawnerManager;
private MobModManager mobModManager;
private BoostManager boostManager;
Expand Down Expand Up @@ -241,6 +238,8 @@ public class StrifePlugin extends FacePlugin {
public static float RUN_COST;
public static float RUN_COST_PERCENT;

public static final DecimalFormat INT_FORMAT = new DecimalFormat("#,###,###,###,###");

public static StrifePlugin getInstance() {
return instance;
}
Expand Down Expand Up @@ -287,7 +286,6 @@ public void enable() {
championManager = new ChampionManager(this);
uniqueEntityManager = new UniqueEntityManager(this);
bossBarManager = new BossBarManager(this);
minionManager = new MinionManager();
damageManager = new DamageManager(this);
chaserManager = new ChaserManager(this);
experienceManager = new ExperienceManager(this);
Expand Down Expand Up @@ -317,7 +315,6 @@ public void enable() {
abilityIconManager = new AbilityIconManager(this);
buffManager = new BuffManager();
pathManager = new PathManager();
combatStatusManager = new CombatStatusManager(this);

MenuListener.getInstance().register(this);

Expand All @@ -330,9 +327,9 @@ public void enable() {
LogUtil.printError("DANGUS ALERT! Bad log level! Acceptable values: " + Arrays.toString(LogLevel.values()));
}

WALK_COST = (float) settings.getDouble("config.mechanics.energy.walk-cost-flat", 3) / 20;
WALK_COST = (float) settings.getDouble("config.mechanics.energy.walk-cost-flat", 3) * EnergyTask.TICK_MULT;
WALK_COST_PERCENT = (float) settings.getDouble("config.mechanics.energy.walk-regen-percent", 0.75);
RUN_COST = (float) settings.getDouble("config.mechanics.energy.run-cost-flat", 10) / 20;
RUN_COST = (float) settings.getDouble("config.mechanics.energy.run-cost-flat", 10) * EnergyTask.TICK_MULT;
RUN_COST_PERCENT = (float) settings.getDouble("config.mechanics.energy.run-regen-percent", 0.25);

buildBuffs();
Expand All @@ -357,12 +354,9 @@ public void enable() {
StealthParticleTask stealthParticleTask = new StealthParticleTask(stealthManager);
ForceAttackSpeed forceAttackSpeed = new ForceAttackSpeed();
BossBarsTask bossBarsTask = new BossBarsTask(bossBarManager);
MinionDecayTask minionDecayTask = new MinionDecayTask(minionManager);
BoostTickTask boostTickTask = new BoostTickTask(boostManager);
SpawnerSpawnTask spawnerSpawnTask = new SpawnerSpawnTask(spawnerManager);
AbilityTickTask iconDuraTask = new AbilityTickTask(abilityManager);
VirtualEntityTask virtualEntityTask = new VirtualEntityTask();
CombatStatusTask combatStatusTask = new CombatStatusTask(combatStatusManager);
EveryTickTask everyTickTask = new EveryTickTask();
IndicatorTask indicatorTask = new IndicatorTask(this);
damageOverTimeTask = new DamageOverTimeTask(this);
Expand Down Expand Up @@ -427,10 +421,6 @@ public void enable() {
240L, // Start timer after 12s
2L // Run it every 1/10th of a second after
));
taskList.add(minionDecayTask.runTaskTimer(this,
220L, // Start timer after 11s
11L
));
taskList.add(boostTickTask.runTaskTimer(this,
20L,
20L
Expand All @@ -439,10 +429,6 @@ public void enable() {
2L,
1L
));
taskList.add(spawnerSpawnTask.runTaskTimer(this,
9 * 20L, // Start timer after 9s
2 * 20L // Run it every 2 seconds
));
taskList.add(iconDuraTask.runTaskTimer(this,
3 * 20L, // Start timer after 3s
AbilityTickTask.ABILITY_TICK_RATE
Expand All @@ -459,10 +445,6 @@ public void enable() {
20L,
1L
));
taskList.add(combatStatusTask.runTaskTimer(this,
3 * 20L + 2L, // Start timer after 3s
20L
));
taskList.add(Bukkit.getScheduler().runTaskTimer(this,
() -> boostManager.checkBoostSchedule(),
60L,
Expand All @@ -477,7 +459,6 @@ public void enable() {
Bukkit.getPluginManager().registerEvents(new CombatListener(this), this);
Bukkit.getPluginManager().registerEvents(new CreeperExplodeListener(this), this);
Bukkit.getPluginManager().registerEvents(new UniqueSplashListener(this), this);
Bukkit.getPluginManager().registerEvents(new EvokerFangEffectListener(strifeMobManager, effectManager), this);
Bukkit.getPluginManager().registerEvents(new DOTListener(this), this);
Bukkit.getPluginManager().registerEvents(new EndermanListener(), this);
Bukkit.getPluginManager().registerEvents(new SwingListener(this), this);
Expand All @@ -491,7 +472,7 @@ public void enable() {
Bukkit.getPluginManager().registerEvents(new SpawnListener(this), this);
Bukkit.getPluginManager().registerEvents(new MoneyDropListener(this), this);
Bukkit.getPluginManager().registerEvents(new ShearsEquipListener(), this);
Bukkit.getPluginManager().registerEvents(new MinionListener(strifeMobManager, minionManager), this);
Bukkit.getPluginManager().registerEvents(new MinionListener(strifeMobManager), this);
Bukkit.getPluginManager().registerEvents(new TargetingListener(this), this);
Bukkit.getPluginManager().registerEvents(new FallListener(this), this);
Bukkit.getPluginManager().registerEvents(new LaunchAndLandListener(this), this);
Expand Down Expand Up @@ -550,7 +531,7 @@ public void enable() {

for (World world : Bukkit.getWorlds()) {
for (Chunk chunk : world.getLoadedChunks()) {
spawnerManager.stampChunk(chunk);
ChunkUtil.stampChunk(chunk);
}
}

Expand Down Expand Up @@ -634,6 +615,14 @@ private void buildEffects() {
assert cs != null;
effectManager.loadEffect(key, cs);
}
for (TriggerType type : TriggerType.values()) {
String id = "TRIGGER_" + type.name();
TriggerLoreAbility triggerLoreAbility = new TriggerLoreAbility(type);
triggerLoreAbility.setId(id);
triggerLoreAbility.setFriendly(true);
triggerLoreAbility.setForceTargetCaster(true);
effectManager.getLoadedEffects().put(id, triggerLoreAbility);
}
}

private void buildConditions() {
Expand Down Expand Up @@ -853,10 +842,6 @@ public BossBarManager getBossBarManager() {
return bossBarManager;
}

public MinionManager getMinionManager() {
return minionManager;
}

public EffectManager getEffectManager() {
return effectManager;
}
Expand Down Expand Up @@ -913,10 +898,6 @@ public MobModManager getMobModManager() {
return mobModManager;
}

public CombatStatusManager getCombatStatusManager() {
return combatStatusManager;
}

public DataStorage getStorage() {
return storage;
}
Expand Down
11 changes: 9 additions & 2 deletions src/main/java/land/face/strife/commands/StrifeCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ public void profileCommand(CommandSender sender, OnlinePlayer target) {
@Subcommand("mobinfo|info")
@CommandPermission("strife.info")
public void infoCommand(Player sender) {
List<LivingEntity> targets = new ArrayList<>(TargetingUtil.getEntitiesInLine(sender.getEyeLocation(), 30));
List<LivingEntity> targets = new ArrayList<>(TargetingUtil.getEntitiesInLine(sender.getEyeLocation(), 30, 2));
targets.remove(sender);
if (targets.isEmpty()) {
sendMessage(sender, "&eNo target found...");
return;
}
TargetingUtil.DISTANCE_COMPARATOR.setLoc(((Player) sender).getLocation());
TargetingUtil.DISTANCE_COMPARATOR.setLoc((sender).getLocation());
targets.sort(TargetingUtil.DISTANCE_COMPARATOR);
StrifeMob targetMob = plugin.getStrifeMobManager().getStatMob(targets.get(0));
sendMessage(sender, "&aUniqueID: " + targetMob.getUniqueEntityId());
Expand Down Expand Up @@ -289,6 +289,13 @@ public void submenuAbilityCommand(CommandSender sender, OnlinePlayer target, Str
plugin.getSubmenu(menu).open(target.getPlayer());
}

@Subcommand("ability refresh")
@CommandCompletion("@players")
@CommandPermission("strife.admin")
public void submenuAbilityCommand(CommandSender sender, OnlinePlayer target) {
plugin.getAbilityIconManager().setAllAbilityIcons(target.getPlayer());
}

@Subcommand("bind")
@CommandCompletion("@players @loreabilities")
@CommandPermission("strife.admin")
Expand Down
Loading

0 comments on commit 6339164

Please sign in to comment.