Commit 21d1b449 authored by argon.sun's avatar argon.sun

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

parents 7f76d5a9 daefab5d
...@@ -490,7 +490,7 @@ uint32 card::get_rank() { ...@@ -490,7 +490,7 @@ uint32 card::get_rank() {
filter_effect(EFFECT_UPDATE_RANK, &effects, FALSE); filter_effect(EFFECT_UPDATE_RANK, &effects, FALSE);
filter_effect(EFFECT_CHANGE_RANK, &effects); filter_effect(EFFECT_CHANGE_RANK, &effects);
for (int32 i = 0; i < effects.count; ++i) { for (int32 i = 0; i < effects.count; ++i) {
if (effects[i]->code == EFFECT_UPDATE_LEVEL) { if (effects[i]->code == EFFECT_UPDATE_RANK) {
if ((effects[i]->type & EFFECT_TYPE_SINGLE) && !(effects[i]->flag & EFFECT_FLAG_SINGLE_RANGE)) if ((effects[i]->type & EFFECT_TYPE_SINGLE) && !(effects[i]->flag & EFFECT_FLAG_SINGLE_RANGE))
up += effects[i]->get_value(this); up += effects[i]->get_value(this);
else else
...@@ -958,7 +958,6 @@ void card::reset(uint32 id, uint32 reset_type) { ...@@ -958,7 +958,6 @@ void card::reset(uint32 id, uint32 reset_type) {
attacked_cards.clear(); attacked_cards.clear();
announce_count = 0; announce_count = 0;
attacked_count = 0; attacked_count = 0;
attack_negated_count = 0;
attack_all_target = TRUE; attack_all_target = TRUE;
} }
if(id & 0x5fe0000) { if(id & 0x5fe0000) {
......
...@@ -93,7 +93,6 @@ public: ...@@ -93,7 +93,6 @@ public:
uint32 operation_param; uint32 operation_param;
uint8 announce_count; uint8 announce_count;
uint8 attacked_count; uint8 attacked_count;
uint8 attack_negated_count;
uint8 attack_all_target; uint8 attack_all_target;
uint16 cardid; uint16 cardid;
uint32 fieldid; uint32 fieldid;
......
...@@ -681,7 +681,7 @@ int32 scriptlib::card_get_attack_announced_count(lua_State *L) { ...@@ -681,7 +681,7 @@ int32 scriptlib::card_get_attack_announced_count(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1); card* pcard = *(card**) lua_touserdata(L, 1);
lua_pushinteger(L, pcard->announce_count - pcard->attack_negated_count); lua_pushinteger(L, pcard->announce_count);
return 1; return 1;
} }
int32 scriptlib::card_is_direct_attacked(lua_State *L) { int32 scriptlib::card_is_direct_attacked(lua_State *L) {
......
...@@ -2870,7 +2870,6 @@ int32 field::process_battle_command(uint16 step) { ...@@ -2870,7 +2870,6 @@ int32 field::process_battle_command(uint16 step) {
atk_disabled = true; atk_disabled = true;
pduel->write_buffer8(MSG_ATTACK_DISABLED); pduel->write_buffer8(MSG_ATTACK_DISABLED);
core.attacker->set_status(STATUS_ATTACK_CANCELED, TRUE); core.attacker->set_status(STATUS_ATTACK_CANCELED, TRUE);
core.attacker->attack_negated_count++;
} }
effect* peffect; effect* peffect;
if((peffect = is_player_affected_by_effect(infos.turn_player, EFFECT_SKIP_BP))) { if((peffect = is_player_affected_by_effect(infos.turn_player, EFFECT_SKIP_BP))) {
......
...@@ -10,9 +10,20 @@ function c10118318.initial_effect(c) ...@@ -10,9 +10,20 @@ function c10118318.initial_effect(c)
e1:SetTarget(c10118318.target) e1:SetTarget(c10118318.target)
e1:SetOperation(c10118318.activate) e1:SetOperation(c10118318.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
if not c10118318.global_check then
c10118318.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_BATTLE)
ge1:SetOperation(c10118318.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c10118318.checkop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(Duel.GetTurnPlayer(),10118318,RESET_PHASE+PHASE_END,0,1)
end end
function c10118318.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c10118318.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetTurnPlayer()~=tp or Duel.GetCurrentPhase()<=PHASE_MAIN1 end if chk==0 then return Duel.GetTurnPlayer()~=tp or Duel.GetFlagEffect(tp,10118318)==0 end
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP) e1:SetCode(EFFECT_CANNOT_BP)
......
...@@ -11,7 +11,7 @@ function c13629812.initial_effect(c) ...@@ -11,7 +11,7 @@ function c13629812.initial_effect(c)
e1:SetTarget(c13629812.target) e1:SetTarget(c13629812.target)
e1:SetOperation(c13629812.operation) e1:SetOperation(c13629812.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--Destroy --return
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(13629812,0)) e2:SetDescription(aux.Stringid(13629812,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
...@@ -63,7 +63,7 @@ end ...@@ -63,7 +63,7 @@ end
function c13629812.retcon(e,tp,eg,ep,ev,re,r,rp) function c13629812.retcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=c:GetFirstCardTarget() local tc=c:GetFirstCardTarget()
if tc and tc:IsLocation(LOCATION_REMOVED) and tc:IsFaceup() and c:IsLocation(LOCATION_GRAVE) then if tc and tc:IsLocation(LOCATION_REMOVED) and tc:IsFaceup() and not c:IsLocation(LOCATION_DECK) then
e:SetLabelObject(tc) e:SetLabelObject(tc)
tc:CreateEffectRelation(e) tc:CreateEffectRelation(e)
return true return true
......
--ɥ?ѥ
function c14212201.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(14212201,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c14212201.sptg)
e1:SetOperation(c14212201.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e2:SetValue(c14212201.xyzlimit)
c:RegisterEffect(e2)
end
function c14212201.filter(c,e,tp)
return c:GetCode()~=14212201 and c:IsSetCard(0x8e) and c:IsAttribute(ATTRIBUTE_DARK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c14212201.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c14212201.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c14212201.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c14212201.filter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c14212201.ftarget)
e1:SetLabel(tc:GetFieldID())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c14212201.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
function c14212201.xyzlimit(e,c)
if not c then return false end
return not c:IsAttribute(ATTRIBUTE_DARK)
end
--覚星師ライズベルト
function c14512659.initial_effect(c)
--lv up
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(14512659,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetHintTiming(0x1c0)
e1:SetTarget(c14512659.target)
e1:SetOperation(c14512659.operation)
c:RegisterEffect(e1)
end
function c14512659.filter(c)
return c:IsFaceup() and c:IsLevelAbove(1)
end
function c14512659.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c14512659.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c14512659.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c14512659.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function c14512659.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(1)
tc:RegisterEffect(e1)
end
end
...@@ -23,7 +23,7 @@ function c15335853.initial_effect(c) ...@@ -23,7 +23,7 @@ function c15335853.initial_effect(c)
--banish --banish
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(15335853,0)) e4:SetDescription(aux.Stringid(15335853,0))
e4:SetCategory(CATEGORY_DESTROY) e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_IGNITION) e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1) e4:SetCountLimit(1)
......
--騎士デイ・グレファー
function c15767889.initial_effect(c)
aux.EnableDualAttribute(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(15767889,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c15767889.thcon)
e1:SetCost(c15767889.thcost)
e1:SetTarget(c15767889.thtg)
e1:SetOperation(c15767889.thop)
c:RegisterEffect(e1)
end
function c15767889.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsDualState() and Duel.GetTurnPlayer()==tp
end
function c15767889.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,15767889)==0 end
Duel.RegisterFlagEffect(tp,15767889,RESET_PHASE+PHASE_END,0,1)
end
function c15767889.filter(c)
return c:IsType(TYPE_EQUIP) and c:IsAbleToHand()
end
function c15767889.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c15767889.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c15767889.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c15767889.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
e:GetHandler():ResetNegateEffect(25789292,97268402)
end
function c15767889.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
--ゴースト姫-パンプリンセス-
function c17601919.initial_effect(c)
--send replace
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_SEND_REPLACE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c17601919.reptg)
e1:SetOperation(c17601919.repop)
c:RegisterEffect(e1)
end
function c17601919.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetDestination()==LOCATION_GRAVE and c:IsReason(REASON_DESTROY) end
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return false end
return Duel.SelectYesNo(tp,aux.Stringid(17601919,0))
end
function c17601919.repop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fc0000)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
--counter
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(17601919,1))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetCountLimit(1)
e2:SetTarget(c17601919.addct)
e2:SetOperation(c17601919.addc)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
--addown
local e3=Effect.CreateEffect(c)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetValue(c17601919.adval)
e3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UPDATE_DEFENCE)
c:RegisterEffect(e4)
end
function c17601919.addct(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x2f)
end
function c17601919.addc(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x2f,1)
end
end
function c17601919.adval(e,c)
return e:GetHandler():GetCounter(0x2f)*-100
end
...@@ -16,7 +16,7 @@ function c18511599.initial_effect(c) ...@@ -16,7 +16,7 @@ function c18511599.initial_effect(c)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(18511599,0)) e2:SetDescription(aux.Stringid(18511599,0))
e2:SetCategory(CATEGORY_DESTROY) e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCost(c18511599.cost) e2:SetCost(c18511599.cost)
...@@ -28,7 +28,7 @@ function c18511599.indcon(e) ...@@ -28,7 +28,7 @@ function c18511599.indcon(e)
return e:GetHandler():GetOverlayCount()~=0 return e:GetHandler():GetOverlayCount()~=0
end end
function c18511599.filter(c,e,tp) function c18511599.filter(c,e,tp)
return c:IsControler(1-tp) and (not e or c:IsRelateToEffect(e)) return c:IsControler(1-tp) and c:IsDestructable() and (not e or c:IsRelateToEffect(e))
end end
function c18511599.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c18511599.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
...@@ -36,8 +36,9 @@ function c18511599.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -36,8 +36,9 @@ function c18511599.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c18511599.target(e,tp,eg,ep,ev,re,r,rp,chk) function c18511599.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(c18511599.filter,1,nil,nil,tp) end if chk==0 then return eg:IsExists(c18511599.filter,1,nil,nil,tp) end
local g=eg:Filter(c18511599.filter,nil,nil,tp)
Duel.SetTargetCard(eg) Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end end
function c18511599.operation(e,tp,eg,ep,ev,re,r,rp) function c18511599.operation(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c18511599.filter,nil,e,tp) local g=eg:Filter(c18511599.filter,nil,e,tp)
......
--陰謀の盾
function c23122036.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c23122036.target)
e1:SetOperation(c23122036.operation)
c:RegisterEffect(e1)
end
function c23122036.filter(c)
return c:IsFaceup()
end
function c23122036.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c23122036.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c23122036.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,c23122036.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c23122036.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsLocation(LOCATION_SZONE) then return end
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetControler()==c:GetControler() then
Duel.Equip(tp,c,tc)
c:CancelToGrave()
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_EQUIP)
e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e1:SetCountLimit(1)
e1:SetValue(c23122036.valcon)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2)
--Equip limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(1)
e3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e3)
end
end
function c23122036.valcon(e,re,r,rp)
return bit.band(r,REASON_BATTLE)~=0 and e:GetHandler():GetEquipTarget():IsPosition(POS_FACEUP_ATTACK)
end
...@@ -50,6 +50,7 @@ function c23232295.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -50,6 +50,7 @@ function c23232295.atkop(e,tp,eg,ep,ev,re,r,rp)
if c:IsRelateToEffect(e) and c:IsFaceup() then if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1ff0000) e1:SetReset(RESET_EVENT+0x1ff0000)
e1:SetValue(800) e1:SetValue(800)
......
...@@ -14,7 +14,7 @@ end ...@@ -14,7 +14,7 @@ end
function c30585393.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) 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 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 tc:IsPreviousLocation(LOCATION_MZONE)
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:IsCanBeEffectTarget(e) and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) end and tc:IsCanBeEffectTarget(e) and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) end
......
...@@ -26,9 +26,10 @@ function c30646525.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -26,9 +26,10 @@ function c30646525.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function c30646525.operation(e,tp,eg,ep,ev,re,r,rp) function c30646525.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c30646525.filter,tp,LOCATION_MZONE,LOCATION_MZONE,c,c:GetAttack()) local g=Duel.GetMatchingGroup(c30646525.filter,tp,LOCATION_MZONE,LOCATION_MZONE,c,c:GetAttack())
local ct=Duel.Destroy(g,REASON_EFFECT) local ct=Duel.Destroy(g,REASON_EFFECT)
if ct>0 and c:IsFaceup() and c:IsRelateToEffect(e) then if ct>0 then
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
......
...@@ -6,13 +6,6 @@ function c31828916.initial_effect(c) ...@@ -6,13 +6,6 @@ function c31828916.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--special summon --special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_DESTROY)
e2:SetRange(LOCATION_SZONE)
e2:SetOperation(c31828916.check)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON) e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetDescription(aux.Stringid(31828916,0)) e3:SetDescription(aux.Stringid(31828916,0))
...@@ -22,19 +15,11 @@ function c31828916.initial_effect(c) ...@@ -22,19 +15,11 @@ function c31828916.initial_effect(c)
e3:SetCountLimit(1) e3:SetCountLimit(1)
e3:SetTarget(c31828916.target) e3:SetTarget(c31828916.target)
e3:SetOperation(c31828916.operation) e3:SetOperation(c31828916.operation)
e3:SetLabelObject(e2)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
function c31828916.check(e,tp,eg,ep,ev,re,r,rp) function c31828916.cfilter(c,e,tp)
if bit.band(r,REASON_BATTLE)==0 then return end return c:IsRace(RACE_MACHINE) and c:IsControler(tp) and c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE)
local pg=e:GetLabelObject() and bit.band(c:GetPreviousRaceOnField(),RACE_MACHINE)~=0
if pg then pg:DeleteGroup() end
local dg=eg:Filter(Card.IsRace,nil,RACE_MACHINE)
e:SetLabelObject(dg)
dg:KeepAlive()
end
function c31828916.cfilter(c,cg,e,tp)
return c:IsRace(RACE_MACHINE) and c:IsControler(tp) and c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) and cg:IsContains(c)
and Duel.IsExistingMatchingCard(c31828916.filter,tp,LOCATION_DECK,0,1,nil,c:GetAttack(),c:GetAttribute(),e,tp) and Duel.IsExistingMatchingCard(c31828916.filter,tp,LOCATION_DECK,0,1,nil,c:GetAttack(),c:GetAttribute(),e,tp)
end end
function c31828916.filter(c,atk,att,e,tp) function c31828916.filter(c,atk,att,e,tp)
...@@ -44,7 +29,7 @@ function c31828916.filter(c,atk,att,e,tp) ...@@ -44,7 +29,7 @@ function c31828916.filter(c,atk,att,e,tp)
end end
function c31828916.target(e,tp,eg,ep,ev,re,r,rp,chk) function c31828916.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 eg:IsExists(c31828916.cfilter,1,nil,e:GetLabelObject():GetLabelObject(),e,tp) end and eg:IsExists(c31828916.cfilter,1,nil,e,tp) end
Duel.SetTargetCard(eg) Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end end
......
...@@ -42,6 +42,35 @@ function c32391631.initial_effect(c) ...@@ -42,6 +42,35 @@ function c32391631.initial_effect(c)
e5:SetTarget(c32391631.destg) e5:SetTarget(c32391631.destg)
e5:SetOperation(c32391631.desop) e5:SetOperation(c32391631.desop)
c:RegisterEffect(e5) c:RegisterEffect(e5)
if not c32391631.global_check then
c32391631.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ATTACK_ANNOUNCE)
ge1:SetOperation(c32391631.check)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_ATTACK_DISABLED)
ge2:SetOperation(c32391631.check2)
Duel.RegisterEffect(ge2,0)
end
end
function c32391631.check(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local ct=tc:GetFlagEffectLabel(32391631)
if ct then
tc:SetFlagEffectLabel(32391631,ct+1)
else
tc:RegisterFlagEffect(32391631,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1,1)
end
end
function c32391631.check2(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local ct=tc:GetFlagEffectLabel(32391631)
if ct then
tc:SetFlagEffectLabel(32391631,ct-1)
end
end end
function c32391631.rectg(e,tp,eg,ep,ev,re,r,rp,chk) function c32391631.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
...@@ -58,7 +87,8 @@ function c32391631.becon(e) ...@@ -58,7 +87,8 @@ 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:GetAttackAnnouncedCount()==0 and c:IsDestructable() local ct=c:GetFlagEffectLabel(32391631)
return c:IsPosition(POS_FACEUP_ATTACK) and (not ct or ct==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
......
...@@ -74,7 +74,6 @@ function c33981008.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -74,7 +74,6 @@ function c33981008.spop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(c33981008.ctfilter,tp,LOCATION_GRAVE,0,nil) local ct=Duel.GetMatchingGroupCount(c33981008.ctfilter,tp,LOCATION_GRAVE,0,nil)
local g=Duel.SelectMatchingCard(tp,c33981008.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp,ct) local g=Duel.SelectMatchingCard(tp,c33981008.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp,ct)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end end
end end
--バーニングナックル・スピリッツ
function c36916401.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c36916401.cost)
e1:SetTarget(c36916401.target)
e1:SetOperation(c36916401.operation)
c:RegisterEffect(e1)
end
function c36916401.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,36916401)==0 and Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end
Duel.DiscardDeck(tp,1,REASON_COST)
Duel.RegisterFlagEffect(tp,36916401,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c36916401.filter(c,e,tp)
return c:IsSetCard(0x84) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c36916401.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c36916401.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c36916401.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c36916401.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c36916401.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENCE)
end
end
--紅貴士-ヴァンパイア・ブラム
function c38250531.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunctionF(c,aux.FilterBoolFunction(Card.IsRace,RACE_ZOMBIE),5),2)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(38250531,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c38250531.spcost)
e1:SetTarget(c38250531.sptg)
e1:SetOperation(c38250531.spop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetOperation(c38250531.spreg)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(38250531,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetRange(LOCATION_GRAVE)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetCondition(c38250531.spcon2)
e3:SetTarget(c38250531.sptg2)
e3:SetOperation(c38250531.spop2)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
function c38250531.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,38250531)==0 and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.RegisterFlagEffect(tp,38250531,RESET_PHASE+PHASE_END,0,1)
end
function c38250531.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c38250531.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(1-tp) and c38250531.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c38250531.spfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c38250531.spfilter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c38250531.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(c38250531.ftarget)
e1:SetLabel(tc:GetFieldID())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c38250531.ftarget(e,c)
return e:GetLabel()~=c:GetFieldID()
end
function c38250531.spreg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if rp~=tp and c:IsReason(REASON_DESTROY) then
e:SetLabel(Duel.GetTurnCount()+1)
c:RegisterFlagEffect(38250531,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,2)
end
end
function c38250531.spcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():GetLabel()==Duel.GetTurnCount() and e:GetHandler():GetFlagEffect(38250531)>0
end
function c38250531.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
e:GetHandler():ResetFlagEffect(38250531)
end
function c38250531.spop2(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_DEFENCE)
end
end
--ブルー・ダストン
function c40217358.initial_effect(c)
c:SetUniqueOnField(1,0,40217358)
--cannot release
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
c:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e4)
local e5=e1:Clone()
e5:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e5)
--banish
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(40217358,0))
e6:SetCategory(CATEGORY_REMOVE)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_DESTROYED)
e6:SetCondition(c40217358.rmcon)
e6:SetTarget(c40217358.rmtg)
e6:SetOperation(c40217358.rmop)
c:RegisterEffect(e6)
end
function c40217358.rmcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c40217358.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local pre=e:GetHandler():GetPreviousControler()
Duel.SetTargetPlayer(pre)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,pre,LOCATION_HAND)
end
function c40217358.rmop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local g=Duel.GetFieldGroup(p,LOCATION_HAND,0)
if g:GetCount()==0 then return end
local sg=g:RandomSelect(p,1)
Duel.Remove(sg,POS_FACEDOWN,REASON_EFFECT)
local tc=sg:GetFirst()
tc:RegisterFlagEffect(40217358,RESET_EVENT+0x1fe0000,0,0)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetCondition(c40217358.retcon)
e1:SetOperation(c40217358.retop)
e1:SetLabel(Duel.GetTurnCount()+1)
e1:SetLabelObject(tc)
Duel.RegisterEffect(e1,tp)
end
function c40217358.retcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()==e:GetLabel()
end
function c40217358.retop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffect(40217358)~=0 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
e:Reset()
end
--ヴァンパイア・グレイス
function c40607210.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(40607210,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_GRAVE)
e1:SetProperty(EFFECT_FLAG_CHAIN_UNIQUE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c40607210.condition)
e1:SetCost(c40607210.cost)
e1:SetTarget(c40607210.target)
e1:SetOperation(c40607210.operation)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(40607210,1))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c40607210.tgtg)
e2:SetOperation(c40607210.tgop)
c:RegisterEffect(e2)
end
function c40607210.cfilter(c,tp)
return c:IsLevelAbove(5) and c:IsRace(RACE_ZOMBIE) and c:IsControler(tp)
end
function c40607210.condition(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return rc and rc:IsRace(RACE_ZOMBIE) and eg:IsExists(c40607210.cfilter,1,nil,tp)
end
function c40607210.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,40607210)==0 and Duel.CheckLPCost(tp,2000) end
Duel.PayLPCost(tp,2000)
Duel.RegisterFlagEffect(tp,40607210,RESET_PHASE+PHASE_END,0,1)
end
function c40607210.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return 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
function c40607210.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c40607210.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,555)
local op=Duel.SelectOption(tp,70,71,72)
e:SetLabel(op)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_DECK)
end
function c40607210.tgfilter(c,ty)
return c:IsType(ty) and c:IsAbleToGrave()
end
function c40607210.tgop(e,tp,eg,ep,ev,re,r,rp)
local g=nil
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
if e:GetLabel()==0 then g=Duel.SelectMatchingCard(1-tp,c40607210.tgfilter,1-tp,LOCATION_DECK,0,1,1,nil,TYPE_MONSTER)
elseif e:GetLabel()==1 then g=Duel.SelectMatchingCard(1-tp,c40607210.tgfilter,1-tp,LOCATION_DECK,0,1,1,nil,TYPE_SPELL)
else g=Duel.SelectMatchingCard(1-tp,c40607210.tgfilter,1-tp,LOCATION_DECK,0,1,1,nil,TYPE_TRAP) end
if g:GetCount()~=0 then
Duel.SendtoGrave(g,REASON_EFFECT)
else
local cg=Duel.GetFieldGroup(tp,0,LOCATION_DECK)
Duel.ConfirmCards(tp,cg)
Duel.ShuffleDeck(1-tp)
end
end
...@@ -44,7 +44,7 @@ function c41329458.spcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -44,7 +44,7 @@ function c41329458.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterFlagEffect(tp,41329458,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,41329458,RESET_PHASE+PHASE_END,0,1)
end end
function c41329458.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c41329458.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-2
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
...@@ -59,7 +59,7 @@ function c41329458.cfilter(c) ...@@ -59,7 +59,7 @@ function c41329458.cfilter(c)
end end
function c41329458.spcost2(e,tp,eg,ep,ev,re,r,rp,chk) function c41329458.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c41329458.cfilter,tp,LOCATION_HAND,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c41329458.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c41329458.cfilter,1,1,nil) Duel.DiscardHand(tp,c41329458.cfilter,1,1,REASON_COST+REASON_DISCARD)
end end
function c41329458.sptg2(e,tp,eg,ep,ev,re,r,rp,chk) function c41329458.sptg2(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
......
...@@ -22,7 +22,7 @@ function c43543777.initial_effect(c) ...@@ -22,7 +22,7 @@ function c43543777.initial_effect(c)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(43543777,1)) e4:SetDescription(aux.Stringid(43543777,1))
e4:SetCategory(CATEGORY_TOHAND) e4:SetCategory(CATEGORY_TOHAND)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SUMMON_SUCCESS) e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetCost(c43543777.thcost) e4:SetCost(c43543777.thcost)
......
...@@ -16,10 +16,10 @@ end ...@@ -16,10 +16,10 @@ end
function c44424095.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c44424095.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsDestructable() end if chkc then return chkc:IsOnField() and chkc:IsDestructable() end
if chk==0 then return Duel.IsExistingMatchingCard(c44424095.filter,tp,LOCATION_HAND,0,1,nil) if chk==0 then return Duel.IsExistingMatchingCard(c44424095.filter,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.IsExistingTarget(Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler())
and Duel.IsPlayerCanDraw(tp,1) end and Duel.IsPlayerCanDraw(tp,1) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) local dg=Duel.SelectTarget(tp,Card.IsDestructable,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND) Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1) Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
......
...@@ -21,7 +21,7 @@ function c45452224.initial_effect(c) ...@@ -21,7 +21,7 @@ function c45452224.initial_effect(c)
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(45452224,1)) e4:SetDescription(aux.Stringid(45452224,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON) e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SUMMON_SUCCESS) e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetTarget(c45452224.sptg) e4:SetTarget(c45452224.sptg)
......
...@@ -21,6 +21,7 @@ function c47942531.valcheck(e,c) ...@@ -21,6 +21,7 @@ function c47942531.valcheck(e,c)
if atk<0 then atk=0 end if atk<0 then atk=0 end
--atk continuous effect --atk continuous effect
if e:GetLabel()==1 then if e:GetLabel()==1 then
e:SetLabel(0)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK) e1:SetCode(EFFECT_SET_ATTACK)
...@@ -28,7 +29,7 @@ function c47942531.valcheck(e,c) ...@@ -28,7 +29,7 @@ function c47942531.valcheck(e,c)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetValue(atk) e1:SetValue(atk)
e1:SetReset(RESET_EVENT+0xff0000) e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
end end
function c47942531.facechk(e,tp,eg,ep,ev,re,r,rp) function c47942531.facechk(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -37,6 +37,7 @@ function c48934760.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -37,6 +37,7 @@ function c48934760.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end end
local te=tc:GetActivateEffect() local te=tc:GetActivateEffect()
local tep=tc:GetControler()
local cost=te:GetCost() local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,EVENT_CHAIN_SOLVED,tc:GetActivateEffect(),0,tp,tp,Duel.GetCurrentChain()) Duel.RaiseEvent(tc,EVENT_CHAIN_SOLVED,tc:GetActivateEffect(),0,tp,tp,Duel.GetCurrentChain())
......
--バースト・リバース
function c50243722.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCost(c50243722.cost)
e1:SetTarget(c50243722.target)
e1:SetOperation(c50243722.operation)
c:RegisterEffect(e1)
end
function c50243722.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,2000) end
Duel.PayLPCost(tp,2000)
end
function c50243722.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN)
end
function c50243722.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c50243722.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c50243722.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c50243722.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c50243722.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENCE)
end
end
--黄血鬼
function c53090623.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(53090623,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c53090623.condition)
e1:SetTarget(c53090623.target)
e1:SetOperation(c53090623.operation)
c:RegisterEffect(e1)
--rankdown
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(53090623,1))
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c53090623.rdcost)
e2:SetTarget(c53090623.rdtg)
e2:SetOperation(c53090623.rdop)
c:RegisterEffect(e2)
end
function c53090623.condition(e,tp,eg,ep,ev,re,r,rp)
local c=eg:GetFirst()
return eg:GetCount()==1 and c:IsControler(tp) and c:GetSummonType()==SUMMON_TYPE_XYZ
end
function c53090623.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return 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
function c53090623.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c53090623.rdcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetOverlayCount(tp,1,0)>0 end
Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST)
end
function c53090623.filter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function c53090623.rdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c53090623.filter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c53090623.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c53090623.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c53090623.rdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-300)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_RANK)
e2:SetValue(-1)
tc:RegisterEffect(e2)
end
end
...@@ -37,7 +37,7 @@ function c62953041.hspcon(e,c) ...@@ -37,7 +37,7 @@ function c62953041.hspcon(e,c)
end end
function c62953041.spreg(e,tp,eg,ep,ev,re,r,rp) function c62953041.spreg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if bit.band(r,0x41)~=0x41 or not c:IsPreviousPosition(POS_FACEUP) then return end if bit.band(r,0x41)~=0x41 or not c:IsPreviousPosition(POS_FACEUP) or not c:IsPreviousLocation(LOCATION_ONFIELD) then return end
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY then if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_STANDBY then
e:SetLabel(Duel.GetTurnCount()) e:SetLabel(Duel.GetTurnCount())
c:RegisterFlagEffect(62953041,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,2) c:RegisterFlagEffect(62953041,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,2)
......
...@@ -13,13 +13,13 @@ function c65303664.initial_effect(c) ...@@ -13,13 +13,13 @@ function c65303664.initial_effect(c)
e1:SetOperation(c65303664.operation) e1:SetOperation(c65303664.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c65303664.cfilter(c) function c65303664.cfilter(c,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsType(TYPE_MONSTER) and c:IsRace(RACE_BEAST) and c:IsReason(REASON_BATTLE) return c:IsLocation(LOCATION_GRAVE) and c:IsType(TYPE_MONSTER) and c:IsRace(RACE_BEAST) and c:IsReason(REASON_BATTLE)
and c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp
and bit.band(c:GetPreviousRaceOnField(),RACE_BEAST)~=0 and bit.band(c:GetPreviousRaceOnField(),RACE_BEAST)~=0
end end
function c65303664.condition(e,tp,eg,ep,ev,re,r,rp) function c65303664.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c65303664.cfilter,1,nil) return eg:IsExists(c65303664.cfilter,1,nil,tp)
end end
function c65303664.rfiletr(c) function c65303664.rfiletr(c)
return c:IsRace(RACE_BEAST) and c:IsAbleToRemoveAsCost() return c:IsRace(RACE_BEAST) and c:IsAbleToRemoveAsCost()
......
...@@ -38,6 +38,7 @@ function c6614221.valcheck(e,c) ...@@ -38,6 +38,7 @@ function c6614221.valcheck(e,c)
tc=g:GetNext() tc=g:GetNext()
end end
if e:GetLabel()==1 then if e:GetLabel()==1 then
e:SetLabel(0)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK) e1:SetCode(EFFECT_SET_ATTACK)
......
...@@ -26,6 +26,35 @@ function c70902743.initial_effect(c) ...@@ -26,6 +26,35 @@ function c70902743.initial_effect(c)
e2:SetTarget(c70902743.target2) e2:SetTarget(c70902743.target2)
e2:SetOperation(c70902743.operation2) e2:SetOperation(c70902743.operation2)
c:RegisterEffect(e2) c:RegisterEffect(e2)
if not c70902743.global_check then
c70902743.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ATTACK_ANNOUNCE)
ge1:SetOperation(c70902743.check)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_ATTACK_DISABLED)
ge2:SetOperation(c70902743.check2)
Duel.RegisterEffect(ge2,0)
end
end
function c70902743.check(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local ct=tc:GetFlagEffectLabel(70902743)
if ct then
tc:SetFlagEffectLabel(70902743,ct+1)
else
tc:RegisterFlagEffect(70902743,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1,1)
end
end
function c70902743.check2(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local ct=tc:GetFlagEffectLabel(70902743)
if ct then
tc:SetFlagEffectLabel(70902743,ct-1)
end
end end
function c70902743.condition1(e,tp,eg,ep,ev,re,r,rp) function c70902743.condition1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttacker()==e:GetHandler() and Duel.GetAttackTarget() and not Duel.GetAttackTarget():IsAttackPos() return Duel.GetAttacker()==e:GetHandler() and Duel.GetAttackTarget() and not Duel.GetAttackTarget():IsAttackPos()
...@@ -43,7 +72,8 @@ function c70902743.operation1(e,tp,eg,ep,ev,re,r,rp) ...@@ -43,7 +72,8 @@ function c70902743.operation1(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(g,REASON_EFFECT) Duel.Destroy(g,REASON_EFFECT)
end end
function c70902743.filter2(c) function c70902743.filter2(c)
return c:GetAttackAnnouncedCount()==0 and c:IsDestructable() local ct=c:GetFlagEffectLabel(70902743)
return (not ct or ct==0) and c:IsDestructable()
end end
function c70902743.condition2(e,tp,eg,ep,ev,re,r,rp) function c70902743.condition2(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() return tp==Duel.GetTurnPlayer()
......
...@@ -13,7 +13,8 @@ function c7092142.initial_effect(c) ...@@ -13,7 +13,8 @@ function c7092142.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c7092142.cfilter(c,tp) function c7092142.cfilter(c,tp)
return c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp and c:IsAttribute(ATTRIBUTE_WATER) return c:IsReason(REASON_DESTROY) and c:IsPreviousLocation(LOCATION_MZONE) and c:GetPreviousControler()==tp and c:IsPreviousPosition(POS_FACEUP)
and c:IsAttribute(ATTRIBUTE_WATER) and bit.band(c:GetPreviousAttributeOnField(),ATTRIBUTE_WATER)~=0
end end
function c7092142.condition(e,tp,eg,ep,ev,re,r,rp) function c7092142.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c7092142.cfilter,1,nil,tp) return eg:IsExists(c7092142.cfilter,1,nil,tp)
......
...@@ -6,57 +6,63 @@ function c71645242.initial_effect(c) ...@@ -6,57 +6,63 @@ function c71645242.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--token --token
local g=Group.CreateGroup()
g:KeepAlive()
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(71645242,0)) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_SUMMON_SUCCESS) e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCondition(c71645242.spcon) e2:SetCondition(c71645242.regcon)
e2:SetTarget(c71645242.sptg) e2:SetOperation(c71645242.regop)
e2:SetOperation(c71645242.spop)
e2:SetLabelObject(g)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=e2:Clone() local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS) e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetLabelObject(g)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(71645242,1)) e4:SetDescription(aux.Stringid(71645242,0))
e4:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON) e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET) e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE) e4:SetRange(LOCATION_SZONE)
e4:SetTarget(c71645242.sptg2) e4:SetCode(71645242)
e4:SetOperation(c71645242.spop2) e4:SetTarget(c71645242.sptg)
e4:SetOperation(c71645242.spop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
--special summon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(71645242,1))
e5:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_SZONE)
e5:SetTarget(c71645242.sptg2)
e5:SetOperation(c71645242.spop2)
c:RegisterEffect(e5)
end end
function c71645242.spcon(e,tp,eg,ep,ev,re,r,rp) function c71645242.regcon(e,tp,eg,ep,ev,re,r,rp)
if eg:GetFirst():GetSummonType()~=SUMMON_TYPE_SPECIAL+0x20 then if eg:GetFirst():GetSummonType()~=SUMMON_TYPE_SPECIAL+0x20 then
e:GetLabelObject():Clear() local sf=0
e:GetLabelObject():Merge(eg) if eg:IsExists(Card.IsControler,1,nil,tp) then
sf=sf+1
end
if eg:IsExists(Card.IsControler,1,nil,1-tp) then
sf=sf+2
end
e:SetLabel(sf)
return true return true
else return false end else return false end
end end
function c71645242.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RaiseEvent(eg,71645242,e,r,rp,ep,e:GetLabel())
end
function c71645242.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c71645242.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING) end if chk==0 then return true end
Duel.SetTargetCard(e:GetLabelObject()) Duel.SetTargetCard(eg)
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)
end end
function c71645242.spop(e,tp,eg,ep,ev,re,r,rp) function c71645242.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e) local g=eg:Filter(Card.IsRelateToEffect,nil,e)
local tc=g:GetFirst() local tc=g:GetFirst()
if not tc then return end
local s0=false
local s1=false
while tc do while tc do
if tc:IsControler(tp) then s0=true
else s1=true end
if tc:IsFaceup() then if tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
...@@ -67,12 +73,12 @@ function c71645242.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -67,12 +73,12 @@ function c71645242.spop(e,tp,eg,ep,ev,re,r,rp)
end end
tc=g:GetNext() tc=g:GetNext()
end end
if s0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 if bit.band(ev,0x1)~=0 and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,71645243,0,0x4011,800,800,2,RACE_PLANT,ATTRIBUTE_DARK,POS_FACEUP_ATTACK,1-tp) then and Duel.IsPlayerCanSpecialSummonMonster(tp,71645243,0,0x4011,800,800,2,RACE_PLANT,ATTRIBUTE_DARK,POS_FACEUP_ATTACK,1-tp) then
local token=Duel.CreateToken(tp,71645243) local token=Duel.CreateToken(tp,71645243)
Duel.SpecialSummonStep(token,0x20,tp,1-tp,false,false,POS_FACEUP_ATTACK) Duel.SpecialSummonStep(token,0x20,tp,1-tp,false,false,POS_FACEUP_ATTACK)
end end
if s1 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if bit.band(ev,0x2)~=0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,71645243,0,0x4011,800,800,2,RACE_PLANT,ATTRIBUTE_DARK) then and Duel.IsPlayerCanSpecialSummonMonster(tp,71645243,0,0x4011,800,800,2,RACE_PLANT,ATTRIBUTE_DARK) then
local token=Duel.CreateToken(1-tp,71645243) local token=Duel.CreateToken(1-tp,71645243)
Duel.SpecialSummonStep(token,0x20,tp,tp,false,false,POS_FACEUP_ATTACK) Duel.SpecialSummonStep(token,0x20,tp,tp,false,false,POS_FACEUP_ATTACK)
......
...@@ -81,7 +81,7 @@ end ...@@ -81,7 +81,7 @@ end
function c74115234.retcon(e,tp,eg,ep,ev,re,r,rp) function c74115234.retcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local ec=c:GetPreviousEquipTarget() local ec=c:GetPreviousEquipTarget()
return c:IsReason(REASON_LOST_TARGET) and (ec:GetLocation()==LOCATION_HAND) return c:IsReason(REASON_LOST_TARGET) and ec and ec:IsLocation(LOCATION_HAND) and ec:GetPreviousControler()==tp
end end
function c74115234.rettg(e,tp,eg,ep,ev,re,r,rp,chk) function c74115234.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end if chk==0 then return e:GetHandler():IsAbleToHand() end
......
...@@ -71,7 +71,6 @@ function c74506079.regop(e,tp,eg,ep,ev,re,r,rp) ...@@ -71,7 +71,6 @@ function c74506079.regop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c74506079.tgcost) e1:SetCost(c74506079.tgcost)
e1:SetTarget(c74506079.tgtg) e1:SetTarget(c74506079.tgtg)
e1:SetOperation(c74506079.tgop) e1:SetOperation(c74506079.tgop)
......
...@@ -24,6 +24,8 @@ function c74841885.chkfilter(c,rac,att) ...@@ -24,6 +24,8 @@ function c74841885.chkfilter(c,rac,att)
return c:IsRace(rac) and c:IsAttribute(att) return c:IsRace(rac) and c:IsAttribute(att)
end end
function c74841885.valcheck(e,c) function c74841885.valcheck(e,c)
if e:GetLabel()~=1 then return end
e:SetLabel(0)
local g=c:GetMaterial() local g=c:GetMaterial()
local lbl=0 local lbl=0
if g:IsExists(c74841885.chkfilter,1,nil,RACE_FAIRY,ATTRIBUTE_LIGHT) then if g:IsExists(c74841885.chkfilter,1,nil,RACE_FAIRY,ATTRIBUTE_LIGHT) then
...@@ -32,7 +34,7 @@ function c74841885.valcheck(e,c) ...@@ -32,7 +34,7 @@ function c74841885.valcheck(e,c)
if g:IsExists(c74841885.chkfilter,1,nil,RACE_FIEND,ATTRIBUTE_DARK) then if g:IsExists(c74841885.chkfilter,1,nil,RACE_FIEND,ATTRIBUTE_DARK) then
lbl=lbl+TYPE_TRAP lbl=lbl+TYPE_TRAP
end end
if e:GetLabel()==1 and lbl~=0 then if lbl~=0 then
--disable --disable
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
if lbl==TYPE_SPELL then if lbl==TYPE_SPELL then
......
--ゴーストリック・アルカード
function c75367227.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunction(c,3),2)
c:EnableReviveLimit()
--cannot be battle target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetTarget(c75367227.tg)
e1:SetValue(1)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DESTROY)
e2:SetDescription(aux.Stringid(75367227,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c75367227.descost)
e2:SetTarget(c75367227.destg)
e2:SetOperation(c75367227.desop)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND)
e3:SetDescription(aux.Stringid(75367227,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetTarget(c75367227.thtg)
e3:SetOperation(c75367227.thop)
c:RegisterEffect(e3)
end
function c75367227.tg(e,c)
return c~=e:GetHandler() and (c:IsFacedown() or c:IsSetCard(0x8d))
end
function c75367227.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,75367227)==0 and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.RegisterFlagEffect(tp,75367227,RESET_PHASE+PHASE_END,0,1)
end
function c75367227.desfilter(c)
return c:IsFacedown() and c:IsDestructable()
end
function c75367227.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) and c75367227.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c75367227.desfilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c75367227.desfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c75367227.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c75367227.filter(c)
return c:IsSetCard(0x8d) and c:IsAbleToHand()
end
function c75367227.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c75367227.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c75367227.filter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c75367227.filter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c75367227.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--土地鋸
function c77428945.initial_effect(c)
--position
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(77428945,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_CHAIN_UNIQUE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCost(c77428945.cost)
e1:SetTarget(c77428945.target)
e1:SetOperation(c77428945.operation)
c:RegisterEffect(e1)
end
function c77428945.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,77428945)==0 end
Duel.RegisterFlagEffect(tp,77428945,RESET_PHASE+PHASE_END,0,1)
end
function c77428945.filter(c)
return c:IsFaceup() and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)~=0
end
function c77428945.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(c77428945.filter,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function c77428945.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c77428945.filter,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
Duel.ChangePosition(g,POS_FACEDOWN_DEFENCE)
end
--姫葵マリーナ
function c78540593.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(78540593,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c78540593.descon)
e1:SetTarget(c78540593.destg)
e1:SetOperation(c78540593.desop)
c:RegisterEffect(e1)
end
function c78540593.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return eg:GetCount()==1 and tc:IsReason(REASON_DESTROY) and tc:IsPreviousLocation(LOCATION_MZONE)
and tc:GetPreviousControler()==tp and bit.band(tc:GetPreviousRaceOnField(),RACE_PLANT)~=0
end
function c78540593.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and chkc:IsDestructable() end
if chk==0 then return e:GetHandler():IsRelateToEffect(e) and Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c78540593.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
--ヴァンパイア・キラー
function c80485722.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(80485722,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_START)
e1:SetTarget(c80485722.destg)
e1:SetOperation(c80485722.desop)
c:RegisterEffect(e1)
end
function c80485722.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=Duel.GetAttacker()
if tc==c then tc=Duel.GetAttackTarget() end
if chk==0 then return tc and tc:IsFaceup() and tc:IsAttribute(ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,0,0)
end
function c80485722.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetAttacker()
if tc==c then tc=Duel.GetAttackTarget() end
if tc:IsRelateToBattle() then Duel.Destroy(tc,REASON_EFFECT) end
end
--ゴーストリックの雪女 --ゴーストリック・キョンシー
function c80885284.initial_effect(c) function c80885284.initial_effect(c)
--summon limit --summon limit
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -20,7 +20,7 @@ function c80885284.initial_effect(c) ...@@ -20,7 +20,7 @@ function c80885284.initial_effect(c)
e3:SetDescription(aux.Stringid(80885284,1)) e3:SetDescription(aux.Stringid(80885284,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CHAIN_UNIQUE) e3:SetProperty(EFFECT_FLAG_CHAIN_UNIQUE+EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_FLIP) e3:SetCode(EVENT_FLIP)
e3:SetCost(c80885284.thcost) e3:SetCost(c80885284.thcost)
e3:SetTarget(c80885284.thtg) e3:SetTarget(c80885284.thtg)
......
...@@ -24,6 +24,7 @@ function c8794435.valcheck(e,c) ...@@ -24,6 +24,7 @@ function c8794435.valcheck(e,c)
tc=g:GetNext() tc=g:GetNext()
end end
if e:GetLabel()==1 then if e:GetLabel()==1 then
e:SetLabel(0)
--atk continuous effect --atk continuous effect
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
......
...@@ -66,6 +66,7 @@ function c88071625.valcheck(e,c) ...@@ -66,6 +66,7 @@ function c88071625.valcheck(e,c)
tc=g:GetNext() tc=g:GetNext()
end end
if e:GetLabel()==1 then if e:GetLabel()==1 then
e:SetLabel(0)
--atk continuous effect --atk continuous effect
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
......
--ヴァンパイア・ソーサラー
function c88728507.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88728507,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c88728507.condition)
e1:SetTarget(c88728507.target)
e1:SetOperation(c88728507.operation)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(88728507,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(c88728507.sumcost)
e2:SetOperation(c88728507.sumop)
c:RegisterEffect(e2)
end
function c88728507.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and e:GetHandler():GetPreviousControler()==tp
end
function c88728507.filter(c)
return c:IsSetCard(0x8e) and (c:IsType(TYPE_SPELL+TYPE_TRAP) or c:IsAttribute(ATTRIBUTE_DARK)) and c:IsAbleToHand()
end
function c88728507.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c88728507.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c88728507.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c88728507.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c88728507.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c88728507.sumop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,88728507)==0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(88728507,2))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c88728507.ntcon)
e1:SetTarget(c88728507.nttg)
e1:SetOperation(c88728507.ntop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,88728507,RESET_PHASE+PHASE_END,0,1)
end
end
function c88728507.ntcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c88728507.nttg(e,c)
return c:IsLevelAbove(5) and c:IsSetCard(0x8e) and c:IsAttribute(ATTRIBUTE_DARK)
end
function c88728507.ntop(e,tp,eg,ep,ev,re,r,rp,c)
e:Reset()
end
--ナチュラル・ボーン・サウルス
function c89362180.initial_effect(c)
aux.EnableDualAttribute(c)
--prop change
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(aux.IsDualState)
e1:SetValue(ATTRIBUTE_EARTH)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_CHANGE_RACE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(aux.IsDualState)
e2:SetValue(RACE_DINOSAUR)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(89362180,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetCode(EVENT_BATTLE_DESTROYING)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCondition(c89362180.spcon)
e3:SetTarget(c89362180.sptg)
e3:SetOperation(c89362180.spop)
c:RegisterEffect(e3)
end
function c89362180.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsDualState() then return false end
local bc=c:GetBattleTarget()
if not c:IsRelateToBattle() or c:IsFacedown() then return false end
return bc:IsLocation(LOCATION_GRAVE) and bc:IsType(TYPE_MONSTER)
end
function c89362180.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local bc=e:GetHandler():GetBattleTarget()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and bc:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetTargetCard(bc)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,bc,1,0,LOCATION_GRAVE)
end
function c89362180.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENCE)>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetValue(RACE_ZOMBIE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
end
...@@ -19,8 +19,9 @@ function c89662736.nacon(e,tp,eg,ep,ev,re,r,rp) ...@@ -19,8 +19,9 @@ function c89662736.nacon(e,tp,eg,ep,ev,re,r,rp)
return at:IsControler(tp) and at:IsFaceup() and at:IsSetCard(0x88) and at:IsRace(RACE_BEASTWARRIOR) return at:IsControler(tp) and at:IsFaceup() and at:IsSetCard(0x88) and at:IsRace(RACE_BEASTWARRIOR)
end end
function c89662736.nacost(e,tp,eg,ep,ev,re,r,rp,chk) function c89662736.nacost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end if chk==0 then return Duel.GetFlagEffect(tp,89662736)==0 and e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST) Duel.SendtoGrave(e:GetHandler(),REASON_COST)
Duel.RegisterFlagEffect(tp,89662736,RESET_PHASE+PHASE_END,0,1)
end end
function c89662736.natg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c89662736.natg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
......
...@@ -6,6 +6,7 @@ function c91842653.initial_effect(c) ...@@ -6,6 +6,7 @@ function c91842653.initial_effect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION) e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c91842653.splimit)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--special summon --special summon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -58,6 +59,9 @@ function c91842653.initial_effect(c) ...@@ -58,6 +59,9 @@ function c91842653.initial_effect(c)
e8:SetOperation(c91842653.atop) e8:SetOperation(c91842653.atop)
c:RegisterEffect(e8) c:RegisterEffect(e8)
end end
function c91842653.splimit(e,se,sp,st,spos,tgp)
return Duel.IsExistingMatchingCard(c91842653.cfilter,tgp,LOCATION_ONFIELD,0,1,nil)
end
function c91842653.cfilter(c) function c91842653.cfilter(c)
return c:IsFaceup() and c:IsCode(15259703) return c:IsFaceup() and c:IsCode(15259703)
end end
......
...@@ -4,7 +4,7 @@ function c93830681.initial_effect(c) ...@@ -4,7 +4,7 @@ function c93830681.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(93830681,0)) e1:SetDescription(aux.Stringid(93830681,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CHAIN_UNIQUE)
e1:SetCode(EVENT_BE_BATTLE_TARGET) e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetRange(LOCATION_GRAVE) e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(c93830681.condition) e1:SetCondition(c93830681.condition)
......
--ゴーストリック・ハウス
function c99795159.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetCode(EFFECT_IGNORE_BATTLE_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c99795159.cfilter)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EFFECT_CHANGE_DAMAGE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,1)
e3:SetValue(c99795159.val)
c:RegisterEffect(e3)
end
function c99795159.cfilter(e,c)
return c:IsFacedown()
end
function c99795159.val(e,re,dam,r,rp,rc)
if bit.band(r,REASON_EFFECT)~=0 or (rc and not rc:IsSetCard(0x8d)) then
return dam/2
else return dam end
end
...@@ -419,3 +419,4 @@ ...@@ -419,3 +419,4 @@
!counter 0x2c 遵命指示物 !counter 0x2c 遵命指示物
!counter 0x2d 指示物(踢火) !counter 0x2d 指示物(踢火)
!counter 0x2e 鲨指示物 !counter 0x2e 鲨指示物
!counter 0x2f 南瓜指示物
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