Commit ced97e17 authored by Nemo Ma's avatar Nemo Ma

151228 wd

parent 334080bf
...@@ -41,6 +41,21 @@ ...@@ -41,6 +41,21 @@
130002004 0 130002004 0
130002005 0 130002005 0
#WILD, I say WILD, WAHAHA #WILD, I say WILD, WAHAHA
17339110 0
17339120 0
17331930 0
7427502 0
7427504 0
7427506 0
7427508 0
7427510 0
7427512 0
7427522 0
7427524 0
7427532 0
7427534 0
7427536 0
74610550 0
17339020 0 17339020 0
17339100 0 17339100 0
62501101 0 62501101 0
...@@ -2859,6 +2874,38 @@ ...@@ -2859,6 +2874,38 @@
95101217 0 95101217 0
95101218 0 95101218 0
95101219 0 95101219 0
#「仙舟翾翔」系列 - MerlinTC
60010225 0
60010226 0
60010227 0
60010228 0
60010229 0
60010230 0
60010231 0
60010232 0
60010233 0
60010234 0
60010235 0
60012001 0
60012002 0
60012003 0
60012004 0
60012005 0
60012006 0
60012007 0
60012008 0
60012009 0
60012010 0
60012011 0
60012012 0
60012013 0
60012014 0
60012015 0
60012016 0
60012017 0
60012018 0
60012019 0
60012020 0
#Tears are now in Japari Park Again! #Tears are now in Japari Park Again!
572850 1 572850 1
4928565 0 4928565 0
...@@ -2875,6 +2922,14 @@ ...@@ -2875,6 +2922,14 @@
60362066 0 60362066 0
74920585 0 74920585 0
77103950 1 77103950 1
#251228
13020100 0 --精灵胶囊
13020070 0 --诅咒玩偶
12847273 0 --黄泉津之巳剑
13020050 1 --武器大师 天天
71290010 0
71290016 0
71290018 0
#251214 #251214
10200106 1 10200106 1
65133124 1 65133124 1
......
No preview for this file type
expansions/pics/17338190.jpg

43.6 KB | W: | H:

expansions/pics/17338190.jpg

44 KB | W: | H:

expansions/pics/17338190.jpg
expansions/pics/17338190.jpg
expansions/pics/17338190.jpg
expansions/pics/17338190.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/17338950.jpg

37.8 KB | W: | H:

expansions/pics/17338950.jpg

37.7 KB | W: | H:

expansions/pics/17338950.jpg
expansions/pics/17338950.jpg
expansions/pics/17338950.jpg
expansions/pics/17338950.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/17339060.jpg

44.1 KB | W: | H:

expansions/pics/17339060.jpg

35.6 KB | W: | H:

expansions/pics/17339060.jpg
expansions/pics/17339060.jpg
expansions/pics/17339060.jpg
expansions/pics/17339060.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/17339070.jpg

102 KB | W: | H:

expansions/pics/17339070.jpg

102 KB | W: | H:

expansions/pics/17339070.jpg
expansions/pics/17339070.jpg
expansions/pics/17339070.jpg
expansions/pics/17339070.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/17339080.jpg

43.7 KB | W: | H:

expansions/pics/17339080.jpg

43.5 KB | W: | H:

expansions/pics/17339080.jpg
expansions/pics/17339080.jpg
expansions/pics/17339080.jpg
expansions/pics/17339080.jpg
  • 2-up
  • Swipe
  • Onion skin
...@@ -114,7 +114,7 @@ function s.ctop(e,tp,eg,ep,ev,re,r,rp) ...@@ -114,7 +114,7 @@ function s.ctop(e,tp,eg,ep,ev,re,r,rp)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
end end
end end
function s.ctfilter(c) function s.ctfilter(c,e,tp)
return c:GetOriginalType()&TYPE_MONSTER>0 and c:GetType()&TYPE_CONTINUOUS+TYPE_TRAP==TYPE_CONTINUOUS+TYPE_TRAP return c:GetOriginalType()&TYPE_MONSTER>0 and c:GetType()&TYPE_CONTINUOUS+TYPE_TRAP==TYPE_CONTINUOUS+TYPE_TRAP
and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
......
...@@ -95,7 +95,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -95,7 +95,7 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if tc then if tc then
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end end
end end
function s.setcon(e,tp,eg,ep,ev,re,r,rp) function s.setcon(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -58,7 +58,6 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -58,7 +58,6 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
Duel.ConfirmCards(1-tp,c) Duel.ConfirmCards(1-tp,c)
-- 特殊召唤部分
if Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then if Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -71,7 +70,6 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -71,7 +70,6 @@ function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end end
-- 检索部分(修改为1张卡)
local g=Duel.GetMatchingGroup(s.opfilter,tp,LOCATION_DECK,0,nil) local g=Duel.GetMatchingGroup(s.opfilter,tp,LOCATION_DECK,0,nil)
if #g>0 then if #g>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
......
--思绪 银幕再叙
local s,id,o=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND+LOCATION_SZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.condition)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(1190)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(s.excon)
e2:SetCountLimit(1,id+1)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)==0
end
function s.cfilter(c)
return c:IsSetCard(0x6f52) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemoveAsCost()
and c:CheckActivateEffect(false,true,false)~=nil
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true)
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if not te then return end
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
local e7=Effect.CreateEffect(e:GetHandler())
e7:SetType(EFFECT_TYPE_FIELD)
e7:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e7:SetCode(EFFECT_CANNOT_ACTIVATE)
e7:SetTargetRange(1,0)
e7:SetValue(s.aclimit)
Duel.RegisterEffect(e7,tp)
end
function s.aclimit(e,re,tp)
return not re:GetHandler():IsSetCard(0x6f52)
end
function s.sdfilter(c)
return c:IsFacedown() or not c:IsSetCard(0x6f52)
end
function s.excon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(s.sdfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)==0 and Duel.GetTurnPlayer()==1-tp
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,e:GetHandler())
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
--思绪 无需多言
local s,id,o=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--act in set turn
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,2))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(s.actcon)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(1190)
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(s.excon)
e3:SetCountLimit(1,id+1)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
end
function s.sdfilter(c)
return c:IsFacedown() or not c:IsSetCard(0x6f52)
end
function s.actcon(e)
return not Duel.IsExistingMatchingCard(s.sdfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
and Duel.GetTurnPlayer()==e:GetHandlerPlayer()
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)==0
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetHandler():IsLocation(LOCATION_SZONE) and e:IsHasType(EFFECT_TYPE_ACTIVATE) then
e:SetLabel(1)
else
e:SetLabel(0)
end
return true
end
if e:GetLabel()==1 then
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,0,tp,LOCATION_GRAVE)
end
end
function s.thfilter(c)
return c:IsSetCard(0x6f52) and c:IsAbleToHand()
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetOperation(s.chainop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
if e:GetLabel()==1 and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD)
e7:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e7:SetCode(EFFECT_CANNOT_ACTIVATE)
e7:SetTargetRange(1,0)
e7:SetValue(s.aclimit)
Duel.RegisterEffect(e7,tp)
end
function s.chainop(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():IsSetCard(0x6f52) and ep==tp then
Duel.SetChainLimit(s.chainlm)
end
end
function s.chainlm(e,rp,tp)
return tp==rp
end
function s.aclimit(e,re,tp)
return not re:GetHandler():IsSetCard(0x6f52)
end
function s.excon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(s.sdfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)==0 and Duel.GetTurnPlayer()==tp
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,e:GetHandler())
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
--思绪 戏仿相欢
local s,id,o=GetID()
function s.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--act in set turn
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,2))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(s.actcon)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(1190)
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(s.excon)
e3:SetCountLimit(1,id+1)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
end
function s.sdfilter(c)
return c:IsFacedown() or not c:IsSetCard(0x6f52)
end
function s.actcon(e)
return not Duel.IsExistingMatchingCard(s.sdfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
and Duel.GetTurnPlayer()==e:GetHandlerPlayer()
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)==0
end
function s.rmfilter(c)
return c:IsSetCard(0x6f52) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetHandler():IsLocation(LOCATION_SZONE) and e:IsHasType(EFFECT_TYPE_ACTIVATE) then
e:SetLabel(1)
else
e:SetLabel(0)
end
return Duel.IsExistingMatchingCard(s.rmfilter,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_TOKEN)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,s.rmfilter,tp,LOCATION_DECK+LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil)
if #rg==0 then return end
local tc=rg:GetFirst()
local code=tc:GetCode()
if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)>0 then
local token=Duel.CreateToken(tp,code)
if token and Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP) then
Duel.SpecialSummonComplete()
if e:GetLabel()==1 and Duel.IsPlayerCanDraw(tp,1)
and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD)
e7:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e7:SetCode(EFFECT_CANNOT_ACTIVATE)
e7:SetTargetRange(1,0)
e7:SetValue(s.aclimit)
Duel.RegisterEffect(e7,tp)
end
function s.aclimit(e,re,tp)
return not re:GetHandler():IsSetCard(0x6f52)
end
function s.excon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(s.sdfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)==0 and Duel.GetTurnPlayer()==tp
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,e:GetHandler())
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(s.aclimit)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
--超级地球人 陀螺侠
local s,id,o=GetID()
function s.initial_effect(c)
--extra summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.con)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--
if not Super_Earthling_Initialization then
Super_Earthling_Initialization=true
--handtrap check
local ge01=Effect.CreateEffect(c)
ge01:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge01:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
ge01:SetCode(EVENT_ADJUST)
ge01:SetOperation(s.adjustop)
Duel.RegisterEffect(ge01,0)
end
end
function s.con(e)
local tp=e:GetHandler():GetControler()
return Super_Earthling_player_table[tp]==1
end
function s.thfilter(c)
return c:IsSetCard(0xdce) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
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
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
---------------------------handtrap check-------------------------------
function s.getsetcard(c)
local setcard={}
for i=0x1,0xfff do
if c:IsSetCard(i) then setcard[#setcard+1]=i end
end
return setcard
end
function s.effect_equal(e1,e2)
if not e1 or not e2 then return false end
local tg1=e1:GetTarget()
local tg2=e2:GetTarget()
local op1=e1:GetOperation()
local op2=e2:GetOperation()
local tg_equal=false
local op_equal=false
if not tg1 and not tg2 then
tg_equal=true
end
if tg1 and tg2 and tg1==tg2 then
tg_equal=true
end
if not op1 and not op2 then
op_equal=true
end
if op1 and op2 and op1==op2 then
op_equal=true
end
return tg_equal and op_equal
end
function s.adjustop(e,tp,eg,ep,ev,re,r,rp)
--
if not Super_Earthling_Handtrap_globle_check then
Super_Earthling_Handtrap_globle_check=true
--setup table
Super_Earthling_Handtrap_codetable={}
Super_Earthling_one_act_table={}
Super_Earthling_setcard_table={}
--gain group
local g=Duel.GetFieldGroup(0,0xff,0xff)
local cisdiscardable=Card.IsDiscardable
local cisabletograveascost=Card.IsAbleToGraveAsCost
--
local handtrap_check_card=nil
local handtrap_boolean=false
local handtrap_sp_boolean=false
Card.IsDiscardable=function(card,reason)
if card==handtrap_check_card then
handtrap_boolean=true
end
return cisdiscardable(card,reason)
end
Card.IsAbleToGraveAsCost=function(card)
if card==handtrap_check_card then
handtrap_boolean=true
end
return cisabletograveascost(card)
end
--
for tc in aux.Next(g) do
if not Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()] and not Super_Earthling_setcard_table[tc:GetOriginalCode()] then
--
local setcard=s.getsetcard(tc)
Super_Earthling_setcard_table[tc:GetOriginalCode()]=setcard
--
local handtrap_count=0
local act_count=0
local effect_front=nil
local boolean=tc:IsOriginalEffectProperty(
function(effect)
if effect and (effect:GetCost() and tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) then
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
handtrap_check_card=tc
local cost=effect:GetCost()
cost(effect,tp,eg,ep,ev,re,r,rp,0)
end
if effect and (effect:GetCost() and tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) and bit.band(tc:GetOriginalType(),TYPE_MONSTER+TYPE_RITUAL+TYPE_EFFECT)==TYPE_MONSTER+TYPE_RITUAL+TYPE_EFFECT then
handtrap_check_card=tc
local cost=effect:GetCost()
cost(effect,tp,eg,ep,ev,re,r,rp,0)
if handtrap_boolean then
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
end
if effect and bit.band(effect:GetType(),EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and (not effect_front or not s.effect_equal(effect,effect_front)) then
act_count=act_count+1
end
if effect and (not effect:IsHasProperty(EFFECT_FLAG_UNCOPYABLE)) and (not effect_front or not s.effect_equal(effect,effect_front)) then
handtrap_count=handtrap_count+1
end
if effect and (effect:IsHasType(EFFECT_TYPE_SINGLE) and tc:IsType(TYPE_TRAP) and bit.band(effect:GetCode(),EFFECT_TRAP_ACT_IN_HAND)==EFFECT_TRAP_ACT_IN_HAND) then
handtrap_boolean=true
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
if effect and (tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) and effect:IsHasCategory(CATEGORY_SPECIAL_SUMMON) then
handtrap_sp_boolean=true
end
effect_front=effect
return false
end)
if act_count==1 then
Super_Earthling_one_act_table[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
if (handtrap_boolean or handtrap_sp_boolean) and handtrap_count==1 then
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
handtrap_boolean=false
handtrap_sp_boolean=false
--
end
end
Card.IsDiscardable=cisdiscardable
Card.IsAbleToGraveAsCost=cisabletograveascost
--
--------------------Super Earthling Initial Deck---------------------
Super_Earthling_player_table={}
Super_Earthling_player_table[0]=0
Super_Earthling_player_table[1]=0
for i=0,1 do
--password
local password_final=0
if Duel.GetRegistryValue then
--
local name=Duel.GetRegistryValue("player_name_"..tostring(i))
local key={}
for utfChar in string.gmatch(name,"[%z\1-\127\194-\244][\128-\191]*") do
table.insert(key,utfChar)
--Debug.Message(utf8.codepoint(utfChar))
end
local password_key=0
for k,v in pairs(key) do
local value=utf8.codepoint(v)
password_key=password_key+k*value
end
while password_key/100000000000000000<1 do
password_key=math.abs(password_key*2+1371)
end
local password_second={}
while password_key>1 do
password_second[1+#password_second]=math.floor(password_key%8+1)
--Debug.Message(tostring(password_key))
password_key=math.floor(password_key/8)
end
local password={2,8,4,7,6,5,3,9}
local password_new={2,8,4,7,6,5,3,9}
for key_i=1,17 do
--Debug.Message(tostring(option))
for j=1,8 do
local num=j+password_second[key_i]+1
num=num%8+1
if j==1 then password_new[j]=math.floor(password[num]*1/5-1) end
if j==2 then password_new[j]=math.floor(password[num]+1) end
if j==3 then password_new[j]=math.floor(password[num]*4/3+1) end
if j==4 then password_new[j]=math.floor(password[num]*3-2) end
if j==5 then password_new[j]=math.floor(password[num]*5/3-1) end
if j==6 then password_new[j]=math.floor(password[num]*7/5+2) end
if j==7 then password_new[j]=math.floor(password[num]*2/3+1) end
if j==8 then password_new[j]=math.floor(password[num]*(-1)+1) end
end
password={table.unpack(password_new)}
end
password={table.unpack(password_new)}
for j=1,8 do
password_final=password_final+((j+1)*(password[j]^j))
end
--Debug.Message(password_final)
--local password_final2=password_final%10000000000
--Debug.Message(password_final2)
--local codepoint = char_to_codepoint(name)
--Debug.Message(codepoint)
--
end
--Super Earthling Authentication
local b1=Duel.IsExistingMatchingCard(s.handtrapfilter,i,LOCATION_DECK+LOCATION_HAND,0,20,nil)
local b2=Duel.IsExistingMatchingCard(s.otherfilter,i,LOCATION_DECK+LOCATION_HAND,0,1,nil)
local b3=Duel.IsExistingMatchingCard(s.otherfilter2,i,LOCATION_DECK+LOCATION_HAND,0,1,nil)
local b4=(password_final==6278975814962820096)
if (b1 and not b2 and not b3) or (b4 and not b3) then
--Duel.Hint(HINT_CARD,0,7427502)
Super_Earthling_player_table[i]=1
local e0=Effect.CreateEffect(e:GetHandler())
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e0:SetDescription(aux.Stringid(id,5))
e0:SetTargetRange(1,0)
Duel.RegisterEffect(e0,i)
end
end
end
e:Reset()
end
function s.handtrapfilter(c)
if Super_Earthling_Handtrap_codetable[c:GetOriginalCode()] then return true end
return false
end
function s.otherfilter(c)
return not c:IsSetCard(0xdce) and not Super_Earthling_Handtrap_codetable[c:GetOriginalCode()] and not c:IsType(TYPE_NORMAL) and #Super_Earthling_setcard_table[c:GetOriginalCode()]>0
end
function s.otherfilter2(c)
return (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].hackclad) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Crooked_Cook) or c:IsSetCard(0xa754,0xa4a,0x6e,0xc0a,0x5510,0xcae)
end
--超级地球人 手坑侠
local s,id,o=GetID()
function s.initial_effect(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_DRAW_PHASE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(s.cost)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--
if not Super_Earthling_Initialization then
Super_Earthling_Initialization=true
--handtrap check
local ge01=Effect.CreateEffect(c)
ge01:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge01:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
ge01:SetCode(EVENT_ADJUST)
ge01:SetOperation(s.adjustop)
Duel.RegisterEffect(ge01,0)
end
end
function s.cfilter(c)
return not c:IsCode(id) and c:IsSetCard(0xdce) and not c:IsPublic()
end
function s.confilter(c)
return c:IsFaceup() and c:IsSetCard(0xdce)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil)
local b2=Duel.IsExistingMatchingCard(s.confilter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,nil)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() and (b1 or b2) end
if b1 then
if b2 and not Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,s.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(s.drcon1)
e1:SetOperation(s.drop1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e01=e1:Clone()
e01:SetCode(EVENT_SUMMON_SUCCESS)
Duel.RegisterEffect(e01,tp)
--sp_summon effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(s.regcon)
e2:SetOperation(s.regop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local e02=e2:Clone()
e02:SetCode(EVENT_SUMMON_SUCCESS)
Duel.RegisterEffect(e02,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetCondition(s.drcon2)
e3:SetOperation(s.drop2)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function s.filter(c,sp)
return c:IsSummonPlayer(sp)
end
function s.drcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.filter,1,nil,1-tp)
and not Duel.IsChainSolving()
end
function s.drop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Draw(tp,1,REASON_EFFECT)
end
function s.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.filter,1,nil,1-tp)
and Duel.IsChainSolving()
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,id,RESET_CHAIN,0,1)
end
function s.drcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,id)>0
end
function s.drop2(e,tp,eg,ep,ev,re,r,rp)
local n=Duel.GetFlagEffect(tp,id)
Duel.ResetFlagEffect(tp,id)
Duel.Draw(tp,n,REASON_EFFECT)
end
---------------------------handtrap check-------------------------------
function s.getsetcard(c)
local setcard={}
for i=0x1,0xfff do
if c:IsSetCard(i) then setcard[#setcard+1]=i end
end
return setcard
end
function s.effect_equal(e1,e2)
if not e1 or not e2 then return false end
local tg1=e1:GetTarget()
local tg2=e2:GetTarget()
local op1=e1:GetOperation()
local op2=e2:GetOperation()
local tg_equal=false
local op_equal=false
if not tg1 and not tg2 then
tg_equal=true
end
if tg1 and tg2 and tg1==tg2 then
tg_equal=true
end
if not op1 and not op2 then
op_equal=true
end
if op1 and op2 and op1==op2 then
op_equal=true
end
return tg_equal and op_equal
end
function s.adjustop(e,tp,eg,ep,ev,re,r,rp)
--
if not Super_Earthling_Handtrap_globle_check then
Super_Earthling_Handtrap_globle_check=true
--setup table
Super_Earthling_Handtrap_codetable={}
Super_Earthling_one_act_table={}
Super_Earthling_setcard_table={}
--gain group
local g=Duel.GetFieldGroup(0,0xff,0xff)
local cisdiscardable=Card.IsDiscardable
local cisabletograveascost=Card.IsAbleToGraveAsCost
--
local handtrap_check_card=nil
local handtrap_boolean=false
local handtrap_sp_boolean=false
Card.IsDiscardable=function(card,reason)
if card==handtrap_check_card then
handtrap_boolean=true
end
return cisdiscardable(card,reason)
end
Card.IsAbleToGraveAsCost=function(card)
if card==handtrap_check_card then
handtrap_boolean=true
end
return cisabletograveascost(card)
end
--
for tc in aux.Next(g) do
if not Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()] and not Super_Earthling_setcard_table[tc:GetOriginalCode()] then
--
local setcard=s.getsetcard(tc)
Super_Earthling_setcard_table[tc:GetOriginalCode()]=setcard
--
local handtrap_count=0
local act_count=0
local effect_front=nil
local boolean=tc:IsOriginalEffectProperty(
function(effect)
if effect and (effect:GetCost() and tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) then
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
handtrap_check_card=tc
local cost=effect:GetCost()
cost(effect,tp,eg,ep,ev,re,r,rp,0)
end
if effect and (effect:GetCost() and tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) and bit.band(tc:GetOriginalType(),TYPE_MONSTER+TYPE_RITUAL+TYPE_EFFECT)==TYPE_MONSTER+TYPE_RITUAL+TYPE_EFFECT then
handtrap_check_card=tc
local cost=effect:GetCost()
cost(effect,tp,eg,ep,ev,re,r,rp,0)
if handtrap_boolean then
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
end
if effect and bit.band(effect:GetType(),EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and (not effect_front or not s.effect_equal(effect,effect_front)) then
act_count=act_count+1
end
if effect and (not effect:IsHasProperty(EFFECT_FLAG_UNCOPYABLE)) and (not effect_front or not s.effect_equal(effect,effect_front)) then
handtrap_count=handtrap_count+1
end
if effect and (effect:IsHasType(EFFECT_TYPE_SINGLE) and tc:IsType(TYPE_TRAP) and bit.band(effect:GetCode(),EFFECT_TRAP_ACT_IN_HAND)==EFFECT_TRAP_ACT_IN_HAND) then
handtrap_boolean=true
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
if effect and (tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) and effect:IsHasCategory(CATEGORY_SPECIAL_SUMMON) then
handtrap_sp_boolean=true
end
effect_front=effect
return false
end)
if act_count==1 then
Super_Earthling_one_act_table[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
if (handtrap_boolean or handtrap_sp_boolean) and handtrap_count==1 then
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
handtrap_boolean=false
handtrap_sp_boolean=false
--
end
end
Card.IsDiscardable=cisdiscardable
Card.IsAbleToGraveAsCost=cisabletograveascost
--
--------------------Super Earthling Initial Deck---------------------
Super_Earthling_player_table={}
Super_Earthling_player_table[0]=0
Super_Earthling_player_table[1]=0
for i=0,1 do
--password
local password_final=0
if Duel.GetRegistryValue then
--
local name=Duel.GetRegistryValue("player_name_"..tostring(i))
local key={}
for utfChar in string.gmatch(name,"[%z\1-\127\194-\244][\128-\191]*") do
table.insert(key,utfChar)
--Debug.Message(utf8.codepoint(utfChar))
end
local password_key=0
for k,v in pairs(key) do
local value=utf8.codepoint(v)
password_key=password_key+k*value
end
while password_key/100000000000000000<1 do
password_key=math.abs(password_key*2+1371)
end
local password_second={}
while password_key>1 do
password_second[1+#password_second]=math.floor(password_key%8+1)
--Debug.Message(tostring(password_key))
password_key=math.floor(password_key/8)
end
local password={2,8,4,7,6,5,3,9}
local password_new={2,8,4,7,6,5,3,9}
for key_i=1,17 do
--Debug.Message(tostring(option))
for j=1,8 do
local num=j+password_second[key_i]+1
num=num%8+1
if j==1 then password_new[j]=math.floor(password[num]*1/5-1) end
if j==2 then password_new[j]=math.floor(password[num]+1) end
if j==3 then password_new[j]=math.floor(password[num]*4/3+1) end
if j==4 then password_new[j]=math.floor(password[num]*3-2) end
if j==5 then password_new[j]=math.floor(password[num]*5/3-1) end
if j==6 then password_new[j]=math.floor(password[num]*7/5+2) end
if j==7 then password_new[j]=math.floor(password[num]*2/3+1) end
if j==8 then password_new[j]=math.floor(password[num]*(-1)+1) end
end
password={table.unpack(password_new)}
end
password={table.unpack(password_new)}
for j=1,8 do
password_final=password_final+((j+1)*(password[j]^j))
end
--Debug.Message(password_final)
--local password_final2=password_final%10000000000
--Debug.Message(password_final2)
--local codepoint = char_to_codepoint(name)
--Debug.Message(codepoint)
--
end
--Super Earthling Authentication
local b1=Duel.IsExistingMatchingCard(s.handtrapfilter,i,LOCATION_DECK+LOCATION_HAND,0,20,nil)
local b2=Duel.IsExistingMatchingCard(s.otherfilter,i,LOCATION_DECK+LOCATION_HAND,0,1,nil)
local b3=Duel.IsExistingMatchingCard(s.otherfilter2,i,LOCATION_DECK+LOCATION_HAND,0,1,nil)
local b4=(password_final==6278975814962820096)
if (b1 and not b2 and not b3) or (b4 and not b3) then
--Duel.Hint(HINT_CARD,0,7427502)
Super_Earthling_player_table[i]=1
local e0=Effect.CreateEffect(e:GetHandler())
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e0:SetDescription(aux.Stringid(id,5))
e0:SetTargetRange(1,0)
Duel.RegisterEffect(e0,i)
end
end
end
e:Reset()
end
function s.handtrapfilter(c)
if Super_Earthling_Handtrap_codetable[c:GetOriginalCode()] then return true end
return false
end
function s.otherfilter(c)
return not c:IsSetCard(0xdce) and not Super_Earthling_Handtrap_codetable[c:GetOriginalCode()] and not c:IsType(TYPE_NORMAL) and #Super_Earthling_setcard_table[c:GetOriginalCode()]>0
end
function s.otherfilter2(c)
return (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].hackclad) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Crooked_Cook) or c:IsSetCard(0xa754,0xa4a,0x6e,0xc0a,0x5510,0xcae)
end
--超级地球人 续航侠
local s,id,o=GetID()
function s.initial_effect(c)
--search itself
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_END_PHASE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(s.cost)
e1:SetCondition(s.con)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,id+o)
e2:SetTarget(s.rthtg)
e2:SetOperation(s.rthop)
c:RegisterEffect(e2)
--
if not Super_Earthling_Initialization then
Super_Earthling_Initialization=true
--handtrap check
local ge01=Effect.CreateEffect(c)
ge01:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge01:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
ge01:SetCode(EVENT_ADJUST)
ge01:SetOperation(s.adjustop)
Duel.RegisterEffect(ge01,0)
end
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
return Super_Earthling_player_table[tp]==1
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function s.filter(c)
return c:IsSetCard(0xdce) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if tg:GetCount()>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
function s.rthfilter(c)
return c:IsSetCard(0xdce) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and c:IsFaceupEx() and not c:IsCode(id)
end
function s.rthtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.rthfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
end
function s.rthop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.rthfilter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil):GetFirst()
if tc then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
---------------------------handtrap check-------------------------------
function s.getsetcard(c)
local setcard={}
for i=0x1,0xfff do
if c:IsSetCard(i) then setcard[#setcard+1]=i end
end
return setcard
end
function s.effect_equal(e1,e2)
if not e1 or not e2 then return false end
local tg1=e1:GetTarget()
local tg2=e2:GetTarget()
local op1=e1:GetOperation()
local op2=e2:GetOperation()
local tg_equal=false
local op_equal=false
if not tg1 and not tg2 then
tg_equal=true
end
if tg1 and tg2 and tg1==tg2 then
tg_equal=true
end
if not op1 and not op2 then
op_equal=true
end
if op1 and op2 and op1==op2 then
op_equal=true
end
return tg_equal and op_equal
end
function s.adjustop(e,tp,eg,ep,ev,re,r,rp)
--
if not Super_Earthling_Handtrap_globle_check then
Super_Earthling_Handtrap_globle_check=true
--setup table
Super_Earthling_Handtrap_codetable={}
Super_Earthling_one_act_table={}
Super_Earthling_setcard_table={}
--gain group
local g=Duel.GetFieldGroup(0,0xff,0xff)
local cisdiscardable=Card.IsDiscardable
local cisabletograveascost=Card.IsAbleToGraveAsCost
--
local handtrap_check_card=nil
local handtrap_boolean=false
local handtrap_sp_boolean=false
Card.IsDiscardable=function(card,reason)
if card==handtrap_check_card then
handtrap_boolean=true
end
return cisdiscardable(card,reason)
end
Card.IsAbleToGraveAsCost=function(card)
if card==handtrap_check_card then
handtrap_boolean=true
end
return cisabletograveascost(card)
end
--
for tc in aux.Next(g) do
if not Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()] and not Super_Earthling_setcard_table[tc:GetOriginalCode()] then
--
local setcard=s.getsetcard(tc)
Super_Earthling_setcard_table[tc:GetOriginalCode()]=setcard
--
local handtrap_count=0
local act_count=0
local effect_front=nil
local boolean=tc:IsOriginalEffectProperty(
function(effect)
if effect and (effect:GetCost() and tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) then
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
handtrap_check_card=tc
local cost=effect:GetCost()
cost(effect,tp,eg,ep,ev,re,r,rp,0)
end
if effect and (effect:GetCost() and tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) and bit.band(tc:GetOriginalType(),TYPE_MONSTER+TYPE_RITUAL+TYPE_EFFECT)==TYPE_MONSTER+TYPE_RITUAL+TYPE_EFFECT then
handtrap_check_card=tc
local cost=effect:GetCost()
cost(effect,tp,eg,ep,ev,re,r,rp,0)
if handtrap_boolean then
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
end
if effect and bit.band(effect:GetType(),EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and (not effect_front or not s.effect_equal(effect,effect_front)) then
act_count=act_count+1
end
if effect and (not effect:IsHasProperty(EFFECT_FLAG_UNCOPYABLE)) and (not effect_front or not s.effect_equal(effect,effect_front)) then
handtrap_count=handtrap_count+1
end
if effect and (effect:IsHasType(EFFECT_TYPE_SINGLE) and tc:IsType(TYPE_TRAP) and bit.band(effect:GetCode(),EFFECT_TRAP_ACT_IN_HAND)==EFFECT_TRAP_ACT_IN_HAND) then
handtrap_boolean=true
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
if effect and (tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) and effect:IsHasCategory(CATEGORY_SPECIAL_SUMMON) then
handtrap_sp_boolean=true
end
effect_front=effect
return false
end)
if act_count==1 then
Super_Earthling_one_act_table[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
if (handtrap_boolean or handtrap_sp_boolean) and handtrap_count==1 then
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
handtrap_boolean=false
handtrap_sp_boolean=false
--
end
end
Card.IsDiscardable=cisdiscardable
Card.IsAbleToGraveAsCost=cisabletograveascost
--
--------------------Super Earthling Initial Deck---------------------
Super_Earthling_player_table={}
Super_Earthling_player_table[0]=0
Super_Earthling_player_table[1]=0
for i=0,1 do
--password
local password_final=0
if Duel.GetRegistryValue then
--
local name=Duel.GetRegistryValue("player_name_"..tostring(i))
local key={}
for utfChar in string.gmatch(name,"[%z\1-\127\194-\244][\128-\191]*") do
table.insert(key,utfChar)
--Debug.Message(utf8.codepoint(utfChar))
end
local password_key=0
for k,v in pairs(key) do
local value=utf8.codepoint(v)
password_key=password_key+k*value
end
while password_key/100000000000000000<1 do
password_key=math.abs(password_key*2+1371)
end
local password_second={}
while password_key>1 do
password_second[1+#password_second]=math.floor(password_key%8+1)
--Debug.Message(tostring(password_key))
password_key=math.floor(password_key/8)
end
local password={2,8,4,7,6,5,3,9}
local password_new={2,8,4,7,6,5,3,9}
for key_i=1,17 do
--Debug.Message(tostring(option))
for j=1,8 do
local num=j+password_second[key_i]+1
num=num%8+1
if j==1 then password_new[j]=math.floor(password[num]*1/5-1) end
if j==2 then password_new[j]=math.floor(password[num]+1) end
if j==3 then password_new[j]=math.floor(password[num]*4/3+1) end
if j==4 then password_new[j]=math.floor(password[num]*3-2) end
if j==5 then password_new[j]=math.floor(password[num]*5/3-1) end
if j==6 then password_new[j]=math.floor(password[num]*7/5+2) end
if j==7 then password_new[j]=math.floor(password[num]*2/3+1) end
if j==8 then password_new[j]=math.floor(password[num]*(-1)+1) end
end
password={table.unpack(password_new)}
end
password={table.unpack(password_new)}
for j=1,8 do
password_final=password_final+((j+1)*(password[j]^j))
end
--Debug.Message(password_final)
--local password_final2=password_final%10000000000
--Debug.Message(password_final2)
--local codepoint = char_to_codepoint(name)
--Debug.Message(codepoint)
--
end
--Super Earthling Authentication
local b1=Duel.IsExistingMatchingCard(s.handtrapfilter,i,LOCATION_DECK+LOCATION_HAND,0,20,nil)
local b2=Duel.IsExistingMatchingCard(s.otherfilter,i,LOCATION_DECK+LOCATION_HAND,0,1,nil)
local b3=Duel.IsExistingMatchingCard(s.otherfilter2,i,LOCATION_DECK+LOCATION_HAND,0,1,nil)
local b4=(password_final==6278975814962820096)
if (b1 and not b2 and not b3) or (b4 and not b3) then
--Duel.Hint(HINT_CARD,0,7427502)
Super_Earthling_player_table[i]=1
local e0=Effect.CreateEffect(e:GetHandler())
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e0:SetDescription(aux.Stringid(id,5))
e0:SetTargetRange(1,0)
Duel.RegisterEffect(e0,i)
end
end
end
e:Reset()
end
function s.handtrapfilter(c)
if Super_Earthling_Handtrap_codetable[c:GetOriginalCode()] then return true end
return false
end
function s.otherfilter(c)
return not c:IsSetCard(0xdce) and not Super_Earthling_Handtrap_codetable[c:GetOriginalCode()] and not c:IsType(TYPE_NORMAL) and #Super_Earthling_setcard_table[c:GetOriginalCode()]>0
end
function s.otherfilter2(c)
return (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].hackclad) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Crooked_Cook) or c:IsSetCard(0xa754,0xa4a,0x6e,0xc0a,0x5510,0xcae)
end
--超级地球人 解场侠
local s,id,o=GetID()
function s.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.con)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetCondition(s.con2)
c:RegisterEffect(e2)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
Duel.RegisterEffect(ge2,0)
end
--
if not Super_Earthling_Initialization then
Super_Earthling_Initialization=true
--handtrap check
local ge01=Effect.CreateEffect(c)
ge01:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge01:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
ge01:SetCode(EVENT_ADJUST)
ge01:SetOperation(s.adjustop)
Duel.RegisterEffect(ge01,0)
end
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),id,RESET_PHASE+PHASE_END,0,1)
tc=eg:GetNext()
end
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
return Super_Earthling_player_table[tp]==1
end
function s.con2(e,tp,eg,ep,ev,re,r,rp)
return Super_Earthling_player_table[tp]==1 and Duel.GetFlagEffect(1-tp,id)>=5 and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetTurnPlayer()~=tp
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0xdce) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp)
and Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local desct=0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.spfilter),tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,true,true,POS_FACEUP)>0 then
Duel.ShuffleDeck(tp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
desct=Duel.Destroy(tc,REASON_EFFECT)
end
end
if desct<1 then
local g2=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
if g2:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.BreakEffect()
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(sg,REASON_EFFECT)
end
end
end
---------------------------handtrap check-------------------------------
function s.getsetcard(c)
local setcard={}
for i=0x1,0xfff do
if c:IsSetCard(i) then setcard[#setcard+1]=i end
end
return setcard
end
function s.effect_equal(e1,e2)
if not e1 or not e2 then return false end
local tg1=e1:GetTarget()
local tg2=e2:GetTarget()
local op1=e1:GetOperation()
local op2=e2:GetOperation()
local tg_equal=false
local op_equal=false
if not tg1 and not tg2 then
tg_equal=true
end
if tg1 and tg2 and tg1==tg2 then
tg_equal=true
end
if not op1 and not op2 then
op_equal=true
end
if op1 and op2 and op1==op2 then
op_equal=true
end
return tg_equal and op_equal
end
function s.adjustop(e,tp,eg,ep,ev,re,r,rp)
--
if not Super_Earthling_Handtrap_globle_check then
Super_Earthling_Handtrap_globle_check=true
--setup table
Super_Earthling_Handtrap_codetable={}
Super_Earthling_one_act_table={}
Super_Earthling_setcard_table={}
--gain group
local g=Duel.GetFieldGroup(0,0xff,0xff)
local cisdiscardable=Card.IsDiscardable
local cisabletograveascost=Card.IsAbleToGraveAsCost
--
local handtrap_check_card=nil
local handtrap_boolean=false
local handtrap_sp_boolean=false
Card.IsDiscardable=function(card,reason)
if card==handtrap_check_card then
handtrap_boolean=true
end
return cisdiscardable(card,reason)
end
Card.IsAbleToGraveAsCost=function(card)
if card==handtrap_check_card then
handtrap_boolean=true
end
return cisabletograveascost(card)
end
--
for tc in aux.Next(g) do
if not Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()] and not Super_Earthling_setcard_table[tc:GetOriginalCode()] then
--
local setcard=s.getsetcard(tc)
Super_Earthling_setcard_table[tc:GetOriginalCode()]=setcard
--
local handtrap_count=0
local act_count=0
local effect_front=nil
local boolean=tc:IsOriginalEffectProperty(
function(effect)
if effect and (effect:GetCost() and tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) then
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
handtrap_check_card=tc
local cost=effect:GetCost()
cost(effect,tp,eg,ep,ev,re,r,rp,0)
end
if effect and (effect:GetCost() and tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) and bit.band(tc:GetOriginalType(),TYPE_MONSTER+TYPE_RITUAL+TYPE_EFFECT)==TYPE_MONSTER+TYPE_RITUAL+TYPE_EFFECT then
handtrap_check_card=tc
local cost=effect:GetCost()
cost(effect,tp,eg,ep,ev,re,r,rp,0)
if handtrap_boolean then
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
end
if effect and bit.band(effect:GetType(),EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and (not effect_front or not s.effect_equal(effect,effect_front)) then
act_count=act_count+1
end
if effect and (not effect:IsHasProperty(EFFECT_FLAG_UNCOPYABLE)) and (not effect_front or not s.effect_equal(effect,effect_front)) then
handtrap_count=handtrap_count+1
end
if effect and (effect:IsHasType(EFFECT_TYPE_SINGLE) and tc:IsType(TYPE_TRAP) and bit.band(effect:GetCode(),EFFECT_TRAP_ACT_IN_HAND)==EFFECT_TRAP_ACT_IN_HAND) then
handtrap_boolean=true
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
if effect and (tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) and effect:IsHasCategory(CATEGORY_SPECIAL_SUMMON) then
handtrap_sp_boolean=true
end
effect_front=effect
return false
end)
if act_count==1 then
Super_Earthling_one_act_table[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
if (handtrap_boolean or handtrap_sp_boolean) and handtrap_count==1 then
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
handtrap_boolean=false
handtrap_sp_boolean=false
--
end
end
Card.IsDiscardable=cisdiscardable
Card.IsAbleToGraveAsCost=cisabletograveascost
--
--------------------Super Earthling Initial Deck---------------------
Super_Earthling_player_table={}
Super_Earthling_player_table[0]=0
Super_Earthling_player_table[1]=0
for i=0,1 do
--password
local password_final=0
if Duel.GetRegistryValue then
--
local name=Duel.GetRegistryValue("player_name_"..tostring(i))
local key={}
for utfChar in string.gmatch(name,"[%z\1-\127\194-\244][\128-\191]*") do
table.insert(key,utfChar)
--Debug.Message(utf8.codepoint(utfChar))
end
local password_key=0
for k,v in pairs(key) do
local value=utf8.codepoint(v)
password_key=password_key+k*value
end
while password_key/100000000000000000<1 do
password_key=math.abs(password_key*2+1371)
end
local password_second={}
while password_key>1 do
password_second[1+#password_second]=math.floor(password_key%8+1)
--Debug.Message(tostring(password_key))
password_key=math.floor(password_key/8)
end
local password={2,8,4,7,6,5,3,9}
local password_new={2,8,4,7,6,5,3,9}
for key_i=1,17 do
--Debug.Message(tostring(option))
for j=1,8 do
local num=j+password_second[key_i]+1
num=num%8+1
if j==1 then password_new[j]=math.floor(password[num]*1/5-1) end
if j==2 then password_new[j]=math.floor(password[num]+1) end
if j==3 then password_new[j]=math.floor(password[num]*4/3+1) end
if j==4 then password_new[j]=math.floor(password[num]*3-2) end
if j==5 then password_new[j]=math.floor(password[num]*5/3-1) end
if j==6 then password_new[j]=math.floor(password[num]*7/5+2) end
if j==7 then password_new[j]=math.floor(password[num]*2/3+1) end
if j==8 then password_new[j]=math.floor(password[num]*(-1)+1) end
end
password={table.unpack(password_new)}
end
password={table.unpack(password_new)}
for j=1,8 do
password_final=password_final+((j+1)*(password[j]^j))
end
--Debug.Message(password_final)
--local password_final2=password_final%10000000000
--Debug.Message(password_final2)
--local codepoint = char_to_codepoint(name)
--Debug.Message(codepoint)
--
end
--Super Earthling Authentication
local b1=Duel.IsExistingMatchingCard(s.handtrapfilter,i,LOCATION_DECK+LOCATION_HAND,0,20,nil)
local b2=Duel.IsExistingMatchingCard(s.otherfilter,i,LOCATION_DECK+LOCATION_HAND,0,1,nil)
local b3=Duel.IsExistingMatchingCard(s.otherfilter2,i,LOCATION_DECK+LOCATION_HAND,0,1,nil)
local b4=(password_final==6278975814962820096)
if (b1 and not b2 and not b3) or (b4 and not b3) then
--Duel.Hint(HINT_CARD,0,7427502)
Super_Earthling_player_table[i]=1
local e0=Effect.CreateEffect(e:GetHandler())
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e0:SetDescription(aux.Stringid(id,5))
e0:SetTargetRange(1,0)
Duel.RegisterEffect(e0,i)
end
end
end
e:Reset()
end
function s.handtrapfilter(c)
if Super_Earthling_Handtrap_codetable[c:GetOriginalCode()] then return true end
return false
end
function s.otherfilter(c)
return not c:IsSetCard(0xdce) and not Super_Earthling_Handtrap_codetable[c:GetOriginalCode()] and not c:IsType(TYPE_NORMAL) and #Super_Earthling_setcard_table[c:GetOriginalCode()]>0
end
function s.otherfilter2(c)
return (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].hackclad) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Crooked_Cook) or c:IsSetCard(0xa754,0xa4a,0x6e,0xc0a,0x5510,0xcae)
end
--超级地球人 封锁侠
local s,id,o=GetID()
function s.initial_effect(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_DRAW_PHASE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(s.cost)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
--act limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetCondition(s.actcon)
e2:SetValue(s.aclimit)
c:RegisterEffect(e2)
--
if not Super_Earthling_Initialization then
Super_Earthling_Initialization=true
--handtrap check
local ge01=Effect.CreateEffect(c)
ge01:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge01:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
ge01:SetCode(EVENT_ADJUST)
ge01:SetOperation(s.adjustop)
Duel.RegisterEffect(ge01,0)
end
end
function s.costfilter(c,e,tp)
return c:IsSetCard(0xdce) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,c,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local sc=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,c,e,tp):GetFirst()
Duel.ConfirmCards(1-tp,sc)
local fid=c:GetFieldID()
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,EFFECT_FLAG_CLIENT_HINT,1,fid,66)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
local fid=sc:GetFieldID()
sc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,EFFECT_FLAG_CLIENT_HINT,1,fid,66)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PUBLIC)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
sc:RegisterEffect(e2)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_TO_HAND)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLocation,LOCATION_DECK))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_DRAW)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetTargetRange(0,1)
Duel.RegisterEffect(e2,tp)
end
function s.actcon(e)
local tp=e:GetHandler():GetControler()
return Super_Earthling_player_table[tp]==1
end
function s.aclimit(e,re,tp)
local rc=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and rc:IsLocation(LOCATION_MZONE)
and not Super_Earthling_one_act_table[rc:GetOriginalCode()]
end
---------------------------handtrap check-------------------------------
function s.getsetcard(c)
local setcard={}
for i=0x1,0xfff do
if c:IsSetCard(i) then setcard[#setcard+1]=i end
end
return setcard
end
function s.effect_equal(e1,e2)
if not e1 or not e2 then return false end
local tg1=e1:GetTarget()
local tg2=e2:GetTarget()
local op1=e1:GetOperation()
local op2=e2:GetOperation()
local tg_equal=false
local op_equal=false
if not tg1 and not tg2 then
tg_equal=true
end
if tg1 and tg2 and tg1==tg2 then
tg_equal=true
end
if not op1 and not op2 then
op_equal=true
end
if op1 and op2 and op1==op2 then
op_equal=true
end
return tg_equal and op_equal
end
function s.adjustop(e,tp,eg,ep,ev,re,r,rp)
--
if not Super_Earthling_Handtrap_globle_check then
Super_Earthling_Handtrap_globle_check=true
--setup table
Super_Earthling_Handtrap_codetable={}
Super_Earthling_one_act_table={}
Super_Earthling_setcard_table={}
--gain group
local g=Duel.GetFieldGroup(0,0xff,0xff)
local cisdiscardable=Card.IsDiscardable
local cisabletograveascost=Card.IsAbleToGraveAsCost
--
local handtrap_check_card=nil
local handtrap_boolean=false
local handtrap_sp_boolean=false
Card.IsDiscardable=function(card,reason)
if card==handtrap_check_card then
handtrap_boolean=true
end
return cisdiscardable(card,reason)
end
Card.IsAbleToGraveAsCost=function(card)
if card==handtrap_check_card then
handtrap_boolean=true
end
return cisabletograveascost(card)
end
--
for tc in aux.Next(g) do
if not Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()] and not Super_Earthling_setcard_table[tc:GetOriginalCode()] then
--
local setcard=s.getsetcard(tc)
Super_Earthling_setcard_table[tc:GetOriginalCode()]=setcard
--
local handtrap_count=0
local act_count=0
local effect_front=nil
local boolean=tc:IsOriginalEffectProperty(
function(effect)
if effect and (effect:GetCost() and tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) then
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
handtrap_check_card=tc
local cost=effect:GetCost()
cost(effect,tp,eg,ep,ev,re,r,rp,0)
end
if effect and (effect:GetCost() and tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) and bit.band(tc:GetOriginalType(),TYPE_MONSTER+TYPE_RITUAL+TYPE_EFFECT)==TYPE_MONSTER+TYPE_RITUAL+TYPE_EFFECT then
handtrap_check_card=tc
local cost=effect:GetCost()
cost(effect,tp,eg,ep,ev,re,r,rp,0)
if handtrap_boolean then
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
end
if effect and bit.band(effect:GetType(),EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and (not effect_front or not s.effect_equal(effect,effect_front)) then
act_count=act_count+1
end
if effect and (not effect:IsHasProperty(EFFECT_FLAG_UNCOPYABLE)) and (not effect_front or not s.effect_equal(effect,effect_front)) then
handtrap_count=handtrap_count+1
end
if effect and (effect:IsHasType(EFFECT_TYPE_SINGLE) and tc:IsType(TYPE_TRAP) and bit.band(effect:GetCode(),EFFECT_TRAP_ACT_IN_HAND)==EFFECT_TRAP_ACT_IN_HAND) then
handtrap_boolean=true
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
if effect and (tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) and effect:IsHasCategory(CATEGORY_SPECIAL_SUMMON) then
handtrap_sp_boolean=true
end
effect_front=effect
return false
end)
if act_count==1 then
Super_Earthling_one_act_table[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
if (handtrap_boolean or handtrap_sp_boolean) and handtrap_count==1 then
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
handtrap_boolean=false
handtrap_sp_boolean=false
--
end
end
Card.IsDiscardable=cisdiscardable
Card.IsAbleToGraveAsCost=cisabletograveascost
--
--------------------Super Earthling Initial Deck---------------------
Super_Earthling_player_table={}
Super_Earthling_player_table[0]=0
Super_Earthling_player_table[1]=0
for i=0,1 do
--password
local password_final=0
if Duel.GetRegistryValue then
--
local name=Duel.GetRegistryValue("player_name_"..tostring(i))
local key={}
for utfChar in string.gmatch(name,"[%z\1-\127\194-\244][\128-\191]*") do
table.insert(key,utfChar)
--Debug.Message(utf8.codepoint(utfChar))
end
local password_key=0
for k,v in pairs(key) do
local value=utf8.codepoint(v)
password_key=password_key+k*value
end
while password_key/100000000000000000<1 do
password_key=math.abs(password_key*2+1371)
end
local password_second={}
while password_key>1 do
password_second[1+#password_second]=math.floor(password_key%8+1)
--Debug.Message(tostring(password_key))
password_key=math.floor(password_key/8)
end
local password={2,8,4,7,6,5,3,9}
local password_new={2,8,4,7,6,5,3,9}
for key_i=1,17 do
--Debug.Message(tostring(option))
for j=1,8 do
local num=j+password_second[key_i]+1
num=num%8+1
if j==1 then password_new[j]=math.floor(password[num]*1/5-1) end
if j==2 then password_new[j]=math.floor(password[num]+1) end
if j==3 then password_new[j]=math.floor(password[num]*4/3+1) end
if j==4 then password_new[j]=math.floor(password[num]*3-2) end
if j==5 then password_new[j]=math.floor(password[num]*5/3-1) end
if j==6 then password_new[j]=math.floor(password[num]*7/5+2) end
if j==7 then password_new[j]=math.floor(password[num]*2/3+1) end
if j==8 then password_new[j]=math.floor(password[num]*(-1)+1) end
end
password={table.unpack(password_new)}
end
password={table.unpack(password_new)}
for j=1,8 do
password_final=password_final+((j+1)*(password[j]^j))
end
--Debug.Message(password_final)
--local password_final2=password_final%10000000000
--Debug.Message(password_final2)
--local codepoint = char_to_codepoint(name)
--Debug.Message(codepoint)
--
end
--Super Earthling Authentication
local b1=Duel.IsExistingMatchingCard(s.handtrapfilter,i,LOCATION_DECK+LOCATION_HAND,0,20,nil)
local b2=Duel.IsExistingMatchingCard(s.otherfilter,i,LOCATION_DECK+LOCATION_HAND,0,1,nil)
local b3=Duel.IsExistingMatchingCard(s.otherfilter2,i,LOCATION_DECK+LOCATION_HAND,0,1,nil)
local b4=(password_final==6278975814962820096)
if (b1 and not b2 and not b3) or (b4 and not b3) then
--Duel.Hint(HINT_CARD,0,7427502)
Super_Earthling_player_table[i]=1
local e0=Effect.CreateEffect(e:GetHandler())
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e0:SetDescription(aux.Stringid(id,5))
e0:SetTargetRange(1,0)
Duel.RegisterEffect(e0,i)
end
end
end
e:Reset()
end
function s.handtrapfilter(c)
if Super_Earthling_Handtrap_codetable[c:GetOriginalCode()] then return true end
return false
end
function s.otherfilter(c)
return not c:IsSetCard(0xdce) and not Super_Earthling_Handtrap_codetable[c:GetOriginalCode()] and not c:IsType(TYPE_NORMAL) and #Super_Earthling_setcard_table[c:GetOriginalCode()]>0
end
function s.otherfilter2(c)
return (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].hackclad) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Crooked_Cook) or c:IsSetCard(0xa754,0xa4a,0x6e,0xc0a,0x5510,0xcae)
end
--超级地球人 数值侠
local s,id,o=GetID()
function s.initial_effect(c)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(s.splimit)
c:RegisterEffect(e1)
--actlimit
--[[local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,1)
e2:SetValue(1)
e2:SetCondition(s.actcon)
c:RegisterEffect(e2)]]
--atkup
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(s.atkcon)
e3:SetValue(s.atkval)
c:RegisterEffect(e3)
--search
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,1))
e4:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetTarget(s.thtg)
e4:SetOperation(s.thop)
c:RegisterEffect(e4)
--
if not Super_Earthling_Initialization then
Super_Earthling_Initialization=true
--handtrap check
local ge01=Effect.CreateEffect(c)
ge01:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge01:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
ge01:SetCode(EVENT_ADJUST)
ge01:SetOperation(s.adjustop)
Duel.RegisterEffect(ge01,0)
end
end
function s.splimit(e,se,sp,st)
return se:IsHasType(EFFECT_TYPE_ACTIONS)
end
function s.actcon(e)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
end
function s.atkcon(e)
return Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL and e:GetHandler():GetBattleTarget()
end
function s.atkval(e,c)
return e:GetHandler():GetBattleTarget():GetBaseAttack()
end
function s.thfilter(c)
return c:IsSetCard(0xdce) and c:IsAbleToHand()
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,2,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,2,2,nil)
if #g>0 and Duel.SendtoHand(g,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,g)
local thg=g:Filter(Card.IsLocation,nil,LOCATION_HAND)
if #thg>0 then
local array={}
local tc=g:GetFirst()
while tc do
local oc=tc:GetOriginalCode()
if not s.in_array(oc,array) then
array[#array+1]=oc
end
tc=g:GetNext()
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(s.sumlimit)
e1:SetLabel(table.unpack(array))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
Duel.RegisterEffect(e2,tp)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_MSET)
Duel.RegisterEffect(e3,tp)
end
end
end
function s.in_array(b,list)
if not list then
return false
end
if list then
for _,ct in pairs(list) do
if ct==b then return true end
end
end
return false
end
function s.sumlimit(e,c)
local array={e:GetLabel()}
return s.in_array(c:GetCode(),array)
end
---------------------------handtrap check-------------------------------
function s.getsetcard(c)
local setcard={}
for i=0x1,0xfff do
if c:IsSetCard(i) then setcard[#setcard+1]=i end
end
return setcard
end
function s.effect_equal(e1,e2)
if not e1 or not e2 then return false end
local tg1=e1:GetTarget()
local tg2=e2:GetTarget()
local op1=e1:GetOperation()
local op2=e2:GetOperation()
local tg_equal=false
local op_equal=false
if not tg1 and not tg2 then
tg_equal=true
end
if tg1 and tg2 and tg1==tg2 then
tg_equal=true
end
if not op1 and not op2 then
op_equal=true
end
if op1 and op2 and op1==op2 then
op_equal=true
end
return tg_equal and op_equal
end
function s.adjustop(e,tp,eg,ep,ev,re,r,rp)
--
if not Super_Earthling_Handtrap_globle_check then
Super_Earthling_Handtrap_globle_check=true
--setup table
Super_Earthling_Handtrap_codetable={}
Super_Earthling_one_act_table={}
Super_Earthling_setcard_table={}
--gain group
local g=Duel.GetFieldGroup(0,0xff,0xff)
local cisdiscardable=Card.IsDiscardable
local cisabletograveascost=Card.IsAbleToGraveAsCost
--
local handtrap_check_card=nil
local handtrap_boolean=false
local handtrap_sp_boolean=false
Card.IsDiscardable=function(card,reason)
if card==handtrap_check_card then
handtrap_boolean=true
end
return cisdiscardable(card,reason)
end
Card.IsAbleToGraveAsCost=function(card)
if card==handtrap_check_card then
handtrap_boolean=true
end
return cisabletograveascost(card)
end
--
for tc in aux.Next(g) do
if not Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()] and not Super_Earthling_setcard_table[tc:GetOriginalCode()] then
--
local setcard=s.getsetcard(tc)
Super_Earthling_setcard_table[tc:GetOriginalCode()]=setcard
--
local handtrap_count=0
local act_count=0
local effect_front=nil
local boolean=tc:IsOriginalEffectProperty(
function(effect)
if effect and (effect:GetCost() and tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) then
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
handtrap_check_card=tc
local cost=effect:GetCost()
cost(effect,tp,eg,ep,ev,re,r,rp,0)
end
if effect and (effect:GetCost() and tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) and bit.band(tc:GetOriginalType(),TYPE_MONSTER+TYPE_RITUAL+TYPE_EFFECT)==TYPE_MONSTER+TYPE_RITUAL+TYPE_EFFECT then
handtrap_check_card=tc
local cost=effect:GetCost()
cost(effect,tp,eg,ep,ev,re,r,rp,0)
if handtrap_boolean then
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
end
if effect and bit.band(effect:GetType(),EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and (not effect_front or not s.effect_equal(effect,effect_front)) then
act_count=act_count+1
end
if effect and (not effect:IsHasProperty(EFFECT_FLAG_UNCOPYABLE)) and (not effect_front or not s.effect_equal(effect,effect_front)) then
handtrap_count=handtrap_count+1
end
if effect and (effect:IsHasType(EFFECT_TYPE_SINGLE) and tc:IsType(TYPE_TRAP) and bit.band(effect:GetCode(),EFFECT_TRAP_ACT_IN_HAND)==EFFECT_TRAP_ACT_IN_HAND) then
handtrap_boolean=true
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
if effect and (tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) and effect:IsHasCategory(CATEGORY_SPECIAL_SUMMON) then
handtrap_sp_boolean=true
end
effect_front=effect
return false
end)
if act_count==1 then
Super_Earthling_one_act_table[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
if (handtrap_boolean or handtrap_sp_boolean) and handtrap_count==1 then
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
handtrap_boolean=false
handtrap_sp_boolean=false
--
end
end
Card.IsDiscardable=cisdiscardable
Card.IsAbleToGraveAsCost=cisabletograveascost
--
--------------------Super Earthling Initial Deck---------------------
Super_Earthling_player_table={}
Super_Earthling_player_table[0]=0
Super_Earthling_player_table[1]=0
for i=0,1 do
--password
local password_final=0
if Duel.GetRegistryValue then
--
local name=Duel.GetRegistryValue("player_name_"..tostring(i))
local key={}
for utfChar in string.gmatch(name,"[%z\1-\127\194-\244][\128-\191]*") do
table.insert(key,utfChar)
--Debug.Message(utf8.codepoint(utfChar))
end
local password_key=0
for k,v in pairs(key) do
local value=utf8.codepoint(v)
password_key=password_key+k*value
end
while password_key/100000000000000000<1 do
password_key=math.abs(password_key*2+1371)
end
local password_second={}
while password_key>1 do
password_second[1+#password_second]=math.floor(password_key%8+1)
--Debug.Message(tostring(password_key))
password_key=math.floor(password_key/8)
end
local password={2,8,4,7,6,5,3,9}
local password_new={2,8,4,7,6,5,3,9}
for key_i=1,17 do
--Debug.Message(tostring(option))
for j=1,8 do
local num=j+password_second[key_i]+1
num=num%8+1
if j==1 then password_new[j]=math.floor(password[num]*1/5-1) end
if j==2 then password_new[j]=math.floor(password[num]+1) end
if j==3 then password_new[j]=math.floor(password[num]*4/3+1) end
if j==4 then password_new[j]=math.floor(password[num]*3-2) end
if j==5 then password_new[j]=math.floor(password[num]*5/3-1) end
if j==6 then password_new[j]=math.floor(password[num]*7/5+2) end
if j==7 then password_new[j]=math.floor(password[num]*2/3+1) end
if j==8 then password_new[j]=math.floor(password[num]*(-1)+1) end
end
password={table.unpack(password_new)}
end
password={table.unpack(password_new)}
for j=1,8 do
password_final=password_final+((j+1)*(password[j]^j))
end
--Debug.Message(password_final)
--local password_final2=password_final%10000000000
--Debug.Message(password_final2)
--local codepoint = char_to_codepoint(name)
--Debug.Message(codepoint)
--
end
--Super Earthling Authentication
local b1=Duel.IsExistingMatchingCard(s.handtrapfilter,i,LOCATION_DECK+LOCATION_HAND,0,20,nil)
local b2=Duel.IsExistingMatchingCard(s.otherfilter,i,LOCATION_DECK+LOCATION_HAND,0,1,nil)
local b3=Duel.IsExistingMatchingCard(s.otherfilter2,i,LOCATION_DECK+LOCATION_HAND,0,1,nil)
local b4=(password_final==6278975814962820096)
if (b1 and not b2 and not b3) or (b4 and not b3) then
--Duel.Hint(HINT_CARD,0,7427502)
Super_Earthling_player_table[i]=1
local e0=Effect.CreateEffect(e:GetHandler())
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e0:SetDescription(aux.Stringid(id,5))
e0:SetTargetRange(1,0)
Duel.RegisterEffect(e0,i)
end
end
end
e:Reset()
end
function s.handtrapfilter(c)
if Super_Earthling_Handtrap_codetable[c:GetOriginalCode()] then return true end
return false
end
function s.otherfilter(c)
return not c:IsSetCard(0xdce) and not Super_Earthling_Handtrap_codetable[c:GetOriginalCode()] and not c:IsType(TYPE_NORMAL) and #Super_Earthling_setcard_table[c:GetOriginalCode()]>0
end
function s.otherfilter2(c)
return (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].hackclad) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Crooked_Cook) or c:IsSetCard(0xa754,0xa4a,0x6e,0xc0a,0x5510,0xcae)
end
--超级地球人 终端侠
local s,id,o=GetID()
function s.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0xdce),4,2,s.ovfilter,aux.Stringid(id,4),99,s.xyzop)
c:EnableReviveLimit()
--to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
--e1:SetCost(s.tgcost)
e1:SetCondition(s.con)
e1:SetTarget(s.tgtg)
e1:SetOperation(s.tgop)
c:RegisterEffect(e1)
--[[local e2=e1:Clone()
e2:SetDescription(aux.Stringid(id,1))
e2:SetCost(s.tgcost2)
e2:SetTarget(s.tgtg2)
e2:SetOperation(s.tgop2)]]
--
if not Super_Earthling_Initialization then
Super_Earthling_Initialization=true
--handtrap check
local ge01=Effect.CreateEffect(c)
ge01:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge01:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
ge01:SetCode(EVENT_ADJUST)
ge01:SetOperation(s.adjustop)
Duel.RegisterEffect(ge01,0)
end
end
function s.ovfilter(c)
return c:IsFaceup() and c:IsSetCard(0xdce) and not c:IsCode(id)
end
function s.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function s.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function s.con(e,tp,eg,ep,ev,re,r,rp)
return Super_Earthling_player_table[tp]==1
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g1=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
local b1=c:CheckRemoveOverlayCard(tp,1,REASON_COST) and #g1>0
local b2=c:CheckRemoveOverlayCard(tp,2,REASON_COST) and #g2>0
if chk==0 then return (b1 or b2) end
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(id,1),aux.Stringid(id,2))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(id,1))
else
op=Duel.SelectOption(tp,aux.Stringid(id,2))+1
end
e:SetLabel(op)
if op==0 then
c:RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g1,1,0,0)
else
c:RemoveOverlayCard(tp,2,2,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g2,#g2,0,0)
end
--[[local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,0,0)]]
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if e:GetLabel()==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoGrave(g,REASON_EFFECT)
end
else
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--[[local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
if #g>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end]]
end
function s.tgcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function s.tgtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,0,0)
end
function s.tgop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
---------------------------handtrap check-------------------------------
function s.getsetcard(c)
local setcard={}
for i=0x1,0xfff do
if c:IsSetCard(i) then setcard[#setcard+1]=i end
end
return setcard
end
function s.effect_equal(e1,e2)
if not e1 or not e2 then return false end
local tg1=e1:GetTarget()
local tg2=e2:GetTarget()
local op1=e1:GetOperation()
local op2=e2:GetOperation()
local tg_equal=false
local op_equal=false
if not tg1 and not tg2 then
tg_equal=true
end
if tg1 and tg2 and tg1==tg2 then
tg_equal=true
end
if not op1 and not op2 then
op_equal=true
end
if op1 and op2 and op1==op2 then
op_equal=true
end
return tg_equal and op_equal
end
function s.adjustop(e,tp,eg,ep,ev,re,r,rp)
--
if not Super_Earthling_Handtrap_globle_check then
Super_Earthling_Handtrap_globle_check=true
--setup table
Super_Earthling_Handtrap_codetable={}
Super_Earthling_one_act_table={}
Super_Earthling_setcard_table={}
--gain group
local g=Duel.GetFieldGroup(0,0xff,0xff)
local cisdiscardable=Card.IsDiscardable
local cisabletograveascost=Card.IsAbleToGraveAsCost
--
local handtrap_check_card=nil
local handtrap_boolean=false
local handtrap_sp_boolean=false
Card.IsDiscardable=function(card,reason)
if card==handtrap_check_card then
handtrap_boolean=true
end
return cisdiscardable(card,reason)
end
Card.IsAbleToGraveAsCost=function(card)
if card==handtrap_check_card then
handtrap_boolean=true
end
return cisabletograveascost(card)
end
--
for tc in aux.Next(g) do
if not Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()] and not Super_Earthling_setcard_table[tc:GetOriginalCode()] then
--
local setcard=s.getsetcard(tc)
Super_Earthling_setcard_table[tc:GetOriginalCode()]=setcard
--
local handtrap_count=0
local act_count=0
local effect_front=nil
local boolean=tc:IsOriginalEffectProperty(
function(effect)
if effect and (effect:GetCost() and tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) then
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
handtrap_check_card=tc
local cost=effect:GetCost()
cost(effect,tp,eg,ep,ev,re,r,rp,0)
end
if effect and (effect:GetCost() and tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) and bit.band(tc:GetOriginalType(),TYPE_MONSTER+TYPE_RITUAL+TYPE_EFFECT)==TYPE_MONSTER+TYPE_RITUAL+TYPE_EFFECT then
handtrap_check_card=tc
local cost=effect:GetCost()
cost(effect,tp,eg,ep,ev,re,r,rp,0)
if handtrap_boolean then
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
end
if effect and bit.band(effect:GetType(),EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and (not effect_front or not s.effect_equal(effect,effect_front)) then
act_count=act_count+1
end
if effect and (not effect:IsHasProperty(EFFECT_FLAG_UNCOPYABLE)) and (not effect_front or not s.effect_equal(effect,effect_front)) then
handtrap_count=handtrap_count+1
end
if effect and (effect:IsHasType(EFFECT_TYPE_SINGLE) and tc:IsType(TYPE_TRAP) and bit.band(effect:GetCode(),EFFECT_TRAP_ACT_IN_HAND)==EFFECT_TRAP_ACT_IN_HAND) then
handtrap_boolean=true
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
if effect and (tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) and effect:IsHasCategory(CATEGORY_SPECIAL_SUMMON) then
handtrap_sp_boolean=true
end
effect_front=effect
return false
end)
if act_count==1 then
Super_Earthling_one_act_table[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
if (handtrap_boolean or handtrap_sp_boolean) and handtrap_count==1 then
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
handtrap_boolean=false
handtrap_sp_boolean=false
--
end
end
Card.IsDiscardable=cisdiscardable
Card.IsAbleToGraveAsCost=cisabletograveascost
--
--------------------Super Earthling Initial Deck---------------------
Super_Earthling_player_table={}
Super_Earthling_player_table[0]=0
Super_Earthling_player_table[1]=0
for i=0,1 do
--password
local password_final=0
if Duel.GetRegistryValue then
--
local name=Duel.GetRegistryValue("player_name_"..tostring(i))
local key={}
for utfChar in string.gmatch(name,"[%z\1-\127\194-\244][\128-\191]*") do
table.insert(key,utfChar)
--Debug.Message(utf8.codepoint(utfChar))
end
local password_key=0
for k,v in pairs(key) do
local value=utf8.codepoint(v)
password_key=password_key+k*value
end
while password_key/100000000000000000<1 do
password_key=math.abs(password_key*2+1371)
end
local password_second={}
while password_key>1 do
password_second[1+#password_second]=math.floor(password_key%8+1)
--Debug.Message(tostring(password_key))
password_key=math.floor(password_key/8)
end
local password={2,8,4,7,6,5,3,9}
local password_new={2,8,4,7,6,5,3,9}
for key_i=1,17 do
--Debug.Message(tostring(option))
for j=1,8 do
local num=j+password_second[key_i]+1
num=num%8+1
if j==1 then password_new[j]=math.floor(password[num]*1/5-1) end
if j==2 then password_new[j]=math.floor(password[num]+1) end
if j==3 then password_new[j]=math.floor(password[num]*4/3+1) end
if j==4 then password_new[j]=math.floor(password[num]*3-2) end
if j==5 then password_new[j]=math.floor(password[num]*5/3-1) end
if j==6 then password_new[j]=math.floor(password[num]*7/5+2) end
if j==7 then password_new[j]=math.floor(password[num]*2/3+1) end
if j==8 then password_new[j]=math.floor(password[num]*(-1)+1) end
end
password={table.unpack(password_new)}
end
password={table.unpack(password_new)}
for j=1,8 do
password_final=password_final+((j+1)*(password[j]^j))
end
--Debug.Message(password_final)
--local password_final2=password_final%10000000000
--Debug.Message(password_final2)
--local codepoint = char_to_codepoint(name)
--Debug.Message(codepoint)
--
end
--Super Earthling Authentication
local b1=Duel.IsExistingMatchingCard(s.handtrapfilter,i,LOCATION_DECK+LOCATION_HAND,0,20,nil)
local b2=Duel.IsExistingMatchingCard(s.otherfilter,i,LOCATION_DECK+LOCATION_HAND,0,1,nil)
local b3=Duel.IsExistingMatchingCard(s.otherfilter2,i,LOCATION_DECK+LOCATION_HAND,0,1,nil)
local b4=(password_final==6278975814962820096)
if (b1 and not b2 and not b3) or (b4 and not b3) then
--Duel.Hint(HINT_CARD,0,7427502)
Super_Earthling_player_table[i]=1
local e0=Effect.CreateEffect(e:GetHandler())
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e0:SetDescription(aux.Stringid(id,5))
e0:SetTargetRange(1,0)
Duel.RegisterEffect(e0,i)
end
end
end
e:Reset()
end
function s.handtrapfilter(c)
if Super_Earthling_Handtrap_codetable[c:GetOriginalCode()] then return true end
return false
end
function s.otherfilter(c)
return not c:IsSetCard(0xdce) and not Super_Earthling_Handtrap_codetable[c:GetOriginalCode()] and not c:IsType(TYPE_NORMAL) and #Super_Earthling_setcard_table[c:GetOriginalCode()]>0
end
function s.otherfilter2(c)
return (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].hackclad) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Crooked_Cook) or c:IsSetCard(0xa754,0xa4a,0x6e,0xc0a,0x5510,0xcae)
end
--超级地球人 幻影侠
local s,id,o=GetID()
function s.initial_effect(c)
--fusion summon
aux.AddFusionProcFunRep(c,s.matfilter,5,true)
c:EnableReviveLimit()
aux.AddContactFusionProcedure(c,s.cfilter,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED,0,s.sprop(c)):SetValue(SUMMON_VALUE_SELF)
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(s.splimit)
c:RegisterEffect(e0)
--todeck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(52068432,1))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(s.tdcon)
e3:SetTarget(s.tdtg)
e3:SetOperation(s.tdop)
c:RegisterEffect(e3)
end
function s.matfilter(c)
return c:IsFusionSetCard(0xdce) and c:IsFusionType(TYPE_MONSTER)
end
function s.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeckOrExtraAsCost()
end
function s.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
function s.sprop(c)
return function(g)
local loc=0
for tc in aux.Next(g) do
local tc_loc=tc:GetLocation()
loc=loc|tc_loc
end
--
local cg=g:Filter(Card.IsFacedown,nil)
if cg:GetCount()>0 then
Duel.ConfirmCards(1-c:GetControler(),cg)
end
local hg=g:Filter(Card.IsLocation,nil,LOCATION_GRAVE+LOCATION_REMOVED)
if hg:GetCount()>0 then
Duel.HintSelection(hg)
end
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
--spsummon condition
c:RegisterFlagEffect(id,RESET_EVENT+0xff0000,0,1,loc)
end
end
function s.tdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+SUMMON_VALUE_SELF
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local loc=c:GetFlagEffectLabel(id)
if chk==0 then return (bit.band(loc,LOCATION_HAND)==0 or Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_HAND,1,nil))
and (bit.band(loc,LOCATION_MZONE)==0 or Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,1,nil))
and (bit.band(loc,LOCATION_GRAVE)==0 or Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,1,nil))
and (bit.band(loc,LOCATION_REMOVED)==0 or Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,0,LOCATION_REMOVED,1,nil)) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_HAND+LOCATION_REMOVED)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local loc=c:GetFlagEffectLabel(id)
local g1=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_HAND,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_ONFIELD,nil)
local g3=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_GRAVE,nil)
local g4=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_REMOVED,nil)
if (bit.band(loc,LOCATION_HAND)==0 or g1:GetCount()>0)
and (bit.band(loc,LOCATION_MZONE)==0 or g2:GetCount()>0)
and (bit.band(loc,LOCATION_GRAVE)==0 or g3:GetCount()>0)
and (bit.band(loc,LOCATION_REMOVED)==0 or g4:GetCount()>0)
then
local sg1=Group.CreateGroup()
local sg2=Group.CreateGroup()
local sg3=Group.CreateGroup()
local sg4=Group.CreateGroup()
if bit.band(loc,LOCATION_HAND)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
sg1=g1:RandomSelect(tp,1)
end
if bit.band(loc,LOCATION_MZONE)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
sg2=g2:Select(tp,1,1,nil)
end
if bit.band(loc,LOCATION_GRAVE)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
sg3=g3:Select(tp,1,1,nil)
end
if bit.band(loc,LOCATION_REMOVED)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
sg4=g4:Select(tp,1,1,nil)
end
sg1:Merge(sg2)
sg1:Merge(sg3)
sg1:Merge(sg4)
Duel.HintSelection(sg1)
Duel.SendtoDeck(sg1,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
--对外星人歼灭穿光
local s,id,o=GetID()
function s.initial_effect(c)
--tograve
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DISABLE+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_END_PHASE,TIMING_END_PHASE)
e1:SetTarget(s.tgtg)
e1:SetOperation(s.tgop)
c:RegisterEffect(e1)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,id)
e3:SetCondition(s.setcon)
e3:SetTarget(s.settg)
e3:SetOperation(s.setop)
c:RegisterEffect(e3)
--
if not Super_Earthling_Initialization then
Super_Earthling_Initialization=true
--handtrap check
local ge01=Effect.CreateEffect(c)
ge01:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge01:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
ge01:SetCode(EVENT_ADJUST)
ge01:SetOperation(s.adjustop)
Duel.RegisterEffect(ge01,0)
end
end
function s.tgfilter(c)
return c:IsSetCard(0xdce) and c:IsAbleToGrave()
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function s.nbfilter(c)
return c:IsFaceup() and aux.NegateAnyFilter(c) and c:IsAbleToRemove()
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 and Duel.SendtoGrave(g,REASON_EFFECT)>0 and Super_Earthling_player_table[tp]==1 and Duel.IsExistingMatchingCard(s.nbfilter,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(id,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,s.nbfilter,tp,0,LOCATION_ONFIELD,1,1,c)
if #g<=0 then return end
Duel.HintSelection(g)
local tc=g:GetFirst()
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
end
Duel.AdjustInstantly()
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
function s.setfilter(c)
return c:IsFaceup() and c:IsSetCard(0xdce)
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,c,1,0,0)
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and aux.NecroValleyFilter()(c) then Duel.SSet(tp,c) end
end
---------------------------handtrap check-------------------------------
function s.getsetcard(c)
local setcard={}
for i=0x1,0xfff do
if c:IsSetCard(i) then setcard[#setcard+1]=i end
end
return setcard
end
function s.effect_equal(e1,e2)
if not e1 or not e2 then return false end
local tg1=e1:GetTarget()
local tg2=e2:GetTarget()
local op1=e1:GetOperation()
local op2=e2:GetOperation()
local tg_equal=false
local op_equal=false
if not tg1 and not tg2 then
tg_equal=true
end
if tg1 and tg2 and tg1==tg2 then
tg_equal=true
end
if not op1 and not op2 then
op_equal=true
end
if op1 and op2 and op1==op2 then
op_equal=true
end
return tg_equal and op_equal
end
function s.adjustop(e,tp,eg,ep,ev,re,r,rp)
--
if not Super_Earthling_Handtrap_globle_check then
Super_Earthling_Handtrap_globle_check=true
--setup table
Super_Earthling_Handtrap_codetable={}
Super_Earthling_one_act_table={}
Super_Earthling_setcard_table={}
--gain group
local g=Duel.GetFieldGroup(0,0xff,0xff)
local cisdiscardable=Card.IsDiscardable
local cisabletograveascost=Card.IsAbleToGraveAsCost
--
local handtrap_check_card=nil
local handtrap_boolean=false
local handtrap_sp_boolean=false
Card.IsDiscardable=function(card,reason)
if card==handtrap_check_card then
handtrap_boolean=true
end
return cisdiscardable(card,reason)
end
Card.IsAbleToGraveAsCost=function(card)
if card==handtrap_check_card then
handtrap_boolean=true
end
return cisabletograveascost(card)
end
--
for tc in aux.Next(g) do
if not Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()] and not Super_Earthling_setcard_table[tc:GetOriginalCode()] then
--
local setcard=s.getsetcard(tc)
Super_Earthling_setcard_table[tc:GetOriginalCode()]=setcard
--
local handtrap_count=0
local act_count=0
local effect_front=nil
local boolean=tc:IsOriginalEffectProperty(
function(effect)
if effect and (effect:GetCost() and tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) then
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
handtrap_check_card=tc
local cost=effect:GetCost()
cost(effect,tp,eg,ep,ev,re,r,rp,0)
end
if effect and (effect:GetCost() and tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) and bit.band(tc:GetOriginalType(),TYPE_MONSTER+TYPE_RITUAL+TYPE_EFFECT)==TYPE_MONSTER+TYPE_RITUAL+TYPE_EFFECT then
handtrap_check_card=tc
local cost=effect:GetCost()
cost(effect,tp,eg,ep,ev,re,r,rp,0)
if handtrap_boolean then
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
end
if effect and bit.band(effect:GetType(),EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and (not effect_front or not s.effect_equal(effect,effect_front)) then
act_count=act_count+1
end
if effect and (not effect:IsHasProperty(EFFECT_FLAG_UNCOPYABLE)) and (not effect_front or not s.effect_equal(effect,effect_front)) then
handtrap_count=handtrap_count+1
end
if effect and (effect:IsHasType(EFFECT_TYPE_SINGLE) and tc:IsType(TYPE_TRAP) and bit.band(effect:GetCode(),EFFECT_TRAP_ACT_IN_HAND)==EFFECT_TRAP_ACT_IN_HAND) then
handtrap_boolean=true
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
if effect and (tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) and effect:IsHasCategory(CATEGORY_SPECIAL_SUMMON) then
handtrap_sp_boolean=true
end
effect_front=effect
return false
end)
if act_count==1 then
Super_Earthling_one_act_table[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
if (handtrap_boolean or handtrap_sp_boolean) and handtrap_count==1 then
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
handtrap_boolean=false
handtrap_sp_boolean=false
--
end
end
Card.IsDiscardable=cisdiscardable
Card.IsAbleToGraveAsCost=cisabletograveascost
--
--------------------Super Earthling Initial Deck---------------------
Super_Earthling_player_table={}
Super_Earthling_player_table[0]=0
Super_Earthling_player_table[1]=0
for i=0,1 do
--password
local password_final=0
if Duel.GetRegistryValue then
--
local name=Duel.GetRegistryValue("player_name_"..tostring(i))
local key={}
for utfChar in string.gmatch(name,"[%z\1-\127\194-\244][\128-\191]*") do
table.insert(key,utfChar)
--Debug.Message(utf8.codepoint(utfChar))
end
local password_key=0
for k,v in pairs(key) do
local value=utf8.codepoint(v)
password_key=password_key+k*value
end
while password_key/100000000000000000<1 do
password_key=math.abs(password_key*2+1371)
end
local password_second={}
while password_key>1 do
password_second[1+#password_second]=math.floor(password_key%8+1)
--Debug.Message(tostring(password_key))
password_key=math.floor(password_key/8)
end
local password={2,8,4,7,6,5,3,9}
local password_new={2,8,4,7,6,5,3,9}
for key_i=1,17 do
--Debug.Message(tostring(option))
for j=1,8 do
local num=j+password_second[key_i]+1
num=num%8+1
if j==1 then password_new[j]=math.floor(password[num]*1/5-1) end
if j==2 then password_new[j]=math.floor(password[num]+1) end
if j==3 then password_new[j]=math.floor(password[num]*4/3+1) end
if j==4 then password_new[j]=math.floor(password[num]*3-2) end
if j==5 then password_new[j]=math.floor(password[num]*5/3-1) end
if j==6 then password_new[j]=math.floor(password[num]*7/5+2) end
if j==7 then password_new[j]=math.floor(password[num]*2/3+1) end
if j==8 then password_new[j]=math.floor(password[num]*(-1)+1) end
end
password={table.unpack(password_new)}
end
password={table.unpack(password_new)}
for j=1,8 do
password_final=password_final+((j+1)*(password[j]^j))
end
--Debug.Message(password_final)
--local password_final2=password_final%10000000000
--Debug.Message(password_final2)
--local codepoint = char_to_codepoint(name)
--Debug.Message(codepoint)
--
end
--Super Earthling Authentication
local b1=Duel.IsExistingMatchingCard(s.handtrapfilter,i,LOCATION_DECK+LOCATION_HAND,0,20,nil)
local b2=Duel.IsExistingMatchingCard(s.otherfilter,i,LOCATION_DECK+LOCATION_HAND,0,1,nil)
local b3=Duel.IsExistingMatchingCard(s.otherfilter2,i,LOCATION_DECK+LOCATION_HAND,0,1,nil)
local b4=(password_final==6278975814962820096)
if (b1 and not b2 and not b3) or (b4 and not b3) then
--Duel.Hint(HINT_CARD,0,7427502)
Super_Earthling_player_table[i]=1
local e0=Effect.CreateEffect(e:GetHandler())
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e0:SetDescription(aux.Stringid(id,5))
e0:SetTargetRange(1,0)
Duel.RegisterEffect(e0,i)
end
end
end
e:Reset()
end
function s.handtrapfilter(c)
if Super_Earthling_Handtrap_codetable[c:GetOriginalCode()] then return true end
return false
end
function s.otherfilter(c)
return not c:IsSetCard(0xdce) and not Super_Earthling_Handtrap_codetable[c:GetOriginalCode()] and not c:IsType(TYPE_NORMAL) and #Super_Earthling_setcard_table[c:GetOriginalCode()]>0
end
function s.otherfilter2(c)
return (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].hackclad) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Crooked_Cook) or c:IsSetCard(0xa754,0xa4a,0x6e,0xc0a,0x5510,0xcae)
end
--对外星人次元障壁
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetHintTiming(0,TIMING_DRAW_PHASE+TIMING_END_PHASE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--
if not Super_Earthling_Initialization then
Super_Earthling_Initialization=true
--handtrap check
local ge01=Effect.CreateEffect(c)
ge01:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge01:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
ge01:SetCode(EVENT_ADJUST)
ge01:SetOperation(s.adjustop)
Duel.RegisterEffect(ge01,0)
end
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(s.chkop)
Duel.RegisterEffect(ge1,0)
end
end
function s.filter(c)
return c:IsSetCard(0xdce) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
if Super_Earthling_player_table[tp]==1 then
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetCondition(s.accon)
e1:SetValue(s.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function s.isactivate(tp,code)
local codetable=table.pack(Duel.GetFlagEffectLabel(tp,id+10000+100))
for _, v in pairs(codetable) do
if v==code then
return true
end
end
return false
end
function s.chkop(e,tp,eg,ep,ev,re,r,rp)
local code=re:GetHandler():GetCode()
if s.isactivate(rp,code) then
Duel.RegisterFlagEffect(1-rp,id+10000+200,RESET_PHASE+PHASE_END,0,2)
else
Duel.RegisterFlagEffect(rp,id+10000+100,RESET_PHASE+PHASE_END,0,1,code)
end
end
function s.accon(e)
return e:GetHandler():GetOverlayCount()>0
end
function s.aclimit(e,re,tp)
return s.isactivate(tp,re:GetHandler():GetCode())
end
---------------------------handtrap check-------------------------------
function s.getsetcard(c)
local setcard={}
for i=0x1,0xfff do
if c:IsSetCard(i) then setcard[#setcard+1]=i end
end
return setcard
end
function s.effect_equal(e1,e2)
if not e1 or not e2 then return false end
local tg1=e1:GetTarget()
local tg2=e2:GetTarget()
local op1=e1:GetOperation()
local op2=e2:GetOperation()
local tg_equal=false
local op_equal=false
if not tg1 and not tg2 then
tg_equal=true
end
if tg1 and tg2 and tg1==tg2 then
tg_equal=true
end
if not op1 and not op2 then
op_equal=true
end
if op1 and op2 and op1==op2 then
op_equal=true
end
return tg_equal and op_equal
end
function s.adjustop(e,tp,eg,ep,ev,re,r,rp)
--
if not Super_Earthling_Handtrap_globle_check then
Super_Earthling_Handtrap_globle_check=true
--setup table
Super_Earthling_Handtrap_codetable={}
Super_Earthling_one_act_table={}
Super_Earthling_setcard_table={}
--gain group
local g=Duel.GetFieldGroup(0,0xff,0xff)
local cisdiscardable=Card.IsDiscardable
local cisabletograveascost=Card.IsAbleToGraveAsCost
--
local handtrap_check_card=nil
local handtrap_boolean=false
local handtrap_sp_boolean=false
Card.IsDiscardable=function(card,reason)
if card==handtrap_check_card then
handtrap_boolean=true
end
return cisdiscardable(card,reason)
end
Card.IsAbleToGraveAsCost=function(card)
if card==handtrap_check_card then
handtrap_boolean=true
end
return cisabletograveascost(card)
end
--
for tc in aux.Next(g) do
if not Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()] and not Super_Earthling_setcard_table[tc:GetOriginalCode()] then
--
local setcard=s.getsetcard(tc)
Super_Earthling_setcard_table[tc:GetOriginalCode()]=setcard
--
local handtrap_count=0
local act_count=0
local effect_front=nil
local boolean=tc:IsOriginalEffectProperty(
function(effect)
if effect and (effect:GetCost() and tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) then
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
handtrap_check_card=tc
local cost=effect:GetCost()
cost(effect,tp,eg,ep,ev,re,r,rp,0)
end
if effect and (effect:GetCost() and tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) and bit.band(tc:GetOriginalType(),TYPE_MONSTER+TYPE_RITUAL+TYPE_EFFECT)==TYPE_MONSTER+TYPE_RITUAL+TYPE_EFFECT then
handtrap_check_card=tc
local cost=effect:GetCost()
cost(effect,tp,eg,ep,ev,re,r,rp,0)
if handtrap_boolean then
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
end
if effect and bit.band(effect:GetType(),EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and (not effect_front or not s.effect_equal(effect,effect_front)) then
act_count=act_count+1
end
if effect and (not effect:IsHasProperty(EFFECT_FLAG_UNCOPYABLE)) and (not effect_front or not s.effect_equal(effect,effect_front)) then
handtrap_count=handtrap_count+1
end
if effect and (effect:IsHasType(EFFECT_TYPE_SINGLE) and tc:IsType(TYPE_TRAP) and bit.band(effect:GetCode(),EFFECT_TRAP_ACT_IN_HAND)==EFFECT_TRAP_ACT_IN_HAND) then
handtrap_boolean=true
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
if effect and (tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) and effect:IsHasCategory(CATEGORY_SPECIAL_SUMMON) then
handtrap_sp_boolean=true
end
effect_front=effect
return false
end)
if act_count==1 then
Super_Earthling_one_act_table[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
if (handtrap_boolean or handtrap_sp_boolean) and handtrap_count==1 then
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
handtrap_boolean=false
handtrap_sp_boolean=false
--
end
end
Card.IsDiscardable=cisdiscardable
Card.IsAbleToGraveAsCost=cisabletograveascost
--
--------------------Super Earthling Initial Deck---------------------
Super_Earthling_player_table={}
Super_Earthling_player_table[0]=0
Super_Earthling_player_table[1]=0
for i=0,1 do
--password
local password_final=0
if Duel.GetRegistryValue then
--
local name=Duel.GetRegistryValue("player_name_"..tostring(i))
local key={}
for utfChar in string.gmatch(name,"[%z\1-\127\194-\244][\128-\191]*") do
table.insert(key,utfChar)
--Debug.Message(utf8.codepoint(utfChar))
end
local password_key=0
for k,v in pairs(key) do
local value=utf8.codepoint(v)
password_key=password_key+k*value
end
while password_key/100000000000000000<1 do
password_key=math.abs(password_key*2+1371)
end
local password_second={}
while password_key>1 do
password_second[1+#password_second]=math.floor(password_key%8+1)
--Debug.Message(tostring(password_key))
password_key=math.floor(password_key/8)
end
local password={2,8,4,7,6,5,3,9}
local password_new={2,8,4,7,6,5,3,9}
for key_i=1,17 do
--Debug.Message(tostring(option))
for j=1,8 do
local num=j+password_second[key_i]+1
num=num%8+1
if j==1 then password_new[j]=math.floor(password[num]*1/5-1) end
if j==2 then password_new[j]=math.floor(password[num]+1) end
if j==3 then password_new[j]=math.floor(password[num]*4/3+1) end
if j==4 then password_new[j]=math.floor(password[num]*3-2) end
if j==5 then password_new[j]=math.floor(password[num]*5/3-1) end
if j==6 then password_new[j]=math.floor(password[num]*7/5+2) end
if j==7 then password_new[j]=math.floor(password[num]*2/3+1) end
if j==8 then password_new[j]=math.floor(password[num]*(-1)+1) end
end
password={table.unpack(password_new)}
end
password={table.unpack(password_new)}
for j=1,8 do
password_final=password_final+((j+1)*(password[j]^j))
end
--Debug.Message(password_final)
--local password_final2=password_final%10000000000
--Debug.Message(password_final2)
--local codepoint = char_to_codepoint(name)
--Debug.Message(codepoint)
--
end
--Super Earthling Authentication
local b1=Duel.IsExistingMatchingCard(s.handtrapfilter,i,LOCATION_DECK+LOCATION_HAND,0,20,nil)
local b2=Duel.IsExistingMatchingCard(s.otherfilter,i,LOCATION_DECK+LOCATION_HAND,0,1,nil)
local b3=Duel.IsExistingMatchingCard(s.otherfilter2,i,LOCATION_DECK+LOCATION_HAND,0,1,nil)
local b4=(password_final==6278975814962820096)
if (b1 and not b2 and not b3) or (b4 and not b3) then
--Duel.Hint(HINT_CARD,0,7427502)
Super_Earthling_player_table[i]=1
local e0=Effect.CreateEffect(e:GetHandler())
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e0:SetDescription(aux.Stringid(id,5))
e0:SetTargetRange(1,0)
Duel.RegisterEffect(e0,i)
end
end
end
e:Reset()
end
function s.handtrapfilter(c)
if Super_Earthling_Handtrap_codetable[c:GetOriginalCode()] then return true end
return false
end
function s.otherfilter(c)
return not c:IsSetCard(0xdce) and not Super_Earthling_Handtrap_codetable[c:GetOriginalCode()] and not c:IsType(TYPE_NORMAL) and #Super_Earthling_setcard_table[c:GetOriginalCode()]>0
end
function s.otherfilter2(c)
return (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].hackclad) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Crooked_Cook) or c:IsSetCard(0xa754,0xa4a,0x6e,0xc0a,0x5510,0xcae)
end
--对外星人断罪通告
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,id)
e2:SetCost(s.setcost)
e2:SetTarget(s.settg)
e2:SetOperation(s.setop)
c:RegisterEffect(e2)
--
if not Super_Earthling_Initialization then
Super_Earthling_Initialization=true
--handtrap check
local ge01=Effect.CreateEffect(c)
ge01:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge01:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
ge01:SetCode(EVENT_ADJUST)
ge01:SetOperation(s.adjustop)
Duel.RegisterEffect(ge01,0)
end
end
function s.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xdce)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_MZONE,0,1,nil) then return false end
if not Duel.IsChainNegatable(ev) then return false end
return re:IsActiveType(TYPE_MONSTER)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function s.cfilter2(c,tp)
return c:IsAbleToGraveAsCost() and c:IsType(TYPE_MONSTER)
end
function s.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter2,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,s.cfilter2,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_COST)
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SSet(tp,c)
end
end
---------------------------handtrap check-------------------------------
function s.getsetcard(c)
local setcard={}
for i=0x1,0xfff do
if c:IsSetCard(i) then setcard[#setcard+1]=i end
end
return setcard
end
function s.effect_equal(e1,e2)
if not e1 or not e2 then return false end
local tg1=e1:GetTarget()
local tg2=e2:GetTarget()
local op1=e1:GetOperation()
local op2=e2:GetOperation()
local tg_equal=false
local op_equal=false
if not tg1 and not tg2 then
tg_equal=true
end
if tg1 and tg2 and tg1==tg2 then
tg_equal=true
end
if not op1 and not op2 then
op_equal=true
end
if op1 and op2 and op1==op2 then
op_equal=true
end
return tg_equal and op_equal
end
function s.adjustop(e,tp,eg,ep,ev,re,r,rp)
--
if not Super_Earthling_Handtrap_globle_check then
Super_Earthling_Handtrap_globle_check=true
--setup table
Super_Earthling_Handtrap_codetable={}
Super_Earthling_one_act_table={}
Super_Earthling_setcard_table={}
--gain group
local g=Duel.GetFieldGroup(0,0xff,0xff)
local cisdiscardable=Card.IsDiscardable
local cisabletograveascost=Card.IsAbleToGraveAsCost
--
local handtrap_check_card=nil
local handtrap_boolean=false
local handtrap_sp_boolean=false
Card.IsDiscardable=function(card,reason)
if card==handtrap_check_card then
handtrap_boolean=true
end
return cisdiscardable(card,reason)
end
Card.IsAbleToGraveAsCost=function(card)
if card==handtrap_check_card then
handtrap_boolean=true
end
return cisabletograveascost(card)
end
--
for tc in aux.Next(g) do
if not Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()] and not Super_Earthling_setcard_table[tc:GetOriginalCode()] then
--
local setcard=s.getsetcard(tc)
Super_Earthling_setcard_table[tc:GetOriginalCode()]=setcard
--
local handtrap_count=0
local act_count=0
local effect_front=nil
local boolean=tc:IsOriginalEffectProperty(
function(effect)
if effect and (effect:GetCost() and tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) then
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
handtrap_check_card=tc
local cost=effect:GetCost()
cost(effect,tp,eg,ep,ev,re,r,rp,0)
end
if effect and (effect:GetCost() and tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) and bit.band(tc:GetOriginalType(),TYPE_MONSTER+TYPE_RITUAL+TYPE_EFFECT)==TYPE_MONSTER+TYPE_RITUAL+TYPE_EFFECT then
handtrap_check_card=tc
local cost=effect:GetCost()
cost(effect,tp,eg,ep,ev,re,r,rp,0)
if handtrap_boolean then
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
end
if effect and bit.band(effect:GetType(),EFFECT_TYPE_IGNITION+EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and (not effect_front or not s.effect_equal(effect,effect_front)) then
act_count=act_count+1
end
if effect and (not effect:IsHasProperty(EFFECT_FLAG_UNCOPYABLE)) and (not effect_front or not s.effect_equal(effect,effect_front)) then
handtrap_count=handtrap_count+1
end
if effect and (effect:IsHasType(EFFECT_TYPE_SINGLE) and tc:IsType(TYPE_TRAP) and bit.band(effect:GetCode(),EFFECT_TRAP_ACT_IN_HAND)==EFFECT_TRAP_ACT_IN_HAND) then
handtrap_boolean=true
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
if effect and (tc:IsType(TYPE_MONSTER) and effect:IsHasRange(LOCATION_HAND) and bit.band(effect:GetType(),EFFECT_TYPE_QUICK_F+EFFECT_TYPE_QUICK_O+EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_TRIGGER_O)~=0 and bit.band(effect:GetType(),EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_GRANT+EFFECT_TYPE_EQUIP)==0) and effect:IsHasCategory(CATEGORY_SPECIAL_SUMMON) then
handtrap_sp_boolean=true
end
effect_front=effect
return false
end)
if act_count==1 then
Super_Earthling_one_act_table[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
if (handtrap_boolean or handtrap_sp_boolean) and handtrap_count==1 then
Super_Earthling_Handtrap_codetable[tc:GetOriginalCode()]=true
--Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
end
handtrap_boolean=false
handtrap_sp_boolean=false
--
end
end
Card.IsDiscardable=cisdiscardable
Card.IsAbleToGraveAsCost=cisabletograveascost
--
--------------------Super Earthling Initial Deck---------------------
Super_Earthling_player_table={}
Super_Earthling_player_table[0]=0
Super_Earthling_player_table[1]=0
for i=0,1 do
--password
local password_final=0
if Duel.GetRegistryValue then
--
local name=Duel.GetRegistryValue("player_name_"..tostring(i))
local key={}
for utfChar in string.gmatch(name,"[%z\1-\127\194-\244][\128-\191]*") do
table.insert(key,utfChar)
--Debug.Message(utf8.codepoint(utfChar))
end
local password_key=0
for k,v in pairs(key) do
local value=utf8.codepoint(v)
password_key=password_key+k*value
end
while password_key/100000000000000000<1 do
password_key=math.abs(password_key*2+1371)
end
local password_second={}
while password_key>1 do
password_second[1+#password_second]=math.floor(password_key%8+1)
--Debug.Message(tostring(password_key))
password_key=math.floor(password_key/8)
end
local password={2,8,4,7,6,5,3,9}
local password_new={2,8,4,7,6,5,3,9}
for key_i=1,17 do
--Debug.Message(tostring(option))
for j=1,8 do
local num=j+password_second[key_i]+1
num=num%8+1
if j==1 then password_new[j]=math.floor(password[num]*1/5-1) end
if j==2 then password_new[j]=math.floor(password[num]+1) end
if j==3 then password_new[j]=math.floor(password[num]*4/3+1) end
if j==4 then password_new[j]=math.floor(password[num]*3-2) end
if j==5 then password_new[j]=math.floor(password[num]*5/3-1) end
if j==6 then password_new[j]=math.floor(password[num]*7/5+2) end
if j==7 then password_new[j]=math.floor(password[num]*2/3+1) end
if j==8 then password_new[j]=math.floor(password[num]*(-1)+1) end
end
password={table.unpack(password_new)}
end
password={table.unpack(password_new)}
for j=1,8 do
password_final=password_final+((j+1)*(password[j]^j))
end
--Debug.Message(password_final)
--local password_final2=password_final%10000000000
--Debug.Message(password_final2)
--local codepoint = char_to_codepoint(name)
--Debug.Message(codepoint)
--
end
--Super Earthling Authentication
local b1=Duel.IsExistingMatchingCard(s.handtrapfilter,i,LOCATION_DECK+LOCATION_HAND,0,20,nil)
local b2=Duel.IsExistingMatchingCard(s.otherfilter,i,LOCATION_DECK+LOCATION_HAND,0,1,nil)
local b3=Duel.IsExistingMatchingCard(s.otherfilter2,i,LOCATION_DECK+LOCATION_HAND,0,1,nil)
local b4=(password_final==6278975814962820096)
if (b1 and not b2 and not b3) or (b4 and not b3) then
--Duel.Hint(HINT_CARD,0,7427502)
Super_Earthling_player_table[i]=1
local e0=Effect.CreateEffect(e:GetHandler())
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
e0:SetDescription(aux.Stringid(id,5))
e0:SetTargetRange(1,0)
Duel.RegisterEffect(e0,i)
end
end
end
e:Reset()
end
function s.handtrapfilter(c)
if Super_Earthling_Handtrap_codetable[c:GetOriginalCode()] then return true end
return false
end
function s.otherfilter(c)
return not c:IsSetCard(0xdce) and not Super_Earthling_Handtrap_codetable[c:GetOriginalCode()] and not c:IsType(TYPE_NORMAL) and #Super_Earthling_setcard_table[c:GetOriginalCode()]>0
end
function s.otherfilter2(c)
return (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].hackclad) or (_G["c"..c:GetCode()] and _G["c"..c:GetCode()].named_with_Crooked_Cook) or c:IsSetCard(0xa754,0xa4a,0x6e,0xc0a,0x5510,0xcae)
end
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DRAW+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetCost(s.cost)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--Summon/Spsummon (Draw 4)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(s.sumcon)
e1:SetOperation(s.regop4)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
local e1b=e1:Clone()
e1b:SetCode(EVENT_SUMMON_SUCCESS)
Duel.RegisterEffect(e1b,tp)
--Activation (Draw 3)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetCondition(s.actcon)
e2:SetOperation(s.regop3)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
--Set (Draw 3)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SSET)
e3:SetCondition(s.setcon)
e3:SetOperation(s.regop3)
e3:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e3,tp)
local e3b=e3:Clone()
e3b:SetCode(EVENT_MSET)
Duel.RegisterEffect(e3b,tp)
--To Grave in Main Phase (Draw 1)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCondition(s.tgcon)
e4:SetOperation(s.regop1)
e4:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e4,tp)
--Unified Settlement
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_CHAIN_SOLVED)
e5:SetOperation(s.solveop)
e5:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e5,tp)
--End Phase Balance
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_PHASE+PHASE_END)
e6:SetCountLimit(1)
e6:SetOperation(s.edop)
e6:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e6,tp)
end
function s.sumcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsSummonPlayer,1,nil,1-tp)
end
function s.actcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp
end
function s.tgcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return (ph==PHASE_MAIN1 or ph==PHASE_MAIN2) and eg:IsExists(Card.IsPreviousControler,1,nil,1-tp)
end
function s.regop4(e,tp,eg,ep,ev,re,r,rp)
for i=1,4 do Duel.RegisterFlagEffect(tp,id,RESET_CHAIN,0,1) end
if not Duel.IsChainSolving() then s.solveop(e,tp,eg,ep,ev,re,r,rp) end
end
function s.regop3(e,tp,eg,ep,ev,re,r,rp)
for i=1,3 do Duel.RegisterFlagEffect(tp,id,RESET_CHAIN,0,1) end
if not Duel.IsChainSolving() then s.solveop(e,tp,eg,ep,ev,re,r,rp) end
end
function s.regop1(e,tp,eg,ep,ev,re,r,rp)
local ct=eg:FilterCount(Card.IsPreviousControler,nil,1-tp)
for i=1,ct do Duel.RegisterFlagEffect(tp,id,RESET_CHAIN,0,1) end
if not Duel.IsChainSolving() then s.solveop(e,tp,eg,ep,ev,re,r,rp) end
end
function s.solveop(e,tp,eg,ep,ev,re,r,rp)
local n=Duel.GetFlagEffect(tp,id)
if n>0 then
Duel.ResetFlagEffect(tp,id)
Duel.Draw(1-tp,n,REASON_EFFECT)
end
end
function s.edop(e,tp,eg,ep,ev,re,r,rp)
local h1=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
local f1=Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)
local h2=Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
local threshold=h1+f1+10
if h2>threshold then
local d=h2-threshold
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND):RandomSelect(1-tp,d)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
\ No newline at end of file
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