Skip to content

Commit

Permalink
Merge pull request #20 from shrimpza/608
Browse files Browse the repository at this point in the history
Monster Hunt 608
  • Loading branch information
shrimpza authored Feb 19, 2022
2 parents 40926c6 + 84f581c commit adb9a3a
Show file tree
Hide file tree
Showing 11 changed files with 128 additions and 113 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# Changelog
# Changelog

## 607 to 608:
- Re-worked and improved MH-NaliVillage]\[ map, included as MH-NaliVillage][-SE
- Include monster difficulty in scoreboard footer message
- Show objectives on scoreboard
- Reduce volume of objective activated/completed sounds
- Only include unfriendly creatures in monsters remaining count
- Tweak levers/waypoints in MH-NaliVillage]\[ map to prevent double-triggering by AI

## 606 to 607:
- Introduction of support for optional objectives in maps, which can show up on the HUD, and tell players what they need to be doing
Expand Down
4 changes: 2 additions & 2 deletions buildscript/buildconfig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ SCRIPTS_DIR=$(dirname $(realpath $0))

export name="Monster Hunt"
export package=MonsterHunt
export build=607
export version=607
export build=608
export version=608
export packagefull=$package
export packagedist=$package$version
export debug=1
Expand Down
10 changes: 10 additions & 0 deletions resources/Help/MonsterHunt/ReadMe.html
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,16 @@ <h2 id="credits">Credits</h2>
<section>
<h2 id="history">Release History</h2>

<h3>Release 14 (608)</h3>
<ul>
<li>Re-worked and improved MH-NaliVillage]\[ map, included as MH-NaliVillage][-SE
<li>Include monster difficulty in scoreboard footer message
<li>Show objectives on scoreboard
<li>Reduce volume of objective activated/completed sounds
<li>Only include unfriendly creatures in monsters remaining count
<li>Tweak levers/waypoints in MH-NaliVillage]\[ map to prevent double-triggering by AI
</ul>

<h3>Release 13 (607)</h3>
<ul>
<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
Expand Down
Binary file added resources/Maps/MH-NaliVillage][-SE.unr
Binary file not shown.
Binary file modified resources/Maps/MH-NaliVillage][.unr
Binary file not shown.
165 changes: 75 additions & 90 deletions src/Classes/MonsterBoard.uc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
class MonsterBoard extends TournamentScoreBoard;

var color LightGreenColor, DarkGreenColor;
var localized String MonsterDifficultyJoinString, ObjectivesString;

function DrawHeader(canvas Canvas) {
local GameReplicationInfo GRI;
Expand Down Expand Up @@ -57,47 +58,58 @@ function DrawTrailer(canvas Canvas) {
local int Hours, Minutes, Seconds;
local float XL, YL;
local PlayerPawn PlayerOwner;
local string TitleQuote;
local GameReplicationInfo GRI;
local string TitleQuote, DifficultyQuote;

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

if ((Level.NetMode == NM_Standalone) && Level.Game.IsA('DeathMatchPlus')) {
TitleQuote = PlayerOwner.GameReplicationInfo.GameName @ MapTitle @ MapTitleQuote $ Level.Title $ MapTitleQuote;
if (DeathMatchPlus(Level.Game).bRatedGame) {
Canvas.DrawText(DeathMatchPlus(Level.Game).RatedGameLadderObj.SkillText @ TitleQuote, true);
} else if (DeathMatchPlus(Level.Game).bNoviceMode) {
Canvas.DrawText(class'ChallengeBotInfo'.default.Skills[Level.Game.Difficulty] @ TitleQuote, true);
PlayerOwner = PlayerPawn(Owner);
GRI = PlayerPawn(Owner).GameReplicationInfo;

if (Level.Game.IsA('MonsterHunt') && GRI.IsA('MonsterReplicationInfo')) {
DifficultyQuote = class'MonsterHuntRules'.default.Skills[
class'MonsterHuntRules'.static.TranslateMonsterSkillIndex(MonsterReplicationInfo(GRI).MonsterSkill)
] @ MonsterDifficultyJoinString;
} else {
DifficultyQuote = "";
}

if ((Level.NetMode == NM_Standalone) && Level.Game.IsA('MonsterHunt')) {
TitleQuote = GRI.GameName @ MapTitle @ MapTitleQuote $ Level.Title $ MapTitleQuote;
if (DeathMatchPlus(Level.Game).bNoviceMode) {
TitleQuote = class'ChallengeBotInfo'.default.Skills[Level.Game.Difficulty] @ TitleQuote;
} else {
Canvas.DrawText(class'ChallengeBotInfo'.default.Skills[Level.Game.Difficulty + 4] @ TitleQuote, true);
TitleQuote = class'ChallengeBotInfo'.default.Skills[Level.Game.Difficulty + 4] @ TitleQuote;
}
} else {
Canvas.DrawText(PlayerOwner.GameReplicationInfo.GameName @ MapTitle @ Level.Title, true);
TitleQuote = GRI.GameName @ MapTitle @ Level.Title;
}

Canvas.DrawText(DifficultyQuote @ TitleQuote, true);

Canvas.SetPos(0, Canvas.ClipY - YL);
if (bTimeDown || (PlayerOwner.GameReplicationInfo.RemainingTime > 0)) {
if (bTimeDown || (GRI.RemainingTime > 0)) {
bTimeDown = true;
if (PlayerOwner.GameReplicationInfo.RemainingTime <= 0) {
if (GRI.RemainingTime <= 0) {
Canvas.DrawText(RemainingTime @ "00:00", true);
} else {
Minutes = PlayerOwner.GameReplicationInfo.RemainingTime / 60;
Seconds = PlayerOwner.GameReplicationInfo.RemainingTime % 60;
Minutes = GRI.RemainingTime / 60;
Seconds = GRI.RemainingTime % 60;
Canvas.DrawText(RemainingTime @ TwoDigitString(Minutes) $ ":" $ TwoDigitString(Seconds), true);
}
} else {
Seconds = PlayerOwner.GameReplicationInfo.ElapsedTime;
Seconds = GRI.ElapsedTime;
Minutes = Seconds / 60;
Hours = Minutes / 60;
Seconds = Seconds - (Minutes * 60);
Minutes = Minutes - (Hours * 60);
Canvas.DrawText(ElapsedTime @ TwoDigitString(Hours) $ ":" $ TwoDigitString(Minutes) $ ":" $ TwoDigitString(Seconds), true);
}

if (PlayerOwner.GameReplicationInfo.GameEndedComments != "") {
if (GRI.GameEndedComments != "") {
Canvas.bCenter = true;
Canvas.StrLen("Test", XL, YL);
Canvas.SetPos(0, Canvas.ClipY - Min(YL * 6, Canvas.ClipY * 0.1));
Expand All @@ -112,6 +124,8 @@ function DrawTrailer(canvas Canvas) {
Canvas.DrawText(Restart, true);
}
Canvas.bCenter = false;

DrawObjectivesList(Canvas);
}

function DrawCategoryHeaders(Canvas Canvas) {
Expand Down Expand Up @@ -196,96 +210,65 @@ function DrawNameAndPing(Canvas Canvas, PlayerReplicationInfo PRI, float XOffset
}
}
function SortScores(int N) {
local int I, J, Max;
local PlayerReplicationInfo TempPRI;
for (I = 0; I < N - 1; I++) {
Max = I;
for (J = I + 1; J < N; J++) {
if (Ordered[J].Score > Ordered[Max].Score) {
Max = J;
} else if ((Ordered[J].Score == Ordered[Max].Score) && (Ordered[J].Deaths < Ordered[Max].Deaths)) {
Max = J;
} else if ((Ordered[J].Score == Ordered[Max].Score) && (Ordered[J].Deaths == Ordered[Max].Deaths)
&& (Ordered[J].PlayerID < Ordered[Max].Score)) {
Max = J;
}
}
function DrawObjectivesList(Canvas Canvas) {
local float XL, YL, YOffset, XOffset;
local int i;
local MonsterReplicationInfo mri;
local MonsterHuntObjective obj;
local bool wasObjectives;
TempPRI = Ordered[Max];
Ordered[Max] = Ordered[I];
Ordered[I] = TempPRI;
}
}
if (PlayerPawn(Owner) == None) return;
function ShowScores(canvas Canvas) {
local PlayerReplicationInfo PRI;
local int PlayerCount, i;
local float XL, YL;
local float YOffset, YStart;
local font CanvasFont;
mri = MonsterReplicationInfo(PlayerPawn(Owner).GameReplicationInfo);
Canvas.Style = ERenderStyle.STY_Normal;
if (mri == None) return;
// Header
Canvas.SetPos(0, 0);
DrawHeader(Canvas);
Canvas.Font = MyFonts.GetBigFont(Canvas.ClipX);
Canvas.StrLen("Test", XL, YL);
// Wipe everything.
for (i = 0; i < ArrayCount(Ordered); i++) Ordered[i] = None;
for (i = 0; i < 32; i++) {
if (PlayerPawn(Owner).GameReplicationInfo.PRIArray[i] != None) {
PRI = PlayerPawn(Owner).GameReplicationInfo.PRIArray[i];
if (!PRI.bIsSpectator || PRI.bWaitingPlayer) {
Ordered[PlayerCount] = PRI;
PlayerCount++;
YOffset = Canvas.ClipY - (YL * 6);
XOffset = Canvas.ClipX * 0.1875; // in line with names list
if (PlayerCount == ArrayCount(Ordered)) break;
}
for (i = 15; i >= 0; i--) { // rendering bottom-up
obj = mri.objectives[i];
if (obj == None) continue;
if (!obj.bActive && !obj.bAlwaysShown) {
if (!obj.bCompleted || (obj.bCompleted && !obj.bShowWhenComplete)) continue;
}
}
SortScores(PlayerCount);
CanvasFont = Canvas.Font;
Canvas.Font = MyFonts.GetBigFont(Canvas.ClipX);
if (!obj.bActive) {
Canvas.Style = ERenderStyle.STY_Translucent;
Canvas.DrawColor = WhiteColor * 0.5;
} else {
Canvas.DrawColor = GoldColor;
}
Canvas.SetPos(0, 160.0 / 768.0 * Canvas.ClipY);
DrawCategoryHeaders(Canvas);
Canvas.SetPos(XOffset + YL, YOffset);
Canvas.DrawText(obj.message, False);
Canvas.StrLen("TEST", XL, YL);
YStart = Canvas.CurY;
YOffset = YStart;
if (PlayerCount > 15) PlayerCount = FMin(PlayerCount, (Canvas.ClipY - YStart) / YL - 1);
Canvas.Style = ERenderStyle.STY_Translucent;
Canvas.SetPos(XOffset + 4, YOffset + 4);
if (obj.bCompleted) {
Canvas.DrawTile(Texture'{{package}}.Hud.ObjComplete', (YL - 8), (YL - 8), 0, 0, 32, 32);
} else {
Canvas.DrawTile(Texture'{{package}}.Hud.ObjIncomplete', (YL - 8), (YL - 8), 0, 0, 32, 32);
}
Canvas.Style = Style;
Canvas.SetPos(0, 0);
for (I = 0; I < PlayerCount; I++) {
YOffset = YStart + I * YL;
DrawNameAndPing(Canvas, Ordered[I], 0, YOffset, false);
YOffset -= YL;
wasObjectives = true;
}
Canvas.DrawColor = LightGreenColor;
Canvas.Font = CanvasFont;
// Trailer
if (!Level.bLowRes) {
Canvas.Font = MyFonts.GetSmallFont(Canvas.ClipX);
DrawTrailer(Canvas);
if (wasObjectives) {
Canvas.SetPos(XOffset, YOffset);
Canvas.DrawColor = GreenColor;
Canvas.DrawText(ObjectivesString, False);
}
Canvas.DrawColor = WhiteColor;
Canvas.Font = CanvasFont;
}
defaultproperties {
GreenColor=(G=255)
WhiteColor=(R=255, G=255, B=255)
GoldColor=(R=255, G=255)
BlueColor=(B=255)
LightCyanColor=(R=128, G=255, B=255)
SilverColor=(R=138, G=164, B=166)
BronzeColor=(R=203, G=147, B=52)
CyanColor=(G=128, B=255)
RedColor=(R=255)
defaultproperties
LightGreenColor=(G=136)
DarkGreenColor=(G=255, B=128)
Restart="You have been killed. Hit [Fire] to continue the hunt!"
Expand All @@ -294,4 +277,6 @@ defaultproperties {
PlayerString="Hunter"
FragsString="Score"
DeathsString="Lives"
MonsterDifficultyJoinString="Monsters /"
ObjectivesString="Objectives"
}
6 changes: 3 additions & 3 deletions src/Classes/MonsterHUD.uc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ simulated function DrawGameSynopsis(Canvas Canvas) {
obj = mri.objectives[i];
if (obj != None) {
if (!obj.bActive && !obj.bAlwaysShown) {
if (!obj.bCompleted || (obj.bCompleted && !obj.bShowWhenComplete)) continue;
if (!obj.bCompleted || (obj.bCompleted && !obj.bShowWhenComplete)) continue;
}
if (!obj.bActive) {
Canvas.Style = ERenderStyle.STY_Translucent;
Expand All @@ -114,9 +114,9 @@ simulated function DrawGameSynopsis(Canvas Canvas) {
Canvas.Style = ERenderStyle.STY_Translucent;
Canvas.SetPos(XOffset + 4, YOffset + 4);
if (obj.bCompleted) {
Canvas.DrawTile(Texture'{{package}}.Hud.ObjComplete', (YL - 8) * Scale, (YL - 8) * Scale, 0, 0, 32, 32);
Canvas.DrawTile(Texture'{{package}}.Hud.ObjComplete', (YL - 8), (YL - 8), 0, 0, 32, 32);
} else {
Canvas.DrawTile(Texture'{{package}}.Hud.ObjIncomplete', (YL - 8) * Scale, (YL - 8) * Scale, 0, 0, 32, 32);
Canvas.DrawTile(Texture'{{package}}.Hud.ObjIncomplete', (YL - 8), (YL - 8), 0, 0, 32, 32);
}
Canvas.Style = Style;
Expand Down
20 changes: 14 additions & 6 deletions src/Classes/MonsterHunt.uc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ function InitGameReplicationInfo() {
mri.Lives = Lives;
mri.bUseTeamSkins = bUseTeamSkins;
mri.bUseLives = Lives > 0;
mri.MonsterSkill = MonsterSkill;
}
}

Expand Down Expand Up @@ -665,7 +666,12 @@ function CountMonsters() {
local int monsterCount;

monsterCount = 0;
foreach AllActors(class'ScriptedPawn', S) if (S.Health >= 1) monsterCount ++;
foreach AllActors(class'ScriptedPawn', S) {
if (S.Health >= 1) {
if ((S.IsA('Nali') || S.IsA('Cow')) && !MaybeEvilFriendlyPawn(S)) continue;
monsterCount ++;
}
}

MonsterReplicationInfo(GameReplicationInfo).Monsters = monsterCount;
}
Expand Down Expand Up @@ -869,16 +875,18 @@ function byte AssessBotAttitude(Bot aBot, Pawn Other) {
return super(DeathMatchPlus).AssessBotAttitude(aBot, Other);
}
function bool MaybeEvilFriendlyPawn(ScriptedPawn Pawn, Pawn Other) {
function bool MaybeEvilFriendlyPawn(ScriptedPawn Pawn, optional Pawn Other) {
switch (Pawn.Default.AttitudeToPlayer) {
case ATTITUDE_Hate:
case ATTITUDE_Frenzy:
return true;
default:
switch (Pawn.AttitudeToCreature(Other)) {
case ATTITUDE_Hate:
case ATTITUDE_Frenzy:
return true;
if (Other != None) {
switch (Pawn.AttitudeToCreature(Other)) {
case ATTITUDE_Hate:
case ATTITUDE_Frenzy:
return true;
}
}
}
return false;
Expand Down
4 changes: 2 additions & 2 deletions src/Classes/MonsterHuntObjective.uc
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ function Trigger(Actor Other, Pawn EventInstigator) {

if (!bInitiallyActive && !bActive && SoundActivated != None) {
for (P = Level.PawnList; P != None; P = P.nextPawn) {
if (P.bIsPlayer) P.PlaySound(SoundActivated, SLOT_Interface, 2.0);
if (P.bIsPlayer) P.PlaySound(SoundActivated, SLOT_Interface, 1.5);
}
}

if (bCompleted && SoundCompleted != None) {
for (P = Level.PawnList; P != None; P = P.nextPawn) {
if (P.bIsPlayer) P.PlaySound(SoundCompleted, SLOT_Interface, 2.0);
if (P.bIsPlayer) P.PlaySound(SoundCompleted, SLOT_Interface, 1.5);
}
}

Expand Down
Loading

0 comments on commit adb9a3a

Please sign in to comment.