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
c6fadaea
Commit
c6fadaea
authored
Sep 14, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
parents
9258e1a3
44a056a3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
33 deletions
+38
-33
effect.cpp
effect.cpp
+18
-2
effect.h
effect.h
+2
-0
libeffect.cpp
libeffect.cpp
+6
-24
operations.cpp
operations.cpp
+2
-1
processor.cpp
processor.cpp
+9
-4
scriptlib.cpp
scriptlib.cpp
+1
-1
scriptlib.h
scriptlib.h
+0
-1
No files found.
effect.cpp
View file @
c6fadaea
...
...
@@ -245,8 +245,7 @@ int32 effect::is_activateable(uint8 playerid, const tevent& e, int32 neglect_con
return
FALSE
;
}
else
if
(
!
(
type
&
EFFECT_TYPE_CONTINUOUS
))
{
card
*
phandler
=
get_handler
();
if
((
phandler
->
data
.
type
&
TYPE_MONSTER
)
&&
(
phandler
->
current
.
location
&
LOCATION_SZONE
)
&&
!
in_range
(
phandler
))
if
(
!
(
phandler
->
get_type
()
&
TYPE_MONSTER
)
&&
(
get_active_type
()
&
TYPE_MONSTER
))
return
FALSE
;
if
(
!
neglect_faceup
&&
(
phandler
->
current
.
location
&
(
LOCATION_ONFIELD
|
LOCATION_REMOVED
)))
{
// effects which can be activated while face-down:
...
...
@@ -752,3 +751,20 @@ void effect::set_activate_location() {
active_location
=
phandler
->
current
.
location
;
active_sequence
=
phandler
->
current
.
sequence
;
}
void
effect
::
set_active_type
()
{
card
*
phandler
=
get_handler
();
active_type
=
phandler
->
get_type
();
if
(
active_type
&
TYPE_TRAPMONSTER
)
active_type
&=
~
TYPE_TRAP
;
}
uint32
effect
::
get_active_type
()
{
if
(
type
&
0x7f0
)
{
if
(
active_type
)
return
active_type
;
else
if
((
type
&
EFFECT_TYPE_ACTIVATE
)
&&
(
get_handler
()
->
data
.
type
&
TYPE_PENDULUM
))
return
TYPE_PENDULUM
+
TYPE_SPELL
;
else
return
get_handler
()
->
get_type
();
}
else
return
owner
->
get_type
();
}
effect.h
View file @
c6fadaea
...
...
@@ -100,6 +100,8 @@ public:
int32
in_range
(
card
*
pcard
);
int32
in_range
(
const
chain
&
ch
);
void
set_activate_location
();
void
set_active_type
();
uint32
get_active_type
();
bool
is_flag
(
effect_flag
flag
)
const
{
return
!!
(
this
->
flag
[
0
]
&
flag
);
}
...
...
libeffect.cpp
View file @
c6fadaea
...
...
@@ -435,40 +435,22 @@ int32 scriptlib::effect_get_operation(lua_State *L) {
interpreter
::
function2value
(
L
,
peffect
->
operation
);
return
1
;
}
// active_type is set in add_chain()
int32
scriptlib
::
effect_get_active_type
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_EFFECT
,
1
);
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
1
);
uint32
atype
;
if
(
peffect
->
type
&
0x7f0
)
{
if
(
peffect
->
active_type
)
atype
=
peffect
->
active_type
;
else
if
((
peffect
->
type
&
EFFECT_TYPE_ACTIVATE
)
&&
(
peffect
->
get_handler
()
->
data
.
type
&
TYPE_PENDULUM
))
atype
=
TYPE_PENDULUM
+
TYPE_SPELL
;
else
atype
=
peffect
->
get_handler
()
->
get_type
();
}
else
atype
=
peffect
->
owner
->
get_type
();
lua_pushinteger
(
L
,
atype
);
lua_pushinteger
(
L
,
peffect
->
get_active_type
());
return
1
;
}
int32
scriptlib
::
effect_is_active_type
(
lua_State
*
L
)
{
check_param_count
(
L
,
2
);
check_param
(
L
,
PARAM_TYPE_EFFECT
,
1
);
effect
*
peffect
=
*
(
effect
**
)
lua_touserdata
(
L
,
1
);
uint32
tpe
=
lua_tointeger
(
L
,
2
);
uint32
atype
;
if
(
peffect
->
type
&
0x7f0
)
{
if
(
peffect
->
active_type
)
atype
=
peffect
->
active_type
;
else
if
((
peffect
->
type
&
EFFECT_TYPE_ACTIVATE
)
&&
(
peffect
->
get_handler
()
->
data
.
type
&
TYPE_PENDULUM
))
atype
=
TYPE_PENDULUM
+
TYPE_SPELL
;
else
atype
=
peffect
->
get_handler
()
->
get_type
();
}
else
atype
=
peffect
->
owner
->
get_type
();
lua_pushboolean
(
L
,
atype
&
tpe
);
uint32
type
=
lua_tointeger
(
L
,
2
);
if
(
peffect
->
get_active_type
()
&
type
)
lua_pushboolean
(
L
,
1
);
else
lua_pushboolean
(
L
,
0
);
return
1
;
}
int32
scriptlib
::
effect_is_has_property
(
lua_State
*
L
)
{
...
...
operations.cpp
View file @
c6fadaea
...
...
@@ -4280,7 +4280,8 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
if
(
!
(
target
->
current
.
location
&
LOCATION_ONFIELD
))
target
->
clear_relate_effect
();
}
if
(
ret
!=
1
||
target
->
turnid
!=
infos
.
turn_id
)
{
if
(
ret
!=
1
&&
location
!=
target
->
current
.
location
||
ret
==
1
&&
target
->
turnid
!=
infos
.
turn_id
)
{
target
->
set_status
(
STATUS_SUMMON_TURN
,
FALSE
);
target
->
set_status
(
STATUS_FLIP_SUMMON_TURN
,
FALSE
);
target
->
set_status
(
STATUS_SPSUMMON_TURN
,
FALSE
);
...
...
processor.cpp
View file @
c6fadaea
...
...
@@ -1702,6 +1702,7 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
if
(
tp
==
core
.
current_player
)
core
.
select_chains
.
push_back
(
*
clit
);
}
else
{
peffect
->
active_type
=
0
;
core
.
new_fchain_s
.
erase
(
clit
++
);
continue
;
}
...
...
@@ -1794,6 +1795,7 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
if
(
tp
==
core
.
current_player
)
core
.
select_chains
.
push_back
(
*
clit
);
}
else
{
peffect
->
active_type
=
0
;
core
.
new_ochain_s
.
erase
(
clit
++
);
continue
;
}
...
...
@@ -1819,8 +1821,10 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
}
case
6
:
{
if
(
returns
.
ivalue
[
0
]
==
-
1
)
{
for
(
const
auto
&
ch
:
core
.
select_chains
)
for
(
const
auto
&
ch
:
core
.
select_chains
)
{
ch
.
triggering_effect
->
active_type
=
0
;
core
.
new_ochain_s
.
remove_if
([
chain_id
=
ch
.
chain_id
](
chain
ch
)
{
return
ch
.
chain_id
==
chain_id
;
});
}
if
(
core
.
new_ochain_s
.
size
())
{
core
.
current_player
=
1
-
infos
.
turn_player
;
core
.
units
.
begin
()
->
step
=
3
;
...
...
@@ -2034,7 +2038,7 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
}
case
2
:
{
chain
newchain
;
for
(
auto
evit
=
core
.
point_event
.
begin
();
evit
!=
core
.
instant_event
.
begin
();
++
evit
)
{
for
(
auto
evit
=
core
.
point_event
.
begin
();
evit
!=
core
.
instant_event
.
end
();
++
evit
)
{
if
(
evit
==
core
.
point_event
.
end
())
evit
=
core
.
instant_event
.
begin
();
auto
pr
=
effects
.
activate_effect
.
equal_range
(
evit
->
event_code
);
...
...
@@ -2432,6 +2436,7 @@ int32 field::process_single_event(effect* peffect, const tevent& e, chain_list&
else
core
.
new_fchain
.
push_back
(
newchain
);
}
peffect
->
set_active_type
();
phandler
->
create_relation
(
newchain
);
effect
*
deffect
;
if
(
deffect
=
phandler
->
is_affected_by_effect
(
EFFECT_DISABLE_EFFECT
))
{
...
...
@@ -4258,7 +4263,7 @@ int32 field::add_chain(uint16 step) {
peffect
->
card_type
=
phandler
->
get_type
();
if
((
peffect
->
card_type
&
0x5
)
==
0x5
)
peffect
->
card_type
-=
TYPE_TRAP
;
peffect
->
active_type
=
peffect
->
card_type
;
peffect
->
set_active_type
()
;
peffect
->
active_handler
=
peffect
->
handler
->
overlay_target
;
clit
.
chain_count
=
core
.
current_chain
.
size
()
+
1
;
clit
.
target_cards
=
0
;
...
...
@@ -4388,7 +4393,7 @@ int32 field::add_chain(uint16 step) {
&&
!
phandler
->
is_affected_by_effect
(
EFFECT_REMAIN_FIELD
))
phandler
->
set_status
(
STATUS_LEAVE_CONFIRMED
,
TRUE
);
}
if
(
(
phandler
->
data
.
type
&
(
TYPE_SPELL
+
TYPE_TRAP
)
)
if
(
phandler
->
get_type
()
&
(
TYPE_SPELL
+
TYPE_TRAP
)
&&
(
phandler
->
data
.
type
&
(
TYPE_CONTINUOUS
+
TYPE_FIELD
+
TYPE_EQUIP
+
TYPE_PENDULUM
))
&&
phandler
->
is_has_relation
(
clit
)
&&
phandler
->
current
.
location
==
LOCATION_SZONE
&&
!
peffect
->
is_flag
(
EFFECT_FLAG_FIELD_ONLY
))
...
...
scriptlib.cpp
View file @
c6fadaea
...
...
@@ -7,7 +7,7 @@
#include "scriptlib.h"
#include "duel.h"
int32
scriptlib
::
check_data_type
(
lua_State
*
L
,
int32
index
,
const
char
*
tname
)
{
static
int32
check_data_type
(
lua_State
*
L
,
int32
index
,
const
char
*
tname
)
{
int32
result
=
FALSE
;
if
(
lua_getmetatable
(
L
,
index
))
{
lua_getglobal
(
L
,
tname
);
...
...
scriptlib.h
View file @
c6fadaea
...
...
@@ -13,7 +13,6 @@
class
scriptlib
{
public:
static
int32
check_data_type
(
lua_State
*
L
,
int32
index
,
const
char
*
tname
);
static
int32
check_param
(
lua_State
*
L
,
int32
param_type
,
int32
index
,
BOOL
retfalse
=
FALSE
);
static
int32
check_param_count
(
lua_State
*
L
,
int32
count
);
static
int32
check_action_permission
(
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