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

Bonfire Spring tweaks #2657

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletions src/abilities/Abolished.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Creature } from '../creature';
import { Effect } from '../effect';
import * as arrayUtils from '../utility/arrayUtils';
import { getPointFacade } from '../utility/pointfacade';
import { isUndefined } from 'underscore';

/** Creates the abilities
* @param {Object} G the game object
Expand Down Expand Up @@ -210,19 +211,37 @@ export default (G) => {
{
// Type : Can be "onQuery", "onStartPhase", "onDamage"
trigger: 'onQuery',
range: 6,
range: 3,
bonus_range: 0,
is_used: false,

_getbonusrange() {
if (this.isUpgraded()) {
if (this.is_used == false) {
this.bonus_range += 1;
}
else {
this.is_used = false;
this.bonus_range = 0;
}
return this.bonus_range;
}
return 0;
},
require() {
return this.testRequirements();
},

query() {
const ability = this;
const crea = this.creature;
this.bonus_range = ability._getbonusrange();

// Relocates to any hex within range except for the current hex
crea.queryMove({
noPath: true,
isAbility: true,
range: G.grid.getFlyingRange(crea.x, crea.y, this.range, crea.size, crea.id),
range: G.grid.getFlyingRange(crea.x, crea.y, this.range + this.bonus_range, crea.size, crea.id),
callback: function (hex, args) {
if (hex.x == args.creature.x && hex.y == args.creature.y) {
// Prevent null movement
Expand All @@ -238,10 +257,6 @@ export default (G) => {
const ability = this;
ability.end();

if (this.isUpgraded()) {
this.range += 1;
}

const targets = ability.getTargets(ability.creature.adjacentHexes(1));

targets.forEach(function (item) {
Expand Down Expand Up @@ -308,6 +323,8 @@ export default (G) => {
G.activeCreature.queryMove();
},
});

this.is_used = true;
},
},
// Fourth Ability: Greater Pyre
Expand Down
Loading