|
7 | 7 | -- * Provide a copy of or a link to the original license (GPL-3.0 or later); see LICENSE.md or <https://www.gnu.org/licenses/>. |
8 | 8 |
|
9 | 9 |
|
| 10 | +---@class HeistStat |
| 11 | +---@field public name string |
| 12 | +---@field public val integer |
| 13 | +---@field public cooldown_name string |
| 14 | +---@field public cooldown_gvar string GVar path name |
| 15 | + |
10 | 16 | ---@class HeistInfo |
11 | 17 | ---@field public get_name fun(): string |
12 | 18 | ---@field public get_coords fun(): vec3? |
13 | | ----@field public stat { name: string, val: integer} |
14 | | ----@field public optInfo? string |
| 19 | +---@field public stat HeistStat |
| 20 | +---@field public opt_info? string Optional info to provide to a tooltip, typically a starting requirement that needs to be done manually |
15 | 21 |
|
16 | 22 | ---@class GenericProperty |
17 | 23 | ---@field public name string |
@@ -57,6 +63,43 @@ function YimHeists:SkipPrep(statName, statVal, notifTitle) |
57 | 63 | Notifier:ShowSuccess(notifTitle, _T("YH_PREP_SKIP_NOTIF")) |
58 | 64 | end |
59 | 65 |
|
| 66 | +-- https://www.unknowncheats.me/forum/4489469-post16.html EXCEPT setting values as that's greater risk |
| 67 | +---@param type string I or C |
| 68 | +---@param index integer |
| 69 | +function YimHeists:SetSecondaryTargets(type, index) |
| 70 | + local secondary_targets = { "CASH", "WEED", "COKE", "GOLD" } |
| 71 | + local targets = { 0, 0, 0, 0 } |
| 72 | + targets[index] = -1 |
| 73 | + |
| 74 | + for st = 1, #secondary_targets do |
| 75 | + local stat_name = _F("MPX_H4LOOT_%s_%s", secondary_targets[st], type) |
| 76 | + stats.set_int(stat_name, targets[st]) |
| 77 | + stats.set_int(stat_name .. "_SCOPED", targets[st]) |
| 78 | + end |
| 79 | + |
| 80 | + stats.set_int("MPX_H4LOOT_PAINT", -1) -- Not really any reason to have an option for paintings |
| 81 | + stats.set_int("MPX_H4LOOT_PAINT_SCOPED", -1) |
| 82 | +end |
| 83 | + |
| 84 | +---@return integer, integer |
| 85 | +function YimHeists:GetSecondaryTargets() |
| 86 | + local secondary_targets = { "CASH", "WEED", "COKE", "GOLD" } |
| 87 | + local return_i |
| 88 | + local return_c |
| 89 | + |
| 90 | + for st = 1, #secondary_targets do |
| 91 | + local stat_name = _F("MPX_H4LOOT_%s", secondary_targets[st]) |
| 92 | + if (stats.get_int(stat_name .. "_I") == -1) then |
| 93 | + return_i = st - 1 -- ImGui indexes by 0 |
| 94 | + end |
| 95 | + if (stats.get_int(stat_name .. "_C") == -1) then |
| 96 | + return_c = st - 1 |
| 97 | + end |
| 98 | + end |
| 99 | + |
| 100 | + return return_i or -1, return_c or -1 |
| 101 | +end |
| 102 | + |
60 | 103 | function YimHeists:ReadPropertyData() |
61 | 104 | ThreadManager:Run(function() |
62 | 105 | -- a better approach to this would be to read transition state. |
@@ -137,4 +180,15 @@ function YimHeists:HasSubmarine() |
137 | 180 | return self.m_properties.submarine |
138 | 181 | end |
139 | 182 |
|
| 183 | +-- ---@return vec3? |
| 184 | +-- function YimHeists:GetSubmarineLocation() |
| 185 | +-- local sub = self:HasSubmarine() |
| 186 | +-- if (not sub) then |
| 187 | +-- return |
| 188 | +-- end |
| 189 | + |
| 190 | +-- sub.coords = Game.Ensure3DCoords(760) |
| 191 | +-- return sub.coords |
| 192 | +-- end |
| 193 | + |
140 | 194 | return YimHeists |
0 commit comments