mirror of
https://github.com/darksaid98/SiegeEngines.git
synced 2026-12-01 22:22:10 +00:00
feat: more config options for projectiles
This commit is contained in:
1 parent
629211c8dc
commit
082d6e4087
6 files changed
+30
-10
No files matched your search
@@ -5,7 +5,6 @@ import com.github.alathra.siegeengines.SiegeEnginesUtil;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.World;
|
||||
@@ -26,6 +25,8 @@ public class EntityProjectile extends SiegeEngineProjectile {
|
||||
public float inaccuracy = 0.2f;
|
||||
public Particle particleType = Particle.CAMPFIRE_SIGNAL_SMOKE;
|
||||
public Sound soundType = Sound.ENTITY_GENERIC_EXPLODE;
|
||||
public float velocityFactor = 1.0f;
|
||||
public float arrowDamageFactor = 1.0f;
|
||||
|
||||
private boolean playSound = true;
|
||||
|
||||
@@ -43,10 +44,10 @@ public class EntityProjectile extends SiegeEngineProjectile {
|
||||
if (delayedFire) {
|
||||
baseDelay += delayTime;
|
||||
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(SiegeEngines.getInstance(), () -> {
|
||||
CreateEntity(entity, FireLocation, velocity, player);
|
||||
CreateEntity(entity, FireLocation, velocity*velocityFactor, player);
|
||||
}, (long) baseDelay);
|
||||
} else {
|
||||
CreateEntity(entity, FireLocation, velocity, player);
|
||||
CreateEntity(entity, FireLocation, velocity*velocityFactor, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,7 +70,7 @@ public class EntityProjectile extends SiegeEngineProjectile {
|
||||
}
|
||||
if (arrow instanceof Arrow) {
|
||||
Arrow arr = (Arrow) arrow;
|
||||
arr.setDamage(8);
|
||||
arr.setDamage(8*arrowDamageFactor);
|
||||
if (player instanceof org.bukkit.projectiles.ProjectileSource) {
|
||||
arr.setShooter((org.bukkit.projectiles.ProjectileSource) player);
|
||||
arr.setPickupStatus(org.bukkit.entity.AbstractArrow.PickupStatus.CREATIVE_ONLY);
|
||||
|
||||
@@ -29,6 +29,7 @@ public class ExplosiveProjectile extends SiegeEngineProjectile {
|
||||
public Particle particleType = Particle.EXPLOSION_LARGE;
|
||||
public Sound soundType = Sound.ENTITY_GENERIC_EXPLODE;
|
||||
public Boolean alertOnLanding = false;
|
||||
public float velocityFactor = 1.0f;
|
||||
|
||||
private boolean playSound = true;
|
||||
|
||||
@@ -44,10 +45,10 @@ public class ExplosiveProjectile extends SiegeEngineProjectile {
|
||||
if (delayedFire) {
|
||||
baseDelay += delayTime;
|
||||
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(SiegeEngines.getInstance(), () -> {
|
||||
CreateEntity(entity, loc, velocity, player);
|
||||
CreateEntity(entity, loc, velocity*velocityFactor, player);
|
||||
}, (long) baseDelay);
|
||||
} else {
|
||||
CreateEntity(entity, loc, velocity, player);
|
||||
CreateEntity(entity, loc, velocity*velocityFactor, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public class FireworkProjectile extends SiegeEngineProjectile {
|
||||
public float inaccuracy = 0.125f;
|
||||
public Particle particleType = Particle.FLASH;
|
||||
public Sound soundType = Sound.ENTITY_FIREWORK_ROCKET_BLAST_FAR;
|
||||
public float velocityFactor = 0.5f;
|
||||
public float velocityFactor = 1.0f;
|
||||
|
||||
private boolean playSound = true;
|
||||
|
||||
@@ -55,7 +55,7 @@ public class FireworkProjectile extends SiegeEngineProjectile {
|
||||
CreateEntity(entity, FireLocation, velocity*velocityFactor, player);
|
||||
}, (long) baseDelay);
|
||||
} else {
|
||||
CreateEntity(entity, FireLocation, velocity, player);
|
||||
CreateEntity(entity, FireLocation, velocity*velocityFactor, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user