mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-24 05:32:52 +08:00
Format code [skip actions]
This commit is contained in:
parent
fbe2b138ee
commit
8de281d4da
@ -159,7 +159,10 @@ public class GameQuest {
|
|||||||
// TODO improve
|
// TODO improve
|
||||||
var oldState = state;
|
var oldState = state;
|
||||||
if (questData.getAcceptCond() != null && questData.getAcceptCond().size() != 0) {
|
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) {
|
if (questData.getFinishCond() != null && questData.getFinishCond().size() != 0) {
|
||||||
|
@ -512,7 +512,9 @@ public final class QuestManager extends BasePlayerManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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())) {
|
if (this.loggedQuests.contains(questData.getId())) {
|
||||||
Grasscutter.getLogger()
|
Grasscutter.getLogger()
|
||||||
.debug(
|
.debug(
|
||||||
@ -540,8 +542,7 @@ public final class QuestManager extends BasePlayerManager {
|
|||||||
|
|
||||||
if (shouldAccept) {
|
if (shouldAccept) {
|
||||||
GameQuest quest = owner.getQuestManager().addQuest(questData);
|
GameQuest quest = owner.getQuestManager().addQuest(questData);
|
||||||
Grasscutter.getLogger()
|
Grasscutter.getLogger().debug("Added quest {}", questData.getSubId());
|
||||||
.debug("Added quest {}", questData.getSubId());
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ public class ConditionItemGivingFinished extends BaseCondition {
|
|||||||
QuestData.QuestAcceptCondition condition,
|
QuestData.QuestAcceptCondition condition,
|
||||||
String paramStr,
|
String paramStr,
|
||||||
int... params) {
|
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]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ public final class ContentFinishItemGiving extends BaseContent {
|
|||||||
@Override
|
@Override
|
||||||
public boolean execute(
|
public boolean execute(
|
||||||
GameQuest quest, QuestData.QuestContentCondition condition, String paramStr, int... params) {
|
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]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -541,7 +541,11 @@ public class Scene {
|
|||||||
|
|
||||||
if (target instanceof EntityGadget gadget) {
|
if (target instanceof EntityGadget gadget) {
|
||||||
if (gadget.getMetaGadget() != null) {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,8 +99,10 @@ public final class HandlerItemGivingReq extends PacketHandler {
|
|||||||
// Mark the giving action as completed.
|
// Mark the giving action as completed.
|
||||||
questManager.markCompleted(giveId);
|
questManager.markCompleted(giveId);
|
||||||
// Queue the content and condition actions.
|
// Queue the content and condition actions.
|
||||||
questManager.queueEvent(QuestContent.QUEST_CONTENT_FINISH_ITEM_GIVING, giveId, matchedGroups.get(0));
|
questManager.queueEvent(
|
||||||
questManager.queueEvent(QuestCond.QUEST_COND_ITEM_GIVING_FINISHED, giveId, matchedGroups.get(0));
|
QuestContent.QUEST_CONTENT_FINISH_ITEM_GIVING, giveId, matchedGroups.get(0));
|
||||||
|
questManager.queueEvent(
|
||||||
|
QuestCond.QUEST_COND_ITEM_GIVING_FINISHED, giveId, matchedGroups.get(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user