mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-23 00:12:29 +00:00
Format code [skip actions]
This commit is contained in:
parent
e28575c80f
commit
7fc7b5087c
@ -8,7 +8,6 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
|||||||
import it.unimi.dsi.fastutil.ints.IntArrayList;
|
import it.unimi.dsi.fastutil.ints.IntArrayList;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
@ -155,8 +155,8 @@ public class GameQuest {
|
|||||||
// TODO improve
|
// TODO improve
|
||||||
var oldState = state;
|
var oldState = state;
|
||||||
if (questData.getFinishCond() != null && questData.getFinishCond().size() != 0) {
|
if (questData.getFinishCond() != null && questData.getFinishCond().size() != 0) {
|
||||||
for(var condition : questData.getFinishCond()) {
|
for (var condition : questData.getFinishCond()) {
|
||||||
if(condition.getType() == QuestContent.QUEST_CONTENT_LUA_NOTIFY) {
|
if (condition.getType() == QuestContent.QUEST_CONTENT_LUA_NOTIFY) {
|
||||||
this.getOwner().getPlayerProgress().resetCurrentProgress(condition.getParamStr());
|
this.getOwner().getPlayerProgress().resetCurrentProgress(condition.getParamStr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -164,8 +164,8 @@ public class GameQuest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (questData.getFailCond() != null && questData.getFailCond().size() != 0) {
|
if (questData.getFailCond() != null && questData.getFailCond().size() != 0) {
|
||||||
for(var condition : questData.getFailCond()) {
|
for (var condition : questData.getFailCond()) {
|
||||||
if(condition.getType() == QuestContent.QUEST_CONTENT_LUA_NOTIFY) {
|
if (condition.getType() == QuestContent.QUEST_CONTENT_LUA_NOTIFY) {
|
||||||
this.getOwner().getPlayerProgress().resetCurrentProgress(condition.getParamStr());
|
this.getOwner().getPlayerProgress().resetCurrentProgress(condition.getParamStr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,8 @@ public class ContentAddQuestProgress extends BaseContent {
|
|||||||
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 progressId = condition.getParam()[0];
|
val progressId = condition.getParam()[0];
|
||||||
val currentCount = quest.getOwner().getPlayerProgress().getCurrentProgress(String.valueOf(progressId));
|
val currentCount =
|
||||||
|
quest.getOwner().getPlayerProgress().getCurrentProgress(String.valueOf(progressId));
|
||||||
|
|
||||||
// if the condition count is 0 I think it is safe to assume that the
|
// if the condition count is 0 I think it is safe to assume that the
|
||||||
// condition count from EXEC only needs to be 1
|
// condition count from EXEC only needs to be 1
|
||||||
|
@ -12,6 +12,8 @@ public class ContentLuaNotify 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.getParamStr().equals(paramStr) && condition.getCount() <= quest.getOwner().getPlayerProgress().getCurrentProgress(paramStr);
|
return condition.getParamStr().equals(paramStr)
|
||||||
|
&& condition.getCount()
|
||||||
|
<= quest.getOwner().getPlayerProgress().getCurrentProgress(paramStr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user