mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-09 18:12:52 +08:00
Fix ContentNotFinishPlot
This commit is contained in:
parent
31cef88ef7
commit
762e7ae301
@ -1,21 +1,17 @@
|
|||||||
package emu.grasscutter.game.quest.content;
|
package emu.grasscutter.game.quest.content;
|
||||||
|
|
||||||
|
import emu.grasscutter.data.excels.quest.QuestData;
|
||||||
|
import emu.grasscutter.game.quest.*;
|
||||||
|
|
||||||
import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_FINISH_PLOT;
|
import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_FINISH_PLOT;
|
||||||
|
|
||||||
import emu.grasscutter.data.binout.MainQuestData;
|
|
||||||
import emu.grasscutter.data.excels.quest.QuestData;
|
|
||||||
import emu.grasscutter.game.quest.GameQuest;
|
|
||||||
import emu.grasscutter.game.quest.QuestValueContent;
|
|
||||||
|
|
||||||
@QuestValueContent(QUEST_CONTENT_FINISH_PLOT)
|
@QuestValueContent(QUEST_CONTENT_FINISH_PLOT)
|
||||||
public class ContentFinishPlot extends BaseContent {
|
public class ContentFinishPlot 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) {
|
||||||
MainQuestData.TalkData talkData =
|
var talkData = quest.getMainQuest().getTalks().get(params[0]);
|
||||||
quest.getMainQuest().getTalks().get(Integer.valueOf(params[0]));
|
var subQuest = quest.getMainQuest().getChildQuestById(params[0]);
|
||||||
GameQuest subQuest = quest.getMainQuest().getChildQuestById(params[0]);
|
|
||||||
return (talkData != null && subQuest != null || condition.getParamStr().equals(paramStr))
|
return (talkData != null && subQuest != null || condition.getParamStr().equals(paramStr))
|
||||||
&& condition.getParam()[0] == params[0];
|
&& condition.getParam()[0] == params[0];
|
||||||
}
|
}
|
||||||
|
@ -1,24 +1,18 @@
|
|||||||
package emu.grasscutter.game.quest.content;
|
package emu.grasscutter.game.quest.content;
|
||||||
|
|
||||||
|
import emu.grasscutter.data.excels.quest.QuestData;
|
||||||
|
import emu.grasscutter.game.quest.*;
|
||||||
|
|
||||||
import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_NOT_FINISH_PLOT;
|
import static emu.grasscutter.game.quest.enums.QuestContent.QUEST_CONTENT_NOT_FINISH_PLOT;
|
||||||
|
|
||||||
import emu.grasscutter.data.excels.quest.QuestData;
|
|
||||||
import emu.grasscutter.game.quest.GameQuest;
|
|
||||||
import emu.grasscutter.game.quest.QuestValueContent;
|
|
||||||
import lombok.val;
|
|
||||||
|
|
||||||
@QuestValueContent(QUEST_CONTENT_NOT_FINISH_PLOT)
|
@QuestValueContent(QUEST_CONTENT_NOT_FINISH_PLOT)
|
||||||
public class ContentNotFinishPlot extends BaseContent {
|
public class ContentNotFinishPlot 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) {
|
||||||
val talkId = condition.getParam()[0];
|
var talkData = quest.getMainQuest().getTalks().get(params[0]);
|
||||||
val checkMainQuest = quest.getOwner().getQuestManager().getMainQuestByTalkId(talkId);
|
var subQuest = quest.getMainQuest().getChildQuestById(params[0]);
|
||||||
if (checkMainQuest == null) {
|
return (talkData == null && subQuest != null || condition.getParamStr().equals(paramStr))
|
||||||
return true;
|
&& condition.getParam()[0] == params[0];
|
||||||
}
|
|
||||||
val talkData = checkMainQuest.getTalks().get(talkId);
|
|
||||||
return talkData == null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user