Commit 47a162b1 authored by REIKAI's avatar REIKAI 💬

emergency

parent 5d50cda3
Pipeline #19866 passed with stage
in 21 minutes and 16 seconds
No preview for this file type
local m=15000395
local cm=_G["c"..m]
cm.name="替身名-『脸部特写』"
function cm.initial_effect(c)
c:SetUniqueOnField(1,0,15000395)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.secon)
e1:SetTarget(cm.setg)
e1:SetOperation(cm.seop)
c:RegisterEffect(e1)
if not cm.Talking_Head_Check then
cm.Talking_Head_Check=true
_Talking_Head_AnnounceCard=Duel.AnnounceCard
function Duel.AnnounceCard(p,...)
local ap=p
if Duel.IsPlayerAffectedByEffect(p,15000395) then ap=1-p end
return _Talking_Head_AnnounceCard(ap,...)
end
_Talking_Head_AnnounceAttribute=Duel.AnnounceAttribute
function Duel.AnnounceAttribute(p,ct,attr)
local ap=p
if Duel.IsPlayerAffectedByEffect(p,15000395) then ap=1-p end
return _Talking_Head_AnnounceAttribute(ap,ct,attr)
end
_Talking_Head_AnnounceCoin=Duel.AnnounceCoin
function Duel.AnnounceCoin(p)
local ap=p
if Duel.IsPlayerAffectedByEffect(p,15000395) then ap=1-p end
return _Talking_Head_AnnounceCoin(ap)
end
_Talking_Head_AnnounceLevel=Duel.AnnounceLevel
function Duel.AnnounceLevel(p,min,max,...)
local ap=p
if not min then min=1 end
if not max then max=12 end
if Duel.IsPlayerAffectedByEffect(p,15000395) then ap=1-p end
return _Talking_Head_AnnounceLevel(ap,min,max,...)
end
_Talking_Head_AnnounceNumber=Duel.AnnounceNumber
function Duel.AnnounceNumber(p,num,...)
local ap=p
if Duel.IsPlayerAffectedByEffect(p,15000395) then ap=1-p end
return _Talking_Head_AnnounceNumber(ap,num,...)
end
_Talking_Head_AnnounceRace=Duel.AnnounceRace
function Duel.AnnounceRace(p,ct,rac)
local ap=p
if Duel.IsPlayerAffectedByEffect(p,15000395) then ap=1-p end
return _Talking_Head_AnnounceRace(ap,ct,rac)
end
_Talking_Head_AnnounceType=Duel.AnnounceType
function Duel.AnnounceType(p)
local ap=p
if Duel.IsPlayerAffectedByEffect(p,15000395) then ap=1-p end
return _Talking_Head_AnnounceType(ap)
end
end
end
function cm.secon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0 and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetTurnPlayer()==tp and Duel.GetLocationCount(1-tp,LOCATION_SZONE,tp,LOCATION_REASON_TOFIELD,0xe)>0 and e:GetHandler():CheckUniqueOnField(1-tp)
end
function cm.setg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function cm.seop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(1-tp,LOCATION_SZONE,tp,LOCATION_REASON_TOFIELD,0xe)>0 then
Duel.ConfirmCards(1-tp,c)
if Duel.MoveToField(c,tp,1-tp,LOCATION_SZONE,POS_FACEUP,true,0xe) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:RegisterEffect(e1)
--change effect type
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(15000395)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
e2:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:RegisterEffect(e2)
end
end
end
\ No newline at end of file
--Fate/Grand Order·吉尔伽美什
local m=30610010
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetUniqueOnField(1,0,30610010)
c:EnableCounterPermit(0x1)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon0)
c:RegisterEffect(e1)
--token
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYED)
e2:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL)
e2:SetCost(cm.addcost)
e2:SetCondition(cm.con)
e2:SetTarget(cm.tg)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,4))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_NO_TURN_RESET)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(cm.descost)
e3:SetCondition(cm.descon)
e3:SetTarget(cm.destg)
e3:SetOperation(cm.desop)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,2))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetCountLimit(1)
e4:SetRange(LOCATION_MZONE)
e4:SetTarget(cm.target)
e4:SetOperation(cm.activate)
c:RegisterEffect(e4)
--atk
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,3))
e5:SetCategory(CATEGORY_DECKDES+CATEGORY_ATKCHANGE)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetCountLimit(1)
e5:SetRange(LOCATION_MZONE)
e5:SetTarget(cm.atktg)
e5:SetOperation(cm.atkop)
c:RegisterEffect(e5)
--Attribute Dark
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e7:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e7:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e7:SetValue(ATTRIBUTE_DIVINE)
c:RegisterEffect(e7)
--Add counter
local e16=Effect.CreateEffect(c)
e16:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e16:SetCode(EVENT_CHAIN_SOLVING)
e16:SetProperty(EFFECT_FLAG_DELAY)
e16:SetRange(LOCATION_MZONE)
e16:SetOperation(cm.op0)
c:RegisterEffect(e16)
end
function cm.counterfilter(c)
return not c:IsSummonLocation(LOCATION_EXTRA)
end
function cm.spcon0(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()==0 then return false end
local tg=g:GetMaxGroup(Card.GetAttack)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tg:IsExists(Card.IsControler,1,nil,1-tp)
end
function cm.addcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 and Duel.IsCanRemoveCounter(tp,1,0,0x1,4,REASON_COST) end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
Duel.RemoveCounter(tp,1,0,0x1,4,REASON_COST)
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
end
function cm.splimit(e,c)
return c:IsSummonLocation(LOCATION_EXTRA)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_BATTLE+REASON_EFFECT)
end
function cm.tg(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 cm.op(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
Duel.Hint(HINT_SOUND,0,aux.Stringid(m,5))
Duel.SelectOption(tp,aux.Stringid(m,0))
Duel.SelectOption(1-tp,aux.Stringid(m,0))
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0)
c:RegisterFlagEffect(0,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,1))
Duel.Hint(HINT_CARD,tp,30610011)
Duel.Hint(HINT_CARD,1-tp,30610011)
end
function cm.damfilter(c)
return c:GetCounter(0x1)>0
end
function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCounter(tp,1,1,0x1)>0 end
local g=Duel.GetMatchingGroup(cm.damfilter,tp,LOCATION_ONFIELD,0,nil)
local tc=g:GetFirst()
while tc do
local sct=tc:GetCounter(0x1)
tc:RemoveCounter(tp,0x1,sct,0)
tc=g:GetNext()
end
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(m)~=0
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
local g1=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_SZONE,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,0,0,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,#g,0,0,nil)
end
function cm.filter1(c)
return c:IsType(TYPE_FIELD) and c:IsFaceup()
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
local g1=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_SZONE,nil)
local g0=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local gt=g0+g
Duel.Hint(HINT_SOUND,0,aux.Stringid(m,6))
Duel.Hint(HINT_CARD,tp,30610011)
Duel.Hint(HINT_CARD,1-tp,30610011)
Duel.Hint(HINT_CARD,tp,30610012)
Duel.Hint(HINT_CARD,1-tp,30610012)
Duel.Hint(HINT_CARD,tp,30610013)
Duel.Hint(HINT_CARD,1-tp,30610013)
Duel.Hint(HINT_CARD,tp,30610014)
Duel.Hint(HINT_CARD,1-tp,30610014)
if Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) then
Duel.SendtoGrave(gt,REASON_RULE)
else
Duel.Destroy(g1,REASON_EFFECT)
end
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local ct=math.min(10,Duel.GetFieldGroupCount(tp,LOCATION_DECK,0))
if ct>0 then
local t={}
for i=1,ct do
t[i]=i
end
local ac=1
if ct>1 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,2))
ac=Duel.AnnounceNumber(tp,table.unpack(t))
end
Duel.SortDecktop(tp,tp,ac)
end
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,1) end
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Duel.IsPlayerCanDiscardDeck(tp,1) then return end
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if ct==0 then return end
if ct>3 then ct=3 end
local t={}
for i=1,ct do t[i]=i end
local ac=Duel.AnnounceNumber(tp,table.unpack(t))
Duel.ConfirmDecktop(tp,ac)
local g=Duel.GetDecktopGroup(tp,ac)
local sg=g:Filter(Card.IsSetCard,nil,0xac11)
local ct=sg:GetCount()
Duel.DisableShuffleCheck()
if Duel.SendtoGrave(sg,REASON_EFFECT+REASON_REVEAL)~=0 and c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(ct*1000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
ac=ac-sg:GetCount()
if ac>0 then
Duel.SortDecktop(tp,tp,ac)
for i=1,ac do
local mg=Duel.GetDecktopGroup(tp,1)
Duel.MoveSequence(mg:GetFirst(),SEQ_DECKBOTTOM)
end
end
end
function cm.op0(e,tp,eg,ep,ev,re,r,rp)
local c=re:GetHandler()
if re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) and c~=e:GetHandler() and rp==tp then
e:GetHandler():AddCounter(0x1,1)
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