-- Summoned Shaman function c123366.initial_effect(c) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetCode(EFFECT_CHANGE_CODE) e1:SetRange(LOCATION_GRAVE) e1:SetValue(70781052) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetDescription(aux.Stringid(123366,0)) e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_QUICK_O) e2:SetCode(EVENT_FREE_CHAIN) e2:SetHintTiming(TIMING_DAMAGE_STEP) e2:SetRange(LOCATION_MZONE+LOCATION_HAND) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e2:SetCondition(c123366.condition) e2:SetCost(c123366.cost) e2:SetOperation(c123366.operation) e2:SetCountLimit(1,123366) c:RegisterEffect(e2) end function c123366.condition(e,tp,eg,ep,ev,re,r,rp) local phase=Duel.GetCurrentPhase() if phase~=PHASE_DAMAGE or Duel.IsDamageCalculated() then return false end local a=Duel.GetAttacker() local d=Duel.GetAttackTarget() return (d~=nil and a:GetControler()==tp and a~=e:GetHandler() and a:IsRace(RACE_FIEND) and a:IsRelateToBattle()) or (d~=nil and d:GetControler()==tp and d~=e:GetHandler() and d:IsFaceup() and d:IsRace(RACE_FIEND) and d:IsRelateToBattle()) end function c123366.cfilter(c) return c:IsRace(RACE_FIEND) and c:IsAbleToGrave() and c:IsLevelBelow(6) end function c123366.cost(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(c123366.cfilter,tp,LOCATION_DECK,0,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) local g=Duel.SelectMatchingCard(tp,c123366.cfilter,tp,LOCATION_DECK,0,1,1,nil) g:AddCard(e:GetHandler()) e:SetLabelObject(g:GetFirst()) Duel.SendtoGrave(g,REASON_COST) end function c123366.operation(e,tp,eg,ep,ev,re,r,rp,chk) local a=Duel.GetAttacker() local d=Duel.GetAttackTarget() local c=e:GetHandler() local tc=e:GetLabelObject() local def=tc:GetDefense() if not a:IsRelateToBattle() or not d:IsRelateToBattle() then return end local e1=Effect.CreateEffect(e:GetHandler()) e1:SetOwnerPlayer(tp) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) if a:GetControler()==tp then e1:SetValue(def) a:RegisterEffect(e1) else e1:SetValue(def) d:RegisterEffect(e1) end end