Commit 8e7998f8 authored by Fluorohydride's avatar Fluorohydride

Merge pull request #462 from VanillaSalt/patch60

fix
parents 1ec53f50 6e8d48ce
...@@ -1200,19 +1200,32 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc, ...@@ -1200,19 +1200,32 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
effect_set eset; effect_set eset;
target->filter_effect(EFFECT_DECREASE_TRIBUTE, &eset); target->filter_effect(EFFECT_DECREASE_TRIBUTE, &eset);
int32 minul = 0; int32 minul = 0;
effect* pdec = 0;
for(int32 i = 0; i < eset.count; ++i) { for(int32 i = 0; i < eset.count; ++i) {
if(!(eset[i]->flag & EFFECT_FLAG_COUNT_LIMIT)) { if(!(eset[i]->flag & EFFECT_FLAG_COUNT_LIMIT)) {
int32 dec = eset[i]->get_value(target); int32 dec = eset[i]->get_value(target);
if(minul < (dec & 0xffff)) if(minul < (dec & 0xffff)) {
minul = dec & 0xffff; minul = dec & 0xffff;
pdec = eset[i];
} }
} }
}
if(pdec) {
min -= minul; min -= minul;
pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_CARD);
pduel->write_buffer8(0);
pduel->write_buffer32(pdec->handler->data.code);
}
for(int32 i = 0; i < eset.count && min > 0; ++i) { for(int32 i = 0; i < eset.count && min > 0; ++i) {
if((eset[i]->flag & EFFECT_FLAG_COUNT_LIMIT) && (eset[i]->reset_count & 0xf00) > 0 && eset[i]->target) { if((eset[i]->flag & EFFECT_FLAG_COUNT_LIMIT) && (eset[i]->reset_count & 0xf00) > 0 && eset[i]->target) {
int32 dec = eset[i]->get_value(target); int32 dec = eset[i]->get_value(target);
min -= dec & 0xffff; min -= dec & 0xffff;
eset[i]->dec_count(); eset[i]->dec_count();
pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_CARD);
pduel->write_buffer8(0);
pduel->write_buffer32(eset[i]->handler->data.code);
} }
} }
for(int32 i = 0; i < eset.count && min > 0; ++i) { for(int32 i = 0; i < eset.count && min > 0; ++i) {
...@@ -1220,6 +1233,10 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc, ...@@ -1220,6 +1233,10 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
int32 dec = eset[i]->get_value(target); int32 dec = eset[i]->get_value(target);
min -= dec & 0xffff; min -= dec & 0xffff;
eset[i]->dec_count(); eset[i]->dec_count();
pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_CARD);
pduel->write_buffer8(0);
pduel->write_buffer32(eset[i]->handler->data.code);
} }
} }
} }
...@@ -1281,6 +1298,10 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc, ...@@ -1281,6 +1298,10 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
core.extra_summon[sumplayer] = TRUE; core.extra_summon[sumplayer] = TRUE;
effect* pextra = (effect*)core.temp_var[0]; effect* pextra = (effect*)core.temp_var[0];
pextra->get_value(target); pextra->get_value(target);
pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_CARD);
pduel->write_buffer8(0);
pduel->write_buffer32(pextra->handler->data.code);
} }
target->set_status(STATUS_FLIP_SUMMONED, FALSE); target->set_status(STATUS_FLIP_SUMMONED, FALSE);
target->enable_field_effect(FALSE); target->enable_field_effect(FALSE);
...@@ -1329,6 +1350,10 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc, ...@@ -1329,6 +1350,10 @@ int32 field::summon(uint16 step, uint8 sumplayer, card * target, effect * proc,
core.extra_summon[sumplayer] = TRUE; core.extra_summon[sumplayer] = TRUE;
effect* pextra = (effect*)core.temp_var[0]; effect* pextra = (effect*)core.temp_var[0];
pextra->get_value(target); pextra->get_value(target);
pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_CARD);
pduel->write_buffer8(0);
pduel->write_buffer32(pextra->handler->data.code);
} }
core.summoning_card = target; core.summoning_card = target;
return FALSE; return FALSE;
...@@ -1669,6 +1694,10 @@ int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, ui ...@@ -1669,6 +1694,10 @@ int32 field::mset(uint16 step, uint8 setplayer, card * target, effect * proc, ui
core.extra_summon[setplayer] = TRUE; core.extra_summon[setplayer] = TRUE;
effect* pextra = (effect*)core.temp_var[0]; effect* pextra = (effect*)core.temp_var[0];
pextra->get_value(target); pextra->get_value(target);
pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_CARD);
pduel->write_buffer8(0);
pduel->write_buffer32(pextra->handler->data.code);
} }
target->enable_field_effect(FALSE); target->enable_field_effect(FALSE);
move_to_field(target, setplayer, setplayer, LOCATION_MZONE, POS_FACEDOWN_DEFENCE); move_to_field(target, setplayer, setplayer, LOCATION_MZONE, POS_FACEDOWN_DEFENCE);
......
...@@ -38,7 +38,7 @@ end ...@@ -38,7 +38,7 @@ end
function c15458892.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c15458892.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c15458892.thfilter(chkc) end if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and c15458892.thfilter(chkc) end
if chk==0 then return true end if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c15458892.thfilter,tp,0,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectTarget(tp,c15458892.thfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end end
......
...@@ -4,10 +4,9 @@ function c18960169.initial_effect(c) ...@@ -4,10 +4,9 @@ function c18960169.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(18960169,0)) e1:SetDescription(aux.Stringid(18960169,0))
e1:SetCategory(CATEGORY_DRAW) e1:SetCategory(CATEGORY_DRAW)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCode(EVENT_DAMAGE)
e1:SetCondition(c18960169.condition) e1:SetCondition(c18960169.condition)
e1:SetTarget(c18960169.target) e1:SetTarget(c18960169.target)
e1:SetOperation(c18960169.operation) e1:SetOperation(c18960169.operation)
...@@ -23,7 +22,7 @@ function c18960169.initial_effect(c) ...@@ -23,7 +22,7 @@ function c18960169.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c18960169.condition(e,tp,eg,ep,ev,re,r,rp) function c18960169.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and r==REASON_BATTLE and e:GetHandler()==eg:GetFirst() return ep~=tp
end end
function c18960169.target(e,tp,eg,ep,ev,re,r,rp,chk) function c18960169.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
......
...@@ -17,9 +17,8 @@ function c19974580.initial_effect(c) ...@@ -17,9 +17,8 @@ function c19974580.initial_effect(c)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(19974580,1)) e2:SetDescription(aux.Stringid(19974580,1))
e2:SetCategory(CATEGORY_DECKDES) e2:SetCategory(CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_MZONE) e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetCode(EVENT_DAMAGE)
e2:SetCondition(c19974580.ddcon) e2:SetCondition(c19974580.ddcon)
e2:SetTarget(c19974580.ddtg) e2:SetTarget(c19974580.ddtg)
e2:SetOperation(c19974580.ddop) e2:SetOperation(c19974580.ddop)
...@@ -47,7 +46,7 @@ function c19974580.atop(e,tp,eg,ep,ev,re,r,rp) ...@@ -47,7 +46,7 @@ function c19974580.atop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c19974580.ddcon(e,tp,eg,ep,ev,re,r,rp) function c19974580.ddcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and r==REASON_BATTLE and eg:GetFirst()==e:GetHandler() return ep~=tp
end end
function c19974580.ddtg(e,tp,eg,ep,ev,re,r,rp,chk) function c19974580.ddtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -41,14 +41,16 @@ end ...@@ -41,14 +41,16 @@ end
function c22624373.desop(e,tp,eg,ep,ev,re,r,rp,chk) function c22624373.desop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsPosition(POS_FACEUP_ATTACK) and tc:IsRelateToEffect(e) then if c:IsRelateToEffect(e) and c:IsPosition(POS_FACEUP_ATTACK) then
Duel.ChangePosition(c,POS_FACEUP_DEFENCE) Duel.ChangePosition(c,POS_FACEUP_DEFENCE)
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT) Duel.Destroy(tc,REASON_EFFECT)
end
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION) e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_COPY_INHERIT) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_COPY_INHERIT)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,3) e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
end end
......
...@@ -10,12 +10,13 @@ function c30585393.initial_effect(c) ...@@ -10,12 +10,13 @@ function c30585393.initial_effect(c)
e1:SetOperation(c30585393.activate) e1:SetOperation(c30585393.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c30585393.target(e,tp,eg,ep,ev,re,r,rp,chk) function c30585393.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tc=eg:GetFirst() local tc=eg:GetFirst()
if chkc then return chkc==tc end
if chk==0 then return eg:GetCount()==1 and tc:GetPreviousControler()==tp if chk==0 then return eg:GetCount()==1 and tc:GetPreviousControler()==tp
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and tc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and tc:IsReason(REASON_EFFECT) and tc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and tc:IsReason(REASON_EFFECT)
and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) end and tc:IsCanBeEffectTarget(e) and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetTargetCard(tc) Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc,1,0,0)
end end
......
...@@ -21,15 +21,14 @@ function c3078576.initial_effect(c) ...@@ -21,15 +21,14 @@ function c3078576.initial_effect(c)
--skip draw --skip draw
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(3078576,1)) e4:SetDescription(aux.Stringid(3078576,1))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetRange(LOCATION_MZONE) e4:SetCode(EVENT_BATTLE_DAMAGE)
e4:SetCode(EVENT_DAMAGE)
e4:SetCondition(c3078576.skipcon) e4:SetCondition(c3078576.skipcon)
e4:SetOperation(c3078576.skipop) e4:SetOperation(c3078576.skipop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c3078576.skipcon(e,tp,eg,ep,ev,re,r,rp) function c3078576.skipcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and r==REASON_BATTLE and Duel.GetAttacker()==e:GetHandler() return ep~=tp
end end
function c3078576.skipop(e,tp,eg,ep,ev,re,r,rp) function c3078576.skipop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
......
...@@ -58,7 +58,7 @@ function c32391631.becon(e) ...@@ -58,7 +58,7 @@ function c32391631.becon(e)
return Duel.IsExistingMatchingCard(Card.IsAttackable,Duel.GetTurnPlayer(),LOCATION_MZONE,0,1,nil) return Duel.IsExistingMatchingCard(Card.IsAttackable,Duel.GetTurnPlayer(),LOCATION_MZONE,0,1,nil)
end end
function c32391631.desfilter(c) function c32391631.desfilter(c)
return c:IsPosition(POS_FACEUP_ATTACK) and c:GetAttackedCount()==0 and c:IsDestructable() return c:IsPosition(POS_FACEUP_ATTACK) and c:GetAttackAnnouncedCount()==0 and c:IsDestructable()
end end
function c32391631.destg(e,tp,eg,ep,ev,re,r,rp,chk) function c32391631.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -3,15 +3,14 @@ function c40933924.initial_effect(c) ...@@ -3,15 +3,14 @@ function c40933924.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(40933924,0)) e1:SetDescription(aux.Stringid(40933924,0))
e1:SetCategory(CATEGORY_TOGRAVE) e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCode(EVENT_DAMAGE)
e1:SetCondition(c40933924.condition) e1:SetCondition(c40933924.condition)
e1:SetOperation(c40933924.operation) e1:SetOperation(c40933924.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c40933924.condition(e,tp,eg,ep,ev,re,r,rp) function c40933924.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and r==REASON_BATTLE and eg:GetFirst()==e:GetHandler() return ep~=tp
end end
function c40933924.operation(e,tp,eg,ep,ev,re,r,rp) function c40933924.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
......
...@@ -23,7 +23,7 @@ function c52575195.initial_effect(c) ...@@ -23,7 +23,7 @@ function c52575195.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c52575195.tgcon1(e,tp,eg,ep,ev,re,r,rp) function c52575195.tgcon1(e,tp,eg,ep,ev,re,r,rp)
if rp==tp or not re:IsActiveType(TYPE_SPELL+TYPE_TRAP) or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end if rp==tp or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g or g:GetCount()~=1 then return false end if not g or g:GetCount()~=1 then return false end
local tc=g:GetFirst() local tc=g:GetFirst()
......
...@@ -12,15 +12,14 @@ function c53714009.initial_effect(c) ...@@ -12,15 +12,14 @@ function c53714009.initial_effect(c)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(53714009,0)) e2:SetDescription(aux.Stringid(53714009,0))
e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_DAMAGE) e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c53714009.atkcon) e2:SetCondition(c53714009.atkcon)
e2:SetOperation(c53714009.atkop) e2:SetOperation(c53714009.atkop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c53714009.atkcon(e,tp,eg,ep,ev,re,r,rp) function c53714009.atkcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and r==REASON_BATTLE and eg:GetFirst()==e:GetHandler() return ep~=tp
end end
function c53714009.atkop(e,tp,eg,ep,ev,re,r,rp) function c53714009.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -35,8 +35,8 @@ end ...@@ -35,8 +35,8 @@ end
function c59627393.operation(e,tp,eg,ep,ev,re,r,rp) function c59627393.operation(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker() local a=Duel.GetAttacker()
local at=Duel.GetAttackTarget() local at=Duel.GetAttackTarget()
if a:IsFacedown() or not a:IsRelateToEffect(e) or at:IsFacedown() or not at:IsRelateToEffect(e) then return end
if at:IsControler(tp) then a,at=at,a end if at:IsControler(tp) then a,at=at,a end
if a:IsFacedown() or not a:IsRelateToEffect(e) or not at:IsRelateToEffect(e) then return end
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_INDESTRUCTABLE_BATTLE) e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
...@@ -49,6 +49,7 @@ function c59627393.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -49,6 +49,7 @@ function c59627393.operation(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(1) e2:SetValue(1)
e2:SetReset(RESET_PHASE+PHASE_DAMAGE) e2:SetReset(RESET_PHASE+PHASE_DAMAGE)
a:RegisterEffect(e2,true) a:RegisterEffect(e2,true)
if at:IsType(TYPE_EFFECT) then
local e3=Effect.CreateEffect(e:GetHandler()) local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE) e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE) e3:SetCode(EFFECT_DISABLE)
...@@ -59,4 +60,5 @@ function c59627393.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -59,4 +60,5 @@ function c59627393.operation(e,tp,eg,ep,ev,re,r,rp)
e4:SetCode(EFFECT_DISABLE_EFFECT) e4:SetCode(EFFECT_DISABLE_EFFECT)
e4:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END) e4:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
at:RegisterEffect(e4) at:RegisterEffect(e4)
end
end end
...@@ -4,6 +4,7 @@ function c62107981.initial_effect(c) ...@@ -4,6 +4,7 @@ function c62107981.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK) e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetCondition(c62107981.atcon)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--atk/def --atk/def
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
......
...@@ -4,17 +4,15 @@ function c6214884.initial_effect(c) ...@@ -4,17 +4,15 @@ function c6214884.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(6214884,0)) e1:SetDescription(aux.Stringid(6214884,0))
e1:SetCategory(CATEGORY_HANDES) e1:SetCategory(CATEGORY_HANDES)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_DAMAGE)
e1:SetCondition(c6214884.condition) e1:SetCondition(c6214884.condition)
e1:SetTarget(c6214884.target) e1:SetTarget(c6214884.target)
e1:SetOperation(c6214884.operation) e1:SetOperation(c6214884.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c6214884.condition(e,tp,eg,ep,ev,re,r,rp) function c6214884.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and r==REASON_BATTLE and eg:GetFirst()==e:GetHandler() return ep~=tp
end end
function c6214884.target(e,tp,eg,ep,ev,re,r,rp,chk) function c6214884.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 end if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 end
......
...@@ -25,6 +25,18 @@ function c68392533.initial_effect(c) ...@@ -25,6 +25,18 @@ function c68392533.initial_effect(c)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(c68392533.eqlimit) e3:SetValue(c68392533.eqlimit)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--tohand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(68392533,0))
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCondition(c68392533.thcon)
e4:SetCost(c68392533.thcost)
e4:SetTarget(c68392533.thtg)
e4:SetOperation(c68392533.thop)
c:RegisterEffect(e4)
end end
function c68392533.eqlimit(e,c) function c68392533.eqlimit(e,c)
return c:IsRace(RACE_PSYCHO) return c:IsRace(RACE_PSYCHO)
...@@ -51,3 +63,23 @@ function c68392533.costchange(e,re,rp,val) ...@@ -51,3 +63,23 @@ function c68392533.costchange(e,re,rp,val)
return 0 return 0
else return val end else return val end
end end
function c68392533.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetPreviousEquipTarget()
return c:IsReason(REASON_LOST_TARGET) and ec and ec:IsReason(REASON_DESTROY)
end
function c68392533.thcost(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 c68392533.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function c68392533.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
...@@ -21,31 +21,6 @@ function c73398797.initial_effect(c) ...@@ -21,31 +21,6 @@ function c73398797.initial_effect(c)
e2:SetTarget(c73398797.sptg) e2:SetTarget(c73398797.sptg)
e2:SetOperation(c73398797.spop) e2:SetOperation(c73398797.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
if not c73398797.global_check then
c73398797.global_check=true
c73398797[0]=true
c73398797[1]=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ATTACK_ANNOUNCE)
ge1:SetOperation(c73398797.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge2:SetOperation(c73398797.clear)
Duel.RegisterEffect(ge2,0)
end
end
function c73398797.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
if tc:IsCode(89631139) then
c73398797[tc:GetControler()]=false
end
end
function c73398797.clear(e,tp,eg,ep,ev,re,r,rp)
c73398797[0]=true
c73398797[1]=true
end end
function c73398797.descon(e,tp,eg,ep,ev,re,r,rp) function c73398797.descon(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget() local d=Duel.GetAttackTarget()
...@@ -62,15 +37,7 @@ function c73398797.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -62,15 +37,7 @@ function c73398797.desop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c73398797.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c73398797.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c73398797[tp] and e:GetHandler():IsReleasable() end if chk==0 then return e:GetHandler():IsReleasable() end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetTarget(aux.TargetBoolFunction(Card.IsCode,89631139))
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetReset(RESET_PHASE+RESET_END)
Duel.RegisterEffect(e1,tp)
Duel.Release(e:GetHandler(),REASON_COST) Duel.Release(e:GetHandler(),REASON_COST)
end end
function c73398797.spfilter(c,e,tp) function c73398797.spfilter(c,e,tp)
...@@ -86,4 +53,11 @@ function c73398797.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -86,4 +53,11 @@ function c73398797.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c73398797.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c73398797.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetTarget(aux.TargetBoolFunction(Card.IsCode,89631139))
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetReset(RESET_PHASE+RESET_END)
Duel.RegisterEffect(e1,tp)
end end
...@@ -23,5 +23,5 @@ function c81863068.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -23,5 +23,5 @@ function c81863068.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-p,g) Duel.ConfirmCards(1-p,g)
local dg=g:Filter(Card.IsType,nil,TYPE_SPELL) local dg=g:Filter(Card.IsType,nil,TYPE_SPELL)
Duel.SendtoGrave(dg,REASON_EFFECT+REASON_DISCARD) Duel.SendtoGrave(dg,REASON_EFFECT+REASON_DISCARD)
Duel.ShuffleHand(1-p) Duel.ShuffleHand(p)
end end
...@@ -30,7 +30,7 @@ function c8483333.spcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -30,7 +30,7 @@ function c8483333.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c8483333.spfilter(c,e,tp,rc) function c8483333.spfilter(c,e,tp,rc)
return c:IsReason(REASON_SUMMON) and c:GetReasonCard()==rc and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_SUMMON) and c:GetReasonCard()==rc and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c8483333.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c8483333.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -59,14 +59,15 @@ function c85602018.spcon2(e,tp,eg,ep,ev,re,r,rp) ...@@ -59,14 +59,15 @@ function c85602018.spcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():GetLabel()==1 and Duel.GetCurrentChain()==0 return e:GetLabelObject():GetLabel()==1 and Duel.GetCurrentChain()==0
end end
function c85602018.spop(e,tp,eg,ep,ev,re,r,rp) function c85602018.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()~=1 then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c85602018.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(c85602018.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.SelectYesNo(tp,aux.Stringid(85602018,0)) then and Duel.SelectYesNo(tp,aux.Stringid(85602018,0)) then
e:GetLabelObject():SetLabel(2)
Duel.Hint(HINT_CARD,0,85602018) Duel.Hint(HINT_CARD,0,85602018)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c85602018.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c85602018.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
e:GetLabelObject():SetLabel(2)
else else
e:GetLabelObject():SetLabel(0) e:GetLabelObject():SetLabel(0)
end end
......
...@@ -4,17 +4,16 @@ function c91711547.initial_effect(c) ...@@ -4,17 +4,16 @@ function c91711547.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(91711547,0)) e1:SetDescription(aux.Stringid(91711547,0))
e1:SetCategory(CATEGORY_DAMAGE) e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_DAMAGE) e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c91711547.damcon) e1:SetCondition(c91711547.damcon)
e1:SetTarget(c91711547.damtg) e1:SetTarget(c91711547.damtg)
e1:SetOperation(c91711547.damop) e1:SetOperation(c91711547.damop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c91711547.damcon(e,tp,eg,ep,ev,re,r,rp) function c91711547.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and r==REASON_BATTLE and eg:GetFirst()==e:GetHandler() return ep~=tp
end end
function c91711547.damtg(e,tp,eg,ep,ev,re,r,rp,chk) function c91711547.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
--E·HERO ボルテック --E·HERO ボルテック
function c9327502.initial_effect(c) function c9327502.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE) e1:SetCode(EVENT_BATTLE_DAMAGE)
e1:SetCode(EVENT_DAMAGE)
e1:SetCondition(c9327502.condition) e1:SetCondition(c9327502.condition)
e1:SetTarget(c9327502.target) e1:SetTarget(c9327502.target)
e1:SetOperation(c9327502.operation) e1:SetOperation(c9327502.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c9327502.condition(e,tp,eg,ep,ev,re,r,rp) function c9327502.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and r==REASON_BATTLE and eg:GetFirst()==e:GetHandler() return ep~=tp
end end
function c9327502.filter(c,e,tp) function c9327502.filter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x3008) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsFaceup() and c:IsSetCard(0x3008) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
......
...@@ -28,7 +28,13 @@ function c967928.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -28,7 +28,13 @@ function c967928.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetCode(EFFECT_SKIP_DP) e1:SetCode(EFFECT_SKIP_DP)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN) if Duel.GetTurnPlayer()==p and Duel.GetCurrentPhase()==PHASE_DRAW then
e1:SetReset(RESET_PHASE+PHASE_DRAW+RESET_SELF_TURN,2)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(c967928.skipcon)
else
e1:SetReset(RESET_PHASE+PHASE_DRAW+RESET_SELF_TURN)
end
Duel.RegisterEffect(e1,p) Duel.RegisterEffect(e1,p)
else else
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
...@@ -41,6 +47,9 @@ function c967928.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -41,6 +47,9 @@ function c967928.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e1,p) Duel.RegisterEffect(e1,p)
end end
end end
function c967928.skipcon(e)
return Duel.GetTurnCount()~=e:GetLabel()
end
function c967928.aclimit(e,re,tp) function c967928.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) return re:IsHasType(EFFECT_TYPE_ACTIVATE)
end end
...@@ -44,15 +44,15 @@ function c98162021.attackup(e,c) ...@@ -44,15 +44,15 @@ function c98162021.attackup(e,c)
return c:GetCounter(0x3003)*300 return c:GetCounter(0x3003)*300
end end
function c98162021.addct2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c98162021.addct2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and chkc:IsCanAddCounter(0x3003,1) end if chkc then return chkc:IsOnField() and chkc:IsCanAddCounter(0x3003,1) end
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x3003,1,REASON_EFFECT) if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x3003,1,REASON_EFFECT)
and Duel.IsExistingTarget(Card.IsCanAddCounter,tp,LOCATION_ONFIELD,0,1,e:GetHandler(),0x3003,1) end and Duel.IsExistingTarget(Card.IsCanAddCounter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler(),0x3003,1) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(98162021,1)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(98162021,1))
Duel.SelectTarget(tp,Card.IsCanAddCounter,tp,LOCATION_ONFIELD,0,1,1,e:GetHandler(),0x3003,1) Duel.SelectTarget(tp,Card.IsCanAddCounter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler(),0x3003,1)
end end
function c98162021.addc2(e,tp,eg,ep,ev,re,r,rp) function c98162021.addc2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:GetCounter(0x21)==0 then return end if c:GetCounter(0x3003)==0 then return end
c:RemoveCounter(tp,0x3003,1,REASON_EFFECT) c:RemoveCounter(tp,0x3003,1,REASON_EFFECT)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then if tc:IsFaceup() and tc:IsRelateToEffect(e) then
......
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