Commit 132f43cd authored by argon.sun's avatar argon.sun

fix & new scripts

parent f05fcc2c
......@@ -396,7 +396,8 @@ int32 scriptlib::group_get_min_group(lua_State *L) {
}
}
interpreter::group2value(L, newgroup);
return 1;
lua_pushinteger(L, min);
return 2;
}
int32 scriptlib::group_get_max_group(lua_State *L) {
check_param_count(L, 2);
......@@ -424,7 +425,8 @@ int32 scriptlib::group_get_max_group(lua_State *L) {
}
}
interpreter::group2value(L, newgroup);
return 1;
lua_pushinteger(L, max);
return 2;
}
int32 scriptlib::group_get_sum(lua_State *L) {
check_param_count(L, 2);
......
......@@ -2709,7 +2709,12 @@ int32 field::process_battle_command(uint16 step) {
adjust_all();
return FALSE;
}
add_process(PROCESSOR_SELECT_YESNO, 0, 0, 0, infos.turn_player, 30);
if(!core.attacker->is_affected_by_effect(EFFECT_MUST_ATTACK))
add_process(PROCESSOR_SELECT_YESNO, 0, 0, 0, infos.turn_player, 30);
else {
returns.ivalue[0] = TRUE;
core.attack_cancelable = FALSE;
}
return FALSE;
}
case 9: {
......
......@@ -4,6 +4,7 @@ function c10925955.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c10925955.condition)
e1:SetTarget(c10925955.target)
e1:SetOperation(c10925955.activate)
c:RegisterEffect(e1)
......
......@@ -55,9 +55,6 @@ function c20057949.clear(e,tp,eg,ep,ev,re,r,rp)
c20057949[0]=false
c20057949[1]=false
end
function c20057949.filter(c)
return c:IsFaceup() and c:IsSetCard(0x31)
end
function c20057949.condition(e,tp,eg,ep,ev,re,r,rp)
return c20057949[tp]
end
......
--ユニバード
function c21296383.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(21296383,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c21296383.target)
e1:SetOperation(c21296383.operation)
c:RegisterEffect(e1)
end
function c21296383.spfilter(c,e,tp)
return c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and c:IsCanBeEffectTarget(e)
end
function c21296383.cfilter(c,lv)
return c:IsFaceup() and c:IsAbleToRemove() and c:IsLevelAbove(lv)
end
function c21296383.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local sg=Duel.GetMatchingGroup(c21296383.spfilter,tp,LOCATION_GRAVE,0,nil,e,tp)
if chkc==0 then return sg:IsContains(chkc) and chkc:IsLevelBelow(e:GetLabel()) end
if sg:GetCount()==0 then return false end
local sg,mlv=sg:GetMinGroup(Card.GetLevel)
local elv=e:GetHandler():GetLevel()
local lv=(elv>=mlv) and 1 or (mlv-elv)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(c21296383.cfilter,tp,LOCATION_MZONE,0,1,e:GetHandler(),lv) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c21296383.cfilter,tp,LOCATION_MZONE,0,1,1,e:GetHandler(),lv)
g:AddCard(e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPECIAL_SUMMON)
e:SetLevel(elv+g:GetFirst():GetLevel())
local g=sg:FilterSelect(tp,Card.IsLevelBelow,1,1,nil,elv+g:GetFirst():GetLevel())
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c21296383.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--一角獣の使い魔
function c22318971.initial_effect(c)
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22318971,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetCondition(c22318971.condition)
e1:SetCost(c22318971.cost)
e1:SetTarget(c22318971.target)
e1:SetOperation(c22318971.operation)
c:RegisterEffect(e1)
end
function c22318971.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPosition(POS_FACEUP_DEFENCE)
end
function c22318971.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c22318971.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() end
Duel.SetTargetCard(Duel.GetAttacker())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,0,0)
end
function c22318971.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and Duel.Remove(c,0,REASON_EFFECT+REASON_TEMPORARY)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
e1:SetCountLimit(1)
e1:SetOperation(c22318971.retop)
Duel.RegisterEffect(e1,tp)
local ac=Duel.GetFirstTarget()
if ac:IsRelateToEffect(e) and ac:IsFaceup() then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MUST_ATTACK)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
ac:RegisterEffect(e2)
end
end
end
function c22318971.retop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()==tp then
Duel.ReturnToField(e:GetOwner())
end
end
--牙城のガーディアン
function c23535429.initial_effect(c)
--defup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(23535429,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_CAL)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCondition(c23535429.condition)
e1:SetCost(c23535429.cost)
e1:SetOperation(c23535429.operation)
c:RegisterEffect(e1)
end
function c23535429.condition(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase()
if (phase~=PHASE_DAMAGE and phase~=PHASE_DAMAGE_CAL) or Duel.IsDamageCalculated() then return false end
local d=Duel.GetAttackTarget()
return d and d:IsControler(tp) and d:IsDefence()
end
function c23535429.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)
end
function c23535429.operation(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
if not d:IsRelateToBattle() then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_DEFENCE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(1500)
d:RegisterEffect(e1)
end
......@@ -20,17 +20,14 @@ function c31692182.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SendtoDeck(g,nil,0,REASON_COST)
end
function c31692182.filter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT) and not c:IsSetCard(0x1d)
return c:IsType(TYPE_EFFECT) and not c:IsSetCard(0x1d)
end
function c31692182.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e1:SetTarget(c31692182.tgfilter)
e1:SetTarget(c31692182.filter)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
Duel.RegisterEffect(e1,tp)
end
function c31692182.tgfilter(e,c)
return not c:IsSetCard(0x1d)
end
......@@ -9,10 +9,10 @@ function c32314730.initial_effect(c)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c32314730.ccost)
c:RegisterEffect(e1)
--special summon
--salvage
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(32314730,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DESTROYING)
......
--ダッシュ·ウォリアー
function c34257001.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetCondition(c34257001.condtion)
e1:SetValue(1200)
c:RegisterEffect(e1)
end
function c34257001.condtion(e)
local ph=Duel.GetCurrentPhase()
return (ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL)
and Duel.GetAttacker()==e:GetHandler()
end
......@@ -22,11 +22,14 @@ function c38167722.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c38167722.cfilter(c)
return not c:IsPublic() and c:IsType(TYPE_SPELL)
end
function c38167722.activate(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
local dis=false
if Duel.IsChainDisablable(0) then
local g=Duel.GetMatchingGroup(Card.IsType,p,0,LOCATION_HAND,nil,TYPE_SPELL)
local g=Duel.GetMatchingGroup(c38167722.cfilter,p,0,LOCATION_HAND,nil)
if g:GetCount()>0 and Duel.SelectYesNo(1-p,aux.Stringid(38167722,0)) then
Duel.Hint(HINT_SELECTMSG,1-p,HINTMSG_CONFIRM)
local sg=g:Select(1-p,1,1,nil)
......
--野望のゴーファー
function c41224658.initial_effect(c)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(41224658,0))
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c41224658.destg)
e1:SetOperation(c41224658.desop)
c:RegisterEffect(e1)
end
function c41224658.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsDestructable() end
if chk==0 then return Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsDestructable,tp,0,LOCATION_MZONE,1,2,nil)
if Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)==Duel.GetMatchingGroupCount(Card.IsPublic,tp,0,LOCATION_HAND,nil)
and not Duel.IsExistingMatchingCard(Card.IsType,tp,0,LOCATION_HAND,1,nil,TYPE_MONSTER) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
end
function c41224658.cfilter(c)
return not c:IsPublic() and c:IsType(TYPE_MONSTER)
end
function c41224658.desop(e,tp,eg,ep,ev,re,r,rp)
local dis=false
if Duel.IsChainDisablable(0) then
local cg=Duel.GetMatchingGroup(c41224658.cfilter,tp,0,LOCATION_HAND,nil)
if cg:GetCount()>0 and Duel.SelectYesNo(1-tp,aux.Stringid(41224658,1)) then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_CONFIRM)
local sg=cg:Select(1-tp,1,1,nil)
Duel.ConfirmCards(tp,sg)
Duel.ShuffleHand(1-tp)
return
end
end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
Duel.Destroy(g,REASON_EFFECT)
end
......@@ -76,7 +76,7 @@ function c43366227.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_MZONE) and c43366227.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c43366227.desfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c43366227.spfilter,tp,0,LOCATION_MZONE,1,1,nil)
local g=Duel.SelectTarget(tp,c43366227.desfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c43366227.desop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -23,7 +23,7 @@ function c48588176.target(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c48588176.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c48588176.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local g=Duel.SelectMatchingCard(tp,c48588176.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
......
......@@ -27,11 +27,14 @@ function c5037726.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectTarget(tp,c5037726.filter,tp,LOCATION_REMOVED,LOCATION_REMOVED,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c5037726.cfilter(c)
return not c:IsPublic() and c:IsType(TYPE_TRAP)
end
function c5037726.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local dis=false
if Duel.IsChainDisablable(0) then
local g=Duel.GetMatchingGroup(Card.IsType,tp,0,LOCATION_HAND,nil,TYPE_TRAP)
local g=Duel.GetMatchingGroup(c5037726.cfilter,tp,0,LOCATION_HAND,nil)
if g:GetCount()>0 and Duel.SelectYesNo(1-tp,aux.Stringid(5037726,0)) then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_CONFIRM)
local sg=g:Select(1-tp,1,1,nil)
......
......@@ -23,12 +23,6 @@ end
function c57036718.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(57036718)~=0
end
function c57036718.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsAttack() and c:IsRelateToBattle() then
Duel.ChangePosition(c,POS_FACEUP_DEFENCE)
end
end
function c57036718.filter(c)
return c:IsFaceup() and c:IsDestructable()
end
......
--二角獣レーム
function c58685438.initial_effect(c)
--deckdes
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(58685438,0))
e1:SetCategory(CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BE_MATERIAL)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCondition(c58685438.ddcon)
e1:SetTarget(c58685438.ddtg)
e1:SetOperation(c58685438.ddop)
c:RegisterEffect(e1)
end
function c58685438.ddcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
end
function c58685438.ddtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(1-tp)
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,1-tp,2)
end
function c58685438.ddop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
Duel.DiscardDeck(p,2,REASON_EFFECT)
end
--モノケロース
function c58807980.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c58807980.hspcon)
e1:SetOperation(c58807980.hspop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(58807980,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCondition(c58807980.spcon)
e2:SetTarget(c58807980.sptg)
e2:SetOperation(c58807980.spop)
c:RegisterEffect(e2)
end
function c58807980.cfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToRemoveAsCost()
end
function c58807980.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c58807980.cfilter,tp,LOCATION_HAND,0,1,nil)
end
function c58807980.hspop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c58807980.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c58807980.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
end
function c58807980.filter(c,e,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsType(TYPE_TUNER) and c:IsRace(RACE_BEAST)
and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c58807980.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local mg=e:GetHandler():GetReasonCard():GetMaterial()
if chkc then return mg:IsContains(chkc) and c58807980.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and mg:IsExists(c58807980.filter,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=mg:FilterSelect(tp,c58807980.filter,1,1,nil,e,tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c58807980.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--ダメージ·イーター
function c60741115.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(61864793,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(c60741115.condition)
e1:SetCost(c60741115.cost)
e1:SetOperation(c60741115.operation)
c:RegisterEffect(e1)
end
function c60741115.condition(e,tp,eg,ep,ev,re,r,rp)
local ex,cg,ct,cp,cv=Duel.GetOperationInfo(ev,CATEGORY_DAMAGE)
if ex then return true end
ex,cg,ct,cp,cv=Duel.GetOperationInfo(ev,CATEGORY_RECOVER)
if not ex then return false end
if cp~=PLAYER_ALL then return Duel.IsPlayerAffectedByEffect(cp,EFFECT_REVERSE_RECOVER)
else return Duel.IsPlayerAffectedByEffect(0,EFFECT_REVERSE_RECOVER)
or Duel.IsPlayerAffectedByEffect(1,EFFECT_REVERSE_RECOVER)
end
end
function c60741115.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function c60741115.operation(e,tp,eg,ep,ev,re,r,rp)
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
--damage conversion
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_REVERSE_DAMAGE)
e1:SetTargetRange(1,1)
e1:SetValue(c60741115.rev)
e1:SetReset(RESET_CHAIN)
e1:SetLabel(cid)
Duel.RegisterEffect(e1,tp)
end
function c60741115.rev(e,re,r,rp,rc)
local cc=Duel.GetCurrentChain()
if cc==0 or bit.band(r,REASON_EFFECT)==0 then return false end
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
return cid==e:GetLabel()
end
--アースクエイク·ジャイアント
function c61864793.initial_effect(c)
--pos
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(61864793,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_CHANGE_POS)
e1:SetCondition(c61864793.poscon)
e1:SetTarget(c61864793.postg)
e1:SetOperation(c61864793.posop)
c:RegisterEffect(e1)
end
function c61864793.poscon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local np=c:GetPosition()
local pp=c:GetPreviousPosition()
return not c:IsStatus(STATUS_CONTINUOUS_POS) and (Duel.GetCurrentPhase()~=PHASE_DAMAGE or c~=Duel.GetAttackTarget())
end
function c61864793.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
end
function c61864793.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.ChangePosition(tc,POS_FACEUP_DEFENCE,POS_FACEDOWN_DEFENCE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
end
end
......@@ -85,10 +85,6 @@ function c78349103.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP_ATTACK)
end
end
function c78349103.scon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsReason(REASON_DESTROY) and bit.band(c:GetPreviousLocation(),LOCATION_ONFIELD)~=0
end
function c78349103.sfilter(c)
return c:IsType(TYPE_UNION) and c:IsAbleToHand()
end
......
--ライノタウルス
function c83957459.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetCondition(c83957459.macon)
e1:SetValue(1)
c:RegisterEffect(e1)
if not c83957459.global_check then
c83957459.global_check=true
c83957459[0]=0
c83957459[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_BATTLE_DESTROYING)
ge1:SetOperation(c83957459.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge2:SetOperation(c83957459.clear)
Duel.RegisterEffect(ge2,0)
end
end
function c83957459.checkop(e,tp,eg,ep,ev,re,r,rp)
local cp=eg:GetFirst():GetControler()
c83957459[cp]=c83957459[cp]+1
end
function c83957459.clear(e,tp,eg,ep,ev,re,r,rp)
c83957459[0]=0
c83957459[1]=0
end
function c83957459.macon(e)
return c83957459[e:GetHandlerPlayer()]>=2
end
--ファイナルサイコオーガ
function c87622767.initial_effect(c)
--salvage
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(87622767,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYING)
e1:SetCost(c87622767.thcost)
e1:SetTarget(c87622767.thtg)
e1:SetOperation(c87622767.thop)
c:RegisterEffect(e1)
end
function c87622767.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,800) end
Duel.PayLPCost(tp,800)
end
function c87622767.filter(c)
return c:IsRace(RACE_PSYCHO) and c:IsAbleToHand()
end
function c87622767.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c87622767.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c87622767.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c87622767.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c87622767.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
--エレファン
function c88845345.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(88845345,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetCondition(c88845345.condition)
e1:SetTarget(c88845345.target)
e1:SetOperation(c88845345.operation)
c:RegisterEffect(e1)
end
function c88845345.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and e:GetHandler():IsReason(REASON_BATTLE)
end
function c88845345.filter(c)
return c:IsLevelBelow(3) and c:IsRace(RACE_BEAST+RACE_BEASTWARRIOR+RACE_WINDBEAST) and c:IsAbleToHand()
end
function c88845345.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c88845345.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c88845345.filter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c88845345.filter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c88845345.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
end
--マイン·モール
function c94079037.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DESTROY_REPLACE)
e1:SetCountLimit(1)
e1:SetTarget(c94079037.reptg)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(94079037,0))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCondition(c94079037.drcon)
e2:SetTarget(c94079037.drtg)
e2:SetOperation(c94079037.drop)
c:RegisterEffect(e2)
--redirect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetCondition(c94079037.rmcon)
e3:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e3)
end
function c94079037.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReason(REASON_BATTLE) end
return true
end
function c94079037.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsLocation(LOCATION_GRAVE) and r==REASON_SYNCHRO
and e:GetHandler():GetReasonCard():IsRace(RACE_BEAST)
end
function c94079037.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c94079037.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function c94079037.rmcon(e)
local c=e:GetHandler()
return c:IsFaceup() and c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()~=c:GetControler()
end
......@@ -62,6 +62,7 @@ function c94662235.target2(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c94662235.activate2(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
local ec=eg:GetFirst()
if re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(ec,POS_FACEUP,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
......
--虚栄の大猿
function c96914272.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c96914272.spcon)
e1:SetOperation(c96914272.spop)
e1:SetValue(1)
c:RegisterEffect(e1)
--lv change
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(96914272,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(c96914272.lvcon)
e2:SetOperation(c96914272.lvop)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
end
function c96914272.spfilter(c)
return c:IsRace(RACE_BEAST) and c:IsAbleToGraveAsCost()
end
function c96914272.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c96914272.spfilter,tp,LOCATION_HAND,0,1,c)
end
function c96914272.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c96914272.spfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST)
e:SetLabel(g:GetFirst():GetLevel())
end
function c96914272.lvcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1
end
function c96914272.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local lv=e:GetLabelObject():GetLabel()
local clv=c:GetLevel()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
if lv>clv then
if Duel.SelectOption(tp,aux.Stringid(96914272,1),aux.Stringid(96914272,2))==0 then
e1:SetValue(lv)
else e1:SetValue(-lv) end
else
Duel.SelectOption(tp,aux.Stringid(96914272,1))
e1:SetValue(lv)
end
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
end
end
--爆導索
function c99788587.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e0)
e1:SetCondition(c99788587.condition)
e1:SetTarget(c99788587.target)
e1:SetOperation(c99788587.activate)
c:RegisterEffect(e1)
end
function c99788587.condition(e,tp,eg,ep,ev,re,r,rp)
local seq=e:GetHandler():GetSequence()
return e:GetHandler():IsFacedown()
and Duel.GetFieldCard(tp,LOCATION_MZONE,seq)
and Duel.GetFieldCard(tp,LOCATION_SZONE,seq)
and Duel.GetFieldCard(1-tp,LOCATION_MZONE,4-seq)
and Duel.GetFieldCard(1-tp,LOCATION_SZONE,4-seq)
end
function c99788587.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
local seq=e:GetHandler():GetSequence()
local g=Group.CreateGroup()
g:AddCard(Duel.GetFieldCard(tp,LOCATION_MZONE,seq))
g:AddCard(Duel.GetFieldCard(tp,LOCATION_SZONE,seq))
g:AddCard(Duel.GetFieldCard(1-tp,LOCATION_MZONE,4-seq))
g:AddCard(Duel.GetFieldCard(1-tp,LOCATION_SZONE,4-seq))
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c99788587.activate(e,tp,eg,ep,ev,re,r,rp)
local seq=e:GetHandler():GetSequence()
local g=Group.CreateGroup()
local tc=Duel.GetFieldCard(tp,LOCATION_MZONE,seq)
if tc then g:AddCard(tc) end
tc=Duel.GetFieldCard(tp,LOCATION_SZONE,seq)
if tc then g:AddCard(tc) end
tc=Duel.GetFieldCard(1-tp,LOCATION_MZONE,4-seq)
if tc then g:AddCard(tc) end
tc=Duel.GetFieldCard(1-tp,LOCATION_SZONE,4-seq)
if tc then g:AddCard(tc) end
Duel.Destroy(g,REASON_EFFECT)
end
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