PaulQbFeng / too-tanky

3 stars 0 forks source link

Inflict damage to target directly in damage method or separately #55

Closed PaulQbFeng closed 1 year ago

PaulQbFeng commented 1 year ago

in champion.py there is an auto_attack_damage and a do_auto_attack method.

But all over the code, sometimes we inflict the damage to the target, sometimes not.

Should we have separate methods ? Or a single one that always does damage to the target.

What do you think ?

Lysxia commented 1 year ago

It's useful to have a function that purely computes the damage for testing. do_auto_attack would handle applying on-hit effects, so I think of it as a quite different job.

LinSun00 commented 1 year ago

I think the cases where we actually need to separe the two are not so common. But having both never hurts and the damage, do_damage seperation is quite intuitive and a good feature to have overall

PaulQbFeng commented 1 year ago

do_auto_attack, do_damage or

hit_auto_attack, hit_damage

LinSun00 commented 1 year ago

I prefer first one. Second one can be confusing because it can be confused with on_hit_damage

PaulQbFeng commented 1 year ago

damage, do_damage in https://github.com/PaulQbFeng/too-tanky/pull/61