Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
ygopro-core
Commits
048acc22
Commit
048acc22
authored
Jan 23, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Fluorohydride/ygopro-core
parents
8cf8c513
b3401baa
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
830 additions
and
710 deletions
+830
-710
card.cpp
card.cpp
+119
-30
card.h
card.h
+1
-0
common.h
common.h
+4
-3
effect.cpp
effect.cpp
+4
-2
effect.h
effect.h
+1
-0
field.h
field.h
+2
-0
interpreter.cpp
interpreter.cpp
+5
-630
libcard.cpp
libcard.cpp
+273
-0
libdebug.cpp
libdebug.cpp
+19
-0
libduel.cpp
libduel.cpp
+230
-0
libeffect.cpp
libeffect.cpp
+66
-0
libgroup.cpp
libgroup.cpp
+51
-0
operations.cpp
operations.cpp
+7
-8
processor.cpp
processor.cpp
+41
-36
scriptlib.h
scriptlib.h
+7
-1
No files found.
card.cpp
View file @
048acc22
This diff is collapsed.
Click to expand it.
card.h
View file @
048acc22
...
@@ -188,6 +188,7 @@ public:
...
@@ -188,6 +188,7 @@ public:
effect_container
single_effect
;
effect_container
single_effect
;
effect_container
field_effect
;
effect_container
field_effect
;
effect_container
equip_effect
;
effect_container
equip_effect
;
effect_container
target_effect
;
effect_container
xmaterial_effect
;
effect_container
xmaterial_effect
;
effect_indexer
indexer
;
effect_indexer
indexer
;
effect_relation
relate_effect
;
effect_relation
relate_effect
;
...
...
common.h
View file @
048acc22
...
@@ -336,10 +336,11 @@ struct card_sort {
...
@@ -336,10 +336,11 @@ struct card_sort {
#define HINT_CODE 8
#define HINT_CODE 8
#define HINT_NUMBER 9
#define HINT_NUMBER 9
#define HINT_CARD 10
#define HINT_CARD 10
#define HINT_ZONE 11
//custom hints in KoishiPro for custom sound
//custom hints in KoishiPro for custom sound
#define HINT_MUSIC
1
1
#define HINT_MUSIC
2
1
#define HINT_SOUND
1
2
#define HINT_SOUND
2
2
#define HINT_MUSIC_OGG
1
3
#define HINT_MUSIC_OGG
2
3
//
//
#define CHINT_TURN 1
#define CHINT_TURN 1
#define CHINT_CARD 2
#define CHINT_CARD 2
...
...
effect.cpp
View file @
048acc22
...
@@ -114,7 +114,7 @@ int32 effect::is_available() {
...
@@ -114,7 +114,7 @@ int32 effect::is_available() {
return
FALSE
;
return
FALSE
;
}
}
}
}
if
(
type
&
EFFECT_TYPE_FIELD
)
{
if
(
type
&
(
EFFECT_TYPE_FIELD
|
EFFECT_TYPE_TARGET
)
)
{
card
*
phandler
=
get_handler
();
card
*
phandler
=
get_handler
();
card
*
powner
=
get_owner
();
card
*
powner
=
get_owner
();
if
(
!
is_flag
(
EFFECT_FLAG_FIELD_ONLY
))
{
if
(
!
is_flag
(
EFFECT_FLAG_FIELD_ONLY
))
{
...
@@ -439,12 +439,14 @@ int32 effect::is_activate_check(uint8 playerid, const tevent& e, int32 neglect_c
...
@@ -439,12 +439,14 @@ int32 effect::is_activate_check(uint8 playerid, const tevent& e, int32 neglect_c
pduel
->
game_field
->
restore_lp_cost
();
pduel
->
game_field
->
restore_lp_cost
();
return
result
;
return
result
;
}
}
// check if pcard is the target of the field effect this
int32
effect
::
is_target
(
card
*
pcard
)
{
int32
effect
::
is_target
(
card
*
pcard
)
{
if
(
type
&
EFFECT_TYPE_ACTIONS
)
if
(
type
&
EFFECT_TYPE_ACTIONS
)
return
FALSE
;
return
FALSE
;
if
(
type
&
(
EFFECT_TYPE_SINGLE
|
EFFECT_TYPE_EQUIP
|
EFFECT_TYPE_XMATERIAL
)
&&
!
(
type
&
EFFECT_TYPE_FIELD
))
if
(
type
&
(
EFFECT_TYPE_SINGLE
|
EFFECT_TYPE_EQUIP
|
EFFECT_TYPE_XMATERIAL
)
&&
!
(
type
&
EFFECT_TYPE_FIELD
))
return
TRUE
;
return
TRUE
;
if
((
type
&
EFFECT_TYPE_TARGET
)
&&
!
(
type
&
EFFECT_TYPE_FIELD
))
{
return
is_fit_target_function
(
pcard
);
}
if
(
pcard
&&
!
is_flag
(
EFFECT_FLAG_SET_AVAILABLE
)
&&
(
pcard
->
current
.
location
&
LOCATION_ONFIELD
)
if
(
pcard
&&
!
is_flag
(
EFFECT_FLAG_SET_AVAILABLE
)
&&
(
pcard
->
current
.
location
&
LOCATION_ONFIELD
)
&&
!
pcard
->
is_position
(
POS_FACEUP
))
&&
!
pcard
->
is_position
(
POS_FACEUP
))
return
FALSE
;
return
FALSE
;
...
...
effect.h
View file @
048acc22
...
@@ -174,6 +174,7 @@ public:
...
@@ -174,6 +174,7 @@ public:
#define EFFECT_TYPE_CONTINUOUS 0x0800 //
#define EFFECT_TYPE_CONTINUOUS 0x0800 //
#define EFFECT_TYPE_XMATERIAL 0x1000 //
#define EFFECT_TYPE_XMATERIAL 0x1000 //
#define EFFECT_TYPE_GRANT 0x2000 //
#define EFFECT_TYPE_GRANT 0x2000 //
#define EFFECT_TYPE_TARGET 0x4000 //
//========== Flags ==========
//========== Flags ==========
enum
effect_flag
:
uint32
{
enum
effect_flag
:
uint32
{
...
...
field.h
View file @
048acc22
...
@@ -185,6 +185,7 @@ struct processor {
...
@@ -185,6 +185,7 @@ struct processor {
event_list
point_event
;
event_list
point_event
;
event_list
instant_event
;
event_list
instant_event
;
event_list
queue_event
;
event_list
queue_event
;
event_list
delayed_activate_event
;
event_list
full_event
;
event_list
full_event
;
event_list
used_event
;
event_list
used_event
;
event_list
single_event
;
event_list
single_event
;
...
@@ -681,6 +682,7 @@ public:
...
@@ -681,6 +682,7 @@ public:
#define TIMING_BATTLE_PHASE 0x1000000
#define TIMING_BATTLE_PHASE 0x1000000
#define TIMING_EQUIP 0x2000000
#define TIMING_EQUIP 0x2000000
#define TIMING_BATTLE_STEP_END 0x4000000
#define TIMING_BATTLE_STEP_END 0x4000000
#define TIMING_BATTLED 0x8000000
#define GLOBALFLAG_DECK_REVERSE_CHECK 0x1
#define GLOBALFLAG_DECK_REVERSE_CHECK 0x1
#define GLOBALFLAG_BRAINWASHING_CHECK 0x2
#define GLOBALFLAG_BRAINWASHING_CHECK 0x2
...
...
interpreter.cpp
View file @
048acc22
This diff is collapsed.
Click to expand it.
libcard.cpp
View file @
048acc22
This diff is collapsed.
Click to expand it.
libdebug.cpp
View file @
048acc22
...
@@ -213,3 +213,22 @@ int32 scriptlib::debug_show_hint(lua_State *L) {
...
@@ -213,3 +213,22 @@ int32 scriptlib::debug_show_hint(lua_State *L) {
#endif
#endif
return
0
;
return
0
;
}
}
static
const
struct
luaL_Reg
debuglib
[]
=
{
{
"Message"
,
scriptlib
::
debug_message
},
{
"AddCard"
,
scriptlib
::
debug_add_card
},
{
"SetPlayerInfo"
,
scriptlib
::
debug_set_player_info
},
{
"PreSummon"
,
scriptlib
::
debug_pre_summon
},
{
"PreEquip"
,
scriptlib
::
debug_pre_equip
},
{
"PreSetTarget"
,
scriptlib
::
debug_pre_set_target
},
{
"PreAddCounter"
,
scriptlib
::
debug_pre_add_counter
},
{
"ReloadFieldBegin"
,
scriptlib
::
debug_reload_field_begin
},
{
"ReloadFieldEnd"
,
scriptlib
::
debug_reload_field_end
},
{
"SetAIName"
,
scriptlib
::
debug_set_ai_name
},
{
"ShowHint"
,
scriptlib
::
debug_show_hint
},
{
NULL
,
NULL
}
};
void
scriptlib
::
open_debuglib
(
lua_State
*
L
)
{
luaL_newlib
(
L
,
debuglib
);
lua_setglobal
(
L
,
"Debug"
);
}
libduel.cpp
View file @
048acc22
This diff is collapsed.
Click to expand it.
libeffect.cpp
View file @
048acc22
...
@@ -595,3 +595,69 @@ int32 scriptlib::effect_use_count_limit(lua_State *L) {
...
@@ -595,3 +595,69 @@ int32 scriptlib::effect_use_count_limit(lua_State *L) {
}
}
return
0
;
return
0
;
}
}
static
const
struct
luaL_Reg
effectlib
[]
=
{
{
"SetOwner"
,
scriptlib
::
effect_set_owner
},
{
"GetRange"
,
scriptlib
::
effect_get_range
},
{
"GetCountLimit"
,
scriptlib
::
effect_get_count_limit
},
{
"CreateEffect"
,
scriptlib
::
effect_new
},
{
"GlobalEffect"
,
scriptlib
::
effect_newex
},
{
"Clone"
,
scriptlib
::
effect_clone
},
{
"Reset"
,
scriptlib
::
effect_reset
},
{
"GetFieldID"
,
scriptlib
::
effect_get_field_id
},
{
"SetDescription"
,
scriptlib
::
effect_set_description
},
{
"SetCode"
,
scriptlib
::
effect_set_code
},
{
"SetRange"
,
scriptlib
::
effect_set_range
},
{
"SetTargetRange"
,
scriptlib
::
effect_set_target_range
},
{
"SetAbsoluteRange"
,
scriptlib
::
effect_set_absolute_range
},
{
"SetCountLimit"
,
scriptlib
::
effect_set_count_limit
},
{
"SetReset"
,
scriptlib
::
effect_set_reset
},
{
"SetType"
,
scriptlib
::
effect_set_type
},
{
"SetProperty"
,
scriptlib
::
effect_set_property
},
{
"SetLabel"
,
scriptlib
::
effect_set_label
},
{
"SetLabelObject"
,
scriptlib
::
effect_set_label_object
},
{
"SetCategory"
,
scriptlib
::
effect_set_category
},
{
"SetHintTiming"
,
scriptlib
::
effect_set_hint_timing
},
{
"SetCondition"
,
scriptlib
::
effect_set_condition
},
{
"SetTarget"
,
scriptlib
::
effect_set_target
},
{
"SetCost"
,
scriptlib
::
effect_set_cost
},
{
"SetValue"
,
scriptlib
::
effect_set_value
},
{
"SetOperation"
,
scriptlib
::
effect_set_operation
},
{
"SetOwnerPlayer"
,
scriptlib
::
effect_set_owner_player
},
{
"GetDescription"
,
scriptlib
::
effect_get_description
},
{
"GetCode"
,
scriptlib
::
effect_get_code
},
{
"GetType"
,
scriptlib
::
effect_get_type
},
{
"GetProperty"
,
scriptlib
::
effect_get_property
},
{
"GetLabel"
,
scriptlib
::
effect_get_label
},
{
"GetLabelObject"
,
scriptlib
::
effect_get_label_object
},
{
"GetCategory"
,
scriptlib
::
effect_get_category
},
{
"GetOwner"
,
scriptlib
::
effect_get_owner
},
{
"GetHandler"
,
scriptlib
::
effect_get_handler
},
{
"GetCondition"
,
scriptlib
::
effect_get_condition
},
{
"GetTarget"
,
scriptlib
::
effect_get_target
},
{
"GetCost"
,
scriptlib
::
effect_get_cost
},
{
"GetValue"
,
scriptlib
::
effect_get_value
},
{
"GetOperation"
,
scriptlib
::
effect_get_operation
},
{
"GetActiveType"
,
scriptlib
::
effect_get_active_type
},
{
"IsActiveType"
,
scriptlib
::
effect_is_active_type
},
{
"GetOwnerPlayer"
,
scriptlib
::
effect_get_owner_player
},
{
"GetHandlerPlayer"
,
scriptlib
::
effect_get_handler_player
},
{
"IsHasProperty"
,
scriptlib
::
effect_is_has_property
},
{
"IsHasCategory"
,
scriptlib
::
effect_is_has_category
},
{
"IsHasType"
,
scriptlib
::
effect_is_has_type
},
{
"IsActivatable"
,
scriptlib
::
effect_is_activatable
},
{
"IsActivated"
,
scriptlib
::
effect_is_activated
},
{
"GetActivateLocation"
,
scriptlib
::
effect_get_activate_location
},
{
"GetActivateSequence"
,
scriptlib
::
effect_get_activate_sequence
},
{
"CheckCountLimit"
,
scriptlib
::
effect_check_count_limit
},
{
"UseCountLimit"
,
scriptlib
::
effect_use_count_limit
},
{
NULL
,
NULL
}
};
void
scriptlib
::
open_effectlib
(
lua_State
*
L
)
{
luaL_newlib
(
L
,
effectlib
);
lua_pushstring
(
L
,
"__index"
);
lua_pushvalue
(
L
,
-
2
);
lua_rawset
(
L
,
-
3
);
lua_setglobal
(
L
,
"Effect"
);
}
libgroup.cpp
View file @
048acc22
...
@@ -850,3 +850,54 @@ int32 scriptlib::group_meta_bxor(lua_State* L) {
...
@@ -850,3 +850,54 @@ int32 scriptlib::group_meta_bxor(lua_State* L) {
interpreter
::
group2value
(
L
,
pgroup
);
interpreter
::
group2value
(
L
,
pgroup
);
return
1
;
return
1
;
}
}
static
const
struct
luaL_Reg
grouplib
[]
=
{
{
"CreateGroup"
,
scriptlib
::
group_new
},
{
"KeepAlive"
,
scriptlib
::
group_keep_alive
},
{
"DeleteGroup"
,
scriptlib
::
group_delete
},
{
"Clone"
,
scriptlib
::
group_clone
},
{
"FromCards"
,
scriptlib
::
group_from_cards
},
{
"Clear"
,
scriptlib
::
group_clear
},
{
"AddCard"
,
scriptlib
::
group_add_card
},
{
"RemoveCard"
,
scriptlib
::
group_remove_card
},
{
"GetNext"
,
scriptlib
::
group_get_next
},
{
"GetFirst"
,
scriptlib
::
group_get_first
},
{
"GetCount"
,
scriptlib
::
group_get_count
},
{
"__len"
,
scriptlib
::
group_get_count
},
{
"ForEach"
,
scriptlib
::
group_for_each
},
{
"Filter"
,
scriptlib
::
group_filter
},
{
"FilterCount"
,
scriptlib
::
group_filter_count
},
{
"FilterSelect"
,
scriptlib
::
group_filter_select
},
{
"Select"
,
scriptlib
::
group_select
},
{
"SelectUnselect"
,
scriptlib
::
group_select_unselect
},
{
"RandomSelect"
,
scriptlib
::
group_random_select
},
{
"IsExists"
,
scriptlib
::
group_is_exists
},
{
"CheckWithSumEqual"
,
scriptlib
::
group_check_with_sum_equal
},
{
"SelectWithSumEqual"
,
scriptlib
::
group_select_with_sum_equal
},
{
"CheckWithSumGreater"
,
scriptlib
::
group_check_with_sum_greater
},
{
"SelectWithSumGreater"
,
scriptlib
::
group_select_with_sum_greater
},
{
"GetMinGroup"
,
scriptlib
::
group_get_min_group
},
{
"GetMaxGroup"
,
scriptlib
::
group_get_max_group
},
{
"GetSum"
,
scriptlib
::
group_get_sum
},
{
"GetClassCount"
,
scriptlib
::
group_get_class_count
},
{
"Remove"
,
scriptlib
::
group_remove
},
{
"Merge"
,
scriptlib
::
group_merge
},
{
"Sub"
,
scriptlib
::
group_sub
},
{
"Equal"
,
scriptlib
::
group_equal
},
{
"IsContains"
,
scriptlib
::
group_is_contains
},
{
"SearchCard"
,
scriptlib
::
group_search_card
},
{
"GetBinClassCount"
,
scriptlib
::
group_get_bin_class_count
},
{
"__add"
,
scriptlib
::
group_meta_add
},
{
"__bor"
,
scriptlib
::
group_meta_add
},
{
"__sub"
,
scriptlib
::
group_meta_sub
},
{
"__band"
,
scriptlib
::
group_meta_band
},
{
"__bxor"
,
scriptlib
::
group_meta_bxor
},
{
NULL
,
NULL
}
};
void
scriptlib
::
open_grouplib
(
lua_State
*
L
)
{
luaL_newlib
(
L
,
grouplib
);
lua_pushstring
(
L
,
"__index"
);
lua_pushvalue
(
L
,
-
2
);
lua_rawset
(
L
,
-
3
);
lua_setglobal
(
L
,
"Group"
);
}
operations.cpp
View file @
048acc22
...
@@ -1406,7 +1406,8 @@ int32 field::equip(uint16 step, uint8 equip_player, card * equip_card, card * ta
...
@@ -1406,7 +1406,8 @@ int32 field::equip(uint16 step, uint8 equip_player, card * equip_card, card * ta
return
FALSE
;
return
FALSE
;
}
}
if
(
equip_card
->
equiping_target
)
{
if
(
equip_card
->
equiping_target
)
{
equip_card
->
cancel_card_target
(
equip_card
->
equiping_target
);
equip_card
->
effect_target_cards
.
erase
(
equip_card
->
equiping_target
);
equip_card
->
equiping_target
->
effect_target_owner
.
erase
(
equip_card
);
equip_card
->
unequip
();
equip_card
->
unequip
();
equip_card
->
enable_field_effect
(
false
);
equip_card
->
enable_field_effect
(
false
);
return
FALSE
;
return
FALSE
;
...
@@ -2376,7 +2377,7 @@ int32 field::sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget
...
@@ -2376,7 +2377,7 @@ int32 field::sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget
card_set
*
set_cards
=
new
card_set
;
card_set
*
set_cards
=
new
card_set
;
core
.
operated_set
.
clear
();
core
.
operated_set
.
clear
();
for
(
auto
&
target
:
ptarget
->
container
)
{
for
(
auto
&
target
:
ptarget
->
container
)
{
if
((
!
(
target
->
data
.
type
&
TYPE_FIELD
)
&&
get_useable_count
(
NULL
,
toplayer
,
LOCATION_SZONE
,
setplayer
,
LOCATION_REASON_TOFIELD
,
zone
?
zone
:
0xff
)
<=
0
)
if
((
!
(
target
->
data
.
type
&
TYPE_FIELD
)
&&
get_useable_count
(
target
,
toplayer
,
LOCATION_SZONE
,
setplayer
,
LOCATION_REASON_TOFIELD
,
zone
?
zone
:
0xff
)
<=
0
)
||
(
target
->
data
.
type
&
TYPE_MONSTER
&&
!
target
->
is_affected_by_effect
(
EFFECT_MONSTER_SSET
))
||
(
target
->
data
.
type
&
TYPE_MONSTER
&&
!
target
->
is_affected_by_effect
(
EFFECT_MONSTER_SSET
))
||
(
target
->
current
.
location
==
LOCATION_SZONE
)
||
(
target
->
current
.
location
==
LOCATION_SZONE
)
||
(
!
is_player_can_sset
(
setplayer
,
target
))
||
(
!
is_player_can_sset
(
setplayer
,
target
))
...
@@ -2411,16 +2412,12 @@ int32 field::sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget
...
@@ -2411,16 +2412,12 @@ int32 field::sset_g(uint16 step, uint8 setplayer, uint8 toplayer, group* ptarget
case
1
:
{
case
1
:
{
card_set
*
set_cards
=
(
card_set
*
)
ptarget
;
card_set
*
set_cards
=
(
card_set
*
)
ptarget
;
card
*
target
=
*
set_cards
->
begin
();
card
*
target
=
*
set_cards
->
begin
();
uint32
flag
;
int32
ct
=
get_useable_count
(
target
,
toplayer
,
LOCATION_SZONE
,
setplayer
,
LOCATION_REASON_TOFIELD
,
zone
?
zone
:
0xff
,
&
flag
);
if
(
ct
<=
0
)
{
core
.
units
.
begin
()
->
step
=
2
;
return
FALSE
;
}
if
(
target
->
data
.
type
&
TYPE_FIELD
)
{
if
(
target
->
data
.
type
&
TYPE_FIELD
)
{
returns
.
bvalue
[
2
]
=
5
;
returns
.
bvalue
[
2
]
=
5
;
return
FALSE
;
return
FALSE
;
}
}
uint32
flag
;
get_useable_count
(
target
,
toplayer
,
LOCATION_SZONE
,
setplayer
,
LOCATION_REASON_TOFIELD
,
zone
?
zone
:
0xff
,
&
flag
);
flag
|=
core
.
set_group_used_zones
;
flag
|=
core
.
set_group_used_zones
;
if
(
setplayer
==
toplayer
)
{
if
(
setplayer
==
toplayer
)
{
flag
=
((
flag
&
0xff
)
<<
8
)
|
0xffff00ff
;
flag
=
((
flag
&
0xff
)
<<
8
)
|
0xffff00ff
;
...
@@ -3989,6 +3986,8 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
...
@@ -3989,6 +3986,8 @@ int32 field::send_to(uint16 step, group * targets, effect * reason_effect, uint3
pcard
->
reset
(
RESET_LEAVE
,
RESET_EVENT
);
pcard
->
reset
(
RESET_LEAVE
,
RESET_EVENT
);
param
->
leave
.
insert
(
pcard
);
param
->
leave
.
insert
(
pcard
);
}
}
if
(
pcard
->
previous
.
location
==
LOCATION_OVERLAY
)
pcard
->
previous
.
controler
=
control_player
;
++
param
->
cvit
;
++
param
->
cvit
;
core
.
units
.
begin
()
->
step
=
4
;
core
.
units
.
begin
()
->
step
=
4
;
return
FALSE
;
return
FALSE
;
...
...
processor.cpp
View file @
048acc22
...
@@ -1262,6 +1262,7 @@ int32 field::process_phase_event(int16 step, int32 phase) {
...
@@ -1262,6 +1262,7 @@ int32 field::process_phase_event(int16 step, int32 phase) {
core
.
quick_f_chain
.
clear
();
core
.
quick_f_chain
.
clear
();
core
.
instant_event
.
clear
();
core
.
instant_event
.
clear
();
core
.
point_event
.
clear
();
core
.
point_event
.
clear
();
core
.
delayed_activate_event
.
clear
();
core
.
full_event
.
clear
();
core
.
full_event
.
clear
();
return
TRUE
;
return
TRUE
;
}
}
...
@@ -1273,6 +1274,7 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
...
@@ -1273,6 +1274,7 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
case
0
:
{
case
0
:
{
core
.
select_chains
.
clear
();
core
.
select_chains
.
clear
();
core
.
point_event
.
splice
(
core
.
point_event
.
end
(),
core
.
instant_event
);
core
.
point_event
.
splice
(
core
.
point_event
.
end
(),
core
.
instant_event
);
core
.
full_event
.
splice
(
core
.
full_event
.
end
(),
core
.
delayed_activate_event
);
if
(
skip_trigger
)
{
if
(
skip_trigger
)
{
core
.
units
.
begin
()
->
step
=
7
;
core
.
units
.
begin
()
->
step
=
7
;
return
FALSE
;
return
FALSE
;
...
@@ -1606,41 +1608,41 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
...
@@ -1606,41 +1608,41 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
chain
newchain
;
chain
newchain
;
if
(
core
.
ignition_priority_chains
.
size
())
if
(
core
.
ignition_priority_chains
.
size
())
core
.
select_chains
.
swap
(
core
.
ignition_priority_chains
);
core
.
select_chains
.
swap
(
core
.
ignition_priority_chains
);
for
(
auto
evit
=
core
.
point_event
.
begin
();
evit
!=
core
.
instant_event
.
end
();
++
evit
)
{
for
(
const
auto
*
ev_list
:
{
&
core
.
point_event
,
&
core
.
instant_event
}
)
{
if
(
evit
==
core
.
point_event
.
end
())
for
(
const
auto
&
ev
:
*
ev_list
)
{
evit
=
core
.
instant_event
.
begin
(
);
auto
pr
=
effects
.
activate_effect
.
equal_range
(
ev
.
event_code
);
auto
pr
=
effects
.
activate_effect
.
equal_range
(
evit
->
event_code
);
for
(
auto
eit
=
pr
.
first
;
eit
!=
pr
.
second
;)
{
for
(
auto
eit
=
pr
.
first
;
eit
!=
pr
.
second
;)
{
effect
*
peffect
=
eit
->
second
;
effect
*
peffect
=
eit
->
second
;
++
eit
;
++
eit
;
peffect
->
set_activate_location
()
;
peffect
->
set_activate_location
();
if
(
!
peffect
->
is_flag
(
EFFECT_FLAG_DELAY
)
&&
peffect
->
is_chainable
(
priority
)
&&
peffect
->
is_activateable
(
priority
,
ev
))
{
if
(
!
peffect
->
is_flag
(
EFFECT_FLAG_DELAY
)
&&
peffect
->
is_chainable
(
priority
)
&&
peffect
->
is_activateable
(
priority
,
*
evit
))
{
card
*
phandler
=
peffect
->
get_handler
();
card
*
phandler
=
peffect
->
get_handler
()
;
newchain
.
flag
=
0
;
newchain
.
flag
=
0
;
newchain
.
chain_id
=
infos
.
field_id
++
;
newchain
.
chain_id
=
infos
.
field_id
++
;
newchain
.
evt
=
ev
;
newchain
.
evt
=
*
evi
t
;
newchain
.
triggering_effect
=
peffec
t
;
newchain
.
triggering_effect
=
peffect
;
newchain
.
set_triggering_state
(
phandler
)
;
newchain
.
set_triggering_state
(
phandler
)
;
newchain
.
triggering_player
=
priority
;
newchain
.
triggering_player
=
priority
;
core
.
select_chains
.
push_back
(
newchain
)
;
core
.
select_chains
.
push_back
(
newchain
);
}
}
}
}
pr
=
effects
.
quick_o_effect
.
equal_range
(
ev
.
event_code
);
pr
=
effects
.
quick_o_effect
.
equal_range
(
evit
->
event_code
);
for
(
auto
eit
=
pr
.
first
;
eit
!=
pr
.
second
;)
{
for
(
auto
eit
=
pr
.
first
;
eit
!=
pr
.
second
;)
{
effect
*
peffect
=
eit
->
second
;
effect
*
peffect
=
eit
->
second
;
++
eit
;
++
eit
;
peffect
->
set_activate_location
()
;
peffect
->
set_activate_location
();
if
(
peffect
->
is_chainable
(
priority
)
&&
peffect
->
is_activateable
(
priority
,
ev
))
{
if
(
peffect
->
is_chainable
(
priority
)
&&
peffect
->
is_activateable
(
priority
,
*
evit
))
{
card
*
phandler
=
peffect
->
get_handler
();
card
*
phandler
=
peffect
->
get_handler
()
;
newchain
.
flag
=
0
;
newchain
.
flag
=
0
;
newchain
.
chain_id
=
infos
.
field_id
++
;
newchain
.
chain_id
=
infos
.
field_id
++
;
newchain
.
evt
=
ev
;
newchain
.
evt
=
*
evi
t
;
newchain
.
triggering_effect
=
peffec
t
;
newchain
.
triggering_effect
=
peffect
;
newchain
.
set_triggering_state
(
phandler
)
;
newchain
.
set_triggering_state
(
phandler
)
;
newchain
.
triggering_player
=
priority
;
newchain
.
triggering_player
=
priority
;
core
.
select_chains
.
push_back
(
newchain
)
;
core
.
select_chains
.
push_back
(
newchain
);
core
.
delayed_quick_tmp
.
erase
(
std
::
make_pair
(
peffect
,
ev
)
);
core
.
delayed_quick_tmp
.
erase
(
std
::
make_pair
(
peffect
,
*
evit
));
core
.
delayed_quick_break
.
erase
(
std
::
make_pair
(
peffect
,
ev
));
core
.
delayed_quick_break
.
erase
(
std
::
make_pair
(
peffect
,
*
evit
));
}
}
}
}
}
}
}
...
@@ -1879,7 +1881,7 @@ int32 field::process_instant_event() {
...
@@ -1879,7 +1881,7 @@ int32 field::process_instant_event() {
}
}
}
}
// delayed activate effect
// delayed activate effect
core
.
full
_event
.
push_back
(
ev
);
core
.
delayed_activate
_event
.
push_back
(
ev
);
// delayed quick effect
// delayed quick effect
pr
=
effects
.
quick_o_effect
.
equal_range
(
ev
.
event_code
);
pr
=
effects
.
quick_o_effect
.
equal_range
(
ev
.
event_code
);
for
(
auto
eit
=
pr
.
first
;
eit
!=
pr
.
second
;)
{
for
(
auto
eit
=
pr
.
first
;
eit
!=
pr
.
second
;)
{
...
@@ -2618,6 +2620,7 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -2618,6 +2620,7 @@ int32 field::process_battle_command(uint16 step) {
return
FALSE
;
return
FALSE
;
}
}
case
8
:
{
case
8
:
{
core
.
attack_cancelable
=
TRUE
;
pduel
->
write_buffer8
(
MSG_ATTACK
);
pduel
->
write_buffer8
(
MSG_ATTACK
);
pduel
->
write_buffer32
(
core
.
attacker
->
get_info_location
());
pduel
->
write_buffer32
(
core
.
attacker
->
get_info_location
());
if
(
core
.
attack_target
)
{
if
(
core
.
attack_target
)
{
...
@@ -2701,6 +2704,7 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -2701,6 +2704,7 @@ int32 field::process_battle_command(uint16 step) {
add_process
(
PROCESSOR_SELECT_YESNO
,
0
,
0
,
0
,
infos
.
turn_player
,
30
);
add_process
(
PROCESSOR_SELECT_YESNO
,
0
,
0
,
0
,
infos
.
turn_player
,
30
);
else
{
else
{
returns
.
ivalue
[
0
]
=
TRUE
;
returns
.
ivalue
[
0
]
=
TRUE
;
core
.
attack_cancelable
=
FALSE
;
}
}
return
FALSE
;
return
FALSE
;
}
}
...
@@ -2709,7 +2713,6 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -2709,7 +2713,6 @@ int32 field::process_battle_command(uint16 step) {
if
(
returns
.
ivalue
[
0
])
{
if
(
returns
.
ivalue
[
0
])
{
core
.
units
.
begin
()
->
arg1
=
TRUE
;
core
.
units
.
begin
()
->
arg1
=
TRUE
;
core
.
units
.
begin
()
->
arg3
=
FALSE
;
core
.
units
.
begin
()
->
arg3
=
FALSE
;
core
.
attack_cancelable
=
TRUE
;
core
.
units
.
begin
()
->
step
=
3
;
core
.
units
.
begin
()
->
step
=
3
;
}
}
return
FALSE
;
return
FALSE
;
...
@@ -3085,6 +3088,8 @@ int32 field::process_battle_command(uint16 step) {
...
@@ -3085,6 +3088,8 @@ int32 field::process_battle_command(uint16 step) {
pduel
->
write_buffer8
(
HINT_EVENT
);
pduel
->
write_buffer8
(
HINT_EVENT
);
pduel
->
write_buffer8
(
1
);
pduel
->
write_buffer8
(
1
);
pduel
->
write_buffer32
(
43
);
pduel
->
write_buffer32
(
43
);
core
.
hint_timing
[
0
]
|=
TIMING_BATTLED
;
core
.
hint_timing
[
1
]
|=
TIMING_BATTLED
;
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
0
,
TRUE
);
add_process
(
PROCESSOR_POINT_EVENT
,
0
,
0
,
0
,
0
,
TRUE
);
return
FALSE
;
return
FALSE
;
}
}
...
...
scriptlib.h
View file @
048acc22
...
@@ -291,6 +291,7 @@ public:
...
@@ -291,6 +291,7 @@ public:
static
int32
card_reset_negate_effect
(
lua_State
*
L
);
static
int32
card_reset_negate_effect
(
lua_State
*
L
);
static
int32
card_assume_prop
(
lua_State
*
L
);
static
int32
card_assume_prop
(
lua_State
*
L
);
static
int32
card_set_spsummon_once
(
lua_State
*
L
);
static
int32
card_set_spsummon_once
(
lua_State
*
L
);
static
void
open_cardlib
(
lua_State
*
L
);
//Effect functions
//Effect functions
static
int32
effect_new
(
lua_State
*
L
);
static
int32
effect_new
(
lua_State
*
L
);
...
@@ -344,6 +345,7 @@ public:
...
@@ -344,6 +345,7 @@ public:
static
int32
effect_get_activate_sequence
(
lua_State
*
L
);
static
int32
effect_get_activate_sequence
(
lua_State
*
L
);
static
int32
effect_check_count_limit
(
lua_State
*
L
);
static
int32
effect_check_count_limit
(
lua_State
*
L
);
static
int32
effect_use_count_limit
(
lua_State
*
L
);
static
int32
effect_use_count_limit
(
lua_State
*
L
);
static
void
open_effectlib
(
lua_State
*
L
);
//Group functions
//Group functions
static
int32
group_new
(
lua_State
*
L
);
static
int32
group_new
(
lua_State
*
L
);
...
@@ -380,6 +382,7 @@ public:
...
@@ -380,6 +382,7 @@ public:
static
int32
group_is_contains
(
lua_State
*
L
);
static
int32
group_is_contains
(
lua_State
*
L
);
static
int32
group_search_card
(
lua_State
*
L
);
static
int32
group_search_card
(
lua_State
*
L
);
static
int32
group_get_bin_class_count
(
lua_State
*
L
);
static
int32
group_get_bin_class_count
(
lua_State
*
L
);
static
void
open_grouplib
(
lua_State
*
L
);
//Duel functions
//Duel functions
static
int32
duel_enable_global_flag
(
lua_State
*
L
);
static
int32
duel_enable_global_flag
(
lua_State
*
L
);
...
@@ -599,7 +602,9 @@ public:
...
@@ -599,7 +602,9 @@ public:
//specific card functions
//specific card functions
static
int32
duel_swap_deck_and_grave
(
lua_State
*
L
);
static
int32
duel_swap_deck_and_grave
(
lua_State
*
L
);
static
int32
duel_majestic_copy
(
lua_State
*
L
);
static
int32
duel_majestic_copy
(
lua_State
*
L
);
static
void
open_duellib
(
lua_State
*
L
);
//group metamethods
//group metamethods
//__len is in the group lib, which is same as group_get_count
//__len is in the group lib, which is same as group_get_count
static
int32
group_meta_add
(
lua_State
*
L
);
static
int32
group_meta_add
(
lua_State
*
L
);
...
@@ -619,6 +624,7 @@ public:
...
@@ -619,6 +624,7 @@ public:
static
int32
debug_reload_field_end
(
lua_State
*
L
);
static
int32
debug_reload_field_end
(
lua_State
*
L
);
static
int32
debug_set_ai_name
(
lua_State
*
L
);
static
int32
debug_set_ai_name
(
lua_State
*
L
);
static
int32
debug_show_hint
(
lua_State
*
L
);
static
int32
debug_show_hint
(
lua_State
*
L
);
static
void
open_debuglib
(
lua_State
*
L
);
};
};
#endif
/* SCRIPTLIB_H_ */
#endif
/* SCRIPTLIB_H_ */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment