Skip to content

Add caster block_list to all skill_get_* accessors - #3436

Open
MrKeiKun wants to merge 2 commits into
HerculesWS:masterfrom
MrKeiKun:feat-2793-skill-get-block-list
Open

Add caster block_list to all skill_get_* accessors#3436
MrKeiKun wants to merge 2 commits into
HerculesWS:masterfrom
MrKeiKun:feat-2793-skill-get-block-list

Conversation

@MrKeiKun

Copy link
Copy Markdown
Contributor

Pull Request Prelude

Changes Proposed

  • Add struct block_list *bl as the first parameter to every skill_get_* accessor keyed by skill_id, following the existing precedent set by skill->get_range2.
  • Update all call sites across the codebase (skill.c, battle.c, clif.c, status.c, unit.c, pc.c, mob.c, and others) to pass the caster through.
  • Regenerate the corresponding HPMHooking_map.Hooks.inc hook blocks so HPM plugins can hook these functions with the new signature.
  • Base behavior is unchanged — bl is not read by any of the default implementations. This is purely enabling infrastructure so a plugin hook can branch on the caster (e.g. bl->type, or a specific unit) when overriding a skill_get_* function, which previously had no way to know who was casting.

Converted:

  • get_hit
  • get_inf
  • get_ele
  • get_nk
  • get_max
  • get_range
  • get_range2
  • get_splash
  • get_hp
  • get_sp
  • get_hp_rate
  • get_sp_rate
  • get_state
  • get_spiritball
  • get_item_index
  • get_itemid
  • get_itemqty
  • get_item_any_flag
  • get_equip_id
  • get_equip_amount
  • get_equip_any_flag
  • get_zeny
  • get_num
  • get_cast
  • get_delay
  • get_walkdelay
  • get_time
  • get_time2
  • get_castdef
  • get_weapontype
  • get_ammotype
  • get_ammo_qty
  • get_inf2
  • get_castcancel
  • get_maxcount
  • get_blewcount
  • get_mhp
  • get_msp
  • get_castnodex
  • get_delaynodex
  • get_type
  • get_unit_id
  • get_unit_interval
  • get_unit_range
  • get_unit_target
  • get_unit_bl_target
  • get_unit_flag
  • get_unit_layout_type
  • get_cooldown
  • get_fixed_cast
  • get_casttype
  • get_sc_type
  • get_name
  • get_desc
  • get_elemental_type

Issues addressed: #2793

Adds struct block_list *bl as the first parameter to skill->get_hit, get_ele, get_num, get_range, get_splash, get_sp, get_zeny, get_cast, get_delay, get_cooldown, get_castdef, get_type, get_maxcount and get_blewcount, following the existing get_range2 precedent, so plugins can vary a skill's stats based on who is casting it (fixes HerculesWS#2793).
Adds struct block_list *bl as the first parameter to the remaining skill_get_* getters (metadata, cost, requirement, unit-placement and cast-timing accessors), matching the earlier damage/behavior getter conversion. Excludes get_index, get_index_sub, get_casttype2, get_any_item_index and get_new_group_id, which are keyed by an internal index or have no skill_id-based shape, and get_requirement, which already receives the caster via its sd parameter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant