Skip to content

Instantly share code, notes, and snippets.

@rmsy
Created September 7, 2013 18:11
Show Gist options
  • Save rmsy/6477839 to your computer and use it in GitHub Desktop.
Save rmsy/6477839 to your computer and use it in GitHub Desktop.
Potion effects mapped to their negative (inverse) implications.
/** Potion effects mapped to their negative (inverse) implications. */
public static final Map<PotionEffectType, PotionClassification> inversePotionEffectTypeImplications;
static {
HashMap<PotionEffectType, PotionClassification> temporaryMap = new HashMap<>();
// SLOW
temporaryMap.put(PotionEffectType.SPEED, PotionClassification.HARMFUL);
// SPEED
temporaryMap.put(PotionEffectType.SLOW, PotionClassification.BENEFICIAL);
// SLOW_DIGGING
temporaryMap.put(PotionEffectType.FAST_DIGGING, PotionClassification.HARMFUL);
// FAST_DIGGING
temporaryMap.put(PotionEffectType.SLOW_DIGGING, PotionClassification.BENEFICIAL);
// WEAKNESS
temporaryMap.put(PotionEffectType.INCREASE_DAMAGE, PotionClassification.HARMFUL);
// Normal behavior
temporaryMap.put(PotionEffectType.HEAL, PotionClassification.BENEFICIAL);
/*
~ Behaves very oddly:
~ Level < 0 && < -5: Constant damage sound/animation. Damage is actually being taken, but amount is negative,
causing no loss in health. Upon taking any positive damage (regular damage) via other means, the player dies
instantly.
~ Level >= -5: Instant death.
*/
temporaryMap.put(PotionEffectType.HARM, PotionClassification.HARMFUL);
/* Inverse of JUMP
~ Side effect: appears to increase fall damage sensitivity.
*/
temporaryMap.put(PotionEffectType.JUMP, PotionClassification.HARMFUL);
// Normal behavior
temporaryMap.put(PotionEffectType.CONFUSION, PotionClassification.HARMFUL);
// Normal behavior
temporaryMap.put(PotionEffectType.REGENERATION, PotionClassification.BENEFICIAL);
// Inverse of DAMAGE_RESISTANCE
temporaryMap.put(PotionEffectType.DAMAGE_RESISTANCE, PotionClassification.HARMFUL);
// Normal behavior
temporaryMap.put(PotionEffectType.FIRE_RESISTANCE, PotionClassification.BENEFICIAL);
// Normal behavior
temporaryMap.put(PotionEffectType.WATER_BREATHING, PotionClassification.BENEFICIAL);
// Normal behavior
temporaryMap.put(PotionEffectType.INVISIBILITY, PotionClassification.BENEFICIAL);
// Normal behavior
temporaryMap.put(PotionEffectType.BLINDNESS, PotionClassification.HARMFUL);
// Normal behavior
temporaryMap.put(PotionEffectType.NIGHT_VISION, PotionClassification.BENEFICIAL);
// SATURATION
temporaryMap.put(PotionEffectType.HUNGER, PotionClassification.BENEFICIAL);
// INCREASE_DAMAGE
temporaryMap.put(PotionEffectType.WEAKNESS, PotionClassification.BENEFICIAL);
// Normal behavior
temporaryMap.put(PotionEffectType.POISON, PotionClassification.HARMFUL);
// Normal behavior
temporaryMap.put(PotionEffectType.WITHER, PotionClassification.HARMFUL);
// Inverse of HEALTH_BOOST
temporaryMap.put(PotionEffectType.HEALTH_BOOST, PotionClassification.HARMFUL);
// Normal behavior
temporaryMap.put(PotionEffectType.ABSORPTION, PotionClassification.BENEFICIAL);
/* HUNGER
~ Side effect: adds 10 absorption hearts at the start of the effect.
*/
temporaryMap.put(PotionEffectType.SATURATION, PotionClassification.HARMFUL);
inversePotionEffectTypeImplications = Collections.unmodifiableMap(temporaryMap);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment