Commit 8d71667f authored by argon.sun's avatar argon.sun

fix

parent 69a01ab3
......@@ -798,14 +798,15 @@ int32 field::process() {
uint32 count = it->arg2, i = 0, p = 0;
field::card_set::iterator cit;
group* pgroup = it->ptarget;
group* newgroup = pduel->new_group();
if(count > pgroup->container.size())
count = pgroup->container.size();
if(count == 0) {
pduel->lua->add_param(newgroup, PARAM_TYPE_GROUP);
core.units.pop_front();
return pduel->bufferlen;
}
duel* pduel = pgroup->pduel;
group* newgroup = pduel->new_group();
if(count == pgroup->container.size())
newgroup->container = pgroup->container;
else {
......
......@@ -16,12 +16,11 @@ function c12296376.initial_effect(c)
end
function c12296376.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local t=Duel.GetAttackTarget()
if t==c then t=GetAttacker() end
if not t then return end
local bc=c:GetBattleTarget()
if not bc then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetReset(RESET_EVENT+0x1fe0000)
t:RegisterEffect(e1)
bc:RegisterEffect(e1)
end
......@@ -34,6 +34,5 @@ function c13761956.atop(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(400)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
......@@ -41,7 +41,7 @@ function c15383415.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c15383415.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
......@@ -28,8 +28,9 @@ function c20855340.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c20855340.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,153,tp,tp,false,false,POS_FACEUP)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,153,tp,tp,false,false,POS_FACEUP)
local rf=tc.evolreg
if rf then rf(tc) end
end
......
......@@ -11,7 +11,7 @@ end
function c27927359.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if bc:IsStatus(STATUS_BATTLE_DESTROYED) and bc:IsType(TYPE_FLIP) then
if bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and bc:IsType(TYPE_FLIP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
......
......@@ -25,7 +25,7 @@ end
function c27944249.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c27944249.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c27944249.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
and Duel.IsExistingTarget(c27944249.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c27944249.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
......
......@@ -36,25 +36,24 @@ function c31764700.initial_effect(c)
end
function c31764700.batop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetAttacker()
if c==tc then tc=Duel.GetAttackTarget() end
if tc then
e:SetLabel(tc:GetAttack())
e:SetLabelObject(tc)
local bc=c:GetBattleTarget()
if bc then
e:SetLabel(bc:GetAttack())
e:SetLabelObject(bc)
end
end
function c31764700.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAttackPos() and Duel.GetAttackTarget()~=0 end
local tc=e:GetLabelObject():GetLabelObject()
local bc=e:GetHandler():GetBattleTarget()
if chk==0 then return bc and e:GetHandler():IsAttackPos() end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,e:GetLabelObject():GetLabel())
if tc:IsDestructable() then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
if bc:IsDestructable() then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,bc,1,0,0)
end
end
function c31764700.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(1-tp,e:GetLabelObject():GetLabel(),REASON_EFFECT)
local tc=e:GetLabelObject():GetLabelObject()
if tc:IsRelateToBattle() then
Duel.Destroy(tc,REASON_EFFECT)
local bc=e:GetHandler():GetBattleTarget()
if bc:IsRelateToBattle() then
Duel.Destroy(bc,REASON_EFFECT)
end
end
......@@ -15,7 +15,7 @@ end
function c33883834.con(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return (a:GetControler()==tp and a:IsSetCard(0x3d)) or (d and d:GetControler()==tp and d:IsSetCard(0x3d))
return d and ((a:GetControler()==tp and a:IsSetCard(0x3d)) or (d:GetControler()==tp and d:IsSetCard(0x3d)))
and Duel.GetFlagEffect(tp,33883834)==0
end
function c33883834.cost(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -50,12 +50,14 @@ function c34230233.desop(e,tp,eg,ep,ev,re,r,rp)
if tc and tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and rp~=tp then
Duel.BreakEffect()
local hg=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
local cg=hg:RandomSelect(tp,1)
local cc=cg:GetFirst()
Duel.ConfirmCards(tp,cc)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0
and cc:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.SelectYesNo(tp,aux.Stringid(34230233,1)) then
Duel.SpecialSummon(cc,0,tp,tp,false,false,POS_FACEUP)
else Duel.ShuffleHand(1-tp) end
if hg:GetCount()>0 then
local cg=hg:RandomSelect(tp,1)
local cc=cg:GetFirst()
Duel.ConfirmCards(tp,cc)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and cc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.SelectYesNo(tp,aux.Stringid(34230233,1)) then
Duel.SpecialSummon(cc,0,tp,tp,false,false,POS_FACEUP)
else Duel.ShuffleHand(1-tp) end
end
end
end
......@@ -87,7 +87,7 @@ function c39823987.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c39823987.spop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
end
end
......@@ -44,7 +44,7 @@ function c41872150.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c41872150.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
......@@ -88,7 +88,7 @@ function c44877690.rettg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c44877690.retop2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
......@@ -36,7 +36,7 @@ function c45037489.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsFaceup() or not c:IsRelateToEffect(e) then return end
Duel.NegateActivation(ev)
if re_GetHandler():IsRelateToEffect(re) then
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
......@@ -65,7 +65,7 @@ function c47111934.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c47111934.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
......@@ -106,7 +106,7 @@ end
function c48568432.spop2(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -57,7 +57,7 @@ function c5183693.atkup(e,tp,eg,ep,ev,re,r,rp)
local eqc=e:GetHandler():GetEquipTarget()
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if a~=eqc and d~=eqc then return end
if not d or (a~=eqc and d~=eqc) then return end
local la=a:GetLevel()
local ld=d:GetLevel()
if (a==eqc and ld<=la) or (d==eqc and la<=ld) then return end
......
......@@ -11,6 +11,7 @@ end
function c54415063.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if not bc then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
......
......@@ -62,7 +62,7 @@ function c5556499.hdop(e,tp,eg,ep,ev,re,r,rp)
if ep==tp then return end
if not re:IsActiveType(TYPE_EFFECT) or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if g:IsContains(e:GetHandler()) then
if g and g:IsContains(e:GetHandler()) then
local hg=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if hg:GetCount()==0 then return end
Duel.ConfirmCards(tp,hg)
......
......@@ -22,7 +22,7 @@ function c56223084.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c56223084.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
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)
......
......@@ -43,6 +43,7 @@ function c61204971.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c61204971.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsFaceup() and tc:IsRelateToEffect(e)
and tc:GetBaseAttack()<c:GetAttack() then
......
......@@ -93,7 +93,7 @@ function c64038662.efop(e,tp,eg,ep,ev,re,r,rp)
end
else
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENCE)
end
end
......
......@@ -24,6 +24,7 @@ end
function c65240384.negop(e,tp,eg,ep,ev,re,r,rp)
if re:IsActiveType(TYPE_SPELL) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g then return end
local tc=g:GetFirst()
if g:GetCount()==1 and tc:IsCode(65240384) and tc:IsLocation(LOCATION_MZONE)
and tc:IsFacedown() and tc:IsDefencePos() then
......
......@@ -37,7 +37,7 @@ function c6903857.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c6903857.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if tc and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
......
......@@ -18,7 +18,7 @@ function c73507661.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c73507661.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end
local sg=Duel.GetMatchingGroup(c73507661.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,g:GetCount()*300)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,sg:GetCount()*300)
end
function c73507661.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c73507661.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
......
......@@ -25,7 +25,7 @@ function c73574678.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c73574678.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
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)
......
......@@ -42,6 +42,7 @@ end
function c79106360.sp(e,tp,ct)
local g=Duel.GetFieldGroup(tp,LOCATION_DECK,0)
local dt=g:GetCount()
if dt==0 then return false end
local dlist={}
tc=g:GetFirst()
while tc do
......
......@@ -32,7 +32,7 @@ end
function c79718768.desop1(e,tp,eg,ep,ev,re,r,rp)
if rp==tp or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET)
or not eg:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE) then
e:SetLabelObjct(0)
e:SetLabelObject(nil)
else e:SetLabelObject(re) end
end
function c79718768.desop2(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -40,7 +40,7 @@ function c80744121.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c80744121.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
......@@ -65,7 +65,7 @@ function c81122844.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c81122844.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
......
--治療の神 ディアン·ケト
function c84257640.initial_effect(c)
--recover
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c84257640.tg)
e1:SetOperation(c84257640.op)
c:RegisterEffect(e1)
end
function c84257640.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
end
function c84257640.op(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
--セカンド·ブースター
function c88032368.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88032368,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c88032368.cost)
e1:SetTarget(c88032368.target)
e1:SetOperation(c88032368.operation)
c:RegisterEffect(e1)
end
function c88032368.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleaseable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c88032368.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:IsPosition(POS_FACEUP_ATTACK) end
if chk==0 then return Duel.IsExistingTarget(Card.IsPosition,tp,LOCATION_MZONE,0,1,e:GetHandler(),POS_FACEUP_ATTACK) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUPATTACK)
Duel.SelectTarget(tp,Card.IsPosition,tp,LOCATION_MZONE,0,1,1,nil)
end
function c88032368.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsPosition(POS_FACEUP_ATTACK) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1500)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
......@@ -91,7 +91,7 @@ function c98777036.cttar(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c98777036.ctop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and not Duel.GetControl(tc,tp) then
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and not Duel.GetControl(tc,tp) then
if not tc:IsImmuneToEffect(e) and tc:IsAbleToChangeControler() then
Duel.Destroy(tc,REASON_EFFECT)
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