Commit 80631d2d authored by JoyJ's avatar JoyJ
parents 0bfe82fc a566c205
--村规决斗:令行禁止
--开局时,双方从卡组外将1张【禁止令】表侧表示从游戏中除外。
--这张【禁止令】得到以下效果。
--①1回合1次,这张卡被除外的状态下才能发动。这个效果不会被无效化。
--宣言1个【禁止令】以外的卡名,在这场决斗中,对方的那些卡受到禁止令效果影响。
--②1回合1次,这张卡被除外的状态下才能发动。这个效果不会被无效化。
--这张卡撕碎(效果名:卡片破坏),解除自己目前受到的所有因此类卡的①效果的禁止令效果。
--③这张卡不是表侧表示除外状态的场合,这张卡表侧表示除外。这个效果不会被无效化,在卡组·手卡也会适用。
CUNGUI = {}
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
end
function CUNGUI.AdjustOperation()
if not CUNGUI.INIT then
CUNGUI.INIT = true
CUNGUI.RegisterForbiddenRule(0)
CUNGUI.RegisterForbiddenRule(1)
end
if CUNGUI.RuleCard[0] and (not CUNGUI.RuleCard[0]:IsLocation(LOCATION_REMOVED) or not CUNGUI.RuleCard[0]:IsFaceup()) then
Duel.Remove(CUNGUI.RuleCard[0],POS_FACEUP,REASON_RULE)
end
if CUNGUI.RuleCard[1] and not CUNGUI.RuleCard[1]:IsLocation(LOCATION_REMOVED) then
Duel.Remove(CUNGUI.RuleCard[1],POS_FACEUP,REASON_RULE)
end
if CUNGUI.RuleCard[0] and not CUNGUI.RuleCard[0]:IsFaceup() then
Duel.ChangePosition(CUNGUI.RuleCard[0],POS_FACEUP)
end
if CUNGUI.RuleCard[1] and not CUNGUI.RuleCard[1]:IsFaceup() then
Duel.ChangePosition(CUNGUI.RuleCard[1],POS_FACEUP)
end
end
CUNGUI.RuleCard={}
CUNGUI.ForbiddenEffects={}
CUNGUI.ForbiddenEffects[0]={}
CUNGUI.ForbiddenEffects[1]={}
function CUNGUI.RegisterForbiddenRule(tp)
local c=Duel.CreateToken(tp,43711255)
Duel.Remove(c,POS_FACEUP,REASON_RULE)
CUNGUI.RuleCard[tp]=c
--forbid
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29417188,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_REMOVED)
e1:SetOperation(CUNGUI.forbidop)
c:RegisterEffect(e1)
--unforbid
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(276357,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetRange(LOCATION_REMOVED)
e2:SetOperation(CUNGUI.operation2)
c:RegisterEffect(e2)
end
function CUNGUI.operation2(e,tp,eg,ep,ev,re,r,rp)
for i,v in pairs(CUNGUI.ForbiddenEffects[1-tp]) do
v:Reset()
end
Duel.Exile(e:GetHandler(),REASON_RULE)
end
function CUNGUI.forbidop(e,tp,eg,ep,ev,re,r,rp)
local code=43711255
while code==43711255 do
code=Duel.AnnounceCard(tp)
end
--forbidden
local e2=Effect.GlobalEffect()
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetCode(EFFECT_FORBIDDEN)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(0x7f,0)
e2:SetTarget(CUNGUI.bantg)
e2:SetLabel(code)
Duel.RegisterEffect(e2,1-tp)
table.insert(CUNGUI.ForbiddenEffects[1-tp],e2)
end
function CUNGUI.bantg(e,c)
local code1,code2=c:GetOriginalCodeRule()
local fcode=e:GetLabel()
return code1==fcode or code2==fcode
end
--村规决斗:霜之哀伤
--一名玩家的基本分达到16000的场合,那个玩家的对方基本分变为0。
--所有怪兽得到以下效果:
--这张卡召唤·特殊召唤成功的场合,
--从卡组外将1张【蓝色药剂】(20871001)加入对方墓地。
--这个效果置于墓地的【蓝色药剂】增加效果:
--此类效果1回合只能使用1次。
--这张卡在墓地的场合,自己结束阶段发动。回复自己墓地【蓝色药剂】数量*400。
CUNGUI = {}
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetCountLimit(1)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
--adjust
e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetOperation(CUNGUI.AdjustOperation2)
Duel.RegisterEffect(e1,0)
end
function CUNGUI.AdjustOperation2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLP(0)>=16000 then
Duel.SetLP(1,0)
elseif Duel.GetLP(1)>=16000 then
Duel.SetLP(0,0)
end
end
CUNGUI.RegisteredMonsters = Group.CreateGroup()
function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp)
local g = Duel.GetMatchingGroup(Card.IsType,0,LOCATION_DECK+LOCATION_HAND+LOCATION_EXTRA+LOCATION_MZONE,LOCATION_DECK+LOCATION_HAND+LOCATION_EXTRA+LOCATION_MZONE,nil,TYPE_MONSTER)
g:ForEach(CUNGUI.RegisterMonsterSpecialEffects)
end
function CUNGUI.RegisterMonsterSpecialEffects(c)
if CUNGUI.RegisteredMonsters:IsContains(c) then return end
CUNGUI.RegisteredMonsters:AddCard(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1)
e2:SetOperation(CUNGUI.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function CUNGUI.thop(e,tp,eg,ep,ev,re,r,rp)
local token=Duel.CreateToken(1-tp,20871001)
Duel.SendtoGrave(token,REASON_RULE)
local e1=Effect.CreateEffect(token)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_GRAVE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCountLimit(1,20871001)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetCondition(CUNGUI.reccon)
e1:SetTarget(CUNGUI.rectg)
e1:SetOperation(CUNGUI.recop)
token:RegisterEffect(e1)
end
function CUNGUI.reccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function CUNGUI.recfilter(c)
return c:IsFaceup() and c:IsCode(76103675)
end
function CUNGUI.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local rec=400*Duel.GetMatchingGroupCount(CUNGUI.recfilter,tp,LOCATION_GRAVE,0,nil)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(rec)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,rec)
end
function CUNGUI.recop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
d=400*Duel.GetMatchingGroupCount(CUNGUI.recfilter,tp,LOCATION_GRAVE,0,nil)
Duel.Recover(p,d,REASON_EFFECT)
end
--村规决斗:禁忌法则
--所有卡得到以下效果:
--这个效果的发动和效果不会被无效化。
--把这张卡从手卡里侧表示除外才能发动。从卡组外将1张随机禁卡加入手卡或额外卡组。
--这个效果加入手卡的卡,在那个回合不能把此类效果发动(即使发生过位置移动)。
--细则:
--采用2022年1月禁卡表。
--加入的卡不需要给对方确认。
CUNGUI = {}
CUNGUI.forbidden={91869203,20663556,44910027,51858306,25862681,53804307,7563579,17330916,34945480,
90411554,8903700,11384280,17412721,67441435,34124316,88071625,61665245,52653092,48905153,85115440,
59537380,86148577,88581108,21377582,94677445,16923472,15341821,37818794,18326736,79875176,75732622,
22593417,39064822,3679218,54719828,58820923,26400609,71525232,78706415,93369354,23558733,9929398,
9047460,31178212,63101919,34206604,4423206,14702066,96782886,3078576,34086406,85243784,57421866,
41482598,44763025,17375316,19613556,74191942,42829885,45986603,55144522,4031928,23557835,31423101,
57953380,54447022,60682203,69243953,79571449,70828912,42703248,52947044,76375976,34906152,46448938,
46411259,85602018,27174286,93016201,3280747,64697231,80604091,35316708,32723153,17178486,28566710}
function Auxiliary.PreloadUds()
--adjust
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_ADJUST)
e1:SetCountLimit(1)
e1:SetOperation(CUNGUI.AdjustOperation)
Duel.RegisterEffect(e1,0)
end
CUNGUI.RegisteredMonsters = Group.CreateGroup()
function CUNGUI.AdjustOperation(e,tp,eg,ep,ev,re,r,rp)
local g = Duel.GetMatchingGroup(nil,0,0x7f,0x7f,nil)
g:ForEach(CUNGUI.RegisterMonsterSpecialEffects)
end
function CUNGUI.RegisterMonsterSpecialEffects(c)
if CUNGUI.RegisteredMonsters:IsContains(c) then return end
CUNGUI.RegisteredMonsters:AddCard(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(3431737,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(CUNGUI.cost)
e1:SetProperty(EFFECT_FLAG_CANNOT_NEGATE+EFFECT_FLAG_CANNOT_INACTIVATE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(CUNGUI.operation)
c:RegisterEffect(e1)
end
function CUNGUI.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost() end
Duel.Remove(c, POS_FACEDOWN,REASON_COST)
end
function CUNGUI.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local add=0
if not CUNGUI.DiceInit then
CUNGUI.DiceInit=true
local a1,a2,a3,a4,a5=Duel.TossDice(tp,5)
local a6,a7,a8,a9,a10=Duel.TossDice(tp,5)
local x=a1^10+a2^9+a3^8+a4^7+a5^6+a6^5+a7^4+a8^3+a9^2+a10
math.randomseed(x)
end
while add==0 do
local code=math.random(#CUNGUI.forbidden)
local tc=Duel.CreateToken(tp,CUNGUI.forbidden[code])
if tc then
add = Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
end
...@@ -46,16 +46,16 @@ end ...@@ -46,16 +46,16 @@ end
local function phaseSkill(code, phase, op, con, both) local function phaseSkill(code, phase, op, con, both)
wrapDeckSkill(code, function(e1) wrapDeckSkill(code, function(e1)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+phase) e1:SetCode(EVENT_PHASE+phase)
e1:SetCountLimit(1,0x7ffffff-code) e1:SetCountLimit(1,0x7ffffff-code)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return (both or Duel.GetTurnPlayer()==tp) and (not con or con(e,tp,eg,ep,ev,re,r,rp)) return (both or Duel.GetTurnPlayer()==tp) and (not con or con(e,tp,eg,ep,ev,re,r,rp))
end) end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp) e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,code) Duel.Hint(HINT_CARD,0,code)
op(e,tp,eg,ep,ev,re,r,rp) op(e,tp,eg,ep,ev,re,r,rp)
end) end)
end) end)
end end
...@@ -145,19 +145,19 @@ function c69015963_filter(c,e,tp) ...@@ -145,19 +145,19 @@ function c69015963_filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,true,false,POS_FACEUP_ATTACK) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 return c:IsCanBeSpecialSummoned(e,0,tp,true,false,POS_FACEUP_ATTACK) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end end
endPhaseSkill(69015963, function(e,tp,eg,ep,ev,re,r,rp) standbyPhaseSkill(69015963, function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c69015963_filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c69015963_filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP_ATTACK) then if tc and Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP_ATTACK) then
local e1=Effect.CreateEffect(tc) local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500) e1:SetValue(500)
e1:SetReset(RESET_EVENT+0xfe0000) e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1,true) tc:RegisterEffect(e1,true)
Duel.SpecialSummonComplete()
end end
Duel.SpecialSummonComplete()
end, function(e,tp,eg,ep,ev,re,r,rp) end, function(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c69015963_filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) return Duel.IsExistingMatchingCard(c69015963_filter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
end) end)
...@@ -224,11 +224,6 @@ function c69015963_filter(c,e,tp) ...@@ -224,11 +224,6 @@ function c69015963_filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,true,true) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 return c:IsCanBeSpecialSummoned(e,0,tp,true,true) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end end
standbyPhaseSkill(69015963, function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,c69015963_filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g then Duel.SpecialSummon(g,0,tp,tp,true,true,POS_FACEUP) end
end)
addSkill(53239672, function(e1) addSkill(53239672, function(e1)
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE) e1:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
...@@ -436,6 +431,49 @@ end, function(e,tp,eg,ep,ev,re,r,rp) ...@@ -436,6 +431,49 @@ end, function(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<=0 return Duel.GetLP(tp)<=0
end) end)
wrapDeckSkill(72283691, function(e4)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetCondition(c72283691_atkcon)
e4:SetOperation(c72283691_atkop)
end)
function c72283691_atkcon(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
return tc:IsControler(1-tp)
end
local function destroyGold(tc)
Duel.Hint(HINT_CARD,0,72283691)
local atk=math.floor(tc:GetAttack()/2)
local tp=tc:GetControler()
if Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Damage(tp,atk,REASON_EFFECT)
end
end
function c72283691_atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetAttacker()
destroyGold(tc)
end
wrapDeckSkill(72283691, function(e4)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_CHAINING)
e4:SetCondition(c72283691_chaincon)
e4:SetOperation(c72283691_chainop)
end)
function c72283691_chaincon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return ep==1-tp and re:IsActiveType(TYPE_MONSTER) and tc and tc:IsControler(1-tp) and tc:IsOnField()
end
function c72283691_chainop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
destroyGold(tc)
end
local function initialize() local function initialize()
local skillSelections={} local skillSelections={}
local skillCodes=getAllSkillCodes() local skillCodes=getAllSkillCodes()
......
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