-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Rename emote to renderEmote * Add basic gnome stronghold agility course * Add advanced gnome course * Add gnome trainers * Add integration tests * Handle logout during obstacles
- Loading branch information
Showing
15 changed files
with
626 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
human_stand: 1426 | ||
dororan_stand: 1880 | ||
dororan_stand: 1880 | ||
rope_balance: 155 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
.../src/main/kotlin/world/gregs/voidps/world/activity/skill/agility/course/GnomeAdvanced.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
package world.gregs.voidps.world.activity.skill.agility.course | ||
|
||
import world.gregs.voidps.engine.client.message | ||
import world.gregs.voidps.engine.client.variable.start | ||
import world.gregs.voidps.engine.entity.character.clearAnimation | ||
import world.gregs.voidps.engine.entity.character.exactMove | ||
import world.gregs.voidps.engine.entity.character.face | ||
import world.gregs.voidps.engine.entity.character.move.tele | ||
import world.gregs.voidps.engine.entity.character.npc.NPCs | ||
import world.gregs.voidps.engine.entity.character.player.chat.ChatType | ||
import world.gregs.voidps.engine.entity.character.player.skill.Skill | ||
import world.gregs.voidps.engine.entity.character.player.skill.exp.exp | ||
import world.gregs.voidps.engine.entity.character.player.skill.level.Level.has | ||
import world.gregs.voidps.engine.entity.character.setAnimation | ||
import world.gregs.voidps.engine.entity.obj.objectApproach | ||
import world.gregs.voidps.engine.entity.obj.objectOperate | ||
import world.gregs.voidps.engine.inject | ||
import world.gregs.voidps.engine.queue.strongQueue | ||
import world.gregs.voidps.engine.suspend.approachRange | ||
import world.gregs.voidps.engine.suspend.delay | ||
import world.gregs.voidps.engine.suspend.pause | ||
import world.gregs.voidps.type.Direction | ||
import world.gregs.voidps.type.Tile | ||
import world.gregs.voidps.type.Zone | ||
|
||
val npcs: NPCs by inject() | ||
|
||
objectOperate("Climb-up", "gnome_tree_branch_advanced") { | ||
if (!player.has(Skill.Agility, 85)) { | ||
return@objectOperate | ||
} | ||
npcs.gnomeTrainer("Terrorbirds could climb faster than that!", Zone(9263413)) | ||
player.message("You climb the tree...", ChatType.Filter) | ||
player.setAnimation("climb_up") | ||
player.start("input_delay", 2) | ||
player.strongQueue("branch", 2) { | ||
player.message("... to an even higher platform.", ChatType.Filter) | ||
player.gnomeStage(4) | ||
player.tele(player.tile.add(y = -1, level = 1)) | ||
player.exp(Skill.Agility, 25.0) | ||
} | ||
} | ||
|
||
objectApproach("Run-across", "gnome_sign_post_advanced") { | ||
npcs.gnomeTrainer("Come on! I'd be over there by now.", Zone(13457717)) | ||
player.approachRange(1) | ||
// Pausing for 2 ticks to ensure we're in the correct spot. | ||
// arriveDelay() wouldn't work as objectApproach is called before Movement.tick where "last_movement" is set | ||
pause(2) | ||
player.face(Direction.EAST) | ||
player.setAnimation("gnome_wall_run") | ||
player.start("input_delay", 4) | ||
player.strongQueue("wall-run", 1) { | ||
player.exactMove(Tile(2484, 3418, 3), 60, Direction.EAST) | ||
pause(2) | ||
player.gnomeStage(5) | ||
player.exp(Skill.Agility, 25.0) | ||
player.clearAnimation() | ||
} | ||
} | ||
|
||
objectApproach("Swing-to", "gnome_pole_advanced") { | ||
var tile = player.tile | ||
if (player.tile.x == 2484) { | ||
tile = Tile(2485, 3418, 3) | ||
} | ||
player.steps.clear() | ||
player.face(Direction.NORTH) | ||
player.start("input_delay", 14) | ||
player.strongQueue("run-up", 1) { | ||
onCancel = { | ||
player.tele(Tile(2486, 3418, 3)) | ||
} | ||
player.setAnimation("gnome_run_up") | ||
player.exactMove(tile.copy(y = 3421), 60, Direction.NORTH) | ||
pause(2) | ||
player.setAnimation("gnome_jump") | ||
player.exactMove(tile.copy(y = 3425), 30, Direction.NORTH) | ||
pause(1) | ||
player.setAnimation("gnome_swing") | ||
pause(4) | ||
player.exactMove(tile.copy(y = 3429), 30, Direction.NORTH) | ||
pause(5) | ||
player.exactMove(tile.copy(y = 3432), 30, Direction.NORTH) | ||
delay(2) | ||
player.gnomeStage(6) | ||
player.exp(Skill.Agility, 25.0) | ||
} | ||
} | ||
|
||
objectOperate("Jump-over", "gnome_barrier_advanced") { | ||
player.setAnimation("gnome_jump_barrier") | ||
player.start("input_delay", 4) | ||
player.strongQueue("branch", 1) { | ||
player.exactMove(Tile(2485, 3434, 3), 30, Direction.NORTH) | ||
pause(2) | ||
player.tele(2485, 3436, 0) | ||
player.setAnimation("gnome_pipe_land") | ||
if (player.gnomeStage == 6) { | ||
player.gnomeStage = 0 | ||
player.inc("gnome_course_advanced_laps") | ||
player.exp(Skill.Agility, 605.0) | ||
} | ||
player.exp(Skill.Agility, 25.0) | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
game/src/main/kotlin/world/gregs/voidps/world/activity/skill/agility/course/GnomeAgility.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package world.gregs.voidps.world.activity.skill.agility.course | ||
|
||
import world.gregs.voidps.engine.entity.character.forceChat | ||
import world.gregs.voidps.engine.entity.character.npc.NPCs | ||
import world.gregs.voidps.engine.entity.character.player.Player | ||
import world.gregs.voidps.type.Zone | ||
import world.gregs.voidps.type.random | ||
|
||
internal fun Player.gnomeStage(stage: Int) { | ||
if (stage == gnomeStage + 1) { | ||
gnomeStage = stage | ||
} | ||
} | ||
|
||
internal var Player.gnomeStage: Int | ||
get() = this["gnome_course_stage", 0] | ||
set(value) { | ||
this["gnome_course_stage"] = value | ||
} | ||
|
||
internal fun NPCs.gnomeTrainer(message: String, zone: Zone) { | ||
val trainer = get(zone).randomOrNull(random) ?: return | ||
trainer.forceChat = message | ||
} | ||
|
||
internal fun NPCs.gnomeTrainer(message: String, zones: List<Zone>) { | ||
for (zone in zones) { | ||
val trainer = get(zone).randomOrNull(random) ?: continue | ||
trainer.forceChat = message | ||
break | ||
} | ||
} |
Oops, something went wrong.