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
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
MyCard
ygopro-core
Commits
b2795b58
Commit
b2795b58
authored
Jun 03, 2016
by
salix5
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Duel.GetBattledCount()
parent
b8f08756
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
0 deletions
+16
-0
field.h
field.h
+1
-0
interpreter.cpp
interpreter.cpp
+1
-0
libduel.cpp
libduel.cpp
+10
-0
processor.cpp
processor.cpp
+3
-0
scriptlib.h
scriptlib.h
+1
-0
No files found.
field.h
View file @
b2795b58
...
...
@@ -285,6 +285,7 @@ struct processor {
bool
spsummon_rst
;
uint8
attack_state_count
[
2
];
uint8
battle_phase_count
[
2
];
uint8
battled_count
[
2
];
uint8
phase_action
;
uint32
hint_timing
[
2
];
uint8
current_player
;
...
...
interpreter.cpp
View file @
b2795b58
...
...
@@ -496,6 +496,7 @@ static const struct luaL_Reg duellib[] = {
{
"CheckPhaseActivity"
,
scriptlib
::
duel_check_phase_activity
},
{
"AddCustomActivityCounter"
,
scriptlib
::
duel_add_custom_activity_counter
},
{
"GetCustomActivityCount"
,
scriptlib
::
duel_get_custom_activity_count
},
{
"GetBattledCount"
,
scriptlib
::
duel_get_battled_count
},
{
"IsAbleToEnterBP"
,
scriptlib
::
duel_is_able_to_enter_bp
},
{
"VenomSwampCheck"
,
scriptlib
::
duel_venom_swamp_check
},
{
"SwapDeckAndGrave"
,
scriptlib
::
duel_swap_deck_and_grave
},
...
...
libduel.cpp
View file @
b2795b58
...
...
@@ -3282,6 +3282,16 @@ int32 scriptlib::duel_get_custom_activity_count(lua_State *L) {
lua_pushinteger
(
L
,
(
val
>>
16
)
&
0xffff
);
return
1
;
}
int32
scriptlib
::
duel_get_battled_count
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
int32
playerid
=
lua_tointeger
(
L
,
1
);
if
(
playerid
!=
0
&&
playerid
!=
1
)
return
0
;
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
lua_pushinteger
(
L
,
pduel
->
game_field
->
core
.
battled_count
[
playerid
]);
return
1
;
}
int32
scriptlib
::
duel_is_able_to_enter_bp
(
lua_State
*
L
)
{
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
lua_pushboolean
(
L
,
pduel
->
game_field
->
is_able_to_enter_bp
());
...
...
processor.cpp
View file @
b2795b58
...
...
@@ -3155,6 +3155,7 @@ int32 field::process_battle_command(uint16 step) {
else
core
.
pre_field
[
1
]
=
0
;
core
.
attacker
->
attacked_count
++
;
core
.
battled_count
[
infos
.
turn_player
]
++
;
raise_single_event
(
core
.
attacker
,
0
,
EVENT_BATTLE_START
,
0
,
0
,
0
,
0
,
0
);
if
(
core
.
attack_target
)
raise_single_event
(
core
.
attack_target
,
0
,
EVENT_BATTLE_START
,
0
,
0
,
0
,
0
,
1
);
...
...
@@ -3619,6 +3620,7 @@ int32 field::process_damage_step(uint16 step, uint32 new_attack) {
}
if
(
new_attack
){
core
.
attack_state_count
[
infos
.
turn_player
]
++
;
core
.
battled_count
[
infos
.
turn_player
]
++
;
check_card_counter
(
core
.
attacker
,
5
,
infos
.
turn_player
);
}
attack_all_target_check
();
...
...
@@ -3870,6 +3872,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
core
.
spsummon_state_count_rst
[
p
]
=
0
;
core
.
attack_state_count
[
p
]
=
0
;
core
.
battle_phase_count
[
p
]
=
0
;
core
.
battled_count
[
p
]
=
0
;
core
.
summon_count
[
p
]
=
0
;
core
.
extra_summon
[
p
]
=
0
;
core
.
spsummon_once_map
[
p
].
clear
();
...
...
scriptlib.h
View file @
b2795b58
...
...
@@ -497,6 +497,7 @@ public:
static
int32
duel_add_custom_activity_counter
(
lua_State
*
L
);
static
int32
duel_get_custom_activity_count
(
lua_State
*
L
);
static
int32
duel_is_able_to_enter_bp
(
lua_State
*
L
);
static
int32
duel_get_battled_count
(
lua_State
*
L
);
//specific card functions
static
int32
duel_venom_swamp_check
(
lua_State
*
L
);
...
...
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