Skip to content

Commit

Permalink
2017-08-30 update.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aessi committed Aug 30, 2017
1 parent 605f5e8 commit 16f005d
Show file tree
Hide file tree
Showing 10 changed files with 832 additions and 780 deletions.
7 changes: 5 additions & 2 deletions Common/Scripts/Libs/Nadeo/ChannelProgression.Script.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Channel progression library
*/
#Const Version "2017-06-22"
#Const Version "2017-08-30"
#Const ScriptName "Libs/Nadeo/ChannelProgression.Script.txt"

// ---------------------------------- //
Expand Down Expand Up @@ -83,6 +83,9 @@ Text Private_GenerateHeaderML(Vec2 _Size, Real _Ratio) {
* @return The manialink
*/
Text Private_GetChannelProgressionML() {
// @disabled
return "";

declare PlayerClass = "CTmMlPlayer";
if (This is CSmMode) PlayerClass = "CSmPlayer";

Expand Down Expand Up @@ -983,7 +986,7 @@ main() {
XP_AnimStart = BestScores_AnimStart + C_BestScores_AnimDuration + 1000;
// Regional ranking
declare AnimDuration = 0;
if (Owner != Null) {
if (Owner != Null && Owner.Score != Null) {
declare netread Net_LibChanPro_OldXP for Owner.Score = 0;
declare netread Net_LibChanPro_NewXP for Owner.Score = 0;
AnimDuration = GetXPAnimDuration(Net_LibChanPro_EmblemsXP, Net_LibChanPro_OldXP, Net_LibChanPro_NewXP);
Expand Down
4 changes: 2 additions & 2 deletions Common/Scripts/Libs/Nadeo/MatchmakingMatch.Script.txt
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ Void ManagePlayers() {
if (MMCommon::GetLogDisplay("MiscDebug")) Private_Log("[SERVER] Invalid player : "^Player.User.Login^" > Transfert to the lobby : "^GetLobbyLogin());

} else if (Now >= LibMMMatch_CanBeKicked) {
declare Kicked = ServerAdmin.KickUser(Player.User, _("This matchmaking server is hosting a match. You can't join at the moment."));
declare Kicked = ServerAdmin.Kick(Player.User, _("This matchmaking server is hosting a match. You can't join at the moment."));
if (MMCommon::GetLogDisplay("MiscDebug")) Private_Log("[SERVER] Invalid player : "^Player.User.Login^" > Kicked.");
}
}
Expand Down Expand Up @@ -1448,7 +1448,7 @@ Void MatchToLobby_End() {
if (MMCommon::GetLogDisplay("MiscDebug")) Private_Log("[SERVER] This is a channel server. Do not kick the players");
} else {
foreach (User in Users) {
declare Kicked = ServerAdmin.KickUser(User, _("Match over. You should have been transferred back to the lobby."));
declare Kicked = ServerAdmin.Kick(User, _("Match over. You should have been transferred back to the lobby."));
if (MMCommon::GetLogDisplay("MiscDebug")) Private_Log("[SERVER] Match over but "^User.Login^" was not transferred. Kick him : "^Kicked);
}
}
Expand Down
43 changes: 41 additions & 2 deletions Common/Scripts/Libs/Nadeo/ShootMania/Attributes.Script.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Manage players' attributes
*/
#Const Version "2016-12-23"
#Const Version "2017-08-10"
#Const ScriptName "Libs/Nadeo/ShootMania/Exp/Attributes.Script.txt"

// ---------------------------------- //
Expand Down Expand Up @@ -237,6 +237,34 @@ Void SetBase(Integer _Attribute, Real _Value) {
G_BaseAttributes[_Attribute] = _Value;
}

// ---------------------------------- //
/** Update a player specific
* attribute base value
*
* @param _Player The player to update
* @param _Attribute The attribute to update
* @param _Value The new base value
*/
Void SetPlayerBase(CSmPlayer _Player, Integer _Attribute, Real _Value) {
if (_Player == Null) return;
declare LibExpAttributes_Base for _Player = Real[Integer];
LibExpAttributes_Base[_Attribute] = _Value;
}

// ---------------------------------- //
/** Update a player specific
* attribute base value
*
* @param _Player The player to update
* @param _Attribute The attribute to update
* @param _Value The new base value
*/
Void ResetPlayerBase(CSmPlayer _Player) {
if (_Player == Null) return;
declare LibExpAttributes_Base for _Player = Real[Integer];
LibExpAttributes_Base = Real[Integer];
}

// ---------------------------------- //
/** Add a bonus to a player's attribute
* This bonus will be added to the base
Expand Down Expand Up @@ -415,7 +443,16 @@ Void RemoveLock(CSmPlayer _Player, Integer _Attribute, Text _Id) {
* @param _Player The player to update
*/
Void Apply(CSmPlayer _Player) {
foreach (Attribute => Value in G_BaseAttributes) {
if (_Player == Null) return;

declare LibExpAttributes_Base for _Player = Real[Integer];

foreach (Attribute => BaseValue in G_BaseAttributes) {
// Use the player base instead of the default one if it exists
declare Value = BaseValue;
if (LibExpAttributes_Base.existskey(Attribute)) {
Value = LibExpAttributes_Base[Attribute];
}
Private_ApplyAttribute(_Player, Attribute, Value);
}
}
Expand Down Expand Up @@ -519,6 +556,8 @@ Void Unload() {
LibExpAttributes_DamagePower = C_Base_DamagePower;
LibExpAttributes_CaptureSpeed = C_Base_CaptureSpeed;
LibExpAttributes_ShieldArmorMax = C_Base_ShieldArmorMax;

ResetPlayerBase(Player);
}
}

Expand Down
5 changes: 3 additions & 2 deletions Common/Scripts/Libs/Nadeo/TrackMania/WarmUp4.Script.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WarmUp lib
*/
#Const Version "2017-04-10"
#Const Version "2017-08-11"
#Const ScriptName "WarmUp4.Script.txt"

#Include "Libs/Nadeo/TrackMania/Events.Script.txt" as Events
Expand Down Expand Up @@ -389,7 +389,8 @@ Void Loop() {
/// Default events management
Void ManageEvents() {
foreach (Event in PendingEvents) {
Events::Valid(Event);
declare Processed = Events::Valid(Event);
if (!Processed) continue;

// ---------------------------------- //
// Waypoint
Expand Down
Loading

0 comments on commit 16f005d

Please sign in to comment.