Commit 53576ec9 authored by Fluorohydride's avatar Fluorohydride

Merge pull request #275 from VanillaSalt/patch29

fix
parents a6bd95a6 1471dcdb
......@@ -27,8 +27,10 @@ function c12014404.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c12014404.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
if c:IsAttackPos() then
if not c:IsRelateToEffect(e) then return end
if c:IsDefencePos() then
Duel.Damage(1-tp,800,REASON_EFFECT)
elseif c:IsPosition(POS_FACEUP_ATTACK) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_BATTLE_START)
......@@ -36,8 +38,6 @@ function c12014404.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetOperation(c12014404.atkop)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
else
Duel.Damage(1-tp,800,REASON_EFFECT)
end
end
function c12014404.atkop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -13,7 +13,7 @@ function c14462257.initial_effect(c)
e2:SetDescription(aux.Stringid(14462257,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c14462257.condition)
e2:SetTarget(c14462257.target)
......
......@@ -28,9 +28,10 @@ end
function c21143940.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
local att=tc:GetAttribute()
if Duel.SendtoGrave(tc,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,c21143940.tfilter,tp,LOCATION_EXTRA,0,1,1,nil,tc:GetAttribute(),e,tp)
local sg=Duel.SelectMatchingCard(tp,c21143940.tfilter,tp,LOCATION_EXTRA,0,1,1,nil,att,e,tp)
if sg:GetCount()>0 then
Duel.BreakEffect()
Duel.SpecialSummon(sg,0,tp,tp,true,false,POS_FACEUP)
......
......@@ -16,17 +16,17 @@ function c28596933.dfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c28596933.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(c28596933.filter,tp,LOCATION_MZONE,0,1,nil)
if chk==0 then return Duel.IsExistingMatchingCard(c28596933.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c28596933.dfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c28596933.filter,tp,LOCATION_MZONE,0,1,1,nil)
local sg=Duel.GetMatchingGroup(c28596933.dfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
end
function c28596933.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,c28596933.filter,tp,LOCATION_MZONE,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_HAND) then
local sg=Duel.GetMatchingGroup(c28596933.dfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.Destroy(sg,REASON_EFFECT)
end
......
......@@ -37,8 +37,8 @@ function c29424328.cfcon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer() and Duel.GetFieldGroupCount(1-tp,LOCATION_DECK,0)>0
end
function c29424328.cfop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmDecktop(1-tp,1)
local g=Duel.GetDecktopGroup(1-tp,1)
Duel.ConfirmCards(tp,g)
local tc=g:GetFirst()
local opt=Duel.SelectOption(tp,aux.Stringid(29424328,1),aux.Stringid(29424328,2))
if opt==1 then
......
......@@ -35,10 +35,10 @@ end
function c30353551.checkop(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if a:IsStatus(STATUS_BATTLE_DESTROYED) and a:IsType(TYPE_NORMAL) and a:GetLevel()<=2 then
if a:IsStatus(STATUS_BATTLE_DESTROYED) and a:IsType(TYPE_NORMAL) and a:IsLevelBelow(2) then
c30353551[a:GetControler()]=c30353551[a:GetControler()]+1
end
if d and d:IsStatus(STATUS_BATTLE_DESTROYED) and d:IsType(TYPE_NORMAL) and d:GetLevel()<=2 then
if d and d:IsStatus(STATUS_BATTLE_DESTROYED) and d:IsType(TYPE_NORMAL) and d:IsLevelBelow(2) then
c30353551[d:GetControler()]=c30353551[d:GetControler()]+1
end
end
......@@ -47,7 +47,7 @@ function c30353551.clear(e,tp,eg,ep,ev,re,r,rp)
c30353551[1]=0
end
function c30353551.filter(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:GetLevel()<=2 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsType(TYPE_NORMAL) and c:IsLevelBelow(2) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c30353551.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c30353551[tp]~=0 end
......
......@@ -80,8 +80,8 @@ function c40695128.condition(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0
end
function c40695128.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
Duel.ConfirmCards(tp,g)
local tc=g:GetFirst()
local opt=Duel.SelectOption(tp,aux.Stringid(40695128,2),aux.Stringid(40695128,3))
if opt==1 then
......
......@@ -13,7 +13,7 @@ function c41160595.initial_effect(c)
end
function c41160595.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return bit.band(r,0x41)==0x41 and rp~=tp and c:GetPreviousControler()==tp
return bit.band(r,0x41)==0x41 and rp~=tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
end
function c41160595.filter(c)
......
......@@ -18,10 +18,10 @@ function c42647539.initial_effect(c)
c:RegisterEffect(e3)
end
function c42647539.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c42647539.posop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -8,7 +8,7 @@ function c49389523.initial_effect(c)
e1:SetDescription(aux.Stringid(49389523,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_DESTROYED)
e1:SetCondition(c49389523.spcon)
e1:SetTarget(c49389523.sptg)
......
......@@ -11,11 +11,11 @@ function c66742250.initial_effect(c)
c:RegisterEffect(e1)
end
function c66742250.filter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsType(TYPE_EFFECT)
end
function c66742250.postg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c66742250.filter,Duel.GetTurnPlayer(),LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(c66742250.filter,Duel.GetTurnPlayer(),LOCATION_MZONE,LOCATION_MZONE,nil)
if chk==0 then return Duel.IsExistingMatchingCard(c66742250.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(c66742250.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function c66742250.posop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -25,9 +25,9 @@ function c67959180.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
if opt==coin then
e1:SetValue(c:GetBaseAttack()/2)
e1:SetValue(c:GetAttack()/2)
else
e1:SetValue(c:GetBaseAttack()*2)
e1:SetValue(c:GetAttack()*2)
end
c:RegisterEffect(e1)
end
......
......@@ -13,8 +13,8 @@ function c76614003.condition(e,tp,eg,ep,ev,re,r,rp)
end
function c76614003.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
Duel.ConfirmDecktop(tp,1)
local g=Duel.GetDecktopGroup(tp,1)
Duel.ConfirmCards(tp,g)
local tc=g:GetFirst()
local opt=Duel.SelectOption(tp,aux.Stringid(76614003,1),aux.Stringid(76614003,2))
if opt==1 then
......
......@@ -9,10 +9,10 @@ function c86170989.initial_effect(c)
c:RegisterEffect(e1)
end
function c86170989.filter1(c)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:GetAttack()<=1200 and c:IsAbleToGrave()
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAttackBelow(1200) and c:IsAbleToGrave()
end
function c86170989.filter2(c,e,tp)
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:GetAttack()<=1200
return c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAttackBelow(1200)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c86170989.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -15,7 +15,7 @@ function c87313164.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
end
function c87313164.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_FISH+RACE_SEASERPENT+RACE_AQUA) and c:IsAbleToDeck()
return c:IsFaceup() and c:IsRace(RACE_FISH+RACE_SEASERPENT+RACE_AQUA) and c:IsAbleToDeckAsCost()
end
function c87313164.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c87313164.cfilter,tp,LOCATION_REMOVED,0,1,nil) end
......
......@@ -57,7 +57,7 @@ function c93130021.operation(e,tp,eg,ep,ev,re,r,rp)
local lv=c:GetLevel()
local race=c:GetRace()
local att=c:GetAttribute()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not c:IsRelateToEffect(e) or c:IsFacedown()
or not Duel.IsPlayerCanSpecialSummonMonster(tp,93130022,0,0x4011,atk,def,lv,race,att) then return end
local token=Duel.CreateToken(tp,93130022)
c:CreateRelation(token,RESET_EVENT+0x1fe0000)
......
......@@ -11,7 +11,7 @@ function c96383838.initial_effect(c)
c:RegisterEffect(e1)
end
function c96383838.filter(c,e,tp)
return c:IsType(TYPE_NORMAL) and c:GetLevel()<=2 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
return c:IsType(TYPE_NORMAL) and c:IsLevelBelow(2) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c96383838.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c96383838.filter(chkc,e,tp) end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment