Skip to content

Commit 3578528

Browse files
committed
Swords stab damage is now config-driven
Fixes #5164
1 parent 7e1e4c8 commit 3578528

File tree

6 files changed

+26
-52
lines changed

6 files changed

+26
-52
lines changed

Changelog.txt

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
Version 2.2.035
2+
Swords subskill Stab is now configurable in advanced.yml
3+
Added 'Skills.Swords.Stab.Base_Damage' to advanced.yml
4+
Added 'Skills.Swords.Stab.Per_Rank_Multiplier' to advanced.yml
5+
6+
NOTES:
7+
The new config settings will be added automatically to advanced.yml
8+
19
Version 2.2.034
210
Fixed bug where mcMMO would drop items in such a way that they get stuck in an adjacent block and float to the surface
311
Fixed a rare edge case where null entities during chunk unload would cause a NullPointerException and potentially lead to server instability

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>com.gmail.nossr50.mcMMO</groupId>
44
<artifactId>mcMMO</artifactId>
5-
<version>2.2.034</version>
5+
<version>2.2.035-SNAPSHOT</version>
66
<name>mcMMO</name>
77
<url>https://github.com/mcMMO-Dev/mcMMO</url>
88
<scm>

src/main/java/com/gmail/nossr50/config/AdvancedConfig.java

+8-29
Original file line numberDiff line numberDiff line change
@@ -575,35 +575,6 @@ private ChatColor getChatColor(String configColor) {
575575
return ChatColor.WHITE;
576576
}
577577

578-
/*public boolean isJSONStatHoverElementBold(StatType statType, boolean isPrefix) {
579-
String keyAddress = isPrefix ? "Prefix" : "Value";
580-
String keyLocation = "Style.JSON.Hover.Details." + StringUtils.getCapitalized(statType.toString()) +"."+keyAddress+".Bold";
581-
return config.getBoolean(keyLocation);
582-
}
583-
584-
public boolean isJSONStatHoverElementItalic(StatType statType, boolean isPrefix) {
585-
String keyAddress = isPrefix ? "Prefix" : "Value";
586-
String keyLocation = "Style.JSON.Hover.Details." + StringUtils.getCapitalized(statType.toString()) +"."+keyAddress+".Italics";
587-
return config.getBoolean(keyLocation);
588-
}
589-
590-
public boolean isJSONStatHoverElementUnderlined(StatType statType, boolean isPrefix) {
591-
String keyAddress = isPrefix ? "Prefix" : "Value";
592-
String keyLocation = "Style.JSON.Hover.Details." + StringUtils.getCapitalized(statType.toString()) +"."+keyAddress+".Underline";
593-
return config.getBoolean(keyLocation);
594-
}*/
595-
596-
/**
597-
* Some SubSkills have the ability to retain classic functionality
598-
*
599-
* @param subSkillType SubSkillType with classic functionality
600-
*
601-
* @return true if the subskill is in classic mode
602-
*/
603-
public boolean isSubSkillClassic(SubSkillType subSkillType) {
604-
return config.getBoolean(subSkillType.getAdvConfigAddress() + ".Classic");
605-
}
606-
607578
/* ACROBATICS */
608579
public double getDodgeDamageModifier() {
609580
return config.getDouble("Skills.Acrobatics.Dodge.DamageModifier", 2.0D);
@@ -851,6 +822,14 @@ public double getFluxMiningChance() {
851822
}
852823

853824
/* SWORDS */
825+
public double getStabBaseDamage() {
826+
return config.getDouble("Skills.Swords.Stab.Base_Damage", 1.0D);
827+
}
828+
829+
public double getStabPerRankMultiplier() {
830+
return config.getDouble("Skills.Swords.Stab.Per_Rank_Multiplier", 1.5D);
831+
}
832+
854833
public double getRuptureTickDamage(boolean isTargetPlayer, int rank) {
855834
String root = "Skills.Swords.Rupture.Rupture_Mechanics.Tick_Interval_Damage.Against_";
856835
String targetType = isTargetPlayer ? "Players" : "Mobs";

src/main/java/com/gmail/nossr50/skills/swords/SwordsManager.java

+5-21
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,13 @@ public void processRupture(@NotNull LivingEntity target) {
9090
}
9191
}
9292

93-
RuptureTask ruptureTask = new RuptureTask(mmoPlayer, target,
93+
final RuptureTask ruptureTask = new RuptureTask(mmoPlayer, target,
9494
mcMMO.p.getAdvancedConfig().getRuptureTickDamage(target instanceof Player, getRuptureRank()));
9595

96-
RuptureTaskMeta ruptureTaskMeta = new RuptureTaskMeta(mcMMO.p, ruptureTask);
96+
final RuptureTaskMeta ruptureTaskMeta = new RuptureTaskMeta(mcMMO.p, ruptureTask);
9797

9898
mcMMO.p.getFoliaLib().getScheduler().runAtEntityTimer(target, ruptureTask, 1, 1);
9999
target.setMetadata(MetadataConstants.METADATA_KEY_RUPTURE, ruptureTaskMeta);
100-
101-
// if (mmoPlayer.useChatNotifications()) {
102-
// NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.Bleeding");
103-
// }
104100
}
105101
}
106102

@@ -112,33 +108,21 @@ public double getStabDamage() {
112108
int rank = RankUtils.getRank(getPlayer(), SubSkillType.SWORDS_STAB);
113109

114110
if (rank > 0) {
115-
return (1.0D + (rank * 1.5));
111+
double baseDamage = mcMMO.p.getAdvancedConfig().getStabBaseDamage();
112+
double rankMultiplier = mcMMO.p.getAdvancedConfig().getStabPerRankMultiplier();
113+
return (baseDamage + (rank * rankMultiplier));
116114
}
117115

118116
return 0;
119117
}
120118

121-
public int getToolTier(@NotNull ItemStack itemStack) {
122-
if (ItemUtils.isNetheriteTool(itemStack))
123-
return 5;
124-
if (ItemUtils.isDiamondTool(itemStack))
125-
return 4;
126-
else if (ItemUtils.isIronTool(itemStack) || ItemUtils.isGoldTool(itemStack))
127-
return 3;
128-
else if (ItemUtils.isStoneTool(itemStack))
129-
return 2;
130-
else
131-
return 1;
132-
}
133-
134119
/**
135120
* Handle the effects of the Counter Attack ability
136121
*
137122
* @param attacker The {@link LivingEntity} being affected by the ability
138123
* @param damage The amount of damage initially dealt by the event
139124
*/
140125
public void counterAttackChecks(@NotNull LivingEntity attacker, double damage) {
141-
142126
if (ProbabilityUtil.isSkillRNGSuccessful(SubSkillType.SWORDS_COUNTER_ATTACK, mmoPlayer)) {
143127
CombatUtils.dealDamage(attacker, damage / Swords.counterAttackModifier, getPlayer());
144128

src/main/resources/advanced.yml

+3
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,9 @@ Skills:
473473
# Settings for Swords
474474
###
475475
Swords:
476+
Stab:
477+
Base_Damage: 1.0
478+
Per_Rank_Multiplier: 1.5
476479
Rupture:
477480
Rupture_Mechanics:
478481
# This is % chance, 15 would mean 15% percent of the time

src/main/resources/locale/locale_en_US.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ Commands.XPGain=&8XP GAIN: &f{0}
919919
Commands.xplock.locked=&6Your XP BAR is now locked to {0}!
920920
Commands.xplock.unlocked=&6Your XP BAR is now &aUNLOCKED&6!
921921
Commands.xprate.modified=&cThe XP RATE was modified to {0}
922-
Commands.xprate.over=&cmcMMO XP Rate Event is OVER!!
922+
Commands.xprate.over=&cmcMMO XP Rate Event is OVER!!
923923
Commands.xprate.proper.0=&cProper usage to change the XP rate is /xprate <integer> <true/false>
924924
Commands.xprate.proper.1=&cProper usage to restore the XP rate to default is /xprate reset
925925
Commands.xprate.proper.2=&cPlease specify true or false to indicate if this is an xp event or not

0 commit comments

Comments
 (0)