Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added getNeighbourPawns method and implemented Retribution prayer logic #110

Closed
wants to merge 0 commits into from
Closed

Conversation

micheal-earl
Copy link

What has been done?

Added utility method to find all neighboring pawns surrounding a target pawn
Implemented Retribution prayer logic, still needs to account for players being pvp attackable

This closes #108

Copy link
Contributor

@DennisSnijder DennisSnijder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! As I'm not as involved in this project I can't review your Pull Request functionally. So i left some "code quality" comments. 😄

if (Prayers.isActive(player, Prayer.RETRIBUTION)) {
val targets = player.getNeighbourPawns()
for (target in targets) {
if (!target.isDead()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would rater see something like if (target.isDead()) { continue; }.
this probably makes it a bit more readable and prevents from stacking indentions.

target.hit(damage = (player.getSkills().getCurrentLevel(Skills.PRAYER) / 4))
} else if (target is Npc) {
if (target.isSpawned() && target.def.isAttackable() && target.lock.canBeAttacked()) {
player.graphic(437)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both statements for players and npc's are identical, perhaps do something at the start of the loop like target is not NPC || target is not Player => continue and execute the code beneath there.

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.

Add Retribution Effect
2 participants