File size: 1,282 Bytes
7e79d67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

import _ from 'lodash';

import { Spell, SpellType } from '../spell';

import { VenomCoating as VenomCoatingEffect } from '../effects/VenomCoating';

export class VenomCoating extends Spell {
  static element = SpellType.BUFF;
  static tiers = [
    { name: 'venom coating',    spellPower: 1,  weight: 25, cost: 200,   profession: 'Archer', level: 15 },
    { name: 'venom slathering', spellPower: 2,  weight: 25, cost: 800,   profession: 'Archer', level: 55 },
    { name: 'venom layer',      spellPower: 1,  weight: 25, cost: 600,   profession: 'MagicalMonster', level: 35,
      collectibles: ['Feathered Cap'] }
  ];

  static shouldCast(caster) {
    return this.$canTarget.allyWithoutEffect(caster, 'VenomCoating') && caster._special.ltePercent(30);
  }

  determineTargets() {
    return this.$targetting.randomAllyWithoutEffect('VenomCoating');
  }

  calcDuration() {
    return 3 + this.spellPower;
  }

  calcPotency() {
    return this.spellPower;
  }

  preCast() {
    const message = '%player applied a %spellName on %targetName\'s weapon!';
    const targets = this.determineTargets();

    _.each(targets, target => {
      super.cast({
        damage: 0,
        message,
        applyEffect: VenomCoatingEffect,
        targets: [target]
      });
    });
  }
}