--Laodiche, Amministrale delle Fiamme --created by ZEN, coded by ZEN & Lyris local cid,id=GetID() function cid.initial_effect(c) local e1=Effect.CreateEffect(c) e1:Desc(1) e1:SetType(EFFECT_TYPE_FIELD) e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetRange(LOCATION_HAND) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetCondition(cid.spcon) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:Desc(2) e2:SetType(EFFECT_TYPE_IGNITION) e2:SetRange(LOCATION_MZONE) e2:SetCountLimit(1,id+2000) e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DESTROY) e2:SetCost(cid.cost) e2:SetTarget(cid.atktg) e2:SetOperation(cid.atkop) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:Desc(3) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e3:SetCode(EVENT_TO_GRAVE) e3:SetCountLimit(1,id+1000) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCategory(CATEGORY_RECOVER+CATEGORY_LEAVE_GRAVE) e3:SetCondition(cid.con) e3:SetTarget(cid.tg) e3:SetOperation(cid.op) c:RegisterEffect(e3) end function cid.cfilter(c) return c:IsSetCard(0xd7c) and c:IsFaceup() and c:GetSequence()<5 end function cid.spcon(e,c) if c==nil then return true end return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cid.cfilter,c:GetControler(),LOCATION_MZONE,0,1,nil) end function cid.dcfilter(c) return c:GetSequence()<5 and c:IsSetCard(0xd7c) and c:IsFaceup() and c:IsAbleToGraveAsCost() end function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(cid.dcfilter,tp,LOCATION_SZONE,0,2,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,cid.dcfilter,tp,LOCATION_SZONE,0,2,2,nil) Duel.SendtoGrave(g,REASON_COST) end function cid.preinfo(c) return c:GetAttack()>1250 and c:GetAttack()<=2500 end function cid.atktg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,g,#g,tp,-2) if g:IsExists(cid.preinfo,1,nil) then Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,g:FilterCount(cid.preinfo,nil),1-tp,LOCATION_MZONE) end end function cid.atkop(e,tp,eg,ep,ev,re,r,rp) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil) local dg=Group.CreateGroup() for tc in aux.Next(g) do local preatk=tc:GetAttack() local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_SET_ATTACK_FINAL) e1:SetValue(tc:GetAttack()/2) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) tc:RegisterEffect(e1) if preatk>1250 and tc:IsAttackBelow(1250) then dg:AddCard(tc) end end if #dg>0 then Duel.Destroy(dg,REASON_EFFECT) end end function cid.con(e,tp,eg,ep,ev,re,r,rp) return e:GetHandler():IsReason(REASON_COST) and e:GetHandler():IsPreviousLocation(LOCATION_SZONE) and e:GetHandler():GetPreviousSequence()<5 and re:IsHasType(0x7e0) and re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsSetCard(0xd7c) end function cid.filter(c,tp) return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xd7c) and not c:CheckUniqueOnField(tp) and not c:IsForbidden() end function cid.rfilter(c) return c:IsFaceup() and c:IsSetCard(0xd7c) and c:GetSequence()<5 end function cid.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cid.filter(chkc,tp) end if chk==0 then return true end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) local g=Duel.SelectTarget(tp,cid.filter,tp,LOCATION_GRAVE,0,1,1,nil,tp) Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,#g,0,0) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,0) end function cid.op(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if not tc or not tc:IsRelateToChain() or not Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) or not tc:IsLocation(LOCATION_SZONE) or not c:IsFaceup() then return end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetDescription(aux.Stringid(id,0)) e1:SetCode(EFFECT_CHANGE_TYPE) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET) e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS) tc:RegisterEffect(e1) local ct=Duel.GetMatchingGroupCount(cid.rfilter,tp,LOCATION_SZONE,0,1,nil) if ct>0 then Duel.Recover(tp,ct*200,REASON_EFFECT) end end