mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 05:06:45 +01:00
Added "Holy Hound" ability to Taming
This commit is contained in:
parent
2fee9df625
commit
62aaad8707
@ -38,6 +38,7 @@ Version 1.4.00-dev
|
||||
+ Added '/mcnotify' command to toggle ability notifications on/off
|
||||
+ Added ability for config files to automatically update with new keys, and prune out old ones
|
||||
+ Added config option to make .new config files instead over writing over old ones when updating
|
||||
+ Added "Holy Hound" ability to Taming
|
||||
= Fixed Green Thumb on wheat not working properly at rank 4
|
||||
= Fixed Green Thumb and Green Terra consuming twice the amount of seed needed
|
||||
= Fixed Green Terra not also checking Green Thumb permissions
|
||||
|
@ -197,6 +197,8 @@ public class AdvancedConfig extends ConfigLoader {
|
||||
public int getThickFurUnlock() { return config.getInt("Skills.Taming.ThickFur_UnlockLevel", 250); }
|
||||
public int getThickFurModifier() { return config.getInt("Skills.Taming.ThickFur_Modifier", 2); }
|
||||
|
||||
public int getHolyHoundUnlock() {return config.getInt("Skills.Taming.HolyHound_UnlockLevel", 375); }
|
||||
|
||||
public int getShockProofUnlock() { return config.getInt("Skills.Taming.ShockProof_UnlockLevel", 500); }
|
||||
public int getShockProofModifier() { return config.getInt("Skills.Taming.ShockProof_Modifier", 6); }
|
||||
|
||||
|
@ -219,8 +219,8 @@ public class EntityListener implements Listener {
|
||||
|
||||
switch (cause) {
|
||||
case CONTACT:
|
||||
case LAVA:
|
||||
case FIRE:
|
||||
case LAVA:
|
||||
if (Taming.canUseEnvironmentallyAware(player)) {
|
||||
Taming.processEnvironmentallyAware(player, wolf, event.getDamage());
|
||||
}
|
||||
@ -235,7 +235,7 @@ public class EntityListener implements Listener {
|
||||
case ENTITY_ATTACK:
|
||||
case PROJECTILE:
|
||||
if (Taming.canUseThickFur(player)) {
|
||||
event.setDamage(Taming.processThickFur(event.getDamage()));
|
||||
event.setDamage(Taming.processThickFur(wolf, event.getDamage()));
|
||||
|
||||
if (event.getDamage() == 0) {
|
||||
event.setCancelled(true);
|
||||
@ -245,7 +245,15 @@ public class EntityListener implements Listener {
|
||||
|
||||
case FIRE_TICK:
|
||||
if (Taming.canUseThickFur(player)) {
|
||||
wolf.setFireTicks(0);
|
||||
Taming.processThickFurFire(wolf);
|
||||
}
|
||||
return;
|
||||
|
||||
case MAGIC:
|
||||
case POISON:
|
||||
case WITHER:
|
||||
if (Taming.canUseHolyHound(player)) {
|
||||
Taming.processHolyHound(wolf, event.getDamage());
|
||||
}
|
||||
return;
|
||||
|
||||
@ -253,7 +261,7 @@ public class EntityListener implements Listener {
|
||||
case ENTITY_EXPLOSION:
|
||||
case LIGHTNING:
|
||||
if (Taming.canUseShockProof(player)) {
|
||||
event.setDamage(Taming.processShockProof(event.getDamage()));
|
||||
event.setDamage(Taming.processShockProof(wolf, event.getDamage()));
|
||||
|
||||
if (event.getDamage() == 0) {
|
||||
event.setCancelled(true);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.gmail.nossr50.skills.taming;
|
||||
|
||||
import org.bukkit.EntityEffect;
|
||||
import org.bukkit.entity.AnimalTamer;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Tameable;
|
||||
@ -14,6 +15,7 @@ import com.gmail.nossr50.util.Permissions;
|
||||
|
||||
public class Taming {
|
||||
public static int environmentallyAwareUnlockLevel = AdvancedConfig.getInstance().getEnviromentallyAwareUnlock();
|
||||
public static int holyHoundUnlockLevel = AdvancedConfig.getInstance().getHolyHoundUnlock();
|
||||
|
||||
public static double fastFoodServiceActivationChance = AdvancedConfig.getInstance().getFastFoodChance();
|
||||
public static int fastFoodServiceUnlockLevel = AdvancedConfig.getInstance().getFastFoodUnlock();
|
||||
@ -51,10 +53,20 @@ public class Taming {
|
||||
return SkillTools.unlockLevelReached(player, SkillType.TAMING, shockProofUnlockLevel) && Permissions.shockProof(player);
|
||||
}
|
||||
|
||||
public static int processThickFur(int damage) {
|
||||
public static boolean canUseHolyHound(Player player) {
|
||||
return SkillTools.unlockLevelReached(player, SkillType.TAMING, holyHoundUnlockLevel) && Permissions.holyHound(player);
|
||||
}
|
||||
|
||||
public static int processThickFur(Wolf wolf, int damage) {
|
||||
wolf.playEffect(EntityEffect.WOLF_SHAKE);
|
||||
return damage / thickFurModifier;
|
||||
}
|
||||
|
||||
public static void processThickFurFire(Wolf wolf) {
|
||||
wolf.playEffect(EntityEffect.WOLF_SMOKE);
|
||||
wolf.setFireTicks(0);
|
||||
}
|
||||
|
||||
public static void processEnvironmentallyAware(Player player, Wolf wolf, int damage) {
|
||||
if (damage > wolf.getHealth()) {
|
||||
return;
|
||||
@ -64,8 +76,15 @@ public class Taming {
|
||||
player.sendMessage(LocaleLoader.getString("Taming.Listener.Wolf"));
|
||||
}
|
||||
|
||||
public static int processShockProof(int damage) {
|
||||
public static int processShockProof(Wolf wolf, int damage) {
|
||||
wolf.playEffect(EntityEffect.WOLF_SHAKE);
|
||||
return damage / shockProofModifier;
|
||||
}
|
||||
|
||||
public static void processHolyHound(Wolf wolf, int damage) {
|
||||
int modifiedHealth = Math.min(wolf.getHealth() + damage, wolf.getMaxHealth());
|
||||
|
||||
wolf.setHealth(modifiedHealth);
|
||||
wolf.playEffect(EntityEffect.WOLF_HEARTS);
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ public class TamingCommand extends SkillCommand {
|
||||
private boolean canShockProof;
|
||||
private boolean canCallWild;
|
||||
private boolean canFastFood;
|
||||
private boolean canHolyHound;
|
||||
|
||||
public TamingCommand() {
|
||||
super(SkillType.TAMING);
|
||||
@ -40,11 +41,12 @@ public class TamingCommand extends SkillCommand {
|
||||
canSharpenedClaws = Permissions.sharpenedClaws(player);
|
||||
canShockProof = Permissions.shockProof(player);
|
||||
canThickFur = Permissions.thickFur(player);
|
||||
canHolyHound = Permissions.holyHound(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean effectsHeaderPermissions() {
|
||||
return canBeastLore || canCallWild || canEnvironmentallyAware || canFastFood || canGore || canSharpenedClaws || canShockProof || canThickFur;
|
||||
return canBeastLore || canCallWild || canEnvironmentallyAware || canFastFood || canGore || canSharpenedClaws || canShockProof || canThickFur || canHolyHound;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -79,6 +81,10 @@ public class TamingCommand extends SkillCommand {
|
||||
player.sendMessage(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.16"), LocaleLoader.getString("Taming.Effect.17")));
|
||||
}
|
||||
|
||||
if (canHolyHound) {
|
||||
player.sendMessage(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.18"), LocaleLoader.getString("Taming.Effect.19")));
|
||||
}
|
||||
|
||||
if (canCallWild) {
|
||||
player.sendMessage(LocaleLoader.getString("Effects.Template", LocaleLoader.getString("Taming.Effect.12"), LocaleLoader.getString("Taming.Effect.13")));
|
||||
player.sendMessage(LocaleLoader.getString("Taming.Effect.14", Config.getInstance().getTamingCOTWOcelotCost()));
|
||||
@ -88,7 +94,7 @@ public class TamingCommand extends SkillCommand {
|
||||
|
||||
@Override
|
||||
protected boolean statsHeaderPermissions() {
|
||||
return canEnvironmentallyAware || canFastFood || canGore || canSharpenedClaws || canShockProof || canThickFur;
|
||||
return canEnvironmentallyAware || canFastFood || canGore || canSharpenedClaws || canShockProof || canThickFur || canHolyHound;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -120,6 +126,15 @@ public class TamingCommand extends SkillCommand {
|
||||
}
|
||||
}
|
||||
|
||||
if (canHolyHound) {
|
||||
if (skillValue < Taming.holyHoundUnlockLevel) {
|
||||
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Taming.Ability.Locked.5", Taming.holyHoundUnlockLevel)));
|
||||
}
|
||||
else {
|
||||
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template", LocaleLoader.getString("Taming.Ability.Bonus.10"), LocaleLoader.getString("Taming.Ability.Bonus.11")));
|
||||
}
|
||||
}
|
||||
|
||||
if (canShockProof) {
|
||||
if (skillValue < Taming.shockProofUnlockLevel) {
|
||||
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", LocaleLoader.getString("Taming.Ability.Locked.2", Taming.shockProofUnlockLevel)));
|
||||
|
@ -187,6 +187,7 @@ public final class Permissions {
|
||||
public static boolean environmentallyAware(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.environmentallyaware"); }
|
||||
public static boolean fastFoodService(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.fastfoodservice"); }
|
||||
public static boolean gore(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.gore"); }
|
||||
public static boolean holyHound(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.holyhound"); }
|
||||
public static boolean thickFur(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.thickfur"); }
|
||||
public static boolean sharpenedClaws(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.sharpenedclaws"); }
|
||||
public static boolean shockProof(Permissible permissible) { return permissible.hasPermission("mcmmo.ability.taming.shockproof"); }
|
||||
|
@ -290,6 +290,9 @@ Skills:
|
||||
ThickFur_UnlockLevel: 250
|
||||
ThickFur_Modifier: 2
|
||||
|
||||
# HolyHound_UnlockLevel: Level when HolyHound unlocks
|
||||
HolyHound_UnlockLevel: 375
|
||||
|
||||
# ShockProof_UnlockLevel: Level when ShockProof unlocks
|
||||
# ShockProof_Modifier: Damage will get divided by this modifier
|
||||
ShockProof_UnlockLevel: 500
|
||||
|
@ -288,11 +288,14 @@ Taming.Ability.Bonus.6=Sharpened Claws
|
||||
Taming.Ability.Bonus.7=+{0} Damage
|
||||
Taming.Ability.Bonus.8=Fast Food Service
|
||||
Taming.Ability.Bonus.9={0} Chance for heal on attack
|
||||
Taming.Ability.Bonus.10=Holy Hound
|
||||
Taming.Ability.Bonus.11=Regain health when damaged by magic or poison
|
||||
Taming.Ability.Locked.0=LOCKED UNTIL {0}+ SKILL (ENVIRONMENTALLY AWARE)
|
||||
Taming.Ability.Locked.1=LOCKED UNTIL {0}+ SKILL (THICK FUR)
|
||||
Taming.Ability.Locked.2=LOCKED UNTIL {0}+ SKILL (SHOCK PROOF)
|
||||
Taming.Ability.Locked.3=LOCKED UNTIL {0}+ SKILL (SHARPENED CLAWS)
|
||||
Taming.Ability.Locked.4=LOCKED UNTIL {0}+ SKILL (FAST FOOD SERVICE)
|
||||
Taming.Ability.Locked.5=LOCKED UNTIL {0}+ SKILL (HOLY HOUND)
|
||||
Taming.Combat.Chance.Gore=[[RED]]Gore Chance: [[YELLOW]]{0}
|
||||
Taming.Effect.0=Beast Lore
|
||||
Taming.Effect.1=Bone-whacking inspects wolves & ocelots
|
||||
@ -304,6 +307,8 @@ Taming.Effect.14=[[GRAY]]COTW (Ocelot): Crouch and left-click with {0} Fish in h
|
||||
Taming.Effect.15=[[GRAY]]COTW (Wolf): Crouch and left-click with {0} Bones in hand
|
||||
Taming.Effect.16=Fast Food Service
|
||||
Taming.Effect.17=Chance for wolves to heal on attack
|
||||
Taming.Effect.18=Holy Hound
|
||||
Taming.Effect.19=Healed by Magic & Poison
|
||||
Taming.Effect.2=Gore
|
||||
Taming.Effect.3=Critical Strike that applies Bleed
|
||||
Taming.Effect.4=Sharpened Claws
|
||||
|
@ -508,6 +508,7 @@ permissions:
|
||||
mcmmo.ability.taming.environmentallyaware: true
|
||||
mcmmo.ability.taming.fastfoodservice: true
|
||||
mcmmo.ability.taming.gore: true
|
||||
mcmmo.ability.taming.holyhound: true
|
||||
mcmmo.ability.taming.sharpenedclaws: true
|
||||
mcmmo.ability.taming.shockproof: true
|
||||
mcmmo.ability.taming.thickfur: true
|
||||
@ -521,6 +522,8 @@ permissions:
|
||||
description: Allows access to the Fast Food Service ability
|
||||
mcmmo.ability.taming.gore:
|
||||
description: Allows access to the Gore ability
|
||||
mcmmo.ability.taming.holyhound:
|
||||
description: Allows access to the Holy Hound ability
|
||||
mcmmo.ability.taming.sharpenedclaws:
|
||||
description: Allows access to the Sharpened Claws ability
|
||||
mcmmo.ability.taming.shockproof:
|
||||
|
Loading…
Reference in New Issue
Block a user