Skip to content

Commit adb9a3a

Browse files
authored
Merge pull request #20 from shrimpza/608
Monster Hunt 608
2 parents 40926c6 + 84f581c commit adb9a3a

File tree

11 files changed

+128
-113
lines changed

11 files changed

+128
-113
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
# Changelog
1+
# Changelog
2+
3+
## 607 to 608:
4+
- Re-worked and improved MH-NaliVillage]\[ map, included as MH-NaliVillage][-SE
5+
- Include monster difficulty in scoreboard footer message
6+
- Show objectives on scoreboard
7+
- Reduce volume of objective activated/completed sounds
8+
- Only include unfriendly creatures in monsters remaining count
9+
- Tweak levers/waypoints in MH-NaliVillage]\[ map to prevent double-triggering by AI
210

311
## 606 to 607:
412
- Introduction of support for optional objectives in maps, which can show up on the HUD, and tell players what they need to be doing

buildscript/buildconfig.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ SCRIPTS_DIR=$(dirname $(realpath $0))
77

88
export name="Monster Hunt"
99
export package=MonsterHunt
10-
export build=607
11-
export version=607
10+
export build=608
11+
export version=608
1212
export packagefull=$package
1313
export packagedist=$package$version
1414
export debug=1

resources/Help/MonsterHunt/ReadMe.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,16 @@ <h2 id="credits">Credits</h2>
306306
<section>
307307
<h2 id="history">Release History</h2>
308308

309+
<h3>Release 14 (608)</h3>
310+
<ul>
311+
<li>Re-worked and improved MH-NaliVillage]\[ map, included as MH-NaliVillage][-SE
312+
<li>Include monster difficulty in scoreboard footer message
313+
<li>Show objectives on scoreboard
314+
<li>Reduce volume of objective activated/completed sounds
315+
<li>Only include unfriendly creatures in monsters remaining count
316+
<li>Tweak levers/waypoints in MH-NaliVillage]\[ map to prevent double-triggering by AI
317+
</ul>
318+
309319
<h3>Release 13 (607)</h3>
310320
<ul>
311321
<li>Introduction of support for optional objectives in maps, which can show up on the HUD, and tell players what they need to be doing
2.75 MB
Binary file not shown.
-507 Bytes
Binary file not shown.

src/Classes/MonsterBoard.uc

Lines changed: 75 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
class MonsterBoard extends TournamentScoreBoard;
1111

1212
var color LightGreenColor, DarkGreenColor;
13+
var localized String MonsterDifficultyJoinString, ObjectivesString;
1314

1415
function DrawHeader(canvas Canvas) {
1516
local GameReplicationInfo GRI;
@@ -57,47 +58,58 @@ function DrawTrailer(canvas Canvas) {
5758
local int Hours, Minutes, Seconds;
5859
local float XL, YL;
5960
local PlayerPawn PlayerOwner;
60-
local string TitleQuote;
61+
local GameReplicationInfo GRI;
62+
local string TitleQuote, DifficultyQuote;
6163

6264
Canvas.bCenter = true;
6365
Canvas.StrLen("Test", XL, YL);
6466
Canvas.DrawColor = LightGreenColor;
65-
PlayerOwner = PlayerPawn(Owner);
6667
Canvas.SetPos(0, Canvas.ClipY - 2 * YL);
6768

68-
if ((Level.NetMode == NM_Standalone) && Level.Game.IsA('DeathMatchPlus')) {
69-
TitleQuote = PlayerOwner.GameReplicationInfo.GameName @ MapTitle @ MapTitleQuote $ Level.Title $ MapTitleQuote;
70-
if (DeathMatchPlus(Level.Game).bRatedGame) {
71-
Canvas.DrawText(DeathMatchPlus(Level.Game).RatedGameLadderObj.SkillText @ TitleQuote, true);
72-
} else if (DeathMatchPlus(Level.Game).bNoviceMode) {
73-
Canvas.DrawText(class'ChallengeBotInfo'.default.Skills[Level.Game.Difficulty] @ TitleQuote, true);
69+
PlayerOwner = PlayerPawn(Owner);
70+
GRI = PlayerPawn(Owner).GameReplicationInfo;
71+
72+
if (Level.Game.IsA('MonsterHunt') && GRI.IsA('MonsterReplicationInfo')) {
73+
DifficultyQuote = class'MonsterHuntRules'.default.Skills[
74+
class'MonsterHuntRules'.static.TranslateMonsterSkillIndex(MonsterReplicationInfo(GRI).MonsterSkill)
75+
] @ MonsterDifficultyJoinString;
76+
} else {
77+
DifficultyQuote = "";
78+
}
79+
80+
if ((Level.NetMode == NM_Standalone) && Level.Game.IsA('MonsterHunt')) {
81+
TitleQuote = GRI.GameName @ MapTitle @ MapTitleQuote $ Level.Title $ MapTitleQuote;
82+
if (DeathMatchPlus(Level.Game).bNoviceMode) {
83+
TitleQuote = class'ChallengeBotInfo'.default.Skills[Level.Game.Difficulty] @ TitleQuote;
7484
} else {
75-
Canvas.DrawText(class'ChallengeBotInfo'.default.Skills[Level.Game.Difficulty + 4] @ TitleQuote, true);
85+
TitleQuote = class'ChallengeBotInfo'.default.Skills[Level.Game.Difficulty + 4] @ TitleQuote;
7686
}
7787
} else {
78-
Canvas.DrawText(PlayerOwner.GameReplicationInfo.GameName @ MapTitle @ Level.Title, true);
88+
TitleQuote = GRI.GameName @ MapTitle @ Level.Title;
7989
}
8090

91+
Canvas.DrawText(DifficultyQuote @ TitleQuote, true);
92+
8193
Canvas.SetPos(0, Canvas.ClipY - YL);
82-
if (bTimeDown || (PlayerOwner.GameReplicationInfo.RemainingTime > 0)) {
94+
if (bTimeDown || (GRI.RemainingTime > 0)) {
8395
bTimeDown = true;
84-
if (PlayerOwner.GameReplicationInfo.RemainingTime <= 0) {
96+
if (GRI.RemainingTime <= 0) {
8597
Canvas.DrawText(RemainingTime @ "00:00", true);
8698
} else {
87-
Minutes = PlayerOwner.GameReplicationInfo.RemainingTime / 60;
88-
Seconds = PlayerOwner.GameReplicationInfo.RemainingTime % 60;
99+
Minutes = GRI.RemainingTime / 60;
100+
Seconds = GRI.RemainingTime % 60;
89101
Canvas.DrawText(RemainingTime @ TwoDigitString(Minutes) $ ":" $ TwoDigitString(Seconds), true);
90102
}
91103
} else {
92-
Seconds = PlayerOwner.GameReplicationInfo.ElapsedTime;
104+
Seconds = GRI.ElapsedTime;
93105
Minutes = Seconds / 60;
94106
Hours = Minutes / 60;
95107
Seconds = Seconds - (Minutes * 60);
96108
Minutes = Minutes - (Hours * 60);
97109
Canvas.DrawText(ElapsedTime @ TwoDigitString(Hours) $ ":" $ TwoDigitString(Minutes) $ ":" $ TwoDigitString(Seconds), true);
98110
}
99111

100-
if (PlayerOwner.GameReplicationInfo.GameEndedComments != "") {
112+
if (GRI.GameEndedComments != "") {
101113
Canvas.bCenter = true;
102114
Canvas.StrLen("Test", XL, YL);
103115
Canvas.SetPos(0, Canvas.ClipY - Min(YL * 6, Canvas.ClipY * 0.1));
@@ -112,6 +124,8 @@ function DrawTrailer(canvas Canvas) {
112124
Canvas.DrawText(Restart, true);
113125
}
114126
Canvas.bCenter = false;
127+
128+
DrawObjectivesList(Canvas);
115129
}
116130

117131
function DrawCategoryHeaders(Canvas Canvas) {
@@ -196,96 +210,65 @@ function DrawNameAndPing(Canvas Canvas, PlayerReplicationInfo PRI, float XOffset
196210
}
197211
}
198212
199-
function SortScores(int N) {
200-
local int I, J, Max;
201-
local PlayerReplicationInfo TempPRI;
202-
203-
for (I = 0; I < N - 1; I++) {
204-
Max = I;
205-
for (J = I + 1; J < N; J++) {
206-
if (Ordered[J].Score > Ordered[Max].Score) {
207-
Max = J;
208-
} else if ((Ordered[J].Score == Ordered[Max].Score) && (Ordered[J].Deaths < Ordered[Max].Deaths)) {
209-
Max = J;
210-
} else if ((Ordered[J].Score == Ordered[Max].Score) && (Ordered[J].Deaths == Ordered[Max].Deaths)
211-
&& (Ordered[J].PlayerID < Ordered[Max].Score)) {
212-
Max = J;
213-
}
214-
}
213+
function DrawObjectivesList(Canvas Canvas) {
214+
local float XL, YL, YOffset, XOffset;
215+
local int i;
216+
local MonsterReplicationInfo mri;
217+
local MonsterHuntObjective obj;
218+
local bool wasObjectives;
215219
216-
TempPRI = Ordered[Max];
217-
Ordered[Max] = Ordered[I];
218-
Ordered[I] = TempPRI;
219-
}
220-
}
220+
if (PlayerPawn(Owner) == None) return;
221221
222-
function ShowScores(canvas Canvas) {
223-
local PlayerReplicationInfo PRI;
224-
local int PlayerCount, i;
225-
local float XL, YL;
226-
local float YOffset, YStart;
227-
local font CanvasFont;
222+
mri = MonsterReplicationInfo(PlayerPawn(Owner).GameReplicationInfo);
228223
229-
Canvas.Style = ERenderStyle.STY_Normal;
224+
if (mri == None) return;
230225
231-
// Header
232-
Canvas.SetPos(0, 0);
233-
DrawHeader(Canvas);
226+
Canvas.Font = MyFonts.GetBigFont(Canvas.ClipX);
227+
Canvas.StrLen("Test", XL, YL);
234228
235-
// Wipe everything.
236-
for (i = 0; i < ArrayCount(Ordered); i++) Ordered[i] = None;
237-
for (i = 0; i < 32; i++) {
238-
if (PlayerPawn(Owner).GameReplicationInfo.PRIArray[i] != None) {
239-
PRI = PlayerPawn(Owner).GameReplicationInfo.PRIArray[i];
240-
if (!PRI.bIsSpectator || PRI.bWaitingPlayer) {
241-
Ordered[PlayerCount] = PRI;
242-
PlayerCount++;
229+
YOffset = Canvas.ClipY - (YL * 6);
230+
XOffset = Canvas.ClipX * 0.1875; // in line with names list
243231
244-
if (PlayerCount == ArrayCount(Ordered)) break;
245-
}
232+
for (i = 15; i >= 0; i--) { // rendering bottom-up
233+
obj = mri.objectives[i];
234+
if (obj == None) continue;
235+
if (!obj.bActive && !obj.bAlwaysShown) {
236+
if (!obj.bCompleted || (obj.bCompleted && !obj.bShowWhenComplete)) continue;
246237
}
247-
}
248238
249-
SortScores(PlayerCount);
250-
251-
CanvasFont = Canvas.Font;
252-
Canvas.Font = MyFonts.GetBigFont(Canvas.ClipX);
239+
if (!obj.bActive) {
240+
Canvas.Style = ERenderStyle.STY_Translucent;
241+
Canvas.DrawColor = WhiteColor * 0.5;
242+
} else {
243+
Canvas.DrawColor = GoldColor;
244+
}
253245
254-
Canvas.SetPos(0, 160.0 / 768.0 * Canvas.ClipY);
255-
DrawCategoryHeaders(Canvas);
246+
Canvas.SetPos(XOffset + YL, YOffset);
247+
Canvas.DrawText(obj.message, False);
256248
257-
Canvas.StrLen("TEST", XL, YL);
258-
YStart = Canvas.CurY;
259-
YOffset = YStart;
260-
if (PlayerCount > 15) PlayerCount = FMin(PlayerCount, (Canvas.ClipY - YStart) / YL - 1);
249+
Canvas.Style = ERenderStyle.STY_Translucent;
250+
Canvas.SetPos(XOffset + 4, YOffset + 4);
251+
if (obj.bCompleted) {
252+
Canvas.DrawTile(Texture'{{package}}.Hud.ObjComplete', (YL - 8), (YL - 8), 0, 0, 32, 32);
253+
} else {
254+
Canvas.DrawTile(Texture'{{package}}.Hud.ObjIncomplete', (YL - 8), (YL - 8), 0, 0, 32, 32);
255+
}
256+
257+
Canvas.Style = Style;
261258
262-
Canvas.SetPos(0, 0);
263-
for (I = 0; I < PlayerCount; I++) {
264-
YOffset = YStart + I * YL;
265-
DrawNameAndPing(Canvas, Ordered[I], 0, YOffset, false);
259+
YOffset -= YL;
260+
261+
wasObjectives = true;
266262
}
267-
Canvas.DrawColor = LightGreenColor;
268-
Canvas.Font = CanvasFont;
269263
270-
// Trailer
271-
if (!Level.bLowRes) {
272-
Canvas.Font = MyFonts.GetSmallFont(Canvas.ClipX);
273-
DrawTrailer(Canvas);
264+
if (wasObjectives) {
265+
Canvas.SetPos(XOffset, YOffset);
266+
Canvas.DrawColor = GreenColor;
267+
Canvas.DrawText(ObjectivesString, False);
274268
}
275-
Canvas.DrawColor = WhiteColor;
276-
Canvas.Font = CanvasFont;
277269
}
278270
279-
defaultproperties {
280-
GreenColor=(G=255)
281-
WhiteColor=(R=255, G=255, B=255)
282-
GoldColor=(R=255, G=255)
283-
BlueColor=(B=255)
284-
LightCyanColor=(R=128, G=255, B=255)
285-
SilverColor=(R=138, G=164, B=166)
286-
BronzeColor=(R=203, G=147, B=52)
287-
CyanColor=(G=128, B=255)
288-
RedColor=(R=255)
271+
defaultproperties
289272
LightGreenColor=(G=136)
290273
DarkGreenColor=(G=255, B=128)
291274
Restart="You have been killed. Hit [Fire] to continue the hunt!"
@@ -294,4 +277,6 @@ defaultproperties {
294277
PlayerString="Hunter"
295278
FragsString="Score"
296279
DeathsString="Lives"
280+
MonsterDifficultyJoinString="Monsters /"
281+
ObjectivesString="Objectives"
297282
}

src/Classes/MonsterHUD.uc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ simulated function DrawGameSynopsis(Canvas Canvas) {
9999
obj = mri.objectives[i];
100100
if (obj != None) {
101101
if (!obj.bActive && !obj.bAlwaysShown) {
102-
if (!obj.bCompleted || (obj.bCompleted && !obj.bShowWhenComplete)) continue;
102+
if (!obj.bCompleted || (obj.bCompleted && !obj.bShowWhenComplete)) continue;
103103
}
104104
if (!obj.bActive) {
105105
Canvas.Style = ERenderStyle.STY_Translucent;
@@ -114,9 +114,9 @@ simulated function DrawGameSynopsis(Canvas Canvas) {
114114
Canvas.Style = ERenderStyle.STY_Translucent;
115115
Canvas.SetPos(XOffset + 4, YOffset + 4);
116116
if (obj.bCompleted) {
117-
Canvas.DrawTile(Texture'{{package}}.Hud.ObjComplete', (YL - 8) * Scale, (YL - 8) * Scale, 0, 0, 32, 32);
117+
Canvas.DrawTile(Texture'{{package}}.Hud.ObjComplete', (YL - 8), (YL - 8), 0, 0, 32, 32);
118118
} else {
119-
Canvas.DrawTile(Texture'{{package}}.Hud.ObjIncomplete', (YL - 8) * Scale, (YL - 8) * Scale, 0, 0, 32, 32);
119+
Canvas.DrawTile(Texture'{{package}}.Hud.ObjIncomplete', (YL - 8), (YL - 8), 0, 0, 32, 32);
120120
}
121121
122122
Canvas.Style = Style;

src/Classes/MonsterHunt.uc

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ function InitGameReplicationInfo() {
5656
mri.Lives = Lives;
5757
mri.bUseTeamSkins = bUseTeamSkins;
5858
mri.bUseLives = Lives > 0;
59+
mri.MonsterSkill = MonsterSkill;
5960
}
6061
}
6162

@@ -665,7 +666,12 @@ function CountMonsters() {
665666
local int monsterCount;
666667

667668
monsterCount = 0;
668-
foreach AllActors(class'ScriptedPawn', S) if (S.Health >= 1) monsterCount ++;
669+
foreach AllActors(class'ScriptedPawn', S) {
670+
if (S.Health >= 1) {
671+
if ((S.IsA('Nali') || S.IsA('Cow')) && !MaybeEvilFriendlyPawn(S)) continue;
672+
monsterCount ++;
673+
}
674+
}
669675

670676
MonsterReplicationInfo(GameReplicationInfo).Monsters = monsterCount;
671677
}
@@ -869,16 +875,18 @@ function byte AssessBotAttitude(Bot aBot, Pawn Other) {
869875
return super(DeathMatchPlus).AssessBotAttitude(aBot, Other);
870876
}
871877
872-
function bool MaybeEvilFriendlyPawn(ScriptedPawn Pawn, Pawn Other) {
878+
function bool MaybeEvilFriendlyPawn(ScriptedPawn Pawn, optional Pawn Other) {
873879
switch (Pawn.Default.AttitudeToPlayer) {
874880
case ATTITUDE_Hate:
875881
case ATTITUDE_Frenzy:
876882
return true;
877883
default:
878-
switch (Pawn.AttitudeToCreature(Other)) {
879-
case ATTITUDE_Hate:
880-
case ATTITUDE_Frenzy:
881-
return true;
884+
if (Other != None) {
885+
switch (Pawn.AttitudeToCreature(Other)) {
886+
case ATTITUDE_Hate:
887+
case ATTITUDE_Frenzy:
888+
return true;
889+
}
882890
}
883891
}
884892
return false;

src/Classes/MonsterHuntObjective.uc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ function Trigger(Actor Other, Pawn EventInstigator) {
7171

7272
if (!bInitiallyActive && !bActive && SoundActivated != None) {
7373
for (P = Level.PawnList; P != None; P = P.nextPawn) {
74-
if (P.bIsPlayer) P.PlaySound(SoundActivated, SLOT_Interface, 2.0);
74+
if (P.bIsPlayer) P.PlaySound(SoundActivated, SLOT_Interface, 1.5);
7575
}
7676
}
7777

7878
if (bCompleted && SoundCompleted != None) {
7979
for (P = Level.PawnList; P != None; P = P.nextPawn) {
80-
if (P.bIsPlayer) P.PlaySound(SoundCompleted, SLOT_Interface, 2.0);
80+
if (P.bIsPlayer) P.PlaySound(SoundCompleted, SLOT_Interface, 1.5);
8181
}
8282
}
8383

0 commit comments

Comments
 (0)