Program: 171343
Project: 171343
Buggy source:
/** 
 * Example return value: ["Let's give you bigger breasts!", AbstractItem]
 * @return NPC's speech as a reaction to giving you this potion, along with the potion itself.
 */
public Value<String,AbstractItem> generateTransformativePotion(){
}

Fixed version (ground truth):
/** 
 * Example return value: ["Let's give you bigger breasts!", AbstractItem]
 * @return NPC's speech as a reaction to giving you this potion, along with the potion itself.
 */
public Value<String,AbstractItem> generateTransformativePotion(){
  int numberOfTransformations=Main.game.getPlayer().hasFetish(Fetish.FETISH_TRANSFORMATION_RECEIVING) ? 2 + Util.random.nextInt(7) : 1 + Util.random.nextInt(4);
  List<ItemEffect> effects=new ArrayList<>();
  AbstractItemType genitalsItemType=ItemType.RACE_INGREDIENT_HUMAN;
  AbstractItemType itemType=ItemType.RACE_INGREDIENT_HUMAN;
  String reaction="String_Node_Str";
  String raceName="String_Node_Str";
  if (Main.getProperties().forcedTFPreference != FurryPreference.HUMAN) {
    if (getPreferredBody().getGender().isFeminine()) {
      raceName=getPreferredBody().getGender().getName() + "String_Node_Str" + getPreferredBody().getRace().getSingularFemaleName();
    }
 else {
      raceName=getPreferredBody().getGender().getName() + "String_Node_Str" + getPreferredBody().getRace().getSingularMaleName();
    }
  }
switch (getPreferredBody().getRace()) {
case CAT_MORPH:
    itemType=ItemType.RACE_INGREDIENT_CAT_MORPH;
  reaction="String_Node_Str" + raceName + "String_Node_Str";
break;
case DOG_MORPH:
itemType=ItemType.RACE_INGREDIENT_DOG_MORPH;
reaction="String_Node_Str" + raceName + "String_Node_Str";
break;
case HARPY:
itemType=ItemType.RACE_INGREDIENT_HARPY;
reaction="String_Node_Str" + raceName + "String_Node_Str";
break;
case HORSE_MORPH:
itemType=ItemType.RACE_INGREDIENT_HORSE_MORPH;
if (getPreferredBody().getGender().isFeminine()) {
reaction="String_Node_Str";
}
 else {
reaction="String_Node_Str";
}
break;
case SQUIRREL_MORPH:
itemType=ItemType.RACE_INGREDIENT_SQUIRREL_MORPH;
reaction="String_Node_Str" + raceName + "String_Node_Str";
break;
case WOLF_MORPH:
itemType=ItemType.RACE_INGREDIENT_WOLF_MORPH;
reaction="String_Node_Str" + raceName + "String_Node_Str";
break;
case GATOR_MORPH:
itemType=ItemType.RACE_INGREDIENT_GATOR_MORPH;
reaction="String_Node_Str" + raceName + "String_Node_Str";
break;
case COW_MORPH:
itemType=ItemType.RACE_INGREDIENT_COW_MORPH;
break;
case ANGEL:
case DEMON:
case SLIME:
case HUMAN:
itemType=ItemType.RACE_INGREDIENT_HUMAN;
break;
}
Map<ItemEffect,String> possibleEffects=new HashMap<>();
boolean removingVagina=false;
boolean addingVagina=false;
boolean removingPenis=false;
boolean addingPenis=false;
if (!Main.game.getPlayer().isHasAnyPregnancyEffects()) {
if (Main.game.getPlayer().getVaginaType() != getPreferredBody().getVagina().getType()) {
if (getPreferredBody().getVagina().getType() == VaginaType.NONE) {
if (Main.game.getPlayer().getVaginaRawCapacityValue() > 1) {
possibleEffects.put(new ItemEffect(genitalsItemType.getEnchantmentEffect(),TFModifier.TF_VAGINA,TFModifier.TF_MOD_CAPACITY,TFPotency.DRAIN,1),"String_Node_Str");
removingVagina=true;
}
 else {
possibleEffects.put(new ItemEffect(genitalsItemType.getEnchantmentEffect(),TFModifier.TF_VAGINA,TFModifier.REMOVAL,TFPotency.MINOR_BOOST,1),"String_Node_Str");
removingVagina=true;
}
}
 else if (Main.getProperties().forcedTFPreference != FurryPreference.HUMAN && Main.getProperties().forcedTFPreference != FurryPreference.MINIMUM) {
possibleEffects.put(new ItemEffect(genitalsItemType.getEnchantmentEffect(),TFModifier.TF_VAGINA,TFModifier.NONE,TFPotency.MINOR_BOOST,1),"String_Node_Str" + getPreferredBody().getVagina().getName(Main.game.getPlayer(),false) + "String_Node_Str");
addingVagina=true;
}
}
}
if (Main.game.getPlayer().getPenisType() != getPreferredBody().getPenis().getType()) {
if (getPreferredBody().getPenis().getType() == PenisType.NONE) {
if (Main.game.getPlayer().getPenisRawSizeValue() > 1) {
possibleEffects.put(new ItemEffect(genitalsItemType.getEnchantmentEffect(),TFModifier.TF_PENIS,TFModifier.TF_MOD_SIZE,TFPotency.DRAIN,1),"String_Node_Str");
removingPenis=true;
}
 else {
possibleEffects.put(new ItemEffect(genitalsItemType.getEnchantmentEffect(),TFModifier.TF_PENIS,TFModifier.REMOVAL,TFPotency.MINOR_BOOST,1),"String_Node_Str");
removingPenis=true;
}
}
 else if (Main.getProperties().forcedTFPreference != FurryPreference.HUMAN && Main.getProperties().forcedTFPreference != FurryPreference.MINIMUM) {
possibleEffects.put(new ItemEffect(genitalsItemType.getEnchantmentEffect(),TFModifier.TF_PENIS,TFModifier.NONE,TFPotency.MINOR_BOOST,1),"String_Node_Str" + getPreferredBody().getPenis().getName(Main.game.getPlayer(),false) + "String_Node_Str");
addingPenis=true;
}
}
if (!possibleEffects.isEmpty()) {
String s="String_Node_Str";
if (possibleEffects.size() > 1) {
if (removingVagina) {
s+="String_Node_Str";
if (removingPenis) {
s+="String_Node_Str";
}
 else if (addingPenis) {
s+="String_Node_Str";
}
}
 else if (addingVagina) {
s+="String_Node_Str" + getPreferredBody().getVagina().getName(Main.game.getPlayer(),false) + "String_Node_Str";
if (removingPenis) {
s+="String_Node_Str";
}
 else if (addingPenis) {
s+="String_Node_Str";
}
}
}
for (Entry<ItemEffect,String> entry : possibleEffects.entrySet()) {
if (possibleEffects.size() == 1) {
s=entry.getValue();
}
effects.add(entry.getKey());
}
return new Value<>(s,EnchantingUtils.craftItem(AbstractItemType.generateItem(itemType),effects));
}
if (Main.getProperties().forcedTFPreference != FurryPreference.HUMAN) {
if (possibleEffects.isEmpty() || Math.random() > 0.33f) {
if (Main.game.getPlayer().getAntennaType() != getPreferredBody().getAntenna().getType()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_ANTENNA,TFModifier.NONE,TFPotency.MINOR_BOOST,1),reaction);
}
if (Main.getProperties().forcedTFPreference != FurryPreference.MINIMUM) {
if (Main.game.getPlayer().getAssType() != getPreferredBody().getAss().getType()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_ASS,TFModifier.NONE,TFPotency.MINOR_BOOST,1),reaction);
}
if (Main.game.getPlayer().getBreastType() != getPreferredBody().getBreast().getType()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_BREASTS,TFModifier.NONE,TFPotency.MINOR_BOOST,1),reaction);
}
}
if (Main.game.getPlayer().getEarType() != getPreferredBody().getEar().getType()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_EARS,TFModifier.NONE,TFPotency.MINOR_BOOST,1),reaction);
}
if (Main.game.getPlayer().getEyeType() != getPreferredBody().getEye().getType()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_EYES,TFModifier.NONE,TFPotency.MINOR_BOOST,1),reaction);
}
if (Main.game.getPlayer().getHairType() != getPreferredBody().getHair().getType()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_HAIR,TFModifier.NONE,TFPotency.MINOR_BOOST,1),reaction);
}
if (Main.game.getPlayer().getHornType() != getPreferredBody().getHorn().getType()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_HORNS,TFModifier.NONE,TFPotency.MINOR_BOOST,1),reaction);
}
if (Main.game.getPlayer().getTailType() != getPreferredBody().getTail().getType()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_TAIL,TFModifier.NONE,TFPotency.MINOR_BOOST,1),reaction);
}
if (Main.game.getPlayer().getWingType() != getPreferredBody().getWing().getType()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_WINGS,TFModifier.NONE,TFPotency.MINOR_BOOST,1),reaction);
}
}
if (Main.getProperties().forcedTFPreference != FurryPreference.MINIMUM) {
if (possibleEffects.isEmpty()) {
if (Main.game.getPlayer().getArmType() != getPreferredBody().getArm().getType()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_ARMS,TFModifier.NONE,TFPotency.MINOR_BOOST,1),reaction);
}
if (Main.game.getPlayer().getLegType() != getPreferredBody().getLeg().getType()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_LEGS,TFModifier.NONE,TFPotency.MINOR_BOOST,1),reaction);
}
}
}
if (Main.getProperties().forcedTFPreference == FurryPreference.NORMAL || Main.getProperties().forcedTFPreference == FurryPreference.MAXIMUM) {
if (possibleEffects.isEmpty()) {
if (Main.game.getPlayer().getSkinType() != getPreferredBody().getSkin().getType()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_SKIN,TFModifier.NONE,TFPotency.MINOR_BOOST,1),reaction);
}
if (Main.game.getPlayer().getFaceType() != getPreferredBody().getFace().getType()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_FACE,TFModifier.NONE,TFPotency.MINOR_BOOST,1),reaction);
}
}
}
}
if (Math.random() < 0.5f && !possibleEffects.isEmpty()) {
List<ItemEffect> keysAsArray=new ArrayList<>(possibleEffects.keySet());
for (int i=0; i < numberOfTransformations; i++) {
if (!keysAsArray.isEmpty()) {
ItemEffect e=keysAsArray.get(Util.random.nextInt(keysAsArray.size()));
effects.add(e);
keysAsArray.remove(e);
}
}
return new Value<>(reaction,EnchantingUtils.craftItem(AbstractItemType.generateItem(itemType),effects));
}
if (Main.game.getPlayer().getFemininityValue() < getPreferredBody().getFemininity() && Femininity.valueOf(Main.game.getPlayer().getFemininityValue()) != Femininity.valueOf(getPreferredBody().getFemininity())) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_CORE,TFModifier.TF_MOD_FEMININITY,TFPotency.BOOST,1),"String_Node_Str");
}
 else if (Main.game.getPlayer().getFemininityValue() > getPreferredBody().getFemininity() && Femininity.valueOf(Main.game.getPlayer().getFemininityValue()) != Femininity.valueOf(getPreferredBody().getFemininity())) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_CORE,TFModifier.TF_MOD_FEMININITY,TFPotency.DRAIN,1),"String_Node_Str");
}
if (Main.game.getPlayer().getHeightValue() < getPreferredBody().getHeightValue() && (getPreferredBody().getHeightValue() - Main.game.getPlayer().getHeightValue() > 5)) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_CORE,TFModifier.TF_MOD_SIZE,TFPotency.BOOST,1),"String_Node_Str");
}
 else if (Main.game.getPlayer().getHeightValue() > getPreferredBody().getHeightValue() && (Main.game.getPlayer().getHeightValue() - getPreferredBody().getHeightValue() > 5)) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_CORE,TFModifier.TF_MOD_SIZE,TFPotency.DRAIN,1),"String_Node_Str");
}
if (Main.game.getPlayer().getBreastSize().getMeasurement() < getPreferredBody().getBreast().getSize().getMeasurement()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_BREASTS,TFModifier.TF_MOD_SIZE,TFPotency.MINOR_BOOST,1),"String_Node_Str");
}
 else if (Main.game.getPlayer().getBreastSize().getMeasurement() > getPreferredBody().getBreast().getSize().getMeasurement()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_BREASTS,TFModifier.TF_MOD_SIZE,TFPotency.MINOR_DRAIN,1),"String_Node_Str");
}
if (Main.game.getPlayer().getAssSize().getValue() < getPreferredBody().getAss().getAssSize().getValue()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_ASS,TFModifier.TF_MOD_SIZE,TFPotency.MINOR_BOOST,1),"String_Node_Str");
}
 else if (Main.game.getPlayer().getAssSize().getValue() > getPreferredBody().getAss().getAssSize().getValue()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_ASS,TFModifier.TF_MOD_SIZE,TFPotency.MINOR_DRAIN,1),"String_Node_Str");
}
if (Main.game.getPlayer().getHipSize().getValue() < getPreferredBody().getAss().getHipSize().getValue()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_ASS,TFModifier.TF_MOD_SIZE_SECONDARY,TFPotency.MINOR_BOOST,1),"String_Node_Str");
}
 else if (Main.game.getPlayer().getHipSize().getValue() > getPreferredBody().getAss().getHipSize().getValue()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_ASS,TFModifier.TF_MOD_SIZE_SECONDARY,TFPotency.MINOR_DRAIN,1),"String_Node_Str");
}
if (Main.game.getPlayer().getPenisType() != PenisType.NONE && getPreferredBody().getPenis().getType() != PenisType.NONE) {
if (Main.game.getPlayer().getPenisRawSizeValue() < getPreferredBody().getPenis().getRawSizeValue()) {
if (getPreferredBody().getPenis().getRawSizeValue() - Main.game.getPlayer().getPenisRawSizeValue() > 5) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_PENIS,TFModifier.TF_MOD_SIZE,TFPotency.BOOST,1),"String_Node_Str");
}
 else {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_PENIS,TFModifier.TF_MOD_SIZE,TFPotency.MINOR_BOOST,1),"String_Node_Str");
}
}
 else if (Main.game.getPlayer().getPenisRawSizeValue() > getPreferredBody().getPenis().getRawSizeValue()) {
if (Main.game.getPlayer().getPenisRawSizeValue() - getPreferredBody().getPenis().getRawSizeValue() > 5) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_PENIS,TFModifier.TF_MOD_SIZE,TFPotency.DRAIN,1),"String_Node_Str");
}
 else {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_PENIS,TFModifier.TF_MOD_SIZE,TFPotency.MINOR_DRAIN,1),"String_Node_Str");
}
}
}
if (Main.game.getPlayer().getVaginaType() != VaginaType.NONE && getPreferredBody().getVagina().getType() != VaginaType.NONE) {
if (Main.game.getPlayer().getVaginaWetness().getValue() < getPreferredBody().getVagina().getOrificeVagina().getWetness(Main.game.getGenericAndrogynousNPC()).getValue()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_VAGINA,TFModifier.TF_MOD_WETNESS,TFPotency.MINOR_BOOST,1),"String_Node_Str");
}
}
if (Main.game.getPlayer().getHairRawLengthValue() < getPreferredBody().getHair().getRawLengthValue() && (getPreferredBody().getHair().getRawLengthValue() - Main.game.getPlayer().getHairRawLengthValue() > 5)) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_HAIR,TFModifier.TF_MOD_SIZE,TFPotency.BOOST,1),"String_Node_Str" + (Main.game.getPlayer().getHairType().isDefaultPlural() ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str");
}
 else if (Main.game.getPlayer().getHairRawLengthValue() > getPreferredBody().getHair().getRawLengthValue() && (Main.game.getPlayer().getHairRawLengthValue() - getPreferredBody().getHair().getRawLengthValue() > 5)) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_HAIR,TFModifier.TF_MOD_SIZE,TFPotency.DRAIN,1),"String_Node_Str" + (Main.game.getPlayer().getHairType().isDefaultPlural() ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str");
}
if (Main.game.getPlayer().getLipSize().getValue() < getPreferredBody().getFace().getMouth().getLipSize().getValue()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_FACE,TFModifier.TF_MOD_SIZE,TFPotency.MINOR_BOOST,1),"String_Node_Str");
}
 else if (Main.game.getPlayer().getLipSize().getValue() > getPreferredBody().getFace().getMouth().getLipSize().getValue()) {
possibleEffects.put(new ItemEffect(itemType.getEnchantmentEffect(),TFModifier.TF_FACE,TFModifier.TF_MOD_SIZE,TFPotency.MINOR_DRAIN,1),"String_Node_Str");
}
if (possibleEffects.isEmpty()) {
return null;
}
List<ItemEffect> keysAsArray=new ArrayList<>(possibleEffects.keySet());
for (int i=0; i < numberOfTransformations; i++) {
if (!keysAsArray.isEmpty()) {
ItemEffect e=keysAsArray.get(Util.random.nextInt(keysAsArray.size()));
effects.add(e);
keysAsArray.remove(e);
}
}
return new Value<>(possibleEffects.get(effects.get(0)),EnchantingUtils.craftItem(AbstractItemType.generateItem(itemType),effects));
}