Skip to content

Commit

Permalink
Clean up adding extra embryo logic in Avatar::recalcStats
Browse files Browse the repository at this point in the history
  • Loading branch information
Melledy authored and Melledy committed Aug 31, 2022
1 parent 45c08c5 commit bab6e68
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/java/emu/grasscutter/game/avatar/Avatar.java
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,8 @@ public void recalcStats(boolean forceSendAbilityChange) {
this.addFightProperty(prop.getProp(), prop.getValue());
}

// Add any skill strings from this proud skill
this.addToExtraAbilityEmbryos(proudSkillData.getOpenConfig(), true);
// Add any embryos from this proud skill
this.addToExtraAbilityEmbryos(proudSkillData.getOpenConfig());
}

// Constellations
Expand All @@ -566,7 +566,7 @@ public void recalcStats(boolean forceSendAbilityChange) {
.filter(Objects::nonNull)
.map(AvatarTalentData::getOpenConfig)
.filter(Objects::nonNull)
.forEach(openConfig -> this.addToExtraAbilityEmbryos(openConfig, false));
.forEach(this::addToExtraAbilityEmbryos);
// Add any skill strings from this constellation

// Set % stats
Expand Down Expand Up @@ -600,6 +600,10 @@ public void recalcStats(boolean forceSendAbilityChange) {
}
}
}

public void addToExtraAbilityEmbryos(String openConfig) {
this.addToExtraAbilityEmbryos(openConfig, false);
}

public void addToExtraAbilityEmbryos(String openConfig, boolean forceAdd) {
if (openConfig == null || openConfig.length() == 0) {
Expand Down

0 comments on commit bab6e68

Please sign in to comment.