mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-22 04:37:45 +01:00
[MIRROR] some code cleanup (#12271)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
co-authored by
Kashargul
parent
56b7bb44f2
commit
f34c48bbcd
@@ -488,7 +488,7 @@ var/global/datum/controller/occupations/job_master
|
||||
|
||||
/* CHOMPRemove Start
|
||||
//Give new players a welcome guide!
|
||||
if(isnum(H.client.player_age) && H.client.player_age < 10)
|
||||
if(isnum(H.client?.player_age) && H.client.player_age < 10)
|
||||
H.equip_to_slot_or_del(new /obj/item/book/manual/virgo_pamphlet(H), slot_r_hand)
|
||||
*/// CHOMPRemove End
|
||||
else
|
||||
|
||||
@@ -418,9 +418,8 @@
|
||||
if(public_spin == 0)
|
||||
to_chat(user,span_notice("The Wheel makes a sad beep, public spins are not enabled right now..."))
|
||||
return
|
||||
else
|
||||
to_chat(user,span_notice("You spin the wheel!"))
|
||||
spin_the_wheel("not_lottery")
|
||||
to_chat(user,span_notice("You spin the wheel!"))
|
||||
spin_the_wheel("not_lottery")
|
||||
if("Set the interval")
|
||||
setinterval()
|
||||
|
||||
@@ -437,51 +436,51 @@
|
||||
if(!check_access(W))
|
||||
to_chat(user, span_warning("Access Denied."))
|
||||
return
|
||||
else
|
||||
to_chat(user, span_warning("Proper access, allowed staff controls."))
|
||||
if(ishuman(user) || isrobot(user))
|
||||
switch(tgui_input_list(user,"Choose what to do (Management)","Wheel Of Fortune (Management)", list("Spin the Lottery Wheel!", "Toggle Lottery Sales", "Toggle Public Spins", "Reset Lottery", "Cancel")))
|
||||
if("Cancel")
|
||||
|
||||
to_chat(user, span_warning("Proper access, allowed staff controls."))
|
||||
if(ishuman(user) || isrobot(user))
|
||||
switch(tgui_input_list(user,"Choose what to do (Management)","Wheel Of Fortune (Management)", list("Spin the Lottery Wheel!", "Toggle Lottery Sales", "Toggle Public Spins", "Reset Lottery", "Cancel")))
|
||||
if("Cancel")
|
||||
return
|
||||
if("Spin the Lottery Wheel!")
|
||||
to_chat(user,span_notice("You spin the wheel for the lottery!"))
|
||||
spin_the_wheel("lottery")
|
||||
|
||||
if("Toggle Lottery Sales")
|
||||
if(lottery_sale == "disabled")
|
||||
lottery_sale = "enabled"
|
||||
to_chat(user,span_notice("Public Lottery sale has been enabled."))
|
||||
return
|
||||
if("Spin the Lottery Wheel!")
|
||||
to_chat(user,span_notice("You spin the wheel for the lottery!"))
|
||||
spin_the_wheel("lottery")
|
||||
lottery_sale = "disabled"
|
||||
to_chat(user,span_notice("Public Lottery sale has been disabled."))
|
||||
|
||||
if("Toggle Lottery Sales")
|
||||
if(lottery_sale == "disabled")
|
||||
lottery_sale = "enabled"
|
||||
to_chat(user,span_notice("Public Lottery sale has been enabled."))
|
||||
else
|
||||
lottery_sale = "disabled"
|
||||
to_chat(user,span_notice("Public Lottery sale has been disabled."))
|
||||
if("Toggle Public Spins")
|
||||
if(public_spin == 0)
|
||||
public_spin = 1
|
||||
to_chat(user,span_notice("Public spins has been enabled."))
|
||||
return
|
||||
public_spin = 0
|
||||
to_chat(user,span_notice("Public spins has been disabled."))
|
||||
|
||||
if("Toggle Public Spins")
|
||||
if(public_spin == 0)
|
||||
public_spin = 1
|
||||
to_chat(user,span_notice("Public spins has been enabled."))
|
||||
else
|
||||
public_spin = 0
|
||||
to_chat(user,span_notice("Public spins has been disabled."))
|
||||
|
||||
if("Reset Lottery")
|
||||
var/confirm = tgui_alert(user, "Are you sure you want to reset Lottery?", "Confirm Lottery Reset", list("Yes", "No"))
|
||||
if(confirm == "Yes")
|
||||
to_chat(user, span_warning("Lottery has been Reset!"))
|
||||
lottery_entries = 0
|
||||
lottery_tickets = list()
|
||||
lottery_tickets_ckeys = list()
|
||||
if("Reset Lottery")
|
||||
var/confirm = tgui_alert(user, "Are you sure you want to reset Lottery?", "Confirm Lottery Reset", list("Yes", "No"))
|
||||
if(confirm == "Yes")
|
||||
to_chat(user, span_warning("Lottery has been Reset!"))
|
||||
lottery_entries = 0
|
||||
lottery_tickets = list()
|
||||
lottery_tickets_ckeys = list()
|
||||
|
||||
if(istype(W, /obj/item/spacecasinocash))
|
||||
if(lottery_sale == "disabled")
|
||||
to_chat(user, span_warning("Lottery sales are currently disabled."))
|
||||
return
|
||||
else
|
||||
if(user.client.ckey in lottery_tickets_ckeys)
|
||||
to_chat(user, span_warning("The scanner beeps in an upset manner, you already have a ticket!"))
|
||||
return
|
||||
|
||||
var/obj/item/spacecasinocash/C = W
|
||||
insert_chip(C, user)
|
||||
if(user.client.ckey in lottery_tickets_ckeys)
|
||||
to_chat(user, span_warning("The scanner beeps in an upset manner, you already have a ticket!"))
|
||||
return
|
||||
|
||||
var/obj/item/spacecasinocash/C = W
|
||||
insert_chip(C, user)
|
||||
|
||||
/obj/machinery/wheel_of_fortune/proc/insert_chip(var/obj/item/spacecasinocash/cashmoney, mob/user)
|
||||
if (busy)
|
||||
@@ -668,12 +667,10 @@
|
||||
if(user.client.ckey == selected_collar.sentientprizeckey)
|
||||
insert_chip(C, user, "selfbuy")
|
||||
return
|
||||
else
|
||||
insert_chip(C, user, "buy")
|
||||
return
|
||||
else
|
||||
to_chat(user, span_warning("This Sentient Prize is already owned! If you are the owner you can release the prize by swiping the collar on the SPASM!"))
|
||||
insert_chip(C, user, "buy")
|
||||
return
|
||||
to_chat(user, span_warning("This Sentient Prize is already owned! If you are the owner you can release the prize by swiping the collar on the SPASM!"))
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/clothing/accessory/collar/casinosentientprize))
|
||||
var/obj/item/clothing/accessory/collar/casinosentientprize/C = W
|
||||
@@ -684,7 +681,7 @@
|
||||
if(!C.ownername)
|
||||
to_chat(user,span_notice("If collar isn't disabled and entry removed, please select your entry and insert chips. Or contact staff if you need assistance."))
|
||||
return
|
||||
else
|
||||
if(C.sentientprizename != C.ownername)
|
||||
to_chat(user,span_notice("If collar isn't disabled and entry removed, please ask your owner to free you with collar swipe on the SPASM, or contact staff if you need assistance."))
|
||||
return
|
||||
if(user.name == C.ownername)
|
||||
@@ -703,54 +700,54 @@
|
||||
if(!check_access(W))
|
||||
to_chat(user, span_warning("Access Denied."))
|
||||
return
|
||||
else
|
||||
to_chat(user, span_warning("Proper access, allowed staff controls."))
|
||||
if(ishuman(user) || isrobot(user))
|
||||
switch(tgui_input_list(user,"Choose what to do (Management)","SPASM (Management)", list("Toggle Sentient Prize Sales", "Wipe Selected Prize Entry", "Change Prize Value", "Cancel")))
|
||||
if("Cancel")
|
||||
|
||||
to_chat(user, span_warning("Proper access, allowed staff controls."))
|
||||
if(ishuman(user) || isrobot(user))
|
||||
switch(tgui_input_list(user,"Choose what to do (Management)","SPASM (Management)", list("Toggle Sentient Prize Sales", "Wipe Selected Prize Entry", "Change Prize Value", "Cancel")))
|
||||
if("Cancel")
|
||||
return
|
||||
|
||||
if("Toggle Sentient Prize Sales")
|
||||
if(casinosentientprize_sale == "disabled")
|
||||
casinosentientprize_sale = "enabled"
|
||||
icon_state = "casinoslave_hub_on"
|
||||
update_icon()
|
||||
to_chat(user,span_notice("Prize sale has been enabled."))
|
||||
else
|
||||
casinosentientprize_sale = "disabled"
|
||||
icon_state = "casinoslave_hub_off"
|
||||
update_icon()
|
||||
to_chat(user,span_notice("Prize sale has been disabled."))
|
||||
|
||||
if("Wipe Selected Prize Entry")
|
||||
if(!selected_collar)
|
||||
to_chat(user, span_warning("No collar selected!"))
|
||||
return
|
||||
|
||||
if("Toggle Sentient Prize Sales")
|
||||
if(casinosentientprize_sale == "disabled")
|
||||
casinosentientprize_sale = "enabled"
|
||||
icon_state = "casinoslave_hub_on"
|
||||
update_icon()
|
||||
to_chat(user,span_notice("Prize sale has been enabled."))
|
||||
else
|
||||
casinosentientprize_sale = "disabled"
|
||||
icon_state = "casinoslave_hub_off"
|
||||
update_icon()
|
||||
to_chat(user,span_notice("Prize sale has been disabled."))
|
||||
|
||||
if("Wipe Selected Prize Entry")
|
||||
if(!selected_collar)
|
||||
to_chat(user, span_warning("No collar selected!"))
|
||||
return
|
||||
if(QDELETED(selected_collar))
|
||||
collar_list -= selected_collar
|
||||
if(QDELETED(selected_collar))
|
||||
collar_list -= selected_collar
|
||||
sentientprizes_ckeys_list -= selected_collar.sentientprizeckey
|
||||
to_chat(user, span_warning("Collar has been destroyed!"))
|
||||
selected_collar = null
|
||||
return
|
||||
var/safety_ckey = selected_collar.sentientprizeckey
|
||||
var/confirm = tgui_alert(user, "Are you sure you want to wipe [selected_collar.sentientprizename] entry?", "Confirm Sentient Prize", list("Yes", "No"))
|
||||
if(confirm == "Yes")
|
||||
if(safety_ckey == selected_collar.sentientprizeckey)
|
||||
to_chat(user, span_warning("[selected_collar.sentientprizename] collar has been deleted from registry!"))
|
||||
selected_collar.icon_state = "casinoslave"
|
||||
selected_collar.update_icon()
|
||||
selected_collar.name = "disabled Sentient Prize Collar: [selected_collar.sentientprizename]"
|
||||
selected_collar.desc = "A collar worn by sentient prizes on the Golden Goose Casino. The tag says its registered to [selected_collar.sentientprizename], but harsh red text informs you its been disabled." //CHOMPEdit
|
||||
sentientprizes_ckeys_list -= selected_collar.sentientprizeckey
|
||||
to_chat(user, span_warning("Collar has been destroyed!"))
|
||||
selected_collar.sentientprizeckey = null
|
||||
collar_list -= selected_collar
|
||||
selected_collar = null
|
||||
return
|
||||
var/safety_ckey = selected_collar.sentientprizeckey
|
||||
var/confirm = tgui_alert(user, "Are you sure you want to wipe [selected_collar.sentientprizename] entry?", "Confirm Sentient Prize", list("Yes", "No"))
|
||||
if(confirm == "Yes")
|
||||
if(safety_ckey == selected_collar.sentientprizeckey)
|
||||
to_chat(user, span_warning("[selected_collar.sentientprizename] collar has been deleted from registry!"))
|
||||
selected_collar.icon_state = "casinoslave"
|
||||
selected_collar.update_icon()
|
||||
selected_collar.name = "disabled Sentient Prize Collar: [selected_collar.sentientprizename]"
|
||||
selected_collar.desc = "A collar worn by sentient prizes on the Golden Goose Casino. The tag says its registered to [selected_collar.sentientprizename], but harsh red text informs you its been disabled." //CHOMPEdit
|
||||
sentientprizes_ckeys_list -= selected_collar.sentientprizeckey
|
||||
selected_collar.sentientprizeckey = null
|
||||
collar_list -= selected_collar
|
||||
selected_collar = null
|
||||
else
|
||||
to_chat(user, span_warning("Registry deletion aborted! Changed collar selection!"))
|
||||
return
|
||||
to_chat(user, span_warning("Registry deletion aborted! Changed collar selection!"))
|
||||
return
|
||||
|
||||
if("Change Prize Value")
|
||||
setprice(user)
|
||||
if("Change Prize Value")
|
||||
setprice(user)
|
||||
|
||||
/obj/machinery/casinosentientprize_handler/proc/do_item_tf(mob/living/sentient_prize, var/target_item_name)
|
||||
var/item_type = GLOB.item_tf_options[target_item_name]
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
flick(anim, animation)
|
||||
if(do_gibs) gibs(loc, dna)
|
||||
|
||||
if (!QDELETED(src))
|
||||
ghostize()
|
||||
|
||||
spawn(15)
|
||||
if(animation) qdel(animation)
|
||||
if(src) qdel(src)
|
||||
@@ -43,6 +46,10 @@
|
||||
new remains(loc)
|
||||
|
||||
GLOB.dead_mob_list -= src
|
||||
|
||||
if (!QDELETED(src))
|
||||
ghostize()
|
||||
|
||||
spawn(15)
|
||||
if(animation) qdel(animation)
|
||||
if(src) qdel(src)
|
||||
@@ -63,6 +70,10 @@
|
||||
flick(anim, animation)
|
||||
|
||||
GLOB.dead_mob_list -= src
|
||||
|
||||
if (!QDELETED(src))
|
||||
ghostize()
|
||||
|
||||
spawn(15)
|
||||
if(animation) qdel(animation)
|
||||
if(src) qdel(src)
|
||||
|
||||
+1
-1
@@ -136,7 +136,7 @@ export const VorePanelEditTextTabs = (
|
||||
<Stack.Item grow>
|
||||
<Section fill scrollable>
|
||||
<Stack fill vertical>
|
||||
{!!button_action && button_data && (
|
||||
{!!button_action && !!button_label && (
|
||||
<Stack.Item>
|
||||
<LabeledList>
|
||||
<LabeledList.Item label={button_label}>
|
||||
|
||||
Reference in New Issue
Block a user