mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-01 21:24:43 +02:00
Rewrote the RNG system to be more unified
This commit is contained in:
@ -11,10 +11,10 @@ import com.gmail.nossr50.skills.SkillManager;
|
||||
import com.gmail.nossr50.util.Permissions;
|
||||
import com.gmail.nossr50.util.player.NotificationManager;
|
||||
import com.gmail.nossr50.util.player.UserManager;
|
||||
import com.gmail.nossr50.util.random.RandomChanceUtil;
|
||||
import com.gmail.nossr50.util.skills.CombatUtils;
|
||||
import com.gmail.nossr50.util.skills.RankUtils;
|
||||
import com.gmail.nossr50.util.skills.SkillActivationType;
|
||||
import com.gmail.nossr50.util.skills.SkillUtils;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -49,7 +49,7 @@ public class SwordsManager extends SkillManager {
|
||||
* @param target The defending entity
|
||||
*/
|
||||
public void ruptureCheck(LivingEntity target) {
|
||||
if (SkillUtils.isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.SWORDS_RUPTURE, getPlayer(), getSkillLevel(), activationChance)) {
|
||||
if (RandomChanceUtil.isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.SWORDS_RUPTURE, getPlayer())) {
|
||||
|
||||
if (target instanceof Player) {
|
||||
Player defender = (Player) target;
|
||||
@ -85,7 +85,7 @@ public class SwordsManager extends SkillManager {
|
||||
* @param damage The amount of damage initially dealt by the event
|
||||
*/
|
||||
public void counterAttackChecks(LivingEntity attacker, double damage) {
|
||||
if (SkillUtils.isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.SWORDS_COUNTER_ATTACK, getPlayer(), getSkillLevel(), activationChance)) {
|
||||
if (RandomChanceUtil.isActivationSuccessful(SkillActivationType.RANDOM_LINEAR_100_SCALE_WITH_CAP, SubSkillType.SWORDS_COUNTER_ATTACK, getPlayer())) {
|
||||
CombatUtils.dealDamage(attacker, damage / Swords.counterAttackModifier, getPlayer());
|
||||
|
||||
NotificationManager.sendPlayerInformation(getPlayer(), NotificationType.SUBSKILL_MESSAGE, "Swords.Combat.Countered");
|
||||
|
Reference in New Issue
Block a user