123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643 |
- rankingtable = "tjrranks";
- game_short = "tjr";
- maxplayers = 1;
- gamesignloc = minigame.getSignLoc("tjrsign");
- sign.started(gamesignloc);
- event.load("player_join");
- event.load("player_move");
- event.load("living_pre_hurt");
- event.load("player_post_respawn");
- event.load("player_toss");
- event.load("player_logout");
- event.load("player_giveup");
- event.load("entity_click");
- event.load("block_break");
- event.load("block_place");
- event.load("block_click");
- event.load("inv_click");
- event.load("function_key");
- @wait
- wait();
- if(event == "living_pre_hurt") {
- if(!isPlayer(living_entity)) {
- goto("wait");
- }
- player = living_entity;
- }
- if(player.hasMinigameId(player, script_id)) {
- ignoreGoto(event);
- }
- goto("wait");
- @player_join
- single_uuid = player.getUuid(player);
- lavacounter = 0;
- angel = read.item("minecraft:fishing_rod");
- arrow = read.item("minecraft:arrow");
- bow = read.item("minecraft:bow");
- ench = enchantment.get("minecraft:infinity");
- enchantment.add(ench, bow, 1);
- gamesworld = world.get("games");
- item_whole_run = read.item("minecraft:slime_block", 1, "§rGanzer Run");
- item.addLore(item_whole_run, 0, "Schaffe das ganze Jump'n'Run so schnell wie möglich. Checkpoints werden gespeichert.");
- item_module_run = read.item("minecraft:clock", 1, "§rModul");
- item.addLore(item_module_run, 0, "Erreiche in jedem einzelnen Modul eine Spitzenzeit.");
- item_fly_run = read.item("minecraft:elytra", 1, "§rFly");
- item.addLore(item_fly_run, 0, "Gehe mit Fly so schnell wie möglich durch das ganze Jump'n'Run. Checkpoints helfen dir hier nichts und du musst immer von vorne anfangen.");
- mode_menu = inv.new("222");
- inv_id_mode = inv.getId(mode_menu);
- inv.setItem(mode_menu, 0, item_whole_run);
- inv.setItem(mode_menu, 1, item_module_run);
- inv.setItem(mode_menu, 2, item_fly_run);
- all_modules_menu = inv.new("222222222222222222222222222222222222222222222222222222");
- inv_id_modules = inv.getId(all_modules_menu);
- inv.setItem(all_modules_menu, 0, read.item("minecraft:stone", 1, "§rStart"));
- inv.setItem(all_modules_menu, 1, read.item("minecraft:stone", 1, "§rModul 1"));
- inv.setItem(all_modules_menu, 2, read.item("minecraft:stone", 1, "§rModul 2"));
- inv.setItem(all_modules_menu, 3, read.item("minecraft:black_wool", 1, "§rModul 3"));
- inv.setItem(all_modules_menu, 4, read.item("minecraft:glass", 1, "§rModul 4"));
- inv.setItem(all_modules_menu, 5, read.item("minecraft:barrier", 1, "§rModul 5"));
- inv.setItem(all_modules_menu, 6, read.item("minecraft:fishing_rod", 1, "§rModul 6"));
- inv.setItem(all_modules_menu, 7, read.item("minecraft:lapis_block", 1, "§rModul 7"));
- inv.setItem(all_modules_menu, 8, read.item("minecraft:campfire", 1, "§rModul 8"));
- inv.setItem(all_modules_menu, 9, read.item("minecraft:chiseled_quartz_block", 1, "§rModul 9"));
- inv.setItem(all_modules_menu, 10, read.item("minecraft:chiseled_quartz_block", 1, "§rModul 10"));
- inv.setItem(all_modules_menu, 11, read.item("minecraft:chiseled_quartz_block", 1, "§rModul 11"));
- inv.setItem(all_modules_menu, 12, read.item("minecraft:chiseled_quartz_block", 1, "§rModul 12"));
- inv.setItem(all_modules_menu, 13, read.item("minecraft:chiseled_quartz_block", 1, "§rModul 13"));
- inv.setItem(all_modules_menu, 14, read.item("minecraft:chiseled_quartz_block", 1, "§rModul 14"));
- inv.setItem(all_modules_menu, 15, read.item("minecraft:chiseled_quartz_block", 1, "§rModul 15"));
- inv.setItem(all_modules_menu, 16, read.item("minecraft:glass", 1, "§rModul 16"));
- inv.setItem(all_modules_menu, 17, read.item("minecraft:chiseled_quartz_block", 1, "§rModul 17"));
- inv.setItem(all_modules_menu, 18, read.item("minecraft:repeater", 1, "§rModul 18"));
- inv.setItem(all_modules_menu, 19, read.item("minecraft:chiseled_quartz_block", 1, "§rModul 19"));
- inv.setItem(all_modules_menu, 20, read.item("minecraft:red_wool", 1, "§rModul 20"));
- inv.setItem(all_modules_menu, 21, read.item("minecraft:chiseled_quartz_block", 1, "§rModul 21"));
- inv.setItem(all_modules_menu, 22, read.item("minecraft:netherrack", 1, "§rModul 22"));
- inv.setItem(all_modules_menu, 23, read.item("minecraft:netherrack", 1, "§rModul 23"));
- inv.setItem(all_modules_menu, 24, read.item("minecraft:netherrack", 1, "§rModul 24"));
- inv.setItem(all_modules_menu, 25, read.item("minecraft:netherrack", 1, "§rModul 25"));
- inv.setItem(all_modules_menu, 26, read.item("minecraft:end_stone", 1, "§rModul 26"));
- inv.setItem(all_modules_menu, 27, read.item("minecraft:end_stone", 1, "§rModul 27"));
- inv.setItem(all_modules_menu, 28, read.item("minecraft:poppy", 1, "§rModul 28"));
- inv.setItem(all_modules_menu, 29, read.item("minecraft:bookshelf", 1, "§rModul 29"));
- inv.setItem(all_modules_menu, 30, read.item("minecraft:oak_planks", 1, "§rModul 30"));
- inv.setItem(all_modules_menu, 31, read.item("minecraft:iron_block", 1, "§rModul 31"));
- inv.setItem(all_modules_menu, 32, read.item("minecraft:iron_block", 1, "§rModul 32"));
- inv.setItem(all_modules_menu, 33, read.item("minecraft:iron_block", 1, "§rModul 33"));
- inv.setItem(all_modules_menu, 34, read.item("minecraft:iron_block", 1, "§rModul 34"));
- inv.setItem(all_modules_menu, 35, read.item("minecraft:iron_block", 1, "§rModul 35"));
- inv.setItem(all_modules_menu, 36, read.item("minecraft:iron_block", 1, "§rModul 36"));
- inv.setItem(all_modules_menu, 37, read.item("minecraft:iron_block", 1, "§rModul 37"));
- inv.setItem(all_modules_menu, 38, read.item("minecraft:iron_block", 1, "§rModul 38"));
- inv.setItem(all_modules_menu, 39, read.item("minecraft:iron_block", 1, "§rModul 39"));
- inv.setItem(all_modules_menu, 40, read.item("minecraft:gray_wool", 1, "§rModul 40"));
- inv.setItem(all_modules_menu, 41, read.item("minecraft:light_gray_wool", 1, "§rModul 41"));
- inv.setItem(all_modules_menu, 42, read.item("minecraft:green_wool", 1, "§rModul 42"));
- inv.setItem(all_modules_menu, 43, read.item("minecraft:hay_block", 1, "§rModul 43"));
- inv.setItem(all_modules_menu, 44, read.item("minecraft:oak_log", 1, "§rModul 44"));
- inv.setItem(all_modules_menu, 45, read.item("minecraft:oak_log", 1, "§rModul 45"));
- inv.setItem(all_modules_menu, 46, read.item("minecraft:snow_block", 1, "§rModul 46"));
- inv.setItem(all_modules_menu, 47, read.item("minecraft:snow_block", 1, "§rModul 47"));
- inv.setItem(all_modules_menu, 48, read.item("minecraft:bookshelf", 1, "§rModul 48"));
- inv.setItem(all_modules_menu, 49, read.item("minecraft:white_wool", 1, "§rModul 49"));
- inv.setItem(all_modules_menu, 50, read.item("minecraft:dark_prismarine", 1, "§rModul 50"));
- inv.setItem(all_modules_menu, 51, read.item("minecraft:slime_block", 1, "§rModul 51"));
- inv.setItem(all_modules_menu, 52, read.item("minecraft:quartz_block", 1, "§rModul 52"));
- inv.setItem(all_modules_menu, 53, read.item("minecraft:quartz_block", 1, "§rModul 53"));
- for(i = 0; i < 54; i++) {
- item = inv.getItem(all_modules_menu, i);
- time = tjr.getModulTime(player, i);
- if(time == -1) {
- item.addLore(item, 0, "-");
- } else {
- item.addLore(item, 0, time.getClockString(time / 1000));
- }
- }
- checkpoints = list.new();
- //Start
- list.add(checkpoints, loc.new(gamesworld, 3939, 52, -5882, 180, 0.0001));
- //1.Modul
- list.add(checkpoints, loc.new(gamesworld, 3924, 62, -5908, 90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3914, 60, -5915, 180, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3927, 78, -5921, -90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3934, 92, -5909, 90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3924, 92, -5894, 0.0001, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3940, 101, -5888, 180, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3943, 108, -5909, -90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3948, 117, -5919, 180, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3933, 118, -5920, 90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3946, 122, -5928, 0.0001, 0.0001));
- //11.Modul
- list.add(checkpoints, loc.new(gamesworld, 3934, 127, -5926, -90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3942, 150, -5924, 90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3931, 143, -5924, 90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3914, 92, -5928, 90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3913, 98, -5915, 0.0001, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3911, 136, -5915, 0.0001, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3930, 152, -5892, -90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3940, 159, -5905, 180, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3919, 161, -5906, 0.0001, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3919, 162, -5896, 0.0001, 0.0001));
- //21.Modul
- list.add(checkpoints, loc.new(gamesworld, 3923, 163, -5923, 90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3923, 175, -5915, 0.0001, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3916, 165, -5911, -90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3928, 168, -5912, -90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3933, 171, -5903, -90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3942, 141, -5889, 180, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3944, 137, -5903, 90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3929, 125, -5898, -90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3925, 110, -5892, 180, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3934, 88, -5937, 180, 0.0001));
- //31.Modul
- list.add(checkpoints, loc.new(gamesworld, 3936, 84, -5935, 180, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3933, 83, -5950, 180, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3927, 83, -5954, 90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3919, 75, -5950, 180, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3923, 52, -5950, 90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3921, 55, -5957, 180, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3927, 55, -5949, 0.0001, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3943, 61, -5949, 180, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3914, 52, -5943, 0.0001, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3912, 92, -5941, -90, 0.0001));
- //41.Modul
- list.add(checkpoints, loc.new(gamesworld, 3924, 104, -5943, 180, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3917, 115, -5950, -90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3933, 100, -5949, -90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3959, 55, -5948, -90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3973, 63, -5956, -90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3976, 55, -5963, 180, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3963, 70, -5967, -90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3996, 77, -5971, 90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3987, 88, -5951, 180, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3970, 91, -5955, 90, 0.0001));
- //51.Modul
- list.add(checkpoints, loc.new(gamesworld, 3986, 103, -5965, -90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3980, 73, -5945, 90, 0.0001));
- list.add(checkpoints, loc.new(gamesworld, 3963, 87, -5952, 180, 0.0001));
- //Finish
- list.add(checkpoints, loc.new(gamesworld, 3965, 101, -5970, 0.0001, 0.0001));
- spawnlocs = list.new();
- for(i = 0; i < list.getSize(checkpoints); i++) {
- location1 = list.getIndex(checkpoints, i);
- location2 = loc.mod(location1, 1, 1, 1);
- list.add(spawnlocs, loc.mod(location1, 0.5, 0, 0.5));
- if(i == 0) {
- continue; //Für Start keinen Move-Bereich erstellen
- }
- event.addMoveData(location1, location2, 3, -1, player);
- }
- gamename = "§cJR-Death";
- player.blockCommands(player);
- resetplayer(player);
- player.setGamemode(player, "adventure");
- tjr.setMode(player, "whole");
- gosub("stage_specific");
- display.add(player, 0, gamename);
- stacks.set(player, 8, "km:gear");
- stacks.setActive(player, true);
- sgoto(20, "loop");
- goto("wait");
- @block_click
- cancel = false;
- if(block_loc == loc.new(gamesworld, 3939, 102, -5887) || block_loc == loc.new(gamesworld, 3947, 102, -5889)) {
- player.giveItem(player, angel);
- player.giveItem(player, angel);
- player.giveItem(player, angel);
- player.giveItem(player, angel);
- goto("wait");
- }
- if(block_loc == loc.new(gamesworld, 3949, 123, -5927)) {
- player.giveItem(player, bow);
- player.giveItem(player, arrow);
- goto("wait");
- }
- goto("wait");
- @player_toss
- if(jumpstage != 43) {
- cancel = true;
- living.setEquip(player, "hand", item);
- inv.update(player);
- }
- goto("wait");
- @function_key
- if(key == 9) {
- inv.open(mode_menu, player, "Wähle einen Modus");
- }
- mode = tjr.getMode();
- if(mode == "whole") {
- if(key == 1) {
- living.setHealth(player, 20);
- tjr.teleportModule(player, jumpstage);
- entity.setBurning(player, 0);
- goto("wait");
- }
- if(key == 2) {
- living.setHealth(player, 20);
- jumpstage = 0;
- tjr.setStarttime();
- tjr.setWholeTimeTemp(player, 0);
- tjr.setWholeModuleTemp(player, 0);
- tjr.teleportModule(player, jumpstage);
- entity.setBurning(player, 0);
- }
- goto("wait");
- }
- if(mode == "fly") {
- if(key == 1) {
- living.setHealth(player, 20);
- jumpstage = 0;
- tjr.setStarttime();
- tjr.teleportModule(player, jumpstage);
- entity.setBurning(player, 0);
- }
- goto("wait");
- }
- if(mode == "modul") {
- if(key == 1) {
- living.setHealth(player, 20);
- tjr.setStarttime();
- tjr.teleportModule(player, jumpstage);
- entity.setBurning(player, 0);
- goto("wait");
- }
- if(key == 8) {
- inv.open(all_modules_menu, player, "Wähle ein Modul");
- }
- }
- goto("wait");
- @inv_click
- if(inv_id == inv_id_mode) {
- mode = tjr.getMode();
- if(mode == "whole") {
- tjr.leaveWholeMode(player);
- }
- if(inv_slot == 0) {
- tjr.setMode(player, "whole");
- goto("wait");
- }
- if(inv_slot == 1) {
- tjr.setMode(player, "modul");
- goto("wait");
- }
- if(inv_slot == 2) {
- tjr.setMode(player, "fly");
- }
- goto("wait");
- }
- if(inv_id == inv_id_modules) {
- jumpstage = inv_slot;
- tjr.teleportModule(player, jumpstage);
- gosub("stage_specific");
- inv.update(player);
- tjr.setStarttime();
- display.add(player, 2, concat("Dein Rekord: §e", time.getClockString(tjr.getModulTime(player, jumpstage) / 1000)));
- }
- goto("wait");
- @entity_click
- @block_break
- @block_place
- cancel = true;
- goto("wait");
- @player_post_respawn
- entity.teleport(player, list.getIndex(spawnlocs, jumpstage));
- goto("wait");
- @living_pre_hurt
- damage_type = damage.getType(damage_source);
- if(damage_type == "lava") {
- ++lavacounter;
- if(lavacounter >= 8) {
- lavacounter = 0;
- mode = tjr.getMode();
- scheduler.setBurning(10, player, 0);
- if(mode == "fly") {
- goto("wait");
- }
- key = 1;
- goto("function_key");
- }
- goto("wait");
- }
- if(damage_type == "fall") {
- if(jumpstage == 11 || jumpstage == 13) {
- goto("wait");
- }
- cancel = true;
- goto("wait");
- }
- if(damage_type == "arrow") {
- if(jumpstage == 30) {
- goto("wait");
- }
- cancel = true;
- }
- goto("wait");
- @player_move
- player_loc = entity.getLocation(player);
- x = loc.getCoord(player_loc, "bx");
- y = loc.getCoord(player_loc, "by");
- z = loc.getCoord(player_loc, "bz");
- loc = loc.new(gamesworld, x, y, z);
- mode = tjr.getMode();
- tjr.setEndtime();
- time = endtime - starttime;
- if(mode == "fly") {
- new_jumpstage = list.getIndexOf(checkpoints, loc);
- if(new_jumpstage > jumpstage) {
- jumpstage = new_jumpstage;
- gosub("stage_specific");
- }
- if(jumpstage == 54) {
- old_time = tjr.getFlyTime(player);
- if(old_time == -1 || time < old_time) {
- tjr.setFlyTime(player, time);
- msg.prefix(player, gamename, concat("Neuer Rekord: ", time.getClockString(time / 1000)));
- } else {
- msg.prefix(player, gamename, concat("Zeit: ", time.getClockString(time / 1000)));
- }
- }
- goto("wait");
- }
- if(mode == "modul") {
- new_jumpstage = list.getIndexOf(checkpoints, loc);
- if(new_jumpstage != jumpstage + 1) {
- goto("wait");
- }
- old_time = tjr.getModulTime(player, jumpstage);
- if(old_time == -1 || time < old_time) {
- tjr.setModulTime(player, jumpstage, time);
- time_string = time.getClockString(time / 1000);
- msg.prefix(player, gamename, concat("Neuer Rekord: ", time_string));
- item = inv.getItem(all_modules_menu, jumpstage);
- item.addLore(item, 0, time_string);
- jumpstage++;
- } else {
- msg.prefix(player, gamename, concat("Zeit: ", time.getClockString(time / 1000)));
- }
- tjr.setStarttime();
- tjr.teleportModule(player, jumpstage);
- goto("wait");
- }
- if(mode == "whole") {
- new_jumpstage = list.getIndexOf(checkpoints, loc);
- if(new_jumpstage <= jumpstage) {
- goto("wait");
- }
- jumpstage = new_jumpstage;
- gosub("stage_specific");
- player.action(player, "§aCheckpoint gesetzt");
- //Alltime first try or already done?
- old_modules = tjr.getWholeModule(player);
- if(old_modules == 54) {
- alltime_first_try = false;
- } else {
- alltime_first_try = true;
- }
- player_id = player.getId(player);
- time = tjr.getWholeTimeTemp(player) + time;
- if(jumpstage < 54) {
- msg.prefix(player, "§4Dr. Septimus", concat("Frohes Scheitern im ", text.number(jumpstage), ". Modul"));
- if(alltime_first_try) {
- ranking.setSecPoints(rankingtable, player_id, jumpstage, time);
- }
- goto("wait");
- }
- if(jumpstage == 54) {
- msg.prefix(player, gamename, concat("Zeit: ", time.getClockString(time / 1000)));
- if(alltime_first_try) {
- ranking.setSecPoints(rankingtable, player_id, jumpstage, time);
- goto("wait");
- }
- //Neuer Rekord?
- old_time = tjr.getWholeTime(player);
- if(old_time == 0 || time < old_time) {
- ranking.setSecPoints(rankingtable, player_id, jumpstage, time);
- msg.prefix(player, gamename, "Neuer Rekord!!!");
- }
- }
- }
- goto("wait");
- @stage_specific
- player.clearInventory(player);
- if(jumpstage == 6) {
- player.giveItem(player, angel);
- player.giveItem(player, angel);
- player.giveItem(player, angel);
- player.giveItem(player, angel);
- }
- elseif(jumpstage == 10 || jumpstage == 41 || jumpstage == 48 || jumpstage == 44) {
- player.giveItem(player, bow);
- player.giveItem(player, arrow);
- }
- elseif(jumpstage == 6 || jumpstage == 11 || jumpstage == 42 || jumpstage == 49) {
- player.clearInventory(player);
- }
- elseif(jumpstage == 28 || jumpstage == 29) {
- block.set(loc.new(gamesworld, 3944, 122, -5905), "minecraft:lever[powered=false,facing=west,face=wall]");
- block.set(loc.new(gamesworld, 3946, 122, -5905), "minecraft:air");
- block.set(loc.new(gamesworld, 3946, 122, -5905), "minecraft:redstone_wire");
- }
- elseif(jumpstage == 30) {
- block.addItem(loc.new(gamesworld, 3929, 92, -5935), read.item("minecraft:arrow", 576));
- }
- elseif(jumpstage == 43) {
- block.addItem(loc.new(gamesworld, 3932, 106, -5947), read.item("minecraft:hay_block", 576));
- }
- elseif(jumpstage == 47) {
- block.set(loc.new(gamesworld, 3968, 77, -5962), "minecraft:lever[powered=true,facing=north,face=wall]");
- entity.removeAll("net.minecraft.entity.projectile.ArrowEntity", loc.new(gamesworld, 3980, 77, -5960), 5);
- entity.removeAll("net.minecraft.entity.projectile.ArrowEntity", loc.new(gamesworld, 3981, 77, -5955), 5);
- }
- return;
- @loop
- player = player.get(single_uuid);
- seconds++;
- if(seconds == 60) {
- minutes++;
- seconds = 0;
- }
- if(seconds < 10) {
- display.add(player, 5, concat("Zeit: §e", text.number(minutes), ":0", text.number(seconds)));
- } else {
- display.add(player, 5, concat("Zeit: §e", text.number(minutes), ":", text.number(seconds)));
- }
- player.setHunger(player, 20);
- player.setSaturation(player, 5);
- sgoto(20, "loop");
- goto("wait");
- @player_logout
- @player_giveup
- player.setGamemode(player, "survival");
- player.unblockCommands(player);
- minigame.statsHeader(player, gamename, "§e");
- minigame.statsLine(player, "§e", "Module geschafft", concat(text.number(tjr.getWholeModule(player) - 1), " / 53"));
- minigame.statsLine(player, "§e", "Ganzer Run", time.getClockString(tjr.getWholeTime(player) / 1000));
- minigame.statsLine(player, "§e", "Fly-Mode", time.getClockString(tjr.getFlyTime(player) / 1000));
- all_module_time = tjr.getAllModulTime(player);
- if(all_module_time == -1) {
- minigame.statsLine(player, "§e", "Modul-Mode", "-");
- } else {
- minigame.statsLine(player, "§e", "Modul-Mode", time.getClockString(all_module_time / 1000));
- }
- mode = tjr.getMode();
- if(mode == "whole") {
- tjr.leaveWholeMode(player);
- }
- script = script.getFromId(script_id);
- minigame.kickPlayer(script, player);
- minigame.term(script, gamesignloc);
- term();
- function tjr.leaveWholeMode(player) {
- tjr.setWholeModuleTemp(player, $jumpstage);
- tjr.setEndtime();
- tjr.setWholeTimeTemp(player, tjr.getWholeTimeTemp(player) + $endtime - $starttime);
- }
- //Setzt die Zeit, für den Whole-Modi (THIS RUN)
- function tjr.setWholeTimeTemp(player_or_id, time) {
- config = playerdata.getGames(player_or_id);
- config.set(config, "tjr.wholetimetemp", time);
- config.saveAsync(config);
- }
- function tjr.getWholeTimeTemp(player_or_id) {
- config = playerdata.getGames(player_or_id);
- return config.getDouble(config, "tjr.wholetimetemp", 0);
- }
- //Setzt das erreichte Modul für den Whole-Modi (ALLTIME)
- function tjr.setWholeModule(player_or_id, modul) {
- if(isPlayer(player_or_id)) {
- player_or_id = player.getId(player_or_id);
- }
- ranking.setPoints($rankingtable, player_or_id, modul);
- }
- //Setzt das erreichte Modul für den Whole-Modi (THIS RUN)
- function tjr.setWholeModuleTemp(player_or_id, jumpstage) {
- config = playerdata.getGames(player_or_id);
- config.set(config, "tjr.wholetimemodule", jumpstage);
- config.saveAsync(config);
- }
- function tjr.getWholeModuleTemp(player_or_id) {
- config = playerdata.getGames(player_or_id);
- return config.getDouble(config, "tjr.wholetimemodule", 0);
- }
- function tjr.getAllModulTime(player) {
- sum_time = 0;
- for(i = 0; i < 54; i++) {
- time = tjr.getModulTime(player, i);
- if(time == -1) {
- sum_time = -1;
- break;
- }
- sum_time += time;
- }
- return sum_time;
- }
- //Setzt die Zeit, für den Fly-Modi
- function tjr.setFlyTime(player_or_id, time) {
- config = playerdata.getGames(player_or_id);
- config.set(config, "tjr.flytime", time);
- config.saveAsync(config);
- }
- function tjr.getFlyTime(player_or_id) {
- config = playerdata.getGames(player_or_id);
- return config.getDouble(config, "tjr.flytime", -1);
- }
- //Setzt die Zeit, für den Modul-Modi
- function tjr.setModulTime(player_or_id, module, time) {
- config = playerdata.getGames(player_or_id);
- config.set(config, concat("tjr.modultime", text.number(module)), time);
- config.saveAsync(config);
- }
- function tjr.getModulTime(player_or_id, module) {
- config = playerdata.getGames(player_or_id);
- return config.getDouble(config, concat("tjr.modultime", text.number(module)), -1);
- }
- //Teleportiert zu einem Checkpoint
- function tjr.teleportModule(player, jumpstage) {
- entity.teleport(player, list.getIndex($spawnlocs, jumpstage));
- }
- function tjr.setMode(player, mode) {
- if(mode == "fly") {
- player.setFly(player, true);
- type = "Modus: §eFly";
- stacks.set(player, 0, "km:return_red");
- stacks.clearIndex(player, 1);
- stacks.clearIndex(player, 7);
- $jumpstage = 0;
- display.add(player, 2, concat("Dein Rekord: §e", time.getClockString(tjr.getFlyTime(player) / 1000)));
- tjr.setStarttime();
- } elseif(mode == "whole") {
- player.setFly(player, false);
- type = "Modus: §eGanzer Run";
- stacks.set(player, 0, "km:refresh_red");
- stacks.set(player, 1, "km:return_red");
- stacks.clearIndex(player, 7);
- display.add(player, 2, concat("Dein Rekord: §e", time.getClockString(tjr.getWholeTime(player) / 1000)));
- $jumpstage = tjr.getWholeModuleTemp(player);
- old_time = tjr.getWholeTimeTemp(player);
- time = old_time / 1000;
- $minutes = math.roundDown(time / 60);
- $seconds = math.round(time % 60);
- $starttime = time.getMillis() - time;
- } elseif(mode == "modul") {
- player.setFly(player, false);
- type = "Modus: §eModul";
- stacks.set(player, 0, "km:refresh_red");
- stacks.set(player, 7, "minecraft:paper");
- stacks.clearIndex(player, 1);
- $jumpstage = 0;
- display.add(player, 2, concat("Dein Rekord: §e", time.getClockString(tjr.getModulTime(player, $jumpstage) / 1000)));
- tjr.setStarttime();
- }
- tjr.teleportModule(player, $jumpstage);
- display.add(player, 1, type);
- $mode = mode;
- }
- function tjr.getMode() {
- return $mode;
- }
- function tjr.setStarttime() {
- $minutes = 0;
- $seconds = 0;
- $starttime = time.getMillis();
- }
- function tjr.setEndtime() {
- $endtime = time.getMillis();
- }
|