Skip to content

Commit

Permalink
Format code [skip actions]
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Sep 10, 2023
1 parent fbe2b13 commit 8de281d
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 9 deletions.
5 changes: 4 additions & 1 deletion src/main/java/emu/grasscutter/game/quest/GameQuest.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ public boolean clearProgress(boolean notifyDelete) {
// TODO improve
var oldState = state;
if (questData.getAcceptCond() != null && questData.getAcceptCond().size() != 0) {
this.getMainQuest().getQuestManager().getAcceptProgressLists().put(this.getSubQuestId(), new int[questData.getAcceptCond().size()]);
this.getMainQuest()
.getQuestManager()
.getAcceptProgressLists()
.put(this.getSubQuestId(), new int[questData.getAcceptCond().size()]);
}

if (questData.getFinishCond() != null && questData.getFinishCond().size() != 0) {
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/emu/grasscutter/game/quest/QuestManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,9 @@ public void triggerEvent(QuestCond condType, String paramStr, int... params) {
}
}

boolean shouldAccept = LogicType.calculate(questData.getAcceptCondComb(), acceptProgressLists.get(questData.getId()));
boolean shouldAccept =
LogicType.calculate(
questData.getAcceptCondComb(), acceptProgressLists.get(questData.getId()));
if (this.loggedQuests.contains(questData.getId())) {
Grasscutter.getLogger()
.debug(
Expand Down Expand Up @@ -540,8 +542,7 @@ public void triggerEvent(QuestCond condType, String paramStr, int... params) {

if (shouldAccept) {
GameQuest quest = owner.getQuestManager().addQuest(questData);
Grasscutter.getLogger()
.debug("Added quest {}", questData.getSubId());
Grasscutter.getLogger().debug("Added quest {}", questData.getSubId());
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public boolean execute(
QuestData.QuestAcceptCondition condition,
String paramStr,
int... params) {
return condition.getParam()[0] == params[0] && (condition.getParam()[1] == 0 || condition.getParam()[1] == params[1]);
return condition.getParam()[0] == params[0]
&& (condition.getParam()[1] == 0 || condition.getParam()[1] == params[1]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public final class ContentFinishItemGiving extends BaseContent {
@Override
public boolean execute(
GameQuest quest, QuestData.QuestContentCondition condition, String paramStr, int... params) {
return condition.getParam()[0] == params[0] && (condition.getParam()[1] == 0 || condition.getParam()[1] == params[1]);
return condition.getParam()[0] == params[0]
&& (condition.getParam()[1] == 0 || condition.getParam()[1] == params[1]);
}
}
6 changes: 5 additions & 1 deletion src/main/java/emu/grasscutter/game/world/Scene.java
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,11 @@ public void killEntity(GameEntity target, int attackerId) {

if (target instanceof EntityGadget gadget) {
if (gadget.getMetaGadget() != null) {
world.getServer().getDropSystem().handleChestDrop(gadget.getMetaGadget().drop_id, gadget.getMetaGadget().drop_count, gadget);
world
.getServer()
.getDropSystem()
.handleChestDrop(
gadget.getMetaGadget().drop_id, gadget.getMetaGadget().drop_count, gadget);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ public void handle(GameSession session, byte[] header, byte[] payload) throws Ex
// Mark the giving action as completed.
questManager.markCompleted(giveId);
// Queue the content and condition actions.
questManager.queueEvent(QuestContent.QUEST_CONTENT_FINISH_ITEM_GIVING, giveId, matchedGroups.get(0));
questManager.queueEvent(QuestCond.QUEST_COND_ITEM_GIVING_FINISHED, giveId, matchedGroups.get(0));
questManager.queueEvent(
QuestContent.QUEST_CONTENT_FINISH_ITEM_GIVING, giveId, matchedGroups.get(0));
questManager.queueEvent(
QuestCond.QUEST_COND_ITEM_GIVING_FINISHED, giveId, matchedGroups.get(0));
}
}
}
Expand Down

0 comments on commit 8de281d

Please sign in to comment.