Artifact-Javascript icon indicating copy to clipboard operation
Artifact-Javascript copied to clipboard

Allseeing One's Favor does not give modified hero +2 regen

Open julienlegault opened this issue 6 years ago • 4 comments

I've been digging around with this for a while, but I can't find a fix for it. g.set("Allseeing One's Favor", "unit"), p.set("Allseeing One's Favor", function (e, a, t, n) { if ("Red" != u.lanes[a].cards[n][t].Color || "Hero" != u.lanes[a].cards[n][t].CardType) return !1; return u.lanes[a].cards[n][t].div.addEventListener("continuousEffect", function (e) { u.lanes[e.detail.lane].cards.forEach(function (a) { null != a[e.detail.player].Name && a[e.detail.player] != u.lanes[e.detail.lane].cards[e.detail.card][e.detail.player] && (a[e.detail.player].regen[4] += 2, a[e.detail.player].updateDisplay()) }) }), !0 }),

This block doesn't seem to give the modified unit +2 regen. I tried just adding e.regen[4] +=2 but that doesn't work because e isn't the card modified.

julienlegault avatar May 10 '19 16:05 julienlegault

I think its the null != a[e.detail.player].Name && a[e.detail.player] != u.lanes[e.detail.lane].cards[e.detail.card][e.detail.player] is the issue statement, i believe changing it to be just null != a[e.detail.player].Name should also give the activated hero plus two regen.

julienlegault avatar Nov 29 '19 16:11 julienlegault

I have not looked over the code recently. But " a[e.detail.player] != u.lanes[e.detail.lane].cards[e.detail.card][e.detail.player] " looks like it has to do with only effecting Allies.
maybe is should be an "==" instead of a "!=". Does it currently work for your other units in the lane?

The code here is easier to read (https://github.com/bubblebooy/Artifact-Javascript/blob/master/src/cardEffects.js)

bubblebooy avatar Nov 29 '19 23:11 bubblebooy

It does effect allies, but not the unit it is cast on.

targetMap.set("Allseeing One's Favor" , "unit") effectMap.set("Allseeing One's Favor" , function(ev, lane, player, index){ if (board.lanes[lane].cards[index][player].Color != "Green" || board.lanes[lane].cards[index][player].CardType != "Hero") return false let card = board.lanes[lane].cards[index][player] card.div.addEventListener("continuousEffect", function(e){ let l = board.lanes[e.detail.lane] l.cards.forEach(function(card){ if (card[e.detail.player].Name != null && card[e.detail.player] != board.lanes[e.detail.lane].cards[e.detail.card][e.detail.player]) { card[e.detail.player].regen[4] += 2; card[e.detail.player].updateDisplay() } }) })

Thats the entire code to look at. If we change it to == won't it only effect the unit it's cast on? Or will it affect every unit in the lane then?

card.div.addEventListener("beforeTheActionPhase", function(e){ let currentLane = board.lanes[e.detail.lane] let index = e.detail.card for (var i = -1; i <= 1; i++) { if (currentLane.cards[index + i] && currentLane.cards[index + i][1-e.detail.player].Name != null){ currentLane.cards[index + i][1-e.detail.player].currentHealth[0] -= 2 - (sum(currentLane.cards[index + i][1-e.detail.player].currentArmor) < 0 ? sum(currentLane.cards[index + i][1-e.detail.player].currentArmor) : 0) } currentLane.collapse() } })

This is heartstopper aura, its calculating slightly differently, but still only checks if name != null if i'm not mistaken?

julienlegault avatar Nov 30 '19 02:11 julienlegault

Ya it looks like your correct. You should remove the card[e.detail.player] != board.lanes[e.detail.lane].cards[e.detail.card][e.detail.player] so that it effects the it is Hero cast on.

bubblebooy avatar Nov 30 '19 23:11 bubblebooy