Skip to content

Unofficial Fixes #1100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
16 changes: 7 additions & 9 deletions unofficial/c100000069.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--Dark Summoning Beast (VG)
local s,id=GetID()
function s.initial_effect(c)
--spsummon
--Special Summon 1 of Uria, Hamon, or Raviel from your Graveyard
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
Expand All @@ -21,27 +21,25 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(c,REASON_COST)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e1:SetProperty(EFFECT_FLAG_OATH+EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.filter(c,e,tp)
return c:IsCode(6007213,32491822,69890967) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and s.filter(chkc,e,tp) end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if e:GetHandler():GetSequence()<5 then ft=ft+1 end
if chk==0 then return ft>0 and Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0 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.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
end
end
101 changes: 57 additions & 44 deletions unofficial/c100000235.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,56 +14,54 @@ function s.initial_effect(c)
sg:KeepAlive()
e1:SetLabelObject(sg)
--Special Summon the banished Unions
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetTarget(s.target)
e3:SetOperation(s.operation)
e3:SetLabelObject(sg)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetTarget(s.target)
e2:SetOperation(s.operation)
e2:SetLabelObject(sg)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
end
function s.refilter(c)
return c:IsType(TYPE_UNION) and c:IsLevelBelow(4) and c:IsAbleToRemove()
end
function s.retarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.refilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,0)
if chk==0 then return Duel.IsExistingMatchingCard(s.refilter,tp,LOCATION_DECK,0,3,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,3,tp,LOCATION_DECK)
end
function s.reactivate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.refilter,tp,LOCATION_DECK,0,nil)
if #g<3 then return end
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.refilter,tp,LOCATION_DECK,0,1,3,nil)
if #g>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
local sg=e:GetLabelObject()
if c:GetFlagEffect(id)==0 then
sg:Clear()
c:RegisterFlagEffect(id,RESET_EVENT+0x1680000,0,1)
end
local tc=g:GetFirst()
for tc in aux.Next(g) do
sg:AddCard(tc)
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1)
end
local rg=g:Select(tp,3,3,nil)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
local sg=e:GetLabelObject()
if c:GetFlagEffect(id)==0 then
sg:Clear()
c:RegisterFlagEffect(id,RESET_EVENT|0x1680000,0,1)
end
local tc=rg:GetFirst()
for tc in aux.Next(rg) do
sg:AddCard(tc)
tc:RegisterFlagEffect(id,RESET_EVENT|RESETS_STANDARD,0,1)
end
end
function s.filter(c,e,tp)
local g=e:GetLabelObject()
return c:IsFaceup() and c:IsSummonPlayer(tp) and g:IsExists(s.filter2,1,nil,c,e,tp)
return c:IsFaceup() and c:IsControler(tp) and g:IsExists(s.filter2,1,nil,c,e,tp)
end
function s.filter2(c,eqc,e,tp)
return c:GetFlagEffect(id)~=0 and c:ListsCode(eqc:GetCode()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
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 eg:IsExists(s.filter,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local gc=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=e:GetLabelObject()
local gt=eg:Filter(s.filter,nil,e,tp)
local gtg=gt:GetFirst()
Expand All @@ -75,33 +73,48 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
tg:Merge(tdg)
end
end
local sg=tg:Select(tp,1,gc,nil)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg,gc,0,0)
Duel.SetTargetCard(tg)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end
if ft>#tg then ft=#tg end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tg,ft,tp,LOCATION_REMOVED)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetTargetCards(e)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<#g then return end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft==0 then return end
if Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then ft=1 end
local g=nil
local tg=Duel.GetTargetCards(e)
if #tg>ft then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
g=tg:Select(tp,ft,ft,nil)
else
g=tg
end
if #g==0 then return end
local c=e:GetHandler()
local tc=g:GetFirst()
for tc in aux.Next(g) do
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
--Cannot attack
local e1=Effect.CreateEffect(c)
e1:SetDescription(3206)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(1)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
tc:RegisterEffect(e1,true)
--Cannot be Tributed
local e2=Effect.CreateEffect(c)
e2:SetDescription(3303)
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UNRELEASABLE_NONSUM)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetCode(EFFECT_UNRELEASABLE_SUM)
e2:SetReset(RESET_EVENT|RESETS_STANDARD)
e2:SetValue(1)
tc:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_ATTACK)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
local e3=e2:Clone()
e3:SetCode(EFFECT_UNRELEASABLE_NONSUM)
tc:RegisterEffect(e3,true)
end
Duel.SpecialSummonComplete()
Expand Down
58 changes: 22 additions & 36 deletions unofficial/c150000034.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,44 @@
--Illumination
local s,id=GetID()
function s.initial_effect(c)
--damage
--Activate 1 of these effects for the rest of this turn
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(s.activate1)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetOperation(s.activate2)
c:RegisterEffect(e2)
end
function s.activate1(e,tp,eg,ep,ev,re,r,rp)
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local op=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
e:SetLabel(op)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(s.condition1)
e1:SetTarget(s.target)
e1:SetCode(EVENT_CHAIN_SOLVING)
if e:GetLabel()==0 then
--Negate an effect that would negate a Normal or Special Summon
e1:SetCondition(s.condition1)
else
--Negate an effect that would destroy a monster(s)
e1:SetCondition(s.condition2)
end
e1:SetOperation(s.operation)
e1:SetCountLimit(1)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE|PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.condition1(e,tp,eg,ep,ev,re,r,rp)
if tp==ep or not Duel.IsChainNegatable(ev) then return false end
if not re:IsActiveType(TYPE_MONSTER) and not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DISABLE_SUMMON)
return ex and tg~=nil and tc+tg:FilterCount(s.cfilter,nil)-#tg>0
end
function s.activate2(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(s.condition2)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
e1:SetCountLimit(1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local ex,tg=Duel.GetOperationInfo(ev,CATEGORY_DISABLE_SUMMON)
return ex and tg~=nil and tg:IsExists(Card.IsSummonType,1,nil,SUMMON_TYPE_NORMAL|SUMMON_TYPE_SPECIAL)
end
function s.condition2(e,tp,eg,ep,ev,re,r,rp)
if tp==ep or not Duel.IsChainNegatable(ev) then return false end
if not re:IsActiveType(TYPE_MONSTER) and not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY)
return ex and tg~=nil and tc+tg:FilterCount(s.cfilter,nil)-#tg>0
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
return ex and tg~=nil and tc+tg:FilterCount(Card.IsMonster,nil)-#tg>0
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
Duel.NegateEffect(ev)
end
12 changes: 7 additions & 5 deletions unofficial/c511000117.lua
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
--死霊公爵
--Duke of Demise
--The Duke of Demise
--fixed by Larry126
local s,id=GetID()
function s.initial_effect(c)
--fusion material
--Fusion Materials
c:EnableReviveLimit()
Fusion.AddProcMix(c,true,true,5434080,66989694)
--Battle Indestructable
--Cannot be destroyed by battle
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(1)
c:RegisterEffect(e1)
--maintain
--Maintenance
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
Expand All @@ -27,7 +29,7 @@ function s.mtcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function s.mtop(e,tp,eg,ep,ev,re,r,rp)
if Duel.CheckLPCost(tp,500) and Duel.SelectYesNo(tp,aux.Stringid(57496978,0)) then
if Duel.CheckLPCost(tp,500) then
Duel.PayLPCost(tp,500)
else
Duel.Destroy(e:GetHandler(),REASON_COST)
Expand Down
53 changes: 31 additions & 22 deletions unofficial/c511000171.lua
Original file line number Diff line number Diff line change
@@ -1,40 +1,49 @@
--マジック・サンクチュアリ
--Spell Sanctuary
local s,id=GetID()
function s.initial_effect(c)
--Activate
--Each player adds 1 Spell from their Deck to their hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--wut
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetCode(EFFECT_BECOME_QUICK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(0x3f,0x3f)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSpell))
c:RegisterEffect(e2)
local e2a=Effect.CreateEffect(c)
e2a:SetType(EFFECT_TYPE_FIELD)
e2a:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2a:SetCode(EFFECT_BECOME_QUICK)
e2a:SetRange(LOCATION_SZONE)
e2a:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e2a:SetTarget(function(e,c) return c:IsSpell() and not c:IsType(TYPE_QUICKPLAY) and c:IsFacedown() and Duel.GetTurnPlayer()~=c:GetControler() end)
c:RegisterEffect(e2a)
local e2b=e2a:Clone()
e2b:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e2b:SetTarget(function(e,c) return c:IsSpell() and not c:IsType(TYPE_QUICKPLAY) and c:IsHasEffect(EFFECT_BECOME_QUICK) and Duel.GetTurnPlayer()~=c:GetControler() end)
c:RegisterEffect(e2b)
end
function s.filter(c)
return c:IsSpell() and c:IsAbleToHand()
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,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetPossibleOperationInfo(0,CATEGORY_TOHAND,nil,1,1-tp,LOCATION_DECK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g1=Duel.GetMatchingGroup(s.filter,tp,LOCATION_DECK,0,nil)
if #g1>0 and Duel.SelectYesNo(tp,aux.Stringid(24140059,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g1:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g1=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if #g1>0 then
Duel.SendtoHand(g1,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g1)
end
local g2=Duel.GetMatchingGroup(s.filter,1-tp,LOCATION_DECK,0,nil)
if #g2>0 and Duel.SelectYesNo(1-tp,aux.Stringid(24140059,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g2:Select(1-tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(tp,sg)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(1-tp,s.filter,1-tp,LOCATION_DECK,0,1,1,nil)
if #g2>0 then
Duel.SendtoHand(g2,nil,REASON_EFFECT)
Duel.ConfirmCards(tp,g2)
end
end
Loading