Skip to content

Commit cec87b7

Browse files
committed
Fix mutantactive. dive/steamatk were still not completely ported. Shield auto actives. Targeting checks (found lots with targeting rendering checking everything)
1 parent 03d328a commit cec87b7

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

actives.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
var Actives = (function(){
22
function mutantactive(t){
33
t.active = {};
4-
var abilities = ["hatch","freeze","burrow","destroy","steal","dive","heal","paradox","lycanthropy","scavenger","infection","gpull","devour","mutation","growth","ablaze","poison","deja","endow","guard","mitosis"];
5-
var index = Math.floor(rng.real()*abilities.length)-2;
4+
var abilities = ["hatch","freeze","burrow","destroy","steal","dive","heal","paradox","lycanthropy","scavenger","infect","gpull","devour","mutation","growth","ablaze","poison","deja","endow","guard","mitosis"];
5+
var index = Math.floor(rng.real()*(abilities.length+2))-2;
66
if (index<0){
7-
t[["momentum","immaterial"][-index]] = true;
7+
t.status[["momentum","immaterial"][~index]] = true;
88
}else{
9-
var active = Actives[abilities[Math.floor(rng.real()*abilities.length)]];
9+
var active = Actives[abilities[index]];
1010
if (active == Actives.scavenger){
1111
t.active.death = active;
1212
}else{
@@ -207,7 +207,8 @@ disshield:function(c,t){
207207
}
208208
},
209209
dive:function(c,t){
210-
c.dive += c.trueatk();
210+
c.defstatus("dive", 0);
211+
c.status.dive += c.trueatk();
211212
},
212213
divinity:function(c,t){
213214
c.owner.buffhp(c.owner.mark == Light?24:16);

etg.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -324,8 +324,8 @@ Player.prototype.endturn = function(discard) {
324324
}
325325
}
326326
if (this.shield){
327-
if(this.shield.active.auto)this.shield.active();
328327
this.shield.usedactive = false;
328+
if(this.shield.active.auto)this.shield.active.auto(this.shield);
329329
}
330330
if (this.weapon)this.weapon.attack();
331331
if (this.sosa > 0){
@@ -600,8 +600,8 @@ Creature.prototype.calcEclipse = function(){
600600
}
601601
Weapon.prototype.trueatk = Creature.prototype.trueatk = function(adrenaline){
602602
var dmg = this.atk;
603-
if (this.steamatk)dmg += this.steamatk;
604-
if (this.dive)dmg += this.dive;
603+
if (this.status.steamatk)dmg += this.status.steamatk;
604+
if (this.status.dive)dmg += this.status.dive;
605605
if (this.active.buff)dmg += this.active.buff(this);
606606
if (this.status.burrowed)dmg = Math.ceil(dmg/2);
607607
if (this instanceof Creature){
@@ -696,7 +696,7 @@ Weapon.prototype.attack = Creature.prototype.attack = function(stasis, freedomCh
696696
if (this.active.hit && (!this.status.adrenaline || this.status.adrenaline < 3)){
697697
this.active.hit(this, target.gpull, dmg);
698698
}
699-
}else if (!target.shield || (trueatk > (truedr = target.shield.truedr()) && (!target.shield.active.shield || !target.shield.active.shield(target.shield, this)))){
699+
}else if (!target.shield || ((trueatk > (truedr = target.shield.truedr()) && (!target.shield.active.shield || !target.shield.active.shield(target.shield, this))))){
700700
var dmg = trueatk - truedr;
701701
target.dmg(dmg);
702702
if (this.active.hit && (!this.status.adrenaline || this.status.adrenaline < 3)){
@@ -805,7 +805,7 @@ var TargetFilters = {
805805
return t.isMaterialInstance(Pillar);
806806
},
807807
weap:function(c, t){
808-
return t.card.type == WeaponEnum && !t.status.immaterial && !t.status.burrowed;
808+
return !(t instanceof Player) && t.card.type == WeaponEnum && !t.status.immaterial && !t.status.burrowed;
809809
},
810810
perm:function(c, t){
811811
return t.isMaterialInstance(Permanent);
@@ -829,7 +829,7 @@ var TargetFilters = {
829829
return c.owner != t.owner && t.isMaterialInstance(Permanent);
830830
},
831831
butterfly:function(c, t){
832-
return (t.trueatk && t.trueatk()<3) || (t.truehp && t.truehp()<3);
832+
return !t.status.immaterial && !t.status.burrowed && ((t.trueatk && t.trueatk()<3) || (t.truehp && t.truehp()<3));
833833
},
834834
devour:function(c, t){
835835
return t.isMaterialInstance(Creature) && t.truehp()<c.truehp();

LICENSE license

File renamed without changes.

0 commit comments

Comments
 (0)