--Arcarum VI - GLI AMANTI --Script by XGlitchy30 local cid,id=GetID() function cid.initial_effect(c) --Activate local e1=Effect.CreateEffect(c) e1:SetDescription(aux.Stringid(id,0)) e1:SetCategory(CATEGORY_POSITION+CATEGORY_RECOVER) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetHintTiming(TIMING_BATTLE_PHASE,TIMINGS_CHECK_MONSTER+TIMING_BATTLE_PHASE) e1:SetCost(cid.cost) e1:SetTarget(cid.target) e1:SetOperation(cid.activate) c:RegisterEffect(e1) --recover local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(id,1)) e2:SetCategory(CATEGORY_RECOVER) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetCode(EVENT_PHASE+PHASE_STANDBY) e2:SetRange(LOCATION_GRAVE) e2:SetCountLimit(1) e2:SetCondition(cid.lpcon) e2:SetTarget(cid.lptg) e2:SetOperation(cid.lpop) c:RegisterEffect(e2) --spsummon local e3=Effect.CreateEffect(c) e3:SetDescription(aux.Stringid(id,2)) e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetType(EFFECT_TYPE_IGNITION) e3:SetRange(LOCATION_GRAVE) e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e3:SetCondition(aux.exccon) e3:SetCost(aux.bfgcost) e3:SetTarget(cid.sptg) e3:SetOperation(cid.spop) c:RegisterEffect(e3) end --filters function cid.filter(c) return c:IsPosition(POS_FACEUP_ATTACK) and c:IsCanChangePosition() and c:IsSetCard(0x5477) and c:IsType(TYPE_MONSTER) end function cid.chkfilter(c,tp,e) return c:IsFaceup() and c:IsSetCard(0x5477) and c:IsType(TYPE_MONSTER) and Duel.IsExistingMatchingCard(cid.spfilter,tp,LOCATION_DECK,0,1,c,e,tp,c:GetLevel()) end function cid.spfilter(c,e,tp,lv) return c:IsSetCard(0x5477) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetLevel()0 then local lv=g:GetFirst():GetLevel() Duel.SetTargetPlayer(tp) Duel.SetTargetParam(lv*300) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,lv*300) end end function cid.activate(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc:IsRelateToEffect(e) and tc:IsLocation(LOCATION_MZONE) and tc:IsPosition(POS_FACEUP_ATTACK) then Duel.ChangePosition(tc,POS_FACEUP_DEFENSE) local lv=tc:GetLevel() if lv>0 then local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Recover(p,d,REASON_EFFECT) end end end --recover function cid.lpcon(e,tp,eg,ep,ev,re,r,rp) local tid=e:GetHandler():GetFlagEffectLabel(id) return tid and tid~=Duel.GetTurnCount() and Duel.GetTurnPlayer()==tp end function cid.lptg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return true end Duel.SetTargetPlayer(tp) Duel.SetTargetParam(1000) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000) end function cid.lpop(e,tp,eg,ep,ev,re,r,rp) if not e:GetHandler():IsRelateToEffect(e) then return end local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) Duel.Recover(p,d,REASON_EFFECT) end --spsummon function cid.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cid.chkfilter(chkc,tp,e) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(cid.chkfilter,tp,LOCATION_MZONE,0,1,nil,tp,e) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET) local g=Duel.SelectTarget(tp,cid.chkfilter,tp,LOCATION_MZONE,0,1,1,nil,tp,e) local sp=Duel.GetMatchingGroup(cid.spfilter,tp,LOCATION_DECK,0,nil,e,tp,g:GetFirst():GetLevel()) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sp,1,0,0) end function cid.spop(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() if tc and tc:IsRelateToEffect(e) and tc:GetLevel()>0 and Duel.IsExistingMatchingCard(cid.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,tc:GetLevel()) then if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectMatchingCard(tp,cid.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,tc:GetLevel()) if g:GetCount()>0 then Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) end end end