--created by Pina, coded by Lyris local s,id=GetID() function s.initial_effect(c) c:EnableReviveLimit() aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_ROCK),2) local e1=Effect.CreateEffect(c) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e1:SetRange(LOCATION_MZONE) e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT) e1:SetCountLimit(1) e1:SetValue(function(e,re,r) return r&REASON_EFFECT>0 end) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e2:SetCode(EVENT_BATTLE_DAMAGE) e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) e2:SetCondition(function(e,tp,eg,ep) return ep~=tp end) e2:SetTarget(s.target) e2:SetOperation(s.operation) c:RegisterEffect(e2) local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_QUICK_O) e3:SetCode(EVENT_CHAINING) e3:SetRange(LOCATION_MZONE) e3:SetCountLimit(1) e3:SetCondition(s.con) e3:SetOperation(s.op) c:RegisterEffect(e3) end function s.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,id//10,0,TYPES_TOKEN_MONSTER,1000,1000,3,RACE_ROCK,ATTRIBUTE_DARK) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0) end function s.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,id//10,0,TYPES_TOKEN_MONSTER,1000,1000,3,RACE_ROCK,ATTRIBUTE_DARK) then return end local token=Duel.CreateToken(tp,id//10) Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP) local e1=Effect.CreateEffect(e:GetHandler()) e1:SetType(EFFECT_TYPE_SINGLE) e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL) e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetValue(aux.TargetBoolFunction(aux.NOT(Card.IsRace),RACE_ROCK)) token:RegisterEffect(e1,true) local e2=e1:Clone() e2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL) token:RegisterEffect(e2,true) end function s.con(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) if not g or g:GetCount()~=1 then return false end local tc=g:GetFirst() local ex,tg=Duel.GetOperationInfo(ev,CATEGORY_DESTROY) return ex and re:IsHasCategory(CATEGORY_DESTROY) and tc:IsLocation(LOCATION_MZONE) and tc:IsControler(tp) and tc:IsFaceup() and tc:IsRace(RACE_ROCK) and tc~=c and Duel.CheckChainTarget(ev,c) end function s.op(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if c:IsRelateToEffect(e) and Duel.CheckChainTarget(ev,c) then Duel.ChangeTargetCard(ev,Group.CreateGroup()+c) end end