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
20ac11bb
Commit
20ac11bb
authored
Sep 18, 2018
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable trap monster attibute automatically
parent
f854afd8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
31 deletions
+26
-31
libcard.cpp
libcard.cpp
+0
-31
operations.cpp
operations.cpp
+26
-0
No files found.
libcard.cpp
View file @
20ac11bb
...
...
@@ -2775,37 +2775,6 @@ int32 scriptlib::card_add_monster_attribute(lua_State *L) {
return
0
;
}
int32
scriptlib
::
card_add_monster_attribute_complete
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_CARD
,
1
);
card
*
pcard
=
*
(
card
**
)
lua_touserdata
(
L
,
1
);
effect
*
teffect
=
pcard
->
is_affected_by_effect
(
EFFECT_PRE_MONSTER
);
if
(
!
teffect
)
return
0
;
int32
type
=
teffect
->
value
;
if
(
type
&
TYPE_TRAP
)
type
|=
TYPE_TRAPMONSTER
|
pcard
->
data
.
type
;
pcard
->
reset
(
EFFECT_PRE_MONSTER
,
RESET_CODE
);
duel
*
pduel
=
pcard
->
pduel
;
// add type
effect
*
peffect
=
pduel
->
new_effect
();
peffect
->
owner
=
pcard
;
peffect
->
type
=
EFFECT_TYPE_SINGLE
;
peffect
->
code
=
EFFECT_CHANGE_TYPE
;
peffect
->
flag
[
0
]
=
EFFECT_FLAG_CANNOT_DISABLE
;
peffect
->
reset_flag
=
RESET_EVENT
+
0x1fc0000
;
peffect
->
value
=
TYPE_MONSTER
|
type
;
pcard
->
add_effect
(
peffect
);
// extra block
if
(
type
&
TYPE_TRAPMONSTER
)
{
peffect
=
pduel
->
new_effect
();
peffect
->
owner
=
pcard
;
peffect
->
type
=
EFFECT_TYPE_FIELD
;
peffect
->
range
=
LOCATION_MZONE
;
peffect
->
code
=
EFFECT_USE_EXTRA_SZONE
;
peffect
->
flag
[
0
]
=
EFFECT_FLAG_CANNOT_DISABLE
;
peffect
->
reset_flag
=
RESET_EVENT
+
0x1fe0000
;
peffect
->
value
=
1
+
(
0x10000
<<
pcard
->
previous
.
sequence
);
pcard
->
add_effect
(
peffect
);
}
return
0
;
}
int32
scriptlib
::
card_cancel_to_grave
(
lua_State
*
L
)
{
...
...
operations.cpp
View file @
20ac11bb
...
...
@@ -4374,6 +4374,32 @@ int32 field::move_to_field(uint16 step, card* target, uint32 enable, uint32 ret,
peffect
->
dec_count
();
}
}
effect
*
teffect
;
if
(
teffect
=
target
->
is_affected_by_effect
(
EFFECT_PRE_MONSTER
))
{
uint32
type
=
teffect
->
value
;
if
(
type
&
TYPE_TRAP
)
type
|=
TYPE_TRAPMONSTER
|
target
->
data
.
type
;
target
->
reset
(
EFFECT_PRE_MONSTER
,
RESET_CODE
);
effect
*
peffect
=
pduel
->
new_effect
();
peffect
->
owner
=
target
;
peffect
->
type
=
EFFECT_TYPE_SINGLE
;
peffect
->
code
=
EFFECT_CHANGE_TYPE
;
peffect
->
flag
[
0
]
=
EFFECT_FLAG_CANNOT_DISABLE
;
peffect
->
reset_flag
=
RESET_EVENT
+
0x1fc0000
;
peffect
->
value
=
TYPE_MONSTER
|
type
;
target
->
add_effect
(
peffect
);
if
(
type
&
TYPE_TRAPMONSTER
)
{
peffect
=
pduel
->
new_effect
();
peffect
->
owner
=
target
;
peffect
->
type
=
EFFECT_TYPE_FIELD
;
peffect
->
range
=
LOCATION_MZONE
;
peffect
->
code
=
EFFECT_USE_EXTRA_SZONE
;
peffect
->
flag
[
0
]
=
EFFECT_FLAG_CANNOT_DISABLE
;
peffect
->
reset_flag
=
RESET_EVENT
+
0x1fe0000
;
peffect
->
value
=
1
+
(
0x10000
<<
target
->
previous
.
sequence
);
target
->
add_effect
(
peffect
);
}
}
}
if
(
enable
||
((
ret
==
1
)
&&
target
->
is_position
(
POS_FACEUP
)))
target
->
enable_field_effect
(
true
);
...
...
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