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
a046eb7e
Commit
a046eb7e
authored
Apr 23, 2020
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro-core
parents
b48eddb3
973f3a6a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
19 deletions
+32
-19
card.cpp
card.cpp
+16
-8
card.h
card.h
+2
-0
effect.h
effect.h
+2
-0
field.cpp
field.cpp
+4
-3
field.h
field.h
+1
-1
processor.cpp
processor.cpp
+7
-7
No files found.
card.cpp
View file @
a046eb7e
...
...
@@ -480,8 +480,6 @@ uint32 card::get_link_type() {
return
data
.
type
;
return
get_type
();
}
// Atk and def are sepcial cases since text atk/def ? are involved.
// Asuumption: we can only change the atk/def of cards in LOCATION_MZONE.
int32
card
::
get_base_attack
()
{
if
(
!
(
data
.
type
&
TYPE_MONSTER
)
&&
!
(
get_type
()
&
TYPE_MONSTER
)
&&
!
is_affected_by_effect
(
EFFECT_PRE_MONSTER
))
return
0
;
...
...
@@ -866,10 +864,22 @@ int32 card::get_defense() {
temp
.
defense
=
-
1
;
return
def
;
}
// Level/Attribute/Race is available for:
// 1. cards with original type TYPE_MONSTER or
// 2. cards with current type TYPE_MONSTER or
// 3. cards with EFFECT_PRE_MONSTER
int32
card
::
get_battle_attack
()
{
effect_set
eset
;
filter_effect
(
EFFECT_SET_BATTLE_ATTACK
,
&
eset
);
if
(
eset
.
size
())
return
eset
.
get_last
()
->
get_value
(
this
);
else
return
get_attack
();
}
int32
card
::
get_battle_defense
()
{
effect_set
eset
;
filter_effect
(
EFFECT_SET_BATTLE_DEFENSE
,
&
eset
);
if
(
eset
.
size
())
return
eset
.
get_last
()
->
get_value
(
this
);
else
return
get_defense
();
}
uint32
card
::
get_level
()
{
if
((
data
.
type
&
(
TYPE_XYZ
|
TYPE_LINK
))
||
(
status
&
STATUS_NO_LEVEL
)
||
(
!
(
data
.
type
&
TYPE_MONSTER
)
&&
!
(
get_type
()
&
TYPE_MONSTER
)
&&
!
is_affected_by_effect
(
EFFECT_PRE_MONSTER
)))
...
...
@@ -986,7 +996,6 @@ uint32 card::check_xyz_level(card* pcard, uint32 lv) {
}
return
0
;
}
// see get_level()
uint32
card
::
get_attribute
()
{
if
(
assume_type
==
ASSUME_ATTRIBUTE
)
return
assume_value
;
...
...
@@ -1037,7 +1046,6 @@ uint32 card::get_link_attribute(uint8 playerid) {
}
return
attribute
;
}
// see get_level()
uint32
card
::
get_race
()
{
if
(
assume_type
==
ASSUME_RACE
)
return
assume_value
;
...
...
card.h
View file @
a046eb7e
...
...
@@ -210,6 +210,8 @@ public:
int32
get_attack
();
int32
get_base_defense
();
int32
get_defense
();
int32
get_battle_attack
();
int32
get_battle_defense
();
uint32
get_level
();
uint32
get_rank
();
uint32
get_link
();
...
...
effect.h
View file @
a046eb7e
...
...
@@ -448,6 +448,8 @@ inline effect_flag operator|(effect_flag flag1, effect_flag flag2)
#define EFFECT_QP_ACT_IN_SET_TURN 359
#define EFFECT_EXTRA_PENDULUM_SUMMON 360
#define EFFECT_MATERIAL_LIMIT 361
#define EFFECT_SET_BATTLE_ATTACK 362
#define EFFECT_SET_BATTLE_DEFENSE 363
#define EVENT_STARTUP 1000
#define EVENT_FLIP 1001
...
...
field.cpp
View file @
a046eb7e
...
...
@@ -3341,16 +3341,17 @@ int32 field::check_cteffect_hint(effect* peffect, uint8 playerid) {
}
return
FALSE
;
}
int32
field
::
check_
hand
_trigger
(
chain
&
ch
)
{
int32
field
::
check_
nonpublic
_trigger
(
chain
&
ch
)
{
effect
*
peffect
=
ch
.
triggering_effect
;
card
*
phandler
=
peffect
->
get_handler
();
if
(
!
peffect
->
is_flag
(
EFFECT_FLAG_FIELD_ONLY
)
&&
((
peffect
->
type
&
EFFECT_TYPE_SINGLE
)
&&
!
peffect
->
is_flag
(
EFFECT_FLAG_SINGLE_RANGE
)
&&
phandler
->
is_has_relation
(
ch
)
&&
ch
.
triggering_location
==
LOCATION_HAND
||
(
peffect
->
range
&
LOCATION_HAND
)))
{
&&
phandler
->
is_has_relation
(
ch
)
&&
(
ch
.
triggering_location
&
(
LOCATION_HAND
|
LOCATION_DECK
))
||
(
peffect
->
range
&
(
LOCATION_HAND
|
LOCATION_DECK
)
)))
{
ch
.
flag
|=
CHAIN_HAND_TRIGGER
;
core
.
new_ochain_h
.
push_back
(
ch
);
if
(
ch
.
triggering_location
==
LOCATION_HAND
&&
phandler
->
is_position
(
POS_FACEDOWN
)
||
ch
.
triggering_location
==
LOCATION_DECK
||
peffect
->
range
&&
!
peffect
->
in_range
(
ch
))
return
FALSE
;
}
...
...
field.h
View file @
a046eb7e
...
...
@@ -481,7 +481,7 @@ public:
int32
get_cteffect
(
effect
*
peffect
,
int32
playerid
,
int32
store
);
int32
get_cteffect_evt
(
effect
*
feffect
,
int32
playerid
,
const
tevent
&
e
,
int32
store
);
int32
check_cteffect_hint
(
effect
*
peffect
,
uint8
playerid
);
int32
check_
hand
_trigger
(
chain
&
ch
);
int32
check_
nonpublic
_trigger
(
chain
&
ch
);
int32
check_trigger_effect
(
const
chain
&
ch
)
const
;
int32
check_spself_from_hand_trigger
(
const
chain
&
ch
)
const
;
int32
is_able_to_enter_bp
();
...
...
processor.cpp
View file @
a046eb7e
...
...
@@ -1367,7 +1367,7 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
clit
->
set_triggering_state
(
phandler
);
}
uint8
tp
=
clit
->
triggering_player
;
if
(
check_
hand
_trigger
(
*
clit
)
&&
check_trigger_effect
(
*
clit
)
if
(
check_
nonpublic
_trigger
(
*
clit
)
&&
check_trigger_effect
(
*
clit
)
&&
peffect
->
is_chainable
(
tp
)
&&
peffect
->
is_activateable
(
tp
,
clit
->
evt
,
TRUE
)
&&
check_spself_from_hand_trigger
(
*
clit
))
{
if
(
tp
==
core
.
current_player
)
...
...
@@ -1666,9 +1666,9 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
ch
.
triggering_player
=
phandler
->
current
.
controler
;
ch
.
set_triggering_state
(
phandler
);
}
if
(
ch
.
triggering_player
==
priority
&&
ch
.
triggering_location
==
LOCATION_HAND
&&
phandler
->
is_position
(
POS_FACEDOWN
)
&&
!
phandler
->
is_status
(
STATUS_CHAINING
)
&&
phandler
->
is_has_relation
(
ch
)
&&
peffect
->
is_chainable
(
priority
)
&&
peffect
->
is_activateable
(
priority
,
ch
.
evt
,
TRUE
)
if
(
ch
.
triggering_player
==
priority
&&
!
phandler
->
is_status
(
STATUS_CHAINING
)
&&
(
ch
.
triggering_location
==
LOCATION_HAND
&&
phandler
->
is_position
(
POS_FACEDOWN
)
||
ch
.
triggering_location
==
LOCATION_DECK
)
&&
p
handler
->
is_has_relation
(
ch
)
&&
p
effect
->
is_chainable
(
priority
)
&&
peffect
->
is_activateable
(
priority
,
ch
.
evt
,
TRUE
)
&&
check_spself_from_hand_trigger
(
ch
))
core
.
select_chains
.
push_back
(
ch
);
}
...
...
@@ -3288,7 +3288,7 @@ int32 field::process_damage_step(uint16 step, uint32 new_attack) {
return
TRUE
;
}
void
field
::
calculate_battle_damage
(
effect
**
pdamchange
,
card
**
preason_card
,
uint8
*
battle_destroyed
)
{
uint32
aa
=
core
.
attacker
->
get_
attack
(),
ad
=
core
.
attacker
->
get
_defense
();
uint32
aa
=
core
.
attacker
->
get_
battle_attack
(),
ad
=
core
.
attacker
->
get_battle
_defense
();
uint32
da
=
0
,
dd
=
0
,
a
=
aa
,
d
;
uint8
pa
=
core
.
attacker
->
current
.
controler
,
pd
;
uint8
damp
=
0
;
...
...
@@ -3303,8 +3303,8 @@ void field::calculate_battle_damage(effect** pdamchange, card** preason_card, ui
a
=
ad
;
}
if
(
core
.
attack_target
)
{
da
=
core
.
attack_target
->
get_attack
();
dd
=
core
.
attack_target
->
get_defense
();
da
=
core
.
attack_target
->
get_
battle_
attack
();
dd
=
core
.
attack_target
->
get_
battle_
defense
();
pd
=
core
.
attack_target
->
current
.
controler
;
if
(
core
.
attack_target
->
is_position
(
POS_ATTACK
))
{
d
=
da
;
...
...
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