Skip to content

Commit

Permalink
update ending
Browse files Browse the repository at this point in the history
  • Loading branch information
johndoe2013 committed Jun 16, 2024
1 parent 02b6d1a commit 42d0536
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 8 deletions.
2 changes: 2 additions & 0 deletions code/datums/tutorial/_tutorial.dm
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ GLOBAL_LIST_EMPTY_TYPED(ongoing_tutorials, /datum/tutorial)

/// Ends the tutorial after a certain amount of time.
/datum/tutorial/proc/tutorial_end_in(time = 5 SECONDS, completed = TRUE)
if(completed)
mark_completed() // This is done because if you're calling this proc with completed == TRUE, then the tutorial's a done deal. We shouldn't penalize the player if they exit a few seconds before it actually completes.
tutorial_ending = TRUE
addtimer(CALLBACK(src, PROC_REF(end_tutorial), completed), time)

Expand Down
49 changes: 41 additions & 8 deletions code/datums/tutorial/xenomorph/abomination.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
tutorial_id = "xeno_abom_1"
tutorial_template = /datum/map_template/tutorial/s7x7
starting_xenomorph_type = /mob/living/carbon/xenomorph/predalien/tutorial
/// How many marines in the kill_marines stage have been killed
var/ending_marines_killed = 0

// START OF SCRITPING

Expand Down Expand Up @@ -98,7 +100,6 @@

var/mob/living/carbon/human/marine = new(loc_from_corner(4, 2))
add_to_tracking_atoms(marine)
marine.create_hud()
arm_equipment(marine, /datum/equipment_preset/uscm/private_equipped)

/datum/tutorial/xenomorph/abomination/proc/frenzy_tutorial_1(datum/action/source, mob/owner)
Expand Down Expand Up @@ -132,7 +133,7 @@
addtimer(CALLBACK(src, PROC_REF(frenzy_tutorial_3)), 2 SECONDS)

/datum/tutorial/xenomorph/abomination/proc/frenzy_tutorial_3()
hide_action(xeno, /datum/action/xeno_action/activable/feral_smash)
remove_action(xeno, /datum/action/xeno_action/activable/feral_smash)
message_to_player("Good. Your final ability is <b>Feral Frenzy</b>, a strong ability that can alternate between hitting a single target or all within a large radius. However, it locks you in place while it winds up.")

TUTORIAL_ATOM_FROM_TRACKING(/mob/living/carbon/human, marine)
Expand All @@ -143,7 +144,6 @@

/datum/tutorial/xenomorph/abomination/proc/frenzy_tutorial_4()
var/mob/living/carbon/human/marine = new(loc_from_corner(4, 2))
marine.create_hud()
add_to_tracking_atoms(marine)
arm_equipment(marine, /datum/equipment_preset/uscm/private_equipped)

Expand Down Expand Up @@ -202,11 +202,44 @@
UnregisterSignal(frenzy, COMSIG_XENO_ACTION_USED)
remove_highlight(frenzy.button)
message_to_player("Good. As you may have noticed, the AOE version of <b>Feral Frenzy</b> takes longer to wind up, in addition to doing less overall damage.")
addtimer(CALLBACK(src, PROC_REF(frenzy_tutorial_8)), 5 SECONDS)
addtimer(CALLBACK(src, PROC_REF(kill_marines)), 6 SECONDS)

/datum/tutorial/xenomorph/abomination/proc/frenzy_tutorial_8()
message_to_player("This is the end of the Abomination tutorial. One last thing to note is that you are able to put yourself out when on fire far faster than other xenomorphs. The tutorial will end itself shortly.")
mark_completed() // just in case people exit early
tutorial_end_in(8 SECONDS, TRUE)
/datum/tutorial/xenomorph/abomination/proc/kill_marines()
message_to_player("To finish the tutorial, kill the three newly-spawned marines using any of your attacks or abilities.")

// Spawn/rejuv the dummies
TUTORIAL_ATOM_FROM_TRACKING(/mob/living/carbon/human, marine) // we can reuse this one though
marine.rejuvenate()
marine.forceMove(loc_from_corner(4, 2))
RegisterSignal(marine, COMSIG_MOB_DEATH, PROC_REF(kill_marines_2))

var/mob/living/carbon/human/marine_2 = new(loc_from_corner(2, 2))
arm_equipment(marine_2, /datum/equipment_preset/uscm/private_equipped)
RegisterSignal(marine_2, COMSIG_MOB_DEATH, PROC_REF(kill_marines_2))

var/mob/living/carbon/human/marine_3 = new(loc_from_corner(0, 2))
arm_equipment(marine_3, /datum/equipment_preset/uscm/private_equipped)
RegisterSignal(marine_3, COMSIG_MOB_DEATH, PROC_REF(kill_marines_2))

// Arrange the actions about how they'd be in an actual game
remove_action(xeno, /datum/action/xeno_action/activable/feralfrenzy)
remove_action(xeno, /datum/action/xeno_action/onclick/toggle_gut_targeting)

give_action(xeno, /datum/action/xeno_action/activable/tail_stab)
give_action(xeno, /datum/action/xeno_action/onclick/feralrush)
give_action(xeno, /datum/action/xeno_action/onclick/predalien_roar)
give_action(xeno, /datum/action/xeno_action/activable/feral_smash)
give_action(xeno, /datum/action/xeno_action/activable/feralfrenzy)
give_action(xeno, /datum/action/xeno_action/onclick/toggle_gut_targeting)

/datum/tutorial/xenomorph/abomination/proc/kill_marines_2(datum/source)
SIGNAL_HANDLER

if(ending_marines_killed < 2)
ending_marines_killed++
return

message_to_player("Good work. The tutorial will end shortly.")
tutorial_end_in(7 SECONDS, TRUE)

// END OF SCRIPTING
3 changes: 3 additions & 0 deletions code/modules/gear_presets/_select_equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@
new_human.set_languages(languages)

/datum/equipment_preset/proc/load_preset(mob/living/carbon/human/new_human, randomise = FALSE, count_participant = FALSE, client/mob_client, show_job_gear = TRUE)
if(!new_human.hud_used)
new_human.create_hud()

load_race(new_human, mob_client)
if(randomise || uses_special_name)
load_name(new_human, randomise, mob_client)
Expand Down

0 comments on commit 42d0536

Please sign in to comment.