AvatarSkillDepotData.java 3.32 KB
Newer Older
Melledy's avatar
Melledy committed
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
package emu.grasscutter.data.def;

import java.util.List;

import emu.grasscutter.data.GenshinData;
import emu.grasscutter.data.GenshinResource;
import emu.grasscutter.data.ResourceType;
import emu.grasscutter.data.ResourceType.LoadPriority;
import emu.grasscutter.data.custom.AbilityEmbryoEntry;
import emu.grasscutter.game.props.ElementType;
import emu.grasscutter.utils.Utils;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import it.unimi.dsi.fastutil.ints.IntList;

@ResourceType(name = "AvatarSkillDepotExcelConfigData.json", loadPriority = LoadPriority.HIGH)
public class AvatarSkillDepotData extends GenshinResource {
	
    private int Id;
    private int EnergySkill;
    private int AttackModeSkill;

    private List<Integer> Skills;
    private List<Integer> SubSkills;
    private List<String> ExtraAbilities;
    private List<Integer> Talents;
    private List<InherentProudSkillOpens> InherentProudSkillOpens;

    private String TalentStarName;
    private String SkillDepotAbilityGroup;
    
    private AvatarSkillData energySkillData;
    private ElementType elementType;
    private IntList abilities;

    @Override
	public int getId(){
        return this.Id;
    }
    
    public int getEnergySkill(){
        return this.EnergySkill;
    }
    
    public List<Integer> getSkills(){
        return this.Skills;
    }
    
    public List<Integer> getSubSkills(){
        return this.SubSkills;
    }
    
    public int getAttackModeSkill(){
        return this.AttackModeSkill;
    }
    
    public List<String> getExtraAbilities(){
        return this.ExtraAbilities;
    }
    
    public List<Integer> getTalents(){
        return this.Talents;
    }
    
    public String getTalentStarName(){
        return this.TalentStarName;
    }
    
    public List<InherentProudSkillOpens> getInherentProudSkillOpens(){
        return this.InherentProudSkillOpens;
    }
    
    public String getSkillDepotAbilityGroup(){
        return this.SkillDepotAbilityGroup;
    }
    
	public AvatarSkillData getEnergySkillData() {
		return this.energySkillData;
	}
	
	public ElementType getElementType() {
		return elementType;
	}
    
    public IntList getAbilities() {
		return abilities;
	}
    
	public void setAbilities(AbilityEmbryoEntry info) {
		this.abilities = new IntArrayList(info.getAbilities().length);
		for (String ability : info.getAbilities()) {
			this.abilities.add(Utils.abilityHash(ability));
		}
	}
	
	@Override
	public void onLoad() {
    	this.energySkillData = GenshinData.getAvatarSkillDataMap().get(this.EnergySkill);
    	if (getEnergySkillData() != null) {
    		this.elementType = ElementType.getTypeByName(getEnergySkillData().getCostElemType());
    	} else {
    		this.elementType = ElementType.None;
    	}
    }
    
    public static class InherentProudSkillOpens {
        private int ProudSkillGroupId;

        private int NeedAvatarPromoteLevel;

        public void setProudSkillGroupId(int ProudSkillGroupId){
            this.ProudSkillGroupId = ProudSkillGroupId;
        }
        public int getProudSkillGroupId(){
            return this.ProudSkillGroupId;
        }
        public void setNeedAvatarPromoteLevel(int NeedAvatarPromoteLevel){
            this.NeedAvatarPromoteLevel = NeedAvatarPromoteLevel;
        }
        public int getNeedAvatarPromoteLevel(){
            return this.NeedAvatarPromoteLevel;
        }
    }
}