Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update act in hand/set turn #1276

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions c23002292.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,16 @@ function c23002292.initial_effect(c)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(23002292,0))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetOperation(c23002292.handop)
c:RegisterEffect(e2)
end
function c23002292.condition(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsHasType(EFFECT_TYPE_ACTIVATE)
and re:IsActiveType(TYPE_TRAP) and Duel.IsChainNegatable(ev)
end
function c23002292.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:GetHandler():IsStatus(STATUS_ACT_FROM_HAND) then
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
end
function c23002292.setfilter(c)
return c:IsType(TYPE_TRAP) and c:IsSSetable(true)
end
Expand Down Expand Up @@ -59,3 +55,6 @@ end
function c23002292.aclimit(e,re,tp)
return re:GetHandler():IsType(TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function c23002292.handop(e,tp,eg,ep,ev,re,r,rp)
Duel.PayLPCost(tp,math.floor(Duel.GetLP(tp)/2))
end
1 change: 1 addition & 0 deletions c29762407.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ function c29762407.initial_effect(c)
c:RegisterEffect(e1)
--Trap activate in set turn
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29762407,1))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
Expand Down
1 change: 1 addition & 0 deletions c68018709.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
function c68018709.initial_effect(c)
--act qp in hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(68018709,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e1:SetRange(LOCATION_MZONE)
Expand Down
1 change: 1 addition & 0 deletions c80075749.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function c80075749.condition(e,tp,eg,ep,ev,re,r,rp)
end
function c80075749.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(80075749,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e1:SetTargetRange(LOCATION_HAND,0)
Expand Down
30 changes: 6 additions & 24 deletions c85551711.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,18 @@ function c85551711.initial_effect(c)
c:EnableReviveLimit()
--act qp/trap in hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(85551711,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetCondition(c85551711.handcon)
e1:SetCost(c85551711.handcost)
e1:SetOperation(c85551711.handop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(85551711)
c:RegisterEffect(e3)
--activate cost
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_ACTIVATE_COST)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,0)
e4:SetCost(c85551711.costchk)
e4:SetTarget(c85551711.costtg)
e4:SetOperation(c85551711.costop)
c:RegisterEffect(e4)
--spsummon
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
Expand All @@ -42,23 +31,16 @@ end
function c85551711.handcon(e)
return Duel.GetTurnPlayer()~=e:GetHandlerPlayer() and e:GetHandler():GetOverlayCount()~=0
end
function c85551711.costtg(e,te,tp)
local tc=te:GetHandler()
return Duel.GetTurnPlayer()~=e:GetHandlerPlayer()
and tc:IsLocation(LOCATION_HAND) and tc:GetEffectCount(85551711)>0
and ((tc:GetEffectCount(EFFECT_QP_ACT_IN_NTPHAND)<=tc:GetEffectCount(85551711) and tc:IsType(TYPE_QUICKPLAY))
or (tc:GetEffectCount(EFFECT_TRAP_ACT_IN_HAND)<=tc:GetEffectCount(85551711) and tc:IsType(TYPE_TRAP)))
end
function c85551711.costchk(e,te_or_c,tp)
function c85551711.handcost(e,c,tp)
return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_EFFECT)
end
function c85551711.costop(e,tp,eg,ep,ev,re,r,rp)
function c85551711.handop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,85551711)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_EFFECT)
end
function c85551711.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ((rp==1-tp and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE))
return ((rp==1-tp and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE))
or c:IsReason(REASON_BATTLE)) and c:IsSummonType(SUMMON_TYPE_XYZ)
end
function c85551711.spfilter(c,e,tp)
Expand Down