Skip to content

Commit

Permalink
added more options in config.yml and improved Magician's Red
Browse files Browse the repository at this point in the history
  • Loading branch information
MysteryCoder456 committed Nov 8, 2020
1 parent 8e79b93 commit b89b7d3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 16 deletions.
10 changes: 8 additions & 2 deletions config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
firstTimeJoinMessage: "&7Stand User &a<player> &7has joined the server for the first time!"
joinMessage: "&7Stand User &e<player> &7has joined the server!"

# Stand Settings
knockbackMultiplier: 4
# Star Platinum Settings
SP_damagePerHit: 4.5
SP_hitCount: 5
SP_knockbackMultiplier: 4

# Magician's Red Settings
MR_attackPower: 3
MR_fireballSpeed: 1
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ public StandUserListener(Main plugin) {

private void starPlatinum(Player player, Entity rightClickedEntity) {

double damagePerHit = 4.5;
int hitCount = 5;
double damagePerHit = Double.parseDouble(config.getString("SP_damagePerHit"));;
int hitCount = Integer.parseInt(config.getString("SP_hitCount"));
long attackDuration = 20;
double knockbackMultiplier = Double.parseDouble(config.getString("knockbackMultiplier"));
double knockbackMultiplier = Double.parseDouble(config.getString("SP_knockbackMultiplier"));

Vector entityVelocity = rightClickedEntity.getVelocity();
Vector knockbackVector = player.getLocation().getDirection();
Expand Down Expand Up @@ -74,18 +74,35 @@ public void run() {

private void magiciansRed(Player player) {

int attackPower = 15;
double fwSpeedMultiplier = 0.1;
int attackPower = Integer.parseInt(config.getString("MR_attackPower"));
double fbSpeedMultiplier = Double.parseDouble(config.getString("MR_fireballSpeed"));

Location fbSpawnLocation = player.getEyeLocation();
Fireball fb = (Fireball) fbSpawnLocation.getWorld().spawnEntity(fbSpawnLocation, EntityType.FIREBALL);

Vector fbDirection = fbSpawnLocation.getDirection();
// fbDirection.multiply(fwSpeedMultiplier);
int id = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {

@Override
public void run() {
Location fbSpawnLocation = player.getEyeLocation();

Vector fbDirection = fbSpawnLocation.getDirection();
fbDirection.multiply(fbSpeedMultiplier);

Fireball fb = (Fireball) fbSpawnLocation.getWorld().spawnEntity(fbSpawnLocation, EntityType.FIREBALL);

fb.setShooter(player);
fb.setDirection(fbDirection);
fb.setVelocity(fbDirection);
}

}, 0, 2);

fb.setShooter(player);
// TODO: Implement fwSpeedMultiplier
fb.setDirection(fbDirection);
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {

@Override
public void run() {
Bukkit.getScheduler().cancelTask(id);
}

}, attackPower * 2);

}

Expand Down Expand Up @@ -113,7 +130,7 @@ public void onPlayerInteractEntityEvent(PlayerInteractEntityEvent e) {
@EventHandler
public void onPlayerInteractAirEvent(PlayerInteractEvent e) {

if (e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
if (e.getAction() == Action.RIGHT_CLICK_AIR) {

Player player = e.getPlayer();

Expand Down

0 comments on commit b89b7d3

Please sign in to comment.