Skip to content
This repository was archived by the owner on Jun 22, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions script/c12117532.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
--罅割れゆく斧
function c12117532.initial_effect(c)
aux.AddPersistentProcedure(c,nil,aux.FilterBoolFunction(Card.IsFaceup),CATEGORY_DISABLE,nil,nil,TIMING_END_PHASE,nil,nil,c12117532.target)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCondition(c12117532.descon)
e2:SetOperation(c12117532.desop)
c:RegisterEffect(e2)
--atkdown
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(c12117532.atkcon)
e3:SetOperation(c12117532.atkop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetRange(LOCATION_SZONE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetTarget(aux.PersistentTargetFilter)
e4:SetValue(c12117532.val)
c:RegisterEffect(e4)
end
function c12117532.target(e,tp,eg,ep,ev,re,r,rp,tc)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,tc,1,0,0)
end
function c12117532.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsStatus(STATUS_DESTROY_CONFIRMED) then return false end
local tc=c:GetFirstCardTarget()
return tc and eg:IsContains(tc) and tc:IsReason(REASON_DESTROY)
end
function c12117532.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
function c12117532.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and e:GetHandler():GetFirstCardTarget()~=nil
end
function c12117532.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
if tc then
tc:RegisterFlagEffect(12117532,RESET_EVENT+0x1fe0000,0,0)
end
end
function c12117532.val(e,c)
return c:GetFlagEffect(12117532)*-500
end
81 changes: 81 additions & 0 deletions script/c12503902.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
--レアメタル化・魔法反射装甲
function c12503902.initial_effect(c)
aux.AddPersistentProcedure(c,0,c12503902.filter,CATEGORY_ATKCHANGE,EFFECT_FLAG_DAMAGE_STEP,nil,TIMING_DAMAGE_STEP,c12503902.condition,nil,nil,c12503902.operation)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_SZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(aux.PersistentTargetFilter)
e1:SetValue(500)
c:RegisterEffect(e1)
--Destroy
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCondition(c12503902.descon2)
e3:SetOperation(c12503902.desop2)
c:RegisterEffect(e3)
end
function c12503902.descon2(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
return tc and eg:IsContains(tc)
end
function c12503902.desop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
function c12503902.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c12503902.filter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE)
end
function c12503902.tfilter1(c,tc)
return c:IsType(TYPE_SPELL) and c:IsHasCardTarget(tc)
end
function c12503902.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c12503902.filter(tc) and tc:IsRelateToEffect(e) then
local g=Duel.GetMatchingGroup(c12503902.tfilter1,tp,LOCATION_SZONE,LOCATION_SZONE,nil,tc)
if g:GetCount()>0 then
local sg,fid=g:GetMaxGroup(Card.GetFieldID)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_SZONE)
e1:SetTargetRange(LOCATION_SZONE,LOCATION_SZONE)
e1:SetCode(EFFECT_DISABLE)
e1:SetCondition(c12503902.discon)
e1:SetTarget(c12503902.distg)
e1:SetLabel(fid)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1,true)
else
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetRange(LOCATION_SZONE)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCondition(c12503902.discon2)
e1:SetOperation(c12503902.disop2)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1,true)
end
end
end
function c12503902.discon(e)
return e:GetHandler():GetCardTargetCount()>0
end
function c12503902.distg(e,c)
return c:GetFieldID()<=e:GetLabel() and c:IsHasCardTarget(e:GetHandler():GetFirstCardTarget()) and c:IsType(TYPE_SPELL)
end
function c12503902.discon2(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
if not tc or not re:IsActiveType(TYPE_SPELL) or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return g:IsContains(tc)
end
function c12503902.disop2(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
e:Reset()
end
64 changes: 64 additions & 0 deletions script/c14005031.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
--ムーンダンスの儀式
function c14005031.initial_effect(c)
aux.AddPersistentProcedure(c,0,c14005031.filter,nil,nil,nil,0x1e0,nil,nil,nil,c14005031.activate)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(14005031,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1)
e1:SetCondition(c14005031.matcon)
e1:SetOperation(c14005031.matop)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c14005031.disable)
e2:SetCondition(c14005031.discon)
e2:SetCode(EFFECT_DISABLE)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCondition(c14005031.descon)
e3:SetOperation(c14005031.desop)
c:RegisterEffect(e3)
end
function c14005031.filter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:GetOverlayCount()==0 and c:IsAttribute(ATTRIBUTE_WIND)
end
function c14005031.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
c:RegisterFlagEffect(14005031,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,0)
end
end
function c14005031.disable(e,c)
return c:IsType(TYPE_EFFECT)
end
function c14005031.discon(e)
return e:GetHandler():GetFirstCardTarget()~=nil
end
function c14005031.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
return tc and eg:IsContains(tc)
end
function c14005031.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
function c14005031.matcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFirstCardTarget()~=nil and e:GetHandler():GetFlagEffect(14005031)>0
end
function c14005031.matop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetFirstCardTarget()
if tc then
Duel.Overlay(tc,Group.FromCards(c))
end
end
37 changes: 37 additions & 0 deletions script/c16278116.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
--竜の束縛
function c16278116.initial_effect(c)
aux.AddPersistentProcedure(c,0,c16278116.filter,nil,nil,nil,0x1c0)
--cannot spsummon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,1)
e3:SetTarget(c16278116.splimit)
c:RegisterEffect(e3)
--Destroy
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetCondition(c16278116.descon)
e4:SetOperation(c16278116.desop)
c:RegisterEffect(e4)
end
function c16278116.filter(c)
return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsAttackBelow(2500) and c:IsDefenseBelow(2500)
end
function c16278116.splimit(e,c,tp,sumtp,sumpos)
local tc=e:GetHandler():GetFirstCardTarget()
return tc and c:IsAttackBelow(tc:GetBaseAttack())
end
function c16278116.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsStatus(STATUS_DESTROY_CONFIRMED) then return false end
local tc=e:GetHandler():GetFirstCardTarget()
return tc and eg:IsContains(tc)
end
function c16278116.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
43 changes: 43 additions & 0 deletions script/c16308000.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
--神の威光
function c16308000.initial_effect(c)
aux.AddPersistentProcedure(c,0,c16308000.filter,nil,nil,0x1c0,0x1c1,nil,nil,nil,c16308000.operation)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetRange(LOCATION_SZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(aux.PersistentTargetFilter)
e1:SetValue(1)
c:RegisterEffect(e1)
end
function c16308000.filter(c)
return c:IsFaceup() and c:IsSetCard(0x4b)
end
function c16308000.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetLabel(2)
e2:SetLabelObject(tc)
e2:SetCondition(c16308000.tgcon)
e2:SetOperation(c16308000.tgop)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,2)
c:RegisterEffect(e2)
end
end
function c16308000.tgcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c16308000.tgop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabel()
ct=ct-1
e:SetLabel(ct)
if ct==0 and e:GetHandler():IsHasCardTarget(e:GetLabelObject()) then
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
end
end
58 changes: 58 additions & 0 deletions script/c17787975.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
--ディメンション・スフィンクス
function c17787975.initial_effect(c)
aux.AddPersistentProcedure(c,0,aux.FilterBoolFunction(Card.IsPosition,POS_FACEUP_ATTACK))
--damage
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(17787975,0))
e3:SetCategory(CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetHintTiming(TIMING_BATTLE_PHASE)
e3:SetCondition(c17787975.damcon)
e3:SetTarget(c17787975.damtg)
e3:SetOperation(c17787975.damop)
c:RegisterEffect(e3)
--Destroy
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetCondition(c17787975.descon)
e4:SetOperation(c17787975.desop)
c:RegisterEffect(e4)
end
function c17787975.damcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_BATTLE_STEP
end
function c17787975.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=c:GetFirstCardTarget()
local at=Duel.GetAttacker()
if chk==0 then return tc and Duel.GetAttackTarget()==tc
and at and at:IsControler(1-tp) and at:GetAttack()>tc:GetAttack()
and c:GetFlagEffect(17787975)==0 end
local dam=math.abs(at:GetAttack()-tc:GetAttack())
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
c:RegisterFlagEffect(17787975,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_DAMAGE,0,1)
end
function c17787975.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=c:GetFirstCardTarget()
if not tc then return false end
local at=Duel.GetAttacker()
if at:IsRelateToBattle() then
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.Damage(p,math.abs(at:GetAttack()-tc:GetAttack()),REASON_EFFECT)
end
end
function c17787975.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
return tc and eg:IsContains(tc)
end
function c17787975.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
31 changes: 31 additions & 0 deletions script/c18807108.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--六芒星の呪縛
function c18807108.initial_effect(c)
aux.AddPersistentProcedure(c,1,nil,CATEGORY_POSITION,nil,nil,nil,nil,nil,nil,nil,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetRange(LOCATION_SZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(aux.PersistentTargetFilter)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_ATTACK)
c:RegisterEffect(e2)
--Destroy
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCondition(c18807108.descon)
e3:SetOperation(c18807108.desop)
c:RegisterEffect(e3)
end
function c18807108.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsStatus(STATUS_DESTROY_CONFIRMED) then return false end
local tc=c:GetFirstCardTarget()
return tc and eg:IsContains(tc) and tc:IsReason(REASON_DESTROY) and c:IsRelateToCard(tc)
end
function c18807108.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
Loading