diff --git a/ModularTegustation/_adventure_console/adventure_layout.dm b/ModularTegustation/_adventure_console/adventure_layout.dm
index 9f2b1daa620b..442a5ea51e0a 100644
--- a/ModularTegustation/_adventure_console/adventure_layout.dm
+++ b/ModularTegustation/_adventure_console/adventure_layout.dm
@@ -3,6 +3,11 @@
* Adventures that are mostly predefined paths.
* This was difficult to finalize since i havent made a text based adventure before.
* Special defines such as button macros are in the code/_DEFINES/~lobotomy_defines.dm
+ *
+ * The way i made this system is unusual to say the least. Its a stand alone datum that
+ * is vaguely connected to the console that created it. While this does make the program
+ * portable it also makes it so that when the console is destroyed there is just a datum
+ * floating around in the code. Unsure how bad this is. -IP
*/
/datum/adventure_layout
@@ -58,6 +63,21 @@
"Recorded Rat:A low life from the backstreets. Their face is disfigured beyond recognition, all you can make out are their eyes.
",
"Digital Reflection:Its you! Well it looks LIKE you.
",
)
+ /*
+ * Exchange shop for digital coins. The only other use for coins is during events
+ * where you want to increase your chance of success in a event or have a unique
+ * interaction. For defeating enemeies the calculation for coins rewarded is
+ * enemy_coin = round((sides of damage die * amount of damage die)/5)
+ * this means that enemies that deal 1d5 damage will grant 1 coin. theoretically
+ * beelining enemy encounters will result in about 5 coins before the user is
+ * defeated. -IP
+ */
+ var/list/exchange_shop_list = list(
+ new /datum/data/extraction_cargo("SNAP POP ", /obj/item/toy/snappop, 10) = 1,
+ new /datum/data/extraction_cargo("CAT TOY ", /obj/item/toy/cattoy, 15) = 1,
+ new /datum/data/extraction_cargo("CHILDRENS TOY",/obj/item/toy/prize/ripley, 20) = 1,
+ new /datum/data/extraction_cargo("HOURGLASS", /obj/item/hourglass, 25) = 1,
+ )
/datum/adventure_layout/New(set_debug_menu = FALSE)
. = ..()
@@ -99,7 +119,7 @@
|ENVY:[virtual_stats[ENVY_STAT]]|
\
"
//From highest menu define to lowest. -IP
- for(var/mode_option = NORMAL_TEXT_DISPLAY to ADVENTURE_TEXT_DISPLAY)
+ for(var/mode_option = NORMAL_TEXT_DISPLAY to EXCHANGE_TEXT_DISPLAY)
. += "[mode_option == display_mode ? "[nameMenu(mode_option)]" : "[nameMenu(mode_option)]"]"
if(debug_menu)
. += "[display_mode == DEBUG_TEXT_DISPLAY ? "[nameMenu(DEBUG_TEXT_DISPLAY)]" : "[nameMenu(DEBUG_TEXT_DISPLAY)]"]"
@@ -159,6 +179,15 @@
if(ADVENTURE_TEXT_DISPLAY)
. += "[TravelUI(interfacer)]"
+ if(EXCHANGE_TEXT_DISPLAY)
+ . += "COIN EXCHANGE
\
+ --------------------|
\
+ PHYSICAL_MERCHANDISE
"
+ //Code taken from fish_market.dm
+ for(var/datum/data/extraction_cargo/A in exchange_shop_list)
+ . += " [A.equipment_name]([A.cost] Points)
"
+ . += "--------------------|
"
+
/datum/adventure_layout/proc/TravelUI(obj/machinery/call_machine)
switch(travel_mode)
if(ADVENTURE_MODE_BATTLE, ADVENTURE_MODE_EVENT_BATTLE)
@@ -404,28 +433,30 @@
//for each catagory please place the number its defined as -IP
/datum/adventure_layout/proc/nameMenu(cat)
switch(cat)
- if(1)
+ if(DEBUG_TEXT_DISPLAY)
return "CHOOSE EVENT"
- if(2)
+ if(NORMAL_TEXT_DISPLAY)
return "MAIN MENU"
- if(3)
+ if(ADVENTURE_TEXT_DISPLAY)
return "ADVENTURE"
+ if(EXCHANGE_TEXT_DISPLAY)
+ return "COIN SHOP"
/datum/adventure_layout/proc/nameStat(stat_named)
switch(stat_named)
- if(1)
+ if(WRATH_STAT)
return "WRATH"
- if(2)
+ if(LUST_STAT)
return "LUST"
- if(3)
+ if(SLOTH_STAT)
return "SLOTH"
- if(4)
+ if(GLUTT_STAT)
return "GLUTT"
- if(5)
+ if(GLOOM_STAT)
return "GLOOM"
- if(6)
+ if(PRIDE_STAT)
return "PRIDE"
- if(7)
+ if(ENVY_STAT)
return "ENVY"
//Recover Health based on time. I may scrap this because the thought of mobile game stamina makes me feel sick -IP
diff --git a/ModularTegustation/_adventure_console/console.dm b/ModularTegustation/_adventure_console/console.dm
index 8532836caab1..fca8e98f416c 100644
--- a/ModularTegustation/_adventure_console/console.dm
+++ b/ModularTegustation/_adventure_console/console.dm
@@ -3,7 +3,7 @@
desc = "This computer has a program on it that can decrypt abnormality data."
icon = 'icons/obj/machines/research.dmi'
icon_state = "nanite_program_hub"
- //Feels weird to make it indestructable but it is a unique machine.
+ //Feels weird to make it indestructable but it is a unique machine. Also if the machine is destroyed the adventure datum would continue to exist. -IP
resistance_flags = INDESTRUCTIBLE
anchored = TRUE
density = TRUE
@@ -31,8 +31,10 @@
var/dat
if(adventure_data)
dat += adventure_data.Adventure(src, user)
- dat += "
LOG OUT
\
- CREATE PASSWORD"
+ dat += "
LOG OUT
"
+ //Unsure if this method is extremely bad. -IP
+ if(profile_list.Find(adventure_data) != 1)
+ dat += "CREATE PASSWORD"
else
dat += ProfileMenu()
var/datum/browser/popup = new(user, "Adventure", "AdventureTest", 500, 600)
@@ -72,6 +74,8 @@
return TRUE
if(href_list["new_profile"])
+ if(!profile_list.len)
+ to_chat(usr, "FIRST PROFILE IS ALWAYS A PUBLIC ACCOUNT")
NewProfile()
updateUsrDialog()
return TRUE
@@ -87,7 +91,7 @@
//Setting display menu for the text adventure.
if(href_list["set_display"])
var/set_display = text2num(href_list["set_display"])
- if(!(set_display < 1 || set_display > 3) && set_display != adventure_data.display_mode)
+ if(isnum(set_display) && set_display != adventure_data.display_mode)
adventure_data.display_mode = set_display
playsound(get_turf(src), 'sound/machines/terminal_prompt_confirm.ogg', 50, TRUE)
updateUsrDialog()
@@ -97,7 +101,7 @@
if(href_list["travel"])
var/travel_num = text2num(href_list["travel"])
adventure_data.AdventureModeReact(travel_num)
- playsound(get_turf(src), 'sound/machines/terminal_prompt_confirm.ogg', 50, TRUE)
+ playsound(get_turf(src), 'sound/machines/pda_button2.ogg', 50, TRUE)
updateUsrDialog()
return TRUE
@@ -110,7 +114,7 @@
*/
var/created_event = text2path(href_list["adventure"])
adventure_data.GenerateEvent(created_event)
- playsound(get_turf(src), 'sound/machines/uplinkpurchase.ogg', 50, TRUE)
+ playsound(get_turf(src), 'sound/machines/pda_button2.ogg', 50, TRUE)
updateUsrDialog()
return TRUE
@@ -148,6 +152,22 @@
updateUsrDialog()
return TRUE
+ //Exchange Shop for exchanging coins for rewards
+ if(href_list["purchase"])
+ var/datum/data/extraction_cargo/product_datum = locate(href_list["purchase"]) in adventure_data.exchange_shop_list //The href_list returns the individual number code and only works if we have it in the first column. -IP
+ if(!product_datum)
+ to_chat(usr, span_warning("ERROR."))
+ return FALSE
+ if(adventure_data.virtual_coins < product_datum.cost)
+ to_chat(usr, span_warning("ERROR: INSUFFICENT CURRENCY."))
+ playsound(get_turf(src), 'sound/machines/terminal_prompt_deny.ogg', 50, TRUE)
+ return FALSE
+ new product_datum.equipment_path(get_turf(src))
+ adventure_data.AdjustCoins(-1 * product_datum.cost)
+ playsound(get_turf(src), 'sound/machines/terminal_prompt_confirm.ogg', 50, TRUE)
+ updateUsrDialog()
+ return TRUE
+
/obj/machinery/text_adventure_console/proc/ProfileMenu(href, href_list)
. = "\
-------------------
\
@@ -155,10 +175,12 @@
-------------------
"
var/profile_num = 1
for(var/i in profile_list)
- if(i)
- . += "|PROFILE [profile_num]
"
- profile_num++
-
+ //Guest profile is the true first variable in the list. So for display the 2nd profile is the 1st one.
+ if(profile_num == 1)
+ . += "|PUBLIC PROFILE
"
+ else
+ . += "|PROFILE [profile_num - 1]
"
+ profile_num++
. += "|NEW PROFILE
\
-----------------"
diff --git a/code/__DEFINES/~lobotomy_defines/adventure.dm b/code/__DEFINES/~lobotomy_defines/adventure.dm
index f1dc251baeb6..63c9054f8662 100644
--- a/code/__DEFINES/~lobotomy_defines/adventure.dm
+++ b/code/__DEFINES/~lobotomy_defines/adventure.dm
@@ -3,6 +3,7 @@
#define DEBUG_TEXT_DISPLAY 1
#define NORMAL_TEXT_DISPLAY 2
#define ADVENTURE_TEXT_DISPLAY 3
+#define EXCHANGE_TEXT_DISPLAY 4
//Modes for what is displayed on the adventure panel.
#define ADVENTURE_MODE_TRAVEL 1