Commit 2083ffbd authored by wind2009's avatar wind2009

Update rule

parent 76fc9a3c
Pipeline #41016 failed with stages
in 10 minutes and 51 seconds
This diff is collapsed.
ChickenGame={}
--Chicken_Game_Rule
function ChickenGame.Load_Chicken_Game_Rule()
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(1,1)
e1:SetCountLimit(1)
e1:SetCode(EVENT_PHASE_START+PHASE_STANDBY)
e1:SetOperation(ChickenGame.Chicken_Game_Operation)
Duel.RegisterEffect(e1,0)
end
function ChickenGame.Chicken_Game_Operation(e,p,eg,ep,ev,re,r,rp)
local tp=Duel.GetTurnPlayer()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT)
local hintlist=(Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0) and {aux.Stringid(64306248,0),aux.Stringid(42541548,0)} or {aux.Stringid(64306248,0)}
local op=Duel.SelectOption(tp,table.unpack(hintlist))
-- heal
if op==0 then
Duel.Recover(tp,1000,REASON_EFFECT)
-- sendback and draw
else
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoDeck(g,nil,1,REASON_EFFECT)>0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
return ChickenGame
\ No newline at end of file
...@@ -14,7 +14,7 @@ end ...@@ -14,7 +14,7 @@ end
function Deepthink.Skill_Deepthink_Condition(e,tp,eg,ep,ev,re,r,rp) function Deepthink.Skill_Deepthink_Condition(e,tp,eg,ep,ev,re,r,rp)
local tp=Duel.GetTurnPlayer() local tp=Duel.GetTurnPlayer()
return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1 return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1
end end
function Deepthink.Skill_Deepthink_Operation(e,tp,eg,ep,ev,re,r,rp) function Deepthink.Skill_Deepthink_Operation(e,tp,eg,ep,ev,re,r,rp)
......
DrawSense={}
--Skill_DrawSense_Rule
function DrawSense.Load_Skill_DrawSense_Rule()
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,1)
--e1:SetCode(PHASE_DRAW+EVENT_PHASE_START)
e1:SetCode(EVENT_PREDRAW)
e1:SetCondition(DrawSense.Skill_DrawSense_Condition)
e1:SetOperation(DrawSense.Skill_DrawSense_Operation)
Duel.RegisterEffect(e1,0)
end
function DrawSense.Skill_DrawSense_Condition(e,p,eg,ep,ev,re,r,rp)
local tp=Duel.GetTurnPlayer()
return (Duel.GetLP(1-tp))-(Duel.GetLP(tp))>2499
and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>1
and Duel.GetDrawCount(tp)>0
and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
--and Duel.IsExistingMatchingCard(Auxiliary.Skill_DestinyDraw_SearchFilter,tp,LOCATION_DECK,0,1,nil)
end
function DrawSense.Skill_DrawSense_Operation(e,p,eg,ep,ev,re,r,rp)
local tp=Duel.GetTurnPlayer()
local dt=Duel.GetDrawCount(tp)
if dt~=0 then
local _replace_count=0
local _replace_max=dt
-- local e1=Effect.CreateEffect(e:GetHandler())
-- e1:SetType(EFFECT_TYPE_FIELD)
-- e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
-- e1:SetCode(EFFECT_DRAW_COUNT)
-- e1:SetTargetRange(1,0)
-- e1:SetReset(RESET_PHASE+PHASE_DRAW)
-- e1:SetValue(0)
-- Duel.RegisterEffect(e1,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
local SenseType=(Duel.AnnounceType(tp))
if (SenseType==0 and Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_DECK,0,1,nil,TYPE_MONSTER)) then
g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_DECK,0,nil,TYPE_MONSTER)
local SenseCard=g:RandomSelect(tp,1)
local tc=SenseCard:GetFirst()
if tc then
Duel.ShuffleDeck(tp)
Duel.MoveSequence(tc,0)
end
--Duel.Draw(tp,1,REASON_RULE)
elseif (SenseType==1 and Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_DECK,0,1,nil,TYPE_SPELL)) then
g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_DECK,0,nil,TYPE_SPELL)
local SenseCard=g:RandomSelect(tp,1)
local tc=SenseCard:GetFirst()
if tc then
Duel.ShuffleDeck(tp)
Duel.MoveSequence(tc,0)
end
--Duel.Draw(tp,1,REASON_RULE)
elseif (SenseType==2 and Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_DECK,0,1,nil,TYPE_TRAP)) then
g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_DECK,0,nil,TYPE_TRAP)
local SenseCard=g:RandomSelect(tp,1)
local tc=SenseCard:GetFirst()
if tc then
Duel.ShuffleDeck(tp)
Duel.MoveSequence(tc,0)
end
--Duel.Draw(tp,1,REASON_RULE)
else
Duel.ShuffleDeck(tp)
--Duel.Draw(tp,1,REASON_RULE)
end
end
end
return DrawSense
\ No newline at end of file
This diff is collapsed.
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