-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Most Duel.GetLocationCountFromEx fixes in unofficial cards (#214)
Most Duel.GetLocationCountFromEx fixes in unofficial cards
- Loading branch information
Showing
93 changed files
with
608 additions
and
530 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
--磁力融合 | ||
--Magnet Fusion | ||
local s,id=GetID() | ||
function s.initial_effect(c) | ||
--Activate | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,70 @@ | ||
--Sp-簡易融合 | ||
--Speed Spell - Instant Fusion | ||
local s,id=GetID() | ||
function s.initial_effect(c) | ||
--Activate | ||
local e1=Effect.CreateEffect(c) | ||
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) | ||
e1:SetType(EFFECT_TYPE_ACTIVATE) | ||
e1:SetCode(EVENT_FREE_CHAIN) | ||
e1:SetCondition(s.con) | ||
e1:SetCountLimit(1,id,EFFECT_COUNT_CODE_OATH) | ||
e1:SetCondition(s.condition) | ||
e1:SetCost(s.cost) | ||
e1:SetTarget(s.target) | ||
e1:SetOperation(s.activate) | ||
c:RegisterEffect(e1) | ||
end | ||
function s.con(e,tp,eg,ep,ev,re,r,rp) | ||
local tc=Duel.GetFieldCard(tp,LOCATION_SZONE,5) | ||
return tc and tc:GetCounter(0x91)>=3 | ||
function s.condition(e,tp,eg,ep,ev,re,r,rp) | ||
return Duel.GetCounter(tp,1,0,0x91)>=3 | ||
end | ||
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk) | ||
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 and Duel.CheckLPCost(tp,1000) end | ||
if chk==0 then return Duel.CheckLPCost(tp,1000) end | ||
Duel.PayLPCost(tp,1000) | ||
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1) | ||
end | ||
function s.filter(c,e,tp) | ||
return c:IsType(TYPE_FUSION) and c:IsLevelBelow(5) | ||
return c:IsType(TYPE_FUSION) and c:IsLevelBelow(5) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 | ||
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial() | ||
end | ||
function s.target(e,tp,eg,ep,ev,re,r,rp,chk) | ||
if chk==0 then return Duel.GetLocationCountFromEx(tp)>0 | ||
and Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end | ||
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end | ||
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) | ||
end | ||
function s.activate(e,tp,eg,ep,ev,re,r,rp) | ||
if Duel.GetLocationCountFromEx(tp)<=0 then return end | ||
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) | ||
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) | ||
local tc=g:GetFirst() | ||
if tc and Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)~=0 then | ||
if not tc then return end | ||
tc:SetMaterial(nil) | ||
if Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)~=0 then | ||
local e1=Effect.CreateEffect(e:GetHandler()) | ||
e1:SetType(EFFECT_TYPE_SINGLE) | ||
e1:SetCode(EFFECT_CANNOT_ATTACK) | ||
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) | ||
e1:SetReset(RESET_EVENT+RESETS_STANDARD) | ||
tc:RegisterEffect(e1,true) | ||
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1) | ||
tc:CompleteProcedure() | ||
local e2=Effect.CreateEffect(e:GetHandler()) | ||
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) | ||
e2:SetCode(EVENT_PHASE+PHASE_END) | ||
e2:SetCountLimit(1) | ||
e2:SetRange(LOCATION_MZONE) | ||
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) | ||
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) | ||
e2:SetLabelObject(tc) | ||
e2:SetCondition(s.descon) | ||
e2:SetOperation(s.desop) | ||
tc:RegisterEffect(e2) | ||
tc:CompleteProcedure() | ||
Duel.RegisterEffect(e2,tp) | ||
end | ||
end | ||
function s.descon(e,tp,eg,ep,ev,re,r,rp) | ||
local tc=e:GetLabelObject() | ||
if tc:GetFlagEffect(id)~=0 then | ||
return true | ||
else | ||
e:Reset() | ||
return false | ||
end | ||
end | ||
function s.desop(e,tp,eg,ep,ev,re,r,rp) | ||
Duel.Destroy(e:GetHandler(),REASON_EFFECT) | ||
local tc=e:GetLabelObject() | ||
Duel.Destroy(tc,REASON_EFFECT) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.