Skip to content

Commit

Permalink
Merge pull request #17 from shrimpza/605
Browse files Browse the repository at this point in the history
Monster Hunt 605
  • Loading branch information
shrimpza authored Jan 26, 2022
2 parents d51e43f + 15711d2 commit d05820d
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 604 to 605:
- Remove automatically assigning monsters to team
- Show monster names better, "KrallElite" becomes "Krall Elite"
- Grammatically correct escape message

## 603 to 604:
- Fix saving of game rule settings
- Refactor scoring implementation, including default scores for more monster types
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
Monster Hunt is a team based modification for Unreal Tournament comprising two
new game types, Monster Hunt, Monster Arena, and Monster Defence.

![](https://i.imgur.com/N6g9JBj.gif)
![](https://i.imgur.com/RnnNFtV.gif)
![](https://i.imgur.com/2tK2kiZ.gif)
![](https://i.imgur.com/YxNhO7u.gif)

In *Monster Hunt*, you and your team of hunters (humans or bots) must work your
way through the level while killing everything that stands in your way.
Monsters you'll face range from the tiny but deadly Pupae, to slimy Sliths
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=604
export version=604
export build=605
export version=605
export packagefull=$package
export packagedist=$package$version
export debug=1
Expand Down
13 changes: 11 additions & 2 deletions resources/Help/MonsterHunt/ReadMe.html
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,13 @@ <h2 id="credits">Credits</h2>
<section>
<h2 id="history">Release History</h2>

<h3>Release 11 (605)</h3>
<ul>
<li>Remove automatically assigning monsters to team
<li>Show monster names better, "KrallElite" becomes "Krall Elite"
<li>Grammatically correct escape message
</ul>

<h3>Release 10 (604)</h3>
<ul>
<li>Fix saving of game rule settings
Expand Down Expand Up @@ -470,11 +477,14 @@ <h2>License</h2>
</p>
<p>
You are free to:
</p>
<ul>
<li><b>Share</b> - copy and redistribute the material in any medium or format
<li><b>Adapt</b> - remix, transform, and build upon the material
</ul>
Under the following terms:
<p>
Under the following terms:
</p>
<ul>
<li><b>Attribution</b> - You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do
so in
Expand All @@ -486,7 +496,6 @@ <h2>License</h2>
<li><b>No additional restrictions</b> - You may not apply legal terms or technological measures that legally restrict others from doing
anything the license permits.
</ul>
</p>
</section>

</body>
Expand Down
39 changes: 37 additions & 2 deletions src/Classes/MonsterHunt.uc
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ function bool IsRelevant(Actor Other) {
pawn = ScriptedPawn(Other);
if (pawn != None) {
SetPawnDifficulty(MonsterSkill, pawn);
pawn.MenuName = FancyName(pawn);

if (Level.NetMode != NM_DedicatedServer) {
if (pawn.Shadow == None) pawn.Shadow = Spawn(class'MonsterShadow', pawn);
Expand Down Expand Up @@ -138,9 +139,43 @@ function SetPawnDifficulty(int MonsterSkill, ScriptedPawn S) {
if (bGameStarted) S.AttitudeToPlayer = ATTITUDE_Hate;
else S.AttitudeToPlayer = ATTITUDE_Ignore;
}
}

function String FancyName(Pawn Other, optional Bool upperArticle) {
local ScriptedPawn S;
local String baseName, newName, c;
local int i, a, p;

S = ScriptedPawn(Other);
if (S == None) return Other.MenuName;

baseName = S.MenuName;
if (baseName == "") baseName = GetItemName(String(S.class));

newName = Left(baseName, 1);
for (i = 1; i < Len(baseName); i++) {
c = Mid(baseName, i, 1);
p = Asc(Mid(baseName, i-1, 1));
a = Asc(c);
if (a >= 65 && a <= 90 && p >= 97 && p <= 122) newName = newName @ c;
else newName = newName $ c;
}

return newName;
}

function String UppercaseFirst(String S) {
local String trimmed, c;
local int i, start;

for (i = 0; i < Len(S); i++) {
if (Mid(S, i, 1) != " ") {
trimmed = Mid(S, i);
break;
}
}

S.TeamTag = 'MHMonsterTeam';
S.Team = 128;
return Caps(Left(trimmed, 1)) $ Mid(trimmed, 1);
}

function AddDefaultInventory(pawn PlayerPawn) {
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/MonsterHuntDefence.uc
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ function bool IsRelevant(Actor Other) {
function monsterEscaped(ScriptedPawn escapee) {
MonsterReplicationInfo(GameReplicationInfo).Escapees++;

BroadcastMessage(escapee.GetHumanName() @ EscapedMessage, false, 'MonsterCriticalEvent');
BroadcastMessage(UppercaseFirst(escapee.GetHumanName()) @ EscapedMessage, false, 'MonsterCriticalEvent');

if (MonsterReplicationInfo(GameReplicationInfo).Escapees >= MaxEscapees) EndGame("Monsters Escaped");
}
Expand Down

0 comments on commit d05820d

Please sign in to comment.