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

fix

parent 1958477f
...@@ -226,7 +226,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -226,7 +226,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->btnJoinCancel->setEnabled(true); mainGame->btnJoinCancel->setEnabled(true);
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
wchar_t msgbuf[256]; wchar_t msgbuf[256];
myswprintf(msgbuf, dataManager.GetSysString(1411), pkt->code); myswprintf(msgbuf, dataManager.GetSysString(1411), pkt->code >> 12, (pkt->code >> 4) & 0xff, pkt->code & 0xf);
mainGame->env->addMessageBox(L"", msgbuf); mainGame->env->addMessageBox(L"", msgbuf);
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
event_base_loopbreak(client_base); event_base_loopbreak(client_base);
...@@ -477,8 +477,8 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) { ...@@ -477,8 +477,8 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->AddChatMsg(msg, mainGame->LocalPlayer(pkt->player)); mainGame->AddChatMsg(msg, mainGame->LocalPlayer(pkt->player));
mainGame->gMutex.Unlock(); mainGame->gMutex.Unlock();
} else if(pkt->player == 8){ //system custom message. } else if(pkt->player == 8) { //system custom message.
if(mainGame->chkIgnore1->isChecked()) if(mainGame->chkIgnore1->isChecked())
break; break;
BufferIO::CopyWStr(pkt->msg, msg, 256); BufferIO::CopyWStr(pkt->msg, msg, 256);
msg[(len - 3) / 2] = 0; msg[(len - 3) / 2] = 0;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <dirent.h> #include <dirent.h>
#endif #endif
const unsigned short PRO_VERSION = 0x1026; const unsigned short PRO_VERSION = 0x1260;
namespace ygo { namespace ygo {
...@@ -58,7 +58,7 @@ bool Game::Initialize() { ...@@ -58,7 +58,7 @@ bool Game::Initialize() {
device->setResizable(false); device->setResizable(false);
//main menu //main menu
wchar_t strbuf[256]; wchar_t strbuf[256];
myswprintf(strbuf, L"YGOPro Version:0x%X)", PRO_VERSION); myswprintf(strbuf, L"YGOPro Version:%X.0%X.%X)", PRO_VERSION >> 12, (PRO_VERSION >> 4) & 0xff, PRO_VERSION & 0xf);
wMainMenu = env->addWindow(rect<s32>(370, 200, 650, 450), false, strbuf); wMainMenu = env->addWindow(rect<s32>(370, 200, 650, 450), false, strbuf);
wMainMenu->getCloseButton()->setVisible(false); wMainMenu->getCloseButton()->setVisible(false);
btnLanMode = env->addButton(rect<s32>(10, 30, 270, 60), wMainMenu, BUTTON_LAN_MODE, dataManager.GetSysString(1200)); btnLanMode = env->addButton(rect<s32>(10, 30, 270, 60), wMainMenu, BUTTON_LAN_MODE, dataManager.GetSysString(1200));
...@@ -760,7 +760,7 @@ void Game::AddChatMsg(wchar_t* msg, int player) { ...@@ -760,7 +760,7 @@ void Game::AddChatMsg(wchar_t* msg, int player) {
} }
chatMsg[0].clear(); chatMsg[0].clear();
chatTiming[0] = 600; chatTiming[0] = 600;
switch(player){ switch(player) {
case 0: //from host case 0: //from host
chatMsg[0].append(dInfo.hostname); chatMsg[0].append(dInfo.hostname);
chatMsg[0].append(L": "); chatMsg[0].append(L": ");
......
...@@ -3,7 +3,6 @@ function c1005587.initial_effect(c) ...@@ -3,7 +3,6 @@ function c1005587.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY) e1:SetCategory(CATEGORY_DESTROY)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(c1005587.target) e1:SetTarget(c1005587.target)
...@@ -15,29 +14,37 @@ function c1005587.filter(c,tp) ...@@ -15,29 +14,37 @@ function c1005587.filter(c,tp)
end end
function c1005587.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c1005587.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if chk==0 then return eg:FilterCount(c1005587.filter,nil,1-tp)==1 end if chk==0 then return eg:IsExists(c1005587.filter,1,nil,1-tp) end
Duel.SetTargetCard(eg)
local g=eg:Filter(c1005587.filter,nil,1-tp) local g=eg:Filter(c1005587.filter,nil,1-tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end end
function c1005587.filter2(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_EFFECT) and c:IsAttackAbove(2000)
and c:GetSummonPlayer()==tp and c:IsDestructable() and c:IsRelateToEffect(e)
end
function c1005587.activate(e,tp,eg,ep,ev,re,r,rp) function c1005587.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst() local g=eg:Filter(c1005587.filter2,nil,e,1-tp)
if tc and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:IsAttackAbove(2000) then local tc=g:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler()) if not tc then return end
e1:SetType(EFFECT_TYPE_SINGLE) if g:GetCount()>1 then
e1:SetCode(EFFECT_DISABLE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
e1:SetReset(RESET_EVENT+0x1fe0000) tc=g:Select(tp,1,1,nil):GetFirst()
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetOperation(c1005587.disop)
e2:SetLabelObject(tc)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
Duel.AdjustInstantly()
Duel.Destroy(tc,REASON_EFFECT)
end end
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_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetOperation(c1005587.disop)
e2:SetLabelObject(tc)
e2:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e2,tp)
Duel.AdjustInstantly()
Duel.Destroy(tc,REASON_EFFECT)
end end
function c1005587.disop(e,tp,eg,ep,ev,re,r,rp) function c1005587.disop(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler()==e:GetLabelObject() then if re:GetHandler()==e:GetLabelObject() then
......
--ギアギアーノ Mk-II --ギアギアーノ Mk-II
function c1045243.initial_effect(c) function c1045143.initial_effect(c)
--spsummon --spsummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(1045243,0)) e1:SetDescription(aux.Stringid(1045143,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS) e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(c1045243.sptg) e1:SetTarget(c1045143.sptg)
e1:SetOperation(c1045243.spop) e1:SetOperation(c1045143.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS) e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function c1045243.filter(c,e,tp) function c1045143.filter(c,e,tp)
return c:IsSetCard(0x72) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x72) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and not c:IsHasEffect(EFFECT_NECRO_VALLEY) and not c:IsHasEffect(EFFECT_NECRO_VALLEY)
end end
function c1045243.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c1045143.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c1045243.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(c1045143.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) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND)
end end
function c1045243.spop(e,tp,eg,ep,ev,re,r,rp) function c1045143.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c1045243.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,c1045143.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENCE) Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENCE)
end end
......
...@@ -3,8 +3,10 @@ function c40383551.initial_effect(c) ...@@ -3,8 +3,10 @@ function c40383551.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(c40383551.condition) e1:SetCondition(c40383551.condition)
e1:SetTarget(c40383551.target)
e1:SetOperation(c40383551.operation) e1:SetOperation(c40383551.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
if not c40383551.global_check then if not c40383551.global_check then
...@@ -43,7 +45,12 @@ end ...@@ -43,7 +45,12 @@ end
function c40383551.condition(e,tp,eg,ep,ev,re,r,rp) function c40383551.condition(e,tp,eg,ep,ev,re,r,rp)
return c40383551[tp] return c40383551[tp]
end end
function c40383551.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
end
function c40383551.operation(e,tp,eg,ep,ev,re,r,rp) function c40383551.operation(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
...@@ -51,7 +58,7 @@ function c40383551.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -51,7 +58,7 @@ function c40383551.operation(e,tp,eg,ep,ev,re,r,rp)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetValue(c40383551.aclimit) e1:SetValue(c40383551.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END,1) e1:SetReset(RESET_PHASE+PHASE_END,1)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,p)
--cannot set --cannot set
local e2=Effect.CreateEffect(e:GetHandler()) local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD) e2:SetType(EFFECT_TYPE_FIELD)
...@@ -60,7 +67,7 @@ function c40383551.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,7 +67,7 @@ function c40383551.operation(e,tp,eg,ep,ev,re,r,rp)
e2:SetTargetRange(1,0) e2:SetTargetRange(1,0)
e2:SetTarget(aux.TRUE) e2:SetTarget(aux.TRUE)
e2:SetReset(RESET_PHASE+PHASE_END,1) e2:SetReset(RESET_PHASE+PHASE_END,1)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e2,p)
end end
function c40383551.aclimit(e,re,tp) function c40383551.aclimit(e,re,tp)
return re:GetHandler():IsType(TYPE_SPELL+TYPE_TRAP) return re:GetHandler():IsType(TYPE_SPELL+TYPE_TRAP)
......
...@@ -16,14 +16,10 @@ function c48216773.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -16,14 +16,10 @@ function c48216773.target(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end end
function c48216773.activate(e,tp,eg,ep,ev,re,r,rp) function c48216773.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_MZONE,0,nil) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g2=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,0,LOCATION_MZONE,nil) local dg1=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_MZONE,0,1,1nil)
if g1:GetCount()>0 and g2:GetCount()>0 then Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TODECK)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK) local dg1=Duel.SelectMatchingCard(1-tp,Card.IsAbleToDeck,1-tp,LOCATION_MZONE,0,1,1nil)
local dg1=g1:Select(tp,1,1,nil) dg1:Merge(dg2)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TODECK) Duel.SendtoDeck(dg1,nil,2,REASON_EFFECT)
local dg2=g2:Select(1-tp,1,1,nil)
dg1:Merge(dg2)
Duel.SendtoDeck(dg1,nil,2,REASON_EFFECT)
end
end end
...@@ -49,8 +49,7 @@ end ...@@ -49,8 +49,7 @@ end
function c51405049.regop(e,tp,eg,ep,ev,re,r,rp) function c51405049.regop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 then return end if e:GetLabel()==0 then return end
local tc=eg:GetFirst() local tc=eg:GetFirst()
if tc:GetCode()==e:GetLabel() and tc:GetFlagEffect(51405049)==0 then if tc:GetCode()==e:GetLabel() then
tc:RegisterFlagEffect(51405049,RESET_CHAIN,0,0)
e:SetLabel(0) e:SetLabel(0)
end end
end end
......
...@@ -15,7 +15,7 @@ function c73417207.filter(c,syncard,f) ...@@ -15,7 +15,7 @@ function c73417207.filter(c,syncard,f)
return c:IsSetCard(0x42) and c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard) and (f==nil or f(c)) return c:IsSetCard(0x42) and c:IsNotTuner() and c:IsCanBeSynchroMaterial(syncard) and (f==nil or f(c))
end end
function c73417207.target(e,syncard,f,minc,maxc) function c73417207.target(e,syncard,f,minc,maxc)
if minc>2 or maxc<2 then then return false end if minc>2 or maxc<2 then return false end
local lv=syncard:GetLevel()-e:GetHandler():GetLevel() local lv=syncard:GetLevel()-e:GetHandler():GetLevel()
if lv<=0 then return false end if lv<=0 then return false end
local g=Duel.GetMatchingGroup(c73417207.filter,syncard:GetControler(),LOCATION_HAND,0,nil,syncard,f) local g=Duel.GetMatchingGroup(c73417207.filter,syncard:GetControler(),LOCATION_HAND,0,nil,syncard,f)
......
...@@ -64,10 +64,11 @@ function c87608852.spcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -64,10 +64,11 @@ function c87608852.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e1:SetReset(RESET_PHASE+PHASE_END) e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetTarget(c87608852.splimit) e1:SetTarget(c87608852.splimit)
e1:SetLabelObject(e)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
end end
function c87608852.splimit(e,c,sump,sumtype,sumpos,targetp,se) function c87608852.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLevelAbove(5) return e:GetLabelObject()~=se and c:IsLevelAbove(5)
end end
function c87608852.spfilter(c,e,tp) function c87608852.spfilter(c,e,tp)
return c:IsLevelAbove(5) and c:IsRace(RACE_SPELLCASTER) and c:IsAttribute(0x30) return c:IsLevelAbove(5) and c:IsRace(RACE_SPELLCASTER) and c:IsAttribute(0x30)
......
...@@ -322,7 +322,7 @@ ...@@ -322,7 +322,7 @@
!system 1408 更换副卡组失败。 !system 1408 更换副卡组失败。
!system 1409 等待更换副卡组中... !system 1409 等待更换副卡组中...
!system 1410 卡组数量与先前不符合。 !system 1410 卡组数量与先前不符合。
!system 1411 版本不匹配(0x%X)。 !system 1411 版本不匹配(%X.0%X.%X)。
!system 1500 决斗结束。 !system 1500 决斗结束。
!system 1501 录像结束。 !system 1501 录像结束。
!system 1502 连接已断开。 !system 1502 连接已断开。
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
antialias = 2 antialias = 2
nickname = Player nickname = Player
gamename = Game gamename = Game
lastdeck = test lastdeck = sample
textfont = c:/windows/fonts/simsun.ttc 14 textfont = c:/windows/fonts/simsun.ttc 14
numfont = c:/windows/fonts/arialbd.ttf numfont = c:/windows/fonts/arialbd.ttf
serverport = 7911 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