9
0
mirror of https://github.com/Auxilor/EcoQuests.git synced 2025-12-22 16:39:21 +00:00

Compare commits

..

19 Commits

Author SHA1 Message Date
Will FP
5814587ed5 libreforge-updater 2024-11-06 18:33:27 +00:00
Will FP
f4682214cc libreforge-updater 2024-10-22 12:14:38 +01:00
Will FP
3c0d5651d8 Merge pull request #3 from kiriharu/master
FIX: Prevent to give expirience to task when it marked as completed
2024-09-26 19:08:57 +01:00
Will FP
c86651df9b libreforge-updater 2024-09-22 17:00:59 +01:00
Will FP
26ccae38b1 Merge pull request #4 from Exanthiax/improved_sorting
improved sorting and multi-line descriptions
2024-09-22 15:47:35 +01:00
Exanthiax
c1c985d638 improved sorting and multi-line descriptions 2024-09-22 15:12:11 +01:00
kiriharu
ed947b354f FIX: Stop giving exp to task and call steps related to it when task already marked as completed 2024-09-21 13:00:51 +03:00
Auxilor
5e51c369bb libreforge-updater 2024-09-02 11:30:14 +01:00
Auxilor
67a2e2fb4f libreforge-updater 2024-08-30 17:25:13 +01:00
Auxilor
f94e79bc92 libreforge-updater 2024-08-29 12:09:23 +01:00
Auxilor
9cf8d465b9 libreforge-updater 2024-08-23 15:35:29 +01:00
Auxilor
237ebda870 libreforge-updater 2024-08-21 18:58:25 +01:00
Auxilor
ed6bcaab04 libreforge-updater 2024-08-15 15:07:42 +01:00
Auxilor
40a0f99716 libreforge-updater 2024-08-03 13:41:32 +01:00
Auxilor
a59bce65ab libreforge-updater 2024-07-25 10:04:39 +01:00
Auxilor
0212076fad libreforge-updater 2024-07-21 12:19:23 +01:00
Auxilor
c4b0429ad5 libreforge-updater 2024-07-19 20:28:44 +01:00
Auxilor
c5e0611a20 libreforge-updater 2024-07-18 13:24:18 +01:00
Auxilor
cb2e8a181f libreforge-updater 2024-07-16 17:13:48 +01:00
3 changed files with 23 additions and 7 deletions

View File

@@ -101,10 +101,20 @@ class Quest(
// The tasks that are actually in use
var tasks = run {
if (isResettable) {
loadTasks() ?: availableTasks.randomlyPick(taskAmount)
if (taskAmount == availableTasks.size) {
// If taskAmount is equal to availableTasks.size then tasks are ordered as configured
if (isResettable) {
availableTasks.take(taskAmount)
} else {
availableTasks.shuffled().take(taskAmount)
}
} else {
availableTasks.randomlyPick(taskAmount)
// If taskAmount is less than availableTasks.size then tasks are selected and ordered randomly.
if (isResettable) {
loadTasks() ?: availableTasks.randomlyPick(taskAmount)
} else {
availableTasks.randomlyPick(taskAmount)
}
}
}
private set
@@ -268,7 +278,8 @@ class Quest(
}
fun getDescription(player: Player): List<String> {
return addPlaceholdersInto(listOf(config.getString("description")), player)
val descriptions = config.getStrings("description")
return addPlaceholdersInto(descriptions, player)
}
fun hasActive(player: OfflinePlayer): Boolean {

View File

@@ -146,6 +146,11 @@ class Task(
* Give experience directly
*/
fun giveExperience(player: Player, amount: Double) {
if (player.profile.read(hasCompletedKey)) {
return
}
val requiredXp = getExperienceRequired(player)
val newXp = player.profile.read(xpKey) + amount

View File

@@ -1,5 +1,5 @@
#libreforge-updater
#Sat Jul 13 20:45:24 BST 2024
#Wed Nov 06 18:33:27 GMT 2024
kotlin.code.style=official
libreforge-version=4.65.1
version=1.36.1
libreforge-version=4.72.2
version=1.43.2