Commit 79dc2d3b authored by argon.sun's avatar argon.sun

fix & new scripts

parent 551543f8
...@@ -36,6 +36,8 @@ effect::effect() { ...@@ -36,6 +36,8 @@ effect::effect() {
label_object = 0; label_object = 0;
hint_timing[0] = 0; hint_timing[0] = 0;
hint_timing[1] = 0; hint_timing[1] = 0;
field_ref = 0;
status = 0;
condition = 0; condition = 0;
cost = 0; cost = 0;
target = 0; target = 0;
...@@ -98,13 +100,17 @@ int32 effect::is_available() { ...@@ -98,13 +100,17 @@ int32 effect::is_available() {
return FALSE; return FALSE;
} }
} }
if (condition) { if (!condition)
pduel->lua->add_param(this, PARAM_TYPE_EFFECT); return TRUE;
if(!pduel->lua->check_condition(condition, 1)) { pduel->lua->add_param(this, PARAM_TYPE_EFFECT);
return FALSE; int32 res = pduel->lua->check_condition(condition, 1);
} if(res) {
} if(!(status & EFFECT_STATUS_AVAILABLE))
return TRUE; id = pduel->game_field->infos.effect_id++;
status |= EFFECT_STATUS_AVAILABLE;
} else
status &= ~EFFECT_STATUS_AVAILABLE;
return res;
} }
int32 effect::is_activateable(uint8 playerid, tevent& e, int32 neglect_cond, int32 neglect_cost, int32 neglect_target) { int32 effect::is_activateable(uint8 playerid, tevent& e, int32 neglect_cond, int32 neglect_cost, int32 neglect_target) {
if(!(type & EFFECT_TYPE_ACTIONS)) if(!(type & EFFECT_TYPE_ACTIONS))
...@@ -208,6 +214,11 @@ int32 effect::is_action_check(uint8 playerid) { ...@@ -208,6 +214,11 @@ int32 effect::is_action_check(uint8 playerid) {
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT); pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(this, PARAM_TYPE_EFFECT); pduel->lua->add_param(this, PARAM_TYPE_EFFECT);
pduel->lua->add_param(playerid, PARAM_TYPE_INT); pduel->lua->add_param(playerid, PARAM_TYPE_INT);
if(!pduel->lua->check_condition(eset[i]->target, 3))
continue;
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(this, PARAM_TYPE_EFFECT);
pduel->lua->add_param(playerid, PARAM_TYPE_INT);
if(!pduel->lua->check_condition(eset[i]->cost, 3)) if(!pduel->lua->check_condition(eset[i]->cost, 3))
return FALSE; return FALSE;
} }
......
...@@ -48,6 +48,8 @@ public: ...@@ -48,6 +48,8 @@ public:
uint32 label; uint32 label;
uint32 hint_timing[2]; uint32 hint_timing[2];
uint32 card_type; uint32 card_type;
uint16 field_ref;
uint16 status;
void* label_object; void* label_object;
int32 condition; int32 condition;
int32 cost; int32 cost;
...@@ -82,6 +84,9 @@ public: ...@@ -82,6 +84,9 @@ public:
uint8 get_handler_player(); uint8 get_handler_player();
}; };
//status
#define EFFECT_STATUS_AVAILABLE 0x0001
//========== Reset ========== //========== Reset ==========
#define RESET_DRAW PHASE_DRAW #define RESET_DRAW PHASE_DRAW
#define RESET_STANDBY PHASE_STANDBY #define RESET_STANDBY PHASE_STANDBY
......
...@@ -1638,6 +1638,8 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) { ...@@ -1638,6 +1638,8 @@ int32 field::special_summon_rule(uint16 step, uint8 sumplayer, card * target) {
if(core.current_chain.size() == 0) { if(core.current_chain.size() == 0) {
if(target->is_affected_by_effect(EFFECT_CANNOT_DISABLE_SPSUMMON)) if(target->is_affected_by_effect(EFFECT_CANNOT_DISABLE_SPSUMMON))
core.units.begin()->step = 14; core.units.begin()->step = 14;
else
core.units.begin()->step = 9;
return FALSE; return FALSE;
} else if(core.current_chain.size() > 1) { } else if(core.current_chain.size() > 1) {
core.units.begin()->step = 14; core.units.begin()->step = 14;
......
...@@ -3597,6 +3597,11 @@ int32 field::add_chain(uint16 step) { ...@@ -3597,6 +3597,11 @@ int32 field::add_chain(uint16 step) {
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT); pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(clit->triggering_effect, PARAM_TYPE_EFFECT); pduel->lua->add_param(clit->triggering_effect, PARAM_TYPE_EFFECT);
pduel->lua->add_param(clit->triggering_player, PARAM_TYPE_INT); pduel->lua->add_param(clit->triggering_player, PARAM_TYPE_INT);
if(!pduel->lua->check_condition(eset[i]->target, 3))
continue;
pduel->lua->add_param(eset[i], PARAM_TYPE_EFFECT);
pduel->lua->add_param(clit->triggering_effect, PARAM_TYPE_EFFECT);
pduel->lua->add_param(clit->triggering_player, PARAM_TYPE_INT);
if(!pduel->lua->check_condition(eset[i]->cost, 3)) if(!pduel->lua->check_condition(eset[i]->cost, 3))
continue; continue;
if(eset[i]->operation) { if(eset[i]->operation) {
......
--ブラッド·マジシャン-煉獄の魔術師-
function c21051146.initial_effect(c)
c:EnableCounterPermit(0x3001)
--add counter
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c21051146.acop)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(21051146,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(c21051146.destg)
e2:SetOperation(c21051146.desop)
c:RegisterEffect(e2)
end
function c21051146.acop(e,tp,eg,ep,ev,re,r,rp)
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) then
e:GetHandler():AddCounter(0x3001,1)
end
end
function c21051146.filter(c,cc)
local ct=math.ceil(c:GetAttack()/700)
if ct==0 then ct=1 end
return c:IsFaceup() and c:IsDestructable() and cc:IsCanRemoveCounter(tp,0x3001,ct,REASON_COST)
end
function c21051146.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c21051146.filter(chkc,e:GetHandler()) end
if chk==0 then return Duel.IsExistingTarget(c21051146.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c21051146.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e:GetHandler())
local ct=math.ceil(g:GetFirst():GetAttack()/700)
if ct==0 then ct=1 end
e:GetHandler():RemoveCounter(tp,0x3001,ct,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c21051146.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 c32062913.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c32062913.cost)
e1:SetTarget(c32062913.target)
e1:SetOperation(c32062913.activate)
c:RegisterEffect(e1)
end
function c32062913.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x3001,10,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x3001,10,REASON_COST)
end
function c32062913.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c32062913.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsDestructable,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--漆黒のパワーストーン
function c34029630.initial_effect(c)
--counter permit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_COUNTER_PERMIT+0x3001)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCondition(c34029630.ctpermit)
c:RegisterEffect(e1)
--Activate
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetTarget(c34029630.target)
e2:SetOperation(c34029630.operation)
c:RegisterEffect(e2)
--counter
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(34029630,1))
e3:SetCategory(CATEGORY_COUNTER)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1)
e3:SetTarget(c34029630.target2)
e3:SetOperation(c34029630.operation)
c:RegisterEffect(e3)
--self destroy
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EFFECT_SELF_DESTROY)
e4:SetCondition(c34029630.descon)
c:RegisterEffect(e4)
end
function c34029630.ctpermit(e)
local c=e:GetHandler()
if not c:IsLocation(LOCATION_SZONE) then return false end
return not c:IsStatus(STATUS_EFFECT_ENABLED) or not c:IsStatus(STATUS_DISABLED)
end
function c34029630.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c34029630.filter(chkc) end
if chk==0 then return true end
local c=e:GetHandler()
c:AddCounter(0x3001,3)
if c:IsCanRemoveCounter(tp,0x3001,1,REASON_EFFECT)
and Duel.IsExistingTarget(c34029630.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler())
and Duel.SelectYesNo(tp,aux.Stringid(34029630,0)) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(34029630,2))
Duel.SelectTarget(tp,c34029630.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
e:GetHandler():RegisterFlagEffect(34029630,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
else
e:SetProperty(0)
end
end
function c34029630.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and c:IsCanRemoveCounter(tp,0x3001,1,REASON_EFFECT) and tc:IsCanAddCounter(0x3001,1) then
c:RemoveCounter(tp,0x3001,1,REASON_EFFECT)
tc:AddCounter(0x3001,1)
end
end
function c34029630.filter(c)
return c:IsFaceup() and c:IsCanAddCounter(0x3001,1)
end
function c34029630.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c34029630.filter(chkc) end
if chk==0 then return e:GetHandler():GetFlagEffect(34029630)==0 and e:GetHandler():IsCanRemoveCounter(tp,0x3001,1,REASON_EFFECT)
and Duel.IsExistingTarget(c34029630.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(34029630,2))
Duel.SelectTarget(tp,c34029630.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
end
function c34029630.descon(e)
return e:GetHandler():GetCounter(0x3001)==0
end
\ No newline at end of file
...@@ -13,6 +13,7 @@ function c38318146.initial_effect(c) ...@@ -13,6 +13,7 @@ function c38318146.initial_effect(c)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1) e2:SetTargetRange(0,1)
e2:SetTarget(c38318146.actarget)
e2:SetCost(c38318146.accost) e2:SetCost(c38318146.accost)
e2:SetOperation(c38318146.acop) e2:SetOperation(c38318146.acop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -25,10 +26,12 @@ end ...@@ -25,10 +26,12 @@ end
function c38318146.acfilter(c) function c38318146.acfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToGraveAsCost() return c:IsType(TYPE_SPELL) and c:IsAbleToGraveAsCost()
end end
function c38318146.actarget(e,te,tp)
te:GetHandler():IsType(TYPE_SPELL) and te:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c38318146.accost(e,te,tp) function c38318146.accost(e,te,tp)
c38318146[0]=false c38318146[0]=false
return te:GetHandler():IsType(TYPE_SPELL) and te:IsHasType(EFFECT_TYPE_ACTIVATE) return Duel.IsExistingMatchingCard(c38318146.acfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(c38318146.acfilter,tp,LOCATION_DECK,0,1,nil)
end end
function c38318146.acop(e,tp,eg,ep,ev,re,r,rp) function c38318146.acop(e,tp,eg,ep,ev,re,r,rp)
if c38318146[0] then return end if c38318146[0] then return end
......
...@@ -36,15 +36,14 @@ function c39910367.initial_effect(c) ...@@ -36,15 +36,14 @@ function c39910367.initial_effect(c)
--Add counter2 --Add counter2
local e6=Effect.CreateEffect(c) local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD) e6:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e6:SetCode(EVENT_DESTROY) e6:SetCode(EVENT_LEAVE_FIELD)
e6:SetRange(LOCATION_SZONE) e6:SetRange(LOCATION_SZONE)
e6:SetOperation(c39910367.addop2) e6:SetOperation(c39910367.addop2)
c:RegisterEffect(e6) c:RegisterEffect(e6)
end end
function c39910367.op(e,tp,eg,ep,ev,re,r,rp) function c39910367.op(e,tp,eg,ep,ev,re,r,rp)
local te=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT) local c=re:GetHandler()
local c=te:GetHandler() if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) and c:GetSequence()~=5 then
if te:IsHasType(EFFECT_TYPE_ACTIVATE) and c:IsType(TYPE_SPELL) and c:GetSequence()~=5 then
e:GetHandler():AddCounter(0x3001,1) e:GetHandler():AddCounter(0x3001,1)
end end
end end
...@@ -66,7 +65,9 @@ function c39910367.addop2(e,tp,eg,ep,ev,re,r,rp) ...@@ -66,7 +65,9 @@ function c39910367.addop2(e,tp,eg,ep,ev,re,r,rp)
local count=0 local count=0
local c=eg:GetFirst() local c=eg:GetFirst()
while c~=nil do while c~=nil do
if not c:IsCode(39910367) then count=count+c:GetCounter(0x3001) end if not c:IsCode(39910367) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_DESTROY) then
count=count+c:GetCounter(0x3001)
end
c=eg:GetNext() c=eg:GetNext()
end end
if count>0 then if count>0 then
......
--アポカテクイル
function c41158734.initial_effect(c)
--level change
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetCondition(c41158734.lvcon)
e1:SetValue(5)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetDescription(aux.Stringid(41158734,0))
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c41158734.spcon)
e2:SetTarget(c41158734.sptg)
e2:SetOperation(c41158734.spop)
c:RegisterEffect(e2)
end
function c41158734.lvfilter(c)
return c:IsFaceup() and c:IsType(TYPE_TUNER)
end
function c41158734.lvcon(e)
return Duel.IsExistingMatchingCard(c41158734.lvfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function c41158734.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and e:GetHandler():IsReason(REASON_DESTROY)
end
function c41158734.spfilter(c,e,tp)
return c:IsCode(42280216) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c41158734.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c41158734.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c41158734.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c41158734.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c41158734.spop(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)
end
end
--闇紅の魔導師
function c45462639.initial_effect(c)
c:EnableCounterPermit(0x3001)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(45462639,0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c45462639.addct)
e1:SetOperation(c45462639.addc)
c:RegisterEffect(e1)
--add counter
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetOperation(c45462639.acop)
c:RegisterEffect(e2)
--attackup
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(c45462639.attackup)
c:RegisterEffect(e3)
--destroy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(45462639,1))
e4:SetCategory(CATEGORY_HANDES)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCost(c45462639.descost)
e4:SetTarget(c45462639.destarg)
e4:SetOperation(c45462639.desop)
c:RegisterEffect(e4)
end
function c45462639.addct(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,2,0,0x3001)
end
function c45462639.addc(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x3001,2)
end
end
function c45462639.acop(e,tp,eg,ep,ev,re,r,rp)
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) then
e:GetHandler():AddCounter(0x3001,1)
end
end
function c45462639.attackup(e,c)
return c:GetCounter(0x3001)*300
end
function c45462639.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x3001,2,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x3001,2,REASON_COST)
end
function c45462639.destarg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_HANDES,0,0,1-tp,1)
end
function c45462639.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND,nil)
if g:GetCount()==0 then return end
local sg=g:RandomSelect(1-tp,1)
Duel.SendtoGrave(sg,REASON_DISCARD+REASON_EFFECT)
end
...@@ -22,8 +22,7 @@ function c46363422.initial_effect(c) ...@@ -22,8 +22,7 @@ function c46363422.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c46363422.acop(e,tp,eg,ep,ev,re,r,rp) function c46363422.acop(e,tp,eg,ep,ev,re,r,rp)
local c=re:GetHandler() if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) then
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and c:IsType(TYPE_SPELL) then
e:GetHandler():AddCounter(0x3001,1) e:GetHandler():AddCounter(0x3001,1)
end end
end end
......
--クリボン
function c47432275.initial_effect(c)
--be target
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(47432275,0))
e1:SetCategory(CATEGORY_RECOVER+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O+EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetCountLimit(1)
e1:SetCondition(c47432275.con)
e1:SetTarget(c47432275.target)
e1:SetOperation(c47432275.op)
c:RegisterEffect(e1)
end
function c47432275.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetAttackTarget()==c and ep==tp
end
function c47432275.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local val=Duel.GetAttacker():GetAttack()
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(val)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,1-tp,val)
end
function c47432275.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.ChangeBattleDamage(ep,0)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
--大波小波
function c51562916.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c51562916.target)
e1:SetOperation(c51562916.activate)
c:RegisterEffect(e1)
end
function c51562916.dfilter(c)
return c:IsFaceup() and c:IsAttribute(ATTRIBUTE_WATER) and c:IsDestructable()
end
function c51562916.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c51562916.dfilter,tp,LOCATION_MZONE,0,1,nil) end
local g=Duel.GetMatchingGroup(c51562916.dfilter,tp,LOCATION_MZONE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c51562916.spfilter(c,e,tp)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c51562916.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c51562916.dfilter,tp,LOCATION_MZONE,0,nil)
local ct=Duel.Destroy(g,REASON_EFFECT)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ct==0 or ft==0 then return end
if ct>ft then ct=ft end
local sg=Duel.GetMatchingGroup(c51562916.spfilter,tp,LOCATION_HAND,0,nil,e,tp)
if sg:GetCount()~=0 and Duel.SelectYesNo(tp,aux.Stringid(51562916,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local spg=sg:Select(tp,1,ct,nil)
Duel.SpecialSummon(spg,0,tp,tp,false,false,POS_FACEUP)
end
end
--対抗魔術
function c53112492.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c53112492.condition)
e1:SetCost(c53112492.cost)
e1:SetTarget(c53112492.target)
e1:SetOperation(c53112492.activate)
c:RegisterEffect(e1)
end
function c53112492.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainInactivatable(ev)
end
function c53112492.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x3001,2,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x3001,2,REASON_COST)
end
function c53112492.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c53112492.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--ħ ٥
function c55424270.initial_effect(c)
c:EnableCounterPermit(0x3001)
--add counter
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c55424270.acop)
c:RegisterEffect(e1)
--attackup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(c55424270.attackup)
c:RegisterEffect(e2)
--remove counter
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_BATTLE)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c55424270.condition)
e3:SetOperation(c55424270.operation)
c:RegisterEffect(e3)
end
function c55424270.acop(e,tp,eg,ep,ev,re,r,rp)
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) then
e:GetHandler():AddCounter(0x3001,1)
end
end
function c55424270.attackup(e,c)
return c:GetCounter(0x3001)*500
end
function c55424270.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetBattledGroupCount()>0
end
function c55424270.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local n=c:GetCounter(0x3001)
if n~=0 then c:RemoveCounter(tp,0x3001,n,REASON_EFFECT) end
end
--ハンニバル·ネクロマンサー
function c5640330.initial_effect(c)
c:EnableCounterPermit(0x3001)
c:SetCounterLimit(0x3001,1)
--summon success
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(5640330,0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c5640330.addct)
e1:SetOperation(c5640330.addc)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(5640330,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCost(c5640330.descost)
e2:SetTarget(c5640330.destg)
e2:SetOperation(c5640330.desop)
c:RegisterEffect(e2)
end
function c5640330.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,0x3001)
end
function c5640330.addc(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
e:GetHandler():AddCounter(0x3001,1)
end
end
function c5640330.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x3001,1,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x3001,1,REASON_COST)
end
function c5640330.filter(c)
return c:IsType(TYPE_TRAP) and c:IsFaceup() and c:IsDestructable()
end
function c5640330.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c5640330.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c5640330.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c5640330.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c5640330.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
...@@ -21,9 +21,7 @@ function c6061630.initial_effect(c) ...@@ -21,9 +21,7 @@ function c6061630.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c6061630.acop(e,tp,eg,ep,ev,re,r,rp) function c6061630.acop(e,tp,eg,ep,ev,re,r,rp)
local te=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT) if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) then
local c=te:GetHandler()
if te:IsHasType(EFFECT_TYPE_ACTIVATE) and c:IsType(TYPE_SPELL) and c~=e:GetHandler() then
e:GetHandler():AddCounter(0x3001,2) e:GetHandler():AddCounter(0x3001,2)
end end
end end
......
...@@ -48,7 +48,7 @@ function c67196946.op(e,tp,eg,ep,ev,re,r,rp) ...@@ -48,7 +48,7 @@ function c67196946.op(e,tp,eg,ep,ev,re,r,rp)
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_UPDATE_LEVEL) e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+0xfe0000) e1:SetReset(RESET_EVENT+0xfe0000+RESET_PHASE+PHASE_END)
e1:SetValue(-ct) e1:SetValue(-ct)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
end end
......
--奇跡の復活
function c68334074.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINT_END_PHASE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCost(c68334074.cost)
e1:SetTarget(c68334074.target)
e1:SetOperation(c68334074.activate)
c:RegisterEffect(e1)
end
function c68334074.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,0,0x3001,2,REASON_COST) end
Duel.RemoveCounter(tp,1,0,0x3001,2,REASON_COST)
end
function c68334074.filter(c,e,tp)
local code=c:GetCode()
return (code==46986414 or code==78193831) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c68334074.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c68334074.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)~=0
and Duel.IsExistingTarget(c68334074.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c68334074.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
end
function c68334074.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
...@@ -23,9 +23,7 @@ function c70791313.initial_effect(c) ...@@ -23,9 +23,7 @@ function c70791313.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c70791313.acop(e,tp,eg,ep,ev,re,r,rp) function c70791313.acop(e,tp,eg,ep,ev,re,r,rp)
local te=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT) if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) then
local c=te:GetHandler()
if te:IsHasType(EFFECT_TYPE_ACTIVATE) and c:IsType(TYPE_SPELL) and c~=e:GetHandler() then
e:GetHandler():AddCounter(0x3001,1) e:GetHandler():AddCounter(0x3001,1)
end end
end end
......
--魔導アーマー エグゼ
function c7180418.initial_effect(c)
--cannot attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetOperation(c7180418.atklimit)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e3)
--cost
e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCode(EVENT_PHASE+PHASE_STANDBY)
e4:SetCountLimit(1)
e4:SetRange(LOCATION_MZONE)
e4:SetOperation(c7180418.ccost)
c:RegisterEffect(e4)
end
function c7180418.atklimit(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1)
end
function c7180418.ccost(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsCanRemoveCounter(tp,1,0,0x3001,1,REASON_COST) and Duel.SelectYesNo(tp,aux.Stringid(7180418,0)) then
Duel.RemoveCounter(tp,1,0,0x3001,1,REASON_COST)
else
Duel.Destroy(e:GetHandler(),REASON_RULE)
end
end
...@@ -22,8 +22,7 @@ function c73752131.initial_effect(c) ...@@ -22,8 +22,7 @@ function c73752131.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c73752131.acop(e,tp,eg,ep,ev,re,r,rp) function c73752131.acop(e,tp,eg,ep,ev,re,r,rp)
local c=re:GetHandler() if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) then
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and c:IsType(TYPE_SPELL) then
e:GetHandler():AddCounter(0x3001,1) e:GetHandler():AddCounter(0x3001,1)
end end
end end
......
--冥界の使者
function c75043725.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(75043725,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c75043725.condition)
e1:SetTarget(c75043725.target)
e1:SetOperation(c75043725.operation)
c:RegisterEffect(e1)
end
function c75043725.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c75043725.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c75043725.filter(c)
return c:IsLevelBelow(3) and c:IsType(TYPE_NORMAL) and c:IsAbleToHand()
end
function c75043725.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g1=Duel.SelectMatchingCard(tp,c75043725.filter,tp,LOCATION_DECK,0,1,1,nil)
local tc1=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_ATOHAND)
local g2=Duel.SelectMatchingCard(1-tp,c75043725.filter,tp,0,LOCATION_DECK,1,1,nil)
local tc2=g2:GetFirst()
g1:Merge(g2)
Duel.SendtoHand(g1,nil,REASON_EFFECT)
if tc1 then Duel.ConfirmCards(1-tp,tc1) end
if tc2 then Duel.ConfirmCards(tp,tc2) end
end
--聖なる解呪師
function c76137614.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(76137614,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c76137614.thcost)
e1:SetTarget(c76137614.thtg)
e1:SetOperation(c76137614.thop)
c:RegisterEffect(e1)
end
function c76137614.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x3001,1,REASON_COST) end
Duel.RemoveCounter(tp,1,1,0x3001,1,REASON_COST)
end
function c76137614.filter(c)
return c:IsType(TYPE_SPELL) and c:IsFaceup() and c:IsAbleToHand()
end
function c76137614.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and c76137614.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c76137614.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,c76137614.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c76137614.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 c7802006.initial_effect(c)
--flip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(7802006,0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP)
e1:SetOperation(c7802006.operation)
c:RegisterEffect(e1)
end
function c7802006.filter(c)
return c:IsFaceup() and c:IsCanAddCounter(0x3001,1)
end
function c7802006.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c7802006.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local tc=g:GetFirst()
while tc do
tc:AddCounter(0x3001,1)
tc=g:GetNext()
end
end
--黒魔力の精製者
function c78121572.initial_effect(c)
--counter
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(78121572,0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c78121572.con)
e1:SetTarget(c78121572.tg)
e1:SetOperation(c78121572.op)
c:RegisterEffect(e1)
end
function c78121572.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPosition(POS_FACEUP_ATTACK)
end
function c78121572.filter(c)
return c:IsFaceup() and c:IsCanAddCounter(0x3001,1)
end
function c78121572.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c78121572.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c78121572.filter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(78121572,1))
local g=Duel.SelectTarget(tp,c78121572.filter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x3001)
end
function c78121572.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and c:IsPosition(POS_FACEUP_ATTACK) then
Duel.ChangePosition(c,POS_FACEUP_DEFENCE)
if tc:IsRelateToEffect(e) then
tc:AddCounter(0x3001,1)
end
end
end
...@@ -12,8 +12,9 @@ function c79323590.initial_effect(c) ...@@ -12,8 +12,9 @@ function c79323590.initial_effect(c)
e2:SetRange(LOCATION_SZONE) e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1) e2:SetTargetRange(1,1)
e2:SetCost(c79323590.accost) e2:SetTarget(c79323590.actarget)
e2:SetOperation(c79323590.acop) e2:SetCost(c79323590.costchk)
e2:SetOperation(c79323590.costop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--summon cost --summon cost
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
...@@ -21,8 +22,8 @@ function c79323590.initial_effect(c) ...@@ -21,8 +22,8 @@ function c79323590.initial_effect(c)
e3:SetCode(EFFECT_SUMMON_COST) e3:SetCode(EFFECT_SUMMON_COST)
e3:SetRange(LOCATION_SZONE) e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_HAND,LOCATION_HAND) e3:SetTargetRange(LOCATION_HAND,LOCATION_HAND)
e3:SetCost(c79323590.ccost) e3:SetCost(c79323590.costchk)
e3:SetOperation(c79323590.acop) e3:SetOperation(c79323590.costop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
local e4=e3:Clone() local e4=e3:Clone()
e4:SetCode(EFFECT_SPSUMMON_COST) e4:SetCode(EFFECT_SPSUMMON_COST)
...@@ -34,13 +35,24 @@ function c79323590.initial_effect(c) ...@@ -34,13 +35,24 @@ function c79323590.initial_effect(c)
local e6=e3:Clone() local e6=e3:Clone()
e6:SetCode(EFFECT_SSET_COST) e6:SetCode(EFFECT_SSET_COST)
c:RegisterEffect(e6) c:RegisterEffect(e6)
--accumulate
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD)
e7:SetCode(0x10000000+79323590)
e7:SetRange(LOCATION_SZONE)
e7:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e7:SetTargetRange(1,1)
c:RegisterEffect(e7)
end end
function c79323590.accost(e,te,tp) function c79323590.actarget(e,te,tp)
return te:GetHandler():IsLocation(LOCATION_HAND) and Duel.CheckLPCost(tp,500) return te:GetHandler():IsLocation(LOCATION_HAND)
end end
function c79323590.ccost(e,c,tp) function c79323590.costchk(e,te_or_c,tp)
c79323590[0]=false
return Duel.CheckLPCost(tp,500) return Duel.CheckLPCost(tp,500)
end end
function c79323590.acop(e,tp,eg,ep,ev,re,r,rp) function c79323590.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.PayLPCost(tp,500) if c79323590[0] then return end
Duel.PayLPCost(tp,Duel.GetFlagEffect(tp,79323590)*500)
c79323590[0]=true
end end
--ゲイシャドウ
function c84055227.initial_effect(c)
c:EnableCounterPermit(0x3001)
--add counter
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(84055227,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetOperation(c84055227.operation)
c:RegisterEffect(e1)
--attackup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(c84055227.attackup)
c:RegisterEffect(e2)
end
function c84055227.operation(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():AddCounter(0x3001,1)
end
function c84055227.attackup(e,c)
return c:GetCounter(0x3001)*200
end
--バベル·タワー
function c94256039.initial_effect(c)
c:EnableCounterPermit(0x3001)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--add counter
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_SZONE)
e2:SetOperation(c94256039.acop)
c:RegisterEffect(e2)
--destroy&damage
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(94256039,0))
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(94256039)
e3:SetTarget(c94256039.damtg)
e3:SetOperation(c94256039.damop)
c:RegisterEffect(e3)
end
function c94256039.acop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_PLAYER)
local c=e:GetHandler()
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) then
c:AddCounter(0x3001,1)
if c:GetCounter(0x3001)==4 then
Duel.RaiseSingleEvent(c,94256039,re,0,0,p,0)
end
end
end
function c94256039.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,ep,3000)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function c94256039.damop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.Destroy(e:GetHandler(),REASON_EFFECT)~=0 then
Duel.Damage(ep,3000,REASON_EFFECT)
end
end
--魔力枯渇
function c95451366.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c95451366.target)
e1:SetOperation(c95451366.activate)
c:RegisterEffect(e1)
end
function c95451366.taget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x3001,1,REASON_EFFECT) end
end
function c95451366.filter(c)
return c:IsFaceup() and c:GetCounter(0x3001)~=0
end
function c95451366.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c95451366.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local tc=g:GetFirst()
while tc do
local cc=tc:GetCounter(0x3001)
tc:RemoveCounter(tp,0x3001,cc,REASON_EFFECT)
tc=g:GetNext()
end
end
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