游戏王残局简化版

Annotation For expansions/script/c896311391.lua
Login

Annotation For expansions/script/c896311391.lua

Origin for each line in expansions/script/c896311391.lua from check-in f67761966f:

f67761966f 2024-07-21    1: --サモン・ソーサレス
f67761966f 2024-07-21    2: function c896311391.initial_effect(c)
f67761966f 2024-07-21    3: 	--link summon
f67761966f 2024-07-21    4: 	aux.AddLinkProcedure(c,aux.NOT(aux.FilterBoolFunction(Card.IsLinkType,TYPE_TOKEN)),2,99,c896311391.lcheck)
f67761966f 2024-07-21    5: 	c:EnableReviveLimit()
f67761966f 2024-07-21    6: 	--special summon
f67761966f 2024-07-21    7: 	local e1=Effect.CreateEffect(c)
f67761966f 2024-07-21    8: 	e1:SetDescription(aux.Stringid(896311391,0))
f67761966f 2024-07-21    9: 	e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
f67761966f 2024-07-21   10: 	e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
f67761966f 2024-07-21   11: 	e1:SetCode(EVENT_SPSUMMON_SUCCESS)
f67761966f 2024-07-21   12: 	e1:SetProperty(EFFECT_FLAG_DELAY)
f67761966f 2024-07-21   13: 	e1:SetCondition(c896311391.spcon1)
f67761966f 2024-07-21   14: 	e1:SetTarget(c896311391.sptg1)
f67761966f 2024-07-21   15: 	e1:SetOperation(c896311391.spop1)
f67761966f 2024-07-21   16: 	c:RegisterEffect(e1)
f67761966f 2024-07-21   17: 	--special summon
f67761966f 2024-07-21   18: 	local e2=Effect.CreateEffect(c)
f67761966f 2024-07-21   19: 	e2:SetDescription(aux.Stringid(896311391,1))
f67761966f 2024-07-21   20: 	e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
f67761966f 2024-07-21   21: 	e2:SetType(EFFECT_TYPE_IGNITION)
f67761966f 2024-07-21   22: 	e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
f67761966f 2024-07-21   23: 	e2:SetRange(LOCATION_MZONE)
f67761966f 2024-07-21   24: 	e2:SetCountLimit(1,896311391)
f67761966f 2024-07-21   25: 	e2:SetTarget(c896311391.sptg2)
f67761966f 2024-07-21   26: 	e2:SetOperation(c896311391.spop2)
f67761966f 2024-07-21   27: 	c:RegisterEffect(e2)
f67761966f 2024-07-21   28: end
f67761966f 2024-07-21   29: function c896311391.lcheck(g)
f67761966f 2024-07-21   30: 	return g:GetClassCount(Card.GetLinkRace)==1
f67761966f 2024-07-21   31: end
f67761966f 2024-07-21   32: function c896311391.spcon1(e,tp,eg,ep,ev,re,r,rp)
f67761966f 2024-07-21   33: 	return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
f67761966f 2024-07-21   34: end
f67761966f 2024-07-21   35: function c896311391.spfilter1(c,e,tp,zone)
f67761966f 2024-07-21   36: 	return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,1-tp,zone)
f67761966f 2024-07-21   37: end
f67761966f 2024-07-21   38: function c896311391.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
f67761966f 2024-07-21   39: 	local zone=e:GetHandler():GetLinkedZone(1-tp)
f67761966f 2024-07-21   40: 	if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
f67761966f 2024-07-21   41: 		and Duel.IsExistingMatchingCard(c896311391.spfilter1,tp,LOCATION_HAND,0,1,nil,e,tp,zone) end
f67761966f 2024-07-21   42: 	Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
f67761966f 2024-07-21   43: end
f67761966f 2024-07-21   44: function c896311391.spop1(e,tp,eg,ep,ev,re,r,rp)
f67761966f 2024-07-21   45: 	local zone=e:GetHandler():GetLinkedZone(1-tp)
f67761966f 2024-07-21   46: 	if Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)<=0 then return end
f67761966f 2024-07-21   47: 	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
f67761966f 2024-07-21   48: 	local g=Duel.SelectMatchingCard(tp,c896311391.spfilter1,tp,LOCATION_HAND,0,1,1,nil,e,tp,zone)
f67761966f 2024-07-21   49: 	if g:GetCount()>0 then
f67761966f 2024-07-21   50: 		Duel.SpecialSummon(g,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE,zone)
f67761966f 2024-07-21   51: 	end
f67761966f 2024-07-21   52: end
f67761966f 2024-07-21   53: function c896311391.spfilter2(c,e,tp,lg)
f67761966f 2024-07-21   54: 	return c:IsFaceup() and lg:IsContains(c) and Duel.IsExistingMatchingCard(c896311391.spfilter3,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetRace())
f67761966f 2024-07-21   55: end
f67761966f 2024-07-21   56: function c896311391.spfilter_chkc(c,e,tp,lg,rc)
f67761966f 2024-07-21   57: 	return c:IsFaceup() and lg:IsContains(c) and (c:GetRace()&rc)==rc
f67761966f 2024-07-21   58: end
f67761966f 2024-07-21   59: function c896311391.spfilter3(c,e,tp,rac)
f67761966f 2024-07-21   60: 	if not c:IsRace(rac) then return false end
f67761966f 2024-07-21   61: 	local ok=false
f67761966f 2024-07-21   62: 	for p=0,1 do
f67761966f 2024-07-21   63: 		local zone=e:GetHandler():GetLinkedZone(p)&0xff
f67761966f 2024-07-21   64: 		ok=ok or (Duel.GetLocationCount(p,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,p,zone))
f67761966f 2024-07-21   65: 	end
f67761966f 2024-07-21   66: 	return ok
f67761966f 2024-07-21   67: end
f67761966f 2024-07-21   68: function c896311391.sptg2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
f67761966f 2024-07-21   69: 	local c=e:GetHandler()
f67761966f 2024-07-21   70: 	local zone={}
f67761966f 2024-07-21   71: 	zone[0]=c:GetLinkedZone(0)
f67761966f 2024-07-21   72: 	zone[1]=c:GetLinkedZone(1)
f67761966f 2024-07-21   73: 	local lg=c:GetLinkedGroup()
f67761966f 2024-07-21   74: 	if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c896311391.spfilter_chkc(chkc,e,tp,lg,e:GetLabel()) end
f67761966f 2024-07-21   75: 	if chk==0 then return Duel.IsExistingTarget(c896311391.spfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,e,tp,lg) end
f67761966f 2024-07-21   76: 	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
f67761966f 2024-07-21   77: 	local g=Duel.SelectTarget(tp,c896311391.spfilter2,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,e,tp,lg)
f67761966f 2024-07-21   78: 	Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
f67761966f 2024-07-21   79: 	e:SetLabel(g:GetFirst():GetRace())
f67761966f 2024-07-21   80: end
f67761966f 2024-07-21   81: function c896311391.spop2(e,tp,eg,ep,ev,re,r,rp)
f67761966f 2024-07-21   82: 	local c=e:GetHandler()
f67761966f 2024-07-21   83: 	local tc=Duel.GetFirstTarget()
f67761966f 2024-07-21   84: 	if not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
f67761966f 2024-07-21   85: 	local zone={}
f67761966f 2024-07-21   86: 	local flag={}
f67761966f 2024-07-21   87: 	for p=0,1 do
f67761966f 2024-07-21   88: 		zone[p]=c:GetLinkedZone(p)&0xff
f67761966f 2024-07-21   89: 		local _,flag_tmp=Duel.GetLocationCount(p,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone[p])
f67761966f 2024-07-21   90: 		flag[p]=(~flag_tmp)&0x7f
f67761966f 2024-07-21   91: 	end
f67761966f 2024-07-21   92: 	Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
f67761966f 2024-07-21   93: 	local g=Duel.SelectMatchingCard(tp,c896311391.spfilter3,tp,LOCATION_DECK,0,1,1,nil,e,tp,tc:GetRace())
f67761966f 2024-07-21   94: 	local sc=g:GetFirst()
f67761966f 2024-07-21   95: 	if sc then
f67761966f 2024-07-21   96: 		local avail_zone=0
f67761966f 2024-07-21   97: 		for p=0,1 do
f67761966f 2024-07-21   98: 			if sc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE,p,zone[p]) then
f67761966f 2024-07-21   99: 				avail_zone=avail_zone|(flag[p]<<(p==tp and 0 or 16))
f67761966f 2024-07-21  100: 			end
f67761966f 2024-07-21  101: 		end
f67761966f 2024-07-21  102: 		Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
f67761966f 2024-07-21  103: 		local sel_zone=Duel.SelectDisableField(tp,1,LOCATION_MZONE,LOCATION_MZONE,0x00ff00ff&(~avail_zone))
f67761966f 2024-07-21  104: 		local sump=0
f67761966f 2024-07-21  105: 		if sel_zone&0xff>0 then
f67761966f 2024-07-21  106: 			sump=tp
f67761966f 2024-07-21  107: 		else
f67761966f 2024-07-21  108: 			sump=1-tp
f67761966f 2024-07-21  109: 			sel_zone=sel_zone>>16
f67761966f 2024-07-21  110: 		end
f67761966f 2024-07-21  111: 		if Duel.SpecialSummonStep(sc,0,tp,sump,false,false,POS_FACEUP_DEFENSE,sel_zone) then
f67761966f 2024-07-21  112: 			local e1=Effect.CreateEffect(c)
f67761966f 2024-07-21  113: 			e1:SetType(EFFECT_TYPE_SINGLE)
f67761966f 2024-07-21  114: 			e1:SetCode(EFFECT_DISABLE)
f67761966f 2024-07-21  115: 			e1:SetReset(RESET_EVENT+RESETS_STANDARD)
f67761966f 2024-07-21  116: 			sc:RegisterEffect(e1)
f67761966f 2024-07-21  117: 			local e2=Effect.CreateEffect(c)
f67761966f 2024-07-21  118: 			e2:SetType(EFFECT_TYPE_SINGLE)
f67761966f 2024-07-21  119: 			e2:SetCode(EFFECT_DISABLE_EFFECT)
f67761966f 2024-07-21  120: 			e2:SetValue(RESET_TURN_SET)
f67761966f 2024-07-21  121: 			e2:SetReset(RESET_EVENT+RESETS_STANDARD)
f67761966f 2024-07-21  122: 			sc:RegisterEffect(e2)
f67761966f 2024-07-21  123: 		end
f67761966f 2024-07-21  124: 		Duel.SpecialSummonComplete()
f67761966f 2024-07-21  125: 	end
f67761966f 2024-07-21  126: end