mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-03 08:39:11 +00:00
348e5cc8dc
* Uses a hierarchy of WeaponClasses -> Weapons for performing attacks, with WeaponClass having a set of styles and associated Attacks for those styles. Weapons and their classes are built with an easy to use and clean DSL. * Adds a BonusContainer mixin, so that Equipment, Weapons, and WeaponClasses can all have their own set of bonuses which apply to the player. * Allows attacks to be queued to the Mobs CombatState instance from external code, allowing e.g., NPCs or auto-cast to queue attacks to be executed.
18 lines
318 B
Ruby
18 lines
318 B
Ruby
java_import 'org.apollo.cache.def.EquipmentDefinition'
|
|
|
|
EQUIPMENT = {}
|
|
|
|
def create_equipment(item, &block)
|
|
equipment = Equipment.new
|
|
equipment.instance_eval block
|
|
|
|
find_entities :item, item do |equipment_item|
|
|
EQUIPMENT[id] = equipment
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
class Equipment
|
|
include Combat::BonusContainer
|
|
end |