mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-04 00:38:11 +00:00
Build a framework for a maintainable combat plugin
* 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.
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
SCIMITAR_WIDGET_ID = 81
|
||||
SCIMITAR_SPECIAL_BAR_ID = 21
|
||||
|
||||
create_weapon_class :scimitar, widget: SCIMITAR_WIDGET_ID do
|
||||
default_speed 4
|
||||
special_bar SCIMITAR_SPECIAL_BAR_ID
|
||||
|
||||
attack_bonuses crush: -2
|
||||
defence_bonuses slash: -1
|
||||
|
||||
add_style :accurate, attack_type: :slash, animation: 390
|
||||
add_style :aggressive, attack_type: :slash, animation: 390
|
||||
add_style :alt_aggressive, attack_type: :stab, animation: 391
|
||||
add_style :defensive, attack_type: :slash, animation: 390
|
||||
end
|
||||
|
||||
create_weapon :iron_scimitar do
|
||||
attack_bonuses stab: 2, slash: 10
|
||||
other_bonuses melee_strength: 9
|
||||
end
|
||||
|
||||
create_weapon :steel_scimitar do
|
||||
attack_bonuses stab: 3, slash: 15
|
||||
other_bonuses melee_strength: 14
|
||||
end
|
||||
|
||||
create_weapon /(black|white) scimitar/ do
|
||||
attack_bonuses stab: 4, slash: 19
|
||||
other_bonuses melee_strength: 14
|
||||
end
|
||||
|
||||
create_weapon :mithril_scimitar do
|
||||
attack_bonuses stab: 5, slash: 21
|
||||
other_bonuses melee_strength: 20
|
||||
end
|
||||
|
||||
create_weapon :adamant_scimitar do
|
||||
attack_bonuses stab: 6, slash: 29
|
||||
other_bonuses melee_strength: 28
|
||||
end
|
||||
|
||||
create_weapon :rune_scimitar do
|
||||
attack_bonuses stab: 7, slash: 45
|
||||
other_bonuses melee_strength: 44
|
||||
end
|
||||
|
||||
create_weapon :dragon_scimitar do
|
||||
attack_bonuses :stab => 8, slash: 67
|
||||
other_bonuses melee_strength: 66
|
||||
end
|
||||
Reference in New Issue
Block a user