2025-02-27 15:54:42 -05:00
|
|
|
|
package kamkeel.npcs;
|
|
|
|
|
|
|
|
|
|
|
|
import kamkeel.npcs.controllers.AttributeController;
|
|
|
|
|
|
import kamkeel.npcs.controllers.data.attribute.AttributeDefinition;
|
|
|
|
|
|
import kamkeel.npcs.controllers.data.attribute.AttributeValueType;
|
2025-03-13 17:14:45 -04:00
|
|
|
|
import kamkeel.npcs.controllers.data.attribute.requirement.RequirementCheckerRegistry;
|
2025-03-18 13:26:50 -04:00
|
|
|
|
import kamkeel.npcs.controllers.data.attribute.requirement.types.ProfileSlotRequirement;
|
2025-02-28 18:31:59 -05:00
|
|
|
|
import kamkeel.npcs.controllers.data.attribute.requirement.types.QuestActiveRequirement;
|
2025-02-28 18:21:14 -05:00
|
|
|
|
import kamkeel.npcs.controllers.data.attribute.requirement.types.QuestCompletedRequirement;
|
2025-03-18 13:26:50 -04:00
|
|
|
|
import kamkeel.npcs.controllers.data.attribute.requirement.types.SoulbindRequirement;
|
2025-02-24 16:08:22 -05:00
|
|
|
|
|
|
|
|
|
|
/**
|
2025-02-24 20:07:32 -05:00
|
|
|
|
* ModAttributes registers the core attributes (both non–magic and magic–based).
|
2025-02-24 16:08:22 -05:00
|
|
|
|
*/
|
2025-02-27 15:54:42 -05:00
|
|
|
|
public class CustomAttributes {
|
2025-02-26 22:49:26 -05:00
|
|
|
|
public static final String HEALTH_KEY = "health";
|
2025-03-14 04:40:19 -04:00
|
|
|
|
public static final String HEALTH_BOOST_KEY = "health_boost";
|
2025-02-26 22:49:26 -05:00
|
|
|
|
public static final String MAIN_ATTACK_KEY = "main_attack";
|
|
|
|
|
|
public static final String MAIN_ATTACK_BOOST_KEY = "main_attack_boost";
|
|
|
|
|
|
public static final String NEUTRAL_KEY = "neutral";
|
|
|
|
|
|
public static final String NEUTRAL_BOOST_KEY = "neutral_boost";
|
|
|
|
|
|
public static final String CRITICAL_DAMAGE_KEY = "critical_damage";
|
|
|
|
|
|
public static final String CRITICAL_CHANCE_KEY = "critical_chance";
|
|
|
|
|
|
public static final String MAGIC_DAMAGE_KEY = "magic_damage";
|
|
|
|
|
|
public static final String MAGIC_BOOST_KEY = "magic_boost";
|
|
|
|
|
|
public static final String MAGIC_DEFENSE_KEY = "magic_defense";
|
|
|
|
|
|
public static final String MAGIC_RESISTANCE_KEY = "magic_resistance";
|
2025-03-14 04:40:19 -04:00
|
|
|
|
public static final String MOVEMENT_SPEED_KEY = "movement_speed";
|
|
|
|
|
|
public static final String KNOCKBACK_RES_KEY = "knockback_res";
|
2025-02-26 22:49:26 -05:00
|
|
|
|
|
2025-03-14 04:40:19 -04:00
|
|
|
|
public static AttributeDefinition HEALTH;
|
|
|
|
|
|
public static AttributeDefinition HEALTH_BOOST;
|
2025-02-26 22:49:26 -05:00
|
|
|
|
public static AttributeDefinition MAIN_ATTACK;
|
|
|
|
|
|
public static AttributeDefinition MAIN_BOOST;
|
|
|
|
|
|
public static AttributeDefinition NEUTRAL_ATTACK;
|
|
|
|
|
|
public static AttributeDefinition NEUTRAL_BOOST;
|
|
|
|
|
|
public static AttributeDefinition CRITICAL_CHANCE;
|
|
|
|
|
|
public static AttributeDefinition CRITICAL_DAMAGE;
|
|
|
|
|
|
public static AttributeDefinition MAGIC_DAMAGE;
|
|
|
|
|
|
public static AttributeDefinition MAGIC_BOOST;
|
|
|
|
|
|
public static AttributeDefinition MAGIC_DEFENSE;
|
|
|
|
|
|
public static AttributeDefinition MAGIC_RESISTANCE;
|
2025-03-14 04:40:19 -04:00
|
|
|
|
public static AttributeDefinition MOVEMENT_SPEED;
|
|
|
|
|
|
public static AttributeDefinition KNOCKBACK_RES;
|
2025-02-24 20:07:32 -05:00
|
|
|
|
|
2025-03-13 17:14:45 -04:00
|
|
|
|
public CustomAttributes() {
|
2025-02-27 00:30:39 -05:00
|
|
|
|
HEALTH = AttributeController.registerAttribute(HEALTH_KEY, "Health", 'c', AttributeValueType.FLAT, AttributeDefinition.AttributeSection.BASE);
|
2025-03-14 04:40:19 -04:00
|
|
|
|
HEALTH_BOOST = AttributeController.registerAttribute(HEALTH_BOOST_KEY, "Health Boost", 'c', AttributeValueType.PERCENT, AttributeDefinition.AttributeSection.MODIFIER);
|
|
|
|
|
|
HEALTH_BOOST.setTranslationKey("attribute.name.generic.maxHealth");
|
2025-02-26 22:49:26 -05:00
|
|
|
|
|
2025-02-27 00:30:39 -05:00
|
|
|
|
MAIN_ATTACK = AttributeController.registerAttribute(MAIN_ATTACK_KEY, "Main Attack Damage", '4', AttributeValueType.FLAT, AttributeDefinition.AttributeSection.BASE);
|
|
|
|
|
|
MAIN_BOOST = AttributeController.registerAttribute(MAIN_ATTACK_BOOST_KEY, "Main Attack Damage", '4', AttributeValueType.PERCENT, AttributeDefinition.AttributeSection.MODIFIER);
|
2025-02-26 22:49:26 -05:00
|
|
|
|
|
2025-02-27 00:30:39 -05:00
|
|
|
|
NEUTRAL_ATTACK = AttributeController.registerAttribute(NEUTRAL_KEY, "Neutral Damage", '6', AttributeValueType.FLAT, AttributeDefinition.AttributeSection.BASE);
|
|
|
|
|
|
NEUTRAL_BOOST = AttributeController.registerAttribute(NEUTRAL_BOOST_KEY, "Neutral Damage", '6', AttributeValueType.PERCENT, AttributeDefinition.AttributeSection.MODIFIER);
|
2025-02-26 22:49:26 -05:00
|
|
|
|
|
2025-02-27 00:30:39 -05:00
|
|
|
|
CRITICAL_CHANCE = AttributeController.registerAttribute(CRITICAL_CHANCE_KEY, "Critical Chance", '6', AttributeValueType.PERCENT, AttributeDefinition.AttributeSection.INFO);
|
|
|
|
|
|
CRITICAL_DAMAGE = AttributeController.registerAttribute(CRITICAL_DAMAGE_KEY, "Critical Damage", '6', AttributeValueType.FLAT, AttributeDefinition.AttributeSection.INFO);
|
2025-02-26 22:49:26 -05:00
|
|
|
|
|
2025-02-27 00:30:39 -05:00
|
|
|
|
MAGIC_DAMAGE = AttributeController.registerAttribute(MAGIC_DAMAGE_KEY, "Magic Damage", '3', AttributeValueType.MAGIC, AttributeDefinition.AttributeSection.BASE);
|
|
|
|
|
|
MAGIC_BOOST = AttributeController.registerAttribute(MAGIC_BOOST_KEY, "Magic Damage", '3', AttributeValueType.MAGIC, AttributeDefinition.AttributeSection.MODIFIER);
|
2025-02-26 22:49:26 -05:00
|
|
|
|
|
2025-02-27 00:30:39 -05:00
|
|
|
|
MAGIC_DEFENSE = AttributeController.registerAttribute(MAGIC_DEFENSE_KEY, "Magic Defense", 'b', AttributeValueType.MAGIC, AttributeDefinition.AttributeSection.BASE);
|
|
|
|
|
|
MAGIC_RESISTANCE = AttributeController.registerAttribute(MAGIC_RESISTANCE_KEY, "Magic Resistance", 'b', AttributeValueType.MAGIC, AttributeDefinition.AttributeSection.MODIFIER);
|
2025-02-28 18:17:39 -05:00
|
|
|
|
|
2025-03-14 04:40:19 -04:00
|
|
|
|
MOVEMENT_SPEED = AttributeController.registerAttribute(MOVEMENT_SPEED_KEY, "Movement Speed", 'a', AttributeValueType.PERCENT, AttributeDefinition.AttributeSection.MODIFIER);
|
|
|
|
|
|
MOVEMENT_SPEED.setTranslationKey("attribute.name.generic.movementSpeed");
|
|
|
|
|
|
|
|
|
|
|
|
KNOCKBACK_RES = AttributeController.registerAttribute(KNOCKBACK_RES_KEY, "Knockback Resistance", 'b', AttributeValueType.PERCENT, AttributeDefinition.AttributeSection.MODIFIER);
|
|
|
|
|
|
KNOCKBACK_RES.setTranslationKey("attribute.name.generic.knockbackResistance");
|
2025-02-28 18:17:39 -05:00
|
|
|
|
|
2025-02-28 19:15:05 -05:00
|
|
|
|
// TODO: Attributes
|
|
|
|
|
|
// Durability Attribute
|
|
|
|
|
|
// Unique Name Attribute
|
|
|
|
|
|
|
2025-02-28 18:17:39 -05:00
|
|
|
|
// Requirement
|
|
|
|
|
|
RequirementCheckerRegistry.registerChecker(new QuestCompletedRequirement());
|
2025-02-28 18:31:59 -05:00
|
|
|
|
RequirementCheckerRegistry.registerChecker(new QuestActiveRequirement());
|
2025-03-18 13:26:50 -04:00
|
|
|
|
RequirementCheckerRegistry.registerChecker(new ProfileSlotRequirement());
|
|
|
|
|
|
RequirementCheckerRegistry.registerChecker(new SoulbindRequirement());
|
2025-02-24 16:08:22 -05:00
|
|
|
|
}
|
|
|
|
|
|
}
|