--created by Discord \ Walrus, coded by Lyris, art generated by Dall-E2 AI --カオス・コール local s,id,o=GetID() function s.initial_effect(c) c:SetUniqueOnField(1,0,id) local e1=Effect.CreateEffect(c) e1:SetCategory(CATEGORY_EQUIP) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetCode(EVENT_FREE_CHAIN) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET) e1:SetTarget(s.target) e1:SetOperation(s.operation) c:RegisterEffect(e1) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_SINGLE) e3:SetCode(EFFECT_EQUIP_LIMIT) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetValue(aux.TargetBoolFunction(s.filter)) c:RegisterEffect(e3) local e0=Effect.CreateEffect(c) e0:SetType(EFFECT_TYPE_EQUIP) e0:SetCode(EFFECT_UPDATE_ATTACK) e0:SetValue(function(e,tc) return 300*Duel.GetMatchingGroupCount(aux.AND(Card.IsFaceup,Card.IsType),e:GetHandlerPlayer(),LOCATION_REMOVED,LOCATION_REMOVED,nil,TYPE_MONSTER) end) c:RegisterEffect(e0) local e2=e0:Clone() e2:SetCode(EFFECT_UPDATE_DEFENSE) e2:SetValue(function(e,tc) return 300*Duel.GetMatchingGroupCount(Card.IsFacedown,e:GetHandlerPlayer(),LOCATION_REMOVED,LOCATION_REMOVED,nil) end) c:RegisterEffect(e2) local e4=Effect.CreateEffect(c) e4:SetCategory(CATEGORY_REMOVE) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e4:SetCode(EVENT_TO_GRAVE) e4:SetCondition(s.condition) e4:SetTarget(s.tg) e4:SetOperation(s.op) c:RegisterEffect(e4) end function s.filter(c) return c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_FIEND) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() and s.filter(c) end if chk==0 then return Duel.IsExistingTarget(aux.AND(Card.IsFaceup,s.filter),tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,aux.AND(Card.IsFaceup,s.filter),tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) local c,tc=e:GetHandler(),Duel.GetFirstTarget() if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then Duel.Equip(tp,c,tc) end end function s.condition(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local ec=c:GetPreviousEquipTarget() return not c:IsReason(REASON_LOST_TARGET) and ec and ec:IsLevelAbove(8) end function s.tg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end local g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0) end function s.op(e,tp,eg,ep,ev,re,r,rp) Duel.Remove(Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD),POS_FACEUP,REASON_EFFECT) end