Skip to content

Commit

Permalink
backstab
Browse files Browse the repository at this point in the history
  • Loading branch information
matsu1213 committed Sep 21, 2024
1 parent 172eab6 commit 63ed225
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/net/azisaba/leoncsaddon/WeaponConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public void init(){
double damage = configuration.getDouble(key + ".damage",0);
double headshotBonusDamage = configuration.getDouble(key + ".headshotBonusDamage",0);
double criticalBonusDamage = configuration.getDouble(key + ".criticalBonusDamage",0);
double backstabBonusDamage = configuration.getDouble(key + ".backstabBonusDamage", 0);
double guardMult = configuration.getDouble(key + ".guardMult",1.0);
float walkSpeed = (float) configuration.getDouble(key + ".walkSpeed",0.2);
boolean canSprint = configuration.getBoolean(key + ".canSprint",false);
Expand Down Expand Up @@ -77,7 +78,7 @@ public void init(){
}
}

weaponsMap.put(key,new WeaponConfigData(key, type, isMain, requirements, damage, headshotBonusDamage, criticalBonusDamage, guardMult, walkSpeed, canSprint, reduceStartTick, reduceEndTick, reduceDamage, projectileSizeXZ, projectileSizeY, potionEffectList));
weaponsMap.put(key,new WeaponConfigData(key, type, isMain, requirements, damage, headshotBonusDamage, criticalBonusDamage, backstabBonusDamage, guardMult, walkSpeed, canSprint, reduceStartTick, reduceEndTick, reduceDamage, projectileSizeXZ, projectileSizeY, potionEffectList));

});
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/net/azisaba/leoncsaddon/WeaponConfigData.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class WeaponConfigData {
public final double damage;
public final double headshotBonusDamage;
public final double criticalBonusDamage;
public final double backstabBonusDamage;
public final double projectileSizeXZ;
public final double projectileSizeY;

Expand All @@ -26,14 +27,15 @@ public class WeaponConfigData {
public final int reduceEndTick;
public final double reduceDamage;

public WeaponConfigData(String name, List<String> type, boolean isMain, List<String> requirements, double damage, double headshotBonusDamage, double criticalBonusDamage, double guardMult, float walkSpeed, boolean canSprint, int reduceStartTick, int reduceEndTick, double reduceDamage, double projectileSizeXZ, double projectileSizeY, List<PotionEffect> potionEffectList){
public WeaponConfigData(String name, List<String> type, boolean isMain, List<String> requirements, double damage, double headshotBonusDamage, double criticalBonusDamage, double backstabBonusDamage, double guardMult, float walkSpeed, boolean canSprint, int reduceStartTick, int reduceEndTick, double reduceDamage, double projectileSizeXZ, double projectileSizeY, List<PotionEffect> potionEffectList){
this.type = type;
this.isMain = isMain;
this.requirements = requirements;
this.name = name;
this.damage = damage;
this.headshotBonusDamage = headshotBonusDamage;
this.criticalBonusDamage = criticalBonusDamage;
this.backstabBonusDamage = backstabBonusDamage;
this.guardMult = guardMult;
this.walkSpeed = walkSpeed;
this.canSprint = canSprint;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public void onWeaponDamage(WeaponDamageEntityEvent e){
if(e.isCritical()){
e.setDamage(e.getDamage() + data.criticalBonusDamage);
}
if(e.isBackstab()){
e.setDamage(e.getDamage() + data.backstabBonusDamage);
}

if(e.getDamager() instanceof Projectile){

Expand Down

0 comments on commit 63ed225

Please sign in to comment.