// • ▌ ▄ ·.  ▄▄▄·  ▄▄ • ▪   ▄▄· ▄▄▄▄·  ▄▄▄·  ▐▄▄▄  ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀  █▪▀▀▀ ▀  ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀  ▀  ▀ ▀▀  █▪ ▀▀▀
//      Magicbane Emulator Project © 2013 - 2024
//                www.magicbane.com

package engine.wpak.data;

import engine.mbEnums;

import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Objects;

public class Power {
    public String power_id;
    public String power;
    public ArrayList<PowerEntry> powers = new ArrayList<>();
    public mbEnums.PowerTargetType target_type;
    public int range;
    public mbEnums.AreaType areaType;
    public int areaRange;
    public mbEnums.ExcludeType excludeType;
    public mbEnums.CostType costType;
    public float cost;
    public float difficulty;
    public float precision;
    public float init_time;
    public float release_time;
    public float recycle_time;
    public int hitRollYN;
    public mbEnums.CastingModeType castingMode;
    public int initAmin;
    public int releaseAnim;
    public mbEnums.TargetSelectType targetSelect;

    // Additional key/value type power entries

    public ArrayList<ActionEntry> actionEntries = new ArrayList<>();
    public int maxLevel;
    public int hateValue;
    public mbEnums.CompoundCurveType hateCurve = mbEnums.CompoundCurveType.DefaultFlat;
    public int loopAnimID;
    public String grantOverrideVar;
    public ArrayList<String> description = new ArrayList<>();
    public HashMap<String, mbEnums.CompoundCurveType> curves = new HashMap<>();
    public mbEnums.PowerCategoryType category;
    public boolean canCastWhileMoving = false;
    public boolean bladeTrails = false;
    public ArrayList<Effect> effectPreReqs = new ArrayList<>();
    public ArrayList<EquipmentPreReq> equipmentPreReq = new ArrayList<>();
    public EnumSet<mbEnums.MonsterType> monsterRestricts = EnumSet.noneOf(mbEnums.MonsterType.class);
    public EnumSet<mbEnums.MonsterType> monsterPrereqs = EnumSet.noneOf(mbEnums.MonsterType.class);
    public boolean shouldCheckPath = false;
    public boolean sticky = false;
    public int pulseCycle;
    public int pulseDuration;
    public int maxMobTargets;
    public int maxPlayerTargets;
    public boolean isAdminPower = false;
    public int casterPulseParticle;
    public ArrayList<Effect> targetEffectPrereqs = new ArrayList<>();
    public boolean canCastWhileFlying = false;
    public boolean isProjectile = false;
    public HashMap<String, Float> conditions = new HashMap<>();

    public boolean isSpell() {
        return true;
    }

    public boolean isSkill() {
        return true;
    }

    public boolean isChant() {
        return true;
    }

    public boolean equals(Object o) {
        if (this == o)
            return true;
        if (o == null || getClass() != o.getClass())
            return false;

        Power power = (Power) o;
        return Objects.equals(power_id, power.power_id);
    }

    @Override
    public int hashCode() {
        return power_id.hashCode(); // Use only the id field for hashCode
    }
}
