diff --git a/unofficial/Crystal Beast Sapphire Pegasus (Anime).cdb b/unofficial/Crystal Beast Sapphire Pegasus (Anime).cdb new file mode 100644 index 0000000000..4a4fdd7d03 Binary files /dev/null and b/unofficial/Crystal Beast Sapphire Pegasus (Anime).cdb differ diff --git a/unofficial/c511000496.lua b/unofficial/c511000496.lua index 825a7eccc5..b2c0a0068e 100644 --- a/unofficial/c511000496.lua +++ b/unofficial/c511000496.lua @@ -46,7 +46,7 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) local g2=Duel.SelectMatchingCard(1-tp,s.filter,tp,0,LOCATION_DECK,3,3,nil) local exg1=Group.CreateGroup() local exg2=Group.CreateGroup() - for i=1,3 do + for i=1,1 do Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM) local sc1=g1:Select(tp,1,1,exg1):GetFirst() exg1:AddCard(sc1) diff --git a/unofficial/c511003117.lua b/unofficial/c511003117.lua new file mode 100644 index 0000000000..b36050b07f --- /dev/null +++ b/unofficial/c511003117.lua @@ -0,0 +1,68 @@ +--宝玉獣 サファイア・ペガサス (Anime) +--Crystal Beast Sapphire Pegasus (Anime) +local s,id=GetID() +function s.initial_effect(c) + --Place this card in Spell/Trap Zone instead of sending to GY + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(id,0)) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_TO_GRAVE_REDIRECT_CB) + e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) + e1:SetCondition(s.replacecon) + e1:SetOperation(s.replaceop) + c:RegisterEffect(e1) + --place + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(id,1)) + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2:SetCode(EVENT_SUMMON_SUCCESS) + e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP) + e2:SetTarget(s.target) + e2:SetOperation(s.operation) + c:RegisterEffect(e2) + local e3=e2:Clone() + e3:SetCode(EVENT_SPSUMMON_SUCCESS) + c:RegisterEffect(e3) + local e4=e2:Clone() + e4:SetCode(EVENT_FLIP_SUMMON_SUCCESS) + c:RegisterEffect(e4) +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 +function s.filter(c) + return c:IsSetCard(SET_CRYSTAL_BEAST) and not c:IsForbidden() +end +function s.target(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK|LOCATION_GRAVE|LOCATION_HAND,0,1,nil) + and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end +end +function s.operation(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.filter),tp,LOCATION_DECK|LOCATION_GRAVE|LOCATION_HAND,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 \ No newline at end of file