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

Кнопочка в ВВ-шке для добавления наркотических зависимостей #5205

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions code/__DEFINES/~ff_defines/vv.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define VV_HK_GIVE_ADDICTION "give_addiction"
33 changes: 33 additions & 0 deletions tff_modular/modules/extra_vv/extra_carbon_vv.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* EXTRA CARBON VV
*/
/mob/living/carbon/vv_get_dropdown()
. = ..()
VV_DROPDOWN_OPTION(VV_HK_GIVE_ADDICTION, "Give/Remove Addiction")

/mob/living/carbon/vv_do_topic(list/href_list)
. = ..()

if(href_list[VV_HK_GIVE_ADDICTION])
if(!check_rights(R_VAREDIT))
return
if(!mind) //Addictions are stored in the mind...
return

switch(tgui_alert(usr, "Give or Remove addictions?", "Addictions", list("Give", "Remove", "Cancel")))
if("Give")
var/chosen_addiction = input(usr, "Choose an addiction to add.", "Choose an addiction.") as null|anything in sort_list(SSaddiction.all_addictions, GLOBAL_PROC_REF(cmp_typepaths_asc))
var/addiction_points = input(usr, "Choose the amount to add.\nAt least 600 are required to obtain an addiction.", "Choose the amount.", MAX_ADDICTION_POINTS) as num|null
if(chosen_addiction && addiction_points)
mind.add_addiction_points(chosen_addiction, addiction_points)
return
if("Remove")
if(!mind.active_addictions)
tgui_alert(usr, "No active addictions.", "Remove addictions")
return
var/chosen_addiction = input(usr, "Choose an addiction to remove.", "Choose an addiction.") as null|anything in sort_list(mind.active_addictions, GLOBAL_PROC_REF(cmp_typepaths_asc))
if(chosen_addiction)
mind.remove_addiction_points(chosen_addiction, MAX_ADDICTION_POINTS)
return
if("Cancel")
return
2 changes: 2 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@
#include "code\__DEFINES\~ff_defines\nabber_clothes_pathes.dm"
#include "code\__DEFINES\~ff_defines\say.dm"
#include "code\__DEFINES\~ff_defines\text.dm"
#include "code\__DEFINES\~ff_defines\vv.dm"
#include "code\__DEFINES\~ff_defines\__HELPERS\global_lists.dm"
#include "code\__DEFINES\~ff_defines\__HELPERS\ishelpers.dm"
#include "code\__DEFINES\~ff_defines\__HELPERS\names.dm"
Expand Down Expand Up @@ -8808,6 +8809,7 @@
#include "tff_modular\modules\drinks\skrelluq\reaction.dm"
#include "tff_modular\modules\drinks\skrelluq\reagent.dm"
#include "tff_modular\modules\drone\code\droneDispenser.dm"
#include "tff_modular\modules\extra_vv\extra_carbon_vv.dm"
#include "tff_modular\modules\holidays_decor\halloween\halloween-craft.dm"
#include "tff_modular\modules\holidays_decor\halloween\halloween-decor.dm"
#include "tff_modular\modules\holidays_decor\new_year\decorations.dm"
Expand Down
Loading