--[[ Tome of Twisted Tales Tomo delle Storie Risvolte Card Author: D1G1TAL Scripted by: XGlitchy30 ]] local s,id,o=GetID() function s.initial_effect(c) aux.AddCodeList(c,id-1) --Activation local e1=Effect.CreateEffect(c) e1:Desc(0) e1:SetCategory(CATEGORY_EQUIP) e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetProperty(EFFECT_FLAG_CARD_TARGET|EFFECT_FLAG_CONTINUOUS_TARGET) e1:SetCode(EVENT_FREE_CHAIN) e1:SetTarget(s.target) e1:SetOperation(s.activate) c:RegisterEffect(e1) local e2=Effect.CreateEffect(c) e2:SetType(EFFECT_TYPE_SINGLE) e2:SetCode(EFFECT_EQUIP_LIMIT) e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e2:SetValue(1) c:RegisterEffect(e2) --The equipped monster cannot be Tributed or used as material for a Link Summon. local e3=Effect.CreateEffect(c) e3:SetType(EFFECT_TYPE_EQUIP) e3:SetCode(EFFECT_UNRELEASABLE_SUM) e3:SetValue(1) c:RegisterEffect(e3) local e4=e3:Clone() e4:SetCode(EFFECT_UNRELEASABLE_NONSUM) c:RegisterEffect(e4) local e5=e3:Clone() e5:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL) c:RegisterEffect(e5) --[[During your Main Phase: You can Special Summon 1 "Foreshadow Token" (Fiend/DARK/Tuner/Level 3/ATK 1500/DEF 0), and if you do, equip this card to it.]] local e6=Effect.CreateEffect(c) e6:SetDescription(aux.Stringid(id,1)) e6:SetCategory(CATEGORIES_TOKEN|CATEGORY_EQUIP) e6:SetType(EFFECT_TYPE_IGNITION) e6:HOPT() e6:SetRange(LOCATION_SZONE) e6:SetCondition(aux.IsEquippedCond) e6:SetTarget(s.eqtg) e6:SetOperation(s.eqop) c:RegisterEffect(e6) --If this card is in your GY: You can target 1 "Grand Twist Dragon" in your GY; Special Summon it, and if you do, add this card to your hand. local e7=Effect.CreateEffect(c) e7:SetDescription(aux.Stringid(id,2)) e7:SetCategory(CATEGORY_SPECIAL_SUMMON|CATEGORY_TOHAND) e7:SetType(EFFECT_TYPE_IGNITION) e7:SetProperty(EFFECT_FLAG_CARD_TARGET) e7:HOPT() e7:SetRange(LOCATION_GRAVE) e7:SetTarget(s.sptg) e7:SetOperation(s.spop) c:RegisterEffect(e7) end --E0 function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) end function s.activate(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if c:IsRelateToChain() and tc:IsRelateToChain() and tc:IsFaceup() then Duel.Equip(tp,c,tc) end end --E6 function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk) local c=e:GetHandler() if chk==0 then return not c:IsForbidden() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,100000185,0,TYPES_TOKEN_MONSTER,1500,0,3,RACE_FIEND,ATTRIBUTE_DARK) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0) Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_EQUIP,c,1,0,0) end function s.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,100000185,0,TYPES_TOKEN_MONSTER,1500,0,3,RACE_FIEND,ATTRIBUTE_DARK) then return end local token=Duel.CreateToken(tp,100000185) if Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)>0 and c:IsRelateToChain() and c:CheckEquipTarget(token) then Duel.Equip(tp,c,token) end end --E7 function s.filter(c,e,tp) return c:IsCode(id-1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) local c=e:GetHandler() if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.filter(chkc,e,tp) end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsAbleToHand() and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) Duel.SetCardOperationInfo(g,CATEGORY_SPECIAL_SUMMON) Duel.SetCardOperationInfo(c,CATEGORY_TOHAND) end function s.spop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler() local tc=Duel.GetFirstTarget() if tc:IsRelateToChain() and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 and c:IsRelateToChain() then Duel.Search(c,tp) end end