Skip to content

Commit

Permalink
Unlock free vehicle NOS upon winning 100 reaction tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellLVP committed Jul 2, 2020
1 parent 6925eb4 commit 5e3b046
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions data/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"ACHIEVEMENT_BOMB_SHOP": "{00E676}* You can now use the Vehicle Bomb Shop in Las Venturas!",
"ACHIEVEMENT_VEHICLE_COLOR": "{00E676}* You can now change your vehicle's colour by clicking on numpad 4!",
"ACHIEVEMENT_VEHICLE_JUMP": "{00E676}* You can now jump in your vehicle outside of Las Venturas by using the horn!",
"ACHIEVEMENT_VEHICLE_NITRO": "{00E676}* You can now add nitrogen to your vehicle by clicking on the fire key!",
"ACHIEVEMENT_VEHICLE_SPAWN": "{00E676}* You can now use the {388E3C}%s{00E676} and {388E3C}%s{00E676} commands to spawn vehicles!",

"ANIMATIONS_ADMIN_NOTICE": "%s (Id:%d) has started the /%s animation for %s (Id:%d)",
Expand Down
2 changes: 1 addition & 1 deletion javascript/features/collectables/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Arsonist | Explode 40 Red Barrels | Unlocks the _vehicle colour
Incendiarist | Explode 90 Red Barrels |
Jomeri's Syndrome | Explode all Red Barrels | Unlocks the _vehicle jump_ key shortcut.
Nimble Critter | Win 10 reaction tests |
Quick Addict | Win 100 reaction tests |
Quick Addict | Win 100 reaction tests | Unlocks the _vehicle nitro_ key shortcut.
Electrolyte | Win 1,000 reaction tests |
The Streak | Win 10 reaction tests in a row |
keybind.cs | Win a reaction test in <2s |
Expand Down
11 changes: 10 additions & 1 deletion javascript/features/collectables/achievements.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import { CollectableBase } from 'features/collectables/collectable_base.js';
import { CollectableDatabase } from 'features/collectables/collectable_database.js';
import { Vehicle } from 'entities/vehicle';

// -------------------------------------------------------------------------------------------------
// Next ID: 16
Expand All @@ -23,7 +24,7 @@ export const kAchievementRedBarrelPlatinum = 8; // kBenefitVehicleKeysJump

// Reaction Tests quantity achievements: awarded when hitting a certain number of reaction tests.
export const kAchievementReactionTestBronze = 9;
export const kAchievementReactionTestSilver = 10;
export const kAchievementReactionTestSilver = 10; // kBenefitVehicleKeysNitro
export const kAchievementReactionTestGold = 11;

// Reaction Test performance achievement: awarded when winning ten reaction tests in a row.
Expand Down Expand Up @@ -161,6 +162,10 @@ export class Achievements extends CollectableBase {
kAchievementRedBarrelPlatinum,
Message.ACHIEVEMENT_VEHICLE_JUMP
],
[
kAchievementReactionTestSilver,
Message.ACHIEVEMENT_VEHICLE_NITRO,
]
]);

const message = kUnlockMessages.get(achievement);
Expand All @@ -176,6 +181,10 @@ export class Achievements extends CollectableBase {
case kAchievementRedBarrelPlatinum:
player.syncedData.vehicleKeys |= Vehicle.kVehicleKeysJump;
break;

case kAchievementReactionTestSilver:
player.syncedData.vehicleKeys |= Vehicle.kVehicleKeysNos;
break;
}
}

Expand Down
3 changes: 3 additions & 0 deletions javascript/features/collectables/collectable_benefits.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ export const kBenefitVehicleKeysColour = 4;

// Whether a player can use the vehicle jump keys outside of Las Venturas.
export const kBenefitVehicleKeysJump = 5;

// Whether a player can use the vehicle nitro key outside of Las Venturas.
export const kBenefitVehicleKeysNitro = 6;

0 comments on commit 5e3b046

Please sign in to comment.