From d34787d98ef91beef89cfa7d7763d5cead942c54 Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Thu, 2 Feb 2017 13:16:54 -0600 Subject: [PATCH 1/2] Buffs the valentines event --- code/modules/events/holiday/vday.dm | 43 ++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/code/modules/events/holiday/vday.dm b/code/modules/events/holiday/vday.dm index ec15894f573..d420758fc74 100644 --- a/code/modules/events/holiday/vday.dm +++ b/code/modules/events/holiday/vday.dm @@ -19,6 +19,47 @@ var/obj/item/weapon/storage/backpack/b = locate() in H.contents new /obj/item/weapon/reagent_containers/food/snacks/candyheart(b) + + var/list/valentines = list() + for(var/mob/living/M in player_list) + if(!M.stat && M.client && M.mind) + valentines |= M + + + for(var/mob/living/L in valentines) + valentines -= L + if(valentines.len) + var/mob/living/date = pick(valentines) + + valentines -= date + + forge_valentines_objective(L, date) + + forge_valentines_objective(date, L) + + + + else + L << "You didn't get a date! They're all having fun without you! you'll show them though..." + var/datum/objective/martyr/normiesgetout = new + normiesgetout.owner = L.mind + ticker.mode.traitors |= L.mind + L.mind.objectives += normiesgetout + + +/proc/forge_valentines_objective(mob/living/lover,mob/living/date) + + ticker.mode.traitors |= lover.mind + lover.mind.special_role = "valentine" + + var/datum/objective/protect/protect_objective = new /datum/objective/protect + protect_objective.owner = lover.mind + protect_objective.target = date.mind + protect_objective.explanation_text = "Protect [date.real_name], your date." + lover.mind.objectives += protect_objective + lover << "You're on a date with [date]! Protect them at all costs. This takes priority over all other loyalties." + + /datum/round_event/valentines/announce() priority_announce("It's Valentine's Day! Give a valentine to that special someone!") @@ -126,4 +167,4 @@ "A heart-shaped candy that reads: FACEHUGGER", "A heart-shaped candy that reads: DOMINATOR", "A heart-shaped candy that reads: GET TESLA'D") - icon_state = pick("candyheart", "candyheart2", "candyheart3", "candyheart4") \ No newline at end of file + icon_state = pick("candyheart", "candyheart2", "candyheart3", "candyheart4") From ceed418d0640786dfa1aade200aba5e3d16d393c Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Thu, 2 Feb 2017 18:40:35 -0600 Subject: [PATCH 2/2] While instead of for --- code/modules/events/holiday/vday.dm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/code/modules/events/holiday/vday.dm b/code/modules/events/holiday/vday.dm index d420758fc74..bcb215ff934 100644 --- a/code/modules/events/holiday/vday.dm +++ b/code/modules/events/holiday/vday.dm @@ -26,12 +26,11 @@ valentines |= M - for(var/mob/living/L in valentines) - valentines -= L + while(valentines.len) + var/mob/living/L = pick_n_take(valentines) if(valentines.len) - var/mob/living/date = pick(valentines) + var/mob/living/date = pick_n_take(valentines) - valentines -= date forge_valentines_objective(L, date) @@ -46,7 +45,6 @@ ticker.mode.traitors |= L.mind L.mind.objectives += normiesgetout - /proc/forge_valentines_objective(mob/living/lover,mob/living/date) ticker.mode.traitors |= lover.mind