Commit 7b4c1756 authored by IamIpanda's avatar IamIpanda

Regular fixes

parent 806644b0
Pipeline #38632 passed with stages
in 47 seconds
.history
ygopro-scripts-define
.gitignore
.gitmodules
......@@ -10,6 +10,7 @@ function s.initial_effect(c)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.thcon)
e1:SetTarget(s.thtg)
e1:SetCost(s.thcost)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
......@@ -44,6 +45,9 @@ end
function s.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x1b2) and c:IsType(TYPE_MONSTER) and not c:IsCode(id)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local h1=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
......
......@@ -30,7 +30,7 @@ function s.filter(c)
end
function s.costfilter(c)
local te=c:GetActivateEffect()
return c:GetType()==TYPE_TRAP and c:IsAbleToGraveAsCost()
return c:GetType()==TYPE_TRAP and c:IsAbleToGraveAsCost() and te and te:GetCode()==EVENT_ATTACK_ANNOUNCE
end
function s.costfilter2(c)
return c:IsAbleToGraveAsCost() and c:IsType(TYPE_MONSTER)
......
......@@ -40,6 +40,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e,tp)
end
-- override effect
local c=e:GetHandler()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
......
--神之预告
local s,id=GetID()
function s.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON)
e1:SetCondition(s.con1)
e1:SetCost(s.cost1)
e1:SetTarget(s.target1)
e1:SetOperation(s.activate1)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(s.handcon)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
end
function s.con1(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function s.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local lp=math.floor(Duel.GetLP(tp)/2)
Duel.PayLPCost(tp,lp)
e:SetLabel(lp)
end
function s.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,2,0,0)
end
function s.activate1(e,tp,eg,ep,ev,re,r,rp)
local c1=Duel.AnnounceCard(tp)
local c2=Duel.AnnounceCard(1-tp)
if c1~=c2 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON)
e1:SetCondition(s.ngcon)
e1:SetOperation(s.ngop)
e1:SetLabel(c1)
e1:SetLabelObject(e)
Duel.RegisterEffect(e1,tp)
end
end
function s.ngcon(e,tp,eg,ep,ev,re,r,rp)
return aux.NegateSummonCondition(e,tp,eg,ep,ev,re,r,rp) and eg:IsExists(Card.IsCode,1,nil,e:GetLabel())
end
function s.ngop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
Duel.Remove(Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_EXTRA,nil,e:GetLabel()),POS_FACEDOWN,REASON_EFFECT)
Duel.Recover(tp,e:GetLabelObject():GetLabel(),REASON_EFFECT)
local c=e:GetLabelObject():GetHandler()
if c:IsLocation(LOCATION_GRAVE) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.BreakEffect()
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
function s.handcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(id,e:GetHandlerPlayer(),ACTIVITY_CHAIN)==0 --and ep~=tp
end
function s.chainfilter(re,tp,cid)
local rc=re:GetHandler()
if rc==nil then return true end
return not rc:IsType(TYPE_MONSTER+TYPE_SPELL)
end
--神之预告
local s,id=GetID()
function s.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON)
e1:SetCondition(s.con1)
e1:SetCost(s.cost1)
e1:SetTarget(s.target1)
e1:SetOperation(s.activate1)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(s.handcon)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
end
function s.con1(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function s.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local lp=math.floor(Duel.GetLP(tp)/2)
Duel.PayLPCost(tp,lp)
e:SetLabel(lp)
end
function s.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,2,0,0)
end
function s.activate1(e,tp,eg,ep,ev,re,r,rp)
local c1=Duel.AnnounceCard(tp)
local c2=Duel.AnnounceCard(1-tp)
if c1~=c2 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON)
e1:SetCondition(s.ngcon)
e1:SetOperation(s.ngop)
e1:SetLabel(c1)
e1:SetLabelObject(e)
Duel.RegisterEffect(e1,tp)
end
end
function s.ngcon(e,tp,eg,ep,ev,re,r,rp)
return aux.NegateSummonCondition(e,tp,eg,ep,ev,re,r,rp) and eg:IsExists(Card.IsCode,1,nil,e:GetLabel())
end
function s.ngop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
Duel.Remove(Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_EXTRA,nil,e:GetLabel()),POS_FACEDOWN,REASON_EFFECT)
Duel.Recover(tp,e:GetLabelObject():GetLabel(),REASON_EFFECT)
local c=e:GetLabelObject():GetHandler()
if c:IsLocation(LOCATION_GRAVE) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.BreakEffect()
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
function s.handcon(e,c)
return Duel.GetCustomActivityCount(id,e:GetHandlerPlayer(),ACTIVITY_CHAIN)==0 --and ep~=tp
end
function s.chainfilter(re,tp,cid)
local rc=re:GetHandler()
if rc==nil then return true end
return not rc:IsType(TYPE_MONSTER+TYPE_SPELL)
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