Commit 339d756b authored by argon.sun's avatar argon.sun

recon

parent 8d2f4a33
This diff is collapsed.
...@@ -24,6 +24,8 @@ private: ...@@ -24,6 +24,8 @@ private:
static char duel_client_read[0x2000]; static char duel_client_read[0x2000];
static char duel_client_write[0x2000]; static char duel_client_write[0x2000];
static bool is_closing; static bool is_closing;
static int select_hint;
static wchar_t event_string[128];
public: public:
static bool StartClient(unsigned int ip, unsigned short port, bool create_game = true); static bool StartClient(unsigned int ip, unsigned short port, bool create_game = true);
static void StopClient(bool is_exiting = false); static void StopClient(bool is_exiting = false);
...@@ -31,6 +33,7 @@ public: ...@@ -31,6 +33,7 @@ public:
static void ClientEvent(bufferevent *bev, short events, void *ctx); static void ClientEvent(bufferevent *bev, short events, void *ctx);
static int ClientThread(void* param); static int ClientThread(void* param);
static void HandleSTOCPacketLan(char* data, unsigned int len); static void HandleSTOCPacketLan(char* data, unsigned int len);
static int ClientAnalyze(char* msg, unsigned int len);
static void SetResponseI(int respI); static void SetResponseI(int respI);
static void SetResponseB(unsigned char* respB, unsigned char len); static void SetResponseB(unsigned char* respB, unsigned char len);
static void SendPacketToServer(unsigned char proto) { static void SendPacketToServer(unsigned char proto) {
......
...@@ -1265,9 +1265,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) { ...@@ -1265,9 +1265,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
} }
break; break;
} }
case irr::EET_USER_EVENT: {
break;
}
} }
return false; return false;
} }
......
...@@ -161,23 +161,28 @@ bool Game::Initialize() { ...@@ -161,23 +161,28 @@ bool Game::Initialize() {
imgCard = env->addImage(rect<s32>(9, 9, 187, 262), wCardImg); imgCard = env->addImage(rect<s32>(9, 9, 187, 262), wCardImg);
imgCard->setUseAlphaChannel(true); imgCard->setUseAlphaChannel(true);
//phase //phase
btnDP = env->addButton(rect<s32>(475, 310, 525, 330), 0, -1, L"DP"); wPhase = env->addWindow(rect<s32>(475, 310, 850, 330), false, L"");
wPhase->setDraggable(false);
wPhase->getCloseButton()->setVisible(false);
wPhase->setDrawBackground(false);
wPhase->setVisible(false);
btnDP = env->addButton(rect<s32>(0, 0, 50, 20), wPhase, -1, L"DP");
btnDP->setEnabled(false); btnDP->setEnabled(false);
btnDP->setPressed(true); btnDP->setPressed(true);
btnDP->setVisible(false); btnDP->setVisible(false);
btnSP = env->addButton(rect<s32>(540, 310, 590, 330), 0, -1, L"SP"); btnSP = env->addButton(rect<s32>(65, 0, 115, 20), wPhase, -1, L"SP");
btnSP->setEnabled(false); btnSP->setEnabled(false);
btnSP->setPressed(true); btnSP->setPressed(true);
btnSP->setVisible(false); btnSP->setVisible(false);
btnM1 = env->addButton(rect<s32>(605, 310, 655, 330), 0, -1, L"M1"); btnM1 = env->addButton(rect<s32>(130, 0, 180, 20), wPhase, -1, L"M1");
btnM1->setEnabled(false); btnM1->setEnabled(false);
btnM1->setPressed(true); btnM1->setPressed(true);
btnM1->setVisible(false); btnM1->setVisible(false);
btnBP = env->addButton(rect<s32>(670, 310, 720, 330), 0, BUTTON_BP, L"BP"); btnBP = env->addButton(rect<s32>(195, 0, 245, 20), wPhase, BUTTON_BP, L"BP");
btnBP->setVisible(false); btnBP->setVisible(false);
btnM2 = env->addButton(rect<s32>(735, 310, 785, 330), 0, BUTTON_M2, L"M2"); btnM2 = env->addButton(rect<s32>(260, 0, 310, 20), wPhase, BUTTON_M2, L"M2");
btnM2->setVisible(false); btnM2->setVisible(false);
btnEP = env->addButton(rect<s32>(800, 310, 850, 330), 0, BUTTON_EP, L"EP"); btnEP = env->addButton(rect<s32>(325, 0, 375, 20), wPhase, BUTTON_EP, L"EP");
btnEP->setVisible(false); btnEP->setVisible(false);
//tab //tab
wInfos = env->addTabControl(rect<s32>(1, 275, 301, 639), 0, true); wInfos = env->addTabControl(rect<s32>(1, 275, 301, 639), 0, true);
......
...@@ -24,28 +24,14 @@ struct Config { ...@@ -24,28 +24,14 @@ struct Config {
struct DuelInfo { struct DuelInfo {
bool isStarted; bool isStarted;
bool is_shuffling; bool is_shuffling;
bool netError;
bool is_host_player[2];
bool is_first_turn; bool is_first_turn;
bool is_local_host;
bool is_responsed;
int resPlayer;
int lp[2]; int lp[2];
int engFlag;
int engLen;
int engType;
int msgLen;
int msgType;
int turn; int turn;
short curMsg; short curMsg;
short preMsg;
int selectHint;
wchar_t hostname[20]; wchar_t hostname[20];
wchar_t clientname[20]; wchar_t clientname[20];
wchar_t pass[20];
wchar_t strLP[2][16]; wchar_t strLP[2][16];
wchar_t strTurn[8]; wchar_t strTurn[8];
wchar_t strEvent[64];
}; };
class Game { class Game {
...@@ -279,6 +265,7 @@ public: ...@@ -279,6 +265,7 @@ public:
irr::gui::IGUIButton* btnAttack; irr::gui::IGUIButton* btnAttack;
irr::gui::IGUIButton* btnShowList; irr::gui::IGUIButton* btnShowList;
//phase button //phase button
irr::gui::IGUIWindow* wPhase;
irr::gui::IGUIButton* btnDP; irr::gui::IGUIButton* btnDP;
irr::gui::IGUIButton* btnSP; irr::gui::IGUIButton* btnSP;
irr::gui::IGUIButton* btnM1; irr::gui::IGUIButton* btnM1;
......
...@@ -266,55 +266,6 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -266,55 +266,6 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
} }
break; break;
} }
case irr::EET_USER_EVENT: {
switch(event.UserEvent.UserData1) {
case UEVENT_EXIT: {
if(mainGame->guiFading) {
mainGame->guiFading->setVisible(false);
mainGame->guiNext = 0;
}
mainGame->ShowElement(mainGame->wMessage, 60);
if(event.UserEvent.UserData2 == 1)
mainGame->exit_window = mainGame->wLanWindow;
else if(event.UserEvent.UserData2 == 2)
;
else if(event.UserEvent.UserData2 == 3)
;
break;
}
case UEVENT_TOWINDOW: {
mainGame->exit_window = 0;
mainGame->wMessage->setVisible(false);
mainGame->wACMessage->setVisible(false);
mainGame->wQuery->setVisible(false);
mainGame->wOptions->setVisible(false);
mainGame->wPosSelect->setVisible(false);
mainGame->wCardSelect->setVisible(false);
mainGame->wANNumber->setVisible(false);
mainGame->wANCard->setVisible(false);
mainGame->wANAttribute->setVisible(false);
mainGame->wANRace->setVisible(false);
mainGame->wCmdMenu->setVisible(false);
mainGame->wReplaySave->setVisible(false);
mainGame->btnDP->setVisible(false);
mainGame->btnSP->setVisible(false);
mainGame->btnM1->setVisible(false);
mainGame->btnBP->setVisible(false);
mainGame->btnM2->setVisible(false);
mainGame->btnEP->setVisible(false);
mainGame->wCardImg->setVisible(false);
mainGame->wInfos->setVisible(false);
mainGame->stHintMsg->setVisible(false);
mainGame->stTip->setVisible(false);
mainGame->device->setEventReceiver(&mainGame->menuHandler);
mainGame->dField.Clear();
mainGame->ShowElement(mainGame->exit_window);
break;
}
break;
}
break;
}
} }
return false; return false;
} }
......
This diff is collapsed.
...@@ -1216,7 +1216,9 @@ int32 scriptlib::duel_get_chain_info(lua_State *L) { ...@@ -1216,7 +1216,9 @@ int32 scriptlib::duel_get_chain_info(lua_State *L) {
lua_pushinteger(L, ch->chain_id); lua_pushinteger(L, ch->chain_id);
break; break;
case CHAININFO_TYPE: case CHAININFO_TYPE:
lua_pushinteger(L, (ch->chain_type & 0x7)); if((ch->chain_type & 0x7) == (TYPE_TRAP | TYPE_MONSTER))
lua_pushinteger(L, TYPE_MONSTER);
else lua_pushinteger(L, (ch->chain_type & 0x7));
break; break;
case CHAININFO_EXTTYPE: case CHAININFO_EXTTYPE:
lua_pushinteger(L, ch->chain_type); lua_pushinteger(L, ch->chain_type);
......
...@@ -3539,8 +3539,6 @@ int32 field::add_chain(uint16 step) { ...@@ -3539,8 +3539,6 @@ int32 field::add_chain(uint16 step) {
if(!(peffect->flag & EFFECT_FLAG_FIELD_ONLY) && peffect->handler->is_affected_by_effect(EFFECT_DISABLE_EFFECT)) if(!(peffect->flag & EFFECT_FLAG_FIELD_ONLY) && peffect->handler->is_affected_by_effect(EFFECT_DISABLE_EFFECT))
clit->flag |= CHAIN_DISABLE_EFFECT; clit->flag |= CHAIN_DISABLE_EFFECT;
clit->chain_type = peffect->handler->get_type(); clit->chain_type = peffect->handler->get_type();
if(clit->chain_type == TYPE_MONSTER + TYPE_TRAP)
clit->chain_type = TYPE_MONSTER;
clit->chain_count = core.current_chain.size() + 1; clit->chain_count = core.current_chain.size() + 1;
clit->target_cards = 0; clit->target_cards = 0;
clit->target_player = PLAYER_NONE; clit->target_player = PLAYER_NONE;
......
...@@ -4,7 +4,7 @@ function c2067935.initial_effect(c) ...@@ -4,7 +4,7 @@ function c2067935.initial_effect(c)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(2067935,0)) e1:SetDescription(aux.Stringid(2067935,0))
e1:SetCategory(CATEGORY_REMOVE) e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c2067935.rmcon) e1:SetCondition(c2067935.rmcon)
......
...@@ -26,7 +26,7 @@ function c21768554.cfilter(c) ...@@ -26,7 +26,7 @@ function c21768554.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xc) return c:IsFaceup() and c:IsSetCard(0xc)
end end
function c21768554.condition(e,tp,eg,ep,ev,re,r,rp) function c21768554.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c21768554.cfilter,tp,0,LOCATION_MZONE,1,nil) return Duel.IsExistingMatchingCard(c21768554.cfilter,tp,LOCATION_MZONE,0,1,nil)
end end
function c21768554.filter(c) function c21768554.filter(c)
return c:GetCounter(0xe)>0 and c:IsControlerCanBeChanged() return c:GetCounter(0xe)>0 and c:IsControlerCanBeChanged()
......
...@@ -10,20 +10,17 @@ function c24694698.initial_effect(c) ...@@ -10,20 +10,17 @@ function c24694698.initial_effect(c)
e1:SetTarget(c24694698.target) e1:SetTarget(c24694698.target)
e1:SetOperation(c24694698.operation) e1:SetOperation(c24694698.operation)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--draw --draw
local e3=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(24694698,1)) e2:SetDescription(aux.Stringid(24694698,1))
e3:SetCategory(CATEGORY_DRAW) e2:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1) e2:SetCountLimit(1)
e3:SetTarget(c24694698.drtg) e2:SetTarget(c24694698.drtg)
e3:SetOperation(c24694698.drop) e2:SetOperation(c24694698.drop)
c:RegisterEffect(e3) c:RegisterEffect(e2)
end end
function c24694698.tgfilter(c) function c24694698.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x2a) and c:IsAbleToGrave() return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x2a) and c:IsAbleToGrave()
......
...@@ -20,9 +20,12 @@ end ...@@ -20,9 +20,12 @@ end
function c43385557.reccon(e,tp,eg,ep,ev,re,r,rp) function c43385557.reccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp return Duel.GetTurnPlayer()==tp
end end
function c43385557.filter(c)
return c:IsFaceup() and c:IsRace(RACE_PSYCHO)
end
function c43385557.rectg(e,tp,eg,ep,ev,re,r,rp,chk) function c43385557.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
local ct=Duel.GetMatchingGroupCount(Card.IsRace,tp,LOCATION_MZONE,0,nil,RACE_PSYCHO) local ct=Duel.GetMatchingGroupCount(c43385557.filter,tp,LOCATION_MZONE,0,nil)
Duel.SetTargetPlayer(tp) Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ct*600) Duel.SetTargetParam(ct*600)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ct*600) Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ct*600)
......
...@@ -28,12 +28,12 @@ function c52971944.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -28,12 +28,12 @@ function c52971944.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCAITON_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end if chkc then return chkc:IsLocation(LOCAITON_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return true end if chk==0 then return true end
if Duel.IsExistingMatchingCard(c52971944.cfilter,tp,LOCATION_GRAVE,0,1,nil) if Duel.IsExistingMatchingCard(c52971944.cfilter,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingTarget(Card.IsAbleToRemoveAs,tp,0,LOCATION_GRAVE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(52971944,0)) then and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(52971944,0)) then
e:SetProperty(EFFECT_FLAG_CARD_TARGET) e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local cg=Duel.SelectMatchingCard(tp,c52971944.cfilter,tp,LOCATION_GRAVE,0,1,1,nil) local cg=Duel.SelectMatchingCard(tp,c52971944.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(cg,POS_FACEUP,REASON_COST) Duel.Remove(cg,POS_FACEUP,REASON_COST)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemoveAs,tp,0,LOCATION_GRAVE,1,1,nil) local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
e:GetHandler():RegisterFlagEffect(52971944,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1) e:GetHandler():RegisterFlagEffect(52971944,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
else e:SetProperty(0) end else e:SetProperty(0) end
...@@ -47,8 +47,8 @@ end ...@@ -47,8 +47,8 @@ end
function c52971944.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c52971944.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCAITON_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end if chkc then return chkc:IsLocation(LOCAITON_GRAVE) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return e:GetHandler():GetFlagEffect(52971944)==0 if chk==0 then return e:GetHandler():GetFlagEffect(52971944)==0
and Duel.IsExistingTarget(Card.IsAbleToRemoveAs,tp,0,LOCATION_GRAVE,1,nil) end and Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,nil) end
local g=Duel.SelectTarget(tp,Card.IsAbleToRemoveAs,tp,0,LOCATION_GRAVE,1,1,nil) local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
e:GetHandler():RegisterFlagEffect(52971944,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1) e:GetHandler():RegisterFlagEffect(52971944,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end end
......
...@@ -13,7 +13,7 @@ function c53540729.initial_effect(c) ...@@ -13,7 +13,7 @@ function c53540729.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c53540729.filter(c) function c53540729.filter(c)
return c:IsFaceup() and c:IsSetCard(0x58) return c:IsFaceup() and c:IsSetCard(0x58) and c:IsLevelAbove(1)
end end
function c53540729.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c53540729.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c24920410.filter(chkc) end if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c24920410.filter(chkc) end
......
...@@ -19,7 +19,7 @@ function c56769674.initial_effect(c) ...@@ -19,7 +19,7 @@ function c56769674.initial_effect(c)
end end
function c56769674.target(e,tp,eg,ep,ev,re,r,rp,chk) function c56769674.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,0) Duel.Hint(HINT_SELECTMSG,tp,562)
local rc=Duel.AnnounceAttribute(tp,1,0xffff) local rc=Duel.AnnounceAttribute(tp,1,0xffff)
e:GetLabelObject():SetLabel(rc) e:GetLabelObject():SetLabel(rc)
end end
......
...@@ -53,7 +53,7 @@ end ...@@ -53,7 +53,7 @@ end
function c66957584.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c66957584.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c66957584.filter(chkc,e,tp) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c66957584.filter(chkc,e,tp) end
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(c66957584.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end and Duel.IsExistingTarget(c66957584.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
local ct=Duel.GetLocationCount(tp,LOCATION_MZONE) local ct=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ct>2 then ct=2 end if ct>2 then ct=2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
...@@ -11,7 +11,7 @@ function c73262676.initial_effect(c) ...@@ -11,7 +11,7 @@ function c73262676.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c73262676.filter(c) function c73262676.filter(c)
return c:GetCounter(0xe)>0 and c:GetLevel()>0 and c:IsDestructable() return c:IsFaceup() and c:IsSetCard(0xc) and c:GetLevel()>0 and c:IsDestructable()
end end
function c73262676.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c73262676.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c73262676.filter(chkc) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c73262676.filter(chkc) end
......
...@@ -18,7 +18,7 @@ function c74701381.initial_effect(c) ...@@ -18,7 +18,7 @@ function c74701381.initial_effect(c)
end end
function c74701381.target(e,tp,eg,ep,ev,re,r,rp,chk) function c74701381.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,0) Duel.Hint(HINT_SELECTMSG,tp,563)
local rc=Duel.AnnounceRace(tp,1,0xffffff) local rc=Duel.AnnounceRace(tp,1,0xffffff)
e:GetLabelObject():SetLabel(rc) e:GetLabelObject():SetLabel(rc)
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