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
59 changes: 59 additions & 0 deletions script/c15555120.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
--ハイ・スピード・リレベル
function c15555120.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCost(c15555120.cost)
e1:SetTarget(c15555120.target)
e1:SetOperation(c15555120.activate)
c:RegisterEffect(e1)
end
function c15555120.cfilter(c,tp)
local lv=c:GetLevel()
return lv>0 and c:IsSetCard(0x2016) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
and Duel.IsExistingTarget(c15555120.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,lv)
end
function c15555120.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return true end
end
function c15555120.filter(c,lv)
local clv=c:GetLevel()
return c:IsFaceup() and clv>0 and clv~=lv and c:IsType(TYPE_SYNCHRO)
end
function c15555120.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
local lv=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c15555120.filter(chkc,lv) end
if chk==0 then
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c15555120.cfilter,tp,LOCATION_GRAVE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c15555120.cfilter,tp,LOCATION_GRAVE,0,1,1,nil,tp)
Duel.Remove(g,POS_FACEUP,REASON_COST)
local lv=g:GetFirst():GetLevel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c15555120.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,lv)
Duel.SetTargetParam(lv)
end
function c15555120.activate(e,tp,eg,ep,ev,re,r,rp)
local lv=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetLevel()~=lv then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(lv*500)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
56 changes: 56 additions & 0 deletions script/c25290459.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
--レベルアップ!
function c25290459.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c25290459.cost)
e1:SetTarget(c25290459.target)
e1:SetOperation(c25290459.activate)
c:RegisterEffect(e1)
end
function c25290459.costfilter(c,e,tp)
if not c:IsSetCard(0x41) or not c:IsAbleToGraveAsCost() or not c:IsFaceup() then return false end
local code=c:GetCode()
local class=_G["c"..code]
if class==nil or class.lvupcount==nil then return false end
return Duel.IsExistingMatchingCard(c25290459.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,class,e,tp)
end
function c25290459.spfilter(c,class,e,tp)
local code=c:GetCode()
for i=1,class.lvupcount do
if code==class.lvup[i] then return c:IsCanBeSpecialSummoned(e,0,tp,true,true) end
end
return false
end
function c25290459.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return true end
end
function c25290459.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c25290459.costfilter,tp,LOCATION_MZONE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c25290459.costfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SendtoGrave(g,REASON_COST)
local code=g:GetFirst():GetCode()
Duel.SetTargetParam(code)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c25290459.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local code=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local class=_G["c"..code]
if class==nil or class.lvupcount==nil then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c25290459.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,class,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,true,true,POS_FACEUP)
if tc:GetPreviousLocation()==LOCATION_DECK then Duel.ShuffleDeck(tp) end
end
end
71 changes: 71 additions & 0 deletions script/c41925941.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
--冥王の咆哮
function c41925941.initial_effect(c)
--atkdown
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(c41925941.condition)
e1:SetCost(c41925941.cost)
e1:SetTarget(c41925941.target)
e1:SetOperation(c41925941.operation)
c:RegisterEffect(e1)
end
function c41925941.condition(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase()
if phase~=PHASE_DAMAGE or Duel.IsDamageCalculated() then return false end
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if a:IsControler(tp) then
e:SetLabelObject(d)
return a:IsFaceup() and a:IsRace(RACE_FIEND) and a:IsRelateToBattle()
and d and d:IsFaceup() and d:IsRelateToBattle()
elseif d and d:IsControler(tp) then
e:SetLabelObject(a)
return d:IsFaceup() and d:IsRace(RACE_FIEND) and d:IsRelateToBattle()
and a and a:IsFaceup() and a:IsRelateToBattle()
end
end
function c41925941.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return true end
end
function c41925941.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tc=e:GetLabelObject()
if chkc then return chkc==tc end
if chk==0 then
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
return Duel.CheckLPCost(tp,100) and (bc:IsAttackAbove(100) or bc:IsDefenseAbove(100)) and tc:IsCanBeEffectTarget(e) end
local maxc=Duel.GetLP(tp)
local maxpay=bc:GetAttack()
local def=bc:GetDefense()
if maxpay<def then maxpay=def end
if maxpay<maxc then maxc=maxpay end
if maxc>5000 then maxc=5000 end
maxc=math.floor(maxc/100)*100
local t={}
for i=1,maxc/100 do
t[i]=i*100
end
local cost=Duel.AnnounceNumber(tp,table.unpack(t))
Duel.PayLPCost(tp,cost)
Duel.SetTargetCard(tc)
Duel.SetTargetParam(cost)
end
function c41925941.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local bc=Duel.GetFirstTarget()
local val=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
if not bc or not bc:IsRelateToEffect(e) or not bc:IsControler(1-tp) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-val)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
bc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
bc:RegisterEffect(e2)
end
52 changes: 52 additions & 0 deletions script/c49204190.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
--奇策
function c49204190.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCondition(c49204190.condition)
e1:SetCost(c49204190.cost)
e1:SetTarget(c49204190.target)
e1:SetOperation(c49204190.activate)
c:RegisterEffect(e1)
end
function c49204190.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c49204190.cfilter(c)
return c:GetAttack()>0 and c:IsDiscardable()
end
function c49204190.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return true end
end
function c49204190.target(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
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c49204190.cfilter,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c49204190.cfilter,tp,LOCATION_HAND,0,1,1,nil)
local atk=g:GetFirst():GetAttack()
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetTargetParam(atk)
end
function c49204190.activate(e,tp,eg,ep,ev,re,r,rp)
local atk=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-atk)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
end
53 changes: 53 additions & 0 deletions script/c5052212.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
--イージーチューニング
function c5052212.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCondition(c5052212.condition)
e1:SetCost(c5052212.cost)
e1:SetTarget(c5052212.target)
e1:SetOperation(c5052212.activate)
c:RegisterEffect(e1)
end
function c5052212.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c5052212.cfilter(c)
return c:IsType(TYPE_TUNER) and c:IsAbleToRemoveAsCost()
end
function c5052212.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return true end
end
function c5052212.target(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
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c5052212.cfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c5052212.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
local atk=g:GetFirst():GetAttack()
if atk<0 then atk=0 end
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetTargetParam(atk)
end
function c5052212.activate(e,tp,eg,ep,ev,re,r,rp)
local atk=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(atk)
tc:RegisterEffect(e1)
end
end
62 changes: 62 additions & 0 deletions script/c67196946.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
--スター・ブラスト
function c67196946.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c67196946.con)
e1:SetCost(c67196946.cost)
e1:SetTarget(c67196946.tg)
e1:SetOperation(c67196946.op)
c:RegisterEffect(e1)
end
function c67196946.con(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,EFFECT_LPCOST_CHANGE)
end
function c67196946.filter(c,lv)
return c:GetLevel()>lv
end
function c67196946.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return true end
end
function c67196946.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
return Duel.CheckLPCost(tp,500) and Duel.IsExistingMatchingCard(c67196946.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,1) end
local lp=Duel.GetLP(tp)
local g=Duel.GetMatchingGroup(c67196946.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,1)
local tg=g:GetMaxGroup(Card.GetLevel)
local maxlv=tg:GetFirst():GetLevel()
local t={}
local l=1
while l<maxlv and l*500<=lp do
t[l]=l*500
l=l+1
end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(67196946,0))
local announce=Duel.AnnounceNumber(tp,table.unpack(t))
Duel.PayLPCost(tp,announce)
Duel.SetTargetParam(announce/500)
end
function c67196946.op(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local g=Duel.GetMatchingGroup(c67196946.filter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil,ct)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(67196946,1))
local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst()
if tc:IsLocation(LOCATION_MZONE) then
Duel.HintSelection(sg)
end
Duel.ConfirmCards(1-tp,sg)
if tc:IsLocation(LOCATION_HAND) then Duel.ShuffleHand(tp) end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+0xfe0000+RESET_PHASE+PHASE_END)
e1:SetValue(-ct)
tc:RegisterEffect(e1)
end
end
40 changes: 40 additions & 0 deletions script/c80161395.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
--神秘の中華なべ
function c80161395.initial_effect(c)
--recover
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c80161395.cost)
e1:SetTarget(c80161395.target)
e1:SetOperation(c80161395.activate)
c:RegisterEffect(e1)
end
function c80161395.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return true end
end
function c80161395.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=1 then return false end
e:SetLabel(0)
return Duel.CheckReleaseGroup(tp,nil,1,nil) end
local sg=Duel.SelectReleaseGroup(tp,nil,1,1,nil)
local tc=sg:GetFirst()
local atk=tc:GetAttack()
local def=tc:GetDefense()
local rec=0
Duel.Release(tc,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(80161395,0))
local sel=Duel.SelectOption(tp,aux.Stringid(80161395,1),aux.Stringid(80161395,2))
if sel==0 then rec=atk
else rec=def end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(rec)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec)
end
function c80161395.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
Loading