-
Notifications
You must be signed in to change notification settings - Fork 0
/
skillManagement.py
50 lines (43 loc) · 1.65 KB
/
skillManagement.py
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
48
49
50
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 16 14:38:55 2016
@author: rmondoncancel
"""
import copy
def applyTrait(elem, pClass) :
if 'traitBonus' in elem and elem['traitBonus']['class'] == pClass :
for bonus in elem['traitBonus']['bonus'] :
elem[bonus] = elem['traitBonus']['bonus'][bonus]
return elem
def applyTraits(l, pClass, skill = False) :
newL = {}
if skill :
for group in l :
newL[group] = applyTraits(l[group], pClass)
return newL
for name in l :
newL[name] = applyTrait(l[name], pClass)
return newL
def removeLifeSurge(l, skill) :
if not skill :
return l
newL = copy.deepcopy(l)
for group in l :
for name in l[group] :
if 'potency' in newL[group][name] :
newL[group][name]['removeBuff'] = (newL[group][name]['removeBuff'] if 'removeBuff' in newL[group][name] else []) + ['lifeSurge']
return newL
def removeBloodOfTheDragonBuffs(l, skill) :
if not skill :
return l
newL = copy.deepcopy(l)
for group in l :
for name in l[group] :
if 'potency' in newL[group][name] and newL[group][name]['gcdType'] == 'global' and newL[group][name]['name'] not in ['sharperFangAndClaw', 'enhancedWheelingThrust'] :
newL[group][name]['removeBuff'] = (newL[group][name]['removeBuff'] if 'removeBuff' in newL[group][name] else []) + ['sharperFangAndClaw', 'enhancedWheelingThrust']
return newL
def prepareGroup(l, pClass, skill = False) :
newL = applyTraits(l, pClass, skill)
newL = removeLifeSurge(newL, skill)
newL = removeBloodOfTheDragonBuffs(newL, skill)
return newL