Commit c9ba0fd9 authored by luffySAMA's avatar luffySAMA

Merge pull request #2 from Fluorohydride/master

sync
parents e0d99df8 5c014f70
...@@ -564,7 +564,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -564,7 +564,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
else if(pkt->player == 3) else if(pkt->player == 3)
mainGame->AddChatMsg(msg, 3); mainGame->AddChatMsg(msg, 3);
else else
mainGame->AddChatMsg(msg, 10); mainGame->AddChatMsg(msg, 9);
} else { } else {
if(pkt->player == 0) if(pkt->player == 0)
mainGame->AddChatMsg(msg, 1); mainGame->AddChatMsg(msg, 1);
...@@ -575,7 +575,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -575,7 +575,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
else if(pkt->player == 3) else if(pkt->player == 3)
mainGame->AddChatMsg(msg, 2); mainGame->AddChatMsg(msg, 2);
else else
mainGame->AddChatMsg(msg, 10); mainGame->AddChatMsg(msg, 9);
} }
} }
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
...@@ -593,7 +593,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -593,7 +593,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
BufferIO::CopyWStr(pkt->msg, msg, 256); BufferIO::CopyWStr(pkt->msg, msg, 256);
msg[(len - 3) / 2] = 0; msg[(len - 3) / 2] = 0;
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->AddChatMsg(msg, 10); mainGame->AddChatMsg(msg, 9);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
} }
break; break;
......
...@@ -1454,7 +1454,10 @@ int32 scriptlib::duel_get_attack_target(lua_State *L) { ...@@ -1454,7 +1454,10 @@ int32 scriptlib::duel_get_attack_target(lua_State *L) {
int32 scriptlib::duel_disable_attack(lua_State *L) { int32 scriptlib::duel_disable_attack(lua_State *L) {
duel* pduel = interpreter::get_duel_info(L); duel* pduel = interpreter::get_duel_info(L);
card* attacker = pduel->game_field->core.attacker; card* attacker = pduel->game_field->core.attacker;
if(!attacker || attacker->is_affected_by_effect(EFFECT_ATTACK_DISABLED) if(!attacker
|| (attacker->fieldid_r != pduel->game_field->core.pre_field[0] && attacker->fieldid_r != pduel->game_field->core.pre_field[1])
|| (attacker->current.position & POS_FACEDOWN)
|| attacker->is_affected_by_effect(EFFECT_ATTACK_DISABLED)
|| !attacker->is_affect_by_effect(pduel->game_field->core.reason_effect)) || !attacker->is_affect_by_effect(pduel->game_field->core.reason_effect))
lua_pushboolean(L, 0); lua_pushboolean(L, 0);
else { else {
......
...@@ -41,7 +41,7 @@ function c22653490.tdtg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -41,7 +41,7 @@ function c22653490.tdtg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function c22653490.tdop1(e,tp,eg,ep,ev,re,r,rp) function c22653490.tdop1(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then if tc and tc:IsFacedown() and tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,1,REASON_EFFECT) Duel.SendtoDeck(tc,nil,1,REASON_EFFECT)
end end
end end
......
...@@ -39,7 +39,7 @@ end ...@@ -39,7 +39,7 @@ end
function c26570480.cfilter(c,tp) function c26570480.cfilter(c,tp)
local np=c:GetPosition() local np=c:GetPosition()
local pp=c:GetPreviousPosition() local pp=c:GetPreviousPosition()
return ((np==POS_FACEUP_DEFENCE and pp==POS_FACEUP_ATTACK) or (pp==POS_FACEUP_DEFENCE and np==POS_FACEUP_ATTACK)) return ((np==POS_FACEUP_DEFENCE and pp==POS_FACEUP_ATTACK) or (bit.band(pp,POS_DEFENCE)~=0 and np==POS_FACEUP_ATTACK))
and c:IsControler(tp) and c:IsSetCard(0x71) and c:IsControler(tp) and c:IsSetCard(0x71)
end end
function c26570480.poscon(e,tp,eg,ep,ev,re,r,rp) function c26570480.poscon(e,tp,eg,ep,ev,re,r,rp)
......
...@@ -35,6 +35,9 @@ function c30562585.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -35,6 +35,9 @@ function c30562585.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c30562585.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,c30562585.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
local tc=g:GetFirst()
local dg=Duel.GetMatchingGroup(c30562585.dfilter,tp,LOCATION_MZONE,LOCATION_MZONE,tc,tc:GetAttack())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,dg:GetCount(),0,0)
end end
function c30562585.dfilter(c,atk) function c30562585.dfilter(c,atk)
return c:IsFaceup() and c:IsDestructable() and c:GetAttack()<atk return c:IsFaceup() and c:IsDestructable() and c:GetAttack()<atk
......
...@@ -33,6 +33,7 @@ function c37412656.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -33,6 +33,7 @@ function c37412656.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,c37412656.dfilter,tp,0,LOCATION_MZONE,1,1,nil,tc:GetAttack()) local dg=Duel.SelectMatchingCard(tp,c37412656.dfilter,tp,0,LOCATION_MZONE,1,1,nil,tc:GetAttack())
Duel.Destroy(dg,REASON_EFFECT) Duel.Destroy(dg,REASON_EFFECT)
......
...@@ -5,7 +5,7 @@ function c57666212.initial_effect(c) ...@@ -5,7 +5,7 @@ function c57666212.initial_effect(c)
e1:SetDescription(aux.Stringid(57666212,0)) e1:SetDescription(aux.Stringid(57666212,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW) e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c57666212.target) e1:SetTarget(c57666212.target)
e1:SetOperation(c57666212.operation) e1:SetOperation(c57666212.operation)
......
...@@ -20,7 +20,7 @@ function c77121851.initial_effect(c) ...@@ -20,7 +20,7 @@ function c77121851.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c77121851.tgop(e,tp,eg,ep,ev,re,r,rp) function c77121851.tgop(e,tp,eg,ep,ev,re,r,rp)
if bit.band(r,REASON_RETURN)~=0 then return end if bit.band(r,REASON_RETURN+REASON_ADJUST)~=0 then return end
e:GetHandler():RegisterFlagEffect(77121851,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1) e:GetHandler():RegisterFlagEffect(77121851,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end end
function c77121851.spcon(e,tp,eg,ep,ev,re,r,rp) function c77121851.spcon(e,tp,eg,ep,ev,re,r,rp)
......
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