diff --git a/unofficial/c511003245.lua b/unofficial/c511003245.lua new file mode 100644 index 0000000000..8771283dd7 --- /dev/null +++ b/unofficial/c511003245.lua @@ -0,0 +1,54 @@ +--宝玉獣 エメラルド・タートル (Anime) +--Crystal Beast Emerald Tortoise (Anime) +--Scripted by The Razgriz +local s,id=GetID() +function s.initial_effect(c) + --Change the position of 1 monster you control that attacked this turn + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(68215963,1)) + e1:SetCategory(CATEGORY_POSITION) + e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetRange(LOCATION_MZONE) + e1:SetCountLimit(1) + e1:SetTarget(s.postg) + e1:SetOperation(s.posop) + c:RegisterEffect(e1) + --Place this card in Spell & Trap Zone instead of sending to GY + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetCode(EFFECT_TO_GRAVE_REDIRECT_CB) + e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) + e2:SetCondition(s.replacecon) + e2:SetOperation(s.replaceop) + c:RegisterEffect(e2) +end +function s.posfilter(c) + return c:IsAttackPos() and c:GetAttackedCount()>0 and c:IsCanChangePosition() +end +function s.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chk==0 then return Duel.IsExistingMatchingCard(s.posfilter,tp,LOCATION_MZONE,0,1,nil) end + Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,tp,0) +end +function s.posop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE) + local tc=Duel.SelectMatchingCard(tp,s.posfilter,tp,LOCATION_MZONE,0,1,1,nil):GetFirst() + if tc then + Duel.HintSelection(tc) + Duel.ChangePosition(tc,POS_FACEUP_DEFENSE,POS_FACEDOWN_DEFENSE,0,0) + end +end +function s.replacecon(e) + local c=e:GetHandler() + return ((c:IsFaceup() and c:IsLocation(LOCATION_MZONE)) or (c:IsLocation(LOCATION_HAND|LOCATION_DECK))) and c:IsReason(REASON_DESTROY) +end +function s.replaceop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local e1=Effect.CreateEffect(c) + e1:SetCode(EFFECT_CHANGE_TYPE) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetReset((RESET_EVENT|RESETS_STANDARD)&~RESET_TURN_SET) + e1:SetValue(TYPE_SPELL|TYPE_CONTINUOUS) + c:RegisterEffect(e1) + Duel.RaiseEvent(c,EVENT_CUSTOM+CARD_CRYSTAL_TREE,e,0,tp,0,0) +end \ No newline at end of file diff --git a/unofficial/c511003246.lua b/unofficial/c511003246.lua new file mode 100644 index 0000000000..9095bccbfc --- /dev/null +++ b/unofficial/c511003246.lua @@ -0,0 +1,69 @@ +--宝玉獣 サファイア・ペガサス (Anime) +--Crystal Beast Sapphire Pegasus (Anime) +--Scripted by Kevdaplog +local s,id=GetID() +function s.initial_effect(c) + --Place 1 "Crystal Beast" monster from your hand, Deck or GY in your Spell & Trap Zone as a Cont. Spell + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(7093411,1)) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) + e1:SetCode(EVENT_SUMMON_SUCCESS) + e1:SetTarget(s.placetg) + e1:SetOperation(s.placeop) + c:RegisterEffect(e1) + local e2=e1:Clone() + e2:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e2) + local e3=e1:Clone() + e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS) + c:RegisterEffect(e3) + --Place this card in Spell & Trap Zone instead of sending to GY + local e4=Effect.CreateEffect(c) + e4:SetType(EFFECT_TYPE_SINGLE) + e4:SetProperty(EFFECT_FLAG_UNCOPYABLE) + e4:SetCode(EFFECT_TO_GRAVE_REDIRECT_CB) + e4:SetCondition(s.replacecon) + e4:SetOperation(s.replaceop) + c:RegisterEffect(e4) +end +s.listed_series={SET_CRYSTAL_BEAST} +function s.placefilter(c) + return c:IsSetCard(SET_CRYSTAL_BEAST) and not c:IsForbidden() +end +function s.placetg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.placefilter,tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,1,nil) + and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end +end +function s.placeop(e,tp,eg,ep,ev,re,r,rp) + if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD) + local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.placefilter),tp,LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE,0,1,1,nil) + local tc=g:GetFirst() + if tc then + Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) + local e1=Effect.CreateEffect(e:GetHandler()) + e1:SetCode(EFFECT_CHANGE_TYPE) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetReset((RESET_EVENT|RESETS_STANDARD)&~RESET_TURN_SET) + e1:SetValue(TYPE_SPELL|TYPE_CONTINUOUS) + tc:RegisterEffect(e1) + Duel.RaiseEvent(tc,EVENT_CUSTOM+CARD_CRYSTAL_TREE,e,0,tp,0,0) + end +end +function s.replacecon(e) + local c=e:GetHandler() + return ((c:IsFaceup() and c:IsLocation(LOCATION_MZONE)) or (c:IsLocation(LOCATION_HAND|LOCATION_DECK))) and c:IsReason(REASON_DESTROY) +end +function s.replaceop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local e1=Effect.CreateEffect(c) + e1:SetCode(EFFECT_CHANGE_TYPE) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetReset((RESET_EVENT|RESETS_STANDARD)&~RESET_TURN_SET) + e1:SetValue(TYPE_SPELL|TYPE_CONTINUOUS) + c:RegisterEffect(e1) + Duel.RaiseEvent(c,EVENT_CUSTOM+CARD_CRYSTAL_TREE,e,0,tp,0,0) +end diff --git a/unofficial/c511003247.lua b/unofficial/c511003247.lua new file mode 100644 index 0000000000..ea79a40fd5 --- /dev/null +++ b/unofficial/c511003247.lua @@ -0,0 +1,55 @@ +--宝玉獣 コバルト・イーグル (Anime) +--Crystal Beast Cobalt Eagle (Anime) +--Scripted by The Razgriz +local s,id=GetID() +function s.initial_effect(c) + --Return 1 "Crystal Beast" card you control to the top of the Deck + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(21698716,1)) + e1:SetCategory(CATEGORY_TODECK) + e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetRange(LOCATION_MZONE) + e1:SetCountLimit(1) + e1:SetTarget(s.tdtg) + e1:SetOperation(s.tdop) + c:RegisterEffect(e1) + --Place this card in Spell & Trap Zone instead of sending to GY + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetCode(EFFECT_TO_GRAVE_REDIRECT_CB) + e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) + e2:SetCondition(s.replacecon) + e2:SetOperation(s.replaceop) + c:RegisterEffect(e2) +end +s.listed_series={SET_CRYSTAL_BEAST} +function s.tdfilter(c) + return c:IsSetCard(SET_CRYSTAL_BEAST) and c:IsAbleToDeck() and c:IsFaceup() +end +function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chk==0 then return Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_ONFIELD,0,1,nil) end + Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,0) +end +function s.tdop(e,tp,eg,ep,ev,re,r,rp) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) + local tc=Duel.SelectMatchingCard(tp,s.tdfilter,tp,LOCATION_ONFIELD,0,1,1,nil):GetFirst() + if tc and tc:IsFaceup() then + Duel.HintSelection(tc) + Duel.SendtoDeck(tc,nil,SEQ_DECKTOP,REASON_EFFECT) + end +end +function s.replacecon(e) + local c=e:GetHandler() + return ((c:IsFaceup() and c:IsLocation(LOCATION_MZONE)) or (c:IsLocation(LOCATION_HAND|LOCATION_DECK))) and c:IsReason(REASON_DESTROY) +end +function s.replaceop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local e1=Effect.CreateEffect(c) + e1:SetCode(EFFECT_CHANGE_TYPE) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetReset((RESET_EVENT|RESETS_STANDARD)&~RESET_TURN_SET) + e1:SetValue(TYPE_SPELL|TYPE_CONTINUOUS) + c:RegisterEffect(e1) + Duel.RaiseEvent(c,EVENT_CUSTOM+CARD_CRYSTAL_TREE,e,0,tp,0,0) +end \ No newline at end of file diff --git a/unofficial/c511003248.lua b/unofficial/c511003248.lua new file mode 100644 index 0000000000..47fc8e4a90 --- /dev/null +++ b/unofficial/c511003248.lua @@ -0,0 +1,53 @@ +--宝玉獣 アンバー・マンモス (Anime) +--Crystal Beast Amber Mammoth (Anime) +local s,id=GetID() +function s.initial_effect(c) + --When another "Crystal Beast" monster you control is selected as an attack target, you can change the attack target to this card + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(69937550,1)) + e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e1:SetCode(EVENT_BE_BATTLE_TARGET) + e1:SetRange(LOCATION_MZONE) + e1:SetCondition(s.attacktargetchangecon) + e1:SetTarget(s.attacktargetchangetg) + e1:SetOperation(s.attacktargetchangeop) + c:RegisterEffect(e1) + --Place this card in Spell & Trap Zone instead of sending to GY + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) + e2:SetCode(EFFECT_TO_GRAVE_REDIRECT_CB) + e2:SetCondition(s.replacecon) + e2:SetOperation(s.replaceop) + c:RegisterEffect(e2) +end +s.listed_series={SET_CRYSTAL_BEAST} +function s.attacktargetchangecon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local at=eg:GetFirst() + return r~=REASON_REPLACE and at~=c and at:IsFaceup() and at:IsSetCard(SET_CRYSTAL_BEAST) and at:GetControler()==c:GetControler() +end +function s.attacktargetchangetg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.GetAttacker():GetAttackableTarget():IsContains(e:GetHandler()) end +end +function s.attacktargetchangeop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if c:IsRelateToEffect(e) and not Duel.GetAttacker():IsImmuneToEffect(e) then + Duel.ChangeAttackTarget(c) + end +end +function s.replacecon(e) + local c=e:GetHandler() + return ((c:IsFaceup() and c:IsLocation(LOCATION_MZONE)) or (c:IsLocation(LOCATION_HAND|LOCATION_DECK))) and c:IsReason(REASON_DESTROY) +end +function s.replaceop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local e1=Effect.CreateEffect(c) + e1:SetCode(EFFECT_CHANGE_TYPE) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetReset((RESET_EVENT|RESETS_STANDARD)&~RESET_TURN_SET) + e1:SetValue(TYPE_SPELL|TYPE_CONTINUOUS) + c:RegisterEffect(e1) + Duel.RaiseEvent(c,EVENT_CUSTOM+CARD_CRYSTAL_TREE,e,0,tp,0,0) +end \ No newline at end of file diff --git a/unofficial/c511003249.lua b/unofficial/c511003249.lua new file mode 100644 index 0000000000..6e83a739fb --- /dev/null +++ b/unofficial/c511003249.lua @@ -0,0 +1,65 @@ +--宝玉獣 アメジスト・キャット (Anime) +--Crystal Beast Amethyst Cat (Anime) +local s,id=GetID() +function s.initial_effect(c) + --Can attack directly by halving its ATK + local e1a=Effect.CreateEffect(c) + e1a:SetType(EFFECT_TYPE_SINGLE) + e1a:SetCode(EFFECT_DIRECT_ATTACK) + c:RegisterEffect(e1a) + --Halves its ATK + local e1b=Effect.CreateEffect(c) + e1b:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) + e1b:SetProperty(EFFECT_FLAG_SINGLE_RANGE) + e1b:SetCode(EVENT_PRE_DAMAGE_CALCULATE) + e1b:SetRange(LOCATION_MZONE) + e1b:SetCondition(s.diratkcon) + e1b:SetOperation(s.diratkop) + c:RegisterEffect(e1b) + --Place this card in Spell & Trap Zone instead of sending to GY + local e3=Effect.CreateEffect(c) + e3:SetType(EFFECT_TYPE_SINGLE) + e3:SetCode(EFFECT_TO_GRAVE_REDIRECT_CB) + e3:SetProperty(EFFECT_FLAG_UNCOPYABLE) + e3:SetCondition(s.replacecon) + e3:SetOperation(s.replaceop) + c:RegisterEffect(e3) +end +function s.diratkcon(e,tp,eg,ep,ev,re,r,rp) + return Duel.GetAttackTarget()==nil and e:GetHandler():IsHasEffect(EFFECT_DIRECT_ATTACK) + and Duel.IsExistingMatchingCard(aux.NOT(Card.IsHasEffect),tp,0,LOCATION_MZONE,1,nil,EFFECT_IGNORE_BATTLE_TARGET) +end +function s.diratkop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local effs={c:GetCardEffect(EFFECT_DIRECT_ATTACK)} + local eg=Group.CreateGroup() + for _,eff in ipairs(effs) do + eg:AddCard(eff:GetOwner()) + end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT) + local ec = #eg==1 and eg:GetFirst() or eg:Select(tp,1,1,nil):GetFirst() + if c==ec then + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_SET_ATTACK_FINAL) + e1:SetRange(LOCATION_MZONE) + e1:SetValue(c:GetAttack()/2) + e1:SetReset(RESET_EVENT|RESETS_STANDARD_DISABLE|RESET_PHASE|PHASE_DAMAGE_CAL) + c:RegisterEffect(e1) + end +end +function s.replacecon(e) + local c=e:GetHandler() + return ((c:IsFaceup() and c:IsLocation(LOCATION_MZONE)) or (c:IsLocation(LOCATION_HAND|LOCATION_DECK))) and c:IsReason(REASON_DESTROY) +end +function s.replaceop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local e1=Effect.CreateEffect(c) + e1:SetCode(EFFECT_CHANGE_TYPE) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetReset((RESET_EVENT|RESETS_STANDARD)&~RESET_TURN_SET) + e1:SetValue(TYPE_SPELL|TYPE_CONTINUOUS) + c:RegisterEffect(e1) + Duel.RaiseEvent(c,EVENT_CUSTOM+CARD_CRYSTAL_TREE,e,0,tp,0,0) +end diff --git a/unofficial/c511003250.lua b/unofficial/c511003250.lua new file mode 100644 index 0000000000..98b417beaa --- /dev/null +++ b/unofficial/c511003250.lua @@ -0,0 +1,40 @@ +--宝玉獣 トパーズ・タイガー (Anime) +--Crystal Beast Topaz Tiger (Anime) +local s,id=GetID() +function s.initial_effect(c) + --If this card attacks an opponent's monster, it gains 400 ATK during the Damage Step only + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE) + e1:SetCode(EFFECT_UPDATE_ATTACK) + e1:SetRange(LOCATION_MZONE) + e1:SetCondition(s.atkcon) + e1:SetValue(400) + c:RegisterEffect(e1) + --Place this card in your Spell & Trap Zone instead of sending it to the GY + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_SINGLE) + e2:SetProperty(EFFECT_FLAG_UNCOPYABLE) + e2:SetCode(EFFECT_TO_GRAVE_REDIRECT_CB) + e2:SetCondition(s.replacecon) + e2:SetOperation(s.replaceop) + c:RegisterEffect(e2) +end +function s.atkcon(e) + return Duel.GetAttacker()==e:GetHandler() and Duel.GetAttackTarget()~=nil and aux.StatChangeDamageStepCondition() +end +function s.replacecon(e) + local c=e:GetHandler() + return ((c:IsFaceup() and c:IsLocation(LOCATION_MZONE)) or (c:IsLocation(LOCATION_HAND|LOCATION_DECK))) and c:IsReason(REASON_DESTROY) +end +function s.replaceop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local e1=Effect.CreateEffect(c) + e1:SetCode(EFFECT_CHANGE_TYPE) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetReset((RESET_EVENT|RESETS_STANDARD)&~RESET_TURN_SET) + e1:SetValue(TYPE_SPELL|TYPE_CONTINUOUS) + c:RegisterEffect(e1) + Duel.RaiseEvent(c,EVENT_CUSTOM+CARD_CRYSTAL_TREE,e,0,tp,0,0) +end \ No newline at end of file