1 Star 0 Fork 0

Alanisia/ygopro-scripts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
c15521027.lua 3.07 KB
一键复制 编辑 原始数据 按行查看 历史
mercury233 提交于 2020-04-21 19:36 . add c.toss_dice
--D・スマホン
function c15521027.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(15521027,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c15521027.spcon)
e1:SetOperation(c15521027.spop)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(15521027,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c15521027.cona)
e2:SetTarget(c15521027.tga)
e2:SetOperation(c15521027.opa)
c:RegisterEffect(e2)
--sort deck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(15521027,2))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c15521027.cond)
e3:SetTarget(c15521027.tgd)
e3:SetOperation(c15521027.opd)
c:RegisterEffect(e3)
end
c15521027.toss_dice=true
function c15521027.spfilter(c)
return c:IsSetCard(0x26) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function c15521027.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c15521027.spfilter,tp,LOCATION_GRAVE,0,1,nil)
end
function c15521027.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c15521027.spfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c15521027.cona(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsAttackPos()
end
function c15521027.tga(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
end
function c15521027.filter(c)
return c:IsSetCard(0x26) and c:IsAbleToHand()
end
function c15521027.opa(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
local dc=Duel.TossDice(tp,1)
Duel.ConfirmDecktop(tp,dc)
local dg=Duel.GetDecktopGroup(tp,dc)
local g=dg:Filter(c15521027.filter,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
Duel.ShuffleDeck(tp)
end
function c15521027.cond(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsDefensePos()
end
function c15521027.tgd(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
Duel.SetOperationInfo(0,CATEGORY_DICE,nil,0,tp,1)
end
function c15521027.opd(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
local dc=Duel.TossDice(tp,1)
local g=Duel.GetDecktopGroup(tp,dc)
local ct=g:GetCount()
Duel.ConfirmCards(tp,g)
local op=Duel.SelectOption(tp,aux.Stringid(15521027,3),aux.Stringid(15521027,4))
Duel.SortDecktop(tp,tp,ct)
if op==0 then return end
for i=1,ct do
local tg=Duel.GetDecktopGroup(tp,1)
Duel.MoveSequence(tg:GetFirst(),1)
end
end
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/alanisia/ygopro-scripts.git
git@gitee.com:alanisia/ygopro-scripts.git
alanisia
ygopro-scripts
ygopro-scripts
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385