Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Fixes ore vent descriptions stacking, fixes potential exploits with ore vent scanning #1765

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 24 additions & 16 deletions code/game/objects/structures/lavaland/ore_vent.dm
Original file line number Diff line number Diff line change
Expand Up @@ -283,27 +283,35 @@
balloon_alert_to_viewers("vent tapped!")
return
if(!COOLDOWN_FINISHED(src, wave_cooldown))
balloon_alert_to_viewers("protect the node drone!")
return
if(scan_only)
discovered = TRUE
generate_description(user)
balloon_alert_to_viewers("vent scanned!")
if(!scan_only)
balloon_alert_to_viewers("protect the node drone!")
return
if(!discovered)
if(scan_only)
discovered = TRUE
generate_description(user)
balloon_alert_to_viewers("vent scanned!")
return

if(DOING_INTERACTION_WITH_TARGET(user, src))
balloon_alert(user, "already scanning!")
return
balloon_alert(user, "scanning...")
playsound(src, 'sound/items/timer.ogg', 30, TRUE)
if(do_after(user, 4 SECONDS))
discovered = TRUE
balloon_alert(user, "vent scanned!")
if(!do_after(user, 4 SECONDS, src))
return

discovered = TRUE
balloon_alert(user, "vent scanned!")
generate_description(user)
var/obj/item/card/id/user_id_card = user.get_idcard(TRUE)
if(isnull(user_id_card))
return
user_id_card.registered_account.mining_points += (MINER_POINT_MULTIPLIER)
user_id_card.registered_account.bank_card_talk("You've been awarded [MINER_POINT_MULTIPLIER] mining points for discovery of an ore vent.")
return

if(scan_only)
return
if(tgui_alert(user, excavation_warning, "Begin defending ore vent?", list("Yes", "No")) != "Yes")
return
if(!COOLDOWN_FINISHED(src, wave_cooldown))
Expand Down Expand Up @@ -332,12 +340,12 @@
* Ore_string is passed to examine().
*/
/obj/structure/ore_vent/proc/generate_description(mob/user)
for(var/mineral_count in 1 to length(mineral_breakdown))
var/datum/material/resource = mineral_breakdown[mineral_count]
if(mineral_count == length(mineral_breakdown))
ore_string += "and " + span_bold(initial(resource.name)) + "."
else
ore_string += span_bold(initial(resource.name)) + ", "
ore_string = ""
var/list/mineral_names = list()
for(var/datum/material/resource as anything in mineral_breakdown)
mineral_names += initial(resource.name)

ore_string = "[english_list(mineral_names)]."
if(user)
ore_string += "\nThis vent was first discovered by [user]."
/**
Expand Down
Loading