Commit 68944054 authored by argon.sun's avatar argon.sun

new

parent 8f361df9
......@@ -104,6 +104,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
mainGame->ShowElement(mainGame->wLanWindow);
} else {
DuelClient::SendPacketToServer(CTOS_SURRENDER);
if(panel)
mainGame->HideElement(panel);
mainGame->localAction.Set();
}
break;
......@@ -1044,7 +1046,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
selected_cards.push_back(clicked_card);
else break;
if (CheckSelectSum()) {
if(selectsum_cards.size()==0 || selectable_cards.size() == 0) {
if(selectsum_cards.size() == 0 || selectable_cards.size() == 0) {
unsigned char respbuf[64];
respbuf[0] = selected_cards.size();
for (int i = 0; i < selected_cards.size(); ++i)
......
......@@ -934,7 +934,7 @@ int32 field::get_release_list(uint8 playerid, card_set* release_list, card_set*
for(int i = 0; i < player[playerid].list_hand.size(); ++i) {
pcard = player[playerid].list_hand[i];
if(pcard && pcard != exp && pcard->is_releaseable_by_nonsummon(playerid)
&& (!use_con || pduel->lua->check_matching(pcard, fun, exarg))) {
&& (!use_con || pduel->lua->check_matching(pcard, fun, exarg))) {
if(release_list)
release_list->insert(pcard);
pcard->operation_param = 1;
......@@ -1088,13 +1088,13 @@ void field::get_overlay_group(uint8 self, uint8 s, uint8 o, card_set* pset) {
uint8 c = s;
card* pcard;
for(int p = 0; p < 2; ++p) {
if(!c)
continue;
for(int i = 0; i < 5; ++i) {
pcard = player[self].list_mzone[i];
if(pcard && !pcard->is_status(STATUS_SUMMONING) && pcard->xyz_materials.size())
for(auto clit = pcard->xyz_materials.begin(); clit != pcard->xyz_materials.end(); ++clit)
pset->insert(*clit);
if(c) {
for(int i = 0; i < 5; ++i) {
pcard = player[self].list_mzone[i];
if(pcard && !pcard->is_status(STATUS_SUMMONING) && pcard->xyz_materials.size())
for(auto clit = pcard->xyz_materials.begin(); clit != pcard->xyz_materials.end(); ++clit)
pset->insert(*clit);
}
}
self = 1 - self;
c = o;
......@@ -1104,12 +1104,12 @@ int32 field::get_overlay_count(uint8 self, uint8 s, uint8 o) {
uint8 c = s;
uint32 count = 0;
for(int p = 0; p < 2; ++p) {
if(!c)
continue;
for(int i = 0; i < 5; ++i) {
card* pcard = player[self].list_mzone[i];
if(pcard && !pcard->is_status(STATUS_SUMMONING))
count += pcard->xyz_materials.size();
if(c) {
for(int i = 0; i < 5; ++i) {
card* pcard = player[self].list_mzone[i];
if(pcard && !pcard->is_status(STATUS_SUMMONING))
count += pcard->xyz_materials.size();
}
}
self = 1 - self;
c = o;
......
......@@ -3844,7 +3844,8 @@ int32 field::solve_chain(uint16 step, uint32 skip_new) {
for(cit = cait->target_cards->container.begin(); cit != cait->target_cards->container.end(); ++cit)
(*cit)->release_relation(cait->triggering_effect);
}
if((pcard->data.type & TYPE_EQUIP) && (cait->triggering_effect->type & EFFECT_TYPE_ACTIVATE) && !pcard->equiping_target)
if((pcard->data.type & TYPE_EQUIP) && (cait->triggering_effect->type & EFFECT_TYPE_ACTIVATE)
&& !pcard->equiping_target && (pcard->current.location == LOCATION_SZONE))
pcard->set_status(STATUS_LEAVE_CONFIRMED, TRUE);
if((pcard->data.type & TYPE_FIELD) && (cait->triggering_effect->type & EFFECT_TYPE_ACTIVATE) && !pcard->is_status(STATUS_LEAVE_CONFIRMED)
&& pcard->is_has_relation(cait->triggering_effect) && player[1 - pcard->current.controler].list_szone[5]
......
--ガガガガードナー
function c12423762.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12423762,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c12423762.spcon)
e1:SetTarget(c12423762.sptg)
e1:SetOperation(c12423762.spop)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(12423762,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BE_BATTLE_TARGET)
e2:SetTarget(c12423762.indcost)
e2:SetOperation(c12423762.indop)
c:RegisterEffect(e2)
end
function c12423762.spcon(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
return at:GetControler()~=tp and Duel.GetAttackTarget()==nil
end
function c12423762.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.ConfirmCards(1-tp,c)
Duel.ShuffleHand(tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c12423762.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c12423762.indcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c12423762.indop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
c:RegisterEffect(e1)
end
end
--ファントム・バウンサー
function c17189532.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17189532,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(c17189532.condition)
e1:SetTarget(c17189532.target)
e1:SetOperation(c17189532.operation)
c:RegisterEffect(e1)
end
function c17189532.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD) and e:GetHandler():IsReason(REASON_DESTROY)
end
function c17189532.filter(c)
return c:IsSetCard(0x6b) and c:IsAbleToHand()
end
function c17189532.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c17189532.filter,tp,LOCATION_DECK,0,2,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c17189532.operation(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(c17189532.filter,tp,LOCATION_DECK,0,nil)
if sg:GetCount()<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=sg:Select(tp,2,2,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
--ハンマー・シャーク
function c17201174.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(17201174,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(c17201174.sptg)
e1:SetOperation(c17201174.spop)
c:RegisterEffect(e1)
end
function c17201174.filter(c,e,tp)
return c:IsLevelBelow(3) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c17201174.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsLevelAbove(2) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c17201174.filter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c17201174.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFacedown() or not c:IsRelateToEffect(e) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(-1)
e1:SetReset(RESET_EVENT+0x1ff0000)
c:RegisterEffect(e1)
if Duel.GetLocationCount(tp,LOCATION_MZONE)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c17201174.filter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--ハンマーラッシュ・バウンサー
function c44790889.initial_effect(c)
--summon with no tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(44790889,0))
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c44790889.ntcon)
c:RegisterEffect(e1)
--actlimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetCondition(c44790889.atkcon)
e2:SetOperation(c44790889.atkop)
c:RegisterEffect(e2)
end
function c44790889.ntcon(e,c)
if c==nil then return true end
return c:GetLevel()>4 and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0,nil)==0
and Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE,nil)>0
end
function c44790889.atkcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_ONFIELD,0,1,nil,TYPE_SPELL+TYPE_TRAP)
end
function c44790889.atkop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetValue(c44790889.aclimit)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE)
Duel.RegisterEffect(e1,tp)
end
function c44790889.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
\ No newline at end of file
--カードカー・D
function c45812361.initial_effect(c)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetOperation(c45812361.sumsuc)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(45812361,0))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c45812361.condition)
e3:SetCost(c45812361.cost)
e3:SetTarget(c45812361.target)
e3:SetOperation(c45812361.operation)
c:RegisterEffect(e3)
end
function c45812361.sumsuc(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(45812361,RESET_EVENT+0x1fc0000+RESET_PHASE+PHASE_END,0,1)
end
function c45812361.condition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(45812361)~=0 and Duel.GetCurrentPhase()==PHASE_MAIN1
end
function c45812361.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleaseable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c45812361.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c45812361.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.Draw(tp,2,REASON_EFFECT)
if ct==0 then return end
Duel.SkipPhase(tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
--オーバーレイ・オウル
function c59644958.initial_effect(c)
--detach
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(59644958,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(c59644958.cost)
e1:SetTarget(c59644958.target)
e1:SetOperation(c59644958.operation)
c:RegisterEffect(e1)
end
function c59644958.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,600) end
Duel.PayLPCost(tp,600)
end
function c59644958.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,1,1,REASON_EFFECT) end
end
function c59644958.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.RemoveOverlayCard(tp,1,1,1,1,REASON_EFFECT)
end
--ブレード・バウンサー
function c70194827.initial_effect(c)
--chain attack
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(70194827,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCode(EVENT_DAMAGE_STEP_END)
e1:SetCondition(c70194827.atcon)
e1:SetCost(c70194827.atcost)
e1:SetOperation(c70194827.atop)
c:RegisterEffect(e1)
end
function c70194827.atcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsChainAttackable() and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)~=0
end
function c70194827.atcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c70194827.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChainAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_DIRECT_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1)
end
--オーバーレイ・イーター
function c81816475.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(81816475,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCost(c81816475.cost)
e1:SetTarget(c81816475.target)
e1:SetOperation(c81816475.operation)
c:RegisterEffect(e1)
end
function c81816475.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 c81816475.filter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function c81816475.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetOverlayCount(tp,0,1)~=0
and Duel.IsExistingMatchingCard(c81816475.filter,tp,LOCATION_MZONE,0,1,nil) end
end
function c81816475.operation(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetOverlayGroup(tp,0,1)
local g2=Duel.GetMatchingGroup(c81816475.filter,tp,LOCATION_MZONE,0,nil)
if g1:GetCount()==0 or g2:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(81816475,2))
local mg=g1:Select(tp,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(81816475,1))
local tc=g2:Select(tp,1,1,nil):GetFirst()
Duel.Overlay(tc,mg)
end
--タスケナイト
function c86039057.initial_effect(c)
--end battle phase
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(86039057,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_GRAVE)
e1:SetCondition(c86039057.condition)
e1:SetTarget(c86039057.target)
e1:SetOperation(c86039057.operation)
c:RegisterEffect(e1)
end
c86039057[0]=true
c86039057[1]=true
function c86039057.condition(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
return at:GetControler()~=tp and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
end
function c86039057.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c86039057[tp] and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
c86039057[tp]=false
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c86039057.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE,1)
end
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