colored, cutom loading hints

This commit is contained in:
Shtoyan 2022-02-25 15:50:51 +04:00
parent af04a01d46
commit 665e19303b
2 changed files with 84 additions and 14 deletions

View File

@ -1,8 +1,10 @@
// made to fix KFStoryGameInfo loading for KFO maps
class NiceGameType extends ScrnGameType;
var NicePack NicePackMutator;
var bool lessDramatic;
var float LesserZedTimeSlomoScale;
function RegisterMutator(NicePack activePack){
NicePackMutator = activePack;
}
@ -77,7 +79,7 @@ function ScoreKill(Controller Killer, Controller Other)
local Controller C;
OtherPRI = Other.PlayerReplicationInfo;
if ( OtherPRI != None )
if ( OtherPRI != none )
{
OtherPRI.NumLives++;
OtherPRI.Score -= (OtherPRI.Score * (GameDifficulty * 0.05)); // you Lose 35% of your current cash on Hell on Earth, 15% on normal.
@ -90,23 +92,23 @@ function ScoreKill(Controller Killer, Controller Other)
OtherPRI.Team.NetUpdateTime = Level.TimeSeconds - 1;
OtherPRI.bOutOfLives = true;
if( Killer!=None && Killer.PlayerReplicationInfo!=None && Killer.bIsPlayer )
if( Killer!=none && Killer.PlayerReplicationInfo!=none && Killer.bIsPlayer )
BroadcastLocalizedMessage(class'KFInvasionMessage',1,OtherPRI,Killer.PlayerReplicationInfo);
else if( Killer==None || Monster(Killer.Pawn)==None )
else if( Killer==none || Monster(Killer.Pawn)==none )
BroadcastLocalizedMessage(class'KFInvasionMessage',1,OtherPRI);
else BroadcastLocalizedMessage(class'KFInvasionMessage',1,OtherPRI,,Killer.Pawn.Class);
CheckScore(None);
CheckScore(none);
}
if ( GameRulesModifiers != None )
if ( GameRulesModifiers != none )
GameRulesModifiers.ScoreKill(Killer, Other);
if ( MonsterController(Killer) != None )
if ( MonsterController(Killer) != none )
return;
if( (killer == Other) || (killer == None) )
if( (killer == Other) || (killer == none) )
{
if ( Other.PlayerReplicationInfo != None )
if ( Other.PlayerReplicationInfo != none )
{
Other.PlayerReplicationInfo.Score -= 1;
Other.PlayerReplicationInfo.NetUpdateTime = Level.TimeSeconds - 1;
@ -114,7 +116,7 @@ function ScoreKill(Controller Killer, Controller Other)
}
}
if ( Killer==None || !Killer.bIsPlayer || (Killer==Other) )
if ( Killer==none || !Killer.bIsPlayer || (Killer==Other) )
return;
if ( Other.bIsPlayer )
@ -126,7 +128,7 @@ function ScoreKill(Controller Killer, Controller Other)
ScoreEvent(Killer.PlayerReplicationInfo, -5, "team_frag");
return;
}
if ( LastKilledMonsterClass == None )
if ( LastKilledMonsterClass == none )
KillScore = 1;
else if(Killer.PlayerReplicationInfo !=none)
{
@ -179,9 +181,9 @@ function ScoreKill(Controller Killer, Controller Other)
if( Class'HUDKillingFloor'.Default.MessageHealthLimit<=Other.Pawn.Default.Health ||
Class'HUDKillingFloor'.Default.MessageMassLimit<=Other.Pawn.Default.Mass )
{
for( C=Level.ControllerList; C!=None; C=C.nextController )
for( C=Level.ControllerList; C!=none; C=C.nextController )
{
if( C.bIsPlayer && xPlayer(C)!=None )
if( C.bIsPlayer && xPlayer(C)!=none )
{
xPlayer(C).ReceiveLocalizedMessage(Class'KillsMessage',1,Killer.PlayerReplicationInfo,,Other.Pawn.Class);
}
@ -189,7 +191,7 @@ function ScoreKill(Controller Killer, Controller Other)
}
else
{
if( xPlayer(Killer)!=None )
if( xPlayer(Killer)!=none )
{
xPlayer(Killer).ReceiveLocalizedMessage(Class'KillsMessage',,,,Other.Pawn.Class);
}
@ -303,10 +305,26 @@ function int ReduceDamage(int Damage, pawn injured, pawn instigatedBy, vector Hi
}
return Super.ReduceDamage(Damage, injured, InstigatedBy, HitLocation, Momentum, DamageType);
}
// HINTS: override to make fancy loading creen hints
static function string GetLoadingHint(PlayerController pc, string MapName, Color ColorHint)
{
// call super code just to draw the map icon and description
super.GetLoadingHint(pc, MapName, ColorHint);
// return colored and custom HINTS
return class'Utility'.static.GetNiceHint();
}
// HINTS: override to make fancy ingame menu hints
static function array<string> GetAllLoadHints(optional bool bThisClassOnly)
{
return class'Utility'.static.GetNiceHintArray();
}
defaultproperties
{
GameName="Nice Floor"
Description="Nice Edition of ScrN Killing Floor game mode (ScrnGameType)."
ZedTimeSlomoScale=0.4
LesserZedTimeSlomoScale=0.6
}
}

52
sources/Utility.uc Normal file
View File

@ -0,0 +1,52 @@
class Utility extends object
abstract;
// custom, colored hints
var const array<string> NiceHints;
final static function string GetNiceHint()
{
local string white, blue;
white = chr(27) $ chr(200) $ chr(200) $ chr(200);
blue = chr(27) $ chr(1) $ chr(100) $ chr(200);
return white $ "Nice Floor: " $ blue $ default.NiceHints[rand(default.NiceHints.Length)];
}
final static function array<string> GetNiceHintArray()
{
local int i;
local string white, blue;
local array<string> Hints;
white = chr(27) $ chr(200) $ chr(200) $ chr(200);
blue = chr(27) $ chr(1) $ chr(100) $ chr(200);
for ( i = 0; i < default.NiceHints.Length; i++ )
Hints[Hints.Length] = white $ "Nice Floor: " $ blue $ default.NiceHints[i];
return Hints;
}
defaultproperties
{
// 'funny', customized hints
NiceHints[00]="Most weapons are clientside, so aim for the heads!"
NiceHints[01]="If you feel this is hard, you are not alone."
NiceHints[02]="This mode will always be in alpha state. Kill your hope."
NiceHints[03]="Only KAIO is able to compile this."
NiceHints[04]="We really hate kiting, so we made camping much harder."
NiceHints[05]="We love camping, so we made kiting almost impossible."
NiceHints[06]="You can play this if you beat 5 faked / 6p HP zeds."
NiceHints[07]="Hold or Die!"
NiceHints[08]="The Wipe Train has no breaks."
NiceHints[09]="We are glad to hear your wishes and requests. Just remember we are super lazy."
NiceHints[10]="If you die - always blame dkanus."
NiceHints[11]="If nothing works - it's intended."
NiceHints[12]="If you find any bug, we can make it a feature."
NiceHints[13]="Play this only if you don't have real life."
NiceHints[14]="You suck and we hate you."
NiceHints[15]="GITGUD"
NiceHints[16]="Git ur shit bucket."
}