Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
__construct: function(nLevel) {
O2.parent(this, 'Luck', nLevel > 0 ? 'bless' : 'curse');
this.setLevel(nLevel);
},
__construct: function(nPower) {
O2.parent(this, 'Magnet', nPower <= 0 ? 'bless' : 'curse');
this.setLevel(nPower);
},
__construct: function(nPower) {
O2.parent(this, 'Power', nPower > 0 ? 'bless' : 'curse');
this.setLevel(nPower);
},
__construct: function(nLevel) {
O2.parent(this, 'Defense', nLevel > 0 ? 'bless' : 'curse');
this.setLevel(nLevel);
},
__construct: function(value) {
O2.parent(this, 'Cooldown', value > 0 ? 'curse' : 'bless');
this.setLevel(value);
},
fire: function(ctx) {
O2.parent(this, ctx);
var m, e;
if (ctx.missiles) {
for (var i = 0; i < ctx.missiles.length; ++i) {
m = ctx.missiles[i];
e = m.getData('effects');
e.push(new Effect.Damage(Utils.rand(5, 10)));
}
}
}
});
fire: function(ctx) {
O2.parent(this, ctx);
var m, e;
if (ctx.missiles) {
for (var i = 0; i < ctx.missiles.length; ++i) {
m = ctx.missiles[i];
e = m.getData('effects');
e.push(new Effect.Damage(Utils.rand(10, 15)));
}
}
}
});
fire: function(ctx) {
O2.parent(this, ctx);
var m, e;
if (ctx.missiles) {
for (var i = 0; i < ctx.missiles.length; ++i) {
m = ctx.missiles[i];
e = m.getData('effects');
e.push(new Effect.PhysicalDamage(Utils.rand(10, 15)));
}
}
}
});
use: function(ctx) {
O2.parent(this, ctx);
if (ctx.missiles && ctx.missiles.length) {
ctx.missiles.forEach(function(m) {
m.bInstable = false;
m.bSlideWall = true;
m.bBouncing = true;
m.setData('reflected', true);
});
}
}
use: function(ctx) {
if (this.checkCooldown(ctx)) {
O2.parent(this, ctx);
}
ctx.consume = false;
},