Commit de1200fa authored by VanillaSalt's avatar VanillaSalt Committed by sidschingis

fix

parent dee76ddc
......@@ -804,6 +804,8 @@ void card::enable_field_effect(int32 enabled) {
for (it = equip_effect.begin(); it != equip_effect.end(); ++it)
it->second->id = pduel->game_field->infos.field_id++;
}
if (get_status(STATUS_DISABLED))
reset(RESET_DISABLE, RESET_EVENT);
} else
set_status(STATUS_EFFECT_ENABLED, FALSE);
filter_immune_effect();
......
......@@ -3658,6 +3658,8 @@ int32 field::process_battle_command(uint16 step) {
return FALSE;
}
case 40: {
core.attacker = 0;
core.attack_target = 0;
returns.ivalue[0] = core.units.begin()->arg1;
returns.ivalue[1] = core.units.begin()->arg2;
return TRUE;
......
......@@ -3,8 +3,10 @@ function c30451366.initial_effect(c)
--fusion substitute
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(0x1e)
e1:SetCode(EFFECT_FUSION_SUBSTITUTE)
e1:SetCondition(c30451366.subcon)
c:RegisterEffect(e1)
end
function c30451366.subcon(e)
return e:GetHandler():IsLocation(LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE)
end
......@@ -69,8 +69,10 @@ function c30604579.disop(e,tp,eg,ep,ev,re,r,rp)
end
function c30604579.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local pos=c:GetPreviousPosition()
if c:IsReason(REASON_BATTLE) then pos=c:GetBattlePosition() end
if rp~=tp and c:GetPreviousControler()==tp and c:IsReason(REASON_DESTROY)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) then
and c:IsPreviousLocation(LOCATION_ONFIELD) and bit.band(pos,POS_FACEUP)~=0 then
c:RegisterFlagEffect(30604579,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
......
......@@ -39,8 +39,7 @@ function c34029630.initial_effect(c)
end
function c34029630.ctpermit(e)
local c=e:GetHandler()
if not c:IsLocation(LOCATION_SZONE) then return false end
return not c:IsStatus(STATUS_EFFECT_ENABLED) or not c:IsStatus(STATUS_DISABLED)
return c:IsLocation(LOCATION_SZONE) and not c:IsStatus(STATUS_DISABLED)
end
function c34029630.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c34029630.filter(chkc) end
......
......@@ -41,7 +41,7 @@ function c36378044.atktg1(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c36378044.atktg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(36378044)==0 end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,3)
e:GetHandler():RegisterFlagEffect(36378044,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
function c36378044.atkop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -14,6 +14,9 @@ function c40343749.initial_effect(c)
end
function c40343749.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsReason(REASON_BATTLE) then
return c:GetReasonPlayer()~=tp and bit.band(c:GetBattlePosition(),POS_FACEUP)~=0
end
return rp~=tp and c:IsReason(REASON_DESTROY) and c:IsPreviousPosition(POS_FACEUP)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:GetPreviousControler()==tp
end
......
......@@ -3,8 +3,10 @@ function c50259460.initial_effect(c)
--fusion substitute
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(0x1e)
e1:SetCode(EFFECT_FUSION_SUBSTITUTE)
e1:SetCondition(c50259460.subcon)
c:RegisterEffect(e1)
end
function c50259460.subcon(e)
return e:GetHandler():IsLocation(LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE)
end
......@@ -31,7 +31,7 @@ function c51452091.initial_effect(c)
c:RegisterEffect(e4)
end
function c51452091.distarget(e,c)
return c~=e:GetHandler() and c:IsType(TYPE_TRAP)
return c~=e:GetHandler() and c:IsType(TYPE_TRAP) and c:IsStatus(STATUS_ACTIVATED)
end
function c51452091.disop(e,tp,eg,ep,ev,re,r,rp)
local tl=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
......
......@@ -7,7 +7,7 @@ function c53244294.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(53244294,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(c53244294.atktg)
e1:SetOperation(c53244294.atkop)
......
......@@ -3,8 +3,10 @@ function c53493204.initial_effect(c)
--fusion substitute
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(0x1e)
e1:SetCode(EFFECT_FUSION_SUBSTITUTE)
e1:SetCondition(c53493204.subcon)
c:RegisterEffect(e1)
end
function c53493204.subcon(e)
return e:GetHandler():IsLocation(LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE)
end
......@@ -19,7 +19,7 @@ end
function c63689843.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
local gc=Duel.GetMatchingGroupCount(Card.IsCode,p,LOCATION_GRAVE,0,nil,63689843)
local gc=Duel.GetMatchingGroupCount(Card.IsCode,tp,LOCATION_GRAVE,0,nil,63689843)
if gc>0 then
Duel.Damage(p,300*gc,REASON_EFFECT)
end
......
......@@ -68,8 +68,10 @@ function c67098114.disop(e,tp,eg,ep,ev,re,r,rp)
end
function c67098114.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local pos=c:GetPreviousPosition()
if c:IsReason(REASON_BATTLE) then pos=c:GetBattlePosition() end
if rp~=tp and c:GetPreviousControler()==tp and c:IsReason(REASON_DESTROY)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) then
and c:IsPreviousLocation(LOCATION_ONFIELD) and bit.band(pos,POS_FACEUP)~=0 then
c:RegisterFlagEffect(67098114,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
......
......@@ -13,11 +13,13 @@ function c79109599.initial_effect(c)
--fusion substitute
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(0x1e)
e2:SetCode(EFFECT_FUSION_SUBSTITUTE)
e2:SetCondition(c79109599.subcon)
c:RegisterEffect(e2)
end
function c79109599.subcon(e)
return e:GetHandler():IsLocation(LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE)
end
function c79109599.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() and c:IsDiscardable() end
......@@ -26,7 +28,7 @@ end
function c79109599.filter(c)
return c:GetCode()==24094653 and c:IsAbleToHand()
end
function c79109599.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
function c79109599.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c79109599.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
......
......@@ -62,8 +62,10 @@ function c93483212.imfilter(e,re)
end
function c93483212.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local pos=c:GetPreviousPosition()
if c:IsReason(REASON_BATTLE) then pos=c:GetBattlePosition() end
if rp~=tp and c:GetPreviousControler()==tp and c:IsReason(REASON_DESTROY)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEUP) then
and c:IsPreviousLocation(LOCATION_ONFIELD) and bit.band(pos,POS_FACEUP)~=0 then
c:RegisterFlagEffect(93483212,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
......
--地雷蜘蛛
function c94773007.initial_effect(c)
--attack cost
--coin
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_ATTACK_COST)
e1:SetCost(aux.TRUE)
e1:SetDescription(aux.Stringid(94773007,0))
e1:SetCategory(CATEGORY_COIN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetTarget(c94773007.attg)
e1:SetOperation(c94773007.atop)
c:RegisterEffect(e1)
end
function c94773007.attg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COIN,nil,0,tp,1)
end
function c94773007.atop(e,tp,eg,ep,ev,re,r,rp)
local opt=Duel.SelectOption(tp,60,61)
local coin=Duel.TossCoin(tp,1)
......
......@@ -4,6 +4,8 @@ function c96012004.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c96012004.cointg)
e1:SetOperation(c96012004.coinop)
c:RegisterEffect(e1)
--coin
local e2=Effect.CreateEffect(c)
......@@ -15,15 +17,31 @@ function c96012004.initial_effect(c)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c96012004.coincon)
e2:SetOperation(c96012004.coinop)
e2:SetLabel(1)
c:RegisterEffect(e2)
end
function c96012004.coincon(e,tp,eg,ep,ev,re,r,rp)
local ex,eg,et,cp,ct=Duel.GetOperationInfo(ev,CATEGORY_COIN)
return ex and ct==1 and re:IsActiveType(TYPE_MONSTER)
if ex and ct==1 and re:IsActiveType(TYPE_MONSTER) then
e:SetLabelObject(re)
return true
else return false end
end
function c96012004.cointg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:SetLabel(0)
local cc=Duel.GetCurrentChain()
if cc==1 then return end
local te=Duel.GetChainInfo(cc-1,CHAININFO_TRIGGERING_EFFECT)
local ex,eg,et,cp,ct=Duel.GetOperationInfo(cc-1,CATEGORY_COIN)
if ex and ct==1 and te:IsActiveType(TYPE_MONSTER) then
e:SetLabel(1)
e:SetLabelObject(te)
end
end
function c96012004.coinop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if e:GetLabel()==0 or not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COIN)
local res=1-Duel.SelectOption(tp,60,61)
local e1=Effect.CreateEffect(c)
......@@ -34,7 +52,7 @@ function c96012004.coinop(e,tp,eg,ep,ev,re,r,rp)
e1:SetOperation(c96012004.drop)
e1:SetCountLimit(1)
e1:SetReset(RESET_CHAIN)
e1:SetLabelObject(re)
e1:SetLabelObject(e:GetLabelObject())
e1:SetLabel(res)
Duel.RegisterEffect(e1,tp)
end
......
......@@ -29,8 +29,7 @@ function c96235275.discon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c96235275.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(96235275)==0 end
e:GetHandler():RegisterFlagEffect(96235275,RESET_EVENT+0x1fe0000+RESET_PHASE+RESET_END,EFFECT_FLAG_OATH,1)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,2)
end
function c96235275.disop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -3,8 +3,10 @@ function c99426834.initial_effect(c)
--fusion substitute
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(0x1e)
e1:SetCode(EFFECT_FUSION_SUBSTITUTE)
e1:SetCondition(c99426834.subcon)
c:RegisterEffect(e1)
end
function c99426834.subcon(e)
return e:GetHandler():IsLocation(LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE)
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