mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-21 09:02:07 -07:00
Change star discovery bonus xp to be gradually disbursed instead of lump-sump.
This commit is contained in:
parent
2afb484c07
commit
d3fc957356
3 changed files with 21 additions and 6 deletions
|
|
@ -66,4 +66,5 @@
|
|||
- Add remote kicking support to the Management Server
|
||||
- Added Christmas Event :)
|
||||
- Added snow toggle to client config
|
||||
< --- ABOVE Released December 4, 2021 https://gitlab.com/2009scape/2009scape/-/tags/Dec-4-2021 ---- >
|
||||
< --- ABOVE Released December 4, 2021 https://gitlab.com/2009scape/2009scape/-/tags/Dec-4-2021 ---- >
|
||||
- Shooting star discovery bonus xp is now gradually disbursed instead of lump-sump.
|
||||
|
|
|
|||
|
|
@ -34,8 +34,10 @@ class ShootingStarMiningPulse(player: Player?, node: Scenery?, val star: Shootin
|
|||
}
|
||||
//checks if the star has been discovered and if not, awards the bonus xp. Xp can be awarded regardless of mining level as per the wiki.
|
||||
if (!star.isDiscovered) {
|
||||
player.skills.addExperience(Skills.MINING, 75 * player.skills.getStaticLevel(Skills.MINING).toDouble())
|
||||
val bonusXp = 75 * player.skills.getStaticLevel(Skills.MINING)
|
||||
player.incrementAttribute("/save:shooting-star:bonus-xp", bonusXp)
|
||||
Repository.sendNews(player.username + " is the discoverer of the crashed star near " + star.location + "!")
|
||||
player.sendMessage("You have ${player.skills.experienceMutiplier * player.getAttribute("shooting-star:bonus-xp", 0).toDouble()} bonus xp towards mining stardust.")
|
||||
ScoreboardManager.submit(player)
|
||||
star.isDiscovered = true
|
||||
return player.skills.getLevel(Skills.MINING) >= star.miningLevel
|
||||
|
|
@ -71,7 +73,19 @@ class ShootingStarMiningPulse(player: Player?, node: Scenery?, val star: Shootin
|
|||
star.dustLeft = 1
|
||||
}
|
||||
star.decDust()
|
||||
player.skills.addExperience(Skills.MINING,star.level.exp.toDouble())
|
||||
|
||||
val bonusXp = player.getAttribute("shooting-star:bonus-xp", 0).toDouble()
|
||||
var xp = star.level.exp.toDouble()
|
||||
if(bonusXp > 0) {
|
||||
val delta = Math.min(bonusXp, xp)
|
||||
player.incrementAttribute("/save:shooting-star:bonus-xp", (-delta).toInt())
|
||||
xp += delta;
|
||||
if(player.getAttribute("shooting-star:bonus-xp", 0) <= 0) {
|
||||
player.sendMessage("You have obtained all of your bonus xp from the star.")
|
||||
}
|
||||
}
|
||||
|
||||
player.skills.addExperience(Skills.MINING, xp)
|
||||
if (ShootingStarOptionHandler.getStarDust(player) < 200) {
|
||||
player.inventory.add(Item(ShootingStarOptionHandler.STAR_DUST, 1))
|
||||
}
|
||||
|
|
@ -118,4 +132,4 @@ class ShootingStarMiningPulse(player: Player?, node: Scenery?, val star: Shootin
|
|||
val clientRatio: Double = Math.random() * ((level - star.miningLevel) * (1.0 + tool.ratio))
|
||||
return hostRatio < clientRatio
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ class StarSpriteDialogue(player: Player? = null) : DialoguePlugin(player) {
|
|||
ContentAPI.addItem(player, bonusId, bonusBaseAmt)
|
||||
ContentAPI.sendMessage(player, colorize("%RYour ring shines brightly as if surging with energy and then fades out."))
|
||||
} else if(RandomFunction.roll(25)){
|
||||
player.savedData.globalData.starSpriteDelay = 0L
|
||||
getStoreFile()[player.username.toLowerCase()] = false //flag daily as uncompleted
|
||||
ContentAPI.sendMessage(player, colorize("%RYour ring vibrates briefly as if surging with power, and then stops."))
|
||||
}
|
||||
}
|
||||
|
|
@ -280,4 +280,4 @@ class StarSpriteDialogue(player: Player? = null) : DialoguePlugin(player) {
|
|||
return ServerStore.getArchive("daily-shooting-star")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue