Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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-2pick
Commits
3bdea07d
Commit
3bdea07d
authored
Nov 05, 2014
by
Argon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
custom counter
parent
e8ce8c55
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
5 deletions
+55
-5
ocgcore/field.h
ocgcore/field.h
+5
-4
ocgcore/interpreter.cpp
ocgcore/interpreter.cpp
+2
-0
ocgcore/libduel.cpp
ocgcore/libduel.cpp
+45
-0
ocgcore/operations.cpp
ocgcore/operations.cpp
+1
-1
ocgcore/scriptlib.h
ocgcore/scriptlib.h
+2
-0
No files found.
ocgcore/field.h
View file @
3bdea07d
...
@@ -269,10 +269,11 @@ struct processor {
...
@@ -269,10 +269,11 @@ struct processor {
uint8
attack_state_count
[
2
];
uint8
attack_state_count
[
2
];
uint8
phase_action
;
uint8
phase_action
;
uint32
hint_timing
[
2
];
uint32
hint_timing
[
2
];
std
::
unordered_map
<
uint32
,
effect
*>
summon_counter
;
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>
>
summon_counter
;
std
::
unordered_map
<
uint32
,
effect
*>
spsummon_counter
;
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>
>
normalsummon_counter
;
std
::
unordered_map
<
uint32
,
effect
*>
flipsummon_counter
;
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>
>
spsummon_counter
;
std
::
unordered_map
<
uint32
,
effect
*>
attack_counter
;
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>
>
flipsummon_counter
;
std
::
unordered_map
<
uint32
,
std
::
pair
<
uint32
,
uint32
>
>
attack_counter
;
};
};
class
field
{
class
field
{
public:
public:
...
...
ocgcore/interpreter.cpp
View file @
3bdea07d
...
@@ -479,6 +479,8 @@ static const struct luaL_Reg duellib[] = {
...
@@ -479,6 +479,8 @@ static const struct luaL_Reg duellib[] = {
{
"CheckChainUniqueness"
,
scriptlib
::
duel_check_chain_uniqueness
},
{
"CheckChainUniqueness"
,
scriptlib
::
duel_check_chain_uniqueness
},
{
"GetActivityCount"
,
scriptlib
::
duel_get_activity_count
},
{
"GetActivityCount"
,
scriptlib
::
duel_get_activity_count
},
{
"CheckPhaseActivity"
,
scriptlib
::
duel_check_phase_activity
},
{
"CheckPhaseActivity"
,
scriptlib
::
duel_check_phase_activity
},
{
"AddCustomActivityCounter"
,
scriptlib
::
duel_add_custom_activity_counter
},
{
"GetCustomActivityCount"
,
scriptlib
::
duel_get_custom_activity_count
},
{
"VenomSwampCheck"
,
scriptlib
::
duel_venom_swamp_check
},
{
"VenomSwampCheck"
,
scriptlib
::
duel_venom_swamp_check
},
{
"SwapDeckAndGrave"
,
scriptlib
::
duel_swap_deck_and_grave
},
{
"SwapDeckAndGrave"
,
scriptlib
::
duel_swap_deck_and_grave
},
{
"MajesticCopy"
,
scriptlib
::
duel_majestic_copy
},
{
"MajesticCopy"
,
scriptlib
::
duel_majestic_copy
},
...
...
ocgcore/libduel.cpp
View file @
3bdea07d
...
@@ -3066,6 +3066,51 @@ int32 scriptlib::duel_check_phase_activity(lua_State *L) {
...
@@ -3066,6 +3066,51 @@ int32 scriptlib::duel_check_phase_activity(lua_State *L) {
lua_pushboolean
(
L
,
pduel
->
game_field
->
core
.
phase_action
);
lua_pushboolean
(
L
,
pduel
->
game_field
->
core
.
phase_action
);
return
1
;
return
1
;
}
}
int32
scriptlib
::
duel_add_custom_activity_counter
(
lua_State
*
L
)
{
check_param_count
(
L
,
3
);
check_param
(
L
,
PARAM_TYPE_FUNCTION
,
3
);
int32
counter_id
=
lua_tointeger
(
L
,
1
);
int32
activity_type
=
lua_tointeger
(
L
,
2
);
int32
counter_filter
=
interpreter
::
get_function_handle
(
L
,
3
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
switch
(
activity_type
)
{
case
1
:
break
;
case
2
:
break
;
case
3
:
break
;
case
4
:
break
;
case
5
:
break
;
default:
break
;
}
return
0
;
}
int32
scriptlib
::
duel_get_custom_activity_count
(
lua_State
*
L
)
{
check_param_count
(
L
,
3
);
int32
counter_id
=
lua_tointeger
(
L
,
1
);
int32
playerid
=
lua_tointeger
(
L
,
2
);
int32
activity_type
=
lua_tointeger
(
L
,
3
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
switch
(
activity_type
)
{
case
1
:
break
;
case
2
:
break
;
case
3
:
break
;
case
4
:
break
;
case
5
:
break
;
default:
break
;
}
return
0
;
}
int32
scriptlib
::
duel_venom_swamp_check
(
lua_State
*
L
)
{
int32
scriptlib
::
duel_venom_swamp_check
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
check_param
(
L
,
PARAM_TYPE_CARD
,
2
);
...
...
ocgcore/operations.cpp
View file @
3bdea07d
...
@@ -2269,7 +2269,7 @@ int32 field::special_summon_step(uint16 step, group * targets, card * target) {
...
@@ -2269,7 +2269,7 @@ int32 field::special_summon_step(uint16 step, group * targets, card * target) {
}
}
if
(
!
result
||
(
target
->
current
.
location
==
LOCATION_MZONE
)
if
(
!
result
||
(
target
->
current
.
location
==
LOCATION_MZONE
)
||
check_unique_onfield
(
target
,
playerid
)
||
check_unique_onfield
(
target
,
playerid
)
||
!
is_player_can_spsummon
(
core
.
reason_effect
,
target
->
summon_info
&
0xff00
0000
,
positions
,
target
->
summon_player
,
playerid
,
target
)
||
!
is_player_can_spsummon
(
core
.
reason_effect
,
target
->
summon_info
&
0xff00
ffff
,
positions
,
target
->
summon_player
,
playerid
,
target
)
||
target
->
is_affected_by_effect
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
||
target
->
is_affected_by_effect
(
EFFECT_CANNOT_SPECIAL_SUMMON
)
||
get_useable_count
(
playerid
,
LOCATION_MZONE
,
target
->
summon_player
,
LOCATION_REASON_TOFIELD
)
<=
0
||
get_useable_count
(
playerid
,
LOCATION_MZONE
,
target
->
summon_player
,
LOCATION_REASON_TOFIELD
)
<=
0
||
(
!
nocheck
&&
!
(
target
->
data
.
type
&
TYPE_MONSTER
)))
||
(
!
nocheck
&&
!
(
target
->
data
.
type
&
TYPE_MONSTER
)))
...
...
ocgcore/scriptlib.h
View file @
3bdea07d
...
@@ -479,6 +479,8 @@ public:
...
@@ -479,6 +479,8 @@ public:
static
int32
duel_check_chain_uniqueness
(
lua_State
*
L
);
static
int32
duel_check_chain_uniqueness
(
lua_State
*
L
);
static
int32
duel_get_activity_count
(
lua_State
*
L
);
static
int32
duel_get_activity_count
(
lua_State
*
L
);
static
int32
duel_check_phase_activity
(
lua_State
*
L
);
static
int32
duel_check_phase_activity
(
lua_State
*
L
);
static
int32
duel_add_custom_activity_counter
(
lua_State
*
L
);
static
int32
duel_get_custom_activity_count
(
lua_State
*
L
);
//specific card functions
//specific card functions
static
int32
duel_venom_swamp_check
(
lua_State
*
L
);
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