Commit 9b1e78e9 authored by sidschingis's avatar sidschingis

Merge remote-tracking branch 'upstream/master'

parents a80b04b8 169c02fc
......@@ -326,17 +326,18 @@ int32 card::get_attack(uint8 swap) {
for (int32 i = 0; i < eset.count; ++i) {
switch (eset[i]->code) {
case EFFECT_UPDATE_ATTACK:
if ((eset[i]->type & EFFECT_TYPE_SINGLE) && !(eset[i]->flag & EFFECT_FLAG_SINGLE_RANGE))
if (eset[i]->type & EFFECT_TYPE_SINGLE)
up += eset[i]->get_value(this);
else
upc += eset[i]->get_value(this);
break;
case EFFECT_SET_ATTACK:
base = eset[i]->get_value(this);
up = 0;
if (!(eset[i]->type & EFFECT_TYPE_SINGLE))
up = 0;
break;
case EFFECT_SET_ATTACK_FINAL:
if ((eset[i]->type & EFFECT_TYPE_SINGLE) && !(eset[i]->flag & EFFECT_FLAG_SINGLE_RANGE)) {
if (eset[i]->type & EFFECT_TYPE_SINGLE) {
base = eset[i]->get_value(this);
up = 0;
upc = 0;
......@@ -348,10 +349,20 @@ int32 card::get_attack(uint8 swap) {
temp.attack = base + up + upc;
else
temp.attack = base - up - upc;
for (int32 i = 0; i < effects.count; ++i) {
if (effects[i]->flag & EFFECT_FLAG_REPEAT) {
base = effects[i]->get_value(this);
up = 0;
upc = 0;
temp.attack = base;
}
}
}
for (int32 i = 0; i < effects.count; ++i) {
final = effects[i]->get_value(this);
temp.attack = final;
if (!(effects[i]->flag & EFFECT_FLAG_REPEAT)) {
final = effects[i]->get_value(this);
temp.attack = final;
}
}
if (final == -1) {
if (!rev)
......@@ -413,17 +424,18 @@ int32 card::get_defence(uint8 swap) {
for (int32 i = 0; i < eset.count; ++i) {
switch (eset[i]->code) {
case EFFECT_UPDATE_DEFENCE:
if ((eset[i]->type & EFFECT_TYPE_SINGLE) && !(eset[i]->flag & EFFECT_FLAG_SINGLE_RANGE))
if (eset[i]->type & EFFECT_TYPE_SINGLE)
up += eset[i]->get_value(this);
else
upc += eset[i]->get_value(this);
break;
case EFFECT_SET_DEFENCE:
base = eset[i]->get_value(this);
up = 0;
if (!(eset[i]->type & EFFECT_TYPE_SINGLE))
up = 0;
break;
case EFFECT_SET_DEFENCE_FINAL:
if ((eset[i]->type & EFFECT_TYPE_SINGLE) && !(eset[i]->flag & EFFECT_FLAG_SINGLE_RANGE)) {
if (eset[i]->type & EFFECT_TYPE_SINGLE) {
base = eset[i]->get_value(this);
up = 0;
upc = 0;
......@@ -435,10 +447,20 @@ int32 card::get_defence(uint8 swap) {
temp.defence = base + up + upc;
else
temp.defence = base - up - upc;
for (int32 i = 0; i < effects.count; ++i) {
if (effects[i]->flag & EFFECT_FLAG_REPEAT) {
base = effects[i]->get_value(this);
up = 0;
upc = 0;
temp.defence = base;
}
}
}
for (int32 i = 0; i < effects.count; ++i) {
final = effects[i]->get_value(this);
temp.defence = final;
if (!(effects[i]->flag & EFFECT_FLAG_REPEAT)) {
final = effects[i]->get_value(this);
temp.defence = final;
}
}
if (final == -1) {
if (!rev)
......@@ -799,8 +821,7 @@ int32 card::add_effect(effect* peffect) {
return 0;
card* check_target = this;
if (peffect->type & EFFECT_TYPE_SINGLE) {
if((peffect->code == EFFECT_SET_ATTACK || peffect->code == EFFECT_SET_ATTACK_FINAL)
&& !(peffect->flag & EFFECT_FLAG_SINGLE_RANGE)) {
if(peffect->code == EFFECT_SET_ATTACK && !(peffect->flag & EFFECT_FLAG_SINGLE_RANGE)) {
for(it = single_effect.begin(); it != single_effect.end();) {
rm = it++;
if((rm->second->code == EFFECT_SET_ATTACK || rm->second->code == EFFECT_SET_ATTACK_FINAL)
......@@ -808,8 +829,15 @@ int32 card::add_effect(effect* peffect) {
remove_effect(rm->second);
}
}
if((peffect->code == EFFECT_SET_DEFENCE || peffect->code == EFFECT_SET_DEFENCE_FINAL)
&& !(peffect->flag & EFFECT_FLAG_SINGLE_RANGE)) {
if(peffect->code == EFFECT_SET_ATTACK_FINAL && !(peffect->flag & EFFECT_FLAG_SINGLE_RANGE)) {
for(it = single_effect.begin(); it != single_effect.end();) {
rm = it++;
if((rm->second->code == EFFECT_UPDATE_ATTACK || rm->second->code == EFFECT_SET_ATTACK
|| rm->second->code == EFFECT_SET_ATTACK_FINAL) && !(rm->second->flag & EFFECT_FLAG_SINGLE_RANGE))
remove_effect(rm->second);
}
}
if(peffect->code == EFFECT_SET_DEFENCE && !(peffect->flag & EFFECT_FLAG_SINGLE_RANGE)) {
for(it = single_effect.begin(); it != single_effect.end();) {
rm = it++;
if((rm->second->code == EFFECT_SET_DEFENCE || rm->second->code == EFFECT_SET_DEFENCE_FINAL)
......@@ -817,6 +845,14 @@ int32 card::add_effect(effect* peffect) {
remove_effect(rm->second);
}
}
if(peffect->code == EFFECT_SET_DEFENCE_FINAL && !(peffect->flag & EFFECT_FLAG_SINGLE_RANGE)) {
for(it = single_effect.begin(); it != single_effect.end();) {
rm = it++;
if((rm->second->code == EFFECT_UPDATE_DEFENCE || rm->second->code == EFFECT_SET_DEFENCE
|| rm->second->code == EFFECT_SET_DEFENCE_FINAL) && !(rm->second->flag & EFFECT_FLAG_SINGLE_RANGE))
remove_effect(rm->second);
}
}
it = single_effect.insert(make_pair(peffect->code, peffect));
} else if (peffect->type & EFFECT_TYPE_FIELD)
it = field_effect.insert(make_pair(peffect->code, peffect));
......
......@@ -44,7 +44,7 @@ function c10406322.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.ShuffleHand(tp)
else
Duel.DisableShuffleCheck()
Duel.SendtoGrave(tc,REASON_EFFECT)
Duel.SendtoGrave(tc,REASON_EFFECT+REASON_REVEAL)
end
end
function c10406322.cfilter(c,tp)
......
......@@ -26,11 +26,12 @@ function c12744567.initial_effect(c)
c:RegisterEffect(e2)
end
function c12744567.filter(c)
return not c:IsType(TYPE_TOKEN) and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
return not c:IsType(TYPE_TOKEN) and c:IsAbleToChangeControler()
and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end
function c12744567.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and c12744567.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c12744567.filter,tp,0,LOCATION_MZONE,1,nil) end
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) and Duel.IsExistingTarget(c12744567.filter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c12744567.filter,tp,0,LOCATION_MZONE,1,1,nil)
end
......
......@@ -18,6 +18,7 @@ function c14677495.initial_effect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_CHANGE_POS)
e2:SetCountLimit(1)
e2:SetCondition(c14677495.spcon2)
e2:SetTarget(c14677495.sptg2)
e2:SetOperation(c14677495.spop2)
......
......@@ -75,7 +75,7 @@ function c18631392.retop(code1,code2,code3)
end
if g:GetCount()~=0 then
Duel.DisableShuffleCheck()
Duel.SendtoGrave(g,REASON_EFFECT)
Duel.SendtoGrave(g,REASON_EFFECT+REASON_REVEAL)
end
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
......
--ギアギアギア XG
function c19891310.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.XyzFilterFunction(c,3),3)
c:EnableReviveLimit()
--disable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_BATTLE_PHASE)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c19891310.condition)
e1:SetCost(c19891310.cost)
e1:SetOperation(c19891310.operation)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCondition(c19891310.thcon)
e2:SetTarget(c19891310.thtg)
e2:SetOperation(c19891310.thop)
c:RegisterEffect(e2)
end
function c19891310.condition(e,tp,eg,ep,ev,re,r,rp)
local bt=Duel.GetAttacker()
if bt and bt:IsControler(tp) then return bt:IsRace(RACE_MACHINE) end
bt=Duel.GetAttackTarget()
return bt and bt:IsControler(tp) and bt:IsRace(RACE_MACHINE)
end
function c19891310.cost(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 c19891310.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DISABLE)
e1:SetTargetRange(0,LOCATION_ONFIELD)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetTargetRange(0,1)
e2:SetValue(c19891310.aclimit)
e2:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e2,tp)
end
function c19891310.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) or re:IsActiveType(TYPE_MONSTER)
end
function c19891310.thcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsLocation(LOCATION_DECK) and e:GetHandler():IsPreviousPosition(POS_FACEUP)
end
function c19891310.thfilter(c)
return c:IsSetCard(0x72) and c:IsAbleToHand()
end
function c19891310.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c19891310.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c19891310.thfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c19891310.thfilter,tp,LOCATION_GRAVE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c19891310.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
......@@ -47,7 +47,7 @@ function c22134079.tdop(e,tp,eg,ep,ev,re,r,rp)
end
end
function c22134079.flipop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(22134079,RESET_EVENT+0x17a0000,0,0)
e:GetHandler():RegisterFlagEffect(22134079,RESET_EVENT+0x57a0000,0,0)
end
function c22134079.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(22134079)~=0
......
......@@ -37,6 +37,6 @@ function c22796548.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.ShuffleHand(tp)
else
Duel.DisableShuffleCheck()
Duel.SendtoGrave(tc,REASON_EFFECT)
Duel.SendtoGrave(tc,REASON_EFFECT+REASON_REVEAL)
end
end
--`󥵩`
--シー・ランサー
function c22842214.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
......@@ -65,20 +65,23 @@ function c22842214.eqop(e,tp,eg,ep,ev,re,r,rp)
Duel.EquipComplete()
end
function c22842214.eqfilter(c,ec)
return c:GetFlagEffect(22842214)~=0 and c:IsHasCardTarget(ec)
return c:GetFlagEffect(22842214)~=0 and c:IsHasCardTarget(ec) and not c:IsStatus(STATUS_DESTROY_CONFIRMED)
end
function c22842214.desreptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c22842214.eqfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil,c) end
if chk==0 then return not c:IsReason(REASON_REPLACE) and Duel.IsExistingMatchingCard(c22842214.eqfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,nil,c) end
if Duel.SelectYesNo(tp,aux.Stringid(22842214,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESREPLACE)
local tc=Duel.SelectMatchingCard(tp,c22842214.eqfilter,tp,LOCATION_SZONE,LOCATION_SZONE,1,1,nil,c):GetFirst()
e:SetLabelObject(tc)
tc:SetStatus(STATUS_DESTROY_CONFIRMED,true)
return true
else return false end
end
function c22842214.desrepop(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(e:GetLabelObject(),REASON_EFFECT+REASON_REPLACE)
local g=e:GetLabelObject()
g:SetStatus(STATUS_DESTROY_CONFIRMED,false)
Duel.Destroy(g,REASON_EFFECT+REASON_REPLACE)
end
function c22842214.atcon(e)
return Duel.IsExistingMatchingCard(c22842214.eqfilter,e:GetHandlerPlayer(),LOCATION_SZONE,LOCATION_SZONE,1,nil,e:GetHandler())
......
......@@ -17,22 +17,6 @@ function c25824484.initial_effect(c)
e2:SetCondition(c25824484.sdcon)
e2:SetOperation(c25824484.sdop)
c:RegisterEffect(e2)
if not c25824484.global_check then
c25824484.global_check=true
c25824484[0]=Group.CreateGroup()
c25824484[0]:KeepAlive()
c25824484[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CONFIRM_DECKTOP)
ge1:SetOperation(c25824484.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c25824484.checkop(e,tp,eg,ep,ev,re,r,rp)
c25824484[0]:Clear()
c25824484[0]:Merge(eg)
c25824484[1]=re
end
function c25824484.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
......@@ -44,15 +28,16 @@ function c25824484.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst()
if tc:IsRace(RACE_PLANT) then
Duel.DisableShuffleCheck()
Duel.SendtoGrave(tc,REASON_EFFECT)
Duel.SendtoGrave(tc,REASON_EFFECT+REASON_REVEAL)
Duel.Draw(tp,1,REASON_EFFECT)
else
Duel.MoveSequence(tc,1)
end
end
function c25824484.sdcon(e,tp,eg,ep,ev,re,r,rp)
return re and e:GetHandler():IsPreviousLocation(LOCATION_DECK)
and c25824484[0]:IsContains(e:GetHandler()) and c25824484[1]==re
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_DECK) and
(c:IsReason(REASON_REVEAL) or c:IsPreviousPosition(POS_FACEUP) or Duel.IsPlayerAffectedByEffect(tp,EFFECT_REVERSE_DECK))
end
function c25824484.sdop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
......
......@@ -30,8 +30,8 @@ function c32362575.operation(e,tp,eg,ep,ev,re,r,rp)
if spcard:IsAbleToHand() then
Duel.DisableShuffleCheck()
Duel.SendtoHand(spcard,nil,REASON_EFFECT)
Duel.DiscardDeck(tp,dcount-seq-1,REASON_EFFECT)
Duel.DiscardDeck(tp,dcount-seq-1,REASON_EFFECT+REASON_REVEAL)
Duel.ConfirmCards(1-tp,spcard)
Duel.ShuffleHand(tp)
else Duel.DiscardDeck(tp,dcount-seq,REASON_EFFECT) end
else Duel.DiscardDeck(tp,dcount-seq,REASON_EFFECT+REASON_REVEAL) end
end
......@@ -21,22 +21,6 @@ function c36046926.initial_effect(c)
e2:SetTarget(c36046926.destg)
e2:SetOperation(c36046926.desop)
c:RegisterEffect(e2)
if not c36046926.global_check then
c36046926.global_check=true
c36046926[0]=Group.CreateGroup()
c36046926[0]:KeepAlive()
c36046926[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CONFIRM_DECKTOP)
ge1:SetOperation(c36046926.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c36046926.checkop(e,tp,eg,ep,ev,re,r,rp)
c36046926[0]:Clear()
c36046926[0]:Merge(eg)
c36046926[1]=re
end
function c36046926.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
......@@ -54,7 +38,7 @@ function c36046926.operation(e,tp,eg,ep,ev,re,r,rp)
local sg=g:Filter(Card.IsRace,nil,RACE_PLANT)
if sg:GetCount()>0 then
Duel.DisableShuffleCheck()
Duel.SendtoGrave(sg,REASON_EFFECT)
Duel.SendtoGrave(sg,REASON_EFFECT+REASON_REVEAL)
end
ac=ac-sg:GetCount()
if ac>0 then
......@@ -66,8 +50,9 @@ function c36046926.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
function c36046926.descon(e,tp,eg,ep,ev,re,r,rp)
return re and e:GetHandler():IsPreviousLocation(LOCATION_DECK)
and c36046926[0]:IsContains(e:GetHandler()) and c36046926[1]==re
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_DECK) and
(c:IsReason(REASON_REVEAL) or c:IsPreviousPosition(POS_FACEUP) or Duel.IsPlayerAffectedByEffect(tp,EFFECT_REVERSE_DECK))
end
function c36046926.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsDestructable() end
......
......@@ -12,6 +12,7 @@ function c38210374.initial_effect(c)
c:RegisterEffect(e1)
--remove material
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(38210374,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
e2:SetRange(LOCATION_SZONE)
......
--ライトロード・メイデン ミネルバ
function c40164421.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(40164421,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c40164421.thtg)
e1:SetOperation(c40164421.thop)
c:RegisterEffect(e1)
--discard deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(40164421,1))
e2:SetCategory(CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c40164421.discon)
e2:SetTarget(c40164421.distg)
e2:SetOperation(c40164421.disop)
c:RegisterEffect(e2)
--discard deck2
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(40164421,2))
e3:SetCategory(CATEGORY_DECKDES)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c40164421.discon2)
e3:SetTarget(c40164421.distg2)
e3:SetOperation(c40164421.disop2)
c:RegisterEffect(e3)
end
function c40164421.cfilter(c)
return c:IsSetCard(0x38) and c:IsType(TYPE_MONSTER)
end
function c40164421.thfilter(c,lv)
return c:IsLevelBelow(lv) and c:IsRace(RACE_DRAGON) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsAbleToHand()
end
function c40164421.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Duel.GetMatchingGroup(c40164421.cfilter,tp,LOCATION_GRAVE,0,nil)
local ct=g:GetClassCount(Card.GetCode)
return Duel.IsExistingMatchingCard(c40164421.thfilter,tp,LOCATION_DECK,0,1,nil,ct)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c40164421.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c40164421.cfilter,tp,LOCATION_GRAVE,0,nil)
local ct=g:GetClassCount(Card.GetCode)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectMatchingCard(tp,c40164421.thfilter,tp,LOCATION_DECK,0,1,1,nil,ct)
if sg:GetCount()>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function c40164421.discon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_DECK+LOCATION_HAND)
end
function c40164421.distg(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_DECKDES,nil,0,tp,1)
end
function c40164421.disop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.DiscardDeck(p,d,REASON_EFFECT)
end
function c40164421.discon2(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c40164421.distg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,2)
end
function c40164421.disop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetControler()~=tp or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
Duel.DiscardDeck(tp,2,REASON_EFFECT)
end
--ギアギアーノ Mk-III
function c45286019.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(45286019,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c45286019.spcon)
e1:SetCost(c45286019.spcost)
e1:SetTarget(c45286019.sptg)
e1:SetOperation(c45286019.spop)
c:RegisterEffect(e1)
if not c45286019.global_check then
c45286019.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(c45286019.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c45286019.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
local p1=false
local p2=false
while tc do
if not tc:IsSetCard(0x72) then
if tc:GetSummonPlayer()==0 then p1=true else p2=true end
end
tc=eg:GetNext()
end
if p1 then Duel.RegisterFlagEffect(0,45286019,RESET_PHASE+PHASE_END,0,1) end
if p2 then Duel.RegisterFlagEffect(1,45286019,RESET_PHASE+PHASE_END,0,1) end
end
function c45286019.spcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsSetCard(0x72)
end
function c45286019.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,45286019)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c45286019.splimit)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,45286019,RESET_PHASE+PHASE_END,0,1)
end
function c45286019.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0x72)
end
function c45286019.filter(c,e,tp)
return c:IsSetCard(0x72) and not c:IsCode(45286019) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end
function c45286019.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c45286019.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
end
function c45286019.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c45286019.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENCE)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
end
end
--ライトロード・アーク ミカエル
function c4779823.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsAttribute,ATTRIBUTE_LIGHT),1)
c:EnableReviveLimit()
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(4779823,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c4779823.rmcost)
e1:SetTarget(c4779823.rmtg)
e1:SetOperation(c4779823.rmop)
c:RegisterEffect(e1)
--todeck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(4779823,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_DESTROYED)
e2:SetTarget(c4779823.rettg)
e2:SetOperation(c4779823.retop)
c:RegisterEffect(e2)
--discard deck
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(4779823,2))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCategory(CATEGORY_DECKDES)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(c4779823.discon)
e3:SetTarget(c4779823.distg)
e3:SetOperation(c4779823.disop)
c:RegisterEffect(e3)
end
function c4779823.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c4779823.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function c4779823.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
function c4779823.filter(c)
return c:IsSetCard(0x38) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function c4779823.rettg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c4779823.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c4779823.filter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c4779823.filter,tp,LOCATION_GRAVE,0,1,99,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetCount()*300)
end
function c4779823.retop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local ct=Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
if ct>0 then
Duel.Recover(tp,ct*300,REASON_EFFECT)
end
end
function c4779823.discon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c4779823.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3)
end
function c4779823.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetControler()~=tp or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
Duel.DiscardDeck(tp,3,REASON_EFFECT)
end
......@@ -28,7 +28,7 @@ function c48739166.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.RegisterFlagEffect(tp,48739166,RESET_PHASE+PHASE_END,0,1)
end
function c48739166.filter(c)
return c:IsPosition(POS_FACEUP_ATTACK)
return c:IsPosition(POS_FACEUP_ATTACK) and c:IsAbleToChangeControler()
and not c:IsType(TYPE_TOKEN) and bit.band(c:GetSummonType(),SUMMON_TYPE_SPECIAL)==SUMMON_TYPE_SPECIAL
end
function c48739166.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
......@@ -27,12 +27,12 @@ function c49587034.activate(e,tp,eg,ep,ev,re,r,rp)
e1:SetRange(LOCATION_REMOVED)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_OPPO_TURN,4)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,4)
e1:SetCondition(c49587034.thcon)
e1:SetOperation(c49587034.thop)
e1:SetLabel(1)
card:RegisterEffect(e1)
e:GetHandler():RegisterFlagEffect(1082946,RESET_PHASE+PHASE_END+RESET_OPPO_TURN,0,3)
e:GetHandler():RegisterFlagEffect(1082946,RESET_PHASE+PHASE_END+RESET_SELF_TURN,0,3)
c49587034[e:GetHandler()]=e1
end
end
......
......@@ -24,12 +24,14 @@ end
function c55713623.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local atk=tc:GetBaseAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(atk/2)
e1:SetValue(c55713623.atkval)
tc:RegisterEffect(e1)
end
end
function c55713623.atkval(e,c)
return c:GetBaseAttack()/2
end
......@@ -3,10 +3,8 @@ function c5851097.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1c1)
e1:SetOperation(c5851097.activate)
c:RegisterEffect(e1)
--disable spsummon
local e2=Effect.CreateEffect(c)
......@@ -16,10 +14,6 @@ function c5851097.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
c:RegisterEffect(e2)
end
function c5851097.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(5851097,0))
......@@ -29,14 +23,13 @@ function c5851097.activate(e,tp,eg,ep,ev,re,r,rp)
e3:SetCondition(c5851097.descon)
e3:SetTarget(c5851097.destg)
e3:SetOperation(c5851097.desop)
e3:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e3,true)
c:RegisterEffect(e3)
end
function c5851097.filter(c,tp)
return c:IsPreviousLocation(LOCATION_DECK+LOCATION_ONFIELD) and c:IsLocation(LOCATION_GRAVE) and c:IsControler(tp)
end
function c5851097.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c5851097.filter,1,nil,tp)
return eg:IsExists(c5851097.filter,1,nil,tp) and e:GetHandler():IsStatus(STATUS_ACTIVATED)
end
function c5851097.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......
......@@ -51,6 +51,6 @@ function c58577036.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummonComplete()
end
else
Duel.DiscardDeck(tp,dcount-seq,REASON_EFFECT)
Duel.DiscardDeck(tp,dcount-seq,REASON_EFFECT+REASON_REVEAL)
end
end
......@@ -23,7 +23,7 @@ function c60645181.operation(e,tp,eg,ep,ev,re,r,rp)
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(c:GetBaseAttack()*2)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END,2)
c:RegisterEffect(e1)
......
......@@ -24,6 +24,7 @@ function c62180201.initial_effect(c)
e4:SetCode(EFFECT_SET_ATTACK_FINAL)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_REPEAT)
e4:SetTarget(c62180201.atktg)
e4:SetValue(c62180201.atkval)
c:RegisterEffect(e4)
......
......@@ -19,22 +19,6 @@ function c62434031.initial_effect(c)
e2:SetTarget(c62434031.tdtg)
e2:SetOperation(c62434031.tdop)
c:RegisterEffect(e2)
if not c62434031.global_check then
c62434031.global_check=true
c62434031[0]=Group.CreateGroup()
c62434031[0]:KeepAlive()
c62434031[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CONFIRM_DECKTOP)
ge1:SetOperation(c62434031.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c62434031.checkop(e,tp,eg,ep,ev,re,r,rp)
c62434031[0]:Clear()
c62434031[0]:Merge(eg)
c62434031[1]=re
end
function c62434031.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
......@@ -46,14 +30,15 @@ function c62434031.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst()
if tc:IsRace(RACE_PLANT) then
Duel.DisableShuffleCheck()
Duel.SendtoGrave(g,REASON_EFFECT)
Duel.SendtoGrave(g,REASON_EFFECT+REASON_REVEAL)
else
Duel.MoveSequence(tc,1)
end
end
function c62434031.tdcon(e,tp,eg,ep,ev,re,r,rp)
return re and e:GetHandler():IsPreviousLocation(LOCATION_DECK)
and c62434031[0]:IsContains(e:GetHandler()) and c62434031[1]==re
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_DECK) and
(c:IsReason(REASON_REVEAL) or c:IsPreviousPosition(POS_FACEUP) or Duel.IsPlayerAffectedByEffect(tp,EFFECT_REVERSE_DECK))
end
function c62434031.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_DECK,0,1,nil,0x90) end
......
......@@ -10,6 +10,8 @@ function c62966332.initial_effect(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_REVERSE_DECK)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,1)
c:RegisterEffect(e2)
end
......@@ -24,22 +24,6 @@ function c63257623.initial_effect(c)
e3:SetTarget(c63257623.sptg)
e3:SetOperation(c63257623.spop)
c:RegisterEffect(e3)
if not c63257623.global_check then
c63257623.global_check=true
c63257623[0]=Group.CreateGroup()
c63257623[0]:KeepAlive()
c63257623[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CONFIRM_DECKTOP)
ge1:SetOperation(c63257623.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c63257623.checkop(e,tp,eg,ep,ev,re,r,rp)
c63257623[0]:Clear()
c63257623[0]:Merge(eg)
c63257623[1]=re
end
function c63257623.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
......@@ -51,14 +35,15 @@ function c63257623.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst()
if tc:IsRace(RACE_PLANT) then
Duel.DisableShuffleCheck()
Duel.SendtoGrave(g,REASON_EFFECT)
Duel.SendtoGrave(g,REASON_EFFECT+REASON_REVEAL)
else
Duel.MoveSequence(tc,1)
end
end
function c63257623.spcon(e,tp,eg,ep,ev,re,r,rp)
return re and e:GetHandler():IsPreviousLocation(LOCATION_DECK)
and c63257623[0]:IsContains(e:GetHandler()) and c63257623[1]==re
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_DECK) and
(c:IsReason(REASON_REVEAL) or c:IsPreviousPosition(POS_FACEUP) or Duel.IsPlayerAffectedByEffect(tp,EFFECT_REVERSE_DECK))
end
function c63257623.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,63257623)==0 end
......
......@@ -9,11 +9,10 @@ function c63422098.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(0)
e1:SetValue(c63422098.val)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENCE)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
......@@ -21,17 +20,17 @@ function c63422098.initial_effect(c)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetOperation(c63422098.regop)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
end
function c63422098.val(e,c)
local ct=e:GetHandler():GetFlagEffectLabel(63422098)
if not ct then return 0 end
return ct
end
function c63422098.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetSummonType()==SUMMON_TYPE_SYNCHRO then
local ct=c:GetMaterialCount()-1
e:GetLabelObject():SetValue(ct*200)
e:GetLabelObject():GetLabelObject():SetValue(ct*200)
else
e:GetLabelObject():SetValue(0)
e:GetLabelObject():GetLabelObject():SetValue(0)
c:RegisterFlagEffect(63422098,RESET_EVENT+0x1fe0000,0,0,ct*200)
end
end
......@@ -64,7 +64,7 @@ function c70222318.tgop(e,tp,eg,ep,ev,re,r,rp)
local tc=g:GetFirst()
if tc:IsRace(RACE_PLANT) then
Duel.DisableShuffleCheck()
Duel.SendtoGrave(g,REASON_EFFECT)
Duel.SendtoGrave(g,REASON_EFFECT+REASON_REVEAL)
else
local opt=Duel.SelectOption(tp,aux.Stringid(70222318,1),aux.Stringid(70222318,2))
if opt==1 then
......
--ギアギアタッカー
function c72370114.initial_effect(c)
--turn set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(72370114,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(c72370114.target)
e1:SetOperation(c72370114.operation)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(72370114,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_FLIP)
e2:SetTarget(c72370114.destg)
e2:SetOperation(c72370114.desop)
c:RegisterEffect(e2)
end
function c72370114.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsCanTurnSet() and c:GetFlagEffect(72370114)==0 end
c:RegisterFlagEffect(72370114,RESET_EVENT+0x1fc0000+RESET_PHASE+PHASE_END,0,1)
Duel.SetOperationInfo(0,CATEGORY_POSITION,c,1,0,0)
end
function c72370114.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.ChangePosition(c,POS_FACEDOWN_DEFENCE)
end
end
function c72370114.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x72)
end
function c72370114.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c72370114.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c72370114.cfilter,tp,LOCATION_MZONE,0,1,e:GetHandler())
and Duel.IsExistingMatchingCard(c72370114.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(c72370114.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c72370114.desop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(c72370114.cfilter,tp,LOCATION_MZONE,0,e:GetHandler())
local g=Duel.GetMatchingGroup(c72370114.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if ct>0 and g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:Select(tp,1,ct,nil)
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
end
--ライトロード・アサシン ライデン
function c77558536.initial_effect(c)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(77558536,0))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c77558536.cost)
e1:SetTarget(c77558536.target)
e1:SetOperation(c77558536.operation)
c:RegisterEffect(e1)
--discard deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(77558536,1))
e2:SetCategory(CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(c77558536.discon)
e2:SetTarget(c77558536.distg)
e2:SetOperation(c77558536.disop)
c:RegisterEffect(e2)
end
function c77558536.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,77558536)==0 end
Duel.RegisterFlagEffect(tp,77558536,RESET_PHASE+PHASE_END,0,1)
end
function c77558536.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,2) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,2)
end
function c77558536.cfilter(c)
return c:IsLocation(LOCATION_GRAVE) and c:IsSetCard(0x38) and c:IsType(TYPE_MONSTER)
end
function c77558536.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardDeck(tp,2,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
local ct=g:FilterCount(c77558536.cfilter,nil)
if ct==0 then return end
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(200)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END,2)
c:RegisterEffect(e1)
end
end
function c77558536.discon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function c77558536.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,2)
end
function c77558536.disop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetControler()~=tp or not c:IsRelateToEffect(e) or c:IsFacedown() then return end
Duel.DiscardDeck(tp,2,REASON_EFFECT)
end
......@@ -77,7 +77,7 @@ function c79106360.sp(e,tp,ct)
tc=g:GetNext()
end
if conf-g:GetCount()>0 then
Duel.DiscardDeck(tp,conf-g:GetCount(),REASON_EFFECT)
Duel.DiscardDeck(tp,conf-g:GetCount(),REASON_EFFECT+REASON_REVEAL)
end
return g
end
......@@ -51,12 +51,12 @@ function c9126351.tgfilter(c)
return c:IsLevelBelow(2) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsRace(RACE_AQUA) and c:IsAbleToGrave()
end
function c9126351.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c9126351.tgfilter,tp,LOCATION_DECK+LOCATION_ONFIELD,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK+LOCATION_ONFIELD)
if chk==0 then return Duel.IsExistingMatchingCard(c9126351.tgfilter,tp,LOCATION_DECK+LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK+LOCATION_MZONE)
end
function c9126351.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c9126351.tgfilter,tp,LOCATION_DECK+LOCATION_ONFIELD,0,1,1,nil)
local g=Duel.SelectMatchingCard(tp,c9126351.tgfilter,tp,LOCATION_DECK+LOCATION_MZONE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
......
......@@ -21,22 +21,6 @@ function c99429730.initial_effect(c)
e2:SetTarget(c99429730.tdtg)
e2:SetOperation(c99429730.tdop)
c:RegisterEffect(e2)
if not c99429730.global_check then
c99429730.global_check=true
c99429730[0]=Group.CreateGroup()
c99429730[0]:KeepAlive()
c99429730[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CONFIRM_DECKTOP)
ge1:SetOperation(c99429730.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c99429730.checkop(e,tp,eg,ep,ev,re,r,rp)
c99429730[0]:Clear()
c99429730[0]:Merge(eg)
c99429730[1]=re
end
function c99429730.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
......@@ -54,7 +38,7 @@ function c99429730.operation(e,tp,eg,ep,ev,re,r,rp)
local sg=g:Filter(Card.IsRace,nil,RACE_PLANT)
if sg:GetCount()>0 then
Duel.DisableShuffleCheck()
Duel.SendtoGrave(sg,REASON_EFFECT)
Duel.SendtoGrave(sg,REASON_EFFECT+REASON_REVEAL)
end
ac=ac-sg:GetCount()
if ac>0 then
......@@ -66,8 +50,9 @@ function c99429730.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
function c99429730.tdcon(e,tp,eg,ep,ev,re,r,rp)
return re and e:GetHandler():IsPreviousLocation(LOCATION_DECK)
and c99429730[0]:IsContains(e:GetHandler()) and c99429730[1]==re
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_DECK) and
(c:IsReason(REASON_REVEAL) or c:IsPreviousPosition(POS_FACEUP) or Duel.IsPlayerAffectedByEffect(tp,EFFECT_REVERSE_DECK))
end
function c99429730.filter(c)
return c:IsRace(RACE_PLANT) and c:IsAbleToDeck()
......
......@@ -21,22 +21,6 @@ function c99641328.initial_effect(c)
e2:SetTarget(c99641328.destg)
e2:SetOperation(c99641328.desop)
c:RegisterEffect(e2)
if not c99641328.global_check then
c99641328.global_check=true
c99641328[0]=Group.CreateGroup()
c99641328[0]:KeepAlive()
c99641328[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CONFIRM_DECKTOP)
ge1:SetOperation(c99641328.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function c99641328.checkop(e,tp,eg,ep,ev,re,r,rp)
c99641328[0]:Clear()
c99641328[0]:Merge(eg)
c99641328[1]=re
end
function c99641328.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 end
......@@ -54,7 +38,7 @@ function c99641328.operation(e,tp,eg,ep,ev,re,r,rp)
local sg=g:Filter(Card.IsRace,nil,RACE_PLANT)
if sg:GetCount()>0 then
Duel.DisableShuffleCheck()
Duel.SendtoGrave(sg,REASON_EFFECT)
Duel.SendtoGrave(sg,REASON_EFFECT+REASON_REVEAL)
end
ac=ac-sg:GetCount()
if ac>0 then
......@@ -66,8 +50,9 @@ function c99641328.operation(e,tp,eg,ep,ev,re,r,rp)
end
end
function c99641328.descon(e,tp,eg,ep,ev,re,r,rp)
return re and e:GetHandler():IsPreviousLocation(LOCATION_DECK)
and c99641328[0]:IsContains(e:GetHandler()) and c99641328[1]==re
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_DECK) and
(c:IsReason(REASON_REVEAL) or c:IsPreviousPosition(POS_FACEUP) or Duel.IsPlayerAffectedByEffect(tp,EFFECT_REVERSE_DECK))
end
function c99641328.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
......
......@@ -101,6 +101,7 @@ REASON_XYZ =0x200000 --
REASON_REPLACE =0x1000000 --
REASON_DRAW =0x2000000 --
REASON_REDIRECT =0x4000000 --
REASON_REVEAL =0x8000000 --
--Summon Type
SUMMON_TYPE_NORMAL =0x10000000
SUMMON_TYPE_ADVANCE =0x11000000
......
......@@ -5,7 +5,7 @@ antialias = 2
errorlog = 1
nickname = Player
gamename = Game
lastdeck = 806
lastdeck = new
textfont = c:/windows/fonts/simsun.ttc 14
numfont = c:/windows/fonts/arialbd.ttf
serverport = 7911
......
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