mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-11 08:08:50 -04:00
Use TntWarsConfig, cleanup tnt wars gui code.
This commit is contained in:
parent
b548011beb
commit
abddf8ffbe
@ -23,16 +23,17 @@ using MCGalaxy.Maths;
|
|||||||
namespace MCGalaxy.Gui {
|
namespace MCGalaxy.Gui {
|
||||||
public partial class PropertyWindow : Form {
|
public partial class PropertyWindow : Form {
|
||||||
System.Timers.Timer lavaUpdateTimer;
|
System.Timers.Timer lavaUpdateTimer;
|
||||||
|
TntWarsGame tw_selected;
|
||||||
|
|
||||||
private void LoadLavaSettings() {
|
void LoadLavaSettings() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveLavaSettings() {
|
void SaveLavaSettings() {
|
||||||
Server.lava.SaveSettings();
|
Server.lava.SaveSettings();
|
||||||
SaveLavaMapSettings();
|
SaveLavaMapSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateLavaControls() {
|
void UpdateLavaControls() {
|
||||||
try {
|
try {
|
||||||
ls_btnStartGame.Enabled = !Server.lava.active;
|
ls_btnStartGame.Enabled = !Server.lava.active;
|
||||||
ls_btnStopGame.Enabled = Server.lava.active;
|
ls_btnStopGame.Enabled = Server.lava.active;
|
||||||
@ -42,22 +43,22 @@ namespace MCGalaxy.Gui {
|
|||||||
catch { }
|
catch { }
|
||||||
}
|
}
|
||||||
|
|
||||||
private void lsBtnStartGame_Click(object sender, EventArgs e) {
|
void lsBtnStartGame_Click(object sender, EventArgs e) {
|
||||||
if (!Server.lava.active) Server.lava.Start();
|
if (!Server.lava.active) Server.lava.Start();
|
||||||
UpdateLavaControls();
|
UpdateLavaControls();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void lsBtnStopGame_Click(object sender, EventArgs e) {
|
void lsBtnStopGame_Click(object sender, EventArgs e) {
|
||||||
if (Server.lava.active) Server.lava.Stop();
|
if (Server.lava.active) Server.lava.Stop();
|
||||||
UpdateLavaControls();
|
UpdateLavaControls();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void lsBtnEndRound_Click(object sender, EventArgs e) {
|
void lsBtnEndRound_Click(object sender, EventArgs e) {
|
||||||
if (Server.lava.roundActive) Server.lava.EndRound();
|
if (Server.lava.roundActive) Server.lava.EndRound();
|
||||||
UpdateLavaControls();
|
UpdateLavaControls();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateLavaMapList(bool useList = true, bool noUseList = true) {
|
void UpdateLavaMapList(bool useList = true, bool noUseList = true) {
|
||||||
if (!useList && !noUseList) return;
|
if (!useList && !noUseList) return;
|
||||||
try {
|
try {
|
||||||
if (this.InvokeRequired) {
|
if (this.InvokeRequired) {
|
||||||
@ -92,7 +93,7 @@ namespace MCGalaxy.Gui {
|
|||||||
catch (Exception ex) { Logger.LogError(ex); }
|
catch (Exception ex) { Logger.LogError(ex); }
|
||||||
}
|
}
|
||||||
|
|
||||||
private void lsAddMap_Click(object sender, EventArgs e) {
|
void lsAddMap_Click(object sender, EventArgs e) {
|
||||||
try {
|
try {
|
||||||
Server.lava.Stop(); // Doing this so we don't break something...
|
Server.lava.Stop(); // Doing this so we don't break something...
|
||||||
UpdateLavaControls();
|
UpdateLavaControls();
|
||||||
@ -127,7 +128,7 @@ namespace MCGalaxy.Gui {
|
|||||||
catch (Exception ex) { Logger.LogError(ex); }
|
catch (Exception ex) { Logger.LogError(ex); }
|
||||||
}
|
}
|
||||||
|
|
||||||
private void lsRemoveMap_Click(object sender, EventArgs e) {
|
void lsRemoveMap_Click(object sender, EventArgs e) {
|
||||||
try {
|
try {
|
||||||
Server.lava.Stop(); // Doing this so we don't break something...
|
Server.lava.Stop(); // Doing this so we don't break something...
|
||||||
UpdateLavaControls();
|
UpdateLavaControls();
|
||||||
@ -154,7 +155,7 @@ namespace MCGalaxy.Gui {
|
|||||||
catch (Exception ex) { Logger.LogError(ex); }
|
catch (Exception ex) { Logger.LogError(ex); }
|
||||||
}
|
}
|
||||||
|
|
||||||
private void lsMapUse_SelectedIndexChanged(object sender, EventArgs e) {
|
void lsMapUse_SelectedIndexChanged(object sender, EventArgs e) {
|
||||||
SaveLavaMapSettings();
|
SaveLavaMapSettings();
|
||||||
if (ls_lstUsed.SelectedIndex == -1) {
|
if (ls_lstUsed.SelectedIndex == -1) {
|
||||||
ls_grpMapSettings.Text = "Map settings";
|
ls_grpMapSettings.Text = "Map settings";
|
||||||
@ -180,13 +181,13 @@ namespace MCGalaxy.Gui {
|
|||||||
Server.lava.SaveMapSettings(props.m);
|
Server.lava.SaveMapSettings(props.m);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void lsBtnEndVote_Click(object sender, EventArgs e) {
|
void lsBtnEndVote_Click(object sender, EventArgs e) {
|
||||||
if (Server.lava.voteActive) Server.lava.EndVote();
|
if (Server.lava.voteActive) Server.lava.EndVote();
|
||||||
UpdateLavaControls();
|
UpdateLavaControls();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadTNTWarsTab(object sender, EventArgs e) {
|
public void LoadTNTWarsTab(object sender, EventArgs e) {
|
||||||
if ( TntWarsGame.GuiLoaded == null ) {
|
if (tw_selected == null) {
|
||||||
//Clear all
|
//Clear all
|
||||||
//Top
|
//Top
|
||||||
SlctdTntWrsLvl.Text = "";
|
SlctdTntWrsLvl.Text = "";
|
||||||
@ -266,15 +267,15 @@ namespace MCGalaxy.Gui {
|
|||||||
else {
|
else {
|
||||||
//Load settings
|
//Load settings
|
||||||
//Top
|
//Top
|
||||||
SlctdTntWrsLvl.Text = TntWarsGame.GuiLoaded.lvl.name;
|
SlctdTntWrsLvl.Text = tw_selected.lvl.name;
|
||||||
if ( TntWarsGame.GuiLoaded.GameStatus == TntWarsGame.TntWarsGameStatus.WaitingForPlayers ) tw_txtStatus.Text = "Waiting For Players";
|
if (tw_selected.GameStatus == TntWarsGame.TntWarsGameStatus.WaitingForPlayers) tw_txtStatus.Text = "Waiting For Players";
|
||||||
if ( TntWarsGame.GuiLoaded.GameStatus == TntWarsGame.TntWarsGameStatus.AboutToStart ) tw_txtStatus.Text = "Starting";
|
if (tw_selected.GameStatus == TntWarsGame.TntWarsGameStatus.AboutToStart) tw_txtStatus.Text = "Starting";
|
||||||
if ( TntWarsGame.GuiLoaded.GameStatus == TntWarsGame.TntWarsGameStatus.GracePeriod ) tw_txtStatus.Text = "Started";
|
if (tw_selected.GameStatus == TntWarsGame.TntWarsGameStatus.GracePeriod) tw_txtStatus.Text = "Started";
|
||||||
if ( TntWarsGame.GuiLoaded.GameStatus == TntWarsGame.TntWarsGameStatus.InProgress ) tw_txtStatus.Text = "In Progress";
|
if (tw_selected.GameStatus == TntWarsGame.TntWarsGameStatus.InProgress) tw_txtStatus.Text = "In Progress";
|
||||||
if ( TntWarsGame.GuiLoaded.GameStatus == TntWarsGame.TntWarsGameStatus.Finished ) tw_txtStatus.Text = "Finished";
|
if (tw_selected.GameStatus == TntWarsGame.TntWarsGameStatus.Finished) tw_txtStatus.Text = "Finished";
|
||||||
tw_txtPlayers.Text = TntWarsGame.GuiLoaded.PlayingPlayers().ToString(CultureInfo.InvariantCulture);
|
tw_txtPlayers.Text = tw_selected.PlayingPlayers().ToString(CultureInfo.InvariantCulture);
|
||||||
//Difficulty
|
//Difficulty
|
||||||
if ( TntWarsGame.GuiLoaded.GameStatus == TntWarsGame.TntWarsGameStatus.WaitingForPlayers ) {
|
if (tw_selected.GameStatus == TntWarsGame.TntWarsGameStatus.WaitingForPlayers) {
|
||||||
TntWrsDiffCombo.Enabled = true;
|
TntWrsDiffCombo.Enabled = true;
|
||||||
TntWrsDiffSlctBt.Enabled = true;
|
TntWrsDiffSlctBt.Enabled = true;
|
||||||
}
|
}
|
||||||
@ -282,50 +283,50 @@ namespace MCGalaxy.Gui {
|
|||||||
TntWrsDiffCombo.Enabled = false;
|
TntWrsDiffCombo.Enabled = false;
|
||||||
TntWrsDiffSlctBt.Enabled = false;
|
TntWrsDiffSlctBt.Enabled = false;
|
||||||
}
|
}
|
||||||
TntWrsDiffCombo.SelectedIndex = TntWrsDiffCombo.FindString(TntWarsGame.GuiLoaded.Difficulty.ToString());
|
TntWrsDiffCombo.SelectedIndex = TntWrsDiffCombo.FindString(tw_selected.Difficulty.ToString());
|
||||||
//scores
|
//scores
|
||||||
tw_numScoreLimit.Value = TntWarsGame.GuiLoaded.ScoreLimit;
|
tw_numScoreLimit.Value = tw_selected.ScoreLimit;
|
||||||
tw_numScoreLimit.Enabled = true;
|
tw_numScoreLimit.Enabled = true;
|
||||||
tw_numScorePerKill.Value = TntWarsGame.GuiLoaded.ScorePerKill;
|
tw_numScorePerKill.Value = tw_selected.Config.ScorePerKill;
|
||||||
tw_numScorePerKill.Enabled = true;
|
tw_numScorePerKill.Enabled = true;
|
||||||
if ( TntWarsGame.GuiLoaded.ScorePerAssist == 0 ) {
|
if (tw_selected.Config.AssistScore == 0) {
|
||||||
tw_cbScoreAssists.Checked = false;
|
tw_cbScoreAssists.Checked = false;
|
||||||
tw_cbScoreAssists.Enabled = true;
|
tw_cbScoreAssists.Enabled = true;
|
||||||
tw_numScoreAssists.Enabled = false;
|
tw_numScoreAssists.Enabled = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
tw_numScoreAssists.Value = TntWarsGame.GuiLoaded.ScorePerAssist;
|
tw_numScoreAssists.Value = tw_selected.Config.AssistScore;
|
||||||
tw_numScoreAssists.Enabled = true;
|
tw_numScoreAssists.Enabled = true;
|
||||||
tw_cbScoreAssists.Checked = true;
|
tw_cbScoreAssists.Checked = true;
|
||||||
tw_cbScoreAssists.Enabled = true;
|
tw_cbScoreAssists.Enabled = true;
|
||||||
}
|
}
|
||||||
if ( TntWarsGame.GuiLoaded.MultiKillBonus == 0 ) {
|
if (tw_selected.Config.MultiKillBonus == 0) {
|
||||||
tw_cbMultiKills.Checked = false;
|
tw_cbMultiKills.Checked = false;
|
||||||
tw_cbMultiKills.Enabled = true;
|
tw_cbMultiKills.Enabled = true;
|
||||||
tw_numMultiKills.Enabled = false;
|
tw_numMultiKills.Enabled = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
tw_numMultiKills.Value = TntWarsGame.GuiLoaded.MultiKillBonus;
|
tw_numMultiKills.Value = tw_selected.Config.MultiKillBonus;
|
||||||
tw_numMultiKills.Enabled = true;
|
tw_numMultiKills.Enabled = true;
|
||||||
tw_cbMultiKills.Checked = true;
|
tw_cbMultiKills.Checked = true;
|
||||||
tw_cbMultiKills.Enabled = true;
|
tw_cbMultiKills.Enabled = true;
|
||||||
}
|
}
|
||||||
//Grace period
|
//Grace period
|
||||||
TntWrsGracePrdChck.Checked = TntWarsGame.GuiLoaded.GracePeriod;
|
TntWrsGracePrdChck.Checked = tw_selected.Config.InitialGracePeriod;
|
||||||
TntWrsGracePrdChck.Enabled = true;
|
TntWrsGracePrdChck.Enabled = true;
|
||||||
TntWrsGraceTimeChck.Value = TntWarsGame.GuiLoaded.GracePeriodSecs;
|
TntWrsGraceTimeChck.Value = tw_selected.Config.GracePeriodSeconds;
|
||||||
TntWrsGraceTimeChck.Enabled = TntWarsGame.GuiLoaded.GracePeriod;
|
TntWrsGraceTimeChck.Enabled = tw_selected.Config.InitialGracePeriod;
|
||||||
//Teams
|
//Teams
|
||||||
TntWrsTmsChck.Checked = TntWarsGame.GuiLoaded.GameMode == TntWarsGame.TntWarsGameMode.TDM;
|
TntWrsTmsChck.Checked = tw_selected.GameMode == TntWarsGame.TntWarsGameMode.TDM;
|
||||||
TntWrsTmsChck.Enabled = true;
|
TntWrsTmsChck.Enabled = true;
|
||||||
tw_cbBalanceTeams.Checked = TntWarsGame.GuiLoaded.BalanceTeams;
|
tw_cbBalanceTeams.Checked = tw_selected.Config.BalanceTeams;
|
||||||
tw_cbBalanceTeams.Enabled = true;
|
tw_cbBalanceTeams.Enabled = true;
|
||||||
tw_cbTeamKills.Checked = TntWarsGame.GuiLoaded.TeamKills;
|
tw_cbTeamKills.Checked = tw_selected.Config.TeamKills;
|
||||||
tw_cbTeamKills.Enabled = true;
|
tw_cbTeamKills.Enabled = true;
|
||||||
//Status
|
//Status
|
||||||
switch ( TntWarsGame.GuiLoaded.GameStatus ) {
|
switch (tw_selected.GameStatus) {
|
||||||
case TntWarsGame.TntWarsGameStatus.WaitingForPlayers:
|
case TntWarsGame.TntWarsGameStatus.WaitingForPlayers:
|
||||||
if ( TntWarsGame.GuiLoaded.CheckAllSetUp(null, false, false) ) tw_btnStartGame.Enabled = true;
|
if (tw_selected.CheckAllSetUp(null, false, false)) tw_btnStartGame.Enabled = true;
|
||||||
tw_btnEndGame.Enabled = false;
|
tw_btnEndGame.Enabled = false;
|
||||||
tw_btnResetGame.Enabled = false;
|
tw_btnResetGame.Enabled = false;
|
||||||
tw_btnDeleteGame.Enabled = true;
|
tw_btnDeleteGame.Enabled = true;
|
||||||
@ -349,7 +350,7 @@ namespace MCGalaxy.Gui {
|
|||||||
|
|
||||||
}
|
}
|
||||||
//Other
|
//Other
|
||||||
tw_cbStreaks.Checked = TntWarsGame.GuiLoaded.Config.Streaks;
|
tw_cbStreaks.Checked = tw_selected.Config.Streaks;
|
||||||
tw_cbStreaks.Enabled = true;
|
tw_cbStreaks.Enabled = true;
|
||||||
//New game
|
//New game
|
||||||
if (TntWrsMpsList.SelectedIndex < 0) TntWrsCrtNwTntWrsBt.Enabled = false;
|
if (TntWrsMpsList.SelectedIndex < 0) TntWrsCrtNwTntWrsBt.Enabled = false;
|
||||||
@ -364,7 +365,7 @@ namespace MCGalaxy.Gui {
|
|||||||
else {
|
else {
|
||||||
TntWarsGame T = TntWarsGame.Find(lvl);
|
TntWarsGame T = TntWarsGame.Find(lvl);
|
||||||
string msg = "";
|
string msg = "";
|
||||||
if ( T == TntWarsGame.GuiLoaded ) { msg += "--> "; }
|
if (T == tw_selected) { msg += "--> "; }
|
||||||
msg += lvl.name + " - ";
|
msg += lvl.name + " - ";
|
||||||
if (T.GameMode == TntWarsGame.TntWarsGameMode.FFA) msg += "FFA";
|
if (T.GameMode == TntWarsGame.TntWarsGameMode.FFA) msg += "FFA";
|
||||||
if (T.GameMode == TntWarsGame.TntWarsGameMode.TDM) msg += "TDM";
|
if (T.GameMode == TntWarsGame.TntWarsGameMode.TDM) msg += "TDM";
|
||||||
@ -413,14 +414,14 @@ namespace MCGalaxy.Gui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private bool TntWarsEditable(object sender, EventArgs e) {
|
private bool TntWarsEditable(object sender, EventArgs e) {
|
||||||
return TntWarsGame.GuiLoaded.GameStatus == TntWarsGame.TntWarsGameStatus.WaitingForPlayers;
|
return tw_selected.GameStatus == TntWarsGame.TntWarsGameStatus.WaitingForPlayers;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void tabControl2_Click(object sender, EventArgs e) {
|
void tabControl2_Click(object sender, EventArgs e) {
|
||||||
LoadTNTWarsTab(sender, e);
|
LoadTNTWarsTab(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EditTntWarsGameBT_Click(object sender, EventArgs e) {
|
void EditTntWarsGameBT_Click(object sender, EventArgs e) {
|
||||||
try {
|
try {
|
||||||
string slctd = tw_lstGames.Items[tw_lstGames.SelectedIndex].ToString();
|
string slctd = tw_lstGames.Items[tw_lstGames.SelectedIndex].ToString();
|
||||||
if (slctd.StartsWith("-->")) {
|
if (slctd.StartsWith("-->")) {
|
||||||
@ -428,17 +429,17 @@ namespace MCGalaxy.Gui {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
string[] split = slctd.Split(new string[] { " - " }, StringSplitOptions.None);
|
string[] split = slctd.Split(new string[] { " - " }, StringSplitOptions.None);
|
||||||
TntWarsGame.GuiLoaded = TntWarsGame.Find(LevelInfo.FindExact(split[0]));
|
tw_selected = TntWarsGame.Find(LevelInfo.FindExact(split[0]));
|
||||||
LoadTNTWarsTab(sender, e);
|
LoadTNTWarsTab(sender, e);
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TntWrsMpsList_SelectedIndexChanged(object sender, EventArgs e) {
|
void TntWrsMpsList_SelectedIndexChanged(object sender, EventArgs e) {
|
||||||
TntWrsCrtNwTntWrsBt.Enabled = TntWrsMpsList.SelectedIndex >= 0;
|
TntWrsCrtNwTntWrsBt.Enabled = TntWrsMpsList.SelectedIndex >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TntWrsCrtNwTntWrsBt_Click(object sender, EventArgs e) {
|
void TntWrsCrtNwTntWrsBt_Click(object sender, EventArgs e) {
|
||||||
TntWarsGame it = null;
|
TntWarsGame it = null;
|
||||||
try {
|
try {
|
||||||
it = new TntWarsGame(LevelInfo.FindExact(TntWrsMpsList.Items[TntWrsMpsList.SelectedIndex].ToString()));
|
it = new TntWarsGame(LevelInfo.FindExact(TntWrsMpsList.Items[TntWrsMpsList.SelectedIndex].ToString()));
|
||||||
@ -446,122 +447,122 @@ namespace MCGalaxy.Gui {
|
|||||||
catch { }
|
catch { }
|
||||||
if (it == null) return;
|
if (it == null) return;
|
||||||
TntWarsGame.GameList.Add(it);
|
TntWarsGame.GameList.Add(it);
|
||||||
TntWarsGame.GuiLoaded = it;
|
tw_selected = it;
|
||||||
LoadTNTWarsTab(sender, e);
|
LoadTNTWarsTab(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TntWrsDiffSlctBt_Click(object sender, EventArgs e) {
|
void TntWrsDiffSlctBt_Click(object sender, EventArgs e) {
|
||||||
if ( TntWarsGame.GuiLoaded == null ) return;
|
if (tw_selected == null) return;
|
||||||
switch (TntWrsDiffCombo.Items[TntWrsDiffCombo.SelectedIndex].ToString()) {
|
switch (TntWrsDiffCombo.Items[TntWrsDiffCombo.SelectedIndex].ToString()) {
|
||||||
case "Easy":
|
case "Easy":
|
||||||
TntWarsGame.GuiLoaded.Difficulty = TntWarsGame.TntWarsDifficulty.Easy;
|
tw_selected.Difficulty = TntWarsGame.TntWarsDifficulty.Easy;
|
||||||
TntWarsGame.GuiLoaded.SendAllPlayersMessage("TNT Wars: Changed difficulty to easy!");
|
tw_selected.SendAllPlayersMessage("TNT Wars: Changed difficulty to easy!");
|
||||||
TntWarsGame.GuiLoaded.TeamKills = false;
|
tw_selected.Config.TeamKills = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "Normal":
|
case "Normal":
|
||||||
TntWarsGame.GuiLoaded.Difficulty = TntWarsGame.TntWarsDifficulty.Normal;
|
tw_selected.Difficulty = TntWarsGame.TntWarsDifficulty.Normal;
|
||||||
TntWarsGame.GuiLoaded.SendAllPlayersMessage("TNT Wars: Changed difficulty to normal!");
|
tw_selected.SendAllPlayersMessage("TNT Wars: Changed difficulty to normal!");
|
||||||
TntWarsGame.GuiLoaded.TeamKills = false;
|
tw_selected.Config.TeamKills = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "Hard":
|
case "Hard":
|
||||||
TntWarsGame.GuiLoaded.Difficulty = TntWarsGame.TntWarsDifficulty.Hard;
|
tw_selected.Difficulty = TntWarsGame.TntWarsDifficulty.Hard;
|
||||||
TntWarsGame.GuiLoaded.SendAllPlayersMessage("TNT Wars: Changed difficulty to hard!");
|
tw_selected.SendAllPlayersMessage("TNT Wars: Changed difficulty to hard!");
|
||||||
TntWarsGame.GuiLoaded.TeamKills = true;
|
tw_selected.Config.TeamKills = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "Extreme":
|
case "Extreme":
|
||||||
TntWarsGame.GuiLoaded.Difficulty = TntWarsGame.TntWarsDifficulty.Extreme;
|
tw_selected.Difficulty = TntWarsGame.TntWarsDifficulty.Extreme;
|
||||||
TntWarsGame.GuiLoaded.SendAllPlayersMessage("TNT Wars: Changed difficulty to extreme!");
|
tw_selected.SendAllPlayersMessage("TNT Wars: Changed difficulty to extreme!");
|
||||||
TntWarsGame.GuiLoaded.TeamKills = true;
|
tw_selected.Config.TeamKills = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
LoadTNTWarsTab(sender, e);
|
LoadTNTWarsTab(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TntWrsScrLmtUpDwn_ValueChanged(object sender, EventArgs e) {
|
void TntWrsScrLmtUpDwn_ValueChanged(object sender, EventArgs e) {
|
||||||
if ( TntWarsGame.GuiLoaded == null ) return;
|
if (tw_selected == null) return;
|
||||||
TntWarsGame.GuiLoaded.ScoreLimit = (int)tw_numScoreLimit.Value;
|
tw_selected.ScoreLimit = (int)tw_numScoreLimit.Value;
|
||||||
LoadTNTWarsTab(sender, e);
|
LoadTNTWarsTab(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TntWrsScrPrKlUpDwn_ValueChanged(object sender, EventArgs e) {
|
void TntWrsScrPrKlUpDwn_ValueChanged(object sender, EventArgs e) {
|
||||||
if ( TntWarsGame.GuiLoaded == null ) return;
|
if (tw_selected == null) return;
|
||||||
TntWarsGame.GuiLoaded.ScorePerKill = (int)tw_numScorePerKill.Value;
|
tw_selected.Config.ScorePerKill = (int)tw_numScorePerKill.Value;
|
||||||
LoadTNTWarsTab(sender, e);
|
LoadTNTWarsTab(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TntWrsAsstChck_CheckedChanged(object sender, EventArgs e) {
|
void TntWrsAsstChck_CheckedChanged(object sender, EventArgs e) {
|
||||||
if ( TntWarsGame.GuiLoaded == null ) return;
|
if (tw_selected == null) return;
|
||||||
if (tw_cbScoreAssists.Checked == false) {
|
if (tw_cbScoreAssists.Checked == false) {
|
||||||
TntWarsGame.GuiLoaded.ScorePerAssist = 0;
|
tw_selected.Config.AssistScore = 0;
|
||||||
tw_numScoreAssists.Enabled = false;
|
tw_numScoreAssists.Enabled = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
TntWarsGame.GuiLoaded.ScorePerAssist = (int)tw_numScoreAssists.Value;
|
tw_selected.Config.AssistScore = (int)tw_numScoreAssists.Value;
|
||||||
tw_numScoreAssists.Enabled = true;
|
tw_numScoreAssists.Enabled = true;
|
||||||
}
|
}
|
||||||
LoadTNTWarsTab(sender, e);
|
LoadTNTWarsTab(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TntWrsAstsScrUpDwn_ValueChanged(object sender, EventArgs e) {
|
void TntWrsAstsScrUpDwn_ValueChanged(object sender, EventArgs e) {
|
||||||
if ( TntWarsGame.GuiLoaded == null ) return;
|
if (tw_selected == null) return;
|
||||||
TntWarsGame.GuiLoaded.ScorePerAssist = (int)tw_numScoreAssists.Value;
|
tw_selected.Config.AssistScore = (int)tw_numScoreAssists.Value;
|
||||||
LoadTNTWarsTab(sender, e);
|
LoadTNTWarsTab(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TntWrsMltiKlChck_CheckedChanged(object sender, EventArgs e) {
|
void TntWrsMltiKlChck_CheckedChanged(object sender, EventArgs e) {
|
||||||
if ( TntWarsGame.GuiLoaded == null ) return;
|
if (tw_selected == null) return;
|
||||||
if (tw_cbMultiKills.Checked == false) {
|
if (tw_cbMultiKills.Checked == false) {
|
||||||
TntWarsGame.GuiLoaded.MultiKillBonus = 0;
|
tw_selected.Config.MultiKillBonus = 0;
|
||||||
tw_numMultiKills.Enabled = false;
|
tw_numMultiKills.Enabled = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
TntWarsGame.GuiLoaded.MultiKillBonus = (int)tw_numMultiKills.Value;
|
tw_selected.Config.MultiKillBonus = (int)tw_numMultiKills.Value;
|
||||||
tw_numMultiKills.Enabled = true;
|
tw_numMultiKills.Enabled = true;
|
||||||
}
|
}
|
||||||
LoadTNTWarsTab(sender, e);
|
LoadTNTWarsTab(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TntWrsMltiKlScPrUpDown_ValueChanged(object sender, EventArgs e) {
|
void TntWrsMltiKlScPrUpDown_ValueChanged(object sender, EventArgs e) {
|
||||||
if ( TntWarsGame.GuiLoaded == null ) return;
|
if (tw_selected == null) return;
|
||||||
TntWarsGame.GuiLoaded.MultiKillBonus = (int)tw_numMultiKills.Value;
|
tw_selected.Config.MultiKillBonus = (int)tw_numMultiKills.Value;
|
||||||
LoadTNTWarsTab(sender, e);
|
LoadTNTWarsTab(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TntWrsGracePrdChck_CheckedChanged(object sender, EventArgs e) {
|
void TntWrsGracePrdChck_CheckedChanged(object sender, EventArgs e) {
|
||||||
if ( TntWarsGame.GuiLoaded == null ) return;
|
if (tw_selected == null) return;
|
||||||
TntWarsGame.GuiLoaded.GracePeriod = TntWrsGracePrdChck.Checked;
|
tw_selected.Config.InitialGracePeriod = TntWrsGracePrdChck.Checked;
|
||||||
LoadTNTWarsTab(sender, e);
|
LoadTNTWarsTab(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TntWrsGraceTimeChck_ValueChanged(object sender, EventArgs e) {
|
void TntWrsGraceTimeChck_ValueChanged(object sender, EventArgs e) {
|
||||||
if ( TntWarsGame.GuiLoaded == null ) return;
|
if (tw_selected == null) return;
|
||||||
TntWarsGame.GuiLoaded.GracePeriodSecs = (int)TntWrsGraceTimeChck.Value;
|
tw_selected.Config.GracePeriodSeconds = (int)TntWrsGraceTimeChck.Value;
|
||||||
LoadTNTWarsTab(sender, e);
|
LoadTNTWarsTab(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TntWrsTmsChck_CheckedChanged(object sender, EventArgs e) {
|
void TntWrsTmsChck_CheckedChanged(object sender, EventArgs e) {
|
||||||
switch (TntWrsTmsChck.Checked) {
|
switch (TntWrsTmsChck.Checked) {
|
||||||
case true:
|
case true:
|
||||||
if ( TntWarsGame.GuiLoaded.GameMode == TntWarsGame.TntWarsGameMode.FFA ) {
|
if (tw_selected.GameMode == TntWarsGame.TntWarsGameMode.FFA) {
|
||||||
TntWarsGame.GuiLoaded.GameMode = TntWarsGame.TntWarsGameMode.TDM;
|
tw_selected.GameMode = TntWarsGame.TntWarsGameMode.TDM;
|
||||||
foreach ( TntWarsGame.player pl in TntWarsGame.GuiLoaded.Players ) {
|
foreach (TntWarsGame.player pl in tw_selected.Players) {
|
||||||
{
|
{
|
||||||
Player.Message(pl.p, "TNT Wars: Changed gamemode to Team Deathmatch");
|
Player.Message(pl.p, "TNT Wars: Changed gamemode to Team Deathmatch");
|
||||||
pl.Red = false;
|
pl.Red = false;
|
||||||
pl.Blue = false;
|
pl.Blue = false;
|
||||||
if ( TntWarsGame.GuiLoaded.BlueTeam() > TntWarsGame.GuiLoaded.RedTeam() ) {
|
if (tw_selected.BlueTeam() > tw_selected.RedTeam()) {
|
||||||
pl.Red = true;
|
pl.Red = true;
|
||||||
}
|
}
|
||||||
else if ( TntWarsGame.GuiLoaded.RedTeam() > TntWarsGame.GuiLoaded.BlueTeam() ) {
|
else if (tw_selected.RedTeam() > tw_selected.BlueTeam()) {
|
||||||
pl.Blue = true;
|
pl.Blue = true;
|
||||||
}
|
}
|
||||||
else if ( TntWarsGame.GuiLoaded.RedScore > TntWarsGame.GuiLoaded.BlueScore ) {
|
else if (tw_selected.RedScore > tw_selected.BlueScore) {
|
||||||
pl.Blue = true;
|
pl.Blue = true;
|
||||||
}
|
}
|
||||||
else if ( TntWarsGame.GuiLoaded.BlueScore > TntWarsGame.GuiLoaded.RedScore ) {
|
else if (tw_selected.BlueScore > tw_selected.RedScore) {
|
||||||
pl.Red = true;
|
pl.Red = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -582,20 +583,20 @@ namespace MCGalaxy.Gui {
|
|||||||
Chat.MessageGlobal(mesg);
|
Chat.MessageGlobal(mesg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( TntWarsGame.GuiLoaded.ScoreLimit == TntWarsGame.Properties.DefaultFFAmaxScore ) {
|
if (tw_selected.ScoreLimit == TntWarsConfig.Default.ScoreMaxFFA) {
|
||||||
TntWarsGame.GuiLoaded.ScoreLimit = TntWarsGame.Properties.DefaultTDMmaxScore;
|
tw_selected.ScoreLimit = TntWarsConfig.Default.ScoreMaxTDM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case false:
|
case false:
|
||||||
if ( TntWarsGame.GuiLoaded.GameMode == TntWarsGame.TntWarsGameMode.TDM ) {
|
if (tw_selected.GameMode == TntWarsGame.TntWarsGameMode.TDM) {
|
||||||
TntWarsGame.GuiLoaded.GameMode = TntWarsGame.TntWarsGameMode.FFA;
|
tw_selected.GameMode = TntWarsGame.TntWarsGameMode.FFA;
|
||||||
TntWarsGame.GuiLoaded.SendAllPlayersMessage("TNT Wars: Changed gamemode to Free For All");
|
tw_selected.SendAllPlayersMessage("TNT Wars: Changed gamemode to Free For All");
|
||||||
if ( TntWarsGame.GuiLoaded.ScoreLimit == TntWarsGame.Properties.DefaultTDMmaxScore ) {
|
if (tw_selected.ScoreLimit == TntWarsConfig.Default.ScoreMaxTDM) {
|
||||||
TntWarsGame.GuiLoaded.ScoreLimit = TntWarsGame.Properties.DefaultFFAmaxScore;
|
tw_selected.ScoreLimit = TntWarsConfig.Default.ScoreMaxFFA;
|
||||||
}
|
}
|
||||||
foreach ( TntWarsGame.player pl in TntWarsGame.GuiLoaded.Players ) {
|
foreach (TntWarsGame.player pl in tw_selected.Players) {
|
||||||
pl.p.color = pl.OldColor;
|
pl.p.color = pl.OldColor;
|
||||||
pl.p.SetPrefix();
|
pl.p.SetPrefix();
|
||||||
}
|
}
|
||||||
@ -604,28 +605,28 @@ namespace MCGalaxy.Gui {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TntWrsBlnceTeamsChck_CheckedChanged(object sender, EventArgs e) {
|
void TntWrsBlnceTeamsChck_CheckedChanged(object sender, EventArgs e) {
|
||||||
if ( TntWarsGame.GuiLoaded == null ) return;
|
if (tw_selected == null) return;
|
||||||
TntWarsGame.GuiLoaded.BalanceTeams = tw_cbBalanceTeams.Checked;
|
tw_selected.Config.BalanceTeams = tw_cbBalanceTeams.Checked;
|
||||||
LoadTNTWarsTab(sender, e);
|
LoadTNTWarsTab(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TntWrsTKchck_CheckedChanged(object sender, EventArgs e) {
|
void TntWrsTKchck_CheckedChanged(object sender, EventArgs e) {
|
||||||
if ( TntWarsGame.GuiLoaded == null ) return;
|
if (tw_selected == null) return;
|
||||||
TntWarsGame.GuiLoaded.TeamKills = tw_cbTeamKills.Checked;
|
tw_selected.Config.TeamKills = tw_cbTeamKills.Checked;
|
||||||
LoadTNTWarsTab(sender, e);
|
LoadTNTWarsTab(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TntWrsStreaksChck_CheckedChanged(object sender, EventArgs e) {
|
void TntWrsStreaksChck_CheckedChanged(object sender, EventArgs e) {
|
||||||
if ( TntWarsGame.GuiLoaded == null ) return;
|
if (tw_selected == null) return;
|
||||||
TntWarsGame.GuiLoaded.Config.Streaks = tw_cbStreaks.Checked;
|
tw_selected.Config.Streaks = tw_cbStreaks.Checked;
|
||||||
LoadTNTWarsTab(sender, e);
|
LoadTNTWarsTab(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TntWrsStrtGame_Click(object sender, EventArgs e) {
|
void TntWrsStrtGame_Click(object sender, EventArgs e) {
|
||||||
if ( TntWarsGame.GuiLoaded == null ) return;
|
if (tw_selected == null) return;
|
||||||
if ( TntWarsGame.GuiLoaded.PlayingPlayers() >= 2 ) {
|
if (tw_selected.PlayingPlayers() >= 2) {
|
||||||
new Thread(TntWarsGame.GuiLoaded.Start).Start();
|
new Thread(tw_selected.Start).Start();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
MessageBox.Show("Not enough players (2 or more needed!)", "More players needed!");
|
MessageBox.Show("Not enough players (2 or more needed!)", "More players needed!");
|
||||||
@ -633,31 +634,31 @@ namespace MCGalaxy.Gui {
|
|||||||
LoadTNTWarsTab(sender, e);
|
LoadTNTWarsTab(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TntWrsEndGame_Click(object sender, EventArgs e) {
|
void TntWrsEndGame_Click(object sender, EventArgs e) {
|
||||||
if ( TntWarsGame.GuiLoaded == null ) return;
|
if (tw_selected == null) return;
|
||||||
foreach ( TntWarsGame.player pl in TntWarsGame.GuiLoaded.Players ) {
|
foreach (TntWarsGame.player pl in tw_selected.Players) {
|
||||||
pl.p.canBuild = true;
|
pl.p.canBuild = true;
|
||||||
pl.p.PlayingTntWars = false;
|
pl.p.PlayingTntWars = false;
|
||||||
pl.p.CurrentAmountOfTnt = 0;
|
pl.p.CurrentAmountOfTnt = 0;
|
||||||
}
|
}
|
||||||
TntWarsGame.GuiLoaded.GameStatus = TntWarsGame.TntWarsGameStatus.Finished;
|
tw_selected.GameStatus = TntWarsGame.TntWarsGameStatus.Finished;
|
||||||
TntWarsGame.GuiLoaded.SendAllPlayersMessage("TNT wars: Game has been stopped!");
|
tw_selected.SendAllPlayersMessage("TNT wars: Game has been stopped!");
|
||||||
LoadTNTWarsTab(sender, e);
|
LoadTNTWarsTab(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TntWrsRstGame_Click(object sender, EventArgs e) {
|
void TntWrsRstGame_Click(object sender, EventArgs e) {
|
||||||
if ( TntWarsGame.GuiLoaded == null ) return;
|
if (tw_selected == null) return;
|
||||||
TntWarsGame.GuiLoaded.GameStatus = TntWarsGame.TntWarsGameStatus.WaitingForPlayers;
|
tw_selected.GameStatus = TntWarsGame.TntWarsGameStatus.WaitingForPlayers;
|
||||||
Command.all.Find("restore").Use(null, TntWarsGame.GuiLoaded.BackupNumber + TntWarsGame.GuiLoaded.lvl.name);
|
Command.all.Find("restore").Use(null, tw_selected.BackupNumber + tw_selected.lvl.name);
|
||||||
TntWarsGame.GuiLoaded.RedScore = 0;
|
tw_selected.RedScore = 0;
|
||||||
TntWarsGame.GuiLoaded.BlueScore = 0;
|
tw_selected.BlueScore = 0;
|
||||||
foreach ( TntWarsGame.player pl in TntWarsGame.GuiLoaded.Players ) {
|
foreach (TntWarsGame.player pl in tw_selected.Players) {
|
||||||
pl.Score = 0;
|
pl.Score = 0;
|
||||||
pl.spec = false;
|
pl.spec = false;
|
||||||
pl.p.TntWarsKillStreak = 0;
|
pl.p.TntWarsKillStreak = 0;
|
||||||
pl.p.TNTWarsLastKillStreakAnnounced = 0;
|
pl.p.TNTWarsLastKillStreakAnnounced = 0;
|
||||||
pl.p.CurrentAmountOfTnt = 0;
|
pl.p.CurrentAmountOfTnt = 0;
|
||||||
pl.p.CurrentTntGameNumber = TntWarsGame.GuiLoaded.GameNumber;
|
pl.p.CurrentTntGameNumber = tw_selected.GameNumber;
|
||||||
pl.p.PlayingTntWars = false;
|
pl.p.PlayingTntWars = false;
|
||||||
pl.p.canBuild = true;
|
pl.p.canBuild = true;
|
||||||
pl.p.TntWarsHealth = 2;
|
pl.p.TntWarsHealth = 2;
|
||||||
@ -668,21 +669,21 @@ namespace MCGalaxy.Gui {
|
|||||||
LoadTNTWarsTab(sender, e);
|
LoadTNTWarsTab(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TntWrsDltGame_Click(object sender, EventArgs e) {
|
void TntWrsDltGame_Click(object sender, EventArgs e) {
|
||||||
if ( TntWarsGame.GuiLoaded == null ) return;
|
if (tw_selected == null) return;
|
||||||
foreach ( TntWarsGame.player pl in TntWarsGame.GuiLoaded.Players ) {
|
foreach (TntWarsGame.player pl in tw_selected.Players) {
|
||||||
pl.p.CurrentTntGameNumber = -1;
|
pl.p.CurrentTntGameNumber = -1;
|
||||||
Player.Message(pl.p, "TNT Wars: The TNT Wars game you are currently playing has been deleted!");
|
Player.Message(pl.p, "TNT Wars: The TNT Wars game you are currently playing has been deleted!");
|
||||||
pl.p.PlayingTntWars = false;
|
pl.p.PlayingTntWars = false;
|
||||||
pl.p.canBuild = true;
|
pl.p.canBuild = true;
|
||||||
TntWarsGame.SetTitlesAndColor(pl, true);
|
TntWarsGame.SetTitlesAndColor(pl, true);
|
||||||
}
|
}
|
||||||
TntWarsGame.GameList.Remove(TntWarsGame.GuiLoaded);
|
TntWarsGame.GameList.Remove(tw_selected);
|
||||||
TntWarsGame.GuiLoaded = null;
|
tw_selected = null;
|
||||||
LoadTNTWarsTab(sender, e);
|
LoadTNTWarsTab(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TntWrsDiffAboutBt_Click(object sender, EventArgs e) {
|
void TntWrsDiffAboutBt_Click(object sender, EventArgs e) {
|
||||||
string msg = "Difficulty:";
|
string msg = "Difficulty:";
|
||||||
msg += Environment.NewLine;
|
msg += Environment.NewLine;
|
||||||
msg += "Easy (2 Hits to die, TNT has long delay)";
|
msg += "Easy (2 Hits to die, TNT has long delay)";
|
||||||
|
@ -77,7 +77,7 @@ namespace MCGalaxy.Gui {
|
|||||||
void PropertyWindow_Unload(object sender, EventArgs e) {
|
void PropertyWindow_Unload(object sender, EventArgs e) {
|
||||||
lavaUpdateTimer.Dispose();
|
lavaUpdateTimer.Dispose();
|
||||||
Window.prevLoaded = false;
|
Window.prevLoaded = false;
|
||||||
TntWarsGame.GuiLoaded = null;
|
tw_selected = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadProperties() {
|
void LoadProperties() {
|
||||||
|
@ -139,7 +139,7 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
case "red":
|
case "red":
|
||||||
case "r":
|
case "r":
|
||||||
case "1":
|
case "1":
|
||||||
if (it.BalanceTeams && red > blue) {
|
if (it.Config.BalanceTeams && red > blue) {
|
||||||
Player.Message(p, "TNT Wars Error: Red has too many players!"); return;
|
Player.Message(p, "TNT Wars Error: Red has too many players!"); return;
|
||||||
}
|
}
|
||||||
pl.Red = true; break;
|
pl.Red = true; break;
|
||||||
@ -147,7 +147,7 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
case "blue":
|
case "blue":
|
||||||
case "b":
|
case "b":
|
||||||
case "2":
|
case "2":
|
||||||
if (it.BalanceTeams && blue > red) {
|
if (it.Config.BalanceTeams && blue > red) {
|
||||||
Player.Message(p, "TNT Wars Error: Blue has too many players!"); return;
|
Player.Message(p, "TNT Wars Error: Blue has too many players!"); return;
|
||||||
}
|
}
|
||||||
pl.Blue = true; break;
|
pl.Blue = true; break;
|
||||||
@ -513,7 +513,7 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (SetBool(p, ref it.GracePeriod, text[2], "Grace period"))
|
if (SetBool(p, ref it.Config.InitialGracePeriod, text[2], "Grace period"))
|
||||||
it.CheckAllSetUp(p);
|
it.CheckAllSetUp(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -530,7 +530,7 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
case "ATM":
|
case "ATM":
|
||||||
case "c":
|
case "c":
|
||||||
case "t":
|
case "t":
|
||||||
Player.Message(p, "TNT Wars: Current grace time is " + it.GracePeriodSecs + " seconds long!");
|
Player.Message(p, "TNT Wars: Current grace time is " + it.Config.GracePeriodSeconds + " seconds long!");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -546,7 +546,7 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
if (numb <= 9) { Player.Message(p, "TNT Wars Error: Grace time cannot be lower than 10 seconds!!"); return; }
|
if (numb <= 9) { Player.Message(p, "TNT Wars Error: Grace time cannot be lower than 10 seconds!!"); return; }
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
it.GracePeriodSecs = numb;
|
it.Config.GracePeriodSeconds = numb;
|
||||||
Player.Message(p, "TNT Wars: Grace period is now " + numb + " seconds long!");
|
Player.Message(p, "TNT Wars: Grace period is now " + numb + " seconds long!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -705,7 +705,7 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
int numb = -1;
|
int numb = -1;
|
||||||
if (!int.TryParse(text[3], out numb))
|
if (!int.TryParse(text[3], out numb))
|
||||||
{ Player.Message(p, "TNT Wars Error: Invalid number '" + text[3] + "'"); return; }
|
{ Player.Message(p, "TNT Wars Error: Invalid number '" + text[3] + "'"); return; }
|
||||||
if (numb <= it.ScorePerKill) { Player.Message(p, "TNT Wars Error: Minimum score limit of " + it.ScorePerKill + " points"); return; }
|
if (numb <= it.Config.ScorePerKill) { Player.Message(p, "TNT Wars Error: Minimum score limit of " + it.Config.ScorePerKill + " points"); return; }
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
it.ScoreLimit = numb;
|
it.ScoreLimit = numb;
|
||||||
@ -736,7 +736,7 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
case "mk":
|
case "mk":
|
||||||
case "d":
|
case "d":
|
||||||
case "t":
|
case "t":
|
||||||
SetInt(p, it, ref it.ScorePerAssist, TntWarsGame.Properties.DefaultMultiKillBonus,
|
SetInt(p, it, ref it.Config.MultiKillBonus, TntWarsConfig.Default.MultiKillBonus,
|
||||||
text, "Mulitkill bonuses", "Mulitkill bonus per extra kill");
|
text, "Mulitkill bonuses", "Mulitkill bonus per extra kill");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -752,7 +752,7 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
case "ATM":
|
case "ATM":
|
||||||
case "c":
|
case "c":
|
||||||
case "t":
|
case "t":
|
||||||
Player.Message(p, "TNT Wars: Score per kill is " + it.ScorePerKill + " points!");
|
Player.Message(p, "TNT Wars: Score per kill is " + it.Config.ScorePerKill + " points!");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -763,7 +763,7 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
int numb = -1;
|
int numb = -1;
|
||||||
if (!CommandParser.GetInt(p, text[3], "Score per kill", ref numb, 0)) return;
|
if (!CommandParser.GetInt(p, text[3], "Score per kill", ref numb, 0)) return;
|
||||||
|
|
||||||
it.ScorePerKill = numb;
|
it.Config.ScorePerKill = numb;
|
||||||
Player.Message(p, "TNT Wars: Score per kill is now " + numb + " points!");
|
Player.Message(p, "TNT Wars: Score per kill is now " + numb + " points!");
|
||||||
return;
|
return;
|
||||||
//break;
|
//break;
|
||||||
@ -775,7 +775,7 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
case "assists":
|
case "assists":
|
||||||
case "assistscore":
|
case "assistscore":
|
||||||
case "a":
|
case "a":
|
||||||
SetInt(p, it, ref it.ScorePerAssist, TntWarsGame.Properties.DefaultAssistScore,
|
SetInt(p, it, ref it.Config.AssistScore, TntWarsConfig.Default.AssistScore,
|
||||||
text, "Assist bonuses", "Score per assist");
|
text, "Assist bonuses", "Score per assist");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -796,7 +796,7 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
case "balanceteams":
|
case "balanceteams":
|
||||||
case "bt":
|
case "bt":
|
||||||
case "b":
|
case "b":
|
||||||
if (SetBool(p, ref it.BalanceTeams, text[2], "Team balancing"))
|
if (SetBool(p, ref it.Config.BalanceTeams, text[2], "Team balancing"))
|
||||||
it.CheckAllSetUp(p);
|
it.CheckAllSetUp(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -809,7 +809,7 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
case "ff":
|
case "ff":
|
||||||
case "friendlyf":
|
case "friendlyf":
|
||||||
case "ffire":
|
case "ffire":
|
||||||
if (SetBool(p, ref it.TeamKills, text[2], "Team killing"))
|
if (SetBool(p, ref it.Config.TeamKills, text[2], "Team killing"))
|
||||||
it.CheckAllSetUp(p);
|
it.CheckAllSetUp(p);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -888,6 +888,7 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
case "info":
|
case "info":
|
||||||
case "c":
|
case "c":
|
||||||
Player.Message(p, "TNT Wars: Current Setup:");
|
Player.Message(p, "TNT Wars: Current Setup:");
|
||||||
|
TntWarsConfig cfg = it.Config;
|
||||||
//1
|
//1
|
||||||
if (it.lvl == null) { Player.Message(p, "Level: " + Colors.red + "NONE"); }
|
if (it.lvl == null) { Player.Message(p, "Level: " + Colors.red + "NONE"); }
|
||||||
else { Player.Message(p, "Level: " + Colors.green + it.lvl.name); }
|
else { Player.Message(p, "Level: " + Colors.green + it.lvl.name); }
|
||||||
@ -900,32 +901,32 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
if (it.Difficulty == TntWarsGame.TntWarsDifficulty.Hard) { Player.Message(p, "Game difficulty: " + Colors.green + "Hard"); }
|
if (it.Difficulty == TntWarsGame.TntWarsDifficulty.Hard) { Player.Message(p, "Game difficulty: " + Colors.green + "Hard"); }
|
||||||
if (it.Difficulty == TntWarsGame.TntWarsDifficulty.Extreme) { Player.Message(p, "Game difficulty: " + Colors.green + "Extreme"); }
|
if (it.Difficulty == TntWarsGame.TntWarsDifficulty.Extreme) { Player.Message(p, "Game difficulty: " + Colors.green + "Extreme"); }
|
||||||
//4
|
//4
|
||||||
if (it.TntPerPlayerAtATime >= 1) { Player.Message(p, "TNT per player at a time: " + Colors.green + it.TntPerPlayerAtATime); }
|
if (cfg.MaxPlayerActiveTnt >= 1) { Player.Message(p, "TNT per player at a time: " + Colors.green + cfg.MaxPlayerActiveTnt); }
|
||||||
else if (it.TntPerPlayerAtATime == 0) { Player.Message(p, "TNT per player at a time: " + Colors.green + "unlimited"); }
|
else if (cfg.MaxPlayerActiveTnt == 0) { Player.Message(p, "TNT per player at a time: " + Colors.green + "unlimited"); }
|
||||||
//5
|
//5
|
||||||
if (it.GracePeriod) { Player.Message(p, "Grace period: " + Colors.green + "enabled"); }
|
if (cfg.InitialGracePeriod) { Player.Message(p, "Grace period: " + Colors.green + "enabled"); }
|
||||||
if (!it.GracePeriod) { Player.Message(p, "Grace period: " + Colors.green + "disabled"); }
|
if (!cfg.InitialGracePeriod) { Player.Message(p, "Grace period: " + Colors.green + "disabled"); }
|
||||||
//6
|
//6
|
||||||
Player.Message(p, "Grace period time: " + Colors.green + it.GracePeriodSecs + " seconds");
|
Player.Message(p, "Grace period time: " + Colors.green + cfg.GracePeriodSeconds + " seconds");
|
||||||
//7
|
//7
|
||||||
if (it.BalanceTeams) { Player.Message(p, "Balance teams: " + Colors.green + "enabled"); }
|
if (cfg.BalanceTeams) { Player.Message(p, "Balance teams: " + Colors.green + "enabled"); }
|
||||||
if (!it.BalanceTeams) { Player.Message(p, "Balance teams: " + Colors.green + "disabled"); }
|
if (!cfg.BalanceTeams) { Player.Message(p, "Balance teams: " + Colors.green + "disabled"); }
|
||||||
//8
|
//8
|
||||||
Player.Message(p, "Score limit: " + Colors.green + it.ScoreLimit + " points");
|
Player.Message(p, "Score limit: " + Colors.green + it.ScoreLimit + " points");
|
||||||
//9
|
//9
|
||||||
if (it.Config.Streaks) { Player.Message(p, "Streaks: " + Colors.green + "enabled"); }
|
if (cfg.Streaks) { Player.Message(p, "Streaks: " + Colors.green + "enabled"); }
|
||||||
if (!it.Config.Streaks) { Player.Message(p, "Streaks: " + Colors.green + "disabled"); }
|
if (!cfg.Streaks) { Player.Message(p, "Streaks: " + Colors.green + "disabled"); }
|
||||||
//10
|
//10
|
||||||
if (it.MultiKillBonus == 0) { Player.Message(p, "Multikill bonus: " + Colors.green + "disabled"); }
|
if (cfg.MultiKillBonus == 0) { Player.Message(p, "Multikill bonus: " + Colors.green + "disabled"); }
|
||||||
if (it.MultiKillBonus != 0) { Player.Message(p, "Multikill bonus: " + Colors.green + "enabled"); }
|
if (cfg.MultiKillBonus != 0) { Player.Message(p, "Multikill bonus: " + Colors.green + "enabled"); }
|
||||||
//11
|
//11
|
||||||
Player.Message(p, "Score per kill: " + Colors.green + it.ScorePerKill + " points");
|
Player.Message(p, "Score per kill: " + Colors.green + cfg.ScorePerKill + " points");
|
||||||
//12
|
//12
|
||||||
if (it.ScorePerAssist == 0) { Player.Message(p, "Assists: " + Colors.green + "disabled"); }
|
if (cfg.AssistScore == 0) { Player.Message(p, "Assists: " + Colors.green + "disabled"); }
|
||||||
if (it.ScorePerAssist != 0) { Player.Message(p, "Assists : " + Colors.green + "enabled (at " + it.ScorePerAssist + " points)"); }
|
if (cfg.AssistScore != 0) { Player.Message(p, "Assists : " + Colors.green + "enabled (at " + cfg.AssistScore + " points)"); }
|
||||||
//13
|
//13
|
||||||
if (it.TeamKills) { Player.Message(p, "Team killing: " + Colors.green + "enabled"); }
|
if (cfg.TeamKills) { Player.Message(p, "Team killing: " + Colors.green + "enabled"); }
|
||||||
if (!it.TeamKills) { Player.Message(p, "Team killing: " + Colors.green + "disabled"); }
|
if (!cfg.TeamKills) { Player.Message(p, "Team killing: " + Colors.green + "disabled"); }
|
||||||
//14
|
//14
|
||||||
it.CheckAllSetUp(p);
|
it.CheckAllSetUp(p);
|
||||||
//15
|
//15
|
||||||
@ -989,9 +990,9 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
Player.Message(p, "TNT Wars: Changed difficulty to {0}", name);
|
Player.Message(p, "TNT Wars: Changed difficulty to {0}", name);
|
||||||
it.SendAllPlayersMessage("TNT Wars: Changed difficulty to " + name + "!");
|
it.SendAllPlayersMessage("TNT Wars: Changed difficulty to " + name + "!");
|
||||||
|
|
||||||
if (it.TeamKills == teamKill) return;
|
if (it.Config.TeamKills == teamKill) return;
|
||||||
Player.Message(p, "TNT Wars: Team killing is now {0}", teamKill ? "&aon" : "&coff");
|
Player.Message(p, "TNT Wars: Team killing is now {0}", teamKill ? "&aon" : "&coff");
|
||||||
it.TeamKills = teamKill;
|
it.Config.TeamKills = teamKill;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void AssignAutoTeam(TntWarsGame.player pl, TntWarsGame it, int red, int blue) {
|
static void AssignAutoTeam(TntWarsGame.player pl, TntWarsGame it, int red, int blue) {
|
||||||
@ -1028,8 +1029,8 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
Chat.MessageGlobal(msg);
|
Chat.MessageGlobal(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (it.ScoreLimit == TntWarsGame.Properties.DefaultFFAmaxScore) {
|
if (it.ScoreLimit == TntWarsConfig.Default.ScoreMaxFFA) {
|
||||||
it.ScoreLimit = TntWarsGame.Properties.DefaultTDMmaxScore;
|
it.ScoreLimit = TntWarsConfig.Default.ScoreMaxTDM;
|
||||||
Player.Message(p, "TNT Wars: Score limit is now " + it.ScoreLimit + " points!");
|
Player.Message(p, "TNT Wars: Score limit is now " + it.ScoreLimit + " points!");
|
||||||
} else {
|
} else {
|
||||||
Player.Message(p, "TNT Wars: Score limit is still " + it.ScoreLimit + " points!");
|
Player.Message(p, "TNT Wars: Score limit is still " + it.ScoreLimit + " points!");
|
||||||
@ -1043,8 +1044,8 @@ namespace MCGalaxy.Commands.Fun {
|
|||||||
}
|
}
|
||||||
|
|
||||||
it.SendAllPlayersMessage("TNT Wars: Changed gamemode to Free For All");
|
it.SendAllPlayersMessage("TNT Wars: Changed gamemode to Free For All");
|
||||||
if (it.ScoreLimit == TntWarsGame.Properties.DefaultTDMmaxScore) {
|
if (it.ScoreLimit == TntWarsConfig.Default.ScoreMaxTDM) {
|
||||||
it.ScoreLimit = TntWarsGame.Properties.DefaultFFAmaxScore;
|
it.ScoreLimit = TntWarsConfig.Default.ScoreMaxFFA;
|
||||||
Player.Message(p, "TNT Wars: Score limit is now " + it.ScoreLimit + " points!");
|
Player.Message(p, "TNT Wars: Score limit is now " + it.ScoreLimit + " points!");
|
||||||
} else {
|
} else {
|
||||||
Player.Message(p, "TNT Wars: Score limit is still " + it.ScoreLimit + " points!");
|
Player.Message(p, "TNT Wars: Score limit is still " + it.ScoreLimit + " points!");
|
||||||
|
@ -41,27 +41,10 @@ namespace MCGalaxy.Games
|
|||||||
public ushort[] BlueSpawn = null;
|
public ushort[] BlueSpawn = null;
|
||||||
|
|
||||||
public TntWarsConfig Config = new TntWarsConfig();
|
public TntWarsConfig Config = new TntWarsConfig();
|
||||||
//incase they don't want the default
|
|
||||||
public int TntPerPlayerAtATime = Properties.DefaultTntPerPlayerAtATime;
|
|
||||||
public bool GracePeriod = Properties.DefaultGracePeriodAtStart;
|
|
||||||
public int GracePeriodSecs = Properties.DefaultGracePeriodSecs;
|
|
||||||
public bool BalanceTeams = Properties.DefaultBalanceTeams;
|
|
||||||
//scores/streaks
|
//scores/streaks
|
||||||
public int ScoreLimit = Properties.DefaultTDMmaxScore;
|
public int ScoreLimit = TntWarsConfig.Default.ScoreMaxTDM;
|
||||||
public bool Streaks = true;
|
|
||||||
public int MultiKillBonus = Properties.DefaultMultiKillBonus;
|
|
||||||
public int ScorePerKill = Properties.DefaultScorePerKill;
|
|
||||||
public int ScorePerAssist = Properties.DefaultAssistScore;
|
|
||||||
public bool TeamKills = false;
|
|
||||||
public Thread Starter;
|
public Thread Starter;
|
||||||
|
|
||||||
public static TntWarsGame GuiLoaded = null;
|
|
||||||
//======PLUGIN EVENTS======
|
|
||||||
public delegate void Starting(TntWarsGame t);
|
|
||||||
public delegate void Started(TntWarsGame t);
|
|
||||||
public delegate void Death(Player killer, List<Player> deadplayers);
|
|
||||||
public delegate void End(TntWarsGame t);
|
|
||||||
//======PLUGIN EVENTS======
|
|
||||||
public TntWarsGame(Level level)
|
public TntWarsGame(Level level)
|
||||||
{
|
{
|
||||||
Starter = new Thread(Start);
|
Starter = new Thread(Start);
|
||||||
@ -135,7 +118,7 @@ namespace MCGalaxy.Games
|
|||||||
if (Difficulty == TntWarsDifficulty.Easy || Difficulty == TntWarsDifficulty.Normal) p.p.TntWarsHealth = 2;
|
if (Difficulty == TntWarsDifficulty.Easy || Difficulty == TntWarsDifficulty.Normal) p.p.TntWarsHealth = 2;
|
||||||
else p.p.TntWarsHealth = 1;
|
else p.p.TntWarsHealth = 1;
|
||||||
p.p.HarmedBy = null;
|
p.p.HarmedBy = null;
|
||||||
if (GracePeriod)
|
if (Config.InitialGracePeriod)
|
||||||
{
|
{
|
||||||
p.p.canBuild = false;
|
p.p.canBuild = false;
|
||||||
}
|
}
|
||||||
@ -149,7 +132,7 @@ namespace MCGalaxy.Games
|
|||||||
p.p.TNTWarsLastKillStreakAnnounced = 0;
|
p.p.TNTWarsLastKillStreakAnnounced = 0;
|
||||||
SetTitlesAndColor(p);
|
SetTitlesAndColor(p);
|
||||||
}
|
}
|
||||||
if (GracePeriod)
|
if (Config.InitialGracePeriod)
|
||||||
{
|
{
|
||||||
SendAllPlayersMessage("TNT Wars: Disabled building during Grace Period!");
|
SendAllPlayersMessage("TNT Wars: Disabled building during Grace Period!");
|
||||||
}
|
}
|
||||||
@ -200,18 +183,18 @@ namespace MCGalaxy.Games
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
string teamkillling = "Disabled";
|
string teamkillling = "Disabled";
|
||||||
if (TeamKills) teamkillling = "Enabled";
|
if (Config.TeamKills) teamkillling = "Enabled";
|
||||||
Chat.MessageGlobal("&cTNT Wars %Son " + lvl.ColoredName + " %Shas started &3" + Gamemode + " %Swith a difficulty of &3" +
|
Chat.MessageGlobal("&cTNT Wars %Son " + lvl.ColoredName + " %Shas started &3" + Gamemode + " %Swith a difficulty of &3" +
|
||||||
difficulty + " %S(&3" + HitsToDie + " %Shits to die, a &3" + explosiontime +
|
difficulty + " %S(&3" + HitsToDie + " %Shits to die, a &3" + explosiontime +
|
||||||
" %Sexplosion delay and with a &3" + explosionsize + " %Sexplosion size)" +
|
" %Sexplosion delay and with a &3" + explosionsize + " %Sexplosion size)" +
|
||||||
", team killing is &3" + teamkillling + " %Sand you can place &3" + TntPerPlayerAtATime
|
", team killing is &3" + teamkillling + " %Sand you can place &3" + Config.MaxPlayerActiveTnt
|
||||||
+ " %STNT at a time and there is a score limit of &3" + ScoreLimit + "%S!!");
|
+ " %STNT at a time and there is a score limit of &3" + ScoreLimit + "%S!!");
|
||||||
if (GameMode == TntWarsGameMode.TDM) SendAllPlayersMessage("TNT Wars: Start your message with ':' to send it as a team chat!");
|
if (GameMode == TntWarsGameMode.TDM) SendAllPlayersMessage("TNT Wars: Start your message with ':' to send it as a team chat!");
|
||||||
//GracePeriod
|
//GracePeriod
|
||||||
if (GracePeriod) //Check This Grace Stuff
|
if (Config.InitialGracePeriod) //Check This Grace Stuff
|
||||||
{
|
{
|
||||||
GameStatus = TntWarsGameStatus.GracePeriod;
|
GameStatus = TntWarsGameStatus.GracePeriod;
|
||||||
int GracePeriodSecsRemaining = GracePeriodSecs;
|
int GracePeriodSecsRemaining = Config.GracePeriodSeconds;
|
||||||
SendAllPlayersMessage("TNT Wars: Grace Period of &a" + GracePeriodSecsRemaining + " %Sseconds");
|
SendAllPlayersMessage("TNT Wars: Grace Period of &a" + GracePeriodSecsRemaining + " %Sseconds");
|
||||||
while (GracePeriodSecsRemaining > 0)
|
while (GracePeriodSecsRemaining > 0)
|
||||||
{
|
{
|
||||||
@ -272,7 +255,7 @@ namespace MCGalaxy.Games
|
|||||||
p.p.canBuild = true;
|
p.p.canBuild = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (GracePeriod)
|
if (Config.InitialGracePeriod)
|
||||||
{
|
{
|
||||||
SendAllPlayersMessage("TNT Wars: You can now build!!");
|
SendAllPlayersMessage("TNT Wars: You can now build!!");
|
||||||
}
|
}
|
||||||
@ -407,15 +390,15 @@ namespace MCGalaxy.Games
|
|||||||
|
|
||||||
foreach (Player Kld in Killed) {
|
foreach (Player Kld in Killed) {
|
||||||
if (FindPlayer(Kld).spec) continue;
|
if (FindPlayer(Kld).spec) continue;
|
||||||
if (!TeamKills && TeamKill(Killer, Kld)) continue;
|
if (!Config.TeamKills && TeamKill(Killer, Kld)) continue;
|
||||||
|
|
||||||
if (Kld.TntWarsHealth - HealthDamage <= 0)
|
if (Kld.TntWarsHealth - HealthDamage <= 0)
|
||||||
{
|
{
|
||||||
Kld.TntWarsHealth = 0;
|
Kld.TntWarsHealth = 0;
|
||||||
Dead.Add(Kld);
|
Dead.Add(Kld);
|
||||||
if (TeamKills && TeamKill(Killer, Kld))
|
if (Config.TeamKills && TeamKill(Killer, Kld))
|
||||||
{
|
{
|
||||||
minusfromscore += ScorePerKill;
|
minusfromscore += Config.ScorePerKill;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -459,13 +442,13 @@ namespace MCGalaxy.Games
|
|||||||
{
|
{
|
||||||
if (TeamKill(Died.HarmedBy, Died))
|
if (TeamKill(Died.HarmedBy, Died))
|
||||||
{
|
{
|
||||||
Player.Message(Died.HarmedBy, "TNT Wars: - " + ScorePerAssist + " point(s) for team kill assist!");
|
Player.Message(Died.HarmedBy, "TNT Wars: - " + Config.AssistScore + " point(s) for team kill assist!");
|
||||||
ChangeScore(Died.HarmedBy, -ScorePerAssist);
|
ChangeScore(Died.HarmedBy, -Config.AssistScore);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Player.Message(Died.HarmedBy, "TNT Wars: + " + ScorePerAssist + " point(s) for assist!");
|
Player.Message(Died.HarmedBy, "TNT Wars: + " + Config.AssistScore + " point(s) for assist!");
|
||||||
ChangeScore(Died.HarmedBy, ScorePerAssist);
|
ChangeScore(Died.HarmedBy, Config.AssistScore);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Died.HarmedBy = null;
|
Died.HarmedBy = null;
|
||||||
@ -513,11 +496,11 @@ namespace MCGalaxy.Games
|
|||||||
Player.Message(Killer, "TNT Wars: Kill streak of " + Killer.TntWarsKillStreak);
|
Player.Message(Killer, "TNT Wars: Kill streak of " + Killer.TntWarsKillStreak);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AddToScore += kills * ScorePerKill;
|
AddToScore += kills * Config.ScorePerKill;
|
||||||
//multikill
|
//multikill
|
||||||
if (kills > 1)
|
if (kills > 1)
|
||||||
{
|
{
|
||||||
AddToScore += kills * MultiKillBonus;
|
AddToScore += kills * Config.MultiKillBonus;
|
||||||
}
|
}
|
||||||
//Add to score
|
//Add to score
|
||||||
if (AddToScore > 0)
|
if (AddToScore > 0)
|
||||||
@ -814,19 +797,5 @@ namespace MCGalaxy.Games
|
|||||||
it = FindFromGameNumber(p.CurrentTntGameNumber);
|
it = FindFromGameNumber(p.CurrentTntGameNumber);
|
||||||
return it;
|
return it;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Static Stuff
|
|
||||||
public static class Properties
|
|
||||||
{
|
|
||||||
public static bool DefaultGracePeriodAtStart = true;
|
|
||||||
public static int DefaultGracePeriodSecs = 30;
|
|
||||||
public static int DefaultTntPerPlayerAtATime = 1;
|
|
||||||
public static bool DefaultBalanceTeams = true;
|
|
||||||
public static int DefaultFFAmaxScore = 75;
|
|
||||||
public static int DefaultTDMmaxScore = 150;
|
|
||||||
public static int DefaultScorePerKill = 10;
|
|
||||||
public static int DefaultMultiKillBonus = 5;
|
|
||||||
public static int DefaultAssistScore = 5;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -27,17 +27,18 @@ using System.Threading;
|
|||||||
namespace MCGalaxy.Games {
|
namespace MCGalaxy.Games {
|
||||||
public sealed class TntWarsConfig {
|
public sealed class TntWarsConfig {
|
||||||
|
|
||||||
public bool GracePeriodAtStart = true;
|
public bool InitialGracePeriod = true;
|
||||||
public int GracePeriodSeconds = 30;
|
public int GracePeriodSeconds = 30;
|
||||||
|
|
||||||
public int TntPerPlayerAtATime = 1;
|
public int MaxPlayerActiveTnt = 1;
|
||||||
public bool BalanceTeams = true;
|
public bool BalanceTeams = true;
|
||||||
|
|
||||||
public int FFAmaxScore = 75;
|
public int ScoreMaxFFA = 75;
|
||||||
public int TDMmaxScore = 150;
|
public int ScoreMaxTDM = 150;
|
||||||
public int ScorePerKill = 10;
|
public int ScorePerKill = 10;
|
||||||
public int MultiKillBonus = 5; // Amount of extra points per player killed (if more than one) per TNT
|
public int MultiKillBonus = 5; // Amount of extra points per player killed (if more than one) per TNT
|
||||||
public int AssistScore = 5;
|
public int AssistScore = 5;
|
||||||
|
public bool TeamKills;
|
||||||
|
|
||||||
public bool Streaks = true;
|
public bool Streaks = true;
|
||||||
public int StreakOneAmount = 3;
|
public int StreakOneAmount = 3;
|
||||||
@ -47,20 +48,22 @@ namespace MCGalaxy.Games {
|
|||||||
public int StreakThreeAmount = 7;
|
public int StreakThreeAmount = 7;
|
||||||
public float StreakThreeMultiplier = 2f;
|
public float StreakThreeMultiplier = 2f;
|
||||||
|
|
||||||
|
public static TntWarsConfig Default = new TntWarsConfig();
|
||||||
|
|
||||||
public TntWarsConfig Copy() {
|
public TntWarsConfig Copy() {
|
||||||
TntWarsConfig copy = new TntWarsConfig();
|
TntWarsConfig copy = new TntWarsConfig();
|
||||||
copy.GracePeriodAtStart = GracePeriodAtStart;
|
copy.InitialGracePeriod = InitialGracePeriod;
|
||||||
copy.GracePeriodSeconds = GracePeriodSeconds;
|
copy.GracePeriodSeconds = GracePeriodSeconds;
|
||||||
|
|
||||||
copy.TntPerPlayerAtATime = TntPerPlayerAtATime;
|
copy.MaxPlayerActiveTnt = MaxPlayerActiveTnt;
|
||||||
copy.BalanceTeams = BalanceTeams;
|
copy.BalanceTeams = BalanceTeams;
|
||||||
|
|
||||||
copy.FFAmaxScore = FFAmaxScore;
|
copy.ScoreMaxFFA = ScoreMaxFFA;
|
||||||
copy.TDMmaxScore = TDMmaxScore;
|
copy.ScoreMaxTDM = ScoreMaxTDM;
|
||||||
copy.ScorePerKill = ScorePerKill;
|
copy.ScorePerKill = ScorePerKill;
|
||||||
copy.MultiKillBonus = MultiKillBonus;
|
copy.MultiKillBonus = MultiKillBonus;
|
||||||
copy.AssistScore = AssistScore;
|
copy.AssistScore = AssistScore;
|
||||||
|
copy.TeamKills = TeamKills;
|
||||||
|
|
||||||
copy.Streaks = Streaks;
|
copy.Streaks = Streaks;
|
||||||
copy.StreakOneAmount = StreakOneAmount;
|
copy.StreakOneAmount = StreakOneAmount;
|
||||||
|
@ -177,10 +177,10 @@ namespace MCGalaxy {
|
|||||||
if (game.InZone(x, y, z, true))
|
if (game.InZone(x, y, z, true))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (p.CurrentAmountOfTnt == game.TntPerPlayerAtATime) {
|
if (p.CurrentAmountOfTnt == game.Config.MaxPlayerActiveTnt) {
|
||||||
Player.Message(p, "TNT Wars: Maximum amount of TNT placed"); return false;
|
Player.Message(p, "TNT Wars: Maximum amount of TNT placed"); return false;
|
||||||
}
|
}
|
||||||
if (p.CurrentAmountOfTnt > game.TntPerPlayerAtATime) {
|
if (p.CurrentAmountOfTnt > game.Config.MaxPlayerActiveTnt) {
|
||||||
Player.Message(p, "TNT Wars: You have passed the maximum amount of TNT that can be placed!"); return false;
|
Player.Message(p, "TNT Wars: You have passed the maximum amount of TNT that can be placed!"); return false;
|
||||||
}
|
}
|
||||||
p.TntAtATime();
|
p.TntAtATime();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user