Commit 027bf102 authored by nanahira's avatar nanahira

Merge branch 'master' into 2pick

parents 1edb0dae b33bcc53
...@@ -81,6 +81,7 @@ after_build: ...@@ -81,6 +81,7 @@ after_build:
- mv -f ../../system.conf . - mv -f ../../system.conf .
- cp -rf ../../ygopro.exe . - cp -rf ../../ygopro.exe .
- mv -f ../../premake5.exe . - mv -f ../../premake5.exe .
- mv -f ../../bats/build.bat .
- cd .. - cd ..
- mkdir redis - mkdir redis
...@@ -102,7 +103,8 @@ after_build: ...@@ -102,7 +103,8 @@ after_build:
- npm install ws - npm install ws
- npm install redis - npm install redis
- cd .. - cd ..
- 7z a ygopro-server.7z ygopro-server start.bat -mx=9 -xr!.git* - mv -f bats/start.bat .
- 7z a -mx9 -xr!.git* ygopro-server.7z ygopro-server start.bat
test: off test: off
...@@ -120,7 +122,6 @@ cache: ...@@ -120,7 +122,6 @@ cache:
- lua-5.3.4.tar.gz - lua-5.3.4.tar.gz
- sqlite-amalgamation-3200100.zip - sqlite-amalgamation-3200100.zip
- irrKlang-32bit-1.5.0.zip - irrKlang-32bit-1.5.0.zip
- irrKlang-pro-1.5.0.zip
- sqlite-amalgamation-3150200.zip - sqlite-amalgamation-3150200.zip
- premake-5.0.0-alpha10-windows.zip - premake-5.0.0-alpha10-windows.zip
- Redis-x64-3.2.100.zip - Redis-x64-3.2.100.zip
No preview for this file type
...@@ -62,7 +62,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) { ...@@ -62,7 +62,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
hints.ai_socktype = SOCK_STREAM; hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP; hints.ai_protocol = IPPROTO_TCP;
hints.ai_flags = EVUTIL_AI_ADDRCONFIG; hints.ai_flags = EVUTIL_AI_ADDRCONFIG;
int status=evutil_getaddrinfo(hostname, port, &hints, &answer); int status = evutil_getaddrinfo(hostname, port, &hints, &answer);
if(status != 0) { if(status != 0) {
mainGame->gMutex.Lock(); mainGame->gMutex.Lock();
mainGame->env->addMessageBox(L"", dataManager.GetSysString(1412)); mainGame->env->addMessageBox(L"", dataManager.GetSysString(1412));
......
...@@ -114,12 +114,14 @@ void SingleDuel::JoinGame(DuelPlayer* dp, void* pdata, bool is_creater) { ...@@ -114,12 +114,14 @@ void SingleDuel::JoinGame(DuelPlayer* dp, void* pdata, bool is_creater) {
if(!players[0] || !players[1]) { if(!players[0] || !players[1]) {
STOC_HS_PlayerEnter scpe; STOC_HS_PlayerEnter scpe;
BufferIO::CopyWStr(dp->name, scpe.name, 20); BufferIO::CopyWStr(dp->name, scpe.name, 20);
if(players[0]) { if(!players[0])
scpe.pos = 0;
else
scpe.pos = 1; scpe.pos = 1;
if(players[0]) {
NetServer::SendPacketToPlayer(players[0], STOC_HS_PLAYER_ENTER, scpe); NetServer::SendPacketToPlayer(players[0], STOC_HS_PLAYER_ENTER, scpe);
} }
if(players[1]) { if(players[1]) {
scpe.pos = 0;
NetServer::SendPacketToPlayer(players[1], STOC_HS_PLAYER_ENTER, scpe); NetServer::SendPacketToPlayer(players[1], STOC_HS_PLAYER_ENTER, scpe);
} }
for(auto pit = observers.begin(); pit != observers.end(); ++pit) for(auto pit = observers.begin(); pit != observers.end(); ++pit)
......
#[2017.10][2017.11 TCG][2017.7][2017.4][2017.1][2016.10][2016.7][2016.4][2016.1][2015.10][2015.4][2015.1][2014.10][2014.7][2014.4][2014.2][2013.9][2017.9 TCG][2017.6 TCG][2017.3 TCG][2016.8 TCG][2016.4 TCG][2015.11 TCG][2015.7 TCG][2015.4 TCG][2015.1 TCG][2014.10 TCG][2014.7 TCG][2014.4 TCG][2014.1.1 TCG][2013.10.11 TCG][2013.3.1][2012.9.1][2012.3.1][2011.9.1] #[2018.1][2017.10][2017.11 TCG][2017.7][2017.4][2017.1][2016.10][2016.7][2016.4][2016.1][2015.10][2015.4][2015.1][2014.10][2014.7][2014.4][2014.2][2013.9][2017.9 TCG][2017.6 TCG][2017.3 TCG][2016.8 TCG][2016.4 TCG][2015.11 TCG][2015.7 TCG][2015.4 TCG][2015.1 TCG][2014.10 TCG][2014.7 TCG][2014.4 TCG][2014.1.1 TCG][2013.10.11 TCG][2013.3.1][2012.9.1][2012.3.1][2011.9.1]
!2018.1
#forbidden
20663556 0 --イレカエル
44910027 0 --ヴィクトリー・ドラゴン
20366274 0 --エルシャドール・ネフィリム
53804307 0 --焔征竜-ブラスター
68819554 0 --Emダメージ・ジャグラー
07563579 0 --Emヒグルミ
17330916 0 --EMモンキーボード
90411554 0 --巌征竜-レドックス
17412721 0 --旧神ノーデン
34124316 0 --サイバーポッド
88071625 0 --The tyrant NEPTUNE
48905153 0 --十二獣ドランシア
85115440 0 --十二獣ブルホーン
21593977 0 --処刑人-マキュラ
21377582 0 --真竜剣皇マスターP
16923472 0 --ゼンマイハンター
56570271 0 --DHERO ディスクガイ
18326736 0 --星守の騎士 プトレマイオス
54719828 0 --No.16 色の支配者ショック・ルーラー
26400609 0 --瀑征竜-タイダル
78706415 0 --ファイバーポッド
93369354 0 --フィッシュボーグ-ガンナー
31178212 0 --マジェスペクター・ユニコーン
34206604 0 --魔導サイエンティスト
96782886 0 --メンタルマスター
03078576 0 --八汰烏
25862681 0 --エンシェント・フェアリー・ドラゴン
34086406 0 --ラヴァルバル・チェイン
89399912 0 --嵐征竜-テンペスト
57421866 0 --レベル・スティーラー
41482598 0 --悪夢の蜃気楼
44763025 0 --いたずら好きな双子悪魔
19613556 0 --大嵐
17375316 0 --押収
74191942 0 --苦渋の選択
42829885 0 --強引な番兵
45986603 0 --強奪
55144522 0 --強欲な壺
04031928 0 --心変わり
46060017 0 --十二獣の会局
12580477 0 --サンダー·ボルト
23557835 0 --次元融合
57953380 0 --生還の宝札
60682203 0 --大寒波
69243953 0 --蝶の短剣-エルマ
79571449 0 --天使の施し
13035077 0 --ドラゴニックD
70828912 0 --早すぎた埋葬
42703248 0 --ハリケーン
34906152 0 --マスドライバー
46448938 0 --魔導書の神判
46411259 0 --突然変異
85602018 0 --遺言状
27174286 0 --異次元からの帰還
93016201 0 --王宮の弾圧
03280747 0 --第六感
64697231 0 --ダスト·シュート
80604091 0 --血の代償
35316708 0 --刻の封印
17178486 0 --ライフチェンジャー
28566710 0 --ラストバトル!
#limit
64034255 1 --A·ジェネクス·バードマン
01561110 1 --ABC-ドラゴン・バスター
50720316 1 --E·HERO シャドー·ミスト
40318957 1 --EMドクロバット・ジョーカー
65536818 1 --源竜星-ボウテンコウ
74586817 1 --PSYフレームロード・Ω
78872731 1 --十二獣モルモラット
06602300 1 --重爆撃禽 ボム・フェネクス
86120751 1 --召喚師アレイスター
78868119 1 --深海のディーヴァ
58984738 1 --真竜拳士ダイナマイトK
04474060 1 --SPYRAL GEAR-ドローン
78080961 1 --SPYRAL-ジーニアス
81275020 1 --SRベイゴマックス
65192027 1 --ダーク·アームド·ドラゴン
44335251 1 --魂喰いオヴィラプター
15341821 1 --ダンディライオン
90953320 1 --TG ハイパー·ライブラリアン
69015963 1 --デビル・フランケン
16226786 1 --深淵の暗殺者
28297833 1 --ネクロフェイス
83531441 1 --彼岸の旅人 ダンテ
70583986 1 --氷結界の虎王ドゥローレン
52687916 1 --氷結界の龍 トリシューラ
05043010 1 --ファイアウォール・ドラゴン
33396948 1 --封印されしエクゾディア
07902349 1 --封印されし者の左腕
70903634 1 --封印されし者の右腕
44519536 1 --封印されし者の左足
08124921 1 --封印されし者の右足
55623480 1 --妖精伝姫−シラユキ
09929398 1 --BF−朧影のゴウフウ
09047460 1 --BF-隠れ蓑のスチーム
26674724 1 --ブリューナクの影霊衣
36042004 1 --ベビケラサウルス
10802915 1 --魔界発現世行きデスガイド
33508719 1 --メタモルポット
90809975 1 --餅カエル
89463537 1 --ユニコールの影霊衣
92746535 1 --竜剣士ラスターP
88264978 1 --レッドアイズ·ダークネスメタルドラゴン
33782437 1 --一時休戦
66957584 1 --インフェルニティガン
81439173 1 --おろかな埋葬
23701465 1 --原初の種
99330325 1 --妨げられた壊獣の眠り
67723438 1 --緊急テレポート
89739383 1 --グリモの魔導書
45305419 1 --継承の印
83764718 1 --死者蘇生
49430782 1 --真竜の継承
54631665 1 --SPYRAL RESORT
32807846 1 --増援
54447022 1 --ソウル・チャージ
48130397 1 --超融合
72892473 1 --手札抹殺
73628505 1 --テラ・フォーミング
97211663 1 --影霊衣の反魂術
18144506 1 --ハーピィの羽根帚
53208660 1 --ペンデュラム・コール
93600443 1 --マスク・チェンジ・セカンド
15854426 1 --霞の谷の神風
58577036 1 --名推理
23171610 1 --リミッター解除
14733538 1 --竜呼相打つ
02295440 1 --ワン·フォー·ワン
05851097 1 --虚無空間
61740673 1 --王宮の勅命
41420027 1 --神の宣告
35125879 1 --真竜皇の復活
36468556 1 --停戦協定
21076084 1 --トリックスター・リンカーネイション
83555666 1 --破壊輪
32723153 1 --マジカル·エクスプロージョン
#semi limit
45222299 2 --イビリチュア·ガストクラーケ
43722862 2 --WW-アイス・ベル
40044918 2 --E·HERO エアーマン
00423585 2 --召喚僧サモンプリースト
33184167 2 --同族感染ウィルス
75732622 2 --トーチ・ゴーレム
90307777 2 --影霊衣の術士 シュリット
41386308 2 --マスマティシャン
10028593 2 --輪廻天狗
48686504 2 --ローンファイア・ブロッサム
59750328 2 --命削りの宝札
47325505 2 --化石調査
73915051 2 --スケープ・ゴート
91623717 2 --連鎖爆撃
67169062 2 --貪欲な壺
22842126 2 --汎神の帝王
73468603 2 --盆回し
43040603 2 --モンスターゲート
66399653 2 --ユニオン格納庫
84749824 2 --神の警告
40605147 2 --神の通告
!2017.10 !2017.10
#forbidden #forbidden
20663556 0 --イレカエル 20663556 0 --イレカエル
......
...@@ -422,6 +422,26 @@ int32 card::is_fusion_set_card(uint32 set_code) { ...@@ -422,6 +422,26 @@ int32 card::is_fusion_set_card(uint32 set_code) {
} }
return FALSE; return FALSE;
} }
int32 card::is_link_set_card(uint32 set_code) {
if(is_set_card(set_code))
return TRUE;
uint32 settype = set_code & 0xfff;
uint32 setsubtype = set_code & 0xf000;
effect_set eset;
filter_effect(EFFECT_ADD_LINK_CODE, &eset);
for(int32 i = 0; i < eset.size(); ++i) {
uint32 code = eset[i]->get_value(this);
card_data dat;
::read_card(code, &dat);
uint64 setcode = dat.setcode;
while(setcode) {
if ((setcode & 0xfff) == settype && (setcode & 0xf000 & setsubtype) == setsubtype)
return TRUE;
setcode = setcode >> 16;
}
}
return FALSE;
}
uint32 card::get_type() { uint32 card::get_type() {
if(assume_type == ASSUME_TYPE) if(assume_type == ASSUME_TYPE)
return assume_value; return assume_value;
...@@ -1046,6 +1066,16 @@ uint32 card::get_fusion_attribute(uint8 playerid) { ...@@ -1046,6 +1066,16 @@ uint32 card::get_fusion_attribute(uint8 playerid) {
} }
return attribute; return attribute;
} }
uint32 card::get_link_attribute(uint8 playerid) {
effect_set effects;
filter_effect(EFFECT_ADD_LINK_ATTRIBUTE, &effects);
uint32 attribute = get_attribute();
for (int32 i = 0; i < effects.size(); ++i) {
pduel->lua->add_param(playerid, PARAM_TYPE_INT);
attribute |= effects[i]->get_value(this, 1);
}
return attribute;
}
// see get_level() // see get_level()
uint32 card::get_race() { uint32 card::get_race() {
if(assume_type == ASSUME_RACE) if(assume_type == ASSUME_RACE)
...@@ -1075,6 +1105,16 @@ uint32 card::get_race() { ...@@ -1075,6 +1105,16 @@ uint32 card::get_race() {
temp.race = 0xffffffff; temp.race = 0xffffffff;
return race; return race;
} }
uint32 card::get_link_race(uint8 playerid) {
effect_set effects;
filter_effect(EFFECT_ADD_LINK_RACE, &effects);
uint32 race = get_race();
for (int32 i = 0; i < effects.size(); ++i) {
pduel->lua->add_param(playerid, PARAM_TYPE_INT);
race |= effects[i]->get_value(this, 1);
}
return race;
}
uint32 card::get_lscale() { uint32 card::get_lscale() {
if(!current.is_location(LOCATION_PZONE)) if(!current.is_location(LOCATION_PZONE))
return data.lscale; return data.lscale;
......
...@@ -201,6 +201,7 @@ public: ...@@ -201,6 +201,7 @@ public:
int32 is_origin_set_card(uint32 set_code); int32 is_origin_set_card(uint32 set_code);
int32 is_pre_set_card(uint32 set_code); int32 is_pre_set_card(uint32 set_code);
int32 is_fusion_set_card(uint32 set_code); int32 is_fusion_set_card(uint32 set_code);
int32 is_link_set_card(uint32 set_code);
uint32 get_type(); uint32 get_type();
uint32 get_fusion_type(); uint32 get_fusion_type();
uint32 get_synchro_type(); uint32 get_synchro_type();
...@@ -218,7 +219,9 @@ public: ...@@ -218,7 +219,9 @@ public:
uint32 check_xyz_level(card* pcard, uint32 lv); uint32 check_xyz_level(card* pcard, uint32 lv);
uint32 get_attribute(); uint32 get_attribute();
uint32 get_fusion_attribute(uint8 playerid); uint32 get_fusion_attribute(uint8 playerid);
uint32 get_link_attribute(uint8 playerid);
uint32 get_race(); uint32 get_race();
uint32 get_link_race(uint8 playerid);
uint32 get_lscale(); uint32 get_lscale();
uint32 get_rscale(); uint32 get_rscale();
uint32 get_link_marker(); uint32 get_link_marker();
......
...@@ -431,6 +431,10 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2) ...@@ -431,6 +431,10 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EFFECT_CHANGE_FUSION_ATTRIBUTE 351 #define EFFECT_CHANGE_FUSION_ATTRIBUTE 351
#define EFFECT_EXTRA_FUSION_MATERIAL 352 #define EFFECT_EXTRA_FUSION_MATERIAL 352
#define EFFECT_TUNER_MATERIAL_LIMIT 353 #define EFFECT_TUNER_MATERIAL_LIMIT 353
#define EFFECT_ADD_LINK_CODE 354
//#define EFFECT_ADD_LINK_SETCODE 355
#define EFFECT_ADD_LINK_ATTRIBUTE 356
#define EFFECT_ADD_LINK_RACE 357
#define EVENT_STARTUP 1000 #define EVENT_STARTUP 1000
#define EVENT_FLIP 1001 #define EVENT_FLIP 1001
......
...@@ -26,11 +26,14 @@ static const struct luaL_Reg cardlib[] = { ...@@ -26,11 +26,14 @@ static const struct luaL_Reg cardlib[] = {
{ "GetOriginalCode", scriptlib::card_get_origin_code }, { "GetOriginalCode", scriptlib::card_get_origin_code },
{ "GetOriginalCodeRule", scriptlib::card_get_origin_code_rule }, { "GetOriginalCodeRule", scriptlib::card_get_origin_code_rule },
{ "GetFusionCode", scriptlib::card_get_fusion_code }, { "GetFusionCode", scriptlib::card_get_fusion_code },
{ "GetLinkCode", scriptlib::card_get_link_code },
{ "IsFusionCode", scriptlib::card_is_fusion_code }, { "IsFusionCode", scriptlib::card_is_fusion_code },
{ "IsLinkCode", scriptlib::card_is_link_code },
{ "IsSetCard", scriptlib::card_is_set_card }, { "IsSetCard", scriptlib::card_is_set_card },
{ "IsOriginalSetCard", scriptlib::card_is_origin_set_card }, { "IsOriginalSetCard", scriptlib::card_is_origin_set_card },
{ "IsPreviousSetCard", scriptlib::card_is_pre_set_card }, { "IsPreviousSetCard", scriptlib::card_is_pre_set_card },
{ "IsFusionSetCard", scriptlib::card_is_fusion_set_card }, { "IsFusionSetCard", scriptlib::card_is_fusion_set_card },
{ "IsLinkSetCard", scriptlib::card_is_link_set_card },
{ "GetType", scriptlib::card_get_type }, { "GetType", scriptlib::card_get_type },
{ "GetOriginalType", scriptlib::card_get_origin_type }, { "GetOriginalType", scriptlib::card_get_origin_type },
{ "GetFusionType", scriptlib::card_get_fusion_type }, { "GetFusionType", scriptlib::card_get_fusion_type },
...@@ -64,8 +67,10 @@ static const struct luaL_Reg cardlib[] = { ...@@ -64,8 +67,10 @@ static const struct luaL_Reg cardlib[] = {
{ "GetAttribute", scriptlib::card_get_attribute }, { "GetAttribute", scriptlib::card_get_attribute },
{ "GetOriginalAttribute", scriptlib::card_get_origin_attribute }, { "GetOriginalAttribute", scriptlib::card_get_origin_attribute },
{ "GetFusionAttribute", scriptlib::card_get_fusion_attribute }, { "GetFusionAttribute", scriptlib::card_get_fusion_attribute },
{ "GetLinkAttribute", scriptlib::card_get_link_attribute },
{ "GetRace", scriptlib::card_get_race }, { "GetRace", scriptlib::card_get_race },
{ "GetOriginalRace", scriptlib::card_get_origin_race }, { "GetOriginalRace", scriptlib::card_get_origin_race },
{ "GetLinkRace", scriptlib::card_get_link_race },
{ "GetAttack", scriptlib::card_get_attack }, { "GetAttack", scriptlib::card_get_attack },
{ "GetBaseAttack", scriptlib::card_get_origin_attack }, { "GetBaseAttack", scriptlib::card_get_origin_attack },
{ "GetTextAttack", scriptlib::card_get_text_attack }, { "GetTextAttack", scriptlib::card_get_text_attack },
...@@ -112,8 +117,10 @@ static const struct luaL_Reg cardlib[] = { ...@@ -112,8 +117,10 @@ static const struct luaL_Reg cardlib[] = {
{ "IsRank", scriptlib::card_is_rank }, { "IsRank", scriptlib::card_is_rank },
{ "IsLink", scriptlib::card_is_link }, { "IsLink", scriptlib::card_is_link },
{ "IsRace", scriptlib::card_is_race }, { "IsRace", scriptlib::card_is_race },
{ "IsLinkRace", scriptlib::card_is_link_race },
{ "IsAttribute", scriptlib::card_is_attribute }, { "IsAttribute", scriptlib::card_is_attribute },
{ "IsFusionAttribute", scriptlib::card_is_fusion_attribute }, { "IsFusionAttribute", scriptlib::card_is_fusion_attribute },
{ "IsLinkAttribute", scriptlib::card_is_link_attribute },
{ "IsReason", scriptlib::card_is_reason }, { "IsReason", scriptlib::card_is_reason },
{ "IsSummonType", scriptlib::card_is_summon_type }, { "IsSummonType", scriptlib::card_is_summon_type },
{ "IsStatus", scriptlib::card_is_status }, { "IsStatus", scriptlib::card_is_status },
......
...@@ -149,6 +149,23 @@ int32 scriptlib::card_get_fusion_code(lua_State *L) { ...@@ -149,6 +149,23 @@ int32 scriptlib::card_get_fusion_code(lua_State *L) {
lua_pushinteger(L, eset[i]->get_value(pcard)); lua_pushinteger(L, eset[i]->get_value(pcard));
return count + eset.size(); return count + eset.size();
} }
int32 scriptlib::card_get_link_code(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
lua_pushinteger(L, pcard->get_code());
int32 count = 1;
uint32 otcode = pcard->get_another_code();
if(otcode) {
lua_pushinteger(L, otcode);
count++;
}
effect_set eset;
pcard->filter_effect(EFFECT_ADD_LINK_CODE, &eset);
for(int32 i = 0; i < eset.size(); ++i)
lua_pushinteger(L, eset[i]->get_value(pcard));
return count + eset.size();
}
int32 scriptlib::card_is_fusion_code(lua_State *L) { int32 scriptlib::card_is_fusion_code(lua_State *L) {
check_param_count(L, 2); check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
...@@ -179,6 +196,36 @@ int32 scriptlib::card_is_fusion_code(lua_State *L) { ...@@ -179,6 +196,36 @@ int32 scriptlib::card_is_fusion_code(lua_State *L) {
lua_pushboolean(L, result); lua_pushboolean(L, result);
return 1; return 1;
} }
int32 scriptlib::card_is_link_code(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
effect_set eset;
pcard->filter_effect(EFFECT_ADD_LINK_CODE, &eset);
if(!eset.size())
return card_is_code(L);
uint32 code1 = pcard->get_code();
uint32 code2 = pcard->get_another_code();
std::unordered_set<uint32> fcode;
fcode.insert(code1);
if(code2)
fcode.insert(code2);
for(int32 i = 0; i < eset.size(); ++i)
fcode.insert(eset[i]->get_value(pcard));
uint32 count = lua_gettop(L) - 1;
uint32 result = FALSE;
for(uint32 i = 0; i < count; ++i) {
if(lua_isnil(L, i + 2))
continue;
uint32 tcode = lua_tonumberint(L, i + 2);
if(fcode.find(tcode) != fcode.end()) {
result = TRUE;
break;
}
}
lua_pushboolean(L, result);
return 1;
}
int32 scriptlib::card_is_set_card(lua_State *L) { int32 scriptlib::card_is_set_card(lua_State *L) {
check_param_count(L, 2); check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
...@@ -211,6 +258,14 @@ int32 scriptlib::card_is_fusion_set_card(lua_State *L) { ...@@ -211,6 +258,14 @@ int32 scriptlib::card_is_fusion_set_card(lua_State *L) {
lua_pushboolean(L, pcard->is_fusion_set_card(set_code)); lua_pushboolean(L, pcard->is_fusion_set_card(set_code));
return 1; return 1;
} }
int32 scriptlib::card_is_link_set_card(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**) lua_touserdata(L, 1);
uint32 set_code = lua_tonumberint(L, 2);
lua_pushboolean(L, pcard->is_link_set_card(set_code));
return 1;
}
int32 scriptlib::card_get_type(lua_State *L) { int32 scriptlib::card_get_type(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
...@@ -467,7 +522,7 @@ int32 scriptlib::card_get_column_zone(lua_State *L) { ...@@ -467,7 +522,7 @@ int32 scriptlib::card_get_column_zone(lua_State *L) {
int32 loc = lua_tonumberint(L, 2); int32 loc = lua_tonumberint(L, 2);
int32 left = 0; int32 left = 0;
int32 right = 0; int32 right = 0;
int32 cp = pcard->current.controler; int32 cp = pcard->current.controler;
if(lua_gettop(L) >= 3) if(lua_gettop(L) >= 3)
left = lua_tonumberint(L, 3); left = lua_tonumberint(L, 3);
if(lua_gettop(L) >= 4) if(lua_gettop(L) >= 4)
...@@ -517,6 +572,18 @@ int32 scriptlib::card_get_fusion_attribute(lua_State *L) { ...@@ -517,6 +572,18 @@ int32 scriptlib::card_get_fusion_attribute(lua_State *L) {
lua_pushinteger(L, pcard->get_fusion_attribute(playerid)); lua_pushinteger(L, pcard->get_fusion_attribute(playerid));
return 1; return 1;
} }
int32 scriptlib::card_get_link_attribute(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**)lua_touserdata(L, 1);
int32 playerid = PLAYER_NONE;
if(lua_gettop(L) > 1 && !lua_isnil(L, 2))
playerid = lua_tonumberint(L, 2);
else
playerid = pcard->pduel->game_field->core.reason_player;
lua_pushinteger(L, pcard->get_link_attribute(playerid));
return 1;
}
int32 scriptlib::card_get_race(lua_State *L) { int32 scriptlib::card_get_race(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
...@@ -534,6 +601,18 @@ int32 scriptlib::card_get_origin_race(lua_State *L) { ...@@ -534,6 +601,18 @@ int32 scriptlib::card_get_origin_race(lua_State *L) {
lua_pushinteger(L, pcard->data.race); lua_pushinteger(L, pcard->data.race);
return 1; return 1;
} }
int32 scriptlib::card_get_link_race(lua_State *L) {
check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**)lua_touserdata(L, 1);
int32 playerid = PLAYER_NONE;
if(lua_gettop(L) > 1 && !lua_isnil(L, 2))
playerid = lua_tonumberint(L, 2);
else
playerid = pcard->pduel->game_field->core.reason_player;
lua_pushinteger(L, pcard->get_link_race(playerid));
return 1;
}
int32 scriptlib::card_get_attack(lua_State *L) { int32 scriptlib::card_get_attack(lua_State *L) {
check_param_count(L, 1); check_param_count(L, 1);
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
...@@ -918,6 +997,22 @@ int32 scriptlib::card_is_race(lua_State *L) { ...@@ -918,6 +997,22 @@ int32 scriptlib::card_is_race(lua_State *L) {
lua_pushboolean(L, 0); lua_pushboolean(L, 0);
return 1; return 1;
} }
int32 scriptlib::card_is_link_race(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**)lua_touserdata(L, 1);
uint32 trace = lua_tonumberint(L, 2);
int32 playerid = PLAYER_NONE;
if(lua_gettop(L) > 2 && !lua_isnil(L, 3))
playerid = lua_tonumberint(L, 3);
else
playerid = pcard->pduel->game_field->core.reason_player;
if(pcard->get_link_race(playerid) & trace)
lua_pushboolean(L, 1);
else
lua_pushboolean(L, 0);
return 1;
}
int32 scriptlib::card_is_attribute(lua_State *L) { int32 scriptlib::card_is_attribute(lua_State *L) {
check_param_count(L, 2); check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
...@@ -945,6 +1040,22 @@ int32 scriptlib::card_is_fusion_attribute(lua_State *L) { ...@@ -945,6 +1040,22 @@ int32 scriptlib::card_is_fusion_attribute(lua_State *L) {
lua_pushboolean(L, 0); lua_pushboolean(L, 0);
return 1; return 1;
} }
int32 scriptlib::card_is_link_attribute(lua_State *L) {
check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1);
card* pcard = *(card**)lua_touserdata(L, 1);
uint32 tattrib = lua_tonumberint(L, 2);
int32 playerid = PLAYER_NONE;
if(lua_gettop(L) > 2 && !lua_isnil(L, 3))
playerid = lua_tonumberint(L, 3);
else
playerid = pcard->pduel->game_field->core.reason_player;
if(pcard->get_link_attribute(playerid) & tattrib)
lua_pushboolean(L, 1);
else
lua_pushboolean(L, 0);
return 1;
}
int32 scriptlib::card_is_reason(lua_State *L) { int32 scriptlib::card_is_reason(lua_State *L) {
check_param_count(L, 2); check_param_count(L, 2);
check_param(L, PARAM_TYPE_CARD, 1); check_param(L, PARAM_TYPE_CARD, 1);
......
...@@ -36,11 +36,14 @@ public: ...@@ -36,11 +36,14 @@ public:
static int32 card_get_origin_code(lua_State *L); static int32 card_get_origin_code(lua_State *L);
static int32 card_get_origin_code_rule(lua_State *L); static int32 card_get_origin_code_rule(lua_State *L);
static int32 card_get_fusion_code(lua_State *L); static int32 card_get_fusion_code(lua_State *L);
static int32 card_get_link_code(lua_State *L);
static int32 card_is_fusion_code(lua_State *L); static int32 card_is_fusion_code(lua_State *L);
static int32 card_is_link_code(lua_State *L);
static int32 card_is_set_card(lua_State *L); static int32 card_is_set_card(lua_State *L);
static int32 card_is_origin_set_card(lua_State *L); static int32 card_is_origin_set_card(lua_State *L);
static int32 card_is_pre_set_card(lua_State *L); static int32 card_is_pre_set_card(lua_State *L);
static int32 card_is_fusion_set_card(lua_State *L); static int32 card_is_fusion_set_card(lua_State *L);
static int32 card_is_link_set_card(lua_State *L);
static int32 card_get_type(lua_State *L); static int32 card_get_type(lua_State *L);
static int32 card_get_origin_type(lua_State *L); static int32 card_get_origin_type(lua_State *L);
static int32 card_get_fusion_type(lua_State *L); static int32 card_get_fusion_type(lua_State *L);
...@@ -74,8 +77,10 @@ public: ...@@ -74,8 +77,10 @@ public:
static int32 card_get_attribute(lua_State *L); static int32 card_get_attribute(lua_State *L);
static int32 card_get_origin_attribute(lua_State *L); static int32 card_get_origin_attribute(lua_State *L);
static int32 card_get_fusion_attribute(lua_State *L); static int32 card_get_fusion_attribute(lua_State *L);
static int32 card_get_link_attribute(lua_State *L);
static int32 card_get_race(lua_State *L); static int32 card_get_race(lua_State *L);
static int32 card_get_origin_race(lua_State *L); static int32 card_get_origin_race(lua_State *L);
static int32 card_get_link_race(lua_State *L);
static int32 card_get_attack(lua_State *L); static int32 card_get_attack(lua_State *L);
static int32 card_get_origin_attack(lua_State *L); static int32 card_get_origin_attack(lua_State *L);
static int32 card_get_text_attack(lua_State *L); static int32 card_get_text_attack(lua_State *L);
...@@ -122,8 +127,10 @@ public: ...@@ -122,8 +127,10 @@ public:
static int32 card_is_rank(lua_State *L); static int32 card_is_rank(lua_State *L);
static int32 card_is_link(lua_State *L); static int32 card_is_link(lua_State *L);
static int32 card_is_race(lua_State *L); static int32 card_is_race(lua_State *L);
static int32 card_is_link_race(lua_State *L);
static int32 card_is_attribute(lua_State *L); static int32 card_is_attribute(lua_State *L);
static int32 card_is_fusion_attribute(lua_State *L); static int32 card_is_fusion_attribute(lua_State *L);
static int32 card_is_link_attribute(lua_State *L);
static int32 card_is_reason(lua_State *L); static int32 card_is_reason(lua_State *L);
static int32 card_is_summon_type(lua_State *L); static int32 card_is_summon_type(lua_State *L);
static int32 card_is_status(lua_State *L); static int32 card_is_status(lua_State *L);
......
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