Skip to content

Commit

Permalink
Display a message when players enter a gang zone
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellLVP committed May 24, 2020
1 parent 760523e commit 3f8cd99
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions data/messages.json
Expand Up @@ -215,6 +215,7 @@
"GANG_SETTINGS_USE_PERSONAL_COLOR": "You will now be using your personal color again.",
"GANG_SETTINGS_USE_GANG_SKIN": "You will now be using the gang's skin again.",
"GANG_SETTINGS_USE_PERSONAL_SKIN": "You will now be using your personal skin again. Use \"/my skin\" to update it.",
"GANG_ZONE_ENTERED": "{%s}* You have entered %s territory: %s",
"GANGS_ALREADY_SET": "@error You need to leave your current gang first by using /gang leave.",
"GANGS_HEADER": "{B1FC17}Gangs on Las Venturas Playground",
"GANGS_NONE_ONLINE": "{B1FC17}There are no gang members on the server right now.",
Expand Down
3 changes: 3 additions & 0 deletions javascript/features/gang_zones/structures/zone.js
Expand Up @@ -23,6 +23,9 @@ export class Zone {
// Gets the ID of the gang who owns this gang zone.
get gangId() { return this.zoneGang_.id; }

// Gets the goal of the gang who owns this gang zone.
get gangGoal() { return this.zoneGang_.goal; }

// Gets the name of the gang who owns this gang zone.
get gangName() { return this.zoneGang_.name; }

Expand Down
Expand Up @@ -80,7 +80,7 @@ describe('ZoneDataAggregator', (it, beforeEach, afterEach) => {
const baGang = aggregator.activeGangs.get(MockZoneDatabase.BA);

assert.equal(baGang.name, 'BA Hooligans');
assert.deepEqual(baGang.color, Color.fromRGB(20, 147, 170));
assert.deepEqual(baGang.color, Color.fromRGBA(255, 20, 147, 170));

aggregator.onGangSettingUpdated({
id: MockZoneDatabase.BA,
Expand Down
3 changes: 3 additions & 0 deletions javascript/features/gang_zones/zone_manager.js
Expand Up @@ -53,6 +53,9 @@ export class ZoneManager {
// ---------------------------------------------------------------------------------------------

onPlayerEnterZone(player, zone) {
player.sendMessage(
Message.GANG_ZONE_ENTERED, zone.color.toHexRGB(), zone.gangName, zone.gangGoal);

if (!server.isTest())
console.log(`[Zone][Enter][${zone.gangName}] : [${player.name}]`);
}
Expand Down

0 comments on commit 3f8cd99

Please sign in to comment.