Commit 476fed8b authored by argon's avatar argon

Merge branch 'master' of github.com:Fluorohydride/ygopro

parents 9448b29f d1574eae
......@@ -731,7 +731,7 @@ void field::remove_oath_effect(effect* reason_effect) {
}
void field::reset_effect(uint32 id, uint32 reset_type) {
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 peffect = rm->first;
auto pit = rm->second;
......
......@@ -125,7 +125,8 @@ int32 scriptlib::duel_reset_flag_effect(lua_State *L) {
effect* peffect;
pr = pduel->game_field->effects.aura_effect.equal_range(code);
for(; pr.first != pr.second; ) {
peffect = pr.first->second;
auto rm = pr.first++;
peffect = rm->second;
if(peffect->code == code)
pduel->game_field->remove_effect(peffect);
}
......
......@@ -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->handler->current.location & 0x3) || peffect->handler->is_status(STATUS_IS_PUBLIC))) {
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);
act = false;
} 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) {
core.units.begin()->step = 2;
core.attacker = core.attackable_cards[sel];
core.attacker->set_status(STATUS_ATTACK_CANCELED, FALSE);
core.pre_field[0] = core.attacker->fieldid_r;
core.phase_action = TRUE;
effect_set eset;
filter_player_effect(infos.turn_player, EFFECT_ATTACK_COST, &eset, FALSE);
......@@ -2701,6 +2703,10 @@ int32 field::process_battle_command(uint16 step) {
}
case 3: {
//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.units.begin()->arg1 = FALSE;
if(core.chain_attack && core.chain_attack_target) {
......@@ -3880,21 +3886,6 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
core.new_ochain.clear();
core.quick_f_chain.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);
return FALSE;
}
......
......@@ -26,7 +26,7 @@ function c12275533.initial_effect(c)
local ge3=ge1:Clone()
ge3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
Duel.RegisterEffect(ge3,0)
end
end
end
function c12275533.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
......@@ -39,7 +39,7 @@ function c12275533.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(1-tp,12275533)>=3
end
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
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
......
......@@ -7,6 +7,7 @@ function c12503902.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_DAMAGE_STEP)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(c12503902.condition)
e1:SetTarget(c12503902.target)
e1:SetOperation(c12503902.operation)
c:RegisterEffect(e1)
......@@ -26,6 +27,9 @@ end
function c12503902.desop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
function c12503902.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c12503902.filter(c)
return c:IsFaceup() and c:IsRace(RACE_MACHINE)
end
......
......@@ -16,12 +16,13 @@ function c13293158.initial_effect(c)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetOperation(c13293158.atkop)
c:RegisterEffect(e2)
--destroy
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(13293158,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetCondition(c13293158.condition)
e3:SetTarget(c13293158.target)
e3:SetOperation(c13293158.activate)
c:RegisterEffect(e3)
......@@ -42,6 +43,9 @@ end
function c13293158.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c13293158.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c13293158.filter(c)
return c:IsFacedown() and c:IsDestructable()
end
......
......@@ -61,8 +61,18 @@ function c13629812.disop(e,tp)
return bit.lshift(0x1,e:GetLabel())
end
function c13629812.retcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFirstCardTarget()~=nil
local c=e:GetHandler()
local tc=c:GetFirstCardTarget()
if tc and tc:IsLocation(LOCATION_REMOVED) and tc:IsFaceup() and c:IsLocation(LOCATION_GRAVE) then
e:SetLabelObject(tc)
tc:CreateEffectRelation(e)
return true
else return false end
end
function c13629812.retop(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetHandler():GetFirstCardTarget())
local c=e:GetHandler()
local tc=e:GetLabelObject()
if tc:IsRelateToEffect(e) then
Duel.ReturnToField(tc)
end
end
......@@ -36,6 +36,7 @@ end
function c14235211.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if c:IsLocation(LOCATION_MZONE) and c:IsFacedown() then return end
local tc=Duel.GetFirstTarget()
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)
......
......@@ -33,6 +33,7 @@ function c16392422.initial_effect(c)
e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_BATTLE_DAMAGE)
e6:SetCondition(c16392422.condition)
e6:SetTarget(c16392422.target)
e6:SetOperation(c16392422.operation)
c:RegisterEffect(e6)
......@@ -63,6 +64,9 @@ function c16392422.dircon(e)
return Duel.IsExistingMatchingCard(c16392422.dirfilter1,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
and not Duel.IsExistingMatchingCard(c16392422.dirfilter2,e:GetHandlerPlayer(),0,LOCATION_MZONE,1,nil)
end
function c16392422.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c16392422.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
......
......@@ -41,7 +41,7 @@ function c18865703.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c18865703.eqop(e,tp,eg,ep,ev,re,r,rp)
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()
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)
......
......@@ -41,7 +41,7 @@ function c21698716.repoperation(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RaiseEvent(c,47408488,e,0,tp,0,0)
end
function c21698716.filter(c)
return c:IsSetCard(0x34) and c:IsAbleToDeck()
return c:IsSetCard(0x34) and c:IsAbleToDeck() and c:IsFaceup()
end
function c21698716.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c21698716.filter(chkc) end
......
......@@ -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)
Duel.SendtoGrave(g,REASON_COST)
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
end
function c22628574.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -44,17 +44,17 @@ function c2403771.thop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c2403771.repfilter(c)
return c:IsType(TYPE_SPELL) and not c:IsStatus(STATUS_DESTROY_CONFIRMED)
return c:IsType(TYPE_SPELL) and c:IsLocation(LOCATION_SZONE) and not c:IsStatus(STATUS_DESTROY_CONFIRMED)
end
function c2403771.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local g=c:GetEquipGroup()
local res=g:IsExists(c2403771.repfilter,1,nil)
return not c:IsReason(REASON_REPLACE) and res
return not c:IsReason(REASON_REPLACE) and g:IsExists(c2403771.repfilter,1,nil)
end
if Duel.SelectYesNo(tp,aux.Stringid(2403771,1)) then
local g=c:GetEquipGroup()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:FilterSelect(tp,c2403771.repfilter,1,1,nil)
Duel.SetTargetCard(sg)
return true
......
......@@ -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
Duel.DiscardHand(tp,c24096228.cfilter,1,1,REASON_COST+REASON_DISCARD)
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
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
end
function c24096228.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
--E·HERO フレイム·ウィングマン
--E·HERO シャイニング·フレア·ウィングマン
function c25366484.initial_effect(c)
--fusion material
c:EnableReviveLimit()
......@@ -40,8 +40,8 @@ function c25366484.damcon(e,tp,eg,ep,ev,re,r,rp)
end
function c25366484.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
local bc=c:GetBattleTarget()
local bc=e:GetHandler():GetBattleTarget()
Duel.SetTargetCard(bc)
local dam=bc:GetAttack()
if dam<0 then dam=0 end
Duel.SetTargetPlayer(1-tp)
......@@ -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)
end
function c25366484.damop(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 tc=Duel.GetFirstTarget()
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
function c25366484.atkup(e,c)
return Duel.GetMatchingGroupCount(Card.IsSetCard,c:GetControler(),LOCATION_GRAVE,0,nil,0x3008)*300
......
......@@ -7,12 +7,16 @@ function c25435080.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCondition(c25435080.condition)
e1:SetCost(c25435080.cost)
e1:SetTarget(c25435080.target)
e1:SetOperation(c25435080.activate)
e1:SetLabel(0)
c:RegisterEffect(e1)
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)
return c:IsSetCard(0x33) and Duel.IsExistingTarget(c25435080.tfilter,tp,LOCATION_MZONE,0,1,c)
end
......@@ -28,10 +32,9 @@ function c25435080.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then
if e:GetLabel()~=1 then return false end
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
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=Duel.SelectMatchingCard(tp,c25435080.cfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
local rg=Duel.SelectReleaseGroup(tp,c25435080.cfilter,1,1,nil,tp)
e:SetLabel(rg:GetFirst():GetAttack())
Duel.Release(rg,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
......
......@@ -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
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c27383110.thfilter(c)
return c:IsLocation(LOCATION_GRAVE) and c:IsAbleToHand()
function c27383110.thfilter(c,e,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp) and c:IsAbleToHand() and c:IsCanBeEffectTarget(e)
end
function c27383110.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tc=e:GetLabelObject():GetLabelObject()
local mat=tc:GetMaterial()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and mat:IsContains(chkc) end
if chk==0 then return mat:IsExists(c27383110.thfilter,1,nil) 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,e,tp) end
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.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
......
......@@ -15,7 +15,7 @@ function c28002611.filter(c)
end
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
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND)
end
function c28002611.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
--ˮ[`ӥ
--水精鱗-オーケアビス
function c28577986.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
......@@ -18,12 +18,12 @@ function c28577986.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c28577986.cfilter(c,e,tp)
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)
end
function c28577986.spfilter(c,lv,e,tp)
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
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
......
......@@ -6,6 +6,7 @@ function c29267084.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCondition(c29267084.condition)
e1:SetTarget(c29267084.target)
e1:SetOperation(c29267084.operation)
c:RegisterEffect(e1)
......@@ -18,6 +19,9 @@ function c29267084.initial_effect(c)
e2:SetOperation(c29267084.desop)
c:RegisterEffect(e2)
end
function c29267084.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c29267084.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
......
......@@ -51,7 +51,7 @@ function c29353756.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c29353756.eqop(e,tp,eg,ep,ev,re,r,rp)
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()
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)
......
......@@ -4,7 +4,7 @@ function c30459350.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_DRAW_PHASE)
e1:SetHintTiming(0,TIMING_DRAW_PHASE+0x1e0)
c:RegisterEffect(e1)
--cannot remove
local e2=Effect.CreateEffect(c)
......
......@@ -20,10 +20,7 @@ function c31034919.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c31034919.operation(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_HAND,0,2,2,nil)
if g:GetCount()==2 then
Duel.SendtoGrave(g,REASON_EFFECT)
Duel.Draw(tp,2,REASON_EFFECT)
end
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)<2 then return end
Duel.DiscardHand(tp,nil,2,2,REASON_EFFECT)
Duel.Draw(tp,2,REASON_EFFECT)
end
......@@ -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 tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
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:RegisterFlagEffect(3146695,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
tc=g:GetNext()
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
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 d=Duel.GetAttackTarget()
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)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,rg,rg:GetCount(),0,0)
end
......@@ -45,3 +59,6 @@ function c3146695.operation(e,tp,eg,ep,ev,re,r,rp)
local rg=g:Filter(Card.IsRelateToBattle,nil)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
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)
return tp==Duel.GetTurnPlayer() and not Duel.CheckAttackActivity(tp)
end
function c33302407.filter(c)
return c:IsSetCard(0x25) and c:IsType(TYPE_MONSTER)
return c:IsFaceup() and c:IsSetCard(0x25)
end
function c33302407.distg(e,tp,eg,ep,ev,re,r,rp,chk)
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)
end
function c33725002.eqop(e,tp,eg,ep,ev,re,r,rp)
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()
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)
......
......@@ -25,6 +25,7 @@ function c34109611.operation(e,tp,eg,ep,ev,re,r,rp)
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(600)
......
......@@ -32,8 +32,8 @@ function c35809262.damcon(e,tp,eg,ep,ev,re,r,rp)
end
function c35809262.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
local bc=c:GetBattleTarget()
local bc=e:GetHandler():GetBattleTarget()
Duel.SetTargetCard(bc)
local dam=bc:GetAttack()
if dam<0 then dam=0 end
Duel.SetTargetPlayer(1-tp)
......@@ -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)
end
function c35809262.damop(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 tc=Duel.GetFirstTarget()
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
......@@ -32,7 +32,7 @@ function c3657444.initial_effect(c)
end
function c3657444.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,0)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c3657444.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
......@@ -52,15 +52,13 @@ function c3657444.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c3657444.filter2,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
local sg=g:Clone()
sg:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,2,0,0)
g:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c3657444.operation2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tc=g:GetFirst()
local tc=Duel.GetFirstTarget()
if tc:IsFacedown() or not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) then return end
local sg=Group.FromCards(c,tc)
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
......@@ -76,7 +74,7 @@ function c3657444.target3(e,tp,eg,ep,ev,re,r,rp,chk)
and Duel.IsExistingMatchingCard(c3657444.filter3,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_GRAVE)
end
function c3657444.operation3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -18,10 +18,10 @@ function c37195861.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
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
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
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c37195861.filter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,1,nil)
......
......@@ -4,10 +4,15 @@ function c38834303.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c38834303.cost)
e1:SetTarget(c38834303.target)
e1:SetOperation(c38834303.activate)
c:RegisterEffect(e1)
end
function c38834303.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,500) end
Duel.PayLPCost(tp,500)
end
function c38834303.filter(c)
return c:GetCounter(0)~=0
end
......@@ -15,7 +20,7 @@ function c38834303.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c38834303.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
end
function c38834303.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c38834303.filter,tp,LOCATION_MZONE,0,nil)
local sg=Duel.GetMatchingGroup(c38834303.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local tc=sg:GetFirst()
while tc do
tc:RemoveCounter(tp,0,0,0)
......
......@@ -12,7 +12,7 @@ function c41620959.initial_effect(c)
end
function c41620959.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,41620959)==0 end
Duel.RegisterFlagEffect(tp,41620959,RESET_PHASE+PHASE_END,0,1)
Duel.RegisterFlagEffect(tp,41620959,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c41620959.tgfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsAbleToGrave()
......
......@@ -32,6 +32,7 @@ function c42386471.initial_effect(c)
e6:SetCategory(CATEGORY_HANDES)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_BATTLE_DAMAGE)
e6:SetCondition(c42386471.condition)
e6:SetTarget(c42386471.target)
e6:SetOperation(c42386471.operation)
c:RegisterEffect(e6)
......@@ -62,6 +63,9 @@ function c42386471.dircon(e)
return Duel.IsExistingMatchingCard(c42386471.dirfilter1,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
and not Duel.IsExistingMatchingCard(c42386471.dirfilter2,e:GetHandlerPlayer(),0,LOCATION_MZONE,1,nil)
end
function c42386471.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c42386471.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,1-tp,1)
......
......@@ -4,19 +4,18 @@ function c42671151.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RECOVER+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_DAMAGE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCondition(c42671151.condition)
e1:SetTarget(c42671151.target)
e1:SetOperation(c42671151.activate)
c:RegisterEffect(e1)
end
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
function c42671151.target(e,tp,eg,ep,ev,re,r,rp,chk)
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_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
......@@ -24,9 +23,9 @@ end
function c42671151.activate(e,tp,eg,ep,ev,re,r,rp)
local rec=Duel.Recover(tp,ev,REASON_EFFECT)
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)
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())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
......@@ -36,4 +35,5 @@ function c42671151.activate(e,tp,eg,ep,ev,re,r,rp)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENCE)
token:RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
end
......@@ -6,10 +6,15 @@ function c42793609.initial_effect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCondition(c42793609.condition)
e1:SetTarget(c42793609.target)
e1:SetOperation(c42793609.operation)
c:RegisterEffect(e1)
end
function c42793609.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c42793609.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil)
......
......@@ -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)
end
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
function c43841694.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
......
......@@ -45,6 +45,7 @@ end
function c45082499.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if c:IsLocation(LOCATION_MZONE) and c:IsFacedown() then return end
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
Duel.SendtoGrave(c,REASON_EFFECT)
......
......@@ -10,8 +10,7 @@ function c46710683.initial_effect(c)
c:RegisterEffect(e1)
end
function c46710683.condition(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_DESTROY)>0
and bit.band(e:GetHandler():GetPreviousLocation(),LOCATION_ONFIELD)>0
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and e:GetHandler():IsReason(REASON_DESTROY)
end
function c46710683.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
......@@ -22,11 +21,11 @@ function c46710683.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(c46710683.damval)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
c46710683.available=true
Duel.RegisterFlagEffect(tp,46710683,RESET_PHASE+PHASE_END,0,1)
end
c46710683.available=false
function c46710683.damval(e,re,val,r,rp,rc)
if not c46710683.available or bit.band(r,REASON_BATTLE)==0 then return val end
c46710683.available=false
local tp=e:GetHandlerPlayer()
if Duel.GetFlagEffect(tp,46710683)==0 or bit.band(r,REASON_BATTLE)==0 then return val end
Duel.ResetFlagEffect(tp,46710683)
return 0
end
......@@ -6,6 +6,13 @@ function c47942531.initial_effect(c)
e1:SetCode(EFFECT_MATERIAL_CHECK)
e1:SetValue(c47942531.valcheck)
c:RegisterEffect(e1)
--give atk effect only when summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_COST)
e2:SetOperation(c47942531.facechk)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
end
function c47942531.valcheck(e,c)
local tc=c:GetMaterial():GetFirst()
......@@ -13,12 +20,17 @@ function c47942531.valcheck(e,c)
if tc then atk=tc:GetTextAttack()*2 end
if atk<0 then atk=0 end
--atk continuous effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
if e:GetLabel()==1 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
end
end
function c47942531.facechk(e,tp,eg,ep,ev,re,r,rp)
e:GetLabelObject():SetLabel(1)
end
......@@ -23,12 +23,14 @@ function c48928529.operation(e,tp,eg,ep,ev,re,r,rp,chk)
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,2)
e1:SetValue(1)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_PIERCE)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,2)
tc:RegisterEffect(e2)
......
......@@ -7,11 +7,15 @@ function c49204190.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetCondition(c49204190.condition)
e1:SetCost(c49204190.cost)
e1:SetTarget(c49204190.target)
e1:SetOperation(c49204190.activate)
c:RegisterEffect(e1)
end
function c49204190.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function c49204190.cfilter(c)
return c:GetAttack()>0 and c:IsDiscardable()
end
......
......@@ -16,8 +16,8 @@ function c50412166.condition(e,tp,eg,ep,ev,re,r,rp)
return ph~=PHASE_MAIN2 and ph~=PHASE_END
end
function c50412166.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c50412166.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local e1=Effect.CreateEffect(e:GetHandler())
......
--フォトン,トライデント
--フォトン・トライデント
function c51589188.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
......@@ -53,7 +53,7 @@ function c51589188.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
function c51589188.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetFirst()==e:GetLabelObject()
return ep~=tp and eg:GetFirst()==e:GetLabelObject()
end
function c51589188.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
......
......@@ -34,7 +34,7 @@ function c53670497.filter1(c)
return c:IsSetCard(0x69) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
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
function c53670497.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -15,6 +15,7 @@ function c53839837.initial_effect(c)
e2:SetCondition(c53839837.spcon)
e2:SetTarget(c53839837.sptg)
e2:SetOperation(c53839837.spop)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
--to grave
local e3=Effect.CreateEffect(c)
......@@ -22,6 +23,7 @@ function c53839837.initial_effect(c)
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetCondition(c53839837.tgcon)
e3:SetTarget(c53839837.tgtg)
e3:SetOperation(c53839837.tgop)
c:RegisterEffect(e3)
......@@ -29,11 +31,17 @@ end
function c53839837.spr(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
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
function c53839837.spcon(e,tp,eg,ep,ev,re,r,rp)
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
function c53839837.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......@@ -44,9 +52,12 @@ end
function c53839837.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
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
function c53839837.tgcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c53839837.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(53839837,5))
......
......@@ -14,7 +14,7 @@ function c56511382.initial_effect(c)
c:RegisterEffect(e1)
end
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
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
......
......@@ -48,14 +48,14 @@ function c56948373.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
function c56948373.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler():GetEquipTarget()
return c and Duel.GetTurnPlayer()==c:GetControler()
return Duel.GetTurnPlayer()==tp and e:GetHandler():GetEquipTarget()~=nil
end
function c56948373.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(Duel.GetTurnPlayer())
local p=e:GetHandler():GetEquipTarget():GetControler()
Duel.SetTargetPlayer(p)
Duel.SetTargetParam(500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,Duel.GetTurnPlayer(),500)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,p,500)
end
function c56948373.damop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
......
......@@ -70,6 +70,5 @@ function c59057152.spop(e,tp,eg,ep,ev,re,r,rp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,c59057152.desfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.BreakEffect()
Duel.Destroy(dg,REASON_EFFECT)
end
......@@ -72,7 +72,7 @@ function c60992364.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
function c60992364.eqop(e,tp,eg,ep,ev,re,r,rp)
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()
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)
......
......@@ -40,6 +40,7 @@ end
function c6330307.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if c:IsLocation(LOCATION_MZONE) and c:IsFacedown() then return end
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
Duel.SendtoGrave(c,REASON_EFFECT)
......
......@@ -12,14 +12,21 @@ function c6614221.initial_effect(c)
e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetValue(c6614221.valcheck)
c:RegisterEffect(e2)
--cannot release
--give atk effect only when summon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_CANNOT_RELEASE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,1)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SUMMON_COST)
e3:SetOperation(c6614221.facechk)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--cannot release
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_CANNOT_RELEASE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,1)
c:RegisterEffect(e4)
end
function c6614221.valcheck(e,c)
local g=c:GetMaterial()
......@@ -30,13 +37,17 @@ function c6614221.valcheck(e,c)
atk=atk+(catk>=0 and catk or 0)
tc=g:GetNext()
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
if e:GetLabel()==1 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
end
end
function c6614221.facechk(e,tp,eg,ep,ev,re,r,rp)
e:GetLabelObject():SetLabel(1)
end
......@@ -6,10 +6,14 @@ function c68167124.initial_effect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCondition(c68167124.condition)
e1:SetTarget(c68167124.target)
e1:SetOperation(c68167124.operation)
c:RegisterEffect(e1)
end
function c68167124.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c68167124.filter(c)
return c:IsFaceup() and c:GetSequence()~=5
end
......
......@@ -5,6 +5,7 @@ function c70089580.initial_effect(c)
e1:SetDescription(aux.Stringid(70089580,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CHAIN_UNIQUE)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c70089580.condition)
e1:SetCost(c70089580.cost)
......
......@@ -27,7 +27,7 @@ function c70271583.initial_effect(c)
e4:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_MZONE)
e4:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e4:SetCode(EVENT_DAMAGE)
e4:SetCode(EVENT_BATTLE_DAMAGE)
e4:SetCondition(c70271583.atkcon)
e4:SetOperation(c70271583.atkop)
c:RegisterEffect(e4)
......@@ -49,7 +49,7 @@ function c70271583.posop(e,tp,eg,ep,ev,re,r,rp)
end
end
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
function c70271583.filter(c)
return c:IsFaceup() and c:IsSetCard(0x11)
......@@ -61,6 +61,7 @@ function c70271583.atkop(e,tp,eg,ep,ev,re,r,rp)
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(800)
......
......@@ -52,16 +52,20 @@ function c76067258.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if c:IsFaceup() and c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
c:SetCardTarget(tc)
tc:RegisterFlagEffect(76067258,RESET_EVENT+0x1fe0000,0,0)
end
end
function c76067258.indtg(e,c)
return e:GetHandler():IsHasCardTarget(c)
return e:GetHandler():IsHasCardTarget(c) and c:GetFlagEffect(76067258)~=0
end
function c76067258.repfilter(c,tp)
return c:IsControler(tp) and c:GetFlagEffect(76067258)~=0
end
function c76067258.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFirstCardTarget()~=nil end
if chk==0 then return e:GetHandler():GetCardTarget():IsExists(c76067258.repfilter,1,nil,tp) end
if Duel.SelectYesNo(tp,aux.Stringid(76067258,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=e:GetHandler():GetCardTarget():Select(tp,1,1,nil)
local g=e:GetHandler():GetCardTarget():FilterSelect(tp,c76067258.repfilter,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_EFFECT)
return true
else return false end
......
--ダークロン
function c76202610.initial_effect(c)
--special summon
--level,attribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(76202610,0))
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
......@@ -14,12 +14,14 @@ function c76202610.operation(e,tp,eg,ep,ev,re,r,rp)
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e2:SetValue(ATTRIBUTE_DARK)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
......
......@@ -23,8 +23,8 @@ function c76214441.discon(e,tp,eg,ep,ev,re,r,rp)
(cp==PLAYER_ALL and (Duel.IsPlayerAffectedByEffect(0,EFFECT_REVERSE_RECOVER) or Duel.IsPlayerAffectedByEffect(1,EFFECT_REVERSE_RECOVER))))
end
function c76214441.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c76214441.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -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
Duel.PayLPCost(tp,1000)
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
end
function c79766336.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -41,7 +41,7 @@ function c80513550.hspcon(e,c)
and Duel.IsExistingMatchingCard(c80513550.hspfilter,c:GetControler(),LOCATION_SZONE,0,3,nil)
end
function c80513550.hdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler()==Duel.GetAttacker()
return ep~=tp and e:GetHandler()==Duel.GetAttacker()
end
function c80513550.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -43,6 +43,7 @@ function c8062132.initial_effect(c)
e6:SetCategory(CATEGORY_COUNTER)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_BATTLE_DAMAGE)
e6:SetCondition(c8062132.ctcon)
e6:SetOperation(c8062132.ctop)
c:RegisterEffect(e6)
end
......@@ -71,6 +72,9 @@ function c8062132.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,true,true,POS_FACEUP)
end
end
function c8062132.ctcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function c8062132.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:AddCounter(0x11,1)
......
......@@ -42,6 +42,7 @@ end
function c81471108.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if c:IsLocation(LOCATION_MZONE) and c:IsFacedown() then return end
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
Duel.SendtoGrave(c,REASON_EFFECT)
......
......@@ -14,7 +14,7 @@ function c83500096.initial_effect(c)
c:RegisterEffect(e1)
end
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
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
......
......@@ -19,7 +19,7 @@ function c83986578.cfilter(c)
return c:IsFaceup() and c:IsAttackBelow(1400)
end
function c83986578.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c83986578.cfilter,1,nil)
return eg:IsExists(c83986578.cfilter,1,nil) and not eg:IsContains(e:GetHandler())
end
function c83986578.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -114,7 +114,7 @@ function c84814897.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
......
......@@ -13,7 +13,7 @@ function c87025064.initial_effect(c)
end
function c87025064.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,87025064)==0 end
Duel.RegisterFlagEffect(tp,87025064,RESET_PHASE+PHASE_END,0,1)
Duel.RegisterFlagEffect(tp,87025064,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c87025064.filter(c,e,tp)
return c:IsRace(RACE_DRAGON) and c:IsType(TYPE_NORMAL) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
......@@ -6,6 +6,13 @@ function c8794435.initial_effect(c)
e1:SetCode(EFFECT_MATERIAL_CHECK)
e1:SetValue(c8794435.valcheck)
c:RegisterEffect(e1)
--give atk effect only when summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SUMMON_COST)
e2:SetOperation(c8794435.facechk)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
end
function c8794435.valcheck(e,c)
local g=c:GetMaterial()
......@@ -16,13 +23,18 @@ function c8794435.valcheck(e,c)
atk=atk+(catk>=0 and catk or 0)
tc=g:GetNext()
end
--atk continuous effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
if e:GetLabel()==1 then
--atk continuous effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
end
end
function c8794435.facechk(e,tp,eg,ep,ev,re,r,rp)
e:GetLabelObject():SetLabel(1)
end
......@@ -7,7 +7,7 @@ function c88071625.initial_effect(c)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.FALSE)
c:RegisterEffect(e1)
--summon with 1 tribute
--summon/set with 1 tribute
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(88071625,0))
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
......@@ -17,22 +17,32 @@ function c88071625.initial_effect(c)
e2:SetOperation(c88071625.otop)
e2:SetValue(SUMMON_TYPE_ADVANCE)
c:RegisterEffect(e2)
--tribute check
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_MATERIAL_CHECK)
e3:SetValue(c88071625.valcheck)
local e3=e2:Clone()
e3:SetCode(EFFECT_SET_PROC)
c:RegisterEffect(e3)
--copy
--tribute check
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(88071625,1))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetCondition(c88071625.copycon)
e4:SetTarget(c88071625.copytg)
e4:SetOperation(c88071625.copyop)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_MATERIAL_CHECK)
e4:SetValue(c88071625.valcheck)
c:RegisterEffect(e4)
--give atk effect only when summon
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_SUMMON_COST)
e5:SetOperation(c88071625.facechk)
e5:SetLabelObject(e4)
c:RegisterEffect(e5)
--copy
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(88071625,1))
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e6:SetProperty(EFFECT_FLAG_CARD_TARGET)
e6:SetCode(EVENT_SUMMON_SUCCESS)
e6:SetCondition(c88071625.copycon)
e6:SetTarget(c88071625.copytg)
e6:SetOperation(c88071625.copyop)
c:RegisterEffect(e6)
end
function c88071625.otcon(e,c)
if c==nil then return true end
......@@ -55,20 +65,25 @@ function c88071625.valcheck(e,c)
def=def+(cdef>=0 and cdef or 0)
tc=g:GetNext()
end
--atk continuous effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
--def continuous effect
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENCE)
e2:SetValue(def)
c:RegisterEffect(e2)
if e:GetLabel()==1 then
--atk continuous effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
--def continuous effect
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENCE)
e2:SetValue(def)
c:RegisterEffect(e2)
end
end
function c88071625.facechk(e,tp,eg,ep,ev,re,r,rp)
e:GetLabelObject():SetLabel(1)
end
function c88071625.copycon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_ADVANCE
......
......@@ -53,7 +53,8 @@ function c88241506.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetHandler())
end
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)
end
function c88241506.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -22,16 +22,16 @@ end
function c88301833.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:GetCount()==1 and eg:GetFirst():GetSummonType()==SUMMON_TYPE_RITUAL
end
function c88301833.thfilter(c,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp) and c:IsAbleToHand()
function c88301833.thfilter(c,e,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp) and c:IsAbleToHand() and c:IsCanBeEffectTarget(e)
end
function c88301833.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tc=eg:GetFirst()
local mat=tc:GetMaterial()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and mat:IsContains(chkc) end
if chk==0 then return mat:IsExists(c88301833.thfilter,1,nil,tp) 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,e,tp) end
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.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
......
......@@ -28,6 +28,7 @@ function c89547299.atkop(e,tp,eg,ep,ev,re,r,rp)
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
......
......@@ -17,7 +17,7 @@ function c92595545.initial_effect(c)
c:RegisterEffect(e2)
end
function c92595545.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttackTarget()==nil
return ep~=tp and Duel.GetAttackTarget()==nil
end
function c92595545.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
......
......@@ -4,13 +4,13 @@ function c96148285.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c96148285.condition)
e1:SetOperation(c96148285.activate)
c:RegisterEffect(e1)
end
function c96148285.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
return eg:IsExists(Card.IsControler,1,nil,1-tp)
end
function c96148285.filter(c,e,tp)
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