-
-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a text adventure minigame to the EO's area.
- Loading branch information
1 parent
081d94b
commit e750fcf
Showing
3 changed files
with
227 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
/*TEXT BASED ADVENTURES!!! Adventures that are mostly predefined paths. | ||
This was difficult to finalize since i havent made a text based | ||
adventure before. */ | ||
/*-------------\ | ||
|Adventure Code| | ||
\-------------*/ | ||
/datum/adventure_layout | ||
var/virtual_integirty = 100 | ||
var/virtual_coins = 1 | ||
var/display_event = FALSE | ||
|
||
/datum/adventure_layout/proc/UI_Display(mob/living/carbon/human/H) | ||
. = "|USER:[H.name]|HP:[virtual_integirty]|COINS:[virtual_coins]|<br>" | ||
. += " <A href='byond://?src=[REF(interface_caller)];choice=[path_change]'>[path_change]</A>[choice_desc]<br>" | ||
Check failure on line 14 in ModularTegustation/lc13_adventuredatum.dm GitHub Actions / Run Linters
Check failure on line 14 in ModularTegustation/lc13_adventuredatum.dm GitHub Actions / Run Linters
Check failure on line 14 in ModularTegustation/lc13_adventuredatum.dm GitHub Actions / Run Linters
|
||
|
||
/* | ||
This definition requires the destination of the path change, | ||
the description of the choice, and the interface recieving this | ||
definition. Hopefully this definition makes creating these easier. | ||
*/ | ||
#define BUTTON_FORMAT(path_change,choice_desc,interface_caller) . += " <A href='byond://?src=[REF(interface_caller)];choice=[path_change]'>[path_change]</A>[choice_desc]<br>" | ||
|
||
/*---------\ | ||
|Event Code| | ||
\---------*/ | ||
/datum/adventure_event | ||
//Name of adventure, displayed at top. | ||
var/name | ||
//Description of adventure. | ||
var/desc | ||
//Where the user is. | ||
var/cords = 1 | ||
//Discriptions of areas. If cords is 2 then B will be displayed for flavor_desc in UI_Display() | ||
var/list/adventure_cords = list( | ||
"A", | ||
"B", | ||
"C", | ||
) | ||
|
||
/*This is where most of the choices and effects will appear. | ||
After your condition for the choice is made with | ||
"if(cords == 2)" remember to add a return if you do not | ||
want the continue button to appear.*/ | ||
/datum/adventure_event/proc/EventChoiceFormat(obj/machinery/M, mob/living/carbon/human/H) | ||
if(cords) | ||
BUTTON_FORMAT(0,"CONTINUE", M) | ||
|
||
/* This proc is called by the machine in order to build the UI. | ||
Its like a hub where all other general things are called. */ | ||
/datum/adventure_event/proc/Event(obj/machinery/caller, mob/living/carbon/human/H) | ||
if(cords == 0) | ||
EventComplete(caller,H) | ||
return | ||
|
||
//UI Data for machine that calls us. | ||
. = UI_Display() | ||
. += EventChoiceFormat(caller, H) | ||
|
||
if(!caller) | ||
return "<br>ERROR: USERFACE SOURCE MISSING" | ||
|
||
/* Formating stuff such as UI display that is | ||
returned to the calling userface such as | ||
the events name, current cords, and | ||
flavor text. */ | ||
/datum/adventure_event/proc/UI_Display(mob/living/carbon/human/H) | ||
var/flavor_desc = adventure_cords[cords] | ||
. += "<b>[name]:[cords]</b><br>" | ||
. += "-----------<br>[flavor_desc]<br>-----------<br>" | ||
|
||
//Code that runs when the event is complete. Mostly resets things. | ||
/datum/adventure_event/proc/EventComplete(obj/machinery/machine_thingly/M, mob/living/carbon/human/H) | ||
cords = 1 | ||
|
||
//Called by console after a choice is recieved. | ||
/datum/adventure_event/proc/EventReact(new_cords) | ||
cords = new_cords | ||
|
||
/*------------\ | ||
|Unique Events| | ||
\------------*/ | ||
|
||
//Refrence to a shot from the early access trailer to lobotomy corp where a cowering agent is surrounded by a void of monsters. | ||
/datum/adventure_event/legacy | ||
name = "The Falling World" | ||
desc = "Adrift in a dark sea is the silloette of a doorway and a cowering figure." | ||
adventure_cords = list( | ||
"A twisting green hue pours out from a door. Silhouetted against that light is a humanoid figure. \ | ||
<br>The figure grabs their head and cowers as the edges of the room crumble away. \ | ||
<br>Encircling the doorway at the edge of your visions are the writhing outline of monsters.", | ||
//Not great story results i know -IP | ||
"You remain silent as the shadows obscure your view of the figure", | ||
"The figure looks towards you, and so do the shadows. You are not alone.", | ||
) | ||
|
||
/datum/adventure_event/legacy/EventChoiceFormat(obj/machinery/M, mob/living/carbon/human/H) | ||
if(cords == 1) | ||
BUTTON_FORMAT(2,"HIDE", M) | ||
BUTTON_FORMAT(3,"REACH OUT", M) | ||
return | ||
if(cords == 3) | ||
playsound(get_turf(H), 'sound/effects/creak1.ogg', 20, FALSE) | ||
. = ..() | ||
|
||
/datum/adventure_event/match | ||
name = "Final Match" | ||
desc = "The window to a warm house in a chilly winters eve." | ||
adventure_cords = list( | ||
"You stand in the snow peering into a nicely lit home. Inside is the scene of a family \ | ||
having dinner. Next to you is a small girl holding a box of matches, she stands there \ | ||
watching blankly as the world ignores her.", | ||
"The window breaks as the inside of the house erupts into flames. The warmth of the fire \ | ||
is comforting in the bitter chill. The girl next to you smiles weakly before the fire \ | ||
dies down leaving nothing but cold ash and burnt matches.", | ||
//You cannot change the outcome of the story. | ||
"You feel strangely out of place while you fish out a coin from your pocket and request a \ | ||
match. The girl turns to you, her form starts to sizzle and burn. After handing you a \ | ||
match she erupts into a fire that carries no warmth.", | ||
) | ||
|
||
/datum/adventure_event/match/EventChoiceFormat(obj/machinery/M, mob/living/carbon/human/H) | ||
if(cords == 1) | ||
BUTTON_FORMAT(2,"CONTINUE TO WATCH", M) | ||
BUTTON_FORMAT(3,"REQUEST A MATCH", M) | ||
return | ||
. = ..() | ||
|
||
//This event is mostly based on what i THINK the creators of forsaken murderer are trying to say. -IP | ||
/datum/adventure_event/murderer | ||
name = "The Forsaken Killer" | ||
desc = "A metal table and a killer ripe for the reaping." | ||
adventure_cords = list( | ||
"Before you is a emaciated man strapped to a table. Next to him on a metal table are \ | ||
documents of his crimes and a medical diagram indicating the location of something \ | ||
of value within his brain.", | ||
"Within his brain you find what you wanted. The glee of the oppertunity to gain so much \ | ||
passes your mind as the man slumps over, still alive but wrong... ", | ||
"As you turn to leave the monsterous man strapped to his table you hear the muffled \ | ||
screams and tearing of flesh. You look back at the fading scene of a shadowy woman \ | ||
tearing out something from the mans brain.", | ||
) | ||
|
||
/datum/adventure_event/murderer/EventChoiceFormat(obj/machinery/M, mob/living/carbon/human/H) | ||
if(cords == 1) | ||
BUTTON_FORMAT(2,"BUTCHER THE MANS BRAIN", M) | ||
BUTTON_FORMAT(3,"LEAVE", M) | ||
return | ||
if(cords == 2) | ||
new /obj/item/coin/gold(get_turf(H)) | ||
. = ..() | ||
|
||
#undef BUTTON_FORMAT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters