diff --git a/script/c1281505.lua b/script/c1281505.lua new file mode 100644 index 00000000..9af1ea59 --- /dev/null +++ b/script/c1281505.lua @@ -0,0 +1,66 @@ +--ヴァイロン・テトラ +function c1281505.initial_effect(c) + --equip + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(1281505,0)) + e1:SetCategory(CATEGORY_EQUIP) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) + e1:SetCode(EVENT_TO_GRAVE) + e1:SetCondition(c1281505.eqcon) + e1:SetCost(c1281505.eqcost) + e1:SetTarget(c1281505.eqtg) + e1:SetOperation(c1281505.eqop) + c:RegisterEffect(e1) + --destroy sub + local e3=Effect.CreateEffect(c) + e3:SetType(EFFECT_TYPE_EQUIP+EFFECT_TYPE_CONTINUOUS) + e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) + e3:SetCode(EFFECT_DESTROY_REPLACE) + e3:SetTarget(c1281505.reptg) + e3:SetOperation(c1281505.repop) + c:RegisterEffect(e3) +end +function c1281505.eqcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + return c:GetPreviousLocation()==LOCATION_MZONE +end +function c1281505.eqcost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.CheckLPCost(tp,500) end + Duel.PayLPCost(tp,500) +end +function c1281505.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 + and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) +end +function c1281505.eqop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local tc=Duel.GetFirstTarget() + if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then + Duel.Equip(tp,c,tc) + --equip limit + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetValue(c1281505.eqlimit) + e1:SetReset(RESET_EVENT+0x1fe0000) + c:RegisterEffect(e1) + end +end +function c1281505.eqlimit(e,c) + local tp=e:GetHandlerPlayer() + return c:IsControler(tp) +end +function c1281505.reptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + return Duel.SelectYesNo(tp,aux.Stringid(1281505,1)) +end +function c1281505.repop(e,tp,eg,ep,ev,re,r,rp) + Duel.Destroy(e:GetHandler(),REASON_EFFECT+REASON_REPLACE) +end diff --git a/script/c14745409.lua b/script/c14745409.lua new file mode 100644 index 00000000..f7bb3095 --- /dev/null +++ b/script/c14745409.lua @@ -0,0 +1,80 @@ +--聖剣ガラティーン +function c14745409.initial_effect(c) + c:SetUniqueOnField(1,0,14745409) + aux.AddEquipProcedure(c,nil,c14745409.eqfilter1) + --Atk up + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_EQUIP) + e2:SetCode(EFFECT_UPDATE_ATTACK) + e2:SetValue(1000) + c:RegisterEffect(e2) + --atkdown + local e4=Effect.CreateEffect(c) + e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) + e4:SetCode(EVENT_PHASE+PHASE_STANDBY) + e4:SetRange(LOCATION_SZONE) + e4:SetCountLimit(1) + e4:SetCondition(c14745409.atkcon) + e4:SetOperation(c14745409.atkop) + c:RegisterEffect(e4) + --equip + local e5=Effect.CreateEffect(c) + e5:SetDescription(aux.Stringid(14745409,0)) + e5:SetCategory(CATEGORY_EQUIP) + e5:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) + e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e5:SetCode(EVENT_TO_GRAVE) + e5:SetCountLimit(1,14745409) + e5:SetCondition(c14745409.eqcon) + e5:SetTarget(c14745409.eqtg) + e5:SetOperation(c14745409.operation) + c:RegisterEffect(e5) +end +function c14745409.eqfilter1(c) + return c:IsRace(RACE_WARRIOR) +end +function c14745409.atkcon(e,tp,eg,ep,ev,re,r,rp) + return Duel.GetTurnPlayer()==tp +end +function c14745409.atkop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if c:GetFlagEffect(14745409)==0 then + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_EQUIP) + e1:SetCode(EFFECT_UPDATE_ATTACK) + e1:SetValue(-200) + e1:SetReset(RESET_EVENT+0x1fe0000) + c:RegisterEffect(e1) + c:RegisterFlagEffect(14745409,RESET_EVENT+0x1fe0000,0,0) + e:SetLabelObject(e1) + e:SetLabel(2) + else + local pe=e:GetLabelObject() + local ct=e:GetLabel() + e:SetLabel(ct+1) + pe:SetValue(ct*-200) + end +end +function c14745409.operation(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local tc=Duel.GetFirstTarget() + if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() and c:CheckUniqueOnField(tp) then + Duel.Equip(tp,c,tc) + end +end +function c14745409.eqcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) and c:IsReason(REASON_DESTROY) and c:CheckUniqueOnField(tp) +end +function c14745409.eqfilter2(c) + return c:IsFaceup() and c:IsSetCard(0x107a) and c:IsRace(RACE_WARRIOR) +end +function c14745409.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c14745409.eqfilter2(chkc) end + if chk==0 then return e:GetHandler():IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 + and Duel.IsExistingTarget(c14745409.eqfilter2,tp,LOCATION_MZONE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + Duel.SelectTarget(tp,c14745409.eqfilter2,tp,LOCATION_MZONE,0,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) +end diff --git a/script/c19619755.lua b/script/c19619755.lua index 813ca5e9..1d694b4c 100644 --- a/script/c19619755.lua +++ b/script/c19619755.lua @@ -1,6 +1,7 @@ --EM五虹の魔術師 --Performapal Five-Arc Magician --Scripted by Eerie Code +--fixed by MLD function c19619755.initial_effect(c) aux.EnablePendulumAttribute(c) --scale @@ -58,6 +59,7 @@ function c19619755.pencon(e,tp,eg,ep,ev,re,r,rp) end function c19619755.pentg(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.CheckLocation(tp,LOCATION_SZONE,6) or Duel.CheckLocation(tp,LOCATION_SZONE,7) end + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) end function c19619755.penop(e,tp,eg,ep,ev,re,r,rp) if e:GetHandler():IsRelateToEffect(e) diff --git a/script/c19748583.lua b/script/c19748583.lua new file mode 100644 index 00000000..f3dd2ddf --- /dev/null +++ b/script/c19748583.lua @@ -0,0 +1,98 @@ +--聖剣を抱く王妃ギネヴィア +function c19748583.initial_effect(c) + --equip + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(19748583,0)) + e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) + e1:SetCategory(CATEGORY_EQUIP) + e1:SetRange(LOCATION_HAND+LOCATION_GRAVE) + e1:SetCountLimit(1,19748583) + e1:SetTarget(c19748583.eqtg) + e1:SetOperation(c19748583.eqop) + c:RegisterEffect(e1) + --atkup + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_EQUIP) + e2:SetCode(EFFECT_UPDATE_ATTACK) + e2:SetValue(300) + c:RegisterEffect(e2) + --destroy sub + local e3=Effect.CreateEffect(c) + e3:SetType(EFFECT_TYPE_EQUIP+EFFECT_TYPE_CONTINUOUS) + e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE) + e3:SetCode(EFFECT_DESTROY_REPLACE) + e3:SetTarget(c19748583.reptg) + e3:SetOperation(c19748583.repop) + c:RegisterEffect(e3) + --destroy + local e4=Effect.CreateEffect(c) + e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) + e4:SetCategory(CATEGORY_DESTROY) + e4:SetCode(EVENT_BATTLE_START) + e4:SetRange(LOCATION_SZONE) + e4:SetCondition(c19748583.descon) + e4:SetTarget(c19748583.destg) + e4:SetOperation(c19748583.desop) + c:RegisterEffect(e4) +end +function c19748583.filter(c) + return c:IsFaceup() and c:IsSetCard(0x107a) +end +function c19748583.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c19748583.filter(chkc) end + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 + and Duel.IsExistingTarget(c19748583.filter,tp,LOCATION_MZONE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + Duel.SelectTarget(tp,c19748583.filter,tp,LOCATION_MZONE,0,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) +end +function c19748583.eqop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if not c:IsRelateToEffect(e) then return end + local tc=Duel.GetFirstTarget() + if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) then + Duel.SendtoGrave(c,REASON_EFFECT) + return + end + Duel.Equip(tp,c,tc,true) + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetReset(RESET_EVENT+0x1fe0000) + e1:SetValue(c19748583.eqlimit) + c:RegisterEffect(e1) +end +function c19748583.eqlimit(e,c) + return c:IsSetCard(0x107a) +end +function c19748583.reptg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + if chk==0 then return bit.band(r,REASON_EFFECT)~=0 and c:GetEquipTarget():IsAttribute(ATTRIBUTE_LIGHT) + and not e:GetHandler():IsStatus(STATUS_DESTROY_CONFIRMED) end + return Duel.SelectYesNo(e:GetOwnerPlayer(),aux.Stringid(19748583,1)) +end +function c19748583.repop(e,tp,eg,ep,ev,re,r,rp) + Duel.Destroy(e:GetHandler(),REASON_EFFECT+REASON_REPLACE) +end +function c19748583.descon(e,tp,eg,ep,ev,re,r,rp) + local tg=e:GetHandler():GetEquipTarget() + return tg and tg:IsAttribute(ATTRIBUTE_DARK) and (Duel.GetAttacker()==tg or Duel.GetAttackTarget()==tg) +end +function c19748583.destg(e,tp,eg,ep,ev,re,r,rp,chk) + local c=e:GetHandler() + local tc=c:GetEquipTarget():GetBattleTarget() + if chk==0 then return tc and tc:IsControler(1-tp) end + local g=Group.FromCards(tc,c) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0) +end +function c19748583.desop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if not c:IsRelateToEffect(e) then return end + local tc=c:GetEquipTarget():GetBattleTarget() + if tc:IsRelateToBattle() and Duel.Destroy(tc,REASON_EFFECT)~=0 then + Duel.BreakEffect() + Duel.Destroy(c,REASON_EFFECT) + end +end diff --git a/script/c23562407.lua b/script/c23562407.lua index f635f5f0..a2bcb8f6 100644 --- a/script/c23562407.lua +++ b/script/c23562407.lua @@ -63,4 +63,5 @@ function c23562407.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,c23562407.eqfilter2,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) end diff --git a/script/c2584136.lua b/script/c2584136.lua new file mode 100644 index 00000000..ebdbb998 --- /dev/null +++ b/script/c2584136.lua @@ -0,0 +1,54 @@ +--シャクトパス +function c2584136.initial_effect(c) + --equip + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(2584136,0)) + e1:SetCategory(CATEGORY_EQUIP) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetCode(EVENT_BATTLE_DESTROYED) + e1:SetCondition(c2584136.eqcon) + e1:SetTarget(c2584136.eqtg) + e1:SetOperation(c2584136.eqop) + c:RegisterEffect(e1) +end +function c2584136.eqcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local bc=c:GetBattleTarget() + return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) and rp~=tp + and bc:IsFaceup() and bc:IsRelateToBattle() +end +function c2584136.eqtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) +end +function c2584136.eqlimit(e,c) + return e:GetOwner()==c +end +function c2584136.eqop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end + local tc=c:GetBattleTarget() + if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToBattle() then + Duel.Equip(tp,c,tc,true) + --Add Equip limit + local e1=Effect.CreateEffect(tc) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetReset(RESET_EVENT+0x1fe0000) + e1:SetValue(c2584136.eqlimit) + c:RegisterEffect(e1) + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_EQUIP) + e2:SetCode(EFFECT_SET_ATTACK) + e2:SetValue(0) + e2:SetReset(RESET_EVENT+0x1fe0000) + c:RegisterEffect(e2) + local e3=Effect.CreateEffect(c) + e3:SetType(EFFECT_TYPE_EQUIP) + e3:SetCode(EFFECT_CANNOT_CHANGE_POSITION) + e3:SetReset(RESET_EVENT+0x1fe0000) + c:RegisterEffect(e3) + end +end diff --git a/script/c29834183.lua b/script/c29834183.lua new file mode 100644 index 00000000..734c7e4a --- /dev/null +++ b/script/c29834183.lua @@ -0,0 +1,81 @@ +--グレイドル・イーグル +function c29834183.initial_effect(c) + --equip + local e1=Effect.CreateEffect(c) + e1:SetCategory(CATEGORY_EQUIP) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) + e1:SetCode(EVENT_TO_GRAVE) + e1:SetCondition(c29834183.eqcon) + e1:SetTarget(c29834183.eqtg) + e1:SetOperation(c29834183.eqop) + c:RegisterEffect(e1) +end +function c29834183.eqcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + return (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and re:IsActiveType(TYPE_MONSTER))) + and c:IsReason(REASON_DESTROY) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) +end +function c29834183.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 + and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) +end +function c29834183.eqlimit(e,c) + return c==e:GetLabelObject() +end +function c29834183.eqop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end + local tc=Duel.GetFirstTarget() + if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsControler(1-tp) then + Duel.Equip(tp,c,tc,true) + --Add Equip limit + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetReset(RESET_EVENT+0x1fe0000) + e1:SetValue(c29834183.eqlimit) + e1:SetLabelObject(tc) + c:RegisterEffect(e1) + --control + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_EQUIP) + e2:SetCode(EFFECT_SET_CONTROL) + e2:SetValue(tp) + e2:SetReset(RESET_EVENT+0x1fe0000) + c:RegisterEffect(e2) + --Destroy + local e3=Effect.CreateEffect(c) + e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) + e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e3:SetCode(EVENT_LEAVE_FIELD_P) + e3:SetOperation(c29834183.checkop) + e3:SetReset(RESET_EVENT+0x1fe0000) + c:RegisterEffect(e3) + local e4=Effect.CreateEffect(c) + e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) + e4:SetCode(EVENT_LEAVE_FIELD) + e4:SetOperation(c29834183.desop) + e4:SetReset(RESET_EVENT+0x17e0000) + e4:SetLabelObject(e3) + c:RegisterEffect(e4) + end +end +function c29834183.checkop(e,tp,eg,ep,ev,re,r,rp) + if e:GetHandler():IsDisabled() then + e:SetLabel(1) + else e:SetLabel(0) end +end +function c29834183.desop(e,tp,eg,ep,ev,re,r,rp) + if e:GetLabelObject():GetLabel()~=0 then return end + local tc=e:GetHandler():GetEquipTarget() + if tc and tc:IsLocation(LOCATION_MZONE) then + Duel.Destroy(tc,REASON_EFFECT) + end +end diff --git a/script/c30502181.lua b/script/c30502181.lua index e6e74ac3..939cde13 100644 --- a/script/c30502181.lua +++ b/script/c30502181.lua @@ -32,6 +32,7 @@ function c30502181.eqtarget(e,tp,eg,ep,ev,re,r,rp,chk,chkc) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,c30502181.filter,tp,LOCATION_MZONE,0,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) end function c30502181.operation(e,tp,eg,ep,ev,re,r,rp) local tc=Duel.GetFirstTarget() diff --git a/script/c31829185.lua b/script/c31829185.lua new file mode 100644 index 00000000..d471018a --- /dev/null +++ b/script/c31829185.lua @@ -0,0 +1,89 @@ +--ダーク・ネクロフィア +function c31829185.initial_effect(c) + c:EnableReviveLimit() + --special summon + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_FIELD) + e1:SetCode(EFFECT_SPSUMMON_PROC) + e1:SetProperty(EFFECT_FLAG_UNCOPYABLE) + e1:SetRange(LOCATION_HAND) + e1:SetCondition(c31829185.spcon) + e1:SetOperation(c31829185.spop) + c:RegisterEffect(e1) + --reg + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) + e2:SetCode(EVENT_TO_GRAVE) + e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e2:SetOperation(c31829185.tgop) + c:RegisterEffect(e2) + --equip + local e3=Effect.CreateEffect(c) + e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) + e3:SetCode(EVENT_PHASE+PHASE_END) + e3:SetProperty(EFFECT_FLAG_CARD_TARGET) + e3:SetRange(LOCATION_GRAVE) + e3:SetCountLimit(1) + e3:SetCondition(c31829185.eqcon) + e3:SetTarget(c31829185.eqtg) + e3:SetOperation(c31829185.eqop) + c:RegisterEffect(e3) +end +function c31829185.spfilter(c) + return c:IsRace(RACE_FIEND) and c:IsAbleToRemoveAsCost() +end +function c31829185.spcon(e,c) + if c==nil then return true end + local tp=c:GetControler() + return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and Duel.IsExistingMatchingCard(c31829185.spfilter,tp,LOCATION_GRAVE,0,3,nil) +end +function c31829185.spop(e,tp,eg,ep,ev,re,r,rp,c) + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + local g=Duel.SelectMatchingCard(tp,c31829185.spfilter,tp,LOCATION_GRAVE,0,3,3,nil) + Duel.Remove(g,POS_FACEUP,REASON_COST) +end +function c31829185.tgop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) + and rp~=tp and bit.band(r,REASON_DESTROY)~=0 then + c:RegisterFlagEffect(31829185,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1) + end +end +function c31829185.eqcon(e,tp,eg,ep,ev,re,r,rp) + return e:GetHandler():GetFlagEffect(31829185)>0 +end +function c31829185.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end + if chk==0 then return true end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) + local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_CONTROL,g,1,0,0) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) +end +function c31829185.eqlimit(e,c) + return e:GetOwner()==c +end +function c31829185.eqop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end + local tc=Duel.GetFirstTarget() + if tc and c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then + Duel.Equip(tp,c,tc) + --Add Equip limit + local e1=Effect.CreateEffect(tc) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetReset(RESET_EVENT+0x1fe0000) + e1:SetValue(c31829185.eqlimit) + c:RegisterEffect(e1) + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_EQUIP) + e2:SetCode(EFFECT_SET_CONTROL) + e2:SetValue(tp) + e2:SetReset(RESET_EVENT+0x1fc0000) + c:RegisterEffect(e2) + end +end diff --git a/script/c38679204.lua b/script/c38679204.lua new file mode 100644 index 00000000..34a4a4e4 --- /dev/null +++ b/script/c38679204.lua @@ -0,0 +1,79 @@ +--ヴァイロン・ステラ +function c38679204.initial_effect(c) + --equip + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(38679204,0)) + e1:SetCategory(CATEGORY_EQUIP) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) + e1:SetCode(EVENT_TO_GRAVE) + e1:SetCondition(c38679204.eqcon) + e1:SetCost(c38679204.eqcost) + e1:SetTarget(c38679204.eqtg) + e1:SetOperation(c38679204.eqop) + c:RegisterEffect(e1) + --destroy + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(38679204,1)) + e2:SetCategory(CATEGORY_DESTROY) + e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) + e2:SetCode(EVENT_DAMAGE_STEP_END) + e2:SetRange(LOCATION_SZONE) + e2:SetCondition(c38679204.descon) + e2:SetTarget(c38679204.destg) + e2:SetOperation(c38679204.desop) + c:RegisterEffect(e2) +end +function c38679204.eqcon(e,tp,eg,ep,ev,re,r,rp) + return e:GetHandler():IsPreviousLocation(LOCATION_MZONE) +end +function c38679204.eqcost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.CheckLPCost(tp,500) end + Duel.PayLPCost(tp,500) +end +function c38679204.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 + and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) +end +function c38679204.eqop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local tc=Duel.GetFirstTarget() + if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then + Duel.Equip(tp,c,tc) + --equip limit + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetValue(c38679204.eqlimit) + e1:SetReset(RESET_EVENT+0x1fe0000) + c:RegisterEffect(e1) + end +end +function c38679204.eqlimit(e,c) + local tp=e:GetHandlerPlayer() + return c:IsControler(tp) +end +function c38679204.descon(e,tp,eg,ep,ev,re,r,rp) + local ec=e:GetHandler():GetEquipTarget() + local dt=nil + if ec==Duel.GetAttacker() then dt=Duel.GetAttackTarget() + elseif ec==Duel.GetAttackTarget() then dt=Duel.GetAttacker() end + e:SetLabelObject(dt) + return dt and dt:IsRelateToBattle() +end +function c38679204.destg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetLabelObject(),1,0,0) +end +function c38679204.desop(e,tp,eg,ep,ev,re,r,rp) + local dt=e:GetLabelObject() + if dt:IsRelateToBattle() then + Duel.Destroy(dt,REASON_EFFECT) + end +end diff --git a/script/c50287060.lua b/script/c50287060.lua new file mode 100644 index 00000000..0f625081 --- /dev/null +++ b/script/c50287060.lua @@ -0,0 +1,47 @@ +--暗黒魔族ギルファー・デーモン +function c50287060.initial_effect(c) + --equip + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(50287060,0)) + e1:SetCategory(CATEGORY_EQUIP) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) + e1:SetCode(EVENT_TO_GRAVE) + e1:SetTarget(c50287060.eqtg) + e1:SetOperation(c50287060.eqop) + c:RegisterEffect(e1) +end +function c50287060.eqtg(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.GetLocationCount(tp,LOCATION_SZONE)>0 + and 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) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) +end +function c50287060.eqlimit(e,c) + return e:GetOwner()==c +end +function c50287060.eqop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end + local tc=Duel.GetFirstTarget() + if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then + Duel.Equip(tp,c,tc,true) + --Add Equip limit + local e1=Effect.CreateEffect(tc) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetReset(RESET_EVENT+0x1fe0000) + e1:SetValue(c50287060.eqlimit) + c:RegisterEffect(e1) + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_EQUIP) + e2:SetCode(EFFECT_UPDATE_ATTACK) + e2:SetValue(-500) + e2:SetReset(RESET_EVENT+0x1fe0000) + c:RegisterEffect(e2) + end +end diff --git a/script/c58257569.lua b/script/c58257569.lua index 6ca0e9f6..dd715ddd 100644 --- a/script/c58257569.lua +++ b/script/c58257569.lua @@ -36,6 +36,7 @@ function c58257569.target(e,tp,eg,ep,ev,re,r,rp,chk) and Duel.IsExistingMatchingCard(c58257569.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) end function c58257569.operation(e,tp,eg,ep,ev,re,r,rp) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end diff --git a/script/c65844845.lua b/script/c65844845.lua new file mode 100644 index 00000000..16c6cf44 --- /dev/null +++ b/script/c65844845.lua @@ -0,0 +1,65 @@ +--甲虫装機 ギガグリオル +function c65844845.initial_effect(c) + --equip + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(65844845,0)) + e1:SetType(EFFECT_TYPE_IGNITION) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET) + e1:SetCategory(CATEGORY_EQUIP) + e1:SetRange(LOCATION_GRAVE) + e1:SetCountLimit(1,65844845) + e1:SetCost(c65844845.eqcost) + e1:SetTarget(c65844845.eqtg) + e1:SetOperation(c65844845.eqop) + c:RegisterEffect(e1) + --equip effect + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_EQUIP) + e2:SetCode(EFFECT_SET_BASE_ATTACK) + e2:SetValue(2000) + c:RegisterEffect(e2) + local e3=Effect.CreateEffect(c) + e3:SetType(EFFECT_TYPE_EQUIP) + e3:SetCode(EFFECT_PIERCE) + c:RegisterEffect(e3) +end +function c65844845.cfilter(c) + return c:IsRace(RACE_INSECT) and c:IsAbleToRemoveAsCost() +end +function c65844845.eqcost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.IsExistingMatchingCard(c65844845.cfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) + local g=Duel.SelectMatchingCard(tp,c65844845.cfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler()) + Duel.Remove(g,POS_FACEUP,REASON_COST) +end +function c65844845.filter(c) + return c:IsFaceup() and c:IsSetCard(0x56) +end +function c65844845.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c65844845.filter(chkc) end + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 + and Duel.IsExistingTarget(c65844845.filter,tp,LOCATION_MZONE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + Duel.SelectTarget(tp,c65844845.filter,tp,LOCATION_MZONE,0,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) +end +function c65844845.eqop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if not c:IsRelateToEffect(e) then return end + local tc=Duel.GetFirstTarget() + if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:IsFacedown() or not tc:IsRelateToEffect(e) then + return + end + Duel.Equip(tp,c,tc,true) + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetReset(RESET_EVENT+0x1fe0000) + e1:SetValue(c65844845.eqlimit) + e1:SetLabelObject(tc) + c:RegisterEffect(e1) +end +function c65844845.eqlimit(e,c) + return c==e:GetLabelObject() +end diff --git a/script/c66451379.lua b/script/c66451379.lua new file mode 100644 index 00000000..d1518204 --- /dev/null +++ b/script/c66451379.lua @@ -0,0 +1,81 @@ +--グレイドル・アリゲーター +function c66451379.initial_effect(c) + --equip + local e1=Effect.CreateEffect(c) + e1:SetCategory(CATEGORY_EQUIP) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) + e1:SetCode(EVENT_TO_GRAVE) + e1:SetCondition(c66451379.eqcon) + e1:SetTarget(c66451379.eqtg) + e1:SetOperation(c66451379.eqop) + c:RegisterEffect(e1) +end +function c66451379.eqcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + return (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and re:IsActiveType(TYPE_SPELL))) + and c:IsReason(REASON_DESTROY) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) +end +function c66451379.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 + and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) +end +function c66451379.eqlimit(e,c) + return c==e:GetLabelObject() +end +function c66451379.eqop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end + local tc=Duel.GetFirstTarget() + if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsControler(1-tp) then + Duel.Equip(tp,c,tc,true) + --Add Equip limit + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetReset(RESET_EVENT+0x1fe0000) + e1:SetValue(c66451379.eqlimit) + e1:SetLabelObject(tc) + c:RegisterEffect(e1) + --control + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_EQUIP) + e2:SetCode(EFFECT_SET_CONTROL) + e2:SetValue(tp) + e2:SetReset(RESET_EVENT+0x1fe0000) + c:RegisterEffect(e2) + --Destroy + local e3=Effect.CreateEffect(c) + e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) + e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e3:SetCode(EVENT_LEAVE_FIELD_P) + e3:SetOperation(c66451379.checkop) + e3:SetReset(RESET_EVENT+0x1fe0000) + c:RegisterEffect(e3) + local e4=Effect.CreateEffect(c) + e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) + e4:SetCode(EVENT_LEAVE_FIELD) + e4:SetOperation(c66451379.desop) + e4:SetReset(RESET_EVENT+0x17e0000) + e4:SetLabelObject(e3) + c:RegisterEffect(e4) + end +end +function c66451379.checkop(e,tp,eg,ep,ev,re,r,rp) + if e:GetHandler():IsDisabled() then + e:SetLabel(1) + else e:SetLabel(0) end +end +function c66451379.desop(e,tp,eg,ep,ev,re,r,rp) + if e:GetLabelObject():GetLabel()~=0 then return end + local tc=e:GetHandler():GetEquipTarget() + if tc and tc:IsLocation(LOCATION_MZONE) then + Duel.Destroy(tc,REASON_EFFECT) + end +end diff --git a/script/c70913714.lua b/script/c70913714.lua new file mode 100644 index 00000000..af0bc101 --- /dev/null +++ b/script/c70913714.lua @@ -0,0 +1,84 @@ +--古神ハストール +function c70913714.initial_effect(c) + --synchro summon + aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1) + c:EnableReviveLimit() + --equip + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(70913714,0)) + e1:SetCategory(CATEGORY_EQUIP) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) + e1:SetCode(EVENT_TO_GRAVE) + e1:SetCondition(c70913714.eqcon) + e1:SetTarget(c70913714.eqtg) + e1:SetOperation(c70913714.eqop) + c:RegisterEffect(e1) +end +function c70913714.eqcon(e,tp,eg,ep,ev,re,r,rp) + return e:GetHandler():IsPreviousLocation(LOCATION_MZONE) +end +function c70913714.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 + and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) +end +function c70913714.eqlimit(e,c) + return e:GetOwner()==c +end +function c70913714.eqop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end + local tc=Duel.GetFirstTarget() + if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then + Duel.Equip(tp,c,tc,true) + --Add Equip limit + local e1=Effect.CreateEffect(tc) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetReset(RESET_EVENT+0x1fe0000) + e1:SetValue(c70913714.eqlimit) + c:RegisterEffect(e1) + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_EQUIP) + e2:SetCode(EFFECT_DISABLE) + e2:SetReset(RESET_EVENT+0x1fe0000) + c:RegisterEffect(e2) + local e3=e2:Clone() + e3:SetCode(EFFECT_CANNOT_ATTACK) + c:RegisterEffect(e3) + --control + local e4=Effect.CreateEffect(c) + e4:SetDescription(aux.Stringid(70913714,1)) + e4:SetCategory(CATEGORY_CONTROL) + e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) + e4:SetCode(EVENT_LEAVE_FIELD) + e4:SetCondition(c70913714.ctcon) + e4:SetTarget(c70913714.cttg) + e4:SetOperation(c70913714.ctop) + e4:SetReset(RESET_EVENT+0x1020000) + c:RegisterEffect(e4) + end +end +function c70913714.ctcon(e,tp,eg,ep,ev,re,r,rp) + return not e:GetHandler():IsReason(REASON_LOST_TARGET) +end +function c70913714.cttg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return true end + local ec=e:GetHandler():GetPreviousEquipTarget() + if ec:IsLocation(LOCATION_MZONE) and ec:IsControlerCanBeChanged() then + Duel.SetTargetCard(ec) + Duel.SetOperationInfo(0,CATEGORY_CONTROL,ec,1,0,0) + end +end +function c70913714.ctop(e,tp,eg,ep,ev,re,r,rp) + local ec=Duel.GetFirstTarget() + if ec and ec:IsRelateToEffect(e) then + Duel.GetControl(ec,tp) + end +end diff --git a/script/c74064212.lua b/script/c74064212.lua new file mode 100644 index 00000000..73fb1452 --- /dev/null +++ b/script/c74064212.lua @@ -0,0 +1,63 @@ +--ヴァイロン・プリズム +function c74064212.initial_effect(c) + --equip + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(74064212,0)) + e1:SetCategory(CATEGORY_EQUIP) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY) + e1:SetCode(EVENT_TO_GRAVE) + e1:SetCondition(c74064212.eqcon) + e1:SetCost(c74064212.eqcost) + e1:SetTarget(c74064212.eqtg) + e1:SetOperation(c74064212.eqop) + c:RegisterEffect(e1) + --atkup + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_EQUIP) + e2:SetCode(EFFECT_UPDATE_ATTACK) + e2:SetCondition(c74064212.atkcon) + e2:SetValue(1000) + c:RegisterEffect(e2) +end +function c74064212.eqcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + return c:GetPreviousLocation()==LOCATION_MZONE +end +function c74064212.eqcost(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.CheckLPCost(tp,500) end + Duel.PayLPCost(tp,500) +end +function c74064212.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsFaceup() end + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 + and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) +end +function c74064212.eqop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local tc=Duel.GetFirstTarget() + if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) then + Duel.Equip(tp,c,tc) + --equip limit + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetValue(c74064212.eqlimit) + e1:SetReset(RESET_EVENT+0x1fe0000) + c:RegisterEffect(e1) + end +end +function c74064212.eqlimit(e,c) + local tp=e:GetHandlerPlayer() + return c:IsControler(tp) +end +function c74064212.atkcon(e) + local ph=Duel.GetCurrentPhase() + local ec=e:GetHandler():GetEquipTarget() + return ec and (ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL) and ec:IsRelateToBattle() +end diff --git a/script/c7452945.lua b/script/c7452945.lua new file mode 100644 index 00000000..e0b4ba2d --- /dev/null +++ b/script/c7452945.lua @@ -0,0 +1,53 @@ +--天命の聖剣 +function c7452945.initial_effect(c) + c:SetUniqueOnField(1,0,7452945) + aux.AddEquipProcedure(c,nil,c7452945.eqfilter1) + --cannot be destroyed + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_EQUIP) + e2:SetCode(EFFECT_INDESTRUCTABLE_COUNT) + e2:SetValue(c7452945.valcon) + e2:SetCountLimit(1) + c:RegisterEffect(e2) + --equip + local e4=Effect.CreateEffect(c) + e4:SetDescription(aux.Stringid(7452945,0)) + e4:SetCategory(CATEGORY_EQUIP) + e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) + e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e4:SetCode(EVENT_TO_GRAVE) + e4:SetCountLimit(1,7452945) + e4:SetCondition(c7452945.eqcon) + e4:SetTarget(c7452945.eqtg) + e4:SetOperation(c7452945.operation) + c:RegisterEffect(e4) +end +function c7452945.eqfilter1(c) + return c:IsRace(RACE_WARRIOR) +end +function c7452945.operation(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local tc=Duel.GetFirstTarget() + if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() and c:CheckUniqueOnField(tp) then + Duel.Equip(tp,c,tc) + end +end +function c7452945.valcon(e,re,r,rp) + return bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0 +end +function c7452945.eqcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) and c:IsReason(REASON_DESTROY) and c:CheckUniqueOnField(tp) +end +function c7452945.eqfilter2(c) + return c:IsFaceup() and c:IsSetCard(0x107a) and c:IsRace(RACE_WARRIOR) +end +function c7452945.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c7452945.eqfilter2(chkc) end + if chk==0 then return e:GetHandler():IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 + and Duel.IsExistingTarget(c7452945.eqfilter2,tp,LOCATION_MZONE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + Duel.SelectTarget(tp,c7452945.eqfilter2,tp,LOCATION_MZONE,0,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) +end diff --git a/script/c83438826.lua b/script/c83438826.lua new file mode 100644 index 00000000..fc255d82 --- /dev/null +++ b/script/c83438826.lua @@ -0,0 +1,78 @@ +--聖剣アロンダイト +function c83438826.initial_effect(c) + c:SetUniqueOnField(1,0,83438826) + aux.AddEquipProcedure(c,nil,aux.FilterBoolFunction(Card.IsRace,RACE_WARRIOR)) + --destroy + local e4=Effect.CreateEffect(c) + e4:SetDescription(aux.Stringid(83438826,0)) + e4:SetCategory(CATEGORY_DESTROY) + e4:SetType(EFFECT_TYPE_IGNITION) + e4:SetProperty(EFFECT_FLAG_CARD_TARGET) + e4:SetRange(LOCATION_SZONE) + e4:SetCountLimit(1) + e4:SetTarget(c83438826.destg) + e4:SetOperation(c83438826.desop) + c:RegisterEffect(e4) + --equip + local e5=Effect.CreateEffect(c) + e5:SetDescription(aux.Stringid(83438826,1)) + e5:SetCategory(CATEGORY_EQUIP) + e5:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) + e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e5:SetCode(EVENT_TO_GRAVE) + e5:SetCountLimit(1,83438826) + e5:SetCondition(c83438826.eqcon) + e5:SetTarget(c83438826.eqtg) + e5:SetOperation(c83438826.operation) + c:RegisterEffect(e5) +end +function c83438826.operation(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local tc=Duel.GetFirstTarget() + if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() and c:CheckUniqueOnField(tp) then + Duel.Equip(tp,c,tc) + end +end +function c83438826.desfilter(c) + return c:IsFacedown() +end +function c83438826.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c83438826.desfilter(chkc) end + local eq=e:GetHandler():GetEquipTarget() + if chk==0 then return eq and eq:IsAttackAbove(500) + and Duel.IsExistingTarget(c83438826.desfilter,tp,0,LOCATION_ONFIELD,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) + local g=Duel.SelectTarget(tp,c83438826.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) +end +function c83438826.desop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local tc=Duel.GetFirstTarget() + local eq=c:GetEquipTarget() + if not c:IsRelateToEffect(e) or eq:IsImmuneToEffect(e) or not eq:IsAttackAbove(500) then return end + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_UPDATE_ATTACK) + e1:SetValue(-500) + e1:SetReset(RESET_EVENT+0x1fe0000) + eq:RegisterEffect(e1) + if tc:IsRelateToEffect(e) and tc:IsControler(1-tp) and tc:IsFacedown() then + Duel.Destroy(tc,REASON_EFFECT) + end +end +function c83438826.eqcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) and c:IsReason(REASON_DESTROY) and c:CheckUniqueOnField(tp) +end +function c83438826.eqfilter2(c) + return c:IsFaceup() and c:IsSetCard(0x107a) and c:IsRace(RACE_WARRIOR) +end +function c83438826.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c83438826.eqfilter2(chkc) end + if chk==0 then return e:GetHandler():IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 + and Duel.IsExistingTarget(c83438826.eqfilter2,tp,LOCATION_MZONE,0,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + Duel.SelectTarget(tp,c83438826.eqfilter2,tp,LOCATION_MZONE,0,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) +end diff --git a/script/c93445074.lua b/script/c93445074.lua new file mode 100644 index 00000000..b1047ad5 --- /dev/null +++ b/script/c93445074.lua @@ -0,0 +1,81 @@ +--グレイドル・アリゲーター +function c93445074.initial_effect(c) + --equip + local e1=Effect.CreateEffect(c) + e1:SetCategory(CATEGORY_EQUIP) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY) + e1:SetCode(EVENT_TO_GRAVE) + e1:SetCondition(c93445074.eqcon) + e1:SetTarget(c93445074.eqtg) + e1:SetOperation(c93445074.eqop) + c:RegisterEffect(e1) +end +function c93445074.eqcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + return (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and re:IsActiveType(TYPE_TRAP))) + and c:IsReason(REASON_DESTROY) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE) +end +function c93445074.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) + if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 + and Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end + Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) + Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) + Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) +end +function c93445074.eqlimit(e,c) + return c==e:GetLabelObject() +end +function c93445074.eqop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end + local tc=Duel.GetFirstTarget() + if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToEffect(e) and tc:IsControler(1-tp) then + Duel.Equip(tp,c,tc,true) + --Add Equip limit + local e1=Effect.CreateEffect(c) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetReset(RESET_EVENT+0x1fe0000) + e1:SetValue(c93445074.eqlimit) + e1:SetLabelObject(tc) + c:RegisterEffect(e1) + --control + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_EQUIP) + e2:SetCode(EFFECT_SET_CONTROL) + e2:SetValue(tp) + e2:SetReset(RESET_EVENT+0x1fe0000) + c:RegisterEffect(e2) + --Destroy + local e3=Effect.CreateEffect(c) + e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) + e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e3:SetCode(EVENT_LEAVE_FIELD_P) + e3:SetOperation(c93445074.checkop) + e3:SetReset(RESET_EVENT+0x1fe0000) + c:RegisterEffect(e3) + local e4=Effect.CreateEffect(c) + e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE) + e4:SetCode(EVENT_LEAVE_FIELD) + e4:SetOperation(c93445074.desop) + e4:SetReset(RESET_EVENT+0x17e0000) + e4:SetLabelObject(e3) + c:RegisterEffect(e4) + end +end +function c93445074.checkop(e,tp,eg,ep,ev,re,r,rp) + if e:GetHandler():IsDisabled() then + e:SetLabel(1) + else e:SetLabel(0) end +end +function c93445074.desop(e,tp,eg,ep,ev,re,r,rp) + if e:GetLabelObject():GetLabel()~=0 then return end + local tc=e:GetHandler():GetEquipTarget() + if tc and tc:IsLocation(LOCATION_MZONE) then + Duel.Destroy(tc,REASON_EFFECT) + end +end diff --git a/script/c97904474.lua b/script/c97904474.lua new file mode 100644 index 00000000..42cc3a46 --- /dev/null +++ b/script/c97904474.lua @@ -0,0 +1,73 @@ +--手錠龍 +function c97904474.initial_effect(c) + --equip + local e1=Effect.CreateEffect(c) + e1:SetDescription(aux.Stringid(97904474,0)) + e1:SetCategory(CATEGORY_EQUIP) + e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e1:SetCode(EVENT_BATTLE_DESTROYED) + e1:SetCondition(c97904474.eqcon) + e1:SetTarget(c97904474.eqtg) + e1:SetOperation(c97904474.eqop) + c:RegisterEffect(e1) + --spsummon + local e2=Effect.CreateEffect(c) + e2:SetDescription(aux.Stringid(97904474,1)) + e2:SetCategory(CATEGORY_SPECIAL_SUMMON) + e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) + e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP) + e2:SetCode(EVENT_TO_GRAVE) + e2:SetCondition(c97904474.spcon) + e2:SetTarget(c97904474.sptg) + e2:SetOperation(c97904474.spop) + c:RegisterEffect(e2) +end +function c97904474.eqcon(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + local bc=c:GetBattleTarget() + return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) and c:GetPreviousControler()==tp + and c==Duel.GetAttackTarget() and bc:IsFaceup() and bc:IsControler(1-tp) and bc:IsRelateToBattle() +end +function c97904474.eqtg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end + Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) +end +function c97904474.eqlimit(e,c) + return e:GetOwner()==c +end +function c97904474.eqop(e,tp,eg,ep,ev,re,r,rp) + local c=e:GetHandler() + if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end + local tc=c:GetBattleTarget() + if c:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsRelateToBattle() then + Duel.Equip(tp,c,tc,true) + --Add Equip limit + local e1=Effect.CreateEffect(tc) + e1:SetType(EFFECT_TYPE_SINGLE) + e1:SetCode(EFFECT_EQUIP_LIMIT) + e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) + e1:SetReset(RESET_EVENT+0x1fe0000) + e1:SetValue(c97904474.eqlimit) + c:RegisterEffect(e1) + local e2=Effect.CreateEffect(c) + e2:SetType(EFFECT_TYPE_EQUIP) + e2:SetCode(EFFECT_UPDATE_ATTACK) + e2:SetValue(-1800) + e2:SetReset(RESET_EVENT+0x1fe0000) + c:RegisterEffect(e2) + end +end +function c97904474.spcon(e,tp,eg,ep,ev,re,r,rp) + return e:GetHandler():IsReason(REASON_LOST_TARGET) and e:GetHandler():GetPreviousEquipTarget():IsReason(REASON_DESTROY) +end +function c97904474.sptg(e,tp,eg,ep,ev,re,r,rp,chk) + if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 + and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end + Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) +end +function c97904474.spop(e,tp,eg,ep,ev,re,r,rp) + if e:GetHandler():IsRelateToEffect(e) then + Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) + end +end diff --git a/script/c98867329.lua b/script/c98867329.lua index bf8b7b8a..1728d2c2 100644 --- a/script/c98867329.lua +++ b/script/c98867329.lua @@ -32,6 +32,7 @@ function c98867329.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP) Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil) Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0) + Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0) end function c98867329.eqop(e,tp,eg,ep,ev,re,r,rp) local c=e:GetHandler()