Преглед изворни кода

removed player_name and player.speak

mloeschenkohl пре 2 година
родитељ
комит
96dd218d76

+ 0 - 0
minigames/maedn/maedn.txt → Archiv/minigames/maedn/maedn.txt


+ 0 - 0
minigames/maedn/maednmap1.txt → Archiv/minigames/maedn/maednmap1.txt


+ 2 - 13
minigames/bedwars/bedwars.txt

@@ -62,6 +62,7 @@ gosub("setstart");
 goto("simplelobby");
 
 @specificLobbyHandling
+player_name = player.getName(player);
 if(event == "player_join") {
 	list.add(waiters, player.getName(player));
 	resetplayer(player);
@@ -69,7 +70,6 @@ if(event == "player_join") {
 	return;
 }
 if(event == "player_logout" || event == "player_giveup") {
-	player_name = player.getName(player);
 	list.remove(waiters, player_name);
 	if(map.get(players, player_name) != null) {
 		teamlist = map.get(teamidtolist, map.get(players, player_name));
@@ -295,6 +295,7 @@ if(event == "living_pre_hurt" || event == "living_death") {
 	player = living_entity;
 }
 if(player.hasMinigameId(player, script_id)) {
+	player_name = player.getName(player);
 	ignoreGoto(event);
 }
 goto("checkgame");
@@ -695,7 +696,6 @@ goto("checkgame");
 
 @player_giveup
 @player_logout
-player_name = player.getName(player);
 minigame.speakAll(gamename, concat(map.get(colorcodes, map.get(players, player_name)), player_name, " §ehas left the game."));
 tempteam = map.get(players, player_name);
 teamlist = map.get(teamidtolist, tempteam);
@@ -711,11 +711,6 @@ if(!checkPlayability(tempteam)) {
 goto("checkgame");
 
 @living_pre_hurt
-if(!isPlayer(living_entity)) {
-	goto("checkgame");
-}
-player = living_entity;
-player_name = player.getName(player);
 cancel = true;
 tempplayerteam = map.get(players, player_name);
 tempcolor = map.get(colorcodes, tempplayerteam);
@@ -736,14 +731,8 @@ if(sec_player != null) {
 goto("checkgame");
 
 @living_death
-if(!isPlayer(living_entity)) {
-	goto("checkgame");
-}
-player = living_entity;
-player_name = player.getName(player);
 map.add(deaths, player_name, map.get(deaths, player_name) + 1);
 player.clearInventory(player);
-
 tempmap = map.get(lastdamagers, player);
 if(tempmap != null) {
 	nowtime = time.getMillis();

+ 8 - 8
minigames/capturetheflag/capturetheflag.txt

@@ -110,7 +110,7 @@ map.remove(players, player_name);
 return;
 
 @finalstart
-player.speak("all", gamename, "§rDas Spiel läuft.");
+minigame.speakAll(gamename, "§rDas Spiel läuft.");
 size = list.getSize(all);
 block.setSign(gamesignloc, 2, concat(text.number(size), "/", text.number(maxplayers)));
 block.setSign(gamesignloc, 3, "§6Läuft");
@@ -213,7 +213,7 @@ tempteamstring = map.get(flagcarrier, player_name);
 map.add(flagcarrier, player_name, null);
 player_loc = entity.getLocation(player);
 item.drop(player_loc, map.get(itembanner, tempteamstring));
-player.speak("all", gamename, concat("§rDie ", map.get(teamcolortext, tempteamstring), " §rFlagge wurde gedroppt."));
+minigame.speakAll(gamename, concat("§rDie ", map.get(teamcolortext, tempteamstring), " §rFlagge wurde gedroppt."));
 map.add(flagat, tempteamstring, "§rGedroppt");
 map.add(flagatloc, tempteamstring, player_loc);
 display.add("all", list.getIndexOf(allteams, tempteamstring) + 1, concat(map.get(teamcolortext2, tempteamstring), " Flagge: ", map.get(flagat, tempteamstring)));
@@ -273,7 +273,7 @@ if(item.getType(tempstack) == "minecraft:air") {
 		goto("checkgame");
 	}
 	tempteamstring2 = map.get(flagcarrier, player_name);
-	player.speak("all", gamename, concat("§rDie ", map.get(teamcolortext, tempteamstring2), " Flagge §rwurde von ", map.get(colorcodes, tempteamstring), "Team ", map.get(teamcolortext2, tempteamstring), " §rerobert"));
+	minigame.speakAll(gamename, concat("§rDie ", map.get(teamcolortext, tempteamstring2), " Flagge §rwurde von ", map.get(colorcodes, tempteamstring), "Team ", map.get(teamcolortext2, tempteamstring), " §rerobert"));
 	block.set2(moveloc, "standing_banner", map.get(flagdirection, moveloc), concat("{Base:", map.get(flagcolors, moveloc), "}"));
 	living.setEquip(player, "head", air_item);
 	map.add(flagcarrier, player_name, null);
@@ -362,7 +362,7 @@ event.addLoc(blueflagloc);
 setVar("blueflagat", "§rBase");
 setVar("blueflagatloc", blueflagloc);
 sb.add("all", 97, concat("§9Blaue Flagge: ", blueflagat));
-player.speak("all", "§3CTF", "§rDie §9blaue §rFlagge ist wieder in ihrer Base.");
+minigame.speakAll("§3CTF", "§rDie §9blaue §rFlagge ist wieder in ihrer Base.");
 goto("setbluecompassnew");
 
 @getblueflag
@@ -395,19 +395,19 @@ block.clone(redcopyflagloc, redflagloc);
 setVar("redflagat", "§rBase");
 setVar("redflagatloc", redflagloc);
 sb.add("all", 96, concat("§cRote Flagge: ", redflagat));
-player.speak("all", "§3CTF", "§rDie §crote §rFlagge ist wieder in der Base.");
+minigame.speakAll("§3CTF", "§rDie §crote §rFlagge ist wieder in der Base.");
 setCompassNew(tempteamstring);
 goto("checkgame");*/
 
 @pickupflag
 if(map.get(flagcarrier, player_name) != null) {
-	player.speak(player, gamename, "§rDu trägst bereits eine Flagge");
+	msg.prefix(player, gamename, "§rDu trägst bereits eine Flagge.");
 	block.set2(moveloc, "standing_banner", map.get(flagdirection, moveloc), concat("{Base:", map.get(flagcolors, moveloc), "}"));
 	goto("checkgame");
 }
 tempteamstring2 = map.get(players, player_name);
 color = map.get(colorcodes, tempteamstring2);
-player.speak("all", gamename, concat(color, player_name, "§r trägt die ", map.get(teamcolortext, tempteamstring), " §rFlagge"));
+minigame.speakAll(gamename, concat(color, player_name, "§r trägt die ", map.get(teamcolortext, tempteamstring), " §rFlagge"));
 living.setEquip(player, "head", map.get(itembanner, tempteamstring));
 map.add(flagcarrier, player_name, tempteamstring);
 map.add(flagat, tempteamstring, concat(color, player_name));
@@ -430,7 +430,7 @@ setVar("colortext", "§crote");
 goto("wincore");
 
 @wincore
-player.speak("all", "§3CTF", "§rDas ", colortext, "§r Team hat gewonnen!");
+minigame.speakAll("§3CTF", concat("§rDas ", colortext, "§r Team hat gewonnen!"));
 for(i = 0; i < list.getSize(all); i++) {
 	p = list.getIndex(all, i);
 	p_name = player.getName(p);

+ 2 - 2
minigames/fastbridge/fastbridge.txt

@@ -78,7 +78,7 @@ if(event == "player_logout" || event == "player_giveup") {
 	removeFromPoints(player.getUuid(player));
 	script = script.getFromId(script_id);
 	minigame.kickPlayer(script, player);
-	minigame.speakAll(gamename, concat(player_name, " §rhas left the game."));
+	minigame.speakAll(gamename, concat(player.getName(player), " §rhas left the game."));
 	if(list.getSize(player_list) < minplayers) {
 		p = player.get(list.getIndex(player_list, 0));
 		wincore(p);
@@ -179,7 +179,7 @@ goto("checkgame");
 @player_giveup
 script = script.getFromId(script_id);
 minigame.kickPlayer(script, player);
-minigame.speakAll(gamename, concat(player_name, " §rhas left the game."));
+minigame.speakAll(gamename, concat(player.getName(player), " §rhas left the game."));
 if(list.getSize(player_list) < minplayers) {
 	p = player.get(list.getIndex(player_list, 0));
 	wincore(p);

+ 2 - 2
minigames/jumpnrun/icejumpnrun.txt

@@ -117,7 +117,7 @@ goto("wait");
 @command
 if(list.contains(notallowed, toLowerCase(command))) {
 	cancel = true;
-	player.speak(player, "§6Commands", "§rDie wichtigste Regel im Wettkampf: Sabotage!");
+	msg.prefix(player, "§6Commands", "§rDie wichtigste Regel im Wettkampf: Sabotage!");
 }
 goto("wait");
 
@@ -157,7 +157,7 @@ loc = loc.new(gamesworld, x, y, z);
 index = list.getIndexOf(checkpoints, loc);
 if(index > jumpstage) {
 	player.action(player, "§aCheckpoint gesetzt");
-	player.speak(player, "§6Commands", "§r", text.number(index), ".Checkpoint erreicht");
+	msg.prefix(player, "§6Commands", concat("§r", text.number(index), ".Checkpoint erreicht"));
 	jumpstage = index;
 	gosub("stage_specific");
 }

+ 1 - 2
minigames/knockfight/knockfight.txt

@@ -55,6 +55,7 @@ if(event == "living_hurt") {
 	player = living_entity;
 }
 if(player.hasMinigameId(player, script_id)) {
+	player_name = player.getName(player);
 	ignoreGoto(event);
 }
 goto("checkgame");
@@ -66,7 +67,6 @@ goto("checkgame");
 
 @living_hurt
 player_uuid = player.getUuid(player);
-player_name = player.getName(player);
 damage_type = damage.getType(damage_source);
 if(damage_type == "player") {
 	sec_player = player.getFromDamageSource(damage_source);
@@ -166,7 +166,6 @@ goto("checkgame");
 
 @player_giveup
 @player_logout
-player_name = player.getName(player);
 minigame.speakAll(gamename, concat("§6", player_name, " §rhas left the game."));
 @leavegame
 script = script.getFromId(script_id);

+ 1 - 0
minigames/ragemode/ragemode.txt

@@ -176,6 +176,7 @@ if(event == "living_pre_hurt") {
 	player = shooter;
 }
 if(player.hasMinigameId(player, script_id)) {
+	player_name = player.getName(player);
 	ignoreGoto(event);
 }
 goto("wait");

+ 1 - 1
minigames/rebuild/rebuild.txt

@@ -30,7 +30,7 @@ if(list.getSize(player_list) == 1) {
 	singleteam = true;
 	for(i = 0; i < list.getSize(player_list); i++) {
 		p = player.get(list.getIndex(player_list, i));
-		player.speak(p, gamename, "Singleteam. Not ranked");
+		msg.prefix(p, gamename, "Singleteam. Not ranked");
 	}
 } else {
 	singleteam = false;

+ 1 - 2
minigames/snowgame/snowgame.txt

@@ -168,6 +168,7 @@ if(event == "projectile_hit") {
 	player = shooter;
 }
 if(player.hasMinigameId(player, script_id)) {
+	player_name = player.getName(player);
 	ignoreGoto(event);
 }
 goto("checkgame");
@@ -205,7 +206,6 @@ goto("checkgame");
 
 @projectile_hit
 if(entity_hit != null) {
-	player_name = player.getName(shooter);
 	if(!isPlayer(entity_hit)) {
 		goto("checkgame");
 	}
@@ -305,7 +305,6 @@ goto("checkgame");
 
 @player_giveup
 @player_logout
-player_name = player.getName(player);
 team = map.get(players, player_name);
 color = map.get(colorcodes, team);
 minigame.speakAll(gamename, concat(color, player_name, " §ehas left the game."));

+ 17 - 17
system/copyisland.txt

@@ -50,7 +50,7 @@ if(command == "copyisland" || command == "ci") {
 	}
 	size = list.getSize(args);
 	if(size == 0) {
-		player.speak(player, "§3CopyIsland", "/copyisland");
+		msg.prefix(player, "§3CopyIsland", "/copyisland");
 		msg(player, "§3 - copy §rSpeichert die Player-Location relativ zur Auswahl");
 		msg(player, "§3 - paste §rKopiert relativ zur Location, an der 'copy' ausgeführt wurde");
 		msg(player, "§3 - pos1 §rSetzt Pos1 auf deine aktuelle Position");
@@ -59,7 +59,7 @@ if(command == "copyisland" || command == "ci") {
 	}
 	arg0 = list.getIndex(args, 0);
 	if(!isTheCloningPlayer(player_id)) {
-		player.speak(player, "§3CopyIsland", "Copyisland wird von ", player.getNameFromId(cloningplayer), " verwendet");
+		msg.prefix(player, "§3CopyIsland", concat("Copyisland wird von ", player.getNameFromId(cloningplayer), " verwendet."));
 		goto("wait");
 	}
 	if(arg0 == "pos1") {
@@ -74,7 +74,7 @@ if(command == "copyisland" || command == "ci") {
 	}
 	if(arg0 == "air") {
 		if(world1 == null || world2 == null) {
-			player.speak(player, "§3CopyIsland", "Auswahl inkorrekt");
+			msg.prefix(player, "§3CopyIsland", "Auswahl inkorrekt.");
 			goto("wait");
 		}
 		if(x1 > x2) {
@@ -100,8 +100,8 @@ if(command == "copyisland" || command == "ci") {
 		//Zeitberechnung
 		volume = x_length * y_length * z_length; //Volumen des ausgewählten Bereichs (oder Anzahl der Blöcke)
 		calc_time = math.round((volume / 30000) * 1.633);
-		player.speak(player, "§3CopyIsland", "§r", text.number(volume), " §eBlöcke werden gesetzt");
-		player.speak(player, "§3CopyIsland", "§3Geschätzte Dauer: §r", text.number(calc_time), "§e Sekunden");
+		msg.prefix(player, "§3CopyIsland", concat("§r", text.number(volume), " §eBlöcke werden gesetzt."));
+		msg.prefix(player, "§3CopyIsland", concat("§3Geschätzte Dauer: §r", text.number(calc_time), "§e Sekunden."));
 		start_time = time.getMillis();
 
 		x1 = math.roundDown(x1 / 16) * 16;
@@ -131,9 +131,9 @@ if(command == "copyisland" || command == "ci") {
 			}
 		}
 
-		player.speak(player, "§3CopyIsland", "§3Done: §r", text.number(counter), "§e blocks affected");
+		msg.prefix(player, "§3CopyIsland", concat("§3Done: §r", text.number(counter), "§e blocks affected."));
 		end_time = time.getMillis();
-		player.speak(player, "§3CopyIsland", "§3Benötigte Zeit: §r", text.number(math.round(((end_time - start_time) / 1000))), "§e Sekunden");
+		msg.prefix(player, "§3CopyIsland", concat("§3Benötigte Zeit: §r", text.number(math.round(((end_time - start_time) / 1000))), "§e Sekunden."));
 		cloningplayer = null;
 		x1 = null;
 		y1 = null;
@@ -147,20 +147,20 @@ if(command == "copyisland" || command == "ci") {
 	}
 	if(arg0 == "copy") {
 		if(world1 == null || world2 == null) {
-			player.speak(player, "§3CopyIsland", "Auswahl inkorrekt");
+			msg.prefix(player, "§3CopyIsland", "Auswahl inkorrekt.");
 			goto("wait");
 		}
 		from_loc = entity.getLocation(player);
-		player.speak(player, "§3CopyIsland", "§rBereit zum Kopieren");
+		msg.prefix(player, "§3CopyIsland", "§rBereit zum Kopieren.");
 		goto("wait");
 	}
 	if(arg0 == "paste") {
 		if(world1 == null || world2 == null) {
-			player.speak(player, "§3CopyIsland", "Auswahl inkorrekt");
+			msg.prefix(player, "§3CopyIsland", "Auswahl inkorrekt.");
 			goto("wait");
 		}
 		if(from_loc == null) {
-			player.speak(player, "§3CopyIsland", "Zuerst die Location relativ zur Auswahl setzen /ci copy");
+			msg.prefix(player, "§3CopyIsland", "Zuerst die Location relativ zur Auswahl setzen /ci copy.");
 			goto("wait");
 		}
 		
@@ -188,8 +188,8 @@ if(command == "copyisland" || command == "ci") {
 		//Zeitberechnung
 		volume = x_length * y_length * z_length; //Volumen des ausgewählten Bereichs (oder Anzahl der Blöcke)
 		calc_time = math.round((volume / 30000) * 1.633);
-		player.speak(player, "§3CopyIsland", "§r", text.number(volume), " §eBlöcke werden kopiert");
-		player.speak(player, "§3CopyIsland", "§3Geschätzte Dauer: §r", text.number(calc_time), "§e Sekunden");
+		msg.prefix(player, "§3CopyIsland", concat("§r", text.number(volume), " §eBlöcke werden kopiert."));
+		msg.prefix(player, "§3CopyIsland", concat("§3Geschätzte Dauer: §r", text.number(calc_time), "§e Sekunden."));
 		start_time = time.getMillis();
 
 		//Distanzen zwischen Spieler-Loc von /copy und 1.Block der kopiert wird
@@ -217,9 +217,9 @@ if(command == "copyisland" || command == "ci") {
 			}
 		}
 
-		player.speak(player, "§3CopyIsland", "§3Done: §r", text.number(counter), "§e blocks affected");
+		msg.prefix(player, "§3CopyIsland", concat("§3Done: §r", text.number(counter), "§e blocks affected."));
 		end_time = time.getMillis();
-		player.speak(player, "§3CopyIsland", "§3Benötigte Zeit: §r", text.number(math.round(((end_time - start_time) / 1000))), "§e Sekunden");
+		msg.prefix(player, "§3CopyIsland", concat("§3Benötigte Zeit: §r", text.number(math.round(((end_time - start_time) / 1000))), "§e Sekunden."));
 		cloningplayer = null;
 		x1 = null;
 		y1 = null;
@@ -240,7 +240,7 @@ function setPos1(player_id, location) {
 	$y1 = loc.getCoord(location, "by");
 	$z1 = loc.getCoord(location, "bz");
 	$world1 = loc.getWorld(location);
-	player.speak($player, "§3CopyIsland", concat("§3Pos1: ", text.number($x1), ", ", text.number($y1), ", ", text.number($z1))); 
+	msg.prefix($player, "§3CopyIsland", concat("§3Pos1: ", text.number($x1), ", ", text.number($y1), ", ", text.number($z1))); 
 	return;
 }
 
@@ -249,7 +249,7 @@ function setPos2(player_id, location) {
 	$y2 = loc.getCoord(location, "by");
 	$z2 = loc.getCoord(location, "bz");
 	$world2 = loc.getWorld(location);
-	player.speak($player, "§3CopyIsland", concat("§3Pos2: ", text.number($x2), ", ", text.number($y2), ", ", text.number($z2))); 
+	msg.prefix($player, "§3CopyIsland", concat("§3Pos2: ", text.number($x2), ", ", text.number($y2), ", ", text.number($z2))); 
 	return;
 }
 

+ 12 - 0
system/doors.txt

@@ -58,8 +58,14 @@ if(block.hasTag(auto_door_tag, block) && action == "right") {
 		goto("wait");
 	}
 	if(player_spec) {
+<<<<<<< HEAD
 		if(!map.contains(orig_value_map, block_loc)) {
 			map.add(orig_value_map, block_loc, open_value);
+=======
+		if(!map.contains(orig_state, block_loc)) {
+			state = block.property.getValue(block_loc, open_prop);
+			map.add(orig_state, block_loc, state);
+>>>>>>> 3e293d2b6f5529ad01878a4b118fac96fef572ff
 		}
 		list.add(doors, block_loc);
 		sgoto(60, "closedoor");
@@ -112,6 +118,7 @@ function door.open(location) {
 		}
 		block.property.setBool(half_loc, $open_prop, true);
 	}
+<<<<<<< HEAD
 	//sound
 	block = block.get(location);
 	if(block.hasTag($doors_tag, block)) {
@@ -120,6 +127,11 @@ function door.open(location) {
 		sound.spawn(location, $open_trapdoor_sound, $block_sound_category);
 	} elseif(block.hasTag($fencegates_tag, block)) {
 		sound.spawn(location, $open_fencegate_sound, $block_sound_category);
+=======
+	map.remove(orig_state, doorloc);
+	if(block.property.getValue(doorloc, open_prop) != state) {
+		//TODO
+>>>>>>> 3e293d2b6f5529ad01878a4b118fac96fef572ff
 	}
 }
 

+ 0 - 1
system/gamecenter.txt

@@ -69,7 +69,6 @@ minigame.addSign("invertingsign3", true, loc.new(gamesworld, -396, 158, -55), "m
 minigame.addSign("invertingclsign1", true, loc.new(gamesworld, -396, 157, -57), "minigames/inverting/inverting", "minigames/inverting/invertingclmap1", true);
 minigame.addSign("invertingclsign2", true, loc.new(gamesworld, -396, 157, -56), "minigames/inverting/inverting", "minigames/inverting/invertingclmap2", true);
 minigame.addSign("invertingclsign3", true, loc.new(gamesworld, -396, 157, -55), "minigames/inverting/inverting", "minigames/inverting/invertingclmap3", true);
-//minigame.addSign("maednsign1", false, loc.new(gamesworld, -401, 157, -72), "minigames/maedn/maedn", "minigames/maedn/maednmap1", false);
 //minigame.addSign("ctfsign1", false, loc.new(gamesworld, 13, 75, 64), "minigames/capturetheflag/capturetheflag", "minigames/capturetheflag/ctfmap1", false);
 minigame.addSign("jrmap", true, loc.new(gamesworld, -396, 158, -51), "minigames/jumpnrun/jumpnrun", "minigames/jumpnrun/jumpnrun", true);
 minigame.addSign("parcoursign1", true, loc.new(gamesworld, -396, 158, -50), "minigames/parcour/parcour", "minigames/parcour/parcour_map1", true);

+ 1 - 1
system/survival.txt

@@ -1050,7 +1050,7 @@ if(isPlayer(living_entity)) {
 				temp = math.random(1, 5);
 			}
 			if(temp == 1) {
-				item.drop(loc, player.getHead(player.getUuid(player), player_name));
+				item.drop(loc, player.getHead(player.getUuid(player), player.getName(player)));
 			}
 		}
 	}

+ 2 - 2
utils/u_games.txt

@@ -174,10 +174,10 @@ if(started) {
 		counterindex = 5;
 		minigame.speakAll(gamename, "Left time reduced to §b5 §rseconds.");
 	} else {
-		player.speak(player, gamename, "Left time can't be reduced.");
+		msg.prefix(player, gamename, "Left time can't be reduced.");
 	}
 } else {
-	player.speak(player, gamename, "Game is not starting.");
+	msg.prefix(player, gamename, "Game is not starting.");
 }
 return;
 

+ 1 - 1
utils/u_general.txt

@@ -3128,7 +3128,7 @@ function setRank(player_or_id, rank) {
 
 function offerRank(player, tech_name) {
 	rank = rank.getFromTechName(tech_name);
-	player.speak(player, "§6Commands", "New rank available: ", text.hover(text.click(concat("[§", rank, "§r]"), concat("/setrank ", player.getName(player), " &", rank)), "Click to set"));
+	msg(player, "§r[§6Commands§r] New rank available: ", text.hover(text.click(concat("[§", rank, "§r]"), concat("/setrank ", player.getName(player), " &", rank)), "Click to set"));
 }
 
 function rank.offerClan(clan_id, tech_name) {