Added OneMine

Added Admin vote to start
Added default Header
This commit is contained in:
ChocoTaco 2025-04-26 18:45:11 -04:00
parent 5a7dc47411
commit 11ac636583
2 changed files with 133 additions and 13 deletions

View file

@ -500,6 +500,14 @@ function LCTFGame::missionLoadDone(%game)
//%game.campThread_2 = schedule( 1000, 0, "checkVehicleCamping", 2 ); //%game.campThread_2 = schedule( 1000, 0, "checkVehicleCamping", 2 );
deleteNonLCTFObjects(); deleteNonLCTFObjects();
if($Host::LCTFOneMine){
//Prevent package from being activated if it is already
if (!isActivePackage(LCTFOneMine))
activatePackage(LCTFOneMine);
}
else if (isActivePackage(LCTFOneMine))
deactivatePackage(LCTFOneMine);
} }
function LCTFGame::clientMissionDropReady(%game, %client) function LCTFGame::clientMissionDropReady(%game, %client)
@ -648,6 +656,9 @@ function LCTFGame::gameOver(%game)
} }
for(%j = 1; %j <= %game.numTeams; %j++) for(%j = 1; %j <= %game.numTeams; %j++)
$TeamScore[%j] = 0; $TeamScore[%j] = 0;
if (isActivePackage(LCTFOneMine))
deactivatePackage(LCTFOneMine);
} }
@ -2282,6 +2293,21 @@ function LCTFGame::sendGameVoteMenu(%game, %client, %key)
else else
messageClient( %client, 'MsgVoteItem', "", %key, 'LCTFProMode', 'Disable Pro Mode (Disc, SL, GL Only)', 'Disable Pro Mode (Disc, SL, GL Only)' ); messageClient( %client, 'MsgVoteItem', "", %key, 'LCTFProMode', 'Disable Pro Mode (Disc, SL, GL Only)', 'Disable Pro Mode (Disc, SL, GL Only)' );
} }
if(!%isAdmin || (%isAdmin && %client.ForceVote))
{
if(!$Host::LCTFOneMine)
messageClient( %client, 'MsgVoteItem', "", %key, 'LCTFOneMine', 'Enable One Mine Inventory', 'Vote to enable One Mine Inventory' );
else
messageClient( %client, 'MsgVoteItem', "", %key, 'LCTFOneMine', 'Disable One Mine Inventory', 'Vote to disable One Mine Inventory' );
}
else
{
if(!$Host::LCTFOneMine)
messageClient( %client, 'MsgVoteItem', "", %key, 'LCTFOneMine', 'Enable One Mine Inventory', 'Enable One Mine Inventory' );
else
messageClient( %client, 'MsgVoteItem', "", %key, 'LCTFOneMine', 'Disable One Mine Inventory', 'Disable One Mine Inventory' );
}
} }
} }
@ -2320,6 +2346,8 @@ function LCTFGame::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4
//%game.VoteArmorClass(%admin, %arg1, %arg2, %arg3, %arg4); //%game.VoteArmorClass(%admin, %arg1, %arg2, %arg3, %arg4);
case "LCTFProMode": case "LCTFProMode":
%game.LCTFProMode(%admin, %arg1, %arg2, %arg3, %arg4); %game.LCTFProMode(%admin, %arg1, %arg2, %arg3, %arg4);
case "LCTFOneMine":
%game.LCTFOneMine(%admin, %arg1, %arg2, %arg3, %arg4);
} }
parent::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4); parent::evalVote(%game, %typeName, %admin, %arg1, %arg2, %arg3, %arg4);
@ -2470,6 +2498,86 @@ function LCTFGame::LCTFProMode(%game, %admin, %arg1, %arg2, %arg3, %arg4)
} }
} }
} }
//--------------------------------LCTFOneMine--------------------------------
//
$VoteMessage["LCTFOneMine"] = "turn";
//Set Mine Max
package LCTFOneMine
{
//Set Mine Max
function Player::maxInventory(%this, %data){
if(isObject(%data)){
if(%data.getName() $= "Mine" && Game.class $= "LCTFGame"){
return 1;
}
}
return ShapeBase::maxInventory(%this, %data);
}
};
function LCTFGame::LCTFOneMine(%game, %admin, %arg1, %arg2, %arg3, %arg4)
{
if( $countdownStarted && $MatchStarted )
{
if(%admin)
{
killeveryone();
if($Host::LCTFOneMine)
{
messageAll('MsgAdminForce', '\c2The Admin has disabled One Mine Inventory.');
if (isActivePackage(LCTFOneMine))
deactivatePackage(LCTFOneMine);
$Host::LCTFOneMine = false;
}
else
{
messageAll('MsgAdminForce', '\c2The Admin has enabled One Mine Inventory.');
if (!isActivePackage(LCTFOneMine))
activatePackage(LCTFOneMine);
$Host::LCTFOneMine = true;
}
}
else
{
%totalVotes = %game.totalVotesFor + %game.totalVotesAgainst;
if(%totalVotes > 0 && (%game.totalVotesFor / ClientGroup.getCount()) > ($Host::VotePasspercent / 100))
{
killeveryone();
if($Host::LCTFOneMine)
{
messageAll('MsgVotePassed', '\c2One Mine Inventory Disabled.');
if (isActivePackage(LCTFOneMine))
deactivatePackage(LCTFOneMine);
$Host::LCTFOneMine = false;
}
else
{
messageAll('MsgVotePassed', '\c2One Mine Inventory Enabled.');
if (!isActivePackage(LCTFOneMine))
activatePackage(LCTFOneMine);
$Host::LCTFOneMine = true;
}
}
else
messageAll('MsgVoteFailed', '\c2Mode change did not pass: %1 percent.', mFloor(%game.totalVotesFor/ClientGroup.getCount() * 100));
}
}
}
// For voting to work properly - evo admin.ovl // For voting to work properly - evo admin.ovl
// //
// case "LCTFProMode": // case "LCTFProMode":

View file

@ -51,10 +51,12 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key)
{ {
if(!$Host::TournamentMode) if(!$Host::TournamentMode)
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTournamentMode', 'change server to Tournament.', 'Vote Tournament Mode'); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteTournamentMode', 'change server to Tournament.', 'Vote Tournament Mode');
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission'); if(!$MatchStarted && !$CountdownStarted && $Host::TournamentMode)
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteNextMission', 'set next mission to', 'Vote to Set the Next Mission'); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteMatchStart', 'Start Match', 'Vote to Start the Match');
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Vote to Change the Time Limit'); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeMission', 'change the mission to', 'Vote to Change the Mission');
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'skip the mission to', 'Vote to Skip Mission' ); messageClient(%client, 'MsgVoteItem', "", %key, 'VoteNextMission', 'set next mission to', 'Vote to Set the Next Mission');
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteChangeTimeLimit', 'change the time limit', 'Vote to Change the Time Limit');
messageClient(%client, 'MsgVoteItem', "", %key, 'VoteSkipMission', 'skip the mission to', 'Vote to Skip Mission' );
if(%multipleTeams) if(%multipleTeams)
{ {
if($teamDamage) if($teamDamage)
@ -86,23 +88,26 @@ function DefaultGame::sendGameVoteMenu(%game, %client, %key)
//Mission Info Header - Mission Name, Type, Caps to Win //Mission Info Header - Mission Name, Type, Caps to Win
if(%client.canVote && %game.scheduleVote $= "") if(%client.canVote && %game.scheduleVote $= "")
{ {
if($voteNext)
%showNM = " - Next Map:" SPC $HostMissionName[$voteNextMap] SPC "(" @ $HostTypeName[$voteNextType] @ ")";
switch$($CurrentMissionType) switch$($CurrentMissionType)
{ {
case CTF or SCtF or LCTF: case CTF or SCtF or LCTF:
if($Host::TournamentMode) %showTL = " - Time Limit:" SPC $Host::TimeLimit SPC "Minutes";
%showTL = " - Time Limit:" SPC $Host::TimeLimit SPC "Minutes";
if($voteNext)
%showNM = " - Next Map:" SPC $HostMissionName[$voteNextMap] SPC "(" @ $HostTypeName[$voteNextType] @ ")";
messageClient(%client, 'MsgVoteItem', "", %key, '', $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC MissionGroup.CTF_scoreLimit SPC "Caps to Win", messageClient(%client, 'MsgVoteItem', "", %key, '', $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC MissionGroup.CTF_scoreLimit SPC "Caps to Win",
$MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC MissionGroup.CTF_scoreLimit SPC "Caps to Win" @ %showTL @ %showNM); $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC MissionGroup.CTF_scoreLimit SPC "Caps to Win" @ %showTL @ %showNM);
case LakRabbit: case LakRabbit:
%cap = "2000 Points to Win"; %cap = "2000 Points to Win";
messageClient(%client, 'MsgVoteItem', "", %key, '', $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC %cap, messageClient(%client, 'MsgVoteItem', "", %key, '', $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC %cap,
$MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC %cap); $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC %cap @ %showNM);
case DM: case DM:
%cap = "25 Points to Win"; %cap = "25 Points to Win";
messageClient(%client, 'MsgVoteItem', "", %key, '', $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC %cap, messageClient(%client, 'MsgVoteItem', "", %key, '', $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC %cap,
$MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC %cap); $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC %cap @ %showNM);
default:
messageClient(%client, 'MsgVoteItem', "", %key, '', $MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ "):" SPC %cap,
$MissionDisplayName SPC "(" @ $MissionTypeDisplayName @ ")" @ %showNM);
} }
} }
@ -515,7 +520,7 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %
} }
case "VoteMatchStart": case "VoteMatchStart":
if(!%isAdmin) if(!%isAdmin || (%isAdmin && %client.ForceVote))
{ {
if($MatchStarted || $CountdownStarted) if($MatchStarted || $CountdownStarted)
return; return;
@ -865,6 +870,13 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %
if(!%isAdmin || (%isAdmin && %client.ForceVote)) if(!%isAdmin || (%isAdmin && %client.ForceVote))
%msg = %client.nameBase @ " initiated a vote to " @ (Game.LCTFProMode == 0 ? "enable" : "disable") @ " pro mode."; %msg = %client.nameBase @ " initiated a vote to " @ (Game.LCTFProMode == 0 ? "enable" : "disable") @ " pro mode.";
case "LCTFOneMine":
if(!$CurrentMissionType $= "LCTF")
return;
if(!%isAdmin || (%isAdmin && %client.ForceVote))
%msg = %client.nameBase @ " initiated a vote to " @ (Game.LCTFOneMine == 0 ? "enable" : "disable") @ " one mine mode.";
case "showServerRules": case "showServerRules":
if (($Host::ServerRules[1] !$= "") && (!%client.CantView)) if (($Host::ServerRules[1] !$= "") && (!%client.CantView))
{ {
@ -1923,4 +1935,4 @@ function DefaultGame::setNextMission(%game, %client, %map, %type, %mapIndex, %ty
messageAll('', '\c1Vote %6: \c0Yea: %1 Nay: %2 Abstain: %7 Total: %3 [%4%5]', %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, mfloor((%game.totalVotesFor/(ClientGroup.getCount() - %game.totalVotesNone)) * 100), "%", %key, %game.totalVotesNone); messageAll('', '\c1Vote %6: \c0Yea: %1 Nay: %2 Abstain: %7 Total: %3 [%4%5]', %game.totalVotesFor, %game.totalVotesAgainst, %totalVotes, mfloor((%game.totalVotesFor/(ClientGroup.getCount() - %game.totalVotesNone)) * 100), "%", %key, %game.totalVotesNone);
} }
} }
} }