@@ -94,6 +94,7 @@ function bool IsRelevant(Actor Other) {
9494 pawn = ScriptedPawn (Other );
9595 if (pawn != None ) {
9696 SetPawnDifficulty (MonsterSkill , pawn );
97+ pawn .MenuName = FancyName (pawn );
9798
9899 if (Level .NetMode != NM_DedicatedServer ) {
99100 if (pawn .Shadow == None ) pawn .Shadow = Spawn (class 'MonsterShadow' , pawn );
@@ -138,9 +139,43 @@ function SetPawnDifficulty(int MonsterSkill, ScriptedPawn S) {
138139 if (bGameStarted ) S .AttitudeToPlayer = ATTITUDE_Hate ;
139140 else S .AttitudeToPlayer = ATTITUDE_Ignore ;
140141 }
142+ }
143+
144+ function String FancyName (Pawn Other , optional Bool upperArticle ) {
145+ local ScriptedPawn S ;
146+ local String baseName , newName , c ;
147+ local int i , a , p ;
148+
149+ S = ScriptedPawn (Other );
150+ if (S == None ) return Other .MenuName ;
151+
152+ baseName = S .MenuName ;
153+ if (baseName == "" ) baseName = GetItemName (String (S .class ));
154+
155+ newName = Left (baseName , 1 );
156+ for (i = 1 ; i < Len (baseName ); i ++) {
157+ c = Mid (baseName , i , 1 );
158+ p = Asc (Mid (baseName , i -1 , 1 ));
159+ a = Asc (c );
160+ if (a >= 65 && a <= 90 && p >= 97 && p <= 122 ) newName = newName @ c ;
161+ else newName = newName $ c ;
162+ }
163+
164+ return newName ;
165+ }
166+
167+ function String UppercaseFirst (String S ) {
168+ local String trimmed , c ;
169+ local int i , start ;
170+
171+ for (i = 0 ; i < Len (S ); i ++) {
172+ if (Mid (S , i , 1 ) != " " ) {
173+ trimmed = Mid (S , i );
174+ break ;
175+ }
176+ }
141177
142- S .TeamTag = 'MHMonsterTeam' ;
143- S .Team = 128 ;
178+ return Caps (Left (trimmed , 1 )) $ Mid (trimmed , 1 );
144179}
145180
146181function AddDefaultInventory (pawn PlayerPawn ) {
0 commit comments