Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
66b17cad
Commit
66b17cad
authored
May 10, 2022
by
Akka
Browse files
little fix
parent
2e69a4d8
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/scripts/service/ScriptMonsterTideService.java
View file @
66b17cad
...
@@ -60,18 +60,18 @@ public class ScriptMonsterTideService {
...
@@ -60,18 +60,18 @@ public class ScriptMonsterTideService {
return
currentGroup
.
monsters
.
values
().
stream
().
findFirst
().
orElse
(
null
);
return
currentGroup
.
monsters
.
values
().
stream
().
findFirst
().
orElse
(
null
);
}
}
public
class
OnMonsterDead
implements
ScriptMonsterListener
{
public
class
OnMonsterDead
implements
ScriptMonsterListener
{
@Override
@Override
public
void
onNotify
(
EntityMonster
sceneMonster
)
{
public
void
onNotify
(
EntityMonster
sceneMonster
)
{
if
(
monsterSceneLimit
<=
0
){
if
(
monsterSceneLimit
<=
0
)
{
return
;
return
;
}
}
if
(
monsterAlive
.
decrementAndGet
()
>=
monsterSceneLimit
)
{
if
(
monsterAlive
.
decrementAndGet
()
>=
monsterSceneLimit
)
{
// maybe not happen
// maybe not happen
return
;
return
;
}
}
monsterKillCount
.
incrementAndGet
();
monsterKillCount
.
incrementAndGet
();
if
(
monsterTideCount
.
get
()
>
0
){
if
(
monsterTideCount
.
get
()
>
0
)
{
// add more
// add more
sceneScriptManager
.
getScriptMonsterSpawnService
().
spawnMonster
(
currentGroup
.
id
,
getNextMonster
());
sceneScriptManager
.
getScriptMonsterSpawnService
().
spawnMonster
(
currentGroup
.
id
,
getNextMonster
());
}
}
...
@@ -79,9 +79,7 @@ public class ScriptMonsterTideService {
...
@@ -79,9 +79,7 @@ public class ScriptMonsterTideService {
// fix the 5-2
// fix the 5-2
sceneScriptManager
.
callEvent
(
EventType
.
EVENT_MONSTER_TIDE_DIE
,
new
ScriptArgs
(
monsterKillCount
.
get
()));
sceneScriptManager
.
callEvent
(
EventType
.
EVENT_MONSTER_TIDE_DIE
,
new
ScriptArgs
(
monsterKillCount
.
get
()));
}
}
// spawn the last turn of monsters
// fix the 5-2
this
.
sceneScriptManager
.
callEvent
(
EventType
.
EVENT_MONSTER_TIDE_DIE
,
new
ScriptArgs
(
this
.
monsterKillCount
.
get
()));
}
}
public
void
unload
(){
public
void
unload
(){
...
...
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