Commit d56081f0 authored by argon.sun's avatar argon.sun

fix

parent 2c40622a
......@@ -162,6 +162,7 @@ public:
#define EFFECT_FLAG_CHAIN_UNIQUE 0x8000000 //
#define EFFECT_FLAG_NAGA 0x10000000 //
#define EFFECT_FLAG_COF 0x20000000 //
#define EFFECT_FLAG_CVAL_CHECK 0x40000000 //
//========== Codes ==========
#define EFFECT_IMMUNE_EFFECT 1 //
#define EFFECT_DISABLE 2 //
......
......@@ -2791,8 +2791,10 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
}
}
if(detach.size()) {
for(auto iter = detach.begin(); iter != detach.end(); ++iter)
raise_single_event(*iter, 0, EVENT_DETACH_MATERIAL, reason_effect, reason, reason_player, 0, 0);
for(auto iter = detach.begin(); iter != detach.end(); ++iter) {
if((*iter)->current.location & LOCATION_MZONE)
raise_single_event(*iter, 0, EVENT_DETACH_MATERIAL, reason_effect, reason, reason_player, 0, 0);
}
}
adjust_instant();
process_single_event();
......
......@@ -1822,6 +1822,9 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
core.tpchain.push_back(*clit);
else
core.ntpchain.push_back(*clit);
if(clit->triggering_effect->flag & EFFECT_FLAG_CVAL_CHECK) {
clit->triggering_effect->get_value();
}
}
core.new_ochain_s.pop_front();
core.units.begin()->step = 4;
......
......@@ -5,16 +5,20 @@ function c14507213.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c14507213.condition)
e1:SetCost(c14507213.cost)
e1:SetTarget(c14507213.target)
e1:SetOperation(c14507213.activate)
c:RegisterEffect(e1)
end
function c14507213.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp or Duel.GetCurrentPhase()<PHASE_BATTLE
end
function c14507213.filter(c)
return c:IsFaceup() and c:IsCanBeSynchroMaterial()
end
function c14507213.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCurrentPhase()~=PHASE_MAIN2 end
if chk==0 then return true end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
......
......@@ -17,6 +17,7 @@ function c23232295.initial_effect(c)
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_DETACH_MATERIAL)
e2:SetTarget(c23232295.atktg)
e2:SetOperation(c23232295.atkop)
c:RegisterEffect(e2)
end
......@@ -30,6 +31,9 @@ function c23232295.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
return true
else return false end
end
function c23232295.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) end
end
function c23232295.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
......
......@@ -10,14 +10,17 @@ function c23309606.initial_effect(c)
e1:SetOperation(c23309606.otop)
e1:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(c23309606.val)
local e2=e1:Clone()
e2:SetCode(EFFECT_LIMIT_SET_PROC)
c:RegisterEffect(e2)
--atk
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(c23309606.val)
c:RegisterEffect(e3)
end
function c23309606.otcon(e,c)
if c==nil then return true end
......
--地獄からの使い
function c42685062.initial_effect(c)
--summon
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(42685062,0))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCondition(c42685062.sumcon)
e1:SetOperation(c42685062.sumop)
e1:SetValue(SUMMON_TYPE_ADVANCE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(42685062,0))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetCondition(c42685062.sumcon)
e2:SetOperation(c42685062.sumop)
e2:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e2)
end
function c42685062.sumcon(e,c)
if c==nil then return true end
......
......@@ -2,6 +2,7 @@
function c46448938.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(c46448938.cost)
......@@ -29,11 +30,10 @@ function c46448938.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(46448938,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1)
e3:SetTarget(c46448938.efftg)
e3:SetCondition(c46448938.effcon)
e3:SetOperation(c46448938.effop)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
......@@ -52,9 +52,8 @@ function c46448938.regop2(e,tp,eg,ep,ev,re,r,rp)
if ct==0 then ct=1 end
e:GetLabelObject():SetLabel(ct-1)
end
function c46448938.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetLabel()>0 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
function c46448938.effcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabel()>0
end
function c46448938.sfilter(c)
return c:IsSetCard(0x106e) and c:GetCode()~=46448938 and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
......@@ -63,6 +62,7 @@ function c46448938.spfilter(c,lv,e,tp)
return c:IsLevelBelow(lv) and c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c46448938.effop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,46448938)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c46448938.sfilter,tp,LOCATION_DECK,0,1,e:GetLabel(),nil)
if g:GetCount()>0 then
......
......@@ -16,12 +16,13 @@ function c47754278.initial_effect(c)
e2:SetDescription(aux.Stringid(47754278,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CVAL_CHECK)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c47754278.spcon)
e2:SetCost(c47754278.spcost)
e2:SetTarget(c47754278.sptg)
e2:SetOperation(c47754278.spop)
e2:SetValue(c47754278.valcheck)
c:RegisterEffect(e2)
end
function c47754278.descon(e,tp,eg,ep,ev,re,r,rp)
......@@ -38,7 +39,14 @@ function c47754278.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY) and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c47754278.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,nil) end
if chk==0 then
if Duel.GetFlagEffect(tp,47754278)==0 then
Duel.RegisterFlagEffect(tp,47754278,RESET_CHAIN,0,1)
c47754278[0]=Duel.GetReleaseGroup():GetCount()
c47754278[1]=0
end
return c47754278[0]-c47754278[1]>=1
end
local g=Duel.SelectReleaseGroup(tp,nil,1,1,nil)
Duel.Release(g,REASON_COST)
end
......@@ -52,3 +60,6 @@ function c47754278.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function c47754278.valcheck(e)
c47754278[1]=c47754278[1]+1
end
......@@ -4,13 +4,14 @@ function c71341529.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(71341529,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CVAL_CHECK)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c71341529.spcon)
e1:SetCost(c71341529.spcost)
e1:SetTarget(c71341529.sptg)
e1:SetOperation(c71341529.spop)
e1:SetValue(c71341529.valcheck)
c:RegisterEffect(e1)
end
function c71341529.spcon(e,tp,eg,ep,ev,re,r,rp)
......@@ -18,7 +19,14 @@ function c71341529.spcon(e,tp,eg,ep,ev,re,r,rp)
return c:IsReason(REASON_DESTROY) and bit.band(c:GetPreviousLocation(),LOCATION_ONFIELD)~=0
end
function c71341529.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,2,e:GetHandler()) end
if chk==0 then
if Duel.GetFlagEffect(tp,71341529)==0 then
Duel.RegisterFlagEffect(tp,71341529,RESET_CHAIN,0,1)
c71341529[0]=Duel.GetMatchingGroupCount(Card.IsDiscardable,tp,LOCATION_HAND,0,e:GetHandler())
c71341529[1]=0
end
return c71341529[0]-c71341529[1]>=2
end
Duel.DiscardHand(tp,Card.IsDiscardable,2,2,REASON_COST+REASON_DISCARD)
end
function c71341529.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -31,3 +39,6 @@ function c71341529.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function c71341529.valcheck(e)
c71341529[1]=c71341529[1]+2
end
......@@ -21,7 +21,7 @@ function c85909450.initial_effect(c)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_IGNORE_RANGE)
e3:SetValue(c85909450.tgvalue)
c:RegisterEffect(e3)
--remove material
......
......@@ -28,12 +28,13 @@ function c96381979.initial_effect(c)
e3:SetDescription(aux.Stringid(96381979,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CHAIN_UNIQUE)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CVAL_CHECK)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c96381979.spcon)
e3:SetCost(c96381979.spcost)
e3:SetTarget(c96381979.sptg)
e3:SetOperation(c96381979.spop)
e3:SetValue(c96381979.valcheck)
c:RegisterEffect(e3)
end
function c96381979.setcon(e,tp,eg,ep,ev,re,r,rp)
......@@ -89,7 +90,14 @@ function c96381979.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x7c) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGraveAsCost()
end
function c96381979.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c96381979.cfilter,tp,LOCATION_ONFIELD,0,3,nil) end
if chk==0 then
if Duel.GetFlagEffect(tp,96381979)==0 then
Duel.RegisterFlagEffect(tp,96381979,RESET_CHAIN,0,1)
c96381979[0]=Duel.GetMatchingGroupCount(c96381979.cfilter,tp,LOCATION_ONFIELD,0,nil)
c96381979[1]=0
end
return c96381979[0]-c96381979[1]>=3
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c96381979.cfilter,tp,LOCATION_ONFIELD,0,3,3,nil)
Duel.SendtoGrave(g,REASON_COST)
......@@ -124,3 +132,6 @@ function c96381979.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummonComplete()
end
end
function c96381979.valcheck(e)
c96381979[1]=c96381979[1]+3
end
......@@ -242,6 +242,7 @@ EFFECT_FLAG_CLIENT_HINT =0x4000000 --
EFFECT_FLAG_CHAIN_UNIQUE =0x8000000 --
EFFECT_FLAG_NAGA =0x10000000 --
EFFECT_FLAG_COF =0x20000000 --
EFFECT_FLAG_CVAL_CHECK =0x40000000 --
--========== Codes ==========
EFFECT_IMMUNE_EFFECT =1 --
EFFECT_DISABLE =2 --
......
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