Element Commands
Element offense, defense, and coefficient helpers for players.Members
coefficientElements
Calculate elemental damage coefficient against another player Determines the damage multiplier when this player attacks another player, taking into account the attacker’s offensive elements, the defender’s elemental efficiency, and elemental defense from equipment. This is used in the battle system to calculate elemental damage modifiers.- Source:
packages/server/src/Player/ElementManager.ts - Kind:
method - Defined in:
IElementManager
Signature
Parameters
otherPlayer:RpgPlayer
Returns
Numerical coefficient to multiply base damage byExamples
elements
Gets all offensive elements available to the player from equipped weapons and armor. This determines what elemental damage types the player can deal in combat. The system automatically combines elements from all equipped items and removes duplicates.- Source:
packages/server/src/Player/ElementManager.ts - Kind:
property - Defined in:
IElementManager
Signature
Returns
Array of element objects with rate and element properties for offensive capabilitieselementsDefense
Gets the defensive capabilities against various elements from equipped items. The system automatically consolidates multiple defensive items, keeping only the highest protection rate for each element type.- Source:
packages/server/src/Player/ElementManager.ts - Kind:
property - Defined in:
IElementManager
Signature
Returns
Array of element defense objects with rate and element propertieselementsEfficiency
Manages the player’s elemental efficiency modifiers, which determine how effective different elements are against this player. Values greater than 1 indicate vulnerability, while values less than 1 indicate resistance. This combines both class-based efficiency and player-specific modifiers.- Source:
packages/server/src/Player/ElementManager.ts - Kind:
property - Defined in:
IElementManager
Signature
Returns
Array of element efficiency objects with rate and element propertiesWithElementManager
Element Manager Mixin Provides elemental management capabilities to any class. This mixin handles elemental resistances, vulnerabilities, and attack elements. It manages both defensive capabilities (elementsDefense) and offensive elements from equipment, as well as player-specific elemental efficiency modifiers.- Source:
packages/server/src/Player/ElementManager.ts - Kind:
function
Signature
Parameters
Base:TBase