//Add the item's functionality down here! I stole most of this from the Stuffed Star active item code! protected override void DoEffect(PlayerController user) { PillEffect effect = pilleffects[BlueWhitePillEffect]; effect.action.Invoke(effect, user); Notify("null", effect.notificationText); }
public static void HealthModifier(PillEffect effect, PlayerController user) { float currentStatValue = user.stats.GetBaseStatValue(PlayerStats.StatType.Health); if (user.characterIdentity == PlayableCharacters.Robot) { if (effect.amount >= 0) { user.healthHaver.Armor += effect.amount; } else if (effect.amount < 0 && user.healthHaver.Armor > 1) { user.healthHaver.Armor += effect.amount; } else if (effect.amount < 0 && user.healthHaver.Armor == 1) { user.healthHaver.Armor += 1; } else { return; } } else if (effect.amount >= 0) { user.stats.SetBaseStatValue(PlayerStats.StatType.Health, currentStatValue + effect.amount, user); } else if (effect.amount < 0 && currentStatValue > 1) { user.stats.SetBaseStatValue(PlayerStats.StatType.Health, currentStatValue + effect.amount, user); } else if (effect.amount < 0 && currentStatValue == 1) { user.stats.SetBaseStatValue(PlayerStats.StatType.Health, currentStatValue + 1, user); } else { return; } }