package com.acethewildfire.acesbs.effect;

import com.acethewildfire.acesbs.AcesBS;
import net.minecraft.entity.attribute.EntityAttributeModifier;
import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectCategory;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.util.Identifier;

public class ModEffects {

    public static final RegistryEntry<StatusEffect> LEMON = registerStatusEffect("lemon",
            new LemonEffect(StatusEffectCategory.HARMFUL, 0xfae640)
                    .addAttributeModifier(EntityAttributes.GENERIC_MOVEMENT_SPEED, Identifier.of(AcesBS.MOD_ID, "lemon"),
                            -0.75F, EntityAttributeModifier.Operation.ADD_MULTIPLIED_TOTAL));
    public static final RegistryEntry<StatusEffect> INFERNAL_FIRE = registerStatusEffect("infernal_fire",
            new InfernalFireEffect(StatusEffectCategory.HARMFUL, 0x963830)
                    .addAttributeModifier(EntityAttributes.GENERIC_MOVEMENT_SPEED, Identifier.of(AcesBS.MOD_ID, "infernal_fire"),
                            1F, EntityAttributeModifier.Operation.ADD_MULTIPLIED_TOTAL)
                    .addAttributeModifier(EntityAttributes.GENERIC_JUMP_STRENGTH, Identifier.of(AcesBS.MOD_ID, "infernal_fire"),
                            0.25F, EntityAttributeModifier.Operation.ADD_MULTIPLIED_TOTAL));

    public static final RegistryEntry<StatusEffect> BRICKED_UP = registerStatusEffect("bricked_up",
            new BrickedUpEffect(StatusEffectCategory.NEUTRAL, 0x8e4631));

    public static final RegistryEntry<StatusEffect> CIGARETTE = registerStatusEffect("cigarette",
            new CigaretteEffect(StatusEffectCategory.BENEFICIAL, 0xE6A74F)
                    .addAttributeModifier(EntityAttributes.GENERIC_MOVEMENT_SPEED, Identifier.of(AcesBS.MOD_ID, "cigarette"),
                            1F, EntityAttributeModifier.Operation.ADD_MULTIPLIED_TOTAL));

    public static final RegistryEntry<StatusEffect> WITHDRAWAL = registerStatusEffect("withdrawal",
            new WithdrawalEffect(StatusEffectCategory.HARMFUL, 0x4A412A)
                    .addAttributeModifier(EntityAttributes.GENERIC_MOVEMENT_SPEED, Identifier.of(AcesBS.MOD_ID, "withdrawal"),
                            -0.5F, EntityAttributeModifier.Operation.ADD_MULTIPLIED_TOTAL));

    public static final RegistryEntry<StatusEffect> JITTERY = registerStatusEffect("jittery",
            new JitteryEffect(StatusEffectCategory.HARMFUL, 0xeb9bff));

    private static RegistryEntry<StatusEffect> registerStatusEffect (String name, StatusEffect effect){
        return Registry.registerReference(Registries.STATUS_EFFECT, Identifier.of(AcesBS.MOD_ID, name), effect);
    }

    public static void registerEffects(){
        AcesBS.LOGGER.info("Registering Mod Effects for " + AcesBS.MOD_ID);
    }
}
