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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actually ports heretics from /tg/station #2119

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 13 additions & 1 deletion beestation.dme
Expand Up @@ -618,6 +618,7 @@
#include "code\game\gamemodes\dynamic\dynamic_rulesets_latejoin.dm"
#include "code\game\gamemodes\dynamic\dynamic_rulesets_midround.dm"
#include "code\game\gamemodes\dynamic\dynamic_rulesets_roundstart.dm"
#include "code\game\gamemodes\eldritch_cult\eldritch_cult.dm"
#include "code\game\gamemodes\events\event.dm"
#include "code\game\gamemodes\extended\extended.dm"
#include "code\game\gamemodes\gangs\dominator.dm"
Expand Down Expand Up @@ -1370,6 +1371,16 @@
#include "code\modules\antagonists\disease\disease_disease.dm"
#include "code\modules\antagonists\disease\disease_event.dm"
#include "code\modules\antagonists\disease\disease_mob.dm"
#include "code\modules\antagonists\eldritch_cult\eldritch_antag.dm"
#include "code\modules\antagonists\eldritch_cult\eldritch_book.dm"
#include "code\modules\antagonists\eldritch_cult\eldritch_effects.dm"
#include "code\modules\antagonists\eldritch_cult\eldritch_items.dm"
#include "code\modules\antagonists\eldritch_cult\eldritch_knowledge.dm"
#include "code\modules\antagonists\eldritch_cult\eldritch_magic.dm"
#include "code\modules\antagonists\eldritch_cult\eldritch_monster_antag.dm"
#include "code\modules\antagonists\eldritch_cult\knowledge\ash_lore.dm"
#include "code\modules\antagonists\eldritch_cult\knowledge\flesh_lore.dm"
#include "code\modules\antagonists\eldritch_cult\knowledge\rust_lore.dm"
#include "code\modules\antagonists\ert\ert.dm"
#include "code\modules\antagonists\fugitive\fugitive.dm"
#include "code\modules\antagonists\fugitive\fugitive_outfits.dm"
Expand Down Expand Up @@ -2295,6 +2306,7 @@
#include "code\modules\mob\living\simple_animal\constructs.dm"
#include "code\modules\mob\living\simple_animal\corpse.dm"
#include "code\modules\mob\living\simple_animal\damage_procs.dm"
#include "code\modules\mob\living\simple_animal\eldritch_demons.dm"
#include "code\modules\mob\living\simple_animal\parrot.dm"
#include "code\modules\mob\living\simple_animal\shade.dm"
#include "code\modules\mob\living\simple_animal\simple_animal.dm"
Expand Down Expand Up @@ -3047,8 +3059,8 @@
#include "code\modules\vending\magivend.dm"
#include "code\modules\vending\medical.dm"
#include "code\modules\vending\medical_wall.dm"
#include "code\modules\vending\mining.dm"
#include "code\modules\vending\megaseed.dm"
#include "code\modules\vending\mining.dm"
#include "code\modules\vending\modularpc.dm"
#include "code\modules\vending\nutrimax.dm"
#include "code\modules\vending\plasmaresearch.dm"
Expand Down
9 changes: 9 additions & 0 deletions code/__DEFINES/antagonists.dm
Expand Up @@ -71,3 +71,12 @@
#define SPAWNTYPE_ROUNDSTART "roundstart"
#define SPAWNTYPE_MIDROUND "midround"
#define SPAWNTYPE_EITHER "either"

///It is faster as a macro than a proc
#define IS_HERETIC(mob) (mob.mind?.has_antag_datum(/datum/antagonist/heretic))

#define PATH_SIDE "Side"

#define PATH_ASH "Ash"
#define PATH_RUST "Rust"
#define PATH_FLESH "Flesh"
1 change: 1 addition & 0 deletions code/__DEFINES/atom_hud.dm
Expand Up @@ -63,6 +63,7 @@
#define ANTAG_HUD_FUGITIVE 26
#define ANTAG_HUD_BRAINWASHED 27
#define ANTAG_HUD_SURVIVALIST 28
#define ANTAG_HUD_HERETIC 29

// Notification action types
#define NOTIFY_JUMP "jump"
Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/components.dm
Expand Up @@ -93,6 +93,8 @@
#define COMSIG_ATOM_SCREWDRIVER_ACT "atom_screwdriver_act" //! from base of atom/screwdriver_act(): (mob/living/user, obj/item/I)
#define COMSIG_ATOM_INTERCEPT_TELEPORT "intercept_teleport" //! called when teleporting into a protected turf: (channel, turf/origin)
#define COMPONENT_BLOCK_TELEPORT 1
///from base of atom/update_overlays(): (list/new_overlays)
#define COMSIG_ATOM_UPDATE_OVERLAYS "atom_update_overlays"
/////////////////
#define COMSIG_ATOM_ATTACK_GHOST "atom_attack_ghost" //! from base of atom/attack_ghost(): (mob/dead/observer/ghost)
#define COMSIG_ATOM_ATTACK_HAND "atom_attack_hand" //! from base of atom/attack_hand(): (mob/user)
Expand Down Expand Up @@ -155,6 +157,7 @@
#define COMSIG_MOVABLE_DISPOSING "movable_disposing" //! called when the movable is added to a disposal holder object for disposal movement: (obj/structure/disposalholder/holder, obj/machinery/disposal/source)

// /mob signals
#define COMSIG_MOB_LOGIN "mob_login"
#define COMSIG_MOB_DEATH "mob_death" //! from base of mob/death(): (gibbed)
#define COMSIG_MOB_CLICKON "mob_clickon" //! from base of mob/clickon(): (atom/A, params)
#define COMSIG_MOB_CANCEL_CLICKON 1
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/mobs.dm
Expand Up @@ -327,3 +327,5 @@
#define WABBAJACK (1<<6)

#define SLEEP_CHECK_DEATH(X) sleep(X); if(QDELETED(src) || stat == DEAD) return;

#define SILENCE_RANGED_MESSAGE (1<<0)
4 changes: 3 additions & 1 deletion code/__DEFINES/role_preferences.dm
Expand Up @@ -37,6 +37,7 @@
#define ROLE_INTERNAL_AFFAIRS "Internal Affairs Agent"
#define ROLE_GANG "Gangster"
#define ROLE_HOLOPARASITE "Holoparasite"
#define ROLE_HERETIC "Heretic"

//Missing assignment means it's not a gamemode specific role, IT'S NOT A BUG OR ERROR.
//The gamemode specific ones are just so the gamemodes can query whether a player is old enough
Expand Down Expand Up @@ -64,7 +65,8 @@ GLOBAL_LIST_INIT(special_roles, list(
ROLE_INTERNAL_AFFAIRS = /datum/game_mode/traitor/internal_affairs,
ROLE_SENTIENCE,
ROLE_GANG = /datum/game_mode/gang,
ROLE_HOLOPARASITE
ROLE_HOLOPARASITE,
ROLE_HERETIC = /datum/game_mode/heretics
))

//Job defines for what happens when you fail to qualify for any job during job selection
Expand Down
4 changes: 4 additions & 0 deletions code/__DEFINES/say.dm
Expand Up @@ -90,3 +90,7 @@
#define CHAT_FILTER_CHECK(T) (CONFIG_GET(flag/ic_filter_enabled) && config.ic_filter_regex && findtext(T, config.ic_filter_regex))
// Is something in the OOC chat filter?
#define OOC_FILTER_CHECK(T) (CONFIG_GET(flag/ooc_filter_enabled) && config.ooc_filter_regex && findtext(T, config.ooc_filter_regex))

#define INVOCATION_SHOUT "shout"
#define INVOCATION_EMOTE "emote"
#define INVOCATION_WHISPER "whisper"
3 changes: 3 additions & 0 deletions code/__HELPERS/cmp.dm
Expand Up @@ -133,3 +133,6 @@ GLOBAL_VAR_INIT(cmp_field, "name")

/proc/cmp_pdajob_asc(obj/item/pda/A, obj/item/pda/B)
return sorttext(B.ownjob, A.ownjob)

/proc/cmp_mob_realname_dsc(mob/A,mob/B)
return sorttext(A.real_name,B.real_name)
3 changes: 3 additions & 0 deletions code/_globalvars/game_modes.dm
Expand Up @@ -12,3 +12,6 @@ GLOBAL_VAR_INIT(sac_image, null)

//TODO clear this one up too
GLOBAL_DATUM(cult_narsie, /obj/singularity/narsie/large/cult)

///We want reality_smash_tracker to exist only once and be accesable from anywhere.
GLOBAL_DATUM_INIT(reality_smash_track, /datum/reality_smash_tracker, new)
5 changes: 5 additions & 0 deletions code/controllers/configuration/entries/game_options.dm
Expand Up @@ -412,3 +412,8 @@
config_entry_value = 250

/datum/config_entry/flag/restricted_suicide

/datum/config_entry/number/ecult_scaling_coeff //how much does the amount of players get divided by to determine e_cult
config_entry_value = 6
integer = FALSE
min_val = 1
5 changes: 5 additions & 0 deletions code/datums/mood_events/generic_positive_events.dm
Expand Up @@ -173,3 +173,8 @@
/datum/mood_event/area/add_effects(list/param)
mood_change = param[1]
description = param[2]

/datum/mood_event/heretics
description = "<span class='nicegreen'>THE HIGHER I RISE , THE MORE I SEE.</span>\n"
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
description = "<span class='nicegreen'>THE HIGHER I RISE , THE MORE I SEE.</span>\n"
description = "<span class='nicegreen'>THE HIGHER I RISE, THE MORE I SEE.</span>\n"

mood_change = 10 //maybe being a cultist isnt that bad after all
hidden = TRUE
125 changes: 125 additions & 0 deletions code/datums/status_effects/debuffs.dm
Expand Up @@ -633,3 +633,128 @@
name = "TO THE STARS AND BEYOND!"
desc = "I must go, my people need me!"
icon_state = "high"

/datum/status_effect/eldritch
duration = 15 SECONDS
status_type = STATUS_EFFECT_REPLACE
alert_type = null
on_remove_on_mob_delete = TRUE
///underlay used to indicate that someone is marked
var/mutable_appearance/marked_underlay
///path for the underlay
var/effect_sprite = ""

/datum/status_effect/eldritch/on_creation(mob/living/new_owner, ...)
marked_underlay = mutable_appearance('icons/effects/effects.dmi', effect_sprite,BELOW_MOB_LAYER)
return ..()

/datum/status_effect/eldritch/on_apply()
if(owner.mob_size >= MOB_SIZE_HUMAN)
owner.add_overlay(marked_underlay)
owner.update_icon()
return TRUE
return FALSE

/datum/status_effect/eldritch/on_remove()
owner.cut_overlay(marked_underlay)
owner.update_icon()
return ..()

/datum/status_effect/eldritch/Destroy()
QDEL_NULL(marked_underlay)
return ..()

/**
* What happens when this mark gets poppedd
*
* Adds actual functionality to each mark
*/
/datum/status_effect/eldritch/proc/on_effect()
playsound(owner, 'sound/magic/repulse.ogg', 75, TRUE)
qdel(src) //what happens when this is procced.

//Each mark has diffrent effects when it is destroyed that combine with the mansus grasp effect.
/datum/status_effect/eldritch/flesh
id = "flesh_mark"
effect_sprite = "emark1"

/datum/status_effect/eldritch/flesh/on_effect()
if(!ishuman(owner))
return
var/mob/living/carbon/human/H = owner
H.bleed_rate += 5
return ..()

/datum/status_effect/eldritch/ash
id = "ash_mark"
effect_sprite = "emark2"
///Dictates how much damage and stamina loss this mark will cause.
var/repetitions = 1

/datum/status_effect/eldritch/ash/on_creation(mob/living/new_owner, _repetition = 5)
. = ..()
repetitions = min(1,_repetition)

/datum/status_effect/eldritch/ash/on_effect()
if(iscarbon(owner))
var/mob/living/carbon/carbon_owner = owner
carbon_owner.adjustStaminaLoss(10 * repetitions)
carbon_owner.adjustFireLoss(5 * repetitions)
for(var/mob/living/carbon/victim in range(1,carbon_owner))
if(IS_HERETIC(victim) || victim == carbon_owner)
continue
victim.apply_status_effect(type,repetitions-1)
break
return ..()

/datum/status_effect/eldritch/rust
id = "rust_mark"
effect_sprite = "emark3"

/datum/status_effect/eldritch/rust/on_effect()
if(!iscarbon(owner))
return
var/mob/living/carbon/carbon_owner = owner
for(var/obj/item/I in carbon_owner.get_all_gear())
//Affects roughly 75% of items
if(!QDELETED(I) && prob(75)) //Just in case
I.take_damage(100)
return ..()

/datum/status_effect/corrosion_curse
id = "corrosion_curse"
status_type = STATUS_EFFECT_REPLACE
alert_type = null
tick_interval = 1 SECONDS

/datum/status_effect/corrosion_curse/on_creation(mob/living/new_owner, ...)
. = ..()
to_chat(owner, "<span class='danger'>Your feel your body starting to break apart...</span>")

/datum/status_effect/corrosion_curse/tick()
. = ..()
if(!ishuman(owner))
return
var/mob/living/carbon/human/H = owner
var/chance = rand(0,100)
switch(chance)
if(0 to 19)
H.vomit()
if(20 to 29)
H.Dizzy(10)
if(30 to 39)
H.adjustOrganLoss(ORGAN_SLOT_LIVER,5)
if(40 to 49)
H.adjustOrganLoss(ORGAN_SLOT_HEART,5)
if(50 to 59)
H.adjustOrganLoss(ORGAN_SLOT_STOMACH,5)
if(60 to 69)
H.adjustOrganLoss(ORGAN_SLOT_EYES,10)
if(70 to 79)
H.adjustOrganLoss(ORGAN_SLOT_EARS,10)
if(80 to 89)
H.adjustOrganLoss(ORGAN_SLOT_LUNGS,10)
if(90 to 99)
H.adjustOrganLoss(ORGAN_SLOT_TONGUE,10)
if(100)
H.adjustOrganLoss(ORGAN_SLOT_BRAIN,20)
8 changes: 8 additions & 0 deletions code/game/atoms.dm
Expand Up @@ -1192,3 +1192,11 @@

custom_material.on_applied(src, materials[custom_material] * multiplier, material_flags)
custom_materials[custom_material] += materials[custom_material] * multiplier

/**
* Causes effects when the atom gets hit by a rust effect from heretics
*
* Override this if you want custom behaviour in whatever gets hit by the rust
*/
/atom/proc/rust_heretic_act()
return
66 changes: 66 additions & 0 deletions code/game/gamemodes/eldritch_cult/eldritch_cult.dm
@@ -0,0 +1,66 @@
/datum/game_mode/heretics
Copy link
Member

Choose a reason for hiding this comment

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

Is there a title card generation for this mode? (The credit text)

name = "heresy"
config_tag = "heresy"
report_type = "heresy"
antag_flag = ROLE_HERETIC
false_report_weight = 5
protected_jobs = list("Prisoner","Security Officer", "Warden", "Detective", "Head of Security", "Captain")
Copy link
Member

Choose a reason for hiding this comment

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

We do not have the prisoner role

restricted_jobs = list("AI", "Cyborg")
required_players = 0
required_enemies = 1
recommended_enemies = 4
reroll_friendly = 1
enemy_minimum_age = 0

announce_span = "danger"
announce_text = "Heretics have been spotted on the station!\n\
<span class='danger'>Heretics</span>: Accomplish your objectives.\n\
<span class='notice'>Crew</span>: Do not let the madman succeed!"

var/ecult_possible = 4 //hard limit on culties if scaling is turned off
var/num_ecult = 1
var/list/culties = list()

/datum/game_mode/heretics/pre_setup()

if(CONFIG_GET(flag/protect_roles_from_antagonist))
restricted_jobs += protected_jobs

if(CONFIG_GET(flag/protect_assistant_from_antagonist))
restricted_jobs += "Assistant"


var/esc = CONFIG_GET(number/ecult_scaling_coeff)
if(esc)
num_ecult = min(max(1, min(round(num_players() / (esc * 2)) + 2, round(num_players() / esc))),4)
else
num_ecult = max(1, min(num_players(), ecult_possible))

for(var/i in 1 to num_ecult)
if(!antag_candidates.len)
break
var/datum/mind/cultie = antag_pick(antag_candidates)
antag_candidates -= cultie
cultie.special_role = ROLE_HERETIC
cultie.restricted_roles = restricted_jobs
culties += cultie

var/enough_heretics = culties.len > 0

if(!enough_heretics)
setup_error = "Not enough heretic candidates"
return FALSE
else
return TRUE

/datum/game_mode/heretics/post_setup()
for(var/c in culties)
var/datum/mind/cultie = c
log_game("[key_name(cultie)] has been selected as a heretic!")
var/datum/antagonist/heretic/new_antag = new()
cultie.add_antag_datum(new_antag)
return ..()

/datum/game_mode/heretics/generate_report()
return "Cybersun Industries has announced that they have successfully raided a high-security library. The library contained a very dangerous book that was \
shown to posses anomalous properties. We suspect that the book has been copied over, Stay vigilant!"
3 changes: 3 additions & 0 deletions code/game/machinery/_machinery.dm
Expand Up @@ -563,3 +563,6 @@ Class Procs:
. = . % 9
AM.pixel_x = -8 + ((.%3)*8)
AM.pixel_y = -8 + (round( . / 3)*8)

/obj/machinery/rust_heretic_act()
take_damage(500, BRUTE, "melee", 1)
5 changes: 4 additions & 1 deletion code/game/mecha/mecha.dm
Expand Up @@ -1084,7 +1084,7 @@

if(L?.client)
L.update_mouse_pointer()
L.client.view_size.resetToDefault()
L.client.view_size.resetToDefault()
zoom_mode = 0

/////////////////////////
Expand Down Expand Up @@ -1146,3 +1146,6 @@ GLOBAL_VAR_INIT(year_integer, text2num(year)) // = 2013???
if(occupant_sight_flags)
if(user == occupant)
user.sight |= occupant_sight_flags

/obj/mecha/rust_heretic_act()
take_damage(500, BRUTE)
5 changes: 4 additions & 1 deletion code/game/objects/structures.dm
Expand Up @@ -4,7 +4,7 @@
max_integrity = 300
interaction_flags_atom = INTERACT_ATOM_ATTACK_HAND | INTERACT_ATOM_UI_INTERACT
layer = BELOW_OBJ_LAYER

var/climb_time = 20
var/climb_stun = 20
var/climbable = FALSE
Expand Down Expand Up @@ -111,3 +111,6 @@
if(0 to 25)
if(!broken)
return "<span class='warning'>It's falling apart!</span>"

/obj/structure/rust_heretic_act()
take_damage(500, BRUTE, "melee", 1)