-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
324 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# KF-TraderBoostMut | ||
Boost the speed of all players once trader time starts | ||
# KF-ServerTools | ||
|
||
- Give all players a speed boost on trader time | ||
- Check the sample config to see how to use | ||
|
||
[SteamWorkShop](https://steamcommunity.com/id/Vel-San/myworkshopfiles/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[TraderBoostMut.BoostMe] | ||
# Value for speed boost | Recommended: Between 500 - 1000 (More than 1000 and you'll become flash) | ||
iSpeedBoost=750 | ||
# If this is set to anything above 0, you will get extra 'boost' time (duration) AFTER the wave has already started | ||
iAfterWaveStartBoost=10 | ||
# Speed boost duration for match start | This is recommended to be 10 because countdown for match start is 10 | ||
iMatchStartBoost=10 | ||
# Message to show at MatchStart boost | ||
sMatchStartBoostMessage=%bMatch Start%w Speed Boost %tActivated!%w | ||
# Message to show at TraderTime boost | ||
sTraderBoostMessage=%bTrader%w Speed Boost %tActivated!%w | ||
# Controls whether the notification/message is global (On Screen) or in-chat | ||
bGlobalMSG=True | ||
|
||
[TraderBoostMut.TraderBoostMut] | ||
# Adding these tags to your sBoostMessage will make it colorful :) | ||
ColorList=(ColorName="Red",ColorTag="%r",Color=(B=0,G=0,R=200,A=0)) | ||
ColorList=(ColorName="Orange",ColorTag="%o",Color=(B=0,G=127,R=255,A=0)) | ||
ColorList=(ColorName="Yellow",ColorTag="%y",Color=(B=0,G=255,R=255,A=0)) | ||
ColorList=(ColorName="Green",ColorTag="%g",Color=(B=0,G=200,R=0,A=0)) | ||
ColorList=(ColorName="Blue",ColorTag="%b",Color=(B=200,G=100,R=0,A=0)) | ||
ColorList=(ColorName="Teal",ColorTag="%t",Color=(B=113,G=179,R=60,A=0)) | ||
ColorList=(ColorName="Violet",ColorTag="%v",Color=(B=139,G=0,R=255,A=0)) | ||
ColorList=(ColorName="White",ColorTag="%w",Color=(B=200,G=200,R=200,A=0)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
Gives player a speed boost at the match start, and trader time in between waves: | ||
|
||
[h1][b][u]Features[/u][/b][/h1] | ||
|
||
- Customizable boost power | ||
- Customizable boost messages (Colored) | ||
- Global vs. Chat notifications | ||
- Ability to give extra boost after TRADER time ends | ||
- Ability to give extra boost after MATCH start | ||
|
||
[b]Credits[/b] | ||
|
||
- Me | ||
- Marco (Some parts of the code) | ||
- NiggaBeats (Testing) | ||
|
||
[h1][b][u]Notes[/u][/b][/h1] | ||
|
||
- Mut is [b]WHITELISTED[/b] on dedicated servers | ||
- Mut is Whitelisted on listen servers (Except for the HOST) | ||
|
||
[h1][b][u]Number Of Files[/u][/b][/h1] | ||
|
||
- 3 | ||
|
||
[h1][b][u]Sample Config[/u][/b][/h1] | ||
|
||
[code] | ||
[TraderBoostMut.BoostMe] | ||
# Value for speed boost | Recommended: Between 500 - 1000 (More than 1000 and you'll become flash) | ||
iSpeedBoost=750 | ||
# If this is set to anything above 0, you will get extra 'boost' time (duration) AFTER the wave has already started | ||
iAfterWaveStartBoost=10 | ||
# Speed boost duration for match start | This is recommended to be 10 because countdown for match start is 10 | ||
iMatchStartBoost=10 | ||
# Message to show at MatchStart boost | ||
sMatchStartBoostMessage=%bMatch Start%w Speed Boost %tActivated!%w | ||
# Message to show at TraderTime boost | ||
sTraderBoostMessage=%bTrader%w Speed Boost %tActivated!%w | ||
# Controls whether the notification/message is global (On Screen) or in-chat | ||
bGlobalMSG=True | ||
|
||
[TraderBoostMut.TraderBoostMut] | ||
# Adding these tags to your sBoostMessage will make it colorful :) | ||
ColorList=(ColorName="Red",ColorTag="%r",Color=(B=0,G=0,R=200,A=0)) | ||
ColorList=(ColorName="Orange",ColorTag="%o",Color=(B=0,G=127,R=255,A=0)) | ||
ColorList=(ColorName="Yellow",ColorTag="%y",Color=(B=0,G=255,R=255,A=0)) | ||
ColorList=(ColorName="Green",ColorTag="%g",Color=(B=0,G=200,R=0,A=0)) | ||
ColorList=(ColorName="Blue",ColorTag="%b",Color=(B=200,G=100,R=0,A=0)) | ||
ColorList=(ColorName="Teal",ColorTag="%t",Color=(B=113,G=179,R=60,A=0)) | ||
ColorList=(ColorName="Violet",ColorTag="%v",Color=(B=139,G=0,R=255,A=0)) | ||
ColorList=(ColorName="White",ColorTag="%w",Color=(B=200,G=200,R=200,A=0)) | ||
# Better to keep debugging False :) | ||
bDebug=True[/code] | ||
|
||
[h1][b][u]File Names[/u][/b][/h1] | ||
|
||
- \System\TraderBoostMut.u | ||
- \System\TraderBoostMut.ucl | ||
- \System\TraderBoostMut.ini | ||
|
||
[h1][b][u]Usage[/u][/b][/h1] | ||
|
||
1- Subscribe or download manually (Recommended) | ||
2- Launch the game and wait to see 'Completed' | ||
3- Restart the game and you can see the mutators in your list | ||
|
||
|
||
[i]Compatibility Issues[/i] | ||
|
||
- None, for now, but let me know if you find any issues/bugs with other mutators | ||
- DO NOT USE If you are already using ServerTools! (ServerTools already has this feature!) | ||
|
||
[h1][b][u]Class Names[/u][/b][/h1] | ||
|
||
- Mut: TraderBoostMut.TraderBoostMut | ||
|
||
[h1][b][u]Manual Download Links (Recommended)[/u][/b][/h1] | ||
|
||
You can find it under 'Whitelisted' folder named 'TraderBoostMut-v1.1' | ||
|
||
- MEGA Link: https://mega DOT nz/folder/YDoEmKiC#s6FGAtgh40-TvB4bHsLaMQ | ||
|
||
- Github: https://github.com/Vel-San/TraderBoostMut/releases/tag/v1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Class Boost extends Info; | ||
|
||
static function bool GiveBoost( Pawn Target) | ||
{ | ||
Target.Spawn(Class'BoostMe'); | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
Class BoostMe extends Info Config(TraderBoostMut); | ||
|
||
var() config int iSpeedBoost, iAfterWaveStartBoost, iMatchStartBoost; | ||
var() config string sMatchStartBoostMessage, sTraderBoostMessage; | ||
var() config bool bGlobalMSG; | ||
|
||
function PostBeginPlay() | ||
{ | ||
local KFGameType KFGT; | ||
local GameReplicationInfo GRI; | ||
|
||
KFGT = KFGameType(Level.Game); | ||
GRI = Level.Game.GameReplicationInfo; | ||
|
||
Instigator.Health = iSpeedBoost; // Value affects groundspeed | ||
|
||
// Start Speed Boost Timer | ||
if ( GRI != none) | ||
{ | ||
if (GRI.ElapsedTime < 10) | ||
{ | ||
// Match Start Boost | ||
if (bGlobalMSG) class'TraderBoostMut'.default.Mut.CriticalServerMessage(sMatchStartBoostMessage); | ||
else class'TraderBoostMut'.default.Mut.ServerMessage(sMatchStartBoostMessage); | ||
SetTimer(iMatchStartBoost, false); // Recommended 10 seconds is for wave start countdown | ||
} | ||
else | ||
{ | ||
// Trader Time Boost | ||
if (bGlobalMSG) class'TraderBoostMut'.default.Mut.CriticalServerMessage(sTraderBoostMessage); | ||
else class'TraderBoostMut'.default.Mut.ServerMessage(sTraderBoostMessage); | ||
SetTimer(KFGT.TimeBetweenWaves + iAfterWaveStartBoost + 10, false); // +10 is for wave start 10 seconds | ||
} | ||
} | ||
} | ||
|
||
function Timer() | ||
{ | ||
Destroy(); | ||
} | ||
|
||
function Tick( float Delta ) | ||
{ | ||
if (Instigator==None || Instigator.Health <= 0) Destroy(); | ||
} | ||
|
||
function Destroyed() | ||
{ | ||
if (Instigator != None) Instigator.Health = Min(Instigator.Health, 100); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
//============================================================================= | ||
// Gives all players a speed boost on trader time; | ||
// Made by Vel-San @ https://steamcommunity.com/id/Vel-San/ | ||
//============================================================================= | ||
|
||
class TraderBoostMut extends Mutator Config(TraderBoostMut); | ||
|
||
// Tmp Vars | ||
var bool isBoostActive; | ||
var KFGameType KFGT; | ||
var TraderBoostMut Mut; | ||
|
||
// Colors from Config | ||
struct ColorRecord | ||
{ | ||
var config string ColorName; // Color name, for comfort | ||
var config string ColorTag; // Color tag | ||
var config Color Color; // RGBA values | ||
}; | ||
var() config array<ColorRecord> ColorList; // Color list | ||
|
||
// Initialization | ||
function PostBeginPlay() | ||
{ | ||
// Pointer To self, just in case needed | ||
Mut = self; | ||
default.Mut = self; | ||
class'TraderBoostMut'.default.Mut = self; | ||
|
||
isBoostActive = false; | ||
KFGT = KFGameType(Level.Game); | ||
|
||
if(KFGT == none) MutLog("-----|| KFGameType not found! ||-----"); | ||
|
||
// Enable Tick | ||
Enable('Tick'); | ||
} | ||
|
||
// Tick to Give Trader Speed Boost | ||
// TODO: Maybe change from tick to something else? Not sure. | ||
function Tick(float DeltaTime) | ||
{ | ||
if (!KFGT.bWaveInProgress && !KFGT.IsInState('PendingMatch') && !KFGT.IsInState('GameEnded')) | ||
{ | ||
if(!isBoostActive) GiveTraderBoost(); | ||
} | ||
else | ||
{ | ||
isBoostActive = false; | ||
} | ||
} | ||
|
||
function ServerMessage(string Msg) | ||
{ | ||
local Controller C; | ||
local PlayerController PC; | ||
for (C = Level.ControllerList; C != none; C = C.nextController) | ||
{ | ||
PC = PlayerController(C); | ||
if (PC != none) | ||
{ | ||
SetColor(Msg); | ||
PC.ClientMessage(Msg); | ||
} | ||
} | ||
} | ||
|
||
function CriticalServerMessage(string Msg) | ||
{ | ||
local Controller C; | ||
local PlayerController PC; | ||
for (C = Level.ControllerList; C != none; C = C.nextController) | ||
{ | ||
PC = PlayerController(C); | ||
if (PC != none) | ||
{ | ||
SetColor(Msg); | ||
PC.ClientMessage(Msg, 'CriticalEvent'); | ||
} | ||
} | ||
} | ||
|
||
function GiveTraderBoost() | ||
{ | ||
local Controller C; | ||
local PlayerController PC; | ||
|
||
|
||
MutLog("-----|| DEBUG - Trader Speed Boost Activated ||-----"); | ||
|
||
isBoostActive = true; | ||
|
||
for (C = Level.ControllerList; C != none; C = C.nextController) | ||
{ | ||
PC = PlayerController(C); | ||
if (PC != none && PC.Pawn != none) class'Boost'.Static.GiveBoost(PC.Pawn); | ||
} | ||
} | ||
|
||
function TimeStampLog(coerce string s) | ||
{ | ||
log("["$Level.TimeSeconds$"s]" @ s, 'SkipTrader'); | ||
} | ||
|
||
function MutLog(string s) | ||
{ | ||
log(s, 'SkipTrader'); | ||
} | ||
|
||
///////////////////////////////////////////////////////////////////////// | ||
// BELOW SECTION IS CREDITED FOR NikC // | ||
|
||
// Apply Color Tags To Message | ||
function SetColor(out string Msg) | ||
{ | ||
local int i; | ||
for(i=0; i<ColorList.Length; i++) | ||
{ | ||
if(ColorList[i].ColorTag!="" && InStr(Msg, ColorList[i].ColorTag)!=-1) | ||
{ | ||
ReplaceText(Msg, ColorList[i].ColorTag, FormatTagToColorCode(ColorList[i].ColorTag, ColorList[i].Color)); | ||
} | ||
} | ||
} | ||
|
||
// Format Color Tag to ColorCode | ||
function string FormatTagToColorCode(string Tag, Color Clr) | ||
{ | ||
Tag=Class'GameInfo'.Static.MakeColorCode(Clr); | ||
Return Tag; | ||
} | ||
|
||
function string RemoveColor(string S) | ||
{ | ||
local int P; | ||
P=InStr(S,Chr(27)); | ||
While(P>=0) | ||
{ | ||
S=Left(S,P)$Mid(S,P+4); | ||
P=InStr(S,Chr(27)); | ||
} | ||
Return S; | ||
} | ||
////////////////////////////////////////////////////////////////////// | ||
|
||
defaultproperties | ||
{ | ||
// Mandatory Vars | ||
GroupName = "KF-TraderBoostMut" | ||
FriendlyName = "Trader Booster - v1.0" | ||
Description = "Gives all players a speed boost on trader time; Made by Vel-San /w help of Marco" | ||
} |