Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Grasscutter
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
ziqian zhang
Grasscutter
Commits
635e342a
Commit
635e342a
authored
3 years ago
by
ImmuState
Committed by
Melledy
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Make sure the hit target is actually a monster.
parent
febdb998
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/emu/grasscutter/game/managers/EnergyManager/EnergyManager.java
+14
-2
14 additions, 2 deletions
...rasscutter/game/managers/EnergyManager/EnergyManager.java
with
14 additions
and
2 deletions
src/main/java/emu/grasscutter/game/managers/EnergyManager/EnergyManager.java
+
14
−
2
View file @
635e342a
...
@@ -45,6 +45,8 @@ import com.google.protobuf.InvalidProtocolBufferException;
...
@@ -45,6 +45,8 @@ import com.google.protobuf.InvalidProtocolBufferException;
public
class
EnergyManager
{
public
class
EnergyManager
{
private
final
Player
player
;
private
final
Player
player
;
private
final
Map
<
EntityAvatar
,
Integer
>
avatarNormalProbabilities
;
private
final
static
Int2ObjectMap
<
List
<
EnergyDropInfo
>>
energyDropData
=
new
Int2ObjectOpenHashMap
<>();
private
final
static
Int2ObjectMap
<
List
<
EnergyDropInfo
>>
energyDropData
=
new
Int2ObjectOpenHashMap
<>();
private
final
static
Int2ObjectMap
<
List
<
SkillParticleGenerationInfo
>>
skillParticleGenerationData
=
new
Int2ObjectOpenHashMap
<>();
private
final
static
Int2ObjectMap
<
List
<
SkillParticleGenerationInfo
>>
skillParticleGenerationData
=
new
Int2ObjectOpenHashMap
<>();
...
@@ -257,8 +259,6 @@ public class EnergyManager {
...
@@ -257,8 +259,6 @@ public class EnergyManager {
entry
(
"WEAPON_CATALYST"
,
10
)
entry
(
"WEAPON_CATALYST"
,
10
)
);
);
private
final
Map
<
EntityAvatar
,
Integer
>
avatarNormalProbabilities
;
private
void
generateEnergyForNormalAndCharged
(
EntityAvatar
avatar
)
{
private
void
generateEnergyForNormalAndCharged
(
EntityAvatar
avatar
)
{
// This logic is based on the descriptions given in
// This logic is based on the descriptions given in
// https://genshin-impact.fandom.com/wiki/Energy#Energy_Generated_by_Normal_Attacks
// https://genshin-impact.fandom.com/wiki/Energy#Energy_Generated_by_Normal_Attacks
...
@@ -304,6 +304,18 @@ public class EnergyManager {
...
@@ -304,6 +304,18 @@ public class EnergyManager {
if
(
attackerEntity
.
isEmpty
()
||
this
.
player
.
getTeamManager
().
getCurrentAvatarEntity
().
getId
()
!=
attackerEntity
.
get
().
getId
())
{
if
(
attackerEntity
.
isEmpty
()
||
this
.
player
.
getTeamManager
().
getCurrentAvatarEntity
().
getId
()
!=
attackerEntity
.
get
().
getId
())
{
return
;
return
;
}
}
// Make sure the target is an actual enemy.
GameEntity
targetEntity
=
this
.
player
.
getScene
().
getEntityById
(
attackRes
.
getDefenseId
());
if
(!(
targetEntity
instanceof
EntityMonster
))
{
return
;
}
EntityMonster
targetMonster
=
(
EntityMonster
)
targetEntity
;
String
targetType
=
targetMonster
.
getMonsterData
().
getType
();
if
(!
targetType
.
equals
(
"MONSTER_ORDINARY"
)
&&
!
targetType
.
equals
(
"MONSTER_BOSS"
))
{
return
;
}
// Get the ability that caused this hit.
// Get the ability that caused this hit.
AbilityIdentifier
ability
=
attackRes
.
getAbilityIdentifier
();
AbilityIdentifier
ability
=
attackRes
.
getAbilityIdentifier
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment