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

Adds a new, extremely rare event. #9166

Merged
merged 31 commits into from
Aug 29, 2020
Merged

Adds a new, extremely rare event. #9166

merged 31 commits into from
Aug 29, 2020

Conversation

Xoxeyos
Copy link
Contributor

@Xoxeyos Xoxeyos commented Jul 9, 2020

This adds a new type of event, it randomly picks 1 person per ten people, so for example if you had 30 people, three would be picked, and given one of the nightmarish punishments randomly chosen from the event script.

A few punishments include, brief periods of blurred vision, faint voices, intense headaches, and nigh terminal brain damage in rare instances.

Big help from arcturus-prime.

🆑 Xoxeyos
rscadd: Adds Flutes, an event that can lead to catastrophe.
soundadd: Adds Flutes.ogg for Flute event.
/:cl:

@Xoxeyos Xoxeyos requested a review from Partheo as a code owner July 9, 2020 07:02
@Yogbot-13 Yogbot-13 added Feature This adds new content to the game Sound This PR changes audio files labels Jul 9, 2020
Copy link
Contributor

@Partheo Partheo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flutes.ogg.ogg

@Xoxeyos Xoxeyos requested a review from Partheo July 9, 2020 08:10
@Xoxeyos
Copy link
Contributor Author

Xoxeyos commented Jul 9, 2020

flutes.ogg.ogg

Fixed I believe

@Partheo Partheo added the Awaiting - Action - Maintainer This PR is awaiting an action from a maintainer label Jul 22, 2020
//---------
//UTILITIES
//---------
/proc/list_intersection(var/list/A, var/list/B)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to go in code/__HELPERS/_lists.dm

//--------------------
//OBJECT DEF
/datum/round_event/flutes
var/chosen_players[0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var/chosen_players[0]
var/list/chosen_players = list()

Consistent syntax

var/chosen_players[0]

//ROUND START PROC
//This gets executed at the start of the round
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is simply not true, it gets executed when the event starts

Comment on lines 37 to 44
var/list/remaining_players = list_intersection(GLOB.player_list, GLOB.alive_mob_list)
var/number_of_players_to_select = round((remaining_players.len / 10), 1)
for(var/i; i<=(number_of_players_to_select == 0 ? 1 : number_of_players_to_select); i++)
var/player = remaining_players[rand(1, remaining_players.len)]
sound_intro(player)
pick_flute_scene(player)
remaining_players.Remove(player)
chosen_players.Add(player)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole proc is a bit weird..

This optimized version does a few things:

  1. No need to loop through the lists several times to see where it intersects
  2. C style loops (i=start;i>=end;i++) are much less optimized than "in to" loops (i in start to end)
  3. We can stop looping through lists once we have our target amount of players
  4. Variables names should fit within a couple of characters.... number_of_players_to_select is wayyy too long and verbose

Also remove list_intersection() since you dont need it no more

Suggested change
var/list/remaining_players = list_intersection(GLOB.player_list, GLOB.alive_mob_list)
var/number_of_players_to_select = round((remaining_players.len / 10), 1)
for(var/i; i<=(number_of_players_to_select == 0 ? 1 : number_of_players_to_select); i++)
var/player = remaining_players[rand(1, remaining_players.len)]
sound_intro(player)
pick_flute_scene(player)
remaining_players.Remove(player)
chosen_players.Add(player)
var/target_amount = round((remaining_players.len / 10), 1)
var/list/mob/living/carbon/selected = list()
for(var/mob/living/carbon/C in GLOB.player_list)
if(C.stat)
continue //ignore unconcious/dead players
sound_intro(C)
pick_flute_scene(C)
selected.Add(C)
if(selected.len >= target_amount)
break //were done here

code/modules/events/flutes.dm Outdated Show resolved Hide resolved
code/modules/events/flutes.dm Show resolved Hide resolved
M.blur_eyes(40)
M.adjustStaminaLoss(99)
to_chat(M, "<span class='Narsie'><b>Y'HAH HT'HU THRZHZU. UA'KLL GHRT AWN ZUU!</b></span>")
M.adjustBruteLoss(99)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very close to the crit point

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

purposeful, I want an event that effects a small number of people, and can potentially really fuck them up. If you have a better idea, please tell.

REMOVE_TRAIT(M, TRAIT_UNSTABLE, M)
M.blur_eyes(5)
M.adjustStaminaLoss(90)
M.adjustBruteLoss(90)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very close to the crit point

M.blur_eyes(5)
M.adjustStaminaLoss(90)
M.adjustBruteLoss(90)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 90)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very close to killing someone

M.adjustStaminaLoss(99)
to_chat(M, "<span class='Narsie'><b>Y'HAH HT'HU THRZHZU. UA'KLL GHRT AWN ZUU!</b></span>")
M.adjustBruteLoss(99)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 99.9)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very close to killing someone

@Xoxeyos
Copy link
Contributor Author

Xoxeyos commented Jul 25, 2020

I'll work on these changes shortly.

arcturus-prime and others added 4 commits July 25, 2020 15:24
Co-authored-by: alexkar598 <25136265+alexkar598@users.noreply.github.com>
Co-authored-by: alexkar598 <25136265+alexkar598@users.noreply.github.com>
Co-authored-by: alexkar598 <25136265+alexkar598@users.noreply.github.com>
Xoxeyos and others added 6 commits July 25, 2020 17:29
Co-authored-by: alexkar598 <25136265+alexkar598@users.noreply.github.com>
Co-authored-by: alexkar598 <25136265+alexkar598@users.noreply.github.com>
Co-authored-by: alexkar598 <25136265+alexkar598@users.noreply.github.com>
Co-authored-by: alexkar598 <25136265+alexkar598@users.noreply.github.com>
@Xoxeyos
Copy link
Contributor Author

Xoxeyos commented Jul 26, 2020

Still currently a WIP.

@Xoxeyos Xoxeyos requested a review from alexkar598 July 29, 2020 03:34
@Xoxeyos
Copy link
Contributor Author

Xoxeyos commented Jul 30, 2020

Pretty much finished

code/modules/events/flutes.dm Show resolved Hide resolved
code/modules/events/flutes.dm Show resolved Hide resolved
@Xoxeyos
Copy link
Contributor Author

Xoxeyos commented Aug 20, 2020

I'll take a look at them now.

Co-authored-by: alexkar598 <25136265+alexkar598@users.noreply.github.com>
@Xoxeyos Xoxeyos requested a review from a team as a code owner August 20, 2020 18:56
Copy link
Contributor

@fluffe9911 fluffe9911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty sure he dealt with most of em

@fluffe9911 fluffe9911 merged commit 1696d27 into yogstation13:master Aug 29, 2020
@Yogbot-13 Yogbot-13 added the DME Edit This PR affects the yogstation.DME file label Aug 29, 2020
Yogbot-13 added a commit that referenced this pull request Aug 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting - Action - Maintainer This PR is awaiting an action from a maintainer DME Edit This PR affects the yogstation.DME file Feature This adds new content to the game Sound This PR changes audio files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants