Commit e963a748 authored by Fluorohydride's avatar Fluorohydride

Merge pull request #569 from VanillaSalt/patch70

fix
parents 442c5bc6 ac4db571
...@@ -731,7 +731,7 @@ void field::remove_oath_effect(effect* reason_effect) { ...@@ -731,7 +731,7 @@ void field::remove_oath_effect(effect* reason_effect) {
} }
void field::reset_effect(uint32 id, uint32 reset_type) { void field::reset_effect(uint32 id, uint32 reset_type) {
int32 result; int32 result;
for (auto it = effects.indexer.begin(); it != effects.indexer.end(); ++it) { for (auto it = effects.indexer.begin(); it != effects.indexer.end();) {
auto rm = it++; auto rm = it++;
auto peffect = rm->first; auto peffect = rm->first;
auto pit = rm->second; auto pit = rm->second;
......
...@@ -125,7 +125,8 @@ int32 scriptlib::duel_reset_flag_effect(lua_State *L) { ...@@ -125,7 +125,8 @@ int32 scriptlib::duel_reset_flag_effect(lua_State *L) {
effect* peffect; effect* peffect;
pr = pduel->game_field->effects.aura_effect.equal_range(code); pr = pduel->game_field->effects.aura_effect.equal_range(code);
for(; pr.first != pr.second; ) { for(; pr.first != pr.second; ) {
peffect = pr.first->second; auto rm = pr.first++;
peffect = rm->second;
if(peffect->code == code) if(peffect->code == code)
pduel->game_field->remove_effect(peffect); pduel->game_field->remove_effect(peffect);
} }
......
...@@ -1773,7 +1773,8 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) { ...@@ -1773,7 +1773,8 @@ int32 field::process_point_event(int16 step, int32 special, int32 skip_new) {
&& ((peffect->code == EVENT_FLIP) || (clit->triggering_location & 0x3) && ((peffect->code == EVENT_FLIP) || (clit->triggering_location & 0x3)
|| !(peffect->handler->current.location & 0x3) || peffect->handler->is_status(STATUS_IS_PUBLIC))) { || !(peffect->handler->current.location & 0x3) || peffect->handler->is_status(STATUS_IS_PUBLIC))) {
if(!(peffect->flag & EFFECT_FLAG_FIELD_ONLY) && clit->triggering_location == LOCATION_HAND if(!(peffect->flag & EFFECT_FLAG_FIELD_ONLY) && clit->triggering_location == LOCATION_HAND
&& (((peffect->type & EFFECT_TYPE_SINGLE) && !(peffect->flag & EFFECT_FLAG_SINGLE_RANGE)) || (peffect->range & LOCATION_HAND))) { && (((peffect->type & EFFECT_TYPE_SINGLE) && !(peffect->flag & EFFECT_FLAG_SINGLE_RANGE) && peffect->handler->is_has_relation(peffect))
|| (peffect->range & LOCATION_HAND))) {
core.new_ochain_h.push_back(*clit); core.new_ochain_h.push_back(*clit);
act = false; act = false;
} else if((peffect->flag & EFFECT_FLAG_FIELD_ONLY) || !(peffect->type & EFFECT_TYPE_FIELD) || (clit->triggering_location & peffect->range)) { } else if((peffect->flag & EFFECT_FLAG_FIELD_ONLY) || !(peffect->type & EFFECT_TYPE_FIELD) || (clit->triggering_location & peffect->range)) {
...@@ -2664,6 +2665,7 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2664,6 +2665,7 @@ int32 field::process_battle_command(uint16 step) {
core.units.begin()->step = 2; core.units.begin()->step = 2;
core.attacker = core.attackable_cards[sel]; core.attacker = core.attackable_cards[sel];
core.attacker->set_status(STATUS_ATTACK_CANCELED, FALSE); core.attacker->set_status(STATUS_ATTACK_CANCELED, FALSE);
core.pre_field[0] = core.attacker->fieldid_r;
core.phase_action = TRUE; core.phase_action = TRUE;
effect_set eset; effect_set eset;
filter_player_effect(infos.turn_player, EFFECT_ATTACK_COST, &eset, FALSE); filter_player_effect(infos.turn_player, EFFECT_ATTACK_COST, &eset, FALSE);
...@@ -2701,6 +2703,10 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2701,6 +2703,10 @@ int32 field::process_battle_command(uint16 step) {
} }
case 3: { case 3: {
//Filter Targers //Filter Targers
if(core.attacker->current.location != LOCATION_MZONE || core.attacker->fieldid_r != core.pre_field[0]) {
core.units.begin()->step = -1;
return FALSE;
}
core.select_cards.clear(); core.select_cards.clear();
core.units.begin()->arg1 = FALSE; core.units.begin()->arg1 = FALSE;
if(core.chain_attack && core.chain_attack_target) { if(core.chain_attack && core.chain_attack_target) {
...@@ -3880,21 +3886,6 @@ int32 field::process_turn(uint16 step, uint8 turn_player) { ...@@ -3880,21 +3886,6 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
core.new_ochain.clear(); core.new_ochain.clear();
core.quick_f_chain.clear(); core.quick_f_chain.clear();
core.delayed_quick_tmp.clear(); core.delayed_quick_tmp.clear();
effect* peffect;
if(peffect = is_player_affected_by_effect(infos.turn_player, EFFECT_SKIP_BP)) {
if(is_player_affected_by_effect(infos.turn_player, EFFECT_BP_TWICE)) {
core.units.begin()->arg2 = 1;
core.units.begin()->step = 8;
} else
core.units.begin()->step = 14;
if(!peffect->value)
add_process(PROCESSOR_PHASE_EVENT, 0, 0, 0, PHASE_BATTLE, 0);
else {
reset_phase(PHASE_BATTLE);
adjust_all();
}
return FALSE;
}
add_process(PROCESSOR_BATTLE_COMMAND, 0, 0, 0, 0, 0); add_process(PROCESSOR_BATTLE_COMMAND, 0, 0, 0, 0, 0);
return FALSE; return FALSE;
} }
......
...@@ -26,7 +26,7 @@ function c12275533.initial_effect(c) ...@@ -26,7 +26,7 @@ function c12275533.initial_effect(c)
local ge3=ge1:Clone() local ge3=ge1:Clone()
ge3:SetCode(EVENT_FLIP_SUMMON_SUCCESS) ge3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
Duel.RegisterEffect(ge3,0) Duel.RegisterEffect(ge3,0)
end end
end end
function c12275533.checkop(e,tp,eg,ep,ev,re,r,rp) function c12275533.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst() local tc=eg:GetFirst()
...@@ -39,7 +39,7 @@ function c12275533.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -39,7 +39,7 @@ function c12275533.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(1-tp,12275533)>=3 return Duel.GetFlagEffect(1-tp,12275533)>=3
end end
function c12275533.target(e,tp,eg,ep,ev,re,r,rp,chk) function c12275533.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end end
......
...@@ -36,6 +36,7 @@ end ...@@ -36,6 +36,7 @@ end
function c14235211.eqop(e,tp,eg,ep,ev,re,r,rp) function c14235211.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
if c:IsLocation(LOCATION_MZONE) and c:IsFacedown() then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) then if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT) Duel.SendtoGrave(c,REASON_EFFECT)
......
...@@ -41,7 +41,7 @@ function c18865703.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -41,7 +41,7 @@ function c18865703.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function c18865703.eqop(e,tp,eg,ep,ev,re,r,rp) function c18865703.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not c:CheckUniqueOnField(tp) then if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not c:CheckUniqueOnField(tp) then
Duel.SendtoGrave(c,REASON_EFFECT) Duel.SendtoGrave(c,REASON_EFFECT)
......
...@@ -19,7 +19,7 @@ function c22628574.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -19,7 +19,7 @@ function c22628574.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectMatchingCard(tp,c22628574.cfilter,tp,LOCATION_HAND,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c22628574.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST) Duel.SendtoGrave(g,REASON_COST)
end end
function c22628574.filter(c,e,tp,eg,ep,ev,re,r,rp) function c22628574.filter(c)
return c:GetType()==0x4 and not c:IsCode(22628574) and c:CheckActivateEffect(false,true,false)~=nil return c:GetType()==0x4 and not c:IsCode(22628574) and c:CheckActivateEffect(false,true,false)~=nil
end end
function c22628574.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c22628574.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
...@@ -16,10 +16,10 @@ function c24096228.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -16,10 +16,10 @@ function c24096228.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c24096228.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end if chk==0 then return Duel.IsExistingMatchingCard(c24096228.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,c24096228.cfilter,1,1,REASON_COST+REASON_DISCARD) Duel.DiscardHand(tp,c24096228.cfilter,1,1,REASON_COST+REASON_DISCARD)
end end
function c24096228.filter1(c,e,tp,eg,ep,ev,re,r,rp) function c24096228.filter1(c)
return c:IsType(TYPE_SPELL) and c:CheckActivateEffect(false,false,false)~=nil return c:IsType(TYPE_SPELL) and c:CheckActivateEffect(false,false,false)~=nil
end end
function c24096228.filter2(c,e,tp,eg,ep,ev,re,r,rp) function c24096228.filter2(c)
return c:IsType(TYPE_SPELL) and not c:IsType(TYPE_EQUIP+TYPE_CONTINUOUS) and c:CheckActivateEffect(false,false,false)~=nil return c:IsType(TYPE_SPELL) and not c:IsType(TYPE_EQUIP+TYPE_CONTINUOUS) and c:CheckActivateEffect(false,false,false)~=nil
end end
function c24096228.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c24096228.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
--E·HERO フレイム·ウィングマン --E·HERO シャイニング·フレア·ウィングマン
function c25366484.initial_effect(c) function c25366484.initial_effect(c)
--fusion material --fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
...@@ -40,8 +40,8 @@ function c25366484.damcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -40,8 +40,8 @@ function c25366484.damcon(e,tp,eg,ep,ev,re,r,rp)
end end
function c25366484.damtg(e,tp,eg,ep,ev,re,r,rp,chk) function c25366484.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local c=e:GetHandler() local bc=e:GetHandler():GetBattleTarget()
local bc=c:GetBattleTarget() Duel.SetTargetCard(bc)
local dam=bc:GetAttack() local dam=bc:GetAttack()
if dam<0 then dam=0 end if dam<0 then dam=0 end
Duel.SetTargetPlayer(1-tp) Duel.SetTargetPlayer(1-tp)
...@@ -49,8 +49,13 @@ function c25366484.damtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -49,8 +49,13 @@ function c25366484.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end end
function c25366484.damop(e,tp,eg,ep,ev,re,r,rp) function c25366484.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local tc=Duel.GetFirstTarget()
Duel.Damage(p,d,REASON_EFFECT) if tc:IsRelateToEffect(e) then
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local dam=tc:GetAttack()
if dam<0 then dam=0 end
Duel.Damage(p,dam,REASON_EFFECT)
end
end end
function c25366484.atkup(e,c) function c25366484.atkup(e,c)
return Duel.GetMatchingGroupCount(Card.IsSetCard,c:GetControler(),LOCATION_GRAVE,0,nil,0x3008)*300 return Duel.GetMatchingGroupCount(Card.IsSetCard,c:GetControler(),LOCATION_GRAVE,0,nil,0x3008)*300
......
...@@ -7,12 +7,16 @@ function c25435080.initial_effect(c) ...@@ -7,12 +7,16 @@ function c25435080.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP) e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCondition(c25435080.condition)
e1:SetCost(c25435080.cost) e1:SetCost(c25435080.cost)
e1:SetTarget(c25435080.target) e1:SetTarget(c25435080.target)
e1:SetOperation(c25435080.activate) e1:SetOperation(c25435080.activate)
e1:SetLabel(0) e1:SetLabel(0)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c25435080.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c25435080.cfilter(c,tp) function c25435080.cfilter(c,tp)
return c:IsSetCard(0x33) and Duel.IsExistingTarget(c25435080.tfilter,tp,LOCATION_MZONE,0,1,c) return c:IsSetCard(0x33) and Duel.IsExistingTarget(c25435080.tfilter,tp,LOCATION_MZONE,0,1,c)
end end
...@@ -28,10 +32,9 @@ function c25435080.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -28,10 +32,9 @@ function c25435080.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then if chk==0 then
if e:GetLabel()~=1 then return false end if e:GetLabel()~=1 then return false end
e:SetLabel(0) e:SetLabel(0)
return Duel.IsExistingMatchingCard(c25435080.cfilter,tp,LOCATION_MZONE,0,1,nil,tp) return Duel.CheckReleaseGroup(tp,c25435080.cfilter,1,nil,tp)
end end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) local rg=Duel.SelectReleaseGroup(tp,c25435080.cfilter,1,1,nil,tp)
local rg=Duel.SelectMatchingCard(tp,c25435080.cfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
e:SetLabel(rg:GetFirst():GetAttack()) e:SetLabel(rg:GetFirst():GetAttack())
Duel.Release(rg,REASON_COST) Duel.Release(rg,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
......
...@@ -62,16 +62,16 @@ function c27383110.thcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -62,16 +62,16 @@ function c27383110.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsAbleToRemove() end if chk==0 then return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsAbleToRemove() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST) Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end end
function c27383110.thfilter(c) function c27383110.thfilter(c,e,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsAbleToHand() return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp) and c:IsAbleToHand() and c:IsCanBeEffectTarget(e)
end end
function c27383110.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c27383110.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tc=e:GetLabelObject():GetLabelObject() local tc=e:GetLabelObject():GetLabelObject()
local mat=tc:GetMaterial() local mat=tc:GetMaterial()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and mat:IsContains(chkc) end if chkc then return mat:IsContains(chkc) and c27383110.thfilter(chkc,e,tp) end
if chk==0 then return mat:IsExists(c27383110.thfilter,1,nil) end if chk==0 then return mat:IsExists(c27383110.thfilter,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=mat:FilterSelect(tp,c27383110.thfilter,1,1,nil) local g=mat:FilterSelect(tp,c27383110.thfilter,1,1,nil,e,tp)
Duel.SetTargetCard(g) Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end end
......
...@@ -15,7 +15,7 @@ function c28002611.filter(c) ...@@ -15,7 +15,7 @@ function c28002611.filter(c)
end end
function c28002611.tg(e,tp,eg,ep,ev,re,r,rp,chk) function c28002611.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c28002611.filter,tp,LOCATION_HAND,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c28002611.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND)
end end
function c28002611.op(e,tp,eg,ep,ev,re,r,rp) function c28002611.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
--ˮ[`ӥ --水精鱗-オーケアビス
function c28577986.initial_effect(c) function c28577986.initial_effect(c)
--spsummon --spsummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -18,12 +18,12 @@ function c28577986.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -18,12 +18,12 @@ function c28577986.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c28577986.cfilter(c,e,tp) function c28577986.cfilter(c,e,tp)
local lv=c:GetLevel() local lv=c:GetLevel()
return lv>0 and c:IsSetCard(0x74) return lv>0 and c:IsFaceup() and c:IsSetCard(0x74)
and Duel.IsExistingMatchingCard(c28577986.spfilter,tp,LOCATION_DECK,0,1,nil,lv,e,tp) and Duel.IsExistingMatchingCard(c28577986.spfilter,tp,LOCATION_DECK,0,1,nil,lv,e,tp)
end end
function c28577986.spfilter(c,lv,e,tp) function c28577986.spfilter(c,lv,e,tp)
if lv>4 then lv=4 end if lv>4 then lv=4 end
return c:IsLevelBelow(lv) and c:IsSetCard(0x74) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) return c:IsLevelBelow(lv) and c:IsSetCard(0x74) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c28577986.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c28577986.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c28577986.cfilter(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c28577986.cfilter(chkc,e,tp) end
......
...@@ -51,7 +51,7 @@ function c29353756.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -51,7 +51,7 @@ function c29353756.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function c29353756.eqop(e,tp,eg,ep,ev,re,r,rp) function c29353756.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not c:CheckUniqueOnField(tp) then if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not c:CheckUniqueOnField(tp) then
Duel.SendtoGrave(c,REASON_EFFECT) Duel.SendtoGrave(c,REASON_EFFECT)
......
...@@ -18,23 +18,37 @@ function c3146695.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -18,23 +18,37 @@ function c3146695.regop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c3146695.cfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(c3146695.cfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst() local tc=g:GetFirst()
while tc do while tc do
local e1=Effect.CreateEffect(e:GetHandler()) tc:RegisterFlagEffect(3146695,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
e1:SetDescription(aux.Stringid(3146695,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLED)
e1:SetTarget(c3146695.target)
e1:SetOperation(c3146695.operation)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext() tc=g:GetNext()
end end
g:KeepAlive()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(3146695,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLED)
e1:SetTarget(c3146695.target)
e1:SetOperation(c3146695.operation)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(g)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetLabelObject(g)
e2:SetOperation(c3146695.reset)
Duel.RegisterEffect(e2,tp)
end
function c3146695.filter(c,g)
return c:GetFlagEffect(3146695)>0 and g:IsContains(c)
end end
function c3146695.target(e,tp,eg,ep,ev,re,r,rp,chk) function c3146695.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetAttackTarget()~=nil end
local a=Duel.GetAttacker() local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget() local d=Duel.GetAttackTarget()
local g=Group.FromCards(a,d) local g=Group.FromCards(a,d)
if chk==0 then return d and g:IsExists(c3146695.filter,1,nil,e:GetLabelObject()) end
local rg=g:Filter(Card.IsRelateToBattle,nil) local rg=g:Filter(Card.IsRelateToBattle,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,rg,rg:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,rg,rg:GetCount(),0,0)
end end
...@@ -45,3 +59,6 @@ function c3146695.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -45,3 +59,6 @@ function c3146695.operation(e,tp,eg,ep,ev,re,r,rp)
local rg=g:Filter(Card.IsRelateToBattle,nil) local rg=g:Filter(Card.IsRelateToBattle,nil)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT) Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
end end
function c3146695.reset(e,tp,eg,ep,ev,re,r,rp)
e:GetLabelObject():DeleteGroup()
end
...@@ -22,7 +22,7 @@ function c33302407.discon(e,tp,eg,ep,ev,re,r,rp) ...@@ -22,7 +22,7 @@ function c33302407.discon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and not Duel.CheckAttackActivity(tp) return tp==Duel.GetTurnPlayer() and not Duel.CheckAttackActivity(tp)
end end
function c33302407.filter(c) function c33302407.filter(c)
return c:IsSetCard(0x25) and c:IsType(TYPE_MONSTER) return c:IsFaceup() and c:IsSetCard(0x25)
end end
function c33302407.distg(e,tp,eg,ep,ev,re,r,rp,chk) function c33302407.distg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(c33302407.filter,tp,LOCATION_MZONE,0,nil) local ct=Duel.GetMatchingGroupCount(c33302407.filter,tp,LOCATION_MZONE,0,nil)
......
...@@ -61,7 +61,7 @@ function c33725002.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -61,7 +61,7 @@ function c33725002.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function c33725002.eqop(e,tp,eg,ep,ev,re,r,rp) function c33725002.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) then if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT) Duel.SendtoGrave(c,REASON_EFFECT)
......
...@@ -25,6 +25,7 @@ function c34109611.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -25,6 +25,7 @@ function c34109611.operation(e,tp,eg,ep,ev,re,r,rp)
while tc do while tc do
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000) e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(600) e1:SetValue(600)
......
...@@ -32,8 +32,8 @@ function c35809262.damcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -32,8 +32,8 @@ function c35809262.damcon(e,tp,eg,ep,ev,re,r,rp)
end end
function c35809262.damtg(e,tp,eg,ep,ev,re,r,rp,chk) function c35809262.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local c=e:GetHandler() local bc=e:GetHandler():GetBattleTarget()
local bc=c:GetBattleTarget() Duel.SetTargetCard(bc)
local dam=bc:GetAttack() local dam=bc:GetAttack()
if dam<0 then dam=0 end if dam<0 then dam=0 end
Duel.SetTargetPlayer(1-tp) Duel.SetTargetPlayer(1-tp)
...@@ -41,6 +41,11 @@ function c35809262.damtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -41,6 +41,11 @@ function c35809262.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam) Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,dam)
end end
function c35809262.damop(e,tp,eg,ep,ev,re,r,rp) function c35809262.damop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local tc=Duel.GetFirstTarget()
Duel.Damage(p,d,REASON_EFFECT) if tc:IsRelateToEffect(e) then
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local dam=tc:GetAttack()
if dam<0 then dam=0 end
Duel.Damage(p,dam,REASON_EFFECT)
end
end end
...@@ -18,10 +18,10 @@ function c37195861.con(e,tp,eg,ep,ev,re,r,rp) ...@@ -18,10 +18,10 @@ function c37195861.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c37195861.filter(c) function c37195861.filter(c)
return c:IsSetCard(0x8) and c:IsAbleToHand() return c:IsSetCard(0x8) and c:IsAbleToHand() and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
end end
function c37195861.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c37195861.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(0x14) and chkc:GetControler()==tp and c37195861.filter(chkc) end if chkc then return chkc:IsLocation(0x14) and chkc:IsControler(tp) and c37195861.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c37195861.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingTarget(c37195861.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c37195861.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectTarget(tp,c37195861.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil)
......
...@@ -4,19 +4,18 @@ function c42671151.initial_effect(c) ...@@ -4,19 +4,18 @@ function c42671151.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RECOVER+CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_RECOVER+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_DAMAGE) e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(c42671151.condition) e1:SetCondition(c42671151.condition)
e1:SetTarget(c42671151.target) e1:SetTarget(c42671151.target)
e1:SetOperation(c42671151.activate) e1:SetOperation(c42671151.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c42671151.condition(e,tp,eg,ep,ev,re,r,rp) function c42671151.condition(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0 and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 return ep==tp and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end end
function c42671151.target(e,tp,eg,ep,ev,re,r,rp,chk) function c42671151.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,42671152,0,0x4011,0,0,1,RACE_FIEND,ATTRIBUTE_DARK) end and Duel.IsPlayerCanSpecialSummonMonster(tp,42671152,0,0x4011,ev,ev,1,RACE_FIEND,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ev) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ev)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
...@@ -24,9 +23,9 @@ end ...@@ -24,9 +23,9 @@ end
function c42671151.activate(e,tp,eg,ep,ev,re,r,rp) function c42671151.activate(e,tp,eg,ep,ev,re,r,rp)
local rec=Duel.Recover(tp,ev,REASON_EFFECT) local rec=Duel.Recover(tp,ev,REASON_EFFECT)
if rec~=ev or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 if rec~=ev or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,42671152,0,0x4011,0,0,1,RACE_FIEND,ATTRIBUTE_DARK) then return end or not Duel.IsPlayerCanSpecialSummonMonster(tp,42671152,0,0x4011,ev,ev,1,RACE_FIEND,ATTRIBUTE_DARK) then return end
local token=Duel.CreateToken(tp,42671152) local token=Duel.CreateToken(tp,42671152)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK) e1:SetCode(EFFECT_SET_ATTACK)
...@@ -36,4 +35,5 @@ function c42671151.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -36,4 +35,5 @@ function c42671151.activate(e,tp,eg,ep,ev,re,r,rp)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENCE) e2:SetCode(EFFECT_SET_DEFENCE)
token:RegisterEffect(e2,true) token:RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
end end
...@@ -19,7 +19,7 @@ function c43841694.filter(c,e,tp) ...@@ -19,7 +19,7 @@ function c43841694.filter(c,e,tp)
return c:IsType(TYPE_XYZ) and c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsType(TYPE_XYZ) and c:IsRace(RACE_SPELLCASTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c43841694.filter2(c) function c43841694.filter2(c)
return c:IsSetCard(0x106e) and c:IsType(TYPE_SPELL) return c:IsFaceup() and c:IsSetCard(0x106e) and c:IsType(TYPE_SPELL)
end end
function c43841694.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c43841694.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
......
...@@ -45,6 +45,7 @@ end ...@@ -45,6 +45,7 @@ end
function c45082499.eqop(e,tp,eg,ep,ev,re,r,rp) function c45082499.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
if c:IsLocation(LOCATION_MZONE) and c:IsFacedown() then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not c:CheckUniqueOnField(tp) then if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not c:CheckUniqueOnField(tp) then
Duel.SendtoGrave(c,REASON_EFFECT) Duel.SendtoGrave(c,REASON_EFFECT)
......
...@@ -10,8 +10,7 @@ function c46710683.initial_effect(c) ...@@ -10,8 +10,7 @@ function c46710683.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c46710683.condition(e,tp,eg,ep,ev,re,r,rp) function c46710683.condition(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_DESTROY)>0 return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and e:GetHandler():IsReason(REASON_DESTROY)
and bit.band(e:GetHandler():GetPreviousLocation(),LOCATION_ONFIELD)>0
end end
function c46710683.operation(e,tp,eg,ep,ev,re,r,rp) function c46710683.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
...@@ -22,11 +21,11 @@ function c46710683.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -22,11 +21,11 @@ function c46710683.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(c46710683.damval) e1:SetValue(c46710683.damval)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
c46710683.available=true Duel.RegisterFlagEffect(tp,46710683,RESET_PHASE+PHASE_END,0,1)
end end
c46710683.available=false
function c46710683.damval(e,re,val,r,rp,rc) function c46710683.damval(e,re,val,r,rp,rc)
if not c46710683.available or bit.band(r,REASON_BATTLE)==0 then return val end local tp=e:GetHandlerPlayer()
c46710683.available=false if Duel.GetFlagEffect(tp,46710683)==0 or bit.band(r,REASON_BATTLE)==0 then return val end
Duel.ResetFlagEffect(tp,46710683)
return 0 return 0
end end
...@@ -23,12 +23,14 @@ function c48928529.operation(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -23,12 +23,14 @@ function c48928529.operation(e,tp,eg,ep,ev,re,r,rp,chk)
while tc do while tc do
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,2) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,2)
e1:SetValue(1) e1:SetValue(1)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler()) local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_PIERCE) e2:SetCode(EFFECT_PIERCE)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,2) e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,2)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
......
...@@ -34,7 +34,7 @@ function c53670497.filter1(c) ...@@ -34,7 +34,7 @@ function c53670497.filter1(c)
return c:IsSetCard(0x69) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave() return c:IsSetCard(0x69) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end end
function c53670497.filter2(c) function c53670497.filter2(c)
return c:IsSetCard(0x69) and c:IsType(TYPE_MONSTER) return c:IsFaceup() and c:IsSetCard(0x69) and c:IsType(TYPE_MONSTER)
end end
function c53670497.target1(e,tp,eg,ep,ev,re,r,rp,chk) function c53670497.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -29,11 +29,17 @@ end ...@@ -29,11 +29,17 @@ end
function c53839837.spr(e,tp,eg,ep,ev,re,r,rp) function c53839837.spr(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if bit.band(r,0x41)~=0x41 or rp==tp or c:GetPreviousControler()~=tp then return end if bit.band(r,0x41)~=0x41 or rp==tp or c:GetPreviousControler()~=tp then return end
c:RegisterFlagEffect(53839837,RESET_EVENT+0x1fe0000,0,0) if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY then
e:SetLabel(Duel.GetTurnCount())
c:RegisterFlagEffect(53839837,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,2)
else
e:SetLabel(0)
c:RegisterFlagEffect(53839837,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1)
end
end end
function c53839837.spcon(e,tp,eg,ep,ev,re,r,rp) function c53839837.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:GetTurnID()~=Duel.GetTurnCount() and tp==Duel.GetTurnPlayer() and c:GetFlagEffect(53839837)>0 return e:GetLabelObject():GetLabel()~=Duel.GetTurnCount() and tp==Duel.GetTurnPlayer() and c:GetFlagEffect(53839837)>0
end end
function c53839837.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c53839837.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
...@@ -44,7 +50,7 @@ end ...@@ -44,7 +50,7 @@ end
function c53839837.spop(e,tp,eg,ep,ev,re,r,rp) function c53839837.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsRelateToEffect(e) then if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,1,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end end
end end
function c53839837.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) function c53839837.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
......
...@@ -14,7 +14,7 @@ function c56511382.initial_effect(c) ...@@ -14,7 +14,7 @@ function c56511382.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c56511382.cfilter(c) function c56511382.cfilter(c)
return c:IsSetCard(0x2) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsAbleToGraveAsCost() return c:IsFaceup() and c:IsSetCard(0x2) and c:IsAttribute(ATTRIBUTE_FIRE) and c:IsAbleToGraveAsCost()
end end
function c56511382.descost(e,tp,eg,ep,ev,re,r,rp,chk) function c56511382.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c56511382.cfilter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c56511382.cfilter,tp,LOCATION_MZONE,0,1,nil) end
......
...@@ -72,7 +72,7 @@ function c60992364.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -72,7 +72,7 @@ function c60992364.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function c60992364.eqop(e,tp,eg,ep,ev,re,r,rp) function c60992364.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) then if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT) Duel.SendtoGrave(c,REASON_EFFECT)
......
...@@ -40,6 +40,7 @@ end ...@@ -40,6 +40,7 @@ end
function c6330307.eqop(e,tp,eg,ep,ev,re,r,rp) function c6330307.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
if c:IsLocation(LOCATION_MZONE) and c:IsFacedown() then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not c:CheckUniqueOnField(tp) then if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not c:CheckUniqueOnField(tp) then
Duel.SendtoGrave(c,REASON_EFFECT) Duel.SendtoGrave(c,REASON_EFFECT)
......
...@@ -27,7 +27,7 @@ function c70271583.initial_effect(c) ...@@ -27,7 +27,7 @@ function c70271583.initial_effect(c)
e4:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FIELD) e4:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE) e4:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e4:SetCode(EVENT_DAMAGE) e4:SetCode(EVENT_BATTLE_DAMAGE)
e4:SetCondition(c70271583.atkcon) e4:SetCondition(c70271583.atkcon)
e4:SetOperation(c70271583.atkop) e4:SetOperation(c70271583.atkop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
...@@ -49,7 +49,7 @@ function c70271583.posop(e,tp,eg,ep,ev,re,r,rp) ...@@ -49,7 +49,7 @@ function c70271583.posop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c70271583.atkcon(e,tp,eg,ep,ev,re,r,rp) function c70271583.atkcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and bit.band(r,REASON_BATTLE)~=0 and (e:GetHandler()==Duel.GetAttacker() or e:GetHandler()==Duel.GetAttackTarget()) return ep==tp and (e:GetHandler()==Duel.GetAttacker() or e:GetHandler()==Duel.GetAttackTarget())
end end
function c70271583.filter(c) function c70271583.filter(c)
return c:IsFaceup() and c:IsSetCard(0x11) return c:IsFaceup() and c:IsSetCard(0x11)
...@@ -61,6 +61,7 @@ function c70271583.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -61,6 +61,7 @@ function c70271583.atkop(e,tp,eg,ep,ev,re,r,rp)
while tc do while tc do
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(800) e1:SetValue(800)
......
--ダークロン --ダークロン
function c76202610.initial_effect(c) function c76202610.initial_effect(c)
--special summon --level,attribute
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(76202610,0)) e1:SetDescription(aux.Stringid(76202610,0))
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
...@@ -14,12 +14,14 @@ function c76202610.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -14,12 +14,14 @@ function c76202610.operation(e,tp,eg,ep,ev,re,r,rp)
while tc do while tc do
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_LEVEL) e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(1) e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler()) local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_CHANGE_ATTRIBUTE) e2:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e2:SetValue(ATTRIBUTE_DARK) e2:SetValue(ATTRIBUTE_DARK)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
......
...@@ -18,7 +18,7 @@ function c79766336.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -18,7 +18,7 @@ function c79766336.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000) Duel.PayLPCost(tp,1000)
end end
function c79766336.filter(c,e,tp,eg,ep,ev,re,r,rp) function c79766336.filter(c)
return c:GetType()==0x4 and not c:IsCode(79766336) and c:IsAbleToRemove() and c:CheckActivateEffect(false,true,false)~=nil return c:GetType()==0x4 and not c:IsCode(79766336) and c:IsAbleToRemove() and c:CheckActivateEffect(false,true,false)~=nil
end end
function c79766336.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c79766336.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
...@@ -42,6 +42,7 @@ end ...@@ -42,6 +42,7 @@ end
function c81471108.eqop(e,tp,eg,ep,ev,re,r,rp) function c81471108.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end if not c:IsRelateToEffect(e) then return end
if c:IsLocation(LOCATION_MZONE) and c:IsFacedown() then return end
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not c:CheckUniqueOnField(tp) then if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) or not c:CheckUniqueOnField(tp) then
Duel.SendtoGrave(c,REASON_EFFECT) Duel.SendtoGrave(c,REASON_EFFECT)
......
...@@ -14,7 +14,7 @@ function c83500096.initial_effect(c) ...@@ -14,7 +14,7 @@ function c83500096.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c83500096.cfilter(c) function c83500096.cfilter(c)
return c:IsSetCard(0x2) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToGraveAsCost() return c:IsFaceup() and c:IsSetCard(0x2) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsAbleToGraveAsCost()
end end
function c83500096.drcost(e,tp,eg,ep,ev,re,r,rp,chk) function c83500096.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c83500096.cfilter,tp,LOCATION_MZONE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c83500096.cfilter,tp,LOCATION_MZONE,0,1,nil) end
......
...@@ -53,7 +53,8 @@ function c88241506.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -53,7 +53,8 @@ function c88241506.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetHandler()) return eg:IsContains(e:GetHandler())
end end
function c88241506.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c88241506.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c88241506.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end end
function c88241506.spop(e,tp,eg,ep,ev,re,r,rp) function c88241506.spop(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -22,16 +22,16 @@ end ...@@ -22,16 +22,16 @@ end
function c88301833.thcon(e,tp,eg,ep,ev,re,r,rp) function c88301833.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetCount()==1 and eg:GetFirst():GetSummonType()==SUMMON_TYPE_RITUAL return eg:GetCount()==1 and eg:GetFirst():GetSummonType()==SUMMON_TYPE_RITUAL
end end
function c88301833.thfilter(c,tp) function c88301833.thfilter(c,e,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp) and c:IsAbleToHand() return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp) and c:IsAbleToHand() and c:IsCanBeEffectTarget(e)
end end
function c88301833.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c88301833.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tc=eg:GetFirst() local tc=eg:GetFirst()
local mat=tc:GetMaterial() local mat=tc:GetMaterial()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and mat:IsContains(chkc) end if chkc then return mat:IsContains(chkc) and c88301833.thfilter(chkc,e,tp) end
if chk==0 then return mat:IsExists(c88301833.thfilter,1,nil,tp) end if chk==0 then return mat:IsExists(c88301833.thfilter,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=mat:FilterSelect(tp,c88301833.thfilter,1,1,nil,tp) local g=mat:FilterSelect(tp,c88301833.thfilter,1,1,nil,e,tp)
Duel.SetTargetCard(g) Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end end
......
...@@ -28,6 +28,7 @@ function c89547299.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -28,6 +28,7 @@ function c89547299.atkop(e,tp,eg,ep,ev,re,r,rp)
while tc do while tc do
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500) e1:SetValue(500)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
......
...@@ -4,13 +4,13 @@ function c96148285.initial_effect(c) ...@@ -4,13 +4,13 @@ function c96148285.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c96148285.condition) e1:SetCondition(c96148285.condition)
e1:SetOperation(c96148285.activate) e1:SetOperation(c96148285.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c96148285.condition(e,tp,eg,ep,ev,re,r,rp) function c96148285.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp return eg:IsExists(Card.IsControler,1,nil,1-tp)
end end
function c96148285.filter(c,e,tp) function c96148285.filter(c,e,tp)
return c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
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