Skip to content

Commit eab6daa

Browse files
committed
[release]: v1.0 Public Release
1 parent f86cb54 commit eab6daa

6 files changed

Lines changed: 324 additions & 2 deletions

File tree

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
# KF-TraderBoostMut
2-
Boost the speed of all players once trader time starts
1+
# KF-ServerTools
2+
3+
- Give all players a speed boost on trader time
4+
- Check the sample config to see how to use
5+
6+
[SteamWorkShop](https://steamcommunity.com/id/Vel-San/myworkshopfiles/)

Sample_Config/TraderBoostMut.ini

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[TraderBoostMut.BoostMe]
2+
# Value for speed boost | Recommended: Between 500 - 1000 (More than 1000 and you'll become flash)
3+
iSpeedBoost=750
4+
# If this is set to anything above 0, you will get extra 'boost' time (duration) AFTER the wave has already started
5+
iAfterWaveStartBoost=10
6+
# Speed boost duration for match start | This is recommended to be 10 because countdown for match start is 10
7+
iMatchStartBoost=10
8+
# Message to show at MatchStart boost
9+
sMatchStartBoostMessage=%bMatch Start%w Speed Boost %tActivated!%w
10+
# Message to show at TraderTime boost
11+
sTraderBoostMessage=%bTrader%w Speed Boost %tActivated!%w
12+
# Controls whether the notification/message is global (On Screen) or in-chat
13+
bGlobalMSG=True
14+
15+
[TraderBoostMut.TraderBoostMut]
16+
# Adding these tags to your sBoostMessage will make it colorful :)
17+
ColorList=(ColorName="Red",ColorTag="%r",Color=(B=0,G=0,R=200,A=0))
18+
ColorList=(ColorName="Orange",ColorTag="%o",Color=(B=0,G=127,R=255,A=0))
19+
ColorList=(ColorName="Yellow",ColorTag="%y",Color=(B=0,G=255,R=255,A=0))
20+
ColorList=(ColorName="Green",ColorTag="%g",Color=(B=0,G=200,R=0,A=0))
21+
ColorList=(ColorName="Blue",ColorTag="%b",Color=(B=200,G=100,R=0,A=0))
22+
ColorList=(ColorName="Teal",ColorTag="%t",Color=(B=113,G=179,R=60,A=0))
23+
ColorList=(ColorName="Violet",ColorTag="%v",Color=(B=139,G=0,R=255,A=0))
24+
ColorList=(ColorName="White",ColorTag="%w",Color=(B=200,G=200,R=200,A=0))
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
Gives player a speed boost at the match start, and trader time in between waves:
2+
3+
[h1][b][u]Features[/u][/b][/h1]
4+
5+
- Customizable boost power
6+
- Customizable boost messages (Colored)
7+
- Global vs. Chat notifications
8+
- Ability to give extra boost after TRADER time ends
9+
- Ability to give extra boost after MATCH start
10+
11+
[b]Credits[/b]
12+
13+
- Me
14+
- Marco (Some parts of the code)
15+
- NiggaBeats (Testing)
16+
17+
[h1][b][u]Notes[/u][/b][/h1]
18+
19+
- Mut is [b]WHITELISTED[/b] on dedicated servers
20+
- Mut is Whitelisted on listen servers (Except for the HOST)
21+
22+
[h1][b][u]Number Of Files[/u][/b][/h1]
23+
24+
- 3
25+
26+
[h1][b][u]Sample Config[/u][/b][/h1]
27+
28+
[code]
29+
[TraderBoostMut.BoostMe]
30+
# Value for speed boost | Recommended: Between 500 - 1000 (More than 1000 and you'll become flash)
31+
iSpeedBoost=750
32+
# If this is set to anything above 0, you will get extra 'boost' time (duration) AFTER the wave has already started
33+
iAfterWaveStartBoost=10
34+
# Speed boost duration for match start | This is recommended to be 10 because countdown for match start is 10
35+
iMatchStartBoost=10
36+
# Message to show at MatchStart boost
37+
sMatchStartBoostMessage=%bMatch Start%w Speed Boost %tActivated!%w
38+
# Message to show at TraderTime boost
39+
sTraderBoostMessage=%bTrader%w Speed Boost %tActivated!%w
40+
# Controls whether the notification/message is global (On Screen) or in-chat
41+
bGlobalMSG=True
42+
43+
[TraderBoostMut.TraderBoostMut]
44+
# Adding these tags to your sBoostMessage will make it colorful :)
45+
ColorList=(ColorName="Red",ColorTag="%r",Color=(B=0,G=0,R=200,A=0))
46+
ColorList=(ColorName="Orange",ColorTag="%o",Color=(B=0,G=127,R=255,A=0))
47+
ColorList=(ColorName="Yellow",ColorTag="%y",Color=(B=0,G=255,R=255,A=0))
48+
ColorList=(ColorName="Green",ColorTag="%g",Color=(B=0,G=200,R=0,A=0))
49+
ColorList=(ColorName="Blue",ColorTag="%b",Color=(B=200,G=100,R=0,A=0))
50+
ColorList=(ColorName="Teal",ColorTag="%t",Color=(B=113,G=179,R=60,A=0))
51+
ColorList=(ColorName="Violet",ColorTag="%v",Color=(B=139,G=0,R=255,A=0))
52+
ColorList=(ColorName="White",ColorTag="%w",Color=(B=200,G=200,R=200,A=0))
53+
# Better to keep debugging False :)
54+
bDebug=True[/code]
55+
56+
[h1][b][u]File Names[/u][/b][/h1]
57+
58+
- \System\TraderBoostMut.u
59+
- \System\TraderBoostMut.ucl
60+
- \System\TraderBoostMut.ini
61+
62+
[h1][b][u]Usage[/u][/b][/h1]
63+
64+
1- Subscribe or download manually (Recommended)
65+
2- Launch the game and wait to see 'Completed'
66+
3- Restart the game and you can see the mutators in your list
67+
68+
69+
[i]Compatibility Issues[/i]
70+
71+
- None, for now, but let me know if you find any issues/bugs with other mutators
72+
- DO NOT USE If you are already using ServerTools! (ServerTools already has this feature!)
73+
74+
[h1][b][u]Class Names[/u][/b][/h1]
75+
76+
- Mut: TraderBoostMut.TraderBoostMut
77+
78+
[h1][b][u]Manual Download Links (Recommended)[/u][/b][/h1]
79+
80+
You can find it under 'Whitelisted' folder named 'TraderBoostMut-v1.1'
81+
82+
- MEGA Link: https://mega DOT nz/folder/YDoEmKiC#s6FGAtgh40-TvB4bHsLaMQ
83+
84+
- Github: https://github.com/Vel-San/TraderBoostMut/releases/tag/v1.1

TraderBoostMut/Classes/Boost.uc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Class Boost extends Info;
2+
3+
static function bool GiveBoost( Pawn Target)
4+
{
5+
Target.Spawn(Class'BoostMe');
6+
return true;
7+
}

TraderBoostMut/Classes/BoostMe.uc

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
Class BoostMe extends Info Config(TraderBoostMut);
2+
3+
var() config int iSpeedBoost, iAfterWaveStartBoost, iMatchStartBoost;
4+
var() config string sMatchStartBoostMessage, sTraderBoostMessage;
5+
var() config bool bGlobalMSG;
6+
7+
function PostBeginPlay()
8+
{
9+
local KFGameType KFGT;
10+
local GameReplicationInfo GRI;
11+
12+
KFGT = KFGameType(Level.Game);
13+
GRI = Level.Game.GameReplicationInfo;
14+
15+
Instigator.Health = iSpeedBoost; // Value affects groundspeed
16+
17+
// Start Speed Boost Timer
18+
if ( GRI != none)
19+
{
20+
if (GRI.ElapsedTime < 10)
21+
{
22+
// Match Start Boost
23+
if (bGlobalMSG) class'TraderBoostMut'.default.Mut.CriticalServerMessage(sMatchStartBoostMessage);
24+
else class'TraderBoostMut'.default.Mut.ServerMessage(sMatchStartBoostMessage);
25+
SetTimer(iMatchStartBoost, false); // Recommended 10 seconds is for wave start countdown
26+
}
27+
else
28+
{
29+
// Trader Time Boost
30+
if (bGlobalMSG) class'TraderBoostMut'.default.Mut.CriticalServerMessage(sTraderBoostMessage);
31+
else class'TraderBoostMut'.default.Mut.ServerMessage(sTraderBoostMessage);
32+
SetTimer(KFGT.TimeBetweenWaves + iAfterWaveStartBoost + 10, false); // +10 is for wave start 10 seconds
33+
}
34+
}
35+
}
36+
37+
function Timer()
38+
{
39+
Destroy();
40+
}
41+
42+
function Tick( float Delta )
43+
{
44+
if (Instigator==None || Instigator.Health <= 0) Destroy();
45+
}
46+
47+
function Destroyed()
48+
{
49+
if (Instigator != None) Instigator.Health = Min(Instigator.Health, 100);
50+
}
51+
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
//=============================================================================
2+
// Gives all players a speed boost on trader time;
3+
// Made by Vel-San @ https://steamcommunity.com/id/Vel-San/
4+
//=============================================================================
5+
6+
class TraderBoostMut extends Mutator Config(TraderBoostMut);
7+
8+
// Tmp Vars
9+
var bool isBoostActive;
10+
var KFGameType KFGT;
11+
var TraderBoostMut Mut;
12+
13+
// Colors from Config
14+
struct ColorRecord
15+
{
16+
var config string ColorName; // Color name, for comfort
17+
var config string ColorTag; // Color tag
18+
var config Color Color; // RGBA values
19+
};
20+
var() config array<ColorRecord> ColorList; // Color list
21+
22+
// Initialization
23+
function PostBeginPlay()
24+
{
25+
// Pointer To self, just in case needed
26+
Mut = self;
27+
default.Mut = self;
28+
class'TraderBoostMut'.default.Mut = self;
29+
30+
isBoostActive = false;
31+
KFGT = KFGameType(Level.Game);
32+
33+
if(KFGT == none) MutLog("-----|| KFGameType not found! ||-----");
34+
35+
// Enable Tick
36+
Enable('Tick');
37+
}
38+
39+
// Tick to Give Trader Speed Boost
40+
// TODO: Maybe change from tick to something else? Not sure.
41+
function Tick(float DeltaTime)
42+
{
43+
if (!KFGT.bWaveInProgress && !KFGT.IsInState('PendingMatch') && !KFGT.IsInState('GameEnded'))
44+
{
45+
if(!isBoostActive) GiveTraderBoost();
46+
}
47+
else
48+
{
49+
isBoostActive = false;
50+
}
51+
}
52+
53+
function ServerMessage(string Msg)
54+
{
55+
local Controller C;
56+
local PlayerController PC;
57+
for (C = Level.ControllerList; C != none; C = C.nextController)
58+
{
59+
PC = PlayerController(C);
60+
if (PC != none)
61+
{
62+
SetColor(Msg);
63+
PC.ClientMessage(Msg);
64+
}
65+
}
66+
}
67+
68+
function CriticalServerMessage(string Msg)
69+
{
70+
local Controller C;
71+
local PlayerController PC;
72+
for (C = Level.ControllerList; C != none; C = C.nextController)
73+
{
74+
PC = PlayerController(C);
75+
if (PC != none)
76+
{
77+
SetColor(Msg);
78+
PC.ClientMessage(Msg, 'CriticalEvent');
79+
}
80+
}
81+
}
82+
83+
function GiveTraderBoost()
84+
{
85+
local Controller C;
86+
local PlayerController PC;
87+
88+
89+
MutLog("-----|| DEBUG - Trader Speed Boost Activated ||-----");
90+
91+
isBoostActive = true;
92+
93+
for (C = Level.ControllerList; C != none; C = C.nextController)
94+
{
95+
PC = PlayerController(C);
96+
if (PC != none && PC.Pawn != none) class'Boost'.Static.GiveBoost(PC.Pawn);
97+
}
98+
}
99+
100+
function TimeStampLog(coerce string s)
101+
{
102+
log("["$Level.TimeSeconds$"s]" @ s, 'SkipTrader');
103+
}
104+
105+
function MutLog(string s)
106+
{
107+
log(s, 'SkipTrader');
108+
}
109+
110+
/////////////////////////////////////////////////////////////////////////
111+
// BELOW SECTION IS CREDITED FOR NikC //
112+
113+
// Apply Color Tags To Message
114+
function SetColor(out string Msg)
115+
{
116+
local int i;
117+
for(i=0; i<ColorList.Length; i++)
118+
{
119+
if(ColorList[i].ColorTag!="" && InStr(Msg, ColorList[i].ColorTag)!=-1)
120+
{
121+
ReplaceText(Msg, ColorList[i].ColorTag, FormatTagToColorCode(ColorList[i].ColorTag, ColorList[i].Color));
122+
}
123+
}
124+
}
125+
126+
// Format Color Tag to ColorCode
127+
function string FormatTagToColorCode(string Tag, Color Clr)
128+
{
129+
Tag=Class'GameInfo'.Static.MakeColorCode(Clr);
130+
Return Tag;
131+
}
132+
133+
function string RemoveColor(string S)
134+
{
135+
local int P;
136+
P=InStr(S,Chr(27));
137+
While(P>=0)
138+
{
139+
S=Left(S,P)$Mid(S,P+4);
140+
P=InStr(S,Chr(27));
141+
}
142+
Return S;
143+
}
144+
//////////////////////////////////////////////////////////////////////
145+
146+
defaultproperties
147+
{
148+
// Mandatory Vars
149+
GroupName = "KF-TraderBoostMut"
150+
FriendlyName = "Trader Booster - v1.0"
151+
Description = "Gives all players a speed boost on trader time; Made by Vel-San /w help of Marco"
152+
}

0 commit comments

Comments
 (0)