Commit 6289d85e authored by Fluorohydride's avatar Fluorohydride

Merge pull request #304 from VanillaSalt/patch33

fix
parents 8d6bd431 70ea32b7
......@@ -24,10 +24,7 @@ int32 scriptlib::card_get_origin_code(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
int32 neglect_alias = false;
if(lua_gettop(L) >= 2)
neglect_alias = lua_toboolean(L, 2);
if(!neglect_alias && pcard->data.alias) {
if(pcard->data.alias) {
int32 dif = pcard->data.code - pcard->data.alias;
if(dif > -10 && dif < 10)
lua_pushinteger(L, pcard->data.alias);
......
......@@ -2844,8 +2844,16 @@ int32 field::process_battle_command(uint16 step) {
|| ((core.sub_attack_target != (card*)0xffffffff) && (!core.sub_attack_target || core.sub_attack_target->current.location == LOCATION_MZONE))) {
if(core.sub_attacker)
core.attacker = core.sub_attacker;
if(core.sub_attack_target != (card*)0xffffffff)
if(core.sub_attack_target != (card*)0xffffffff) {
core.attack_target = core.sub_attack_target;
if(core.attack_target) {
raise_single_event(core.attack_target, 0, EVENT_BE_BATTLE_TARGET, 0, REASON_REPLACE, 0, 1 - infos.turn_player, 0);
raise_event(core.attack_target, EVENT_BE_BATTLE_TARGET, 0, REASON_REPLACE, 0, 1 - infos.turn_player, 0);
process_single_event();
process_instant_event();
add_process(PROCESSOR_POINT_EVENT, 0, 0, 0, 0, 0);
}
}
core.sub_attacker = 0;
core.sub_attack_target = (card*)0xffffffff;
core.attacker->announce_count++;
......
......@@ -23,10 +23,6 @@ end
function c10132124.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
if e:GetHandler():IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c10132124.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -11,14 +11,15 @@ function c13857930.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(13857930,0))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetCondition(c13857930.condition)
e3:SetTarget(c13857930.target)
e3:SetOperation(c13857930.activate)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_BE_BATTLE_TARGET)
c:RegisterEffect(e4)
end
function c13857930.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler()==Duel.GetAttacker() or e:GetHandler()==Duel.GetAttackTarget()
end
function c13857930.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(13857930)==0 end
......
......@@ -32,8 +32,6 @@ end
function c14677495.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c14677495.spop1(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -47,6 +47,7 @@ function c14943837.synop(e,tp,eg,ep,ev,re,r,rp,syncard,f,minc,maxc)
local c=e:GetHandler()
local lv=syncard:GetLevel()-c:GetLevel()
local g=Duel.GetMatchingGroup(c14943837.synfilter,syncard:GetControler(),LOCATION_MZONE,LOCATION_MZONE,c,syncard,c,f)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local sg=g:SelectWithSumEqual(tp,Card.GetSynchroLevel,lv,minc,maxc,syncard)
Duel.SetSynchroMaterial(sg)
end
......
......@@ -15,7 +15,7 @@ function c15341821.condition(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsReason(REASON_RETURN)
end
function c15341821.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsLocation(LOCATION_HAND+LOCATION_DECK) end
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
end
......
......@@ -29,7 +29,8 @@ end
function c15854426.check(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if tc:IsControler(tp) and tc:IsFaceup() and tc:IsAttribute(ATTRIBUTE_WIND) and tc:GetDestination()==LOCATION_HAND then
if tc:IsControler(tp) and tc:IsLocation(LOCATION_MZONE)
and tc:IsFaceup() and tc:IsAttribute(ATTRIBUTE_WIND) and tc:GetDestination()==LOCATION_HAND then
tc:RegisterFlagEffect(15854426,RESET_EVENT+0x15e0000,0,1)
end
tc=eg:GetNext()
......
......@@ -4,14 +4,15 @@ function c17732278.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17732278,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c17732278.condition)
e1:SetTarget(c17732278.target)
e1:SetOperation(c17732278.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_BE_BATTLE_TARGET)
c:RegisterEffect(e2)
end
function c17732278.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler()==Duel.GetAttacker() or e:GetHandler()==Duel.GetAttackTarget()
end
function c17732278.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(17732278)==0 end
......
......@@ -25,8 +25,6 @@ end
function c19353570.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c19353570.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -15,8 +15,6 @@ function c21051977.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_HAND,0,1,nil,67445676)
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c21051977.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -35,10 +35,8 @@ function c21977828.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c21977828.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c21977828.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c21977828.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.ShuffleHand(tp)
end
function c21977828.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -22,8 +22,6 @@ end
function c25206027.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c25206027.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -25,6 +25,9 @@ end
function c2732323.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.ChangeAttackTarget(tc)
local a=Duel.GetAttacker()
if a:IsOnField() and a:IsFaceup() then
Duel.CalculateDamage(a,tc)
end
end
end
......@@ -26,6 +26,7 @@ function c31828916.initial_effect(c)
c:RegisterEffect(e3)
end
function c31828916.check(e,tp,eg,ep,ev,re,r,rp)
if r~=REASON_BATTLE then return end
local pg=e:GetLabelObject()
if pg then pg:DeleteGroup() end
local dg=eg:Filter(Card.IsRace,nil,RACE_MACHINE)
......@@ -33,7 +34,7 @@ function c31828916.check(e,tp,eg,ep,ev,re,r,rp)
dg:KeepAlive()
end
function c31828916.cfilter(c,cg,e,tp)
return c:IsRace(RACE_MACHINE) and c:IsControler(tp) and c:IsLocation(LOCATION_GRAVE) and cg:IsContains(c)
return c:IsRace(RACE_MACHINE) and c:IsControler(tp) and c:IsLocation(LOCATION_GRAVE) and c:IsReason(REASON_BATTLE) and cg:IsContains(c)
and Duel.IsExistingMatchingCard(c31828916.filter,tp,LOCATION_DECK,0,1,nil,c:GetAttack(),c:GetAttribute(),e,tp)
end
function c31828916.filter(c,atk,att,e,tp)
......
......@@ -21,8 +21,6 @@ end
function c32391566.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c32391566.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -61,10 +61,6 @@ end
function c34471458.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c34471458.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
if e:GetHandler():IsLocation(LOCATION_DECK) then
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c34471458.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -22,8 +22,6 @@ end
function c35073065.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
......
......@@ -3,20 +3,14 @@ function c36088082.initial_effect(c)
--level change
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(36088082,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c36088082.regcon)
e1:SetOperation(c36088082.regop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(36088082,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BE_BATTLE_TARGET)
e2:SetOperation(c36088082.regop)
c:RegisterEffect(e2)
end
function c36088082.regcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetAttackTarget()~=nil
return (e:GetHandler()==Duel.GetAttacker() and Duel.GetAttackTarget()~=nil) or e:GetHandler()==Duel.GetAttackTarget()
end
function c36088082.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -40,8 +40,6 @@ function c38107923.costfilter(c)
end
function c38107923.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c38107923.costfilter,tp,LOCATION_GRAVE,0,2,nil) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c38107923.costfilter,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
......
......@@ -18,8 +18,6 @@ end
function c4192696.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,ev)
end
......
......@@ -45,7 +45,7 @@ end
function c42256406.cbcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bt=eg:GetFirst()
return c~=bt and bt:IsFaceup() and bt:GetControler()==c:GetControler()
return r~=REASON_REPLACE and c~=bt and bt:IsFaceup() and bt:GetControler()==c:GetControler()
end
function c42256406.cbop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeAttackTarget(e:GetHandler())
......
......@@ -10,7 +10,7 @@ function c43509019.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(43509019,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BE_BATTLE_TARGET)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_SZONE)
e2:SetLabel(1)
e2:SetCondition(c43509019.cbcon)
......@@ -20,14 +20,14 @@ end
function c43509019.cbtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local bt=Duel.GetAttackTarget()
if Duel.CheckEvent(EVENT_BE_BATTLE_TARGET) and bt:IsFaceup() and bt:IsLevelBelow(4) and bt:IsType(TYPE_TOON)
if Duel.CheckEvent(EVENT_ATTACK_ANNOUNCE) and bt and bt:IsFaceup() and bt:IsLevelBelow(4) and bt:IsType(TYPE_TOON)
and bt:GetControler()==e:GetHandlerPlayer() and Duel.SelectYesNo(tp,aux.Stringid(43509019,1)) then
e:SetLabel(1)
else e:SetLabel(0) end
end
function c43509019.cbcon(e,tp,eg,ep,ev,re,r,rp)
local bt=eg:GetFirst()
return bt:IsFaceup() and bt:IsLevelBelow(4) and bt:IsType(TYPE_TOON) and bt:GetControler()==e:GetHandlerPlayer()
local bt=Duel.GetAttackTarget()
return bt and bt:IsFaceup() and bt:IsLevelBelow(4) and bt:IsType(TYPE_TOON) and bt:GetControler()==e:GetHandlerPlayer()
end
function c43509019.cbop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==1 then
......
......@@ -87,10 +87,6 @@ end
function c4779091.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c4779091.filter,tp,0x13,0,1,nil,e,tp) end
if e:GetHandler():IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,0x13)
end
function c4779091.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -28,8 +28,6 @@ end
function c49460512.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c49460512.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -18,8 +18,6 @@ end
function c50613779.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ev)
end
......
......@@ -10,32 +10,20 @@ function c55727845.initial_effect(c)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c55727845.atkcost)
e1:SetTarget(c55727845.atktg1)
e1:SetTarget(c55727845.atktg)
e1:SetOperation(c55727845.atkop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(55727845,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_BE_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c55727845.atkcost)
e2:SetTarget(c55727845.atktg2)
e2:SetOperation(c55727845.atkop)
c:RegisterEffect(e2)
end
function c55727845.atkcost(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 c55727845.atktg1(e,tp,eg,ep,ev,re,r,rp,chk)
function c55727845.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local at=Duel.GetAttackTarget()
if chk==0 then return at and at:IsFaceup() and Duel.GetAttacker()==e:GetHandler() and not e:GetHandler():IsStatus(STATUS_CHAINING) end
if chk==0 then return ((at and at:IsFaceup() and Duel.GetAttacker()==e:GetHandler()) or at==e:GetHandler())
and not e:GetHandler():IsStatus(STATUS_CHAINING) end
Duel.SetTargetCard(at)
end
function c55727845.atktg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetAttackTarget()==e:GetHandler() and not e:GetHandler():IsStatus(STATUS_CHAINING) end
Duel.SetTargetCard(Duel.GetAttacker())
end
function c55727845.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
......
......@@ -23,8 +23,6 @@ end
function c62476197.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsStatus(STATUS_CHAINING) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,400)
end
......
......@@ -44,8 +44,6 @@ end
function c63211608.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c63211608.sumop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -48,10 +48,6 @@ end
function c64262809.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
if e:GetHandler():IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c64262809.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -43,10 +43,6 @@ end
function c67757079.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
if e:GetHandler():IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c67757079.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -41,7 +41,7 @@ end
function c69937550.cbcondition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bt=eg:GetFirst()
return c~=bt and bt:IsFaceup() and bt:IsSetCard(0x34) and bt:GetControler()==c:GetControler()
return r~=REASON_REPLACE and c~=bt and bt:IsFaceup() and bt:IsSetCard(0x34) and bt:GetControler()==c:GetControler()
end
function c69937550.cboperation(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeAttackTarget(e:GetHandler())
......
......@@ -50,10 +50,8 @@ function c76080032.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c76080032.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c76080032.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c76080032.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.ShuffleHand(tp)
end
function c76080032.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -4,15 +4,15 @@ function c77972406.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(c77972406.condition)
e1:SetTarget(c77972406.target)
e1:SetOperation(c77972406.activate)
c:RegisterEffect(e1)
end
function c77972406.condition(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return tc:IsControler(tp) and tc:IsFaceup() and tc:IsSetCard(0x50)
local tc=Duel.GetAttackTarget()
return tc and tc:IsControler(tp) and tc:IsFaceup() and tc:IsSetCard(0x50)
end
function c77972406.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tg=Duel.GetAttacker()
......
......@@ -45,7 +45,7 @@ end
function c79473793.cbcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bt=eg:GetFirst()
return c~=bt and bt:IsFaceup() and bt:GetControler()==c:GetControler()
return r~=REASON_REPLACE and c~=bt and bt:IsFaceup() and bt:GetControler()==c:GetControler()
end
function c79473793.cfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGraveAsCost()
......
......@@ -25,8 +25,6 @@ end
function c81336148.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c81336148.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -52,10 +52,8 @@ function c87008374.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c87008374.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c87008374.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c87008374.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.ShuffleHand(tp)
end
function c87008374.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -44,9 +44,8 @@ end
function c87997872.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,false) end
Duel.ConfirmCards(1-tp,e:GetHandler())
if e:GetHandler():IsLocation(LOCATION_HAND) then
Duel.ShuffleHand(tp)
if e:GetHandler():IsLocation(LOCATION_DECK) then
Duel.ConfirmCards(1-tp,e:GetHandler())
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
......
......@@ -43,6 +43,7 @@ function c89181369.activate(e,tp,eg,ep,ev,re,r,rp)
local rg=Duel.GetMatchingGroup(c89181369.rmfilter,tp,LOCATION_GRAVE,0,nil)
rg:RemoveCard(tc)
if rg:CheckWithSumEqual(Card.GetLevel,tc:GetLevel(),1,99) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rm=rg:SelectWithSumEqual(tp,Card.GetLevel,tc:GetLevel(),1,99)
Duel.Remove(rm,POS_FACEUP,REASON_EFFECT)
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
......
......@@ -16,11 +16,9 @@ function c89235196.cfilter(c)
end
function c89235196.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c89235196.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c89235196.cfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler())
Duel.SendtoGrave(g,REASON_COST)
Duel.ShuffleHand(tp)
end
function c89235196.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
......
......@@ -29,8 +29,6 @@ end
function c89258906.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c89258906.operation(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -33,7 +33,7 @@ function c90011152.atcon(e)
return Duel.IsExistingMatchingCard(c90011152.cfilter,e:GetHandler():GetControler(),LOCATION_MZONE,0,1,nil)
end
function c90011152.costfilter(c)
return c:IsSetCard(0xf) and c:IsAbleToGrave()
return c:IsSetCard(0xf) and c:IsAbleToGraveAsCost()
end
function c90011152.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c90011152.costfilter,tp,LOCATION_HAND,0,1,nil) end
......
......@@ -18,7 +18,6 @@ end
function c90502999.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)+Duel.GetLocationCount(1-tp,LOCATION_MZONE)>1 end
local dis=Duel.SelectDisableField(tp,2,LOCATION_MZONE,LOCATION_MZONE,0)
Debug.Message(dis)
e:SetLabel(dis)
end
function c90502999.disop(e,tp)
......
......@@ -37,9 +37,8 @@ end
function c92377303.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,false) end
Duel.ConfirmCards(1-tp,e:GetHandler())
if e:GetHandler():IsLocation(LOCATION_HAND) then
Duel.ShuffleHand(tp)
if e:GetHandler():IsLocation(LOCATION_DECK) then
Duel.ConfirmCards(1-tp,e:GetHandler())
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
......
......@@ -35,10 +35,8 @@ function c94573223.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c94573223.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c94573223.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c94573223.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.ShuffleHand(tp)
end
function c94573223.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......
......@@ -27,8 +27,6 @@ end
function c94656263.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,false) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c94656263.spop(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -29,8 +29,6 @@ function c97940434.spcon(e,tp,eg,ep,ev,re,r,rp)
end
function c97940434.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.ConfirmCards(1-tp,e:GetHandler())
Duel.ShuffleHand(tp)
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD,e:GetHandler())
end
function c97940434.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
......
......@@ -159,7 +159,7 @@ function Auxiliary.AddSynchroProcedure2(c,f1,f2)
end
function Auxiliary.AddXyzProcedure(c,f,ct,alterf,desc,maxct)
if c.xyz_filter==nil then
local code=c:GetOriginalCode(true)
local code=c:GetOriginalCode()
local mt=_G["c" .. code]
mt.xyz_filter=f
mt.xyz_count=ct
......@@ -257,7 +257,7 @@ function Auxiliary.FConditionCheckF(c,chkf)
end
function Auxiliary.AddFusionProcCode2(c,code1,code2,sub,insf)
if c.material_count==nil then
local code=c:GetOriginalCode(true)
local code=c:GetOriginalCode()
local mt=_G["c" .. code]
mt.material_count=2
mt.material={code1,code2}
......@@ -329,10 +329,10 @@ function Auxiliary.FOperationCode2(code1,code2,sub,insf)
end
function Auxiliary.AddFusionProcCode3(c,code1,code2,code3,sub,insf)
if c.material_count==nil then
local code=c:GetOriginalCode(true)
local code=c:GetOriginalCode()
local mt=_G["c" .. code]
mt.material_count=3
mt.material={code1,code2,code2}
mt.material={code1,code2,code3}
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
......@@ -424,7 +424,7 @@ function Auxiliary.FOperationCode3(code1,code2,code3,sub,insf)
end
function Auxiliary.AddFusionProcCode4(c,code1,code2,code3,code4,sub,insf)
if c.material_count==nil then
local code=c:GetOriginalCode(true)
local code=c:GetOriginalCode()
local mt=_G["c" .. code]
mt.material_count=4
mt.material={code1,code2,code3,code4}
......@@ -530,19 +530,19 @@ function Auxiliary.FOperationCode4(code1,code2,code3,code4,sub,insf)
Duel.SetFusionMaterial(g1)
end
end
function Auxiliary.AddFusionProcCodeFun(c,code,f,cc,sub,insf)
function Auxiliary.AddFusionProcCodeFun(c,code1,f,cc,sub,insf)
if c.material_count==nil then
local code=c:GetOriginalCode(true)
local code=c:GetOriginalCode()
local mt=_G["c" .. code]
mt.material_count=1
mt.material={code}
mt.material={code1}
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_FUSION_MATERIAL)
e1:SetCondition(Auxiliary.FConditionCodeFun(code,f,cc,sub,insf))
e1:SetOperation(Auxiliary.FOperationCodeFun(code,f,cc,sub,insf))
e1:SetCondition(Auxiliary.FConditionCodeFun(code1,f,cc,sub,insf))
e1:SetOperation(Auxiliary.FOperationCodeFun(code1,f,cc,sub,insf))
c:RegisterEffect(e1)
end
function Auxiliary.FConditionFilterCF(c,g2,cc)
......@@ -685,19 +685,19 @@ function Auxiliary.FOperationFun2(f1,f2,insf)
Duel.SetFusionMaterial(g1)
end
end
function Auxiliary.AddFusionProcCodeRep(c,code,cc,sub,insf)
function Auxiliary.AddFusionProcCodeRep(c,code1,cc,sub,insf)
if c.material_count==nil then
local code=c:GetOriginalCode(true)
local code=c:GetOriginalCode()
local mt=_G["c" .. code]
mt.material_count=1
mt.material={code}
mt.material={code1}
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_FUSION_MATERIAL)
e1:SetCondition(Auxiliary.FConditionCodeRep(code,cc,sub,insf))
e1:SetOperation(Auxiliary.FOperationCodeRep(code,cc,sub,insf))
e1:SetCondition(Auxiliary.FConditionCodeRep(code1,cc,sub,insf))
e1:SetOperation(Auxiliary.FOperationCodeRep(code1,cc,sub,insf))
c:RegisterEffect(e1)
end
function Auxiliary.FConditionFilterCR(c,code,sub)
......
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