mirror of
https://github.com/darksaid98/SiegeEngines.git
synced 2026-12-03 06:28:55 +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
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>com.github.alathra</groupId>
|
<groupId>com.github.alathra</groupId>
|
||||||
<artifactId>SiegeEngines</artifactId>
|
<artifactId>SiegeEngines</artifactId>
|
||||||
<version>0.7.8</version>
|
<version>0.7.9</version>
|
||||||
|
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>SiegeEngines</name>
|
<name>SiegeEngines</name>
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import com.github.alathra.siegeengines.projectile.FireworkProjectile;
|
|||||||
import com.github.alathra.siegeengines.projectile.ProjectileType;
|
import com.github.alathra.siegeengines.projectile.ProjectileType;
|
||||||
import com.github.alathra.siegeengines.projectile.SiegeEngineProjectile;
|
import com.github.alathra.siegeengines.projectile.SiegeEngineProjectile;
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public class Config {
|
public class Config {
|
||||||
|
|
||||||
private static FileConfiguration config;
|
private static FileConfiguration config;
|
||||||
@@ -257,6 +258,8 @@ public class Config {
|
|||||||
.getInt("Projectiles." + projectileName + ".ProjectileCount");
|
.getInt("Projectiles." + projectileName + ".ProjectileCount");
|
||||||
explosiveProjectile.soundType = Sound
|
explosiveProjectile.soundType = Sound
|
||||||
.valueOf(config.getString("Projectiles." + projectileName + ".FireSound"));
|
.valueOf(config.getString("Projectiles." + projectileName + ".FireSound"));
|
||||||
|
explosiveProjectile.velocityFactor = (float) config
|
||||||
|
.getDouble("Projectiles." + projectileName + ".VelocityFactor");
|
||||||
projectileMap.put(projectileName, explosiveProjectile);
|
projectileMap.put(projectileName, explosiveProjectile);
|
||||||
break;
|
break;
|
||||||
case ENTITY:
|
case ENTITY:
|
||||||
@@ -269,6 +272,12 @@ public class Config {
|
|||||||
.valueOf(config.getString("Projectiles." + projectileName + ".EntityType"));
|
.valueOf(config.getString("Projectiles." + projectileName + ".EntityType"));
|
||||||
entityProjectile.soundType = Sound
|
entityProjectile.soundType = Sound
|
||||||
.valueOf(config.getString("Projectiles." + projectileName + ".FireSound"));
|
.valueOf(config.getString("Projectiles." + projectileName + ".FireSound"));
|
||||||
|
entityProjectile.velocityFactor = (float) config
|
||||||
|
.getDouble("Projectiles." + projectileName + ".VelocityFactor");
|
||||||
|
if (entityProjectile.entityType.equals(EntityType.ARROW)) {
|
||||||
|
entityProjectile.arrowDamageFactor = (float) config
|
||||||
|
.getDouble("Projectiles." + projectileName + ".ArrowDamageFactor");
|
||||||
|
}
|
||||||
projectileMap.put(projectileName, entityProjectile);
|
projectileMap.put(projectileName, entityProjectile);
|
||||||
break;
|
break;
|
||||||
case FIREWORK:
|
case FIREWORK:
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import com.github.alathra.siegeengines.SiegeEnginesUtil;
|
|||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.Particle;
|
import org.bukkit.Particle;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
@@ -26,6 +25,8 @@ public class EntityProjectile extends SiegeEngineProjectile {
|
|||||||
public float inaccuracy = 0.2f;
|
public float inaccuracy = 0.2f;
|
||||||
public Particle particleType = Particle.CAMPFIRE_SIGNAL_SMOKE;
|
public Particle particleType = Particle.CAMPFIRE_SIGNAL_SMOKE;
|
||||||
public Sound soundType = Sound.ENTITY_GENERIC_EXPLODE;
|
public Sound soundType = Sound.ENTITY_GENERIC_EXPLODE;
|
||||||
|
public float velocityFactor = 1.0f;
|
||||||
|
public float arrowDamageFactor = 1.0f;
|
||||||
|
|
||||||
private boolean playSound = true;
|
private boolean playSound = true;
|
||||||
|
|
||||||
@@ -43,10 +44,10 @@ public class EntityProjectile extends SiegeEngineProjectile {
|
|||||||
if (delayedFire) {
|
if (delayedFire) {
|
||||||
baseDelay += delayTime;
|
baseDelay += delayTime;
|
||||||
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(SiegeEngines.getInstance(), () -> {
|
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(SiegeEngines.getInstance(), () -> {
|
||||||
CreateEntity(entity, FireLocation, velocity, player);
|
CreateEntity(entity, FireLocation, velocity*velocityFactor, player);
|
||||||
}, (long) baseDelay);
|
}, (long) baseDelay);
|
||||||
} else {
|
} 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) {
|
if (arrow instanceof Arrow) {
|
||||||
Arrow arr = (Arrow) arrow;
|
Arrow arr = (Arrow) arrow;
|
||||||
arr.setDamage(8);
|
arr.setDamage(8*arrowDamageFactor);
|
||||||
if (player instanceof org.bukkit.projectiles.ProjectileSource) {
|
if (player instanceof org.bukkit.projectiles.ProjectileSource) {
|
||||||
arr.setShooter((org.bukkit.projectiles.ProjectileSource) player);
|
arr.setShooter((org.bukkit.projectiles.ProjectileSource) player);
|
||||||
arr.setPickupStatus(org.bukkit.entity.AbstractArrow.PickupStatus.CREATIVE_ONLY);
|
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 Particle particleType = Particle.EXPLOSION_LARGE;
|
||||||
public Sound soundType = Sound.ENTITY_GENERIC_EXPLODE;
|
public Sound soundType = Sound.ENTITY_GENERIC_EXPLODE;
|
||||||
public Boolean alertOnLanding = false;
|
public Boolean alertOnLanding = false;
|
||||||
|
public float velocityFactor = 1.0f;
|
||||||
|
|
||||||
private boolean playSound = true;
|
private boolean playSound = true;
|
||||||
|
|
||||||
@@ -44,10 +45,10 @@ public class ExplosiveProjectile extends SiegeEngineProjectile {
|
|||||||
if (delayedFire) {
|
if (delayedFire) {
|
||||||
baseDelay += delayTime;
|
baseDelay += delayTime;
|
||||||
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(SiegeEngines.getInstance(), () -> {
|
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(SiegeEngines.getInstance(), () -> {
|
||||||
CreateEntity(entity, loc, velocity, player);
|
CreateEntity(entity, loc, velocity*velocityFactor, player);
|
||||||
}, (long) baseDelay);
|
}, (long) baseDelay);
|
||||||
} else {
|
} 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 float inaccuracy = 0.125f;
|
||||||
public Particle particleType = Particle.FLASH;
|
public Particle particleType = Particle.FLASH;
|
||||||
public Sound soundType = Sound.ENTITY_FIREWORK_ROCKET_BLAST_FAR;
|
public Sound soundType = Sound.ENTITY_FIREWORK_ROCKET_BLAST_FAR;
|
||||||
public float velocityFactor = 0.5f;
|
public float velocityFactor = 1.0f;
|
||||||
|
|
||||||
private boolean playSound = true;
|
private boolean playSound = true;
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ public class FireworkProjectile extends SiegeEngineProjectile {
|
|||||||
CreateEntity(entity, FireLocation, velocity*velocityFactor, player);
|
CreateEntity(entity, FireLocation, velocity*velocityFactor, player);
|
||||||
}, (long) baseDelay);
|
}, (long) baseDelay);
|
||||||
} else {
|
} else {
|
||||||
CreateEntity(entity, FireLocation, velocity, player);
|
CreateEntity(entity, FireLocation, velocity*velocityFactor, player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ Projectiles:
|
|||||||
ExplodePower: 3.25
|
ExplodePower: 3.25
|
||||||
Inaccuracy: 0.125
|
Inaccuracy: 0.125
|
||||||
ProjectileCount: 1
|
ProjectileCount: 1
|
||||||
|
VelocityFactor: 1.0
|
||||||
AmmoItem: COBBLESTONE
|
AmmoItem: COBBLESTONE
|
||||||
FireSound: ENTITY_GENERIC_EXPLODE
|
FireSound: ENTITY_GENERIC_EXPLODE
|
||||||
BreachShot:
|
BreachShot:
|
||||||
@@ -56,6 +57,7 @@ Projectiles:
|
|||||||
ExplodePower: 5.25
|
ExplodePower: 5.25
|
||||||
Inaccuracy: 0.375
|
Inaccuracy: 0.375
|
||||||
ProjectileCount: 1
|
ProjectileCount: 1
|
||||||
|
VelocityFactor: 1.0
|
||||||
AmmoItem: IRON_BLOCK
|
AmmoItem: IRON_BLOCK
|
||||||
FireSound: ENTITY_GENERIC_EXPLODE
|
FireSound: ENTITY_GENERIC_EXPLODE
|
||||||
RepeatingShot:
|
RepeatingShot:
|
||||||
@@ -63,26 +65,32 @@ Projectiles:
|
|||||||
ExplodePower: 1.75
|
ExplodePower: 1.75
|
||||||
Inaccuracy: 0.525
|
Inaccuracy: 0.525
|
||||||
ProjectileCount: 6
|
ProjectileCount: 6
|
||||||
|
VelocityFactor: 1.0
|
||||||
AmmoItem: TNT
|
AmmoItem: TNT
|
||||||
FireSound: ENTITY_GENERIC_EXPLODE
|
FireSound: ENTITY_GENERIC_EXPLODE
|
||||||
ScatterShot:
|
ScatterShot:
|
||||||
ProjectileType: ENTITY
|
ProjectileType: ENTITY
|
||||||
Inaccuracy: 0.365
|
Inaccuracy: 0.365
|
||||||
EntityCount: 24
|
EntityCount: 24
|
||||||
|
VelocityFactor: 1.0
|
||||||
EntityType: ARROW
|
EntityType: ARROW
|
||||||
|
ArrowDamageFactor: 1.0
|
||||||
AmmoItem: GRAVEL
|
AmmoItem: GRAVEL
|
||||||
FireSound: ITEM_CROSSBOW_SHOOT
|
FireSound: ITEM_CROSSBOW_SHOOT
|
||||||
BallistaBoltShot:
|
BallistaBoltShot:
|
||||||
ProjectileType: ENTITY
|
ProjectileType: ENTITY
|
||||||
Inaccuracy: 0.0125
|
Inaccuracy: 0.0125
|
||||||
EntityCount: 1
|
EntityCount: 1
|
||||||
|
VelocityFactor: 0.5
|
||||||
EntityType: ARROW
|
EntityType: ARROW
|
||||||
|
ArrowDamageFactor: 1.0
|
||||||
AmmoItem: ARROW
|
AmmoItem: ARROW
|
||||||
FireSound: ITEM_CROSSBOW_SHOOT
|
FireSound: ITEM_CROSSBOW_SHOOT
|
||||||
DragonsBreath:
|
DragonsBreath:
|
||||||
ProjectileType: ENTITY
|
ProjectileType: ENTITY
|
||||||
Inaccuracy: 0.125
|
Inaccuracy: 0.125
|
||||||
EntityCount: 1
|
EntityCount: 1
|
||||||
|
VelocityFactor: 1.0
|
||||||
EntityType: DRAGON_FIREBALL
|
EntityType: DRAGON_FIREBALL
|
||||||
AmmoItem: DRAGON_BREATH
|
AmmoItem: DRAGON_BREATH
|
||||||
FireSound: ENTITY_GENERIC_EXPLODE
|
FireSound: ENTITY_GENERIC_EXPLODE
|
||||||
@@ -90,6 +98,7 @@ Projectiles:
|
|||||||
ProjectileType: ENTITY
|
ProjectileType: ENTITY
|
||||||
Inaccuracy: 0.475
|
Inaccuracy: 0.475
|
||||||
EntityCount: 8
|
EntityCount: 8
|
||||||
|
VelocityFactor: 1.0
|
||||||
EntityType: SMALL_FIREBALL
|
EntityType: SMALL_FIREBALL
|
||||||
AmmoItem: MAGMA_BLOCK
|
AmmoItem: MAGMA_BLOCK
|
||||||
FireSound: ENTITY_GENERIC_EXPLODE
|
FireSound: ENTITY_GENERIC_EXPLODE
|
||||||
@@ -117,7 +126,7 @@ SiegeEngines:
|
|||||||
CanMount: false
|
CanMount: false
|
||||||
Ballista:
|
Ballista:
|
||||||
ShotAmount: 1
|
ShotAmount: 1
|
||||||
VelocityPerFuel: 0.975
|
VelocityPerFuel: 2.0
|
||||||
MaxFuel: 2
|
MaxFuel: 2
|
||||||
FuelItem: STRING
|
FuelItem: STRING
|
||||||
Projectiles:
|
Projectiles:
|
||||||
|
|||||||
Reference in new issue
Block a user