diff --git a/beestation.dme b/beestation.dme index 38c9ecf49a9bf..83772afed65ca 100644 --- a/beestation.dme +++ b/beestation.dme @@ -193,6 +193,7 @@ #include "code\__DEFINES\turfs.dm" #include "code\__DEFINES\typeids.dm" #include "code\__DEFINES\uplink.dm" +#include "code\__DEFINES\vampires.dm" #include "code\__DEFINES\vehicles.dm" #include "code\__DEFINES\visual_helpers.dm" #include "code\__DEFINES\vv.dm" @@ -308,6 +309,7 @@ #include "code\__HELPERS\test_helpers.dm" #include "code\__HELPERS\text.dm" #include "code\__HELPERS\time.dm" +#include "code\__HELPERS\traits.dm" #include "code\__HELPERS\turfs.dm" #include "code\__HELPERS\type2type.dm" #include "code\__HELPERS\type_processing.dm" @@ -398,6 +400,7 @@ #include "code\_onclick\hud\screen_objects.dm" #include "code\_onclick\hud\slime.dm" #include "code\_onclick\hud\swarmer.dm" +#include "code\_onclick\hud\vampire.dm" #include "code\_onclick\hud\rendering\plane_master.dm" #include "code\_onclick\hud\rendering\plane_master_controller.dm" #include "code\_onclick\hud\rendering\render_plate.dm" @@ -490,6 +493,7 @@ #include "code\controllers\subsystem\stat.dm" #include "code\controllers\subsystem\stickyban.dm" #include "code\controllers\subsystem\sun.dm" +#include "code\controllers\subsystem\sunlight.dm" #include "code\controllers\subsystem\supply.dm" #include "code\controllers\subsystem\tgui.dm" #include "code\controllers\subsystem\throwing.dm" @@ -1681,6 +1685,7 @@ #include "code\game\objects\structures\tank_dispenser.dm" #include "code\game\objects\structures\target_stake.dm" #include "code\game\objects\structures\traps.dm" +#include "code\game\objects\structures\vampire_crypt.dm" #include "code\game\objects\structures\watercloset.dm" #include "code\game\objects\structures\windoor_assembly.dm" #include "code\game\objects\structures\window.dm" @@ -1714,6 +1719,7 @@ #include "code\game\objects\structures\crates_lockers\closets\secure\secure_closets.dm" #include "code\game\objects\structures\crates_lockers\closets\secure\security.dm" #include "code\game\objects\structures\crates_lockers\crates\bins.dm" +#include "code\game\objects\structures\crates_lockers\crates\coffins.dm" #include "code\game\objects\structures\crates_lockers\crates\critter.dm" #include "code\game\objects\structures\crates_lockers\crates\large.dm" #include "code\game\objects\structures\crates_lockers\crates\secure.dm" @@ -2179,6 +2185,49 @@ #include "code\modules\antagonists\traitor\IAA\internal_affairs.dm" #include "code\modules\antagonists\valentines\heartbreaker.dm" #include "code\modules\antagonists\valentines\valentine.dm" +#include "code\modules\antagonists\vampire\conversion_vampire.dm" +#include "code\modules\antagonists\vampire\datum_vampire.dm" +#include "code\modules\antagonists\vampire\daylight_vampire.dm" +#include "code\modules\antagonists\vampire\frenzy_vampire.dm" +#include "code\modules\antagonists\vampire\life_vampire.dm" +#include "code\modules\antagonists\vampire\misc_procs_vampire.dm" +#include "code\modules\antagonists\vampire\moodlets_vampire.dm" +#include "code\modules\antagonists\vampire\names_vampire.dm" +#include "code\modules\antagonists\vampire\objectives_vampire.dm" +#include "code\modules\antagonists\vampire\clans\_clan.dm" +#include "code\modules\antagonists\vampire\clans\assignclan.dm" +#include "code\modules\antagonists\vampire\clans\clan_flavortext.dm" +#include "code\modules\antagonists\vampire\clans\malkavian.dm" +#include "code\modules\antagonists\vampire\clans\nosferatu.dm" +#include "code\modules\antagonists\vampire\clans\tremere.dm" +#include "code\modules\antagonists\vampire\clans\ventrue.dm" +#include "code\modules\antagonists\vampire\powers\_power.dm" +#include "code\modules\antagonists\vampire\powers\cloak.dm" +#include "code\modules\antagonists\vampire\powers\feed.dm" +#include "code\modules\antagonists\vampire\powers\fortitude.dm" +#include "code\modules\antagonists\vampire\powers\gohome.dm" +#include "code\modules\antagonists\vampire\powers\masquerade.dm" +#include "code\modules\antagonists\vampire\powers\veil.dm" +#include "code\modules\antagonists\vampire\powers\targeted\_targeted.dm" +#include "code\modules\antagonists\vampire\powers\targeted\brawn.dm" +#include "code\modules\antagonists\vampire\powers\targeted\haste.dm" +#include "code\modules\antagonists\vampire\powers\targeted\lunge.dm" +#include "code\modules\antagonists\vampire\powers\targeted\mesmerize.dm" +#include "code\modules\antagonists\vampire\powers\targeted\trespass.dm" +#include "code\modules\antagonists\vampire\powers\tremere\_tremere.dm" +#include "code\modules\antagonists\vampire\powers\tremere\auspex.dm" +#include "code\modules\antagonists\vampire\powers\tremere\dominate.dm" +#include "code\modules\antagonists\vampire\powers\tremere\thaumaturgey.dm" +#include "code\modules\antagonists\vampire\powers\vassal\distress.dm" +#include "code\modules\antagonists\vampire\powers\vassal\recuperate.dm" +#include "code\modules\antagonists\vampire\powers\vassal\revenge_bloodbag.dm" +#include "code\modules\antagonists\vampire\powers\vassal\revenge_checkstatus.dm" +#include "code\modules\antagonists\vampire\powers\vassal\revenge_fold.dm" +#include "code\modules\antagonists\vampire\vassals\datum_vassal.dm" +#include "code\modules\antagonists\vampire\vassals\ex_vassal.dm" +#include "code\modules\antagonists\vampire\vassals\favorite_vassal.dm" +#include "code\modules\antagonists\vampire\vassals\misc_procs_vassal.dm" +#include "code\modules\antagonists\vampire\vassals\revenge_vassal.dm" #include "code\modules\antagonists\wishgranter\wishgranter.dm" #include "code\modules\antagonists\wizard\wizard.dm" #include "code\modules\antagonists\wizard\equipment\artefact.dm" @@ -2910,6 +2959,7 @@ #include "code\modules\language\sylvan.dm" #include "code\modules\language\terrum.dm" #include "code\modules\language\uncommon.dm" +#include "code\modules\language\vampiric.dm" #include "code\modules\language\voltaic.dm" #include "code\modules\language\xenocommon.dm" #include "code\modules\library\lib_codex_gigas.dm" @@ -3139,7 +3189,6 @@ #include "code\modules\mob\living\carbon\human\species_types\shadowpeople.dm" #include "code\modules\mob\living\carbon\human\species_types\skeletons.dm" #include "code\modules\mob\living\carbon\human\species_types\snail.dm" -#include "code\modules\mob\living\carbon\human\species_types\vampire.dm" #include "code\modules\mob\living\carbon\human\species_types\zombies.dm" #include "code\modules\mob\living\carbon\human\verbs\give.dm" #include "code\modules\mob\living\carbon\monkey\death.dm" diff --git a/code/__DEFINES/antagonists.dm b/code/__DEFINES/antagonists.dm index 46c5b43e3f1ea..9b380332a2423 100644 --- a/code/__DEFINES/antagonists.dm +++ b/code/__DEFINES/antagonists.dm @@ -82,6 +82,7 @@ #define FACTION_BLOB "Blob" #define FACTION_ALIEN "Xenomorph" #define FACTION_WIZARD "Wizard" +#define FACTION_VAMPIRE "Vampire" // Heretic path defines. #define HERETIC_PATH_START "Heretic Start Path" diff --git a/code/__DEFINES/is_helpers.dm b/code/__DEFINES/is_helpers.dm index beb339be799f5..a307436d2b1d9 100644 --- a/code/__DEFINES/is_helpers.dm +++ b/code/__DEFINES/is_helpers.dm @@ -99,7 +99,6 @@ GLOBAL_LIST_INIT(turfs_without_ground, typecacheof(list( #define ishumanbasic(A) (is_species(A, /datum/species/human) && !is_species(A, /datum/species/human/krokodil_addict)) #define iscatperson(A) (is_species(A, /datum/species/human/felinid) ) #define isethereal(A) (is_species(A, /datum/species/ethereal)) -#define isvampire(A) (is_species(A,/datum/species/vampire)) #define isdullahan(A) (is_species(A, /datum/species/dullahan)) #define isipc(A) (is_species(A, /datum/species/ipc)) #define isapid(A) (is_species(A, /datum/species/apid)) diff --git a/code/__DEFINES/language.dm b/code/__DEFINES/language.dm index 42002e5ab433c..9ce2ddcf0c5e8 100644 --- a/code/__DEFINES/language.dm +++ b/code/__DEFINES/language.dm @@ -82,5 +82,6 @@ GLOBAL_LIST_INIT(multilingual_language_list, typecacheof(list( /datum/language/sylvan, /datum/language/terrum, /datum/language/uncommon, - /datum/language/voltaic + /datum/language/voltaic, + /datum/language/vampiric ))) diff --git a/code/__DEFINES/role_preferences.dm b/code/__DEFINES/role_preferences.dm index 1b1783108971e..85f12adef686a 100644 --- a/code/__DEFINES/role_preferences.dm +++ b/code/__DEFINES/role_preferences.dm @@ -53,6 +53,7 @@ #define ROLE_PYRO_SLIME "Pyroclastic Anomaly Slime" #define ROLE_MONKEY_HELMET "Sentient Monkey" #define ROLE_PRISONER "Prisoner" +#define ROLE_VAMPIRE "Vampire" /// Roles that are antagonists, roundstart or not, and have passes to do.. antagonistry GLOBAL_LIST_INIT(antagonist_bannable_roles, list( @@ -91,6 +92,7 @@ GLOBAL_LIST_INIT(antagonist_bannable_roles, list( ROLE_FUGITIVE_HUNTER, ROLE_SLAUGHTER_DEMON, ROLE_CONTRACTOR_SUPPORT_UNIT, + ROLE_VAMPIRE, )) #define BAN_ROLE_FORCED_ANTAGONISTS "Forced Antagonists" diff --git a/code/__DEFINES/species.dm b/code/__DEFINES/species.dm index b743ca3356bb6..f810eda00a7e8 100644 --- a/code/__DEFINES/species.dm +++ b/code/__DEFINES/species.dm @@ -24,7 +24,6 @@ #define SPECIES_SKELETON "skeleton" #define SPECIES_SNAILPERSON "snail" #define SPECIES_SUPERSOLDIER "supersoldier" -#define SPECIES_VAMPIRE "vampire" #define SPECIES_PSYPHOZA "psyphoza" //Defines for Golem Species IDs diff --git a/code/__DEFINES/vampires.dm b/code/__DEFINES/vampires.dm new file mode 100644 index 0000000000000..f0b04e651ad85 --- /dev/null +++ b/code/__DEFINES/vampires.dm @@ -0,0 +1,175 @@ +///Uncomment this to enable testing of Vampire features (such as vassalizing people with a mind instead of a client). +//#define VAMPIRE_TESTING + +/** + * Blood-level defines + */ +/// Determines Vampire regeneration rate +#define BS_BLOOD_VOLUME_MAX_REGEN 700 +/// Cost to torture someone halfway, in blood. Called twice for full cost +#define TORTURE_BLOOD_HALF_COST 8 +/// Cost to convert someone after successful torture, in blood +#define TORTURE_CONVERSION_COST 50 +/// Once blood is this low, will enter Frenzy +#define FRENZY_THRESHOLD_ENTER 25 +/// Once blood is this high, will exit Frenzyshak +#define FRENZY_THRESHOLD_EXIT 250 + +/** + * Vassal defines + */ +///If someone passes all checks and can be vassalized +#define VASSALIZATION_ALLOWED 0 +///If someone has to accept vassalization +#define VASSALIZATION_DISLOYAL 1 +///If someone is not allowed under any circimstances to become a Vassal +#define VASSALIZATION_BANNED 2 + +/** + * Cooldown defines + * Used in Cooldowns Vampires use to prevent spamming + */ +///Spam prevention for healing messages. +#define VAMPIRE_SPAM_HEALING (15 SECONDS) +///Span prevention for Sol Masquerade messages. +#define VAMPIRE_SPAM_MASQUERADE (60 SECONDS) + +///Span prevention for Sol messages. +#define VAMPIRE_SPAM_SOL (30 SECONDS) + +/** + * Clan defines + */ +#define CLAN_NONE "Caitiff" +#define CLAN_BRUJAH "Brujah Clan" +#define CLAN_TOREADOR "Toreador Clan" +#define CLAN_NOSFERATU "Nosferatu Clan" +#define CLAN_TREMERE "Tremere Clan" +#define CLAN_GANGREL "Gangrel Clan" +#define CLAN_VENTRUE "Ventrue Clan" +#define CLAN_MALKAVIAN "Malkavian Clan" +#define CLAN_TZIMISCE "Tzimisce Clan" + +#define TREMERE_VASSAL "tremere_vassal" +#define FAVORITE_VASSAL "favorite_vassal" +#define REVENGE_VASSAL "revenge_vassal" + +/** + * Power defines + */ +/// This Power can't be used in Torpor +#define BP_CANT_USE_IN_TORPOR (1<<0) +/// This Power can't be used in Frenzy. +#define BP_CANT_USE_IN_FRENZY (1<<1) +/// This Power can't be used with a stake in you +#define BP_CANT_USE_WHILE_STAKED (1<<2) +/// This Power can't be used while incapacitated +#define BP_CANT_USE_WHILE_INCAPACITATED (1<<3) +/// This Power can't be used while unconscious +#define BP_CANT_USE_WHILE_UNCONSCIOUS (1<<4) + +/// This Power can be purchased by Vampires +#define VAMPIRE_CAN_BUY (1<<0) +/// This is a Default Power that all Vampires get. +#define VAMPIRE_DEFAULT_POWER (1<<1) +/// This Power can be purchased by Tremere Vampires +#define TREMERE_CAN_BUY (1<<2) +/// This Power can be purchased by Vassals +#define VASSAL_CAN_BUY (1<<3) + +/// This Power is a Toggled Power +#define BP_AM_TOGGLE (1<<0) +/// This Power is a Single-Use Power +#define BP_AM_SINGLEUSE (1<<1) +/// This Power has a Static cooldown +#define BP_AM_STATIC_COOLDOWN (1<<2) +/// This Power doesn't cost bloot to run while unconscious +#define BP_AM_COSTLESS_UNCONSCIOUS (1<<3) + +/** + * Vampire Signals + */ +///Called when a Vampire ranks up: (datum/vampire_datum, mob/owner, mob/target) +#define VAMPIRE_RANK_UP "vampire_rank_up" +///Called when a Vampire interacts with a Vassal on their persuasion rack. +#define VAMPIRE_INTERACT_WITH_VASSAL "vampire_interact_with_vassal" +///Called when a Vampire makes a Vassal into their Favorite Vassal: (datum/vassal_datum, mob/master) +#define VAMPIRE_MAKE_FAVORITE "vampire_make_favorite" +///Called when a new Vassal is successfully made: (datum/vampire_datum) +#define VAMPIRE_MADE_VASSAL "vampire_made_vassal" +///Called when a Vampire exits Torpor. +#define VAMPIRE_EXIT_TORPOR "vampire_exit_torpor" +///Called when a Vampire reaches Final Death. +#define VAMPIRE_FINAL_DEATH "vampire_final_death" +///Whether the Vampire should not be dusted when arriving Final Death +#define DONT_DUST (1<<0) +///Called when a Vampire breaks the Masquerade +#define COMSIG_VAMPIRE_BROKE_MASQUERADE "comsig_vampire_broke_masquerade" +///Called when a Vampire enters Frenzy +#define VAMPIRE_ENTERS_FRENZY "vampire_enters_frenzy" +///Called when a Vampire exits Frenzy +#define VAMPIRE_EXITS_FRENZY "vampire_exits_frenzy" + +/** + * Sol signals & Defines + */ +#define COMSIG_SOL_RANKUP_VAMPIRES "comsig_sol_rankup_vampires" +#define COMSIG_SOL_RISE_TICK "comsig_sol_rise_tick" +#define COMSIG_SOL_NEAR_START "comsig_sol_near_start" +#define COMSIG_SOL_END "comsig_sol_end" +///Sent when a warning for Sol is meant to go out: (danger_level, vampire_warning_message, vassal_warning_message) +#define COMSIG_SOL_WARNING_GIVEN "comsig_sol_warning_given" +///Called on a Vampire's Lifetick. +#define COMSIG_VAMPIRE_ON_LIFETICK "comsig_vampire_on_lifetick" + +#define DANGER_LEVEL_FIRST_WARNING 1 +#define DANGER_LEVEL_SECOND_WARNING 2 +#define DANGER_LEVEL_THIRD_WARNING 3 +#define DANGER_LEVEL_SOL_ROSE 4 +#define DANGER_LEVEL_SOL_ENDED 5 + +/** + * Clan defines + * + * This is stuff that is used solely by Clans for clan-related activity. + */ +///Drinks blood the normal Vampire way. +#define VAMPIRE_DRINK_NORMAL "vampire_drink_normal" +///Drinks blood but is snobby, refusing to drink from mindless +#define VAMPIRE_DRINK_SNOBBY "vampire_drink_snobby" +///Drinks blood from disgusting creatures without Humanity consequences. +#define VAMPIRE_DRINK_INHUMANELY "vampire_drink_imhumanely" + +/** + * Traits + */ +/// Falsifies Health analyzer blood levels +#define TRAIT_MASQUERADE "trait_masquerade" +/// Your body is literal room temperature. Does not make you immune to the temp +#define TRAIT_COLDBLOODED "trait_coldblooded" + +/** + * Sources + */ +#define TRAIT_VAMPIRE "trait_vampire" +/// Source trait while Feeding +#define TRAIT_FEED "trait_feed" +/// Source trait during a Frenzy +#define TRAIT_FRENZY "trait_frenzy" +/// Source trait for vampires in torpor. +#define TRAIT_TORPOR "trait_torpor" +/// Source trait for vampire mesmerization. +#define TRAIT_MESMERIZED "trait_mesmerized" + +/** + * Macros + */ +#define IS_VAMPIRE(mob) (mob?.mind?.has_antag_datum(/datum/antagonist/vampire)) +#define IS_VASSAL(mob) (mob?.mind?.has_antag_datum(/datum/antagonist/vassal)) +#define IS_FAVORITE_VASSAL(mob) (mob?.mind?.has_antag_datum(/datum/antagonist/vassal/favorite)) +#define IS_REVENGE_VASSAL(mob) (mob?.mind?.has_antag_datum(/datum/antagonist/vassal/revenge)) +#define IS_EX_VASSAL(mob) (mob?.mind?.has_antag_datum(/datum/antagonist/ex_vassal)) +#define IS_CURATOR(mob) (mob?.mind?.assigned_role == JOB_NAME_CURATOR) + +//Used in vampire_life.dm +#define MARTIALART_FRENZYGRAB "frenzy grabbing" diff --git a/code/__HELPERS/traits.dm b/code/__HELPERS/traits.dm new file mode 100644 index 0000000000000..918ee9aedb907 --- /dev/null +++ b/code/__HELPERS/traits.dm @@ -0,0 +1,9 @@ +/// Proc that handles adding multiple traits to a target via a list. Must have a common source and target. +/datum/proc/add_traits(list/list_of_traits, source) + for(var/trait in list_of_traits) + ADD_TRAIT(src, trait, source) + +/// Proc that handles removing multiple traits from a target via a list. Must have a common source and target. +/datum/proc/remove_traits(list/list_of_traits, source) + for(var/trait in list_of_traits) + REMOVE_TRAIT(src, trait, source) diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 80a0c4896153b..98a0059f5d9ab 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -30,6 +30,10 @@ GLOBAL_LIST_INIT(available_ui_styles, list( var/atom/movable/screen/ling/chems/lingchemdisplay var/atom/movable/screen/ling/sting/lingstingdisplay + var/atom/movable/screen/vampire/blood_counter/blood_display + var/atom/movable/screen/vampire/rank_counter/vamprank_display + var/atom/movable/screen/vampire/sunlight_counter/sunlight_display + var/atom/movable/screen/blobpwrdisplay var/atom/movable/screen/alien_plasma_display diff --git a/code/_onclick/hud/vampire.dm b/code/_onclick/hud/vampire.dm new file mode 100644 index 0000000000000..ee3e1adf05711 --- /dev/null +++ b/code/_onclick/hud/vampire.dm @@ -0,0 +1,88 @@ +/// 1 tile down +#define UI_BLOOD_DISPLAY "WEST:6,CENTER-1:0" +/// 2 tiles down +#define UI_VAMPRANK_DISPLAY "WEST:6,CENTER-2:-5" +/// 6 pixels to the right, zero tiles & 5 pixels DOWN. +#define UI_SUNLIGHT_DISPLAY "WEST:6,CENTER-0:0" + +///Maptext define for Vampire HUDs +#define FORMAT_VAMPIRE_HUD_TEXT(valuecolor, value) MAPTEXT("
[round(value,1)]
") +///Maptext define for Vampire Sunlight HUDs +#define FORMAT_VAMPIRE_SUNLIGHT_TEXT(valuecolor, value) MAPTEXT("
[value]
") + +/atom/movable/screen/vampire + icon = 'icons/vampires/actions_vampire.dmi' + +/atom/movable/screen/vampire/blood_counter + name = "Blood Consumed" + icon_state = "blood_display" + screen_loc = UI_BLOOD_DISPLAY + +/atom/movable/screen/vampire/rank_counter + name = "Vampire Rank" + icon_state = "rank" + screen_loc = UI_VAMPRANK_DISPLAY + +/atom/movable/screen/vampire/sunlight_counter + name = "Solar Flare Timer" + icon_state = "sunlight" + screen_loc = UI_SUNLIGHT_DISPLAY +#ifdef VAMPIRE_TESTING + var/datum/controller/subsystem/sunlight/sunlight_subsystem + +/atom/movable/screen/vampire/sunlight_counter/New(loc, ...) + . = ..() + sunlight_subsystem = SSsunlight +#endif + +/// Update Blood Counter + Rank Counter +/datum/antagonist/vampire/proc/update_hud() + var/valuecolor + if(vampire_blood_volume > BLOOD_VOLUME_SAFE) + valuecolor = "#FFDDDD" + else if(vampire_blood_volume > BLOOD_VOLUME_BAD) + valuecolor = "#FFAAAA" + + blood_display?.maptext = FORMAT_VAMPIRE_HUD_TEXT(valuecolor, vampire_blood_volume) + + if(vamprank_display) + if(vampire_level_unspent > 0) + vamprank_display.icon_state = "[initial(vamprank_display.icon_state)]_up" + else + vamprank_display.icon_state = initial(vamprank_display.icon_state) + vamprank_display.maptext = FORMAT_VAMPIRE_HUD_TEXT(valuecolor, vampire_level) + + if(sunlight_display) + if(SSsunlight.sunlight_active) + valuecolor = "#FF5555" + sunlight_display.icon_state = "[initial(sunlight_display.icon_state)]_day" + else + switch(round(SSsunlight.time_til_cycle, 1)) + if(0 to 30) + sunlight_display.icon_state = "[initial(sunlight_display.icon_state)]_30" + valuecolor = "#FFCCCC" + if(31 to 60) + sunlight_display.icon_state = "[initial(sunlight_display.icon_state)]_60" + valuecolor = "#FFE6CC" + if(61 to 90) + sunlight_display.icon_state = "[initial(sunlight_display.icon_state)]_90" + valuecolor = "#FFFFCC" + else + sunlight_display.icon_state = "[initial(sunlight_display.icon_state)]_night" + valuecolor = "#FFFFFF" + sunlight_display.maptext = FORMAT_VAMPIRE_SUNLIGHT_TEXT( \ + valuecolor, \ + (SSsunlight.time_til_cycle >= 60) ? "[round(SSsunlight.time_til_cycle / 60, 1)] m" : "[round(SSsunlight.time_til_cycle, 1)] s" \ + ) + +/// 1 tile down +#undef UI_BLOOD_DISPLAY +/// 2 tiles down +#undef UI_VAMPRANK_DISPLAY +/// 6 pixels to the right, zero tiles & 5 pixels DOWN. +#undef UI_SUNLIGHT_DISPLAY + +///Maptext define for Vampire HUDs +#undef FORMAT_VAMPIRE_HUD_TEXT +///Maptext define for Vampire Sunlight HUDs +#undef FORMAT_VAMPIRE_SUNLIGHT_TEXT diff --git a/code/controllers/subsystem/sunlight.dm b/code/controllers/subsystem/sunlight.dm new file mode 100644 index 0000000000000..6bde07eb04f4c --- /dev/null +++ b/code/controllers/subsystem/sunlight.dm @@ -0,0 +1,89 @@ +///How long Sol will last until it's night again. +#define TIME_VAMPIRE_DAY 60 +///Base time nighttime should be in for, until Sol rises. +#define TIME_VAMPIRE_NIGHT 600 +///Time left to send an alert to Vampires about an incoming Sol. +#define TIME_VAMPIRE_DAY_WARN 90 +///Time left to send an urgent alert to Vampires about an incoming Sol. +#define TIME_VAMPIRE_DAY_FINAL_WARN 30 +///Time left to alert that Sol is rising. +#define TIME_VAMPIRE_BURN_INTERVAL 5 + +///How much time Sol can be 'off' by, keeping the time inconsistent. +#define TIME_VAMPIRE_SOL_DELAY 90 + +SUBSYSTEM_DEF(sunlight) + name = "Sol" + can_fire = FALSE + wait = 2 SECONDS + flags = SS_NO_INIT | SS_BACKGROUND | SS_TICKER + + ///If the Sun is currently out our not. + var/sunlight_active = FALSE + ///The time between the next cycle, randomized every night. + var/time_til_cycle = TIME_VAMPIRE_NIGHT + ///If Vampire levels for the night has been given out yet. + var/issued_XP = FALSE + +/datum/controller/subsystem/sunlight/fire(resumed = FALSE) + time_til_cycle-- + if(sunlight_active) + if(time_til_cycle > 0) + SEND_SIGNAL(src, COMSIG_SOL_RISE_TICK) + if(!issued_XP && time_til_cycle <= 15) + issued_XP = TRUE + SEND_SIGNAL(src, COMSIG_SOL_RANKUP_VAMPIRES) + if(time_til_cycle <= 1) + sunlight_active = FALSE + issued_XP = FALSE + //randomize the next sol timer + time_til_cycle = round(rand((TIME_VAMPIRE_NIGHT-TIME_VAMPIRE_SOL_DELAY), (TIME_VAMPIRE_NIGHT+TIME_VAMPIRE_SOL_DELAY)), 1) + message_admins("VAMPIRE NOTICE: Daylight Ended. Resetting to Night (Lasts for [time_til_cycle / 60] minutes.") + SEND_SIGNAL(src, COMSIG_SOL_END) + warn_daylight( + danger_level = DANGER_LEVEL_SOL_ENDED, + vampire_warning_message = "The solar flare has ended, and the daylight danger has passed... for now.", + vassal_warning_message = "The solar flare has ended, and the daylight danger has passed... for now.", + ) + return + + switch(time_til_cycle) + if(TIME_VAMPIRE_DAY_WARN) + SEND_SIGNAL(src, COMSIG_SOL_NEAR_START) + warn_daylight( + danger_level = DANGER_LEVEL_FIRST_WARNING, + vampire_warning_message = "Solar Flares will bombard the station with dangerous UV radiation in [TIME_VAMPIRE_DAY_WARN / 60] minutes. Prepare to seek cover in a coffin or closet." + ) + if(TIME_VAMPIRE_DAY_FINAL_WARN) + message_admins("VAMPIRE NOTICE: Daylight beginning in [TIME_VAMPIRE_DAY_FINAL_WARN] seconds.") + warn_daylight( + danger_level = DANGER_LEVEL_SECOND_WARNING, + vampire_warning_message = "Solar Flares are about to bombard the station! You have [TIME_VAMPIRE_DAY_FINAL_WARN] seconds to find cover!", + vassal_warning_message = "In [TIME_VAMPIRE_DAY_FINAL_WARN] seconds, your master will be at risk of a Solar Flare. Make sure they find cover!", + ) + if(TIME_VAMPIRE_BURN_INTERVAL) + warn_daylight( + danger_level = DANGER_LEVEL_THIRD_WARNING, + vampire_warning_message = "Seek cover, for Sol rises!", + ) + if(NONE) + sunlight_active = TRUE + //set the timer to countdown daytime now. + time_til_cycle = TIME_VAMPIRE_DAY + message_admins("VAMPIRE NOTICE: Daylight Beginning (Lasts for [TIME_VAMPIRE_DAY / 60] minutes.)") + warn_daylight( + danger_level = DANGER_LEVEL_SOL_ROSE, + vampire_warning_message = "Solar flares bombard the station with deadly UV light! Stay in cover for the next [TIME_VAMPIRE_DAY / 60] minutes or risk Final Death!", + vassal_warning_message = "Solar flares bombard the station with UV light!", + ) + +/datum/controller/subsystem/sunlight/proc/warn_daylight(danger_level, vampire_warning_message, vassal_warning_message) + SEND_SIGNAL(src, COMSIG_SOL_WARNING_GIVEN, danger_level, vampire_warning_message, vassal_warning_message) + +#undef TIME_VAMPIRE_SOL_DELAY + +#undef TIME_VAMPIRE_DAY +#undef TIME_VAMPIRE_NIGHT +#undef TIME_VAMPIRE_DAY_WARN +#undef TIME_VAMPIRE_DAY_FINAL_WARN +#undef TIME_VAMPIRE_BURN_INTERVAL diff --git a/code/datums/brain_damage/special.dm b/code/datums/brain_damage/special.dm index 79ec38905f1f0..31f52703bbec5 100644 --- a/code/datums/brain_damage/special.dm +++ b/code/datums/brain_damage/special.dm @@ -255,3 +255,169 @@ victim = null STOP_PROCESSING(SSfastprocess,src) return ..() + +/datum/brain_trauma/special/bluespace_prophet/phobetor + name = "Sleepless Dreamer" + desc = "The patient, after undergoing untold psychological hardship, believes they can travel between the dreamscapes of this dimension." + scan_desc = "awoken sleeper" + gain_text = "Your mind snaps, and you wake up. You really wake up." + lose_text = "You succumb once more to the sleepless dream of the unwoken." + + ///Created tears, only checking the FIRST one, not the one it's created to link to. + var/list/created_firsts = list() + COOLDOWN_DECLARE(portal_cooldown) + +///When the trauma is removed from a mob. +/datum/brain_trauma/special/bluespace_prophet/phobetor/on_lose(silent) + for(var/obj/effect/hallucination/simple/phobetor/phobetor_tears as anything in created_firsts) + qdel(phobetor_tears) + +/datum/brain_trauma/special/bluespace_prophet/phobetor/on_life(seconds_per_tick, times_fired) + if(!COOLDOWN_FINISHED(src, portal_cooldown)) + return + COOLDOWN_START(src, portal_cooldown, 10 SECONDS) + var/list/turf/possible_tears = list() + for(var/turf/nearby_turfs as anything in RANGE_TURFS(8, owner)) + if(nearby_turfs.density) + continue + possible_tears += nearby_turfs + if(!LAZYLEN(possible_tears)) + return + + var/turf/first_tear + var/turf/second_tear + first_tear = return_valid_floor_in_range(owner, 6, 0, TRUE) + if(!first_tear) + return + second_tear = return_valid_floor_in_range(first_tear, 20, 6, TRUE) + if(!second_tear) + return + + var/obj/effect/hallucination/simple/phobetor/first = new(first_tear, owner) + var/obj/effect/hallucination/simple/phobetor/second = new(second_tear, owner) + + first.linked_to = second + first.seer = owner + first.desc += " This one leads to [get_area(second)]." + first.name += " ([get_area(second)])" + created_firsts += first + + second.linked_to = first + second.seer = owner + second.desc += " This one leads to [get_area(first)]." + second.name += " ([get_area(first)])" + + // Delete Next Portal if it's time (it will remove its partner) + var/obj/effect/hallucination/simple/phobetor/first_on_the_stack = created_firsts[1] + if(created_firsts.len && world.time >= first_on_the_stack.created_on + first_on_the_stack.exist_length) + var/targetGate = first_on_the_stack + created_firsts -= targetGate + qdel(targetGate) + +/datum/brain_trauma/special/bluespace_prophet/phobetor/proc/return_valid_floor_in_range(atom/targeted_atom, checkRange = 8, minRange = 0, check_floor = TRUE) + // FAIL: Atom doesn't exist. Aren't you real? + if(!istype(targeted_atom)) + return FALSE + var/delta_x = rand(minRange,checkRange)*pick(-1,1) + var/delta_y = rand(minRange,checkRange)*pick(-1,1) + var/turf/center = get_turf(targeted_atom) + + var/target = locate((center.x + delta_x),(center.y + delta_y), center.z) + if(check_turf_is_valid(target, check_floor)) + return target + return FALSE + +/** + * Used as a helper that checks if you can successfully teleport to a turf. + * Returns a boolean, and checks for if the turf has density, if the turf's area has the NOTELEPORT flag, + * and if the objects in the turf have density. + * If check_floor is TRUE in the argument, it will return FALSE if it's not a type of [/turf/open/floor]. + * Arguments: + * * turf/open_turf - The turf being checked for validity. + * * check_floor - Checks if it's a type of [/turf/open/floor]. If this is FALSE, lava/chasms will be able to be selected. + */ +/datum/brain_trauma/special/bluespace_prophet/phobetor/proc/check_turf_is_valid(turf/open_turf, check_floor = TRUE) + if(check_floor && !istype(open_turf, /turf/open/floor)) + return FALSE + if(open_turf.density) + return FALSE + var/area/turf_area = get_area(open_turf) + if(turf_area.area_flags & HIDDEN_AREA) + return FALSE + // Checking for Objects... + for(var/obj/object in open_turf) + if(object.density) + return FALSE + return TRUE + +/** + * # Phobetor Tears + * + * The phobetor tears created by the Brain trauma. + */ + +/obj/effect/hallucination/simple/phobetor + name = "phobetor tear" + desc = "A subdimensional rip in reality, which gives extra-spacial passage to those who have woken from the sleepless dream." + /// Both of these are here so ghosts can see the tears too. + icon = 'icons/effects/effects.dmi' + icon_state = "phobetor_tear" + image_icon = 'icons/effects/effects.dmi' + image_state = "phobetor_tear" + image_layer = ABOVE_MOB_LAYER + + /// How long this will exist for + var/exist_length = 50 SECONDS + /// The time of this tear's creation + var/created_on + /// The phobetor tear this is linked to + var/obj/effect/hallucination/simple/phobetor/linked_to + /// The person able to see this tear. + var/mob/living/carbon/seer + +/obj/effect/hallucination/simple/phobetor/Initialize(mapload) + . = ..() + created_on = world.time + +/obj/effect/hallucination/simple/phobetor/Destroy() + if(linked_to) + linked_to.linked_to = null + QDEL_NULL(linked_to) + return ..() + +/obj/effect/hallucination/simple/phobetor/proc/check_location_seen(atom/subject, turf/target_turf) + if(!target_turf) + return FALSE + if(!isturf(target_turf)) + return FALSE + if(!target_turf.lighting_object || !target_turf.get_lumcount() >= 0.1) + return FALSE + for(var/mob/living/nearby_viewers in viewers(target_turf)) + if(nearby_viewers == subject) + continue + if(!isliving(nearby_viewers) || !nearby_viewers.mind) + continue + if(IS_VAMPIRE(nearby_viewers) || IS_VASSAL(nearby_viewers)) + continue + if(nearby_viewers.has_unlimited_silicon_privilege || nearby_viewers.is_blind()) + continue + return TRUE + return FALSE + +/obj/effect/hallucination/simple/phobetor/attack_hand(mob/living/user, list/modifiers) + if(user != seer || !linked_to) + return + for(var/obj/item/implant/tracking/imp in user.implants) + if(imp) + to_chat(user, "[imp] gives you the sense that you're being watched.") + return + // Is this, or linked, stream being watched? + if(check_location_seen(user, get_turf(user))) + to_chat(user, "Not while you're being watched.") + return + if(check_location_seen(user, get_turf(linked_to))) + to_chat(user, "Your destination is being watched.") + return + to_chat(user, "You slip unseen through [src].") + user.playsound_local(null, 'sound/magic/wand_teleport.ogg', 30, FALSE, pressure_affected = FALSE) + user.forceMove(get_turf(linked_to)) diff --git a/code/datums/components/crafting/crafting_lists/structures.dm b/code/datums/components/crafting/crafting_lists/structures.dm index 835719293a27b..84ab9e0616f78 100644 --- a/code/datums/components/crafting/crafting_lists/structures.dm +++ b/code/datums/components/crafting/crafting_lists/structures.dm @@ -120,6 +120,92 @@ category = CAT_STRUCTURE one_per_turf = TRUE +/datum/crafting_recipe/blackcoffin + name = "Black Coffin" + result = /obj/structure/closet/crate/coffin/blackcoffin + tools = list(TOOL_WELDER, TOOL_SCREWDRIVER) + reqs = list( + /obj/item/stack/sheet/cotton/cloth = 1, + /obj/item/stack/sheet/wood = 5, + /obj/item/stack/sheet/iron = 1, + ) + time = 15 SECONDS + category = CAT_STRUCTURE + +/datum/crafting_recipe/securecoffin + name = "Secure Coffin" + result = /obj/structure/closet/crate/coffin/securecoffin + tools = list(TOOL_WELDER, TOOL_SCREWDRIVER) + reqs = list( + /obj/item/stack/rods = 1, + /obj/item/stack/sheet/plasteel = 5, + /obj/item/stack/sheet/iron = 5, + ) + time = 15 SECONDS + category = CAT_STRUCTURE + +/datum/crafting_recipe/meatcoffin + name = "Meat Coffin" + result = /obj/structure/closet/crate/coffin/meatcoffin + tools = list(TOOL_KNIFE, TOOL_ROLLINGPIN) + reqs = list( + /obj/item/food/meat/slab = 5, + /obj/item/restraints/handcuffs/cable = 1, + ) + time = 15 SECONDS + category = CAT_STRUCTURE + always_available = FALSE //only for the elite vampires + +/datum/crafting_recipe/metalcoffin + name = "Metal Coffin" + result = /obj/structure/closet/crate/coffin/metalcoffin + tools = list(TOOL_WRENCH, TOOL_SCREWDRIVER) + reqs = list( + /obj/item/stack/sheet/iron = 6, + /obj/item/stack/rods = 2, + ) + time = 10 SECONDS + category = CAT_STRUCTURE + +/datum/crafting_recipe/vassalrack + name = "Persuasion Rack" + result = /obj/structure/vampire/vassalrack + tools = list(TOOL_WELDER, TOOL_WRENCH) + reqs = list( + /obj/item/stack/sheet/wood = 3, + /obj/item/stack/sheet/iron = 2, + /obj/item/restraints/handcuffs/cable = 2, + ) + time = 15 SECONDS + category = CAT_STRUCTURE + always_available = FALSE + +/datum/crafting_recipe/candelabrum + name = "Candelabrum" + result = /obj/structure/vampire/candelabrum + tools = list(TOOL_WELDER, TOOL_WRENCH) + reqs = list( + /obj/item/stack/sheet/iron = 3, + /obj/item/stack/rods = 1, + /obj/item/candle = 1, + ) + time = 10 SECONDS + category = CAT_STRUCTURE + always_available = FALSE + +/datum/crafting_recipe/bloodthrone + name = "Blood Throne" + result = /obj/structure/vampire/bloodthrone + tools = list(TOOL_WRENCH) + reqs = list( + /obj/item/stack/sheet/cotton/cloth = 3, + /obj/item/stack/sheet/iron = 5, + /obj/item/stack/sheet/wood = 1, + ) + time = 5 SECONDS + category = CAT_STRUCTURE + always_available = FALSE + /datum/crafting_recipe/weightmachine name = "Chest press machine" result = /obj/structure/weightmachine @@ -156,4 +242,3 @@ tools = list(TOOL_WIRECUTTER) category = CAT_STRUCTURE one_per_turf = TRUE - diff --git a/code/datums/components/crafting/crafting_lists/weaponry/weapons.dm b/code/datums/components/crafting/crafting_lists/weaponry/weapons.dm index af1eefd2cd594..ab259844017d0 100644 --- a/code/datums/components/crafting/crafting_lists/weaponry/weapons.dm +++ b/code/datums/components/crafting/crafting_lists/weaponry/weapons.dm @@ -396,3 +396,37 @@ category = CAT_WEAPONRY subcategory = CAT_WEAPON dangerous_craft = TRUE + +/datum/crafting_recipe/stake + name = "Stake" + result = /obj/item/stake + reqs = list(/obj/item/stack/sheet/wood = 3) + time = 8 SECONDS + category = CAT_WEAPONRY + subcategory = CAT_WEAPON + dangerous_craft = TRUE + +/datum/crafting_recipe/hardened_stake + name = "Hardened Stake" + result = /obj/item/stake/hardened + tools = list(TOOL_WELDER) + reqs = list(/obj/item/stack/rods = 1) + time = 6 SECONDS + category = CAT_WEAPONRY + subcategory = CAT_WEAPON + dangerous_craft = TRUE + always_available = FALSE + +/datum/crafting_recipe/silver_stake + name = "Silver Stake" + result = /obj/item/stake/hardened/silver + tools = list(TOOL_WELDER) + reqs = list( + /obj/item/stack/sheet/mineral/silver = 1, + /obj/item/stake/hardened = 1, + ) + time = 8 SECONDS + category = CAT_WEAPONRY + subcategory = CAT_WEAPON + dangerous_craft = TRUE + always_available = FALSE diff --git a/code/datums/mind.dm b/code/datums/mind.dm index d05a0a0b82427..d06bc28286cce 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -716,6 +716,12 @@ add_antag_datum(head) special_role = ROLE_REV_HEAD +/datum/mind/proc/make_vampire(datum/mind/creator) + if(!has_antag_datum(/datum/antagonist/vampire)) + special_role = ROLE_VAMPIRE + assigned_role = ROLE_VAMPIRE + add_antag_datum(/datum/antagonist/vampire) + /datum/mind/proc/AddSpell(obj/effect/proc_holder/spell/S) // HACK: Preferences menu creates one of every selectable species. // Some species, like vampires, create spells when they're made. diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_latejoin.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_latejoin.dm index 0a21008e6b14c..5e88cd85ec0c8 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets_latejoin.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets_latejoin.dm @@ -117,3 +117,36 @@ new_heretic.knowledge_points = min(new_heretic.knowledge_points, 5) return DYNAMIC_EXECUTE_SUCCESS + +////////////////////////////////////////////// +// // +// LATEJOIN VAMPIRE // +// // +////////////////////////////////////////////// + +/datum/dynamic_ruleset/latejoin/vampire + name = "Vampire Breakout" + antag_datum = /datum/antagonist/vampire + role_preference = /datum/role_preference/antagonist/vampire + protected_roles = list(JOB_NAME_CAPTAIN, JOB_NAME_HEADOFPERSONNEL, JOB_NAME_HEADOFSECURITY, JOB_NAME_WARDEN, JOB_NAME_SECURITYOFFICER, JOB_NAME_DETECTIVE, JOB_NAME_CURATOR) + restricted_roles = list(JOB_NAME_AI, JOB_NAME_CYBORG) + required_candidates = 1 + weight = 5 + cost = 10 + requirements = list(10,10,10,10,10,10,10,10,10,10) + repeatable = FALSE + +/datum/dynamic_ruleset/latejoin/vampire/execute() + var/mob/latejoiner = pick(candidates) // This should contain a single player, but in case. + assigned += latejoiner.mind + + for(var/datum/mind/candidate_mind as anything in assigned) + var/datum/antagonist/vampire/vampiredatum = candidate_mind.make_vampire() + if(!vampiredatum) + assigned -= candidate_mind + message_admins("[ADMIN_LOOKUPFLW(candidate_mind)] was selected by the [name] ruleset, but couldn't be made into a Vampire.") + continue + vampiredatum.vampire_level_unspent = rand(2,3) + message_admins("[ADMIN_LOOKUPFLW(candidate_mind)] was selected by the [name] ruleset and has been made into a midround Vampire.") + log_game("DYNAMIC: [key_name(candidate_mind)] was selected by the [name] ruleset and has been made into a midround Vampire.") + return TRUE diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm index 3217233bbeda9..5f55b1c0dad8e 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets_midround.dm @@ -280,6 +280,45 @@ M.add_ion_law(generate_ion_law()) return DYNAMIC_EXECUTE_SUCCESS +////////////////////////////////////////////// +// // +// MIDROUND VAMPIRE // +// // +////////////////////////////////////////////// + +/datum/dynamic_ruleset/midround/vampire + name = "Vampiric Accident" + midround_ruleset_style = MIDROUND_RULESET_STYLE_HEAVY + antag_datum = /datum/antagonist/vampire + role_preference = /datum/role_preference/midround_living/vampire + protected_roles = list(JOB_NAME_CAPTAIN, JOB_NAME_HEADOFPERSONNEL, JOB_NAME_HEADOFSECURITY, JOB_NAME_WARDEN, JOB_NAME_SECURITYOFFICER, JOB_NAME_DETECTIVE, JOB_NAME_CURATOR) + restricted_roles = list(JOB_NAME_AI, JOB_NAME_CYBORG, "Positronic Brain") + required_candidates = 1 + weight = 5 + cost = 10 + requirements = list(40,30,20,10,10,10,10,10,10,10) + repeatable = FALSE + +/datum/dynamic_ruleset/midround/vampire/trim_candidates() + candidates = living_players + for(var/mob/living/player in candidates) + if(!is_station_level(player.z)) + candidates.Remove(player) + else if(player.mind && (player.mind.special_role || length(player.mind.antag_datums) > 0)) + candidates.Remove(player) + +/datum/dynamic_ruleset/midround/vampire/execute() + var/mob/selected_mobs = pick(living_players) + assigned += selected_mobs.mind + living_players -= selected_mobs + var/datum/mind/candidate_mind = selected_mobs.mind + candidate_mind.make_vampire() + var/datum/antagonist/vampire/vampiredatum = IS_VAMPIRE(candidate_mind.current) + vampiredatum.vampire_level_unspent = rand(2,3) + message_admins("[ADMIN_LOOKUPFLW(selected_mobs)] was selected by the [name] ruleset and has been made into a midround Vampire.") + log_game("DYNAMIC: [key_name(selected_mobs)] was selected by the [name] ruleset and has been made into a midround Vampire.") + return TRUE + ////////////////////////////////////////////// // // // WIZARD (GHOST) // diff --git a/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm b/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm index ebe48dbb4474a..f179c09c378e3 100644 --- a/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm +++ b/code/game/gamemodes/dynamic/dynamic_rulesets_roundstart.dm @@ -630,3 +630,42 @@ SSticker.mode_result = "win - incursion win" else SSticker.mode_result = "loss - staff stopped the incursion" + +////////////////////////////////////////////// +// // +// ROUNDSTART VAMPIRE // +// // +////////////////////////////////////////////// + +/datum/dynamic_ruleset/roundstart/vampire + name = "Vampires" + role_preference = /datum/role_preference/antagonist/vampire + antag_datum = /datum/antagonist/vampire + protected_roles = list(JOB_NAME_CAPTAIN, JOB_NAME_HEADOFPERSONNEL, JOB_NAME_HEADOFSECURITY, JOB_NAME_WARDEN, JOB_NAME_SECURITYOFFICER, JOB_NAME_DETECTIVE, JOB_NAME_CURATOR) + restricted_roles = list(JOB_NAME_AI, JOB_NAME_CYBORG) + required_candidates = 1 + weight = 3 + cost = 10 + scaling_cost = 9 + requirements = list(10,10,10,10,10,10,10,10,10,10) + antag_cap = list("denominator" = 24) + +/datum/dynamic_ruleset/roundstart/vampire/pre_execute(population) + . = ..() + var/num_vampires = get_antag_cap(population) * (scaled_times + 1) + + for(var/i = 1 to num_vampires) + if(candidates.len <= 0) + break + var/mob/selected_mobs = pick_n_take(candidates) + assigned += selected_mobs.mind + selected_mobs.mind.restricted_roles = restricted_roles + GLOB.pre_setup_antags += selected_mobs.mind + return TRUE + +/datum/dynamic_ruleset/roundstart/vampire/execute() + for(var/datum/mind/candidate_mind as anything in assigned) + candidate_mind.make_vampire() + GLOB.pre_setup_antags -= candidate_mind + candidate_mind.special_role = ROLE_VAMPIRE + return TRUE diff --git a/code/game/objects/items/implants/implant_mindshield.dm b/code/game/objects/items/implants/implant_mindshield.dm index f990ca463f537..7fc1d5fafb523 100644 --- a/code/game/objects/items/implants/implant_mindshield.dm +++ b/code/game/objects/items/implants/implant_mindshield.dm @@ -42,6 +42,15 @@ to_chat(target, "You feel something interfering with your mental conditioning, but you resist it!") else to_chat(target, "You feel a sense of peace and security. You are now protected from brainwashing.") + + var/datum/antagonist/vassal/vassal = IS_VASSAL(target) + if(vassal) + if(vassal.special_type) + if(!silent) + target.visible_message("[target] seems to resist the implant!", "You feel something interfering with your mental conditioning, but you resist it!") + return FALSE + target.mind.remove_antag_datum(/datum/antagonist/vassal) + ADD_TRAIT(target, TRAIT_MINDSHIELD, "implant") target.sec_hud_set_implants() return TRUE diff --git a/code/game/objects/items/melee/misc.dm b/code/game/objects/items/melee/misc.dm index cc021a15a5600..d6caecff275bd 100644 --- a/code/game/objects/items/melee/misc.dm +++ b/code/game/objects/items/melee/misc.dm @@ -1002,3 +1002,96 @@ target.apply_damage(stamina_force, STAMINA, target_zone, armour_level) return ..() + +/obj/item/stake + name = "wooden stake" + desc = "A simple wooden stake carved to a sharp point." + icon = 'icons/vampires/stakes.dmi' + icon_state = "wood" + item_state = "wood" + lefthand_file = 'icons/vampires/bs_leftinhand.dmi' + righthand_file = 'icons/vampires/bs_rightinhand.dmi' + slot_flags = ITEM_SLOT_POCKETS + w_class = WEIGHT_CLASS_SMALL + hitsound = 'sound/weapons/bladeslice.ogg' + attack_verb_continuous = list("staked", "stabbed", "tore into") + attack_verb_simple = list("staked", "stabbed", "tore into") + sharpness = SHARP + embedding = list("embed_chance" = 20) + force = 6 + throwforce = 10 + max_integrity = 30 + + ///Time it takes to embed the stake into someone's chest. + var/staketime = 12 SECONDS + +/obj/item/stake/attack(mob/living/target, mob/living/user, params) + . = ..() + if(.) + return + // Invalid Target, or not targetting the chest? + if(check_zone(user.get_combat_bodyzone()) != BODY_ZONE_CHEST) + return + if(target == user) + return + if(!target.can_be_staked()) // Oops! Can't. + to_chat(user, "You can't stake [target] when they are moving about! They have to be laying down or grabbed by the neck!") + return + if(HAS_TRAIT(target, TRAIT_PIERCEIMMUNE)) + to_chat(user, "[target]'s chest resists the stake. It won't go in.") + return + + to_chat(user, "You put all your weight into embedding the stake into [target]'s chest...") + playsound(user, 'sound/magic/Demon_consume.ogg', 50, 1) + if(!do_after(user, staketime, target, extra_checks = CALLBACK(target, TYPE_PROC_REF(/mob/living/carbon, can_be_staked)))) // user / target / time / uninterruptable / show progress bar / extra checks + return + // Drop & Embed Stake + user.visible_message( + "[user.name] drives the [src] into [target]'s chest!", + "You drive the [src] into [target]'s chest!", + ) + playsound(get_turf(target), 'sound/effects/splat.ogg', 40, 1) + if(tryEmbed(target.get_bodypart(BODY_ZONE_CHEST), TRUE, TRUE)) //and if it embeds successfully in their chest, cause a lot of pain + target.apply_damage(max(10, force * 1.2), BRUTE, BODY_ZONE_CHEST) + if(QDELETED(src)) // in case trying to embed it caused its deletion (say, if it's DROPDEL) + return + if(!target.mind) + return + var/datum/antagonist/vampire/vampiredatum = IS_VAMPIRE(target) + if(vampiredatum) + if(vampiredatum?.can_stake_kill()) + vampiredatum.final_death() + else + to_chat(target, "You have been staked! Your powers are useless while it remains in place.") + target.balloon_alert(target, "you have been staked!") + +///Can this target be staked? If someone stands up before this is complete, it fails. Best used on someone stationary. +/mob/living/proc/can_be_staked() + return FALSE + +/mob/living/carbon/can_be_staked() + if(!(mobility_flags & MOBILITY_MOVE)) + return TRUE + return FALSE + +/// Created by welding and acid-treating a simple stake. +/obj/item/stake/hardened + name = "hardened stake" + desc = "A wooden stake carved to a sharp point and hardened by fire." + icon_state = "hardened" + force = 8 + throwforce = 12 + armour_penetration = 10 + embedding = list("embed_chance" = 35) + staketime = 80 + +/obj/item/stake/hardened/silver + name = "silver stake" + desc = "Polished and sharp at the end. For when some mofo is always trying to iceskate uphill." + icon_state = "silver" + item_state = "silver" + siemens_coefficient = 1 + force = 9 + armour_penetration = 25 + embedding = list("embed_chance" = 65) + staketime = 60 diff --git a/code/game/objects/items/stacks/sheets/organic/wood.dm b/code/game/objects/items/stacks/sheets/organic/wood.dm index 35a9daba19827..7a8c38b147384 100644 --- a/code/game/objects/items/stacks/sheets/organic/wood.dm +++ b/code/game/objects/items/stacks/sheets/organic/wood.dm @@ -32,6 +32,32 @@ Woods Sheets /obj/item/stack/sheet/wood/get_recipes() return GLOB.wood_recipes +/obj/item/stack/sheet/wood/attackby(obj/item/item, mob/user, params) + if(!item.is_sharp()) + return ..() + user.visible_message( + "[user] begins whittling [src] into a pointy object.", + "You begin whittling [src] into a sharp point at one end.", + "You hear wood carving.", + ) + // 5 Second Timer + if(!do_after(user, 5 SECONDS, src, NONE, TRUE)) + return + // Make Stake + var/obj/item/stake/new_item = new(user.loc) + user.visible_message( + "[user] finishes carving a stake out of [src].", + "You finish carving a stake out of [src].", + ) + // Prepare to Put in Hands (if holding wood) + var/obj/item/stack/sheet/wood/wood_stack = src + var/replace = (user.get_inactive_held_item() == wood_stack) + // Use Wood + wood_stack.use(1) + // If stack depleted, put item in that hand (if it had one) + if(!wood_stack && replace) + user.put_in_hands(new_item) + /* Bamboo */ /obj/item/stack/sheet/bamboo @@ -75,7 +101,6 @@ Woods Sheets icon = 'icons/obj/stacks/organic.dmi' merge_type = /obj/item/stack/sheet/paperframes resistance_flags = FLAMMABLE - merge_type = /obj/item/stack/sheet/paperframes /obj/item/stack/sheet/paperframes/get_recipes() return GLOB.paperframe_recipes diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm index d552cbd2a255e..fe0e660499b9c 100644 --- a/code/game/objects/structures/crates_lockers/crates.dm +++ b/code/game/objects/structures/crates_lockers/crates.dm @@ -24,6 +24,9 @@ close_sound_volume = 50 drag_slowdown = 0 imacrate = TRUE + breakout_time = 20 SECONDS + var/mob/living/resident //The vampire owner of this crate (or coffin) + var/pry_lid_timer = 25 SECONDS //The time it takes to pry this open with a crowbar var/crate_climb_time = 20 var/azimuth_angle_2 = 180 //in this context the azimuth angle for over 90 degree var/radius_2 = 1.35 @@ -153,23 +156,6 @@ manifest = null update_icon() -/obj/structure/closet/crate/coffin - name = "coffin" - desc = "It's a burial receptacle for the dearly departed." - icon_state = "coffin" - resistance_flags = FLAMMABLE - max_integrity = 70 - material_drop = /obj/item/stack/sheet/wood - material_drop_amount = 5 - open_sound = 'sound/machines/wooden_closet_open.ogg' - close_sound = 'sound/machines/wooden_closet_close.ogg' - open_sound_volume = 25 - close_sound_volume = 50 - door_anim_angle = 140 - azimuth_angle_2 = 180 - door_anim_time = 5 - door_hinge = 5 - /obj/structure/closet/crate/internals desc = "An internals crate." name = "internals crate" diff --git a/code/game/objects/structures/crates_lockers/crates/coffins.dm b/code/game/objects/structures/crates_lockers/crates/coffins.dm new file mode 100644 index 0000000000000..8fa28f5a13c26 --- /dev/null +++ b/code/game/objects/structures/crates_lockers/crates/coffins.dm @@ -0,0 +1,282 @@ +/obj/structure/closet/crate/coffin + name = "coffin" + desc = "It's a burial receptacle for the dearly departed." + icon_state = "coffin" + resistance_flags = FLAMMABLE + max_integrity = 70 + material_drop = /obj/item/stack/sheet/wood + material_drop_amount = 5 + open_sound = 'sound/machines/wooden_closet_open.ogg' + close_sound = 'sound/machines/wooden_closet_close.ogg' + open_sound_volume = 25 + close_sound_volume = 50 + door_anim_angle = 140 + azimuth_angle_2 = 180 + door_anim_time = 5 + door_hinge = 5 + +/obj/structure/closet/crate/coffin/examine(mob/user) + . = ..() + if(user == resident) + . += "This is your Claimed Coffin." + . += "Rest in it while injured to enter Torpor. Entering it with unspent Ranks will allow you to spend one." + . += "Alt-Click while inside the Coffin to Lock/Unlock." + . += "Alt-Click while outside of your Coffin to Unclaim it, unwrenching it and all your other structures as a result." + +/obj/structure/closet/crate/coffin/blackcoffin + name = "black coffin" + desc = "For those departed who are not so dear." + icon_state = "blackcoffin" + icon = 'icons/vampires/vamp_obj.dmi' + open_sound = 'sound/vampires/coffin_open.ogg' + close_sound = 'sound/vampires/coffin_close.ogg' + breakout_time = 30 SECONDS + pry_lid_timer = 20 SECONDS + resistance_flags = NONE + material_drop = /obj/item/stack/sheet/iron + material_drop_amount = 2 + armor_type = /datum/armor/blackcoffin + door_anim_time = 0 + +/datum/armor/blackcoffin + melee = 50 + bullet = 20 + laser = 30 + bomb = 50 + fire = 70 + acid = 60 + +/obj/structure/closet/crate/coffin/securecoffin + name = "secure coffin" + desc = "For those too scared of having their place of rest disturbed." + icon_state = "securecoffin" + icon = 'icons/vampires/vamp_obj.dmi' + open_sound = 'sound/vampires/coffin_open.ogg' + close_sound = 'sound/vampires/coffin_close.ogg' + breakout_time = 35 SECONDS + pry_lid_timer = 35 SECONDS + resistance_flags = FIRE_PROOF | LAVA_PROOF | ACID_PROOF + material_drop = /obj/item/stack/sheet/iron + material_drop_amount = 2 + armor_type = /datum/armor/securecoffin + door_anim_angle = 140 + azimuth_angle_2 = 180 + door_anim_time = 5 + door_hinge = 5 + +/datum/armor/securecoffin + melee = 35 + bullet = 20 + laser = 20 + bomb = 100 + fire = 100 + acid = 100 + +/obj/structure/closet/crate/coffin/meatcoffin + name = "meat coffin" + desc = "When you're ready to meat your maker, the steaks can never be too high." + icon_state = "meatcoffin" + icon = 'icons/vampires/vamp_obj.dmi' + resistance_flags = FIRE_PROOF + open_sound = 'sound/effects/footstep/slime1.ogg' + close_sound = 'sound/effects/footstep/slime1.ogg' + breakout_time = 25 SECONDS + pry_lid_timer = 20 SECONDS + material_drop = /obj/item/food/meat/slab/human + material_drop_amount = 3 + armor_type = /datum/armor/meatcoffin + door_anim_time = 0 + +/datum/armor/meatcoffin + melee = 70 + bullet = 10 + laser = 10 + bomb = 70 + fire = 70 + acid = 60 + +/obj/structure/closet/crate/coffin/metalcoffin + name = "metal coffin" + desc = "A big metal sardine can inside of another big metal sardine can, in space." + icon_state = "metalcoffin" + icon = 'icons/vampires/vamp_obj.dmi' + resistance_flags = FIRE_PROOF | LAVA_PROOF + open_sound = 'sound/effects/pressureplate.ogg' + close_sound = 'sound/effects/pressureplate.ogg' + breakout_time = 25 SECONDS + pry_lid_timer = 30 SECONDS + material_drop = /obj/item/stack/sheet/iron + material_drop_amount = 5 + armor_type = /datum/armor/metalcoffin + door_anim_angle = 140 + azimuth_angle_2 = 180 + door_anim_time = 5 + door_hinge = 5 + +/datum/armor/metalcoffin + melee = 40 + bullet = 15 + laser = 50 + bomb = 10 + fire = 70 + acid = 60 + +/// NOTE: This can be any coffin that you are resting AND inside of. +/obj/structure/closet/crate/coffin/proc/claim_coffin(mob/living/claimant, area/current_area) + var/datum/antagonist/vampire/vampiredatum = claimant.mind.has_antag_datum(/datum/antagonist/vampire) + // Successfully claimed? + if(vampiredatum.claim_coffin(src, current_area)) + resident = claimant + anchored = TRUE + START_PROCESSING(SSprocessing, src) + +/obj/structure/closet/crate/coffin/Destroy() + unclaim_coffin() + STOP_PROCESSING(SSprocessing, src) + return ..() + +/obj/structure/closet/crate/coffin/process(mob/living/user) + . = ..() + if(!.) + return FALSE + if(user in src) + var/list/turf/area_turfs = get_area_turfs(get_area(src)) + // Create Dirt etc. + var/turf/T_Dirty = pick(area_turfs) + if(T_Dirty && !T_Dirty.density) + // Default: Dirt + // STEP ONE: COBWEBS + // CHECK: Wall to North? + var/turf/check_N = get_step(T_Dirty, NORTH) + if(istype(check_N, /turf/closed/wall)) + // CHECK: Wall to West? + var/turf/check_W = get_step(T_Dirty, WEST) + if(istype(check_W, /turf/closed/wall)) + new /obj/effect/decal/cleanable/cobweb(T_Dirty) + // CHECK: Wall to East? + var/turf/check_E = get_step(T_Dirty, EAST) + if(istype(check_E, /turf/closed/wall)) + new /obj/effect/decal/cleanable/cobweb/cobweb2(T_Dirty) + new /obj/effect/decal/cleanable/dirt(T_Dirty) + +/obj/structure/closet/crate/proc/unclaim_coffin(manual = FALSE) + // Unanchor it (If it hasn't been broken, anyway) + anchored = FALSE + if(!resident || !resident.mind) + return + // Unclaiming + var/datum/antagonist/vampire/vampiredatum = resident.mind.has_antag_datum(/datum/antagonist/vampire) + if(vampiredatum && vampiredatum.coffin == src) + vampiredatum.coffin = null + vampiredatum.vampire_lair_area = null + for(var/obj/structure/vampire/vampire_structure in get_area(src)) + if(vampire_structure.owner == resident) + vampire_structure.unbolt() + if(manual) + to_chat(resident, "You have unclaimed your coffin! This also unclaims all your other Vampire structures!") + else + to_chat(resident, "You sense that the link with your coffin and your sacred lair has been broken! You will need to seek another.") + // Remove resident. Because this objec (GC?) we need to give them a way to see they don't have a home anymore. + resident = null + +/// You cannot lock in/out a coffin's owner. SORRY. +/obj/structure/closet/crate/coffin/can_open(mob/living/user) + if(!locked) + return ..() + if(user == resident) + if(welded) + welded = FALSE + update_icon() + locked = FALSE + return TRUE + playsound(get_turf(src), 'sound/machines/door_locked.ogg', 20, 1) + to_chat(user, "[src] appears to be locked tight from the inside.") + +/obj/structure/closet/crate/coffin/close(mob/living/user) + . = ..() + if(!.) + return FALSE + // Only the User can put themself into Torpor. If already in it, you'll start to heal. + if(user in src) + var/datum/antagonist/vampire/vampiredatum = user.mind.has_antag_datum(/datum/antagonist/vampire) + if(!vampiredatum) + return FALSE + var/area/current_area = get_area(src) + if(!vampiredatum.coffin && !resident) + switch(tgui_alert(user, "Do you wish to claim this as your coffin? [current_area] will be your lair.", "Claim Lair", list("Yes", "No"))) + if("Yes") + claim_coffin(user, current_area) + if("No") + return + LockMe(user) + //Level up if possible. + if(!vampiredatum.my_clan) + to_chat(user, "You must enter a Clan to rank up.") + else + vampiredatum.SpendRank() + // You're in a Coffin, everything else is done, you're likely here to heal. Let's offer them the oppertunity to do so. + vampiredatum.check_begin_torpor() + return TRUE + +/// You cannot weld or deconstruct an owned coffin. Only the owner can destroy their own coffin. +/obj/structure/closet/crate/coffin/attackby(obj/item/item, mob/user, params) + if(!resident) + return ..() + if(user != resident) + if(istype(item, cutting_tool)) + to_chat(user, "This is a much more complex mechanical structure than you thought. You don't know where to begin cutting [src].") + return + if(anchored && (item.tool_behaviour == TOOL_WRENCH)) + to_chat(user, "The coffin won't come unanchored from the floor.[user == resident ? " You can Alt-Click to unclaim and unwrench your Coffin." : ""]") + return + + if(locked && (item.tool_behaviour == TOOL_CROWBAR)) + var/pry_time = pry_lid_timer * item.toolspeed // Pry speed must be affected by the speed of the tool. + user.visible_message( + "[user] tries to pry the lid off of [src] with [item].", + "You begin prying the lid off of [src] with [item]. This should take about [DisplayTimeText(pry_time)].", + ) + if(!do_after(user, pry_time, src)) + return + bust_open() + user.visible_message( + "[user] snaps the door of [src] wide open.", + "The door of [src] snaps open.", + ) + return + return ..() + +/// Distance Check (Inside Of) +/obj/structure/closet/crate/coffin/AltClick(mob/user) + . = ..() + if(user in src) + LockMe(user, !locked) + return + + if(user == resident && user.Adjacent(src)) + balloon_alert(user, "unclaim coffin?") + var/static/list/unclaim_options = list( + "Yes" = image(icon = 'icons/hud/radials/radial_generic.dmi', icon_state = "radial_yes"), + "No" = image(icon = 'icons/hud/radials/radial_generic.dmi', icon_state = "radial_no")) + var/unclaim_response = show_radial_menu(user, src, unclaim_options, radius = 36, require_near = TRUE) + switch(unclaim_response) + if("Yes") + unclaim_coffin(TRUE) + +/obj/structure/closet/crate/proc/LockMe(mob/user, inLocked = TRUE) + if(user == resident) + if(!broken) + locked = inLocked + if(locked) + to_chat(user, "You flip a secret latch and lock yourself inside [src].") + else + to_chat(user, "You flip a secret latch and unlock [src].") + return + // Broken? Let's fix it. + to_chat(resident, "The secret latch that would lock [src] from the inside is broken. You set it back into place...") + if(!do_after(resident, 5 SECONDS, src)) + to_chat(resident, "You fail to fix [src]'s mechanism.") + return + to_chat(resident, "You fix the mechanism and lock it.") + broken = FALSE + locked = TRUE diff --git a/code/game/objects/structures/vampire_crypt.dm b/code/game/objects/structures/vampire_crypt.dm new file mode 100644 index 0000000000000..34a6b6c56f3bb --- /dev/null +++ b/code/game/objects/structures/vampire_crypt.dm @@ -0,0 +1,489 @@ +/obj/structure/vampire + ///Who owns this structure? + var/mob/living/owner + /* + * We use vars to add descriptions to items. + * This way we don't have to make a new /examine for each structure + * And it's easier to edit. + */ + var/ghost_desc + var/vampire_desc + var/vassal_desc + var/curator_desc + +/obj/structure/vampire/examine(mob/user) + . = ..() + if(!user.mind && ghost_desc) + . += "[ghost_desc]" + if(IS_VAMPIRE(user) && vampire_desc) + if(!owner) + . += "It is unsecured. Click on [src] while in your lair to secure it in place to get its full potential" + return + . += "[vampire_desc]" + if(IS_VASSAL(user) && vassal_desc) + . += "[vassal_desc]" + if(IS_CURATOR(user) && curator_desc) + . += "[curator_desc]" + +/// This handles bolting down the structure. +/obj/structure/vampire/proc/bolt(mob/user) + to_chat(user, "You have secured [src] in place.") + to_chat(user, "* Vampire Tip: Examine [src] to understand how it functions!") + user.playsound_local(null, 'sound/items/ratchet.ogg', 70, FALSE, pressure_affected = FALSE) + set_anchored(TRUE) + owner = user + +/// This handles unbolting of the structure. +/obj/structure/vampire/proc/unbolt(mob/user) + to_chat(user, "You have unsecured [src].") + user.playsound_local(null, 'sound/items/ratchet.ogg', 70, FALSE, pressure_affected = FALSE) + set_anchored(FALSE) + owner = null + +/obj/structure/vampire/attackby(obj/item/item, mob/living/user, params) + /// If a Vampire tries to wrench it in place, yell at them. + if(item.tool_behaviour == TOOL_WRENCH && !anchored && IS_VAMPIRE(user)) + user.playsound_local(null, 'sound/machines/buzz-sigh.ogg', 40, FALSE, pressure_affected = FALSE) + to_chat(user, "* Vampire Tip: Examine Vampire structures to understand how they function!") + return + return ..() + +/obj/structure/vampire/attack_hand(mob/user, list/modifiers) + var/datum/antagonist/vampire/vampiredatum = IS_VAMPIRE(user) + /// Claiming the Rack instead of using it? + if(vampiredatum && !owner) + if(!vampiredatum.vampire_lair_area) + to_chat(user, "You don't have a lair. Claim a coffin to make that location your lair.") + return FALSE + if(vampiredatum.vampire_lair_area != get_area(src)) + to_chat(user, "You may only activate this structure in your lair: [vampiredatum.vampire_lair_area].") + return FALSE + + /// Radial menu for securing your Persuasion rack in place. + to_chat(user, "Do you wish to secure [src] here?") + var/static/list/secure_options = list( + "Yes" = image(icon = 'icons/hud/radials/radial_generic.dmi', icon_state = "radial_yes"), + "No" = image(icon = 'icons/hud/radials/radial_generic.dmi', icon_state = "radial_no")) + var/secure_response = show_radial_menu(user, src, secure_options, radius = 36, require_near = TRUE) + if(secure_response == "Yes") + bolt(user) + return FALSE + return TRUE + +/obj/structure/vampire/AltClick(mob/user) + . = ..() + if(user == owner && user.Adjacent(src)) + balloon_alert(user, "unbolt [src]?") + var/static/list/unsecure_options = list( + "Yes" = image(icon = 'icons/hud/radials/radial_generic.dmi', icon_state = "radial_yes"), + "No" = image(icon = 'icons/hud/radials/radial_generic.dmi', icon_state = "radial_no"), + ) + var/unsecure_response = show_radial_menu(user, src, unsecure_options, radius = 36, require_near = TRUE) + if(unsecure_response == "Yes") + unbolt(user) + +/obj/structure/vampire/vassalrack + name = "persuasion rack" + desc = "If this wasn't meant for torture, then someone has some fairly horrifying hobbies." + icon = 'icons/vampires/vamp_obj.dmi' + icon_state = "vassalrack" + anchored = FALSE + density = TRUE + can_buckle = TRUE + buckle_lying = 180 + ghost_desc = "This is a Vassal rack, which allows Vampires to thrall crewmembers into loyal minions." + vampire_desc = "This is the Vassal rack, which allows you to thrall crewmembers into loyal minions in your service. This costs blood to do.\n\ + Simply click and hold on a victim, and then drag their sprite on the vassal rack. Click on the persuasion rack to unbuckle them.\n\ + To convert into a Vassal, repeatedly click on the persuasion rack while not on help intent.\n\ + The conversion time is decreased depending on how sharp the tool in you offhand is, if you have one.\n\ + Vassals can be turned into special ones by continuing to torture them once converted." + vassal_desc = "This is the vassal rack, which allows your master to thrall crewmembers into their minions.\n\ + Aid your master in bringing their victims here and keeping them secure.\n\ + You can secure victims to the vassal rack by click dragging the victim onto the rack while it is secured." + curator_desc = "This is the vassal rack, which monsters use to brainwash crewmembers into their loyal slaves.\n\ + They usually ensure that victims are handcuffed, to prevent them from running away.\n\ + Their rituals take time, allowing us to disrupt it." + + /// How many times a buckled person has to be tortured to be converted. + var/convert_progress = 3 + /// Mindshielded and Antagonists willingly have to accept you as their Master. + var/wants_vassilization = FALSE + /// Prevents popup spam. + var/vassilization_offered = FALSE + /// No spamming torture + var/is_torturing = FALSE + +/obj/structure/vampire/vassalrack/deconstruct(disassembled = TRUE) + . = ..() + new /obj/item/stack/sheet/iron(src.loc, 4) + new /obj/item/stack/rods(loc, 4) + qdel(src) + +/obj/structure/vampire/vassalrack/MouseDrop_T(atom/movable/movable_atom, mob/user) + var/mob/living/living_target = movable_atom + if(!anchored && IS_VAMPIRE(user)) + to_chat(user, "Until this rack is secured in place, it cannot serve its purpose.") + to_chat(user, "* Vampire Tip: Examine the Persuasion Rack to understand how it functions!") + return + // Default checks + if(!isliving(movable_atom) || !living_target.Adjacent(src) || living_target == user || !isliving(user) || has_buckled_mobs() || user.incapacitated() || living_target.buckled) + return + // Don't buckle Silicon to it please. + if(issilicon(living_target)) + to_chat(user, "You realize that this machine cannot be vassalized, therefore it is useless to buckle them.") + return + if(do_after(user, 5 SECONDS, living_target)) + density = FALSE // Temporarily set density to false so the target is actually on the rack + attach_victim(living_target, user) + density = TRUE + +/** + * Attempts to buckle target into the vassalrack + */ +/obj/structure/vampire/vassalrack/proc/attach_victim(mob/living/target, mob/living/user) + if(!buckle_mob(target)) + return + user.visible_message( + "[user] straps [target] into the rack, immobilizing them.", + "You secure [target] tightly in place. They won't escape you now.", + ) + + playsound(loc, 'sound/effects/pop_expl.ogg', 25, 1) + update_appearance(UPDATE_ICON) + + // Set up Torture stuff now + convert_progress = 3 + wants_vassilization = FALSE + vassilization_offered = FALSE + +/// Attempt Unbuckle +/obj/structure/vampire/vassalrack/user_unbuckle_mob(mob/living/buckled_mob, mob/user) + if(IS_VAMPIRE(user) || IS_VASSAL(user)) + return ..() + + if(buckled_mob == user) + buckled_mob.visible_message( + "[user] tries to release themself from the rack!", + "You attempt to release yourself from the rack!", + "You hear a squishy wet noise.", + ) + if(!do_after(user, 20 SECONDS, buckled_mob)) + return + else + buckled_mob.visible_message( + "[user] tries to pull [buckled_mob] from the rack!", + "You attempt to release [buckled_mob] from the rack!", + "You hear a squishy wet noise.", + ) + if(!do_after(user, 10 SECONDS, buckled_mob)) + return + + return ..() + +/obj/structure/vampire/vassalrack/unbuckle_mob(mob/living/buckled_mob, force = FALSE, can_fall = TRUE) + if(!..()) + return FALSE + visible_message("[buckled_mob][buckled_mob.stat == DEAD ? "'s corpse" : ""] slides off of the rack.") + buckled_mob.Paralyze(2 SECONDS) + update_appearance(UPDATE_ICON) + return TRUE + +/obj/structure/vampire/vassalrack/attack_hand(mob/user, list/modifiers) + ..() + if(!has_buckled_mobs()) + return FALSE + + var/datum/antagonist/vassal/vampiredatum = IS_VAMPIRE(user) + // Try Unbuckle + var/mob/living/carbon/buckled_person = pick(buckled_mobs) + if(user.a_intent == INTENT_HELP) + if(vampiredatum) + unbuckle_mob(buckled_person) + return FALSE + else + user_unbuckle_mob(buckled_person, user) + return + + // Try to interact with vassal + var/datum/antagonist/vassal/vassaldatum = IS_VASSAL(buckled_person) + if(vassaldatum?.master == vampiredatum) + SEND_SIGNAL(vampiredatum, VAMPIRE_INTERACT_WITH_VASSAL, vassaldatum) + return + + torture_victim(user, buckled_person) + +/** + * Torture steps: + * + * * When convert_progress reaches 0, the victim is ready to be converted + * * Using a better tool will reduce the time required to torture + * * If the victim has a mindshield or is an antagonist, they must accept the conversion. If they don't accept, they aren't converted + * * Vassalize target + */ +/obj/structure/vampire/vassalrack/proc/torture_victim(mob/living/user, mob/living/target) + var/datum/antagonist/vampire/vampiredatum = IS_VAMPIRE(user) + + if(!vampiredatum.can_make_vassal(target) || is_torturing) + return + + // These if statements can be simplified but aren't for better code-readability. + if(convert_progress > 0) + balloon_alert(user, "spilling blood...") + + is_torturing = TRUE + target.Paralyze(1 SECONDS) + vampiredatum.AddBloodVolume(-TORTURE_BLOOD_HALF_COST) + if(!do_torture(user, target)) + is_torturing = FALSE + return + is_torturing = FALSE + + vampiredatum.AddBloodVolume(-TORTURE_BLOOD_HALF_COST) + convert_progress-- + + if(convert_progress > 0) + balloon_alert(user, "needs more persuasion...") + return + + // If the victim is mindshielded or an antagonist, they choose to accept or refuse vassilization. + if(!wants_vassilization && (HAS_TRAIT(target, TRAIT_MINDSHIELD) || length(target.mind.antag_datums))) + balloon_alert(user, "has external loyalties! more persuasion required!") + if(!ask_for_vassilization(user, target)) + balloon_alert(user, "refused persuasion!") + convert_progress++ + return + + balloon_alert(user, "ready for communion!") + if(wants_vassilization || !(HAS_TRAIT(target, TRAIT_MINDSHIELD) || length(target.mind.antag_datums))) + user.balloon_alert_to_viewers("smears blood...", "paints bloody marks...") + if(!do_after(user, 5 SECONDS, target)) + balloon_alert(user, "interrupted!") + return + vampiredatum.AddBloodVolume(-TORTURE_CONVERSION_COST) + + vampiredatum.make_vassal(target) + // Find Mind Implant & Destroy + for(var/obj/item/implant/implant as anything in target.implants) + if(istype(implant, /obj/item/implant/mindshield)) + implant.Destroy() + SEND_SIGNAL(vampiredatum, VAMPIRE_MADE_VASSAL, user, target) + +/obj/structure/vampire/vassalrack/proc/do_torture(mob/living/user, mob/living/carbon/target) + var/obj/item/held_item = user.get_inactive_held_item() + var/torture_time = 15 + torture_time -= held_item?.force / 4 + torture_time -= held_item?.sharpness + 1 + + // Minimum 5 seconds + torture_time = max(5 SECONDS, torture_time SECONDS) + if(do_after(user, torture_time, target)) + held_item?.play_tool_sound(target) + + var/obj/item/bodypart/selected_bodypart = pick(target.bodyparts) + target.visible_message( + "[user] performs a ritual, spilling some of [target]'s blood from their [selected_bodypart.name]!", + "[user] performs a ritual, spilling some blood from your [selected_bodypart.name]!") + + INVOKE_ASYNC(target, TYPE_PROC_REF(/mob, emote), "scream") + target.Jitter(5 SECONDS) + target.apply_damage(held_item ? held_item.force / 4 : 2, held_item ? held_item.damtype : BRUTE, selected_bodypart) + return TRUE + else + balloon_alert(user, "interrupted!") + return FALSE + +/// Offer them the oppertunity to join now. +/obj/structure/vampire/vassalrack/proc/ask_for_vassilization(mob/living/user, mob/living/target) + if(vassilization_offered) + return FALSE + vassilization_offered = TRUE + + to_chat(user, "[target] has been given the opportunity for servitude. You await their decision...") + var/alert_response = tgui_alert( + user = target, \ + message = "You are being tortured! Do you want to give in and pledge your undying loyalty to [user]? \n\ + You will not lose your current objectives, but they come second to the will of your new master!", \ + title = "THE HORRIBLE PAIN! WHEN WILL IT END?!", + buttons = list("Accept", "Refuse"), + timeout = 10 SECONDS, \ + autofocus = TRUE + ) + if(alert_response == "Accept") + wants_vassilization = TRUE + else + target.balloon_alert_to_viewers("stares defiantly", "refused vassalization!") + vassilization_offered = FALSE + return wants_vassilization + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/obj/structure/vampire/candelabrum + name = "candelabrum" + desc = "It burns slowly, but doesn't radiate any heat." + icon = 'icons/vampires/vamp_obj.dmi' + icon_state = "candelabrum" + light_color = "#66FFFF" + light_power = 3 + density = FALSE + can_buckle = TRUE + anchored = FALSE + ghost_desc = "This is a magical candle which drains at the sanity of non Vampires and Vassals.\n\ + Vassals can turn the candle on manually, while Vampires can do it from a distance." + vampire_desc = "This is a magical candle which drains at the sanity of mortals who are not under your command while it is active.\n\ + You can right-click on it from any range to turn it on remotely, or simply be next to it and click on it to turn it on and off normally." + vassal_desc = "This is a magical candle which drains at the sanity of the fools who havent yet accepted your master, as long as it is active.\n\ + You can turn it on and off by clicking on it while you are next to it." + curator_desc = "This is a blue Candelabrum, which causes insanity to those near it while active." + var/lit = FALSE + +/obj/structure/vampire/candelabrum/Destroy() + STOP_PROCESSING(SSobj, src) + return ..() + +/obj/structure/vampire/candelabrum/update_icon_state() + icon_state = "candelabrum[lit ? "_lit" : ""]" + return ..() + +/obj/structure/vampire/candelabrum/bolt() + density = TRUE + return ..() + +/obj/structure/vampire/candelabrum/unbolt() + density = FALSE + return ..() + +/obj/structure/vampire/candelabrum/attack_hand(mob/living/user, list/modifiers) + if(!..()) + return + if(anchored && (IS_VASSAL(user) || IS_VAMPIRE(user))) + toggle() + return ..() + +/obj/structure/vampire/candelabrum/proc/toggle(mob/user) + lit = !lit + if(lit) + desc = initial(desc) + set_light(l_range = 2, l_power = 3, l_color = "#66FFFF") + START_PROCESSING(SSobj, src) + else + desc = "Despite not being lit, it makes your skin crawl." + set_light(0) + STOP_PROCESSING(SSobj, src) + update_icon() + +/obj/structure/vampire/candelabrum/process() + if(!lit) + return + for(var/mob/living/carbon/nearby_people in viewers(7, src)) + /// We dont want Vampires or Vassals affected by this + if(IS_VASSAL(nearby_people) || IS_VAMPIRE(nearby_people) || IS_CURATOR(nearby_people)) + continue + nearby_people.hallucination += 5 SECONDS + SEND_SIGNAL(nearby_people, COMSIG_ADD_MOOD_EVENT, "vampcandle", /datum/mood_event/vampcandle) + +/// Blood Throne - Allows Vampires to remotely speak with their Vassals. - Code (Mostly) stolen from comfy chairs (armrests) and chairs (layers) +/obj/structure/vampire/bloodthrone + name = "blood throne" + desc = "Twisted metal shards jut from the arm rests. Very uncomfortable looking. It would take a masochistic sort to sit on this jagged piece of furniture." + icon = 'icons/vampires/vamp_obj_64.dmi' + icon_state = "throne" + buckle_lying = 0 + anchored = FALSE + density = TRUE + can_buckle = TRUE + ghost_desc = "This is a blood throne, any Vampire sitting on it can remotely speak to their Vassals by attempting to speak aloud." + vampire_desc = "This is a blood throne, sitting on it will allow you to telepathically speak to your vassals by simply speaking." + vassal_desc = "This is a blood throne, it allows your Master to telepathically speak to you and others like you." + curator_desc = "This is a chair that hurts those that try to buckle themselves onto it, though the Undead have no problem latching on.\n\ + While buckled, Monsters can use this to telepathically communicate with eachother." + var/mutable_appearance/armrest + +// Add rotating and armrest +/obj/structure/vampire/bloodthrone/Initialize(mapload) + AddComponent(/datum/component/simple_rotation) + armrest = GetArmrest() + armrest.layer = ABOVE_MOB_LAYER + return ..() + +/obj/structure/vampire/bloodthrone/Destroy() + QDEL_NULL(armrest) + return ..() + +// Armrests +/obj/structure/vampire/bloodthrone/proc/GetArmrest() + return mutable_appearance('icons/vampires/vamp_obj_64.dmi', "thronearm") + +/obj/structure/vampire/bloodthrone/proc/update_armrest() + if(has_buckled_mobs()) + add_overlay(armrest) + else + cut_overlay(armrest) + +// Rotating +/obj/structure/vampire/bloodthrone/setDir(newdir) + . = ..() + if(has_buckled_mobs()) + for(var/m in buckled_mobs) + var/mob/living/buckled_mob = m + buckled_mob.setDir(newdir) + + if(has_buckled_mobs() && dir == NORTH) + layer = ABOVE_MOB_LAYER + else + layer = OBJ_LAYER + +// Buckling +/obj/structure/vampire/bloodthrone/buckle_mob(mob/living/user, force = FALSE, check_loc = TRUE) + if(!anchored) + to_chat(user, "[src] is not bolted to the ground!") + return + density = FALSE + . = ..() + density = TRUE + user.visible_message( + "[user] sits down on [src].", + "You sit down onto [src].", + ) + if(IS_VAMPIRE(user)) + RegisterSignal(user, COMSIG_MOB_SAY, PROC_REF(handle_speech)) + else + unbuckle_mob(user) + user.Paralyze(10 SECONDS) + to_chat(user, "The power of the blood throne overwhelms you!") + +/obj/structure/vampire/bloodthrone/post_buckle_mob(mob/living/target) + . = ..() + update_armrest() + target.pixel_y += 2 + +// Unbuckling +/obj/structure/vampire/bloodthrone/unbuckle_mob(mob/living/user, force = FALSE, can_fall = TRUE) + src.visible_message("[user] unbuckles themselves from [src].") + if(IS_VAMPIRE(user)) + UnregisterSignal(user, COMSIG_MOB_SAY) + . = ..() + +/obj/structure/vampire/bloodthrone/post_unbuckle_mob(mob/living/target) + target.pixel_y -= 2 + +// The speech itself +/obj/structure/vampire/bloodthrone/proc/handle_speech(datum/source, list/speech_args) + SIGNAL_HANDLER + + var/message = speech_args[SPEECH_MESSAGE] + var/mob/living/carbon/human/user = source + var/rendered = "[user.real_name]: [message]" + user.log_talk(message, LOG_SAY, tag = ROLE_VAMPIRE) + var/datum/antagonist/vampire/vampiredatum = IS_VAMPIRE(user) + for(var/datum/antagonist/vassal/receiver as anything in vampiredatum.vassals) + if(!receiver.owner.current) + continue + var/mob/receiver_mob = receiver.owner.current + to_chat(receiver_mob, rendered) + to_chat(user, rendered) + + for(var/mob/dead_mob in GLOB.dead_mob_list) + var/link = FOLLOW_LINK(dead_mob, user) + to_chat(dead_mob, "[link] [rendered]") + + speech_args[SPEECH_MESSAGE] = "" diff --git a/code/modules/antagonists/role_preference/role_antagonists.dm b/code/modules/antagonists/role_preference/role_antagonists.dm index 44111cecfddfe..9bc1056cb164a 100644 --- a/code/modules/antagonists/role_preference/role_antagonists.dm +++ b/code/modules/antagonists/role_preference/role_antagonists.dm @@ -316,8 +316,7 @@ /datum/role_preference/antagonist/wizard name = "Wizard" - description = "GREETINGS. WE'RE THE WIZARDS OF THE WIZARD'S FEDERATION.\n\ - Choose between a variety of powerful spells in order to cause chaos among Space Station 13." + description = "GREETINGS. WE'RE THE WIZARDS OF THE WIZARD'S FEDERATION.\nChoose between a variety of powerful spells in order to cause chaos among Space Station 13." antag_datum = /datum/antagonist/wizard preview_outfit = /datum/outfit/wizard @@ -328,3 +327,25 @@ use_icon = /datum/role_preference/antagonist/traitor #undef TRAITOR_DESC_DETAILS + +/datum/role_preference/antagonist/vampire + name = "Vampire" + description = "After your death, you awaken to see yourself as an undead monster.\nScrape by Space Station 13, or take it over, vassalizing your way!" + antag_datum = /datum/antagonist/vampire + preview_outfit = /datum/outfit/vampire + +/datum/role_preference/antagonist/vampire/get_preview_icon() + var/icon/icon = render_preview_outfit(/datum/outfit/vampire) + icon.Blend(icon('icons/effects/blood.dmi', "uniformblood"), ICON_OVERLAY) + + return finish_preview_icon(icon) + +/datum/role_preference/midround_living/vampire + name = "Vampiric Accident" + description = "After your death, you awaken to see yourself as an undead monster.\nScrape by Space Station 13, or take over it, vassalizing your way!" + antag_datum = /datum/antagonist/vampire + use_icon = /datum/role_preference/antagonist/vampire + +/datum/outfit/vampire + name = "Vampire outfit (Preview only)" + suit = /obj/item/clothing/suit/costume/dracula diff --git a/code/modules/antagonists/vampire/clans/_clan.dm b/code/modules/antagonists/vampire/clans/_clan.dm new file mode 100644 index 0000000000000..54e0a62a318f0 --- /dev/null +++ b/code/modules/antagonists/vampire/clans/_clan.dm @@ -0,0 +1,258 @@ +/** + * Vampire clans + * + * Handles everything related to clans. + * the entire idea of datumizing this came to me in a dream. + */ +/datum/vampire_clan + ///The vampire datum that owns this clan. Use this over 'source', because while it's the same thing, this is more consistent (and used for deletion). + var/datum/antagonist/vampire/vampiredatum + ///The name of the clan we're in. + var/name = CLAN_NONE + ///Description of what the clan is, given when joining and through your antag UI. + var/description = "The Caitiff is as basic as you can get with Vampires. \n\ + Entirely Clan-less, they are blissfully unaware of who they really are. \n\ + No additional abilities is gained, nothing is lost, if you want a plain Vampire, this is it. \n\ + The Favorite Vassal will gain the Brawn ability, to help in combat." + ///The clan objective that is required to greentext. + var/datum/objective/vampire/clan_objective + ///The icon of the radial icon to join this clan. + var/join_icon = 'icons/vampires/clan_icons.dmi' + ///Same as join_icon, but the state + var/join_icon_state = "caitiff" + ///Description shown when trying to join the clan. + var/join_description = "The default, Classic Vampire." + ///Whether the clan can be joined by players. FALSE for flavortext-only clans. + var/joinable_clan = TRUE + + ///How we will drink blood using Feed. + var/blood_drink_type = VAMPIRE_DRINK_NORMAL + +/datum/vampire_clan/New(datum/antagonist/vampire/owner_datum) + . = ..() + src.vampiredatum = owner_datum + + RegisterSignal(vampiredatum, COMSIG_VAMPIRE_ON_LIFETICK, PROC_REF(handle_clan_life)) + RegisterSignal(vampiredatum, VAMPIRE_RANK_UP, PROC_REF(on_spend_rank)) + + RegisterSignal(vampiredatum, VAMPIRE_INTERACT_WITH_VASSAL, PROC_REF(on_interact_with_vassal)) + RegisterSignal(vampiredatum, VAMPIRE_MAKE_FAVORITE, PROC_REF(on_favorite_vassal)) + + RegisterSignal(vampiredatum, VAMPIRE_MADE_VASSAL, PROC_REF(on_vassal_made)) + RegisterSignal(vampiredatum, VAMPIRE_EXIT_TORPOR, PROC_REF(on_exit_torpor)) + RegisterSignal(vampiredatum, VAMPIRE_FINAL_DEATH, PROC_REF(on_final_death)) + + RegisterSignal(vampiredatum, VAMPIRE_ENTERS_FRENZY, PROC_REF(on_enter_frenzy)) + RegisterSignal(vampiredatum, VAMPIRE_EXITS_FRENZY, PROC_REF(on_exit_frenzy)) + + give_clan_objective() + +/datum/vampire_clan/Destroy(force) + UnregisterSignal(vampiredatum, list( + COMSIG_VAMPIRE_ON_LIFETICK, + VAMPIRE_RANK_UP, + VAMPIRE_INTERACT_WITH_VASSAL, + VAMPIRE_MAKE_FAVORITE, + VAMPIRE_MADE_VASSAL, + VAMPIRE_EXIT_TORPOR, + VAMPIRE_FINAL_DEATH, + VAMPIRE_ENTERS_FRENZY, + VAMPIRE_EXITS_FRENZY, + )) + remove_clan_objective() + vampiredatum = null + return ..() + +/datum/vampire_clan/proc/on_enter_frenzy(datum/antagonist/vampire/source) + SIGNAL_HANDLER + + var/mob/living/carbon/human/human_vampire = vampiredatum.owner.current + human_vampire?.physiology?.stamina_mod *= 0.4 + +/datum/vampire_clan/proc/on_exit_frenzy(datum/antagonist/vampire/source) + SIGNAL_HANDLER + + var/mob/living/carbon/human/human_vampire = vampiredatum.owner.current + human_vampire?.set_dizziness(3 SECONDS) + human_vampire?.Paralyze(2 SECONDS) + human_vampire?.physiology.stamina_mod /= 0.4 + +/datum/vampire_clan/proc/give_clan_objective() + if(isnull(clan_objective)) + return + clan_objective = new clan_objective() + clan_objective.name = "Clan Objective" + clan_objective.owner = vampiredatum.owner + vampiredatum.objectives += clan_objective + vampiredatum.owner.announce_objectives() + +/datum/vampire_clan/proc/remove_clan_objective() + vampiredatum.objectives -= clan_objective + QDEL_NULL(clan_objective) + vampiredatum.owner.announce_objectives() + +/** + * Called when a Vampire exits Torpor + * args: + * source - the Vampire exiting Torpor + */ +/datum/vampire_clan/proc/on_exit_torpor(datum/antagonist/vampire/source) + SIGNAL_HANDLER + +/** + * Called when a Vampire enters Final Death + * args: + * source - the Vampire exiting Torpor + */ +/datum/vampire_clan/proc/on_final_death(datum/antagonist/vampire/source) + SIGNAL_HANDLER + return FALSE + +/** + * Called during Vampire's LifeTick + * args: + * vampiredatum - the antagonist datum of the Vampire running this. + */ +/datum/vampire_clan/proc/handle_clan_life(datum/antagonist/vampire/source) + SIGNAL_HANDLER + +/** + * Called when a Vampire successfully Vassalizes someone. + * args: + * vampiredatum - the antagonist datum of the Vampire running this. + */ +/datum/vampire_clan/proc/on_vassal_made(datum/antagonist/vampire/source, mob/living/user, mob/living/target) + SIGNAL_HANDLER + user.playsound_local(null, 'sound/effects/explosion_distant.ogg', 40, TRUE) + target.playsound_local(null, 'sound/effects/singlebeat.ogg', 40, TRUE) + target.Jitter(15 SECONDS) + INVOKE_ASYNC(target, TYPE_PROC_REF(/mob, emote), "laugh") + +/** + * Called when a Vampire successfully starts spending their Rank + * args: + * vampiredatum - the antagonist datum of the Vampire running this. + * target - The Vassal (if any) we are upgrading. + * cost_rank - TRUE/FALSE on whether this will cost us a rank when we go through with it. + * blood_cost - A number saying how much it costs to rank up. + */ +/datum/vampire_clan/proc/on_spend_rank(datum/antagonist/vampire/source, mob/living/carbon/target, cost_rank = TRUE, blood_cost) + SIGNAL_HANDLER + + INVOKE_ASYNC(src, PROC_REF(spend_rank), vampiredatum, target, cost_rank, blood_cost) + +/datum/vampire_clan/proc/spend_rank(datum/antagonist/vampire/source, mob/living/carbon/target, cost_rank = TRUE, blood_cost) + // Purchase Power Prompt + var/list/options = list() + for(var/datum/action/cooldown/vampire/power as anything in vampiredatum.all_vampire_powers) + if(initial(power.purchase_flags) & VAMPIRE_CAN_BUY && !(locate(power) in vampiredatum.powers)) + options[initial(power.name)] = power + + if(options.len < 1) + to_chat(vampiredatum.owner.current, "You grow more ancient by the night!") + else + // Give them the UI to purchase a power. + var/choice = tgui_input_list(vampiredatum.owner.current, "You have the opportunity to grow more ancient. Select a power to advance your Rank.", "Your Blood Thickens...", options) + // Prevent Vampires from closing/reopning their coffin to spam Levels. + if(cost_rank && vampiredatum.vampire_level_unspent <= 0) + return + // Did you choose a power? + if(!choice || !options[choice]) + to_chat(vampiredatum.owner.current, "You prevent your blood from thickening just yet, but you may try again later.") + return + // Prevent Vampires from closing/reopning their coffin to spam Levels. + if(locate(options[choice]) in vampiredatum.powers) + to_chat(vampiredatum.owner.current, "You prevent your blood from thickening just yet, but you may try again later.") + return + // Prevent Vampires from purchasing a power while outside of their Coffin. + if(!istype(vampiredatum.owner.current.loc, /obj/structure/closet/crate/coffin)) + to_chat(vampiredatum.owner.current, "You must be in your Coffin to purchase Powers.") + return + + // Good to go - Buy Power! + var/datum/action/cooldown/vampire/purchased_power = options[choice] + vampiredatum.BuyPower(new purchased_power) + vampiredatum.owner.current.balloon_alert(vampiredatum.owner.current, "learned [choice]!") + to_chat(vampiredatum.owner.current, "You have learned how to use [choice]!") + + finalize_spend_rank(vampiredatum, cost_rank, blood_cost) + +/datum/vampire_clan/proc/finalize_spend_rank(datum/antagonist/vampire/source, cost_rank = TRUE, blood_cost) + vampiredatum.LevelUpPowers() + vampiredatum.vampire_regen_rate += 0.05 + vampiredatum.max_blood_volume += 100 + + var/mob/living/carbon/human/vampire_human = vampiredatum.owner.current + if(ishuman(vampire_human)) + vampire_human.dna.species.punchdamage += 0.5 + // We're almost done - Spend your Rank now. + vampiredatum.vampire_level++ + if(cost_rank) + vampiredatum.vampire_level_unspent-- + if(blood_cost) + vampiredatum.AddBloodVolume(-blood_cost) + + // Ranked up enough to get your true Reputation? + if(vampiredatum.vampire_level == 4) + vampiredatum.SelectReputation(am_fledgling = FALSE, forced = TRUE) + + to_chat(vampiredatum.owner.current, "You are now a rank [vampiredatum.vampire_level] Vampire. \ + Your strength, health, feed rate, regen rate, and maximum blood capacity have all increased! \n\ + * Your existing powers have all ranked up as well!") + vampiredatum.owner.current.playsound_local(null, 'sound/effects/pope_entry.ogg', 25, TRUE, pressure_affected = FALSE) + vampiredatum.update_hud() + +/** + * Called when we are trying to turn someone into a Favorite Vassal + * args: + * vampiredatum - the antagonist datum of the Vampire performing this. + * vassaldatum - the antagonist datum of the Vassal being offered up. + */ +/datum/vampire_clan/proc/on_interact_with_vassal(datum/antagonist/vampire/source, datum/antagonist/vassal/vassaldatum) + SIGNAL_HANDLER + + INVOKE_ASYNC(src, PROC_REF(interact_with_vassal), vampiredatum, vassaldatum) + +/datum/vampire_clan/proc/interact_with_vassal(datum/antagonist/vampire/source, datum/antagonist/vassal/vassaldatum) + if(vassaldatum.special_type) + to_chat(vampiredatum.owner.current, "This Vassal was already assigned a special position.") + return FALSE + if(!(vassaldatum.owner.current.mob_biotypes & MOB_ORGANIC)) + to_chat(vampiredatum.owner.current, "This Vassal is unable to gain a Special rank due to innate features.") + return FALSE + + var/list/options = list() + var/list/radial_display = list() + for(var/datum/antagonist/vassal/vassaldatums as anything in subtypesof(/datum/antagonist/vassal)) + if(vampiredatum.special_vassals[initial(vassaldatums.special_type)]) + continue + options[initial(vassaldatums.name)] = vassaldatums + + var/datum/radial_menu_choice/option = new + option.image = image(icon = 'icons/mob/hud.dmi', icon_state = initial(vassaldatums.vassal_hud_name)) + option.info = "[initial(vassaldatums.name)] - ["[initial(vassaldatums.vassal_description)]"]" + radial_display[initial(vassaldatums.name)] = option + + if(!options.len) + return + + to_chat(vampiredatum.owner.current, "You can change who this Vassal is, who are they to you?") + var/vassal_response = show_radial_menu(vampiredatum.owner.current, vassaldatum.owner.current, radial_display) + if(!vassal_response) + return + vassal_response = options[vassal_response] + if(QDELETED(src) || QDELETED(vampiredatum.owner.current) || QDELETED(vassaldatum.owner.current)) + return FALSE + vassaldatum.make_special(vassal_response) + vampiredatum.vampire_blood_volume -= 150 + return TRUE + +/** + * Called when we are successfully turn a Vassal into a Favorite Vassal + * args: + * source - antagonist datum of the Vampire who turned them into a Vassal. + * vassaldatum - the antagonist datum of the Vassal being offered up. + */ +/datum/vampire_clan/proc/on_favorite_vassal(datum/antagonist/vampire/source, datum/antagonist/vassal/vassaldatum) + SIGNAL_HANDLER + vassaldatum.BuyPower(new /datum/action/cooldown/vampire/targeted/brawn) diff --git a/code/modules/antagonists/vampire/clans/assignclan.dm b/code/modules/antagonists/vampire/clans/assignclan.dm new file mode 100644 index 0000000000000..2cf8382db14a8 --- /dev/null +++ b/code/modules/antagonists/vampire/clans/assignclan.dm @@ -0,0 +1,44 @@ +/** + * Gives Vampires the ability to choose a Clan. + * If they are already in a Clan, or is in a Frenzy, they will not be able to do so. + * The arg is optional and should really only be an Admin setting a Clan for a player. + * If set however, it will give them the control of their Clan instead of the Vampire. + * This is selected through a radial menu over the player's body, even when an Admin is setting it. + * Args: + * person_selecting - Mob override for stuff like Admins selecting someone's clan. + */ +/datum/antagonist/vampire/proc/assign_clan_and_bane(mob/person_selecting) + if(my_clan || owner.current.has_status_effect(/datum/status_effect/frenzy)) + return + person_selecting ||= owner.current + + var/list/options = list() + var/list/radial_display = list() + for(var/datum/vampire_clan/all_clans as anything in typesof(/datum/vampire_clan)) + if(!initial(all_clans.joinable_clan)) //flavortext only + continue + options[initial(all_clans.name)] = all_clans + + var/datum/radial_menu_choice/option = new + option.image = image(icon = initial(all_clans.join_icon), icon_state = initial(all_clans.join_icon_state)) + option.info = "[initial(all_clans.name)] - ["[initial(all_clans.join_description)]"]" + radial_display[initial(all_clans.name)] = option + + var/chosen_clan = show_radial_menu(person_selecting, owner.current, radial_display) + chosen_clan = options[chosen_clan] + if(QDELETED(src) || QDELETED(owner.current)) + return FALSE + if(!chosen_clan) + to_chat(person_selecting, "You choose to remain ignorant, for now.") + return + my_clan = new chosen_clan(src) + +/datum/antagonist/vampire/proc/remove_clan(mob/admin) + if(owner.current.has_status_effect(/datum/status_effect/frenzy)) + to_chat(admin, "Removing a Vampire from a Clan while they are in a Frenzy will break stuff, this action has been blocked.") + return + QDEL_NULL(my_clan) + to_chat(owner.current, "You have been forced out of your clan! You can re-enter one by regular means.") + +/datum/antagonist/vampire/proc/admin_set_clan(mob/admin) + assign_clan_and_bane(admin) diff --git a/code/modules/antagonists/vampire/clans/clan_flavortext.dm b/code/modules/antagonists/vampire/clans/clan_flavortext.dm new file mode 100644 index 0000000000000..de9856d339309 --- /dev/null +++ b/code/modules/antagonists/vampire/clans/clan_flavortext.dm @@ -0,0 +1,48 @@ +// These have no functionality. They're just flavortext for the Archive of the Kindred +/datum/vampire_clan/gangrel + name = CLAN_GANGREL + description = "Closer to Animals than Vampires, known as Werewolves waiting to happen, \n\ + these are the most fearful of True Faith, being the most lethal thing they would ever see the night of. \n\ + Full Moons do not seem to have an effect, despite common-told stories. \n\ + The Favorite Vassal turns into a Werewolf whenever their Master does." + joinable_clan = FALSE + blood_drink_type = VAMPIRE_DRINK_INHUMANELY + +/datum/vampire_clan/gangrel/on_enter_frenzy(datum/antagonist/vampire/source) + ADD_TRAIT(vampiredatum.owner.current, TRAIT_STUNIMMUNE, TRAIT_FRENZY) + +/datum/vampire_clan/gangrel/on_exit_frenzy(datum/antagonist/vampire/source) + REMOVE_TRAIT(vampiredatum.owner.current, TRAIT_STUNIMMUNE, TRAIT_FRENZY) + +/datum/vampire_clan/gangrel/handle_clan_life(datum/antagonist/vampire/source) + . = ..() + var/area/current_area = get_area(vampiredatum.owner.current) + if(istype(current_area, /area/chapel)) + to_chat(vampiredatum.owner.current, "You don't belong in holy areas! The Faith burns you!") + vampiredatum.owner.current.adjustFireLoss(20) + vampiredatum.owner.current.adjust_fire_stacks(2) + vampiredatum.owner.current.IgniteMob() + +/datum/vampire_clan/toreador + name = CLAN_TOREADOR + description = "The most charming Clan of them all, allowing them to very easily disguise among the crew. \n\ + More in touch with their morals, they suffer and benefit more strongly from humanity cost or gain of their actions. \n\ + Known as 'The most humane kind of vampire', they have an obsession with perfectionism and beauty \n\ + The Favorite Vassal gains the Mesmerize ability." + joinable_clan = FALSE + blood_drink_type = VAMPIRE_DRINK_SNOBBY + +/datum/vampire_clan/brujah + name = CLAN_BRUJAH + description = "The Brujah Clan has proven to be the strongest in melee combat, boasting a powerful punch. \n\ + They also appear to be more calm than the others, entering their 'frenzies' whenever they want, but dont seem affected much by them. \n\ + Be wary, as they are fearsome warriors, rebels and anarchists, with an inclination towards Frenzy. \n\ + The Favorite Vassal gains brawn and a massive increase in brute damage from punching." + joinable_clan = FALSE + +/datum/vampire_clan/tzimisce + name = CLAN_TZIMISCE + description = "The Tzimisce Clan has no knowledge about it. \n\ + If you see one, you should probably run away.\n\ + *the rest of the page is full of undecipherable scribbles...*" + joinable_clan = FALSE diff --git a/code/modules/antagonists/vampire/clans/malkavian.dm b/code/modules/antagonists/vampire/clans/malkavian.dm new file mode 100644 index 0000000000000..50f9e1c651d27 --- /dev/null +++ b/code/modules/antagonists/vampire/clans/malkavian.dm @@ -0,0 +1,77 @@ +/datum/vampire_clan/malkavian + name = CLAN_MALKAVIAN + description = "Little is documented about Malkavians. Complete insanity is the most common theme. \n\ + The Favorite Vassal will suffer the same fate as the Master." + join_icon_state = "malkavian" + join_description = "Completely insane. You gain constant hallucinations, become a prophet with unintelligable rambling, \ + and become the enforcer of the Masquerade code." + blood_drink_type = VAMPIRE_DRINK_INHUMANELY + +/datum/vampire_clan/malkavian/on_enter_frenzy(datum/antagonist/vampire/source) + ADD_TRAIT(vampiredatum.owner.current, TRAIT_STUNIMMUNE, TRAIT_FRENZY) + +/datum/vampire_clan/malkavian/on_exit_frenzy(datum/antagonist/vampire/source) + REMOVE_TRAIT(vampiredatum.owner.current, TRAIT_STUNIMMUNE, TRAIT_FRENZY) + +/datum/vampire_clan/malkavian/New(datum/antagonist/vampire/owner_datum) + . = ..() + RegisterSignal(SSdcs, COMSIG_VAMPIRE_BROKE_MASQUERADE, PROC_REF(on_vampire_broke_masquerade)) + ADD_TRAIT(vampiredatum.owner.current, TRAIT_XRAY_VISION, TRAIT_VAMPIRE) + var/mob/living/carbon/carbon_owner = vampiredatum.owner.current + if(istype(carbon_owner)) + carbon_owner.gain_trauma(/datum/brain_trauma/mild/hallucinations, TRAUMA_RESILIENCE_ABSOLUTE) + carbon_owner.gain_trauma(/datum/brain_trauma/special/bluespace_prophet/phobetor, TRAUMA_RESILIENCE_ABSOLUTE) + owner_datum.owner.current.update_sight() + + vampiredatum.owner.current.playsound_local(get_turf(vampiredatum.owner.current), 'sound/ambience/antag/creepalert.ogg', 80, FALSE, pressure_affected = FALSE, use_reverb = FALSE) + to_chat(vampiredatum.owner.current, "Welcome to the Malkavian...") + +/datum/vampire_clan/malkavian/Destroy(force) + UnregisterSignal(SSdcs, COMSIG_VAMPIRE_BROKE_MASQUERADE) + REMOVE_TRAIT(vampiredatum.owner.current, TRAIT_XRAY_VISION, TRAIT_VAMPIRE) + var/mob/living/carbon/carbon_owner = vampiredatum.owner.current + if(istype(carbon_owner)) + carbon_owner.cure_trauma_type(/datum/brain_trauma/mild/hallucinations, TRAUMA_RESILIENCE_ABSOLUTE) + carbon_owner.cure_trauma_type(/datum/brain_trauma/special/bluespace_prophet/phobetor, TRAUMA_RESILIENCE_ABSOLUTE) + vampiredatum.owner.current.update_sight() + return ..() + +/datum/vampire_clan/malkavian/handle_clan_life(datum/antagonist/vampire/source) + . = ..() + if(prob(85) || vampiredatum.owner.current.stat != CONSCIOUS || HAS_TRAIT(vampiredatum.owner.current, TRAIT_MASQUERADE)) + return + var/message = pick(strings("malkavian_revelations.json", "revelations", "strings")) + INVOKE_ASYNC(vampiredatum.owner.current, /atom/movable/proc/say, message, , , , , , CLAN_MALKAVIAN) + +/datum/vampire_clan/malkavian/on_favorite_vassal(datum/antagonist/vampire/source, datum/antagonist/vassal/vassaldatum) + var/mob/living/carbon/carbonowner = vassaldatum.owner.current + if(istype(carbonowner)) + carbonowner.gain_trauma(/datum/brain_trauma/mild/hallucinations, TRAUMA_RESILIENCE_ABSOLUTE) + carbonowner.gain_trauma(/datum/brain_trauma/special/bluespace_prophet/phobetor, TRAUMA_RESILIENCE_ABSOLUTE) + to_chat(vassaldatum.owner.current, "Additionally, you now suffer the same fate as your Master.") + +/datum/vampire_clan/malkavian/on_exit_torpor(datum/antagonist/vampire/source) + var/mob/living/carbon/carbonowner = vampiredatum.owner.current + if(istype(carbonowner)) + carbonowner.gain_trauma(/datum/brain_trauma/mild/hallucinations, TRAUMA_RESILIENCE_ABSOLUTE) + carbonowner.gain_trauma(/datum/brain_trauma/special/bluespace_prophet/phobetor, TRAUMA_RESILIENCE_ABSOLUTE) + +/datum/vampire_clan/malkavian/on_final_death(datum/antagonist/vampire/source) + var/obj/item/soulstone/vampire/stone = new /obj/item/soulstone/vampire(get_turf(vampiredatum.owner.current)) + INVOKE_ASYNC(stone, TYPE_PROC_REF(/obj/item/soulstone/vampire, init_shade), vampiredatum.owner.current) + + return DONT_DUST + +/datum/vampire_clan/malkavian/proc/on_vampire_broke_masquerade(datum/source, datum/antagonist/vampire/masquerade_breaker) + SIGNAL_HANDLER + + if(masquerade_breaker == vampiredatum) + return + + to_chat(vampiredatum.owner.current, "[masquerade_breaker.owner.current] has broken the Masquerade! Ensure [masquerade_breaker.owner.current.p_they()] [masquerade_breaker.owner.current.p_are()] eliminated at all costs!") + var/datum/objective/assassinate/masquerade_objective = new() + masquerade_objective.target = masquerade_breaker.owner.current + masquerade_objective.name = "Clan Objective" + masquerade_objective.explanation_text = "Ensure [masquerade_breaker.owner.current], who has broken the Masquerade, succumbs to Final Death." + vampiredatum.objectives += masquerade_objective + vampiredatum.owner.announce_objectives() diff --git a/code/modules/antagonists/vampire/clans/nosferatu.dm b/code/modules/antagonists/vampire/clans/nosferatu.dm new file mode 100644 index 0000000000000..d71a45cd70816 --- /dev/null +++ b/code/modules/antagonists/vampire/clans/nosferatu.dm @@ -0,0 +1,42 @@ +/datum/vampire_clan/nosferatu + name = CLAN_NOSFERATU + description = "The Nosferatu Clan is unable to blend in with the crew, with no abilities such as Masquerade and Veil. \n\ + Additionally, has a permanent bad back and looks like a Vampire upon a simple examine, and is entirely unidentifiable, \n\ + they can fit in the vents regardless of their form and equipment. \n\ + The Favorite Vassal is permanetly disfigured, and can also ventcrawl, but only while entirely nude." + clan_objective = /datum/objective/vampire/kindred + join_icon_state = "nosferatu" + join_description = "You are permanetly disfigured, look like a Vampire to all who examine you, \ + lose your Masquerade ability, but gain the ability to Ventcrawl even while clothed." + blood_drink_type = VAMPIRE_DRINK_INHUMANELY + +/datum/vampire_clan/nosferatu/New(datum/antagonist/vampire/owner_datum) + . = ..() + for(var/datum/action/cooldown/vampire/power as anything in vampiredatum.powers) + if(istype(power, /datum/action/cooldown/vampire/masquerade) || istype(power, /datum/action/cooldown/vampire/veil)) + vampiredatum.RemovePower(power) + + ADD_TRAIT(vampiredatum.owner.current, TRAIT_DISFIGURED, TRAIT_VAMPIRE) + vampiredatum.owner.add_quirk(/datum/quirk/badback) + vampiredatum.owner.current.ventcrawler = VENTCRAWLER_ALWAYS + +/datum/vampire_clan/nosferatu/Destroy(force) + for(var/datum/action/cooldown/vampire/power in vampiredatum.powers) + vampiredatum.RemovePower(power) + vampiredatum.give_starting_powers() + + REMOVE_TRAIT(vampiredatum.owner.current, TRAIT_DISFIGURED, TRAIT_VAMPIRE) + vampiredatum.owner.remove_quirk(/datum/quirk/badback) + vampiredatum.owner.current.ventcrawler = VENTCRAWLER_NONE + return ..() + +/datum/vampire_clan/nosferatu/handle_clan_life(datum/antagonist/vampire/source) + . = ..() + if(!HAS_TRAIT(vampiredatum.owner.current, TRAIT_NO_BLOOD)) + vampiredatum.owner.current.blood_volume = BLOOD_VOLUME_SURVIVE + +/datum/vampire_clan/nosferatu/on_favorite_vassal(datum/antagonist/vampire/source, datum/antagonist/vassal/vassaldatum) + vassaldatum.owner.current.ventcrawler = VENTCRAWLER_NUDE + ADD_TRAIT(vampiredatum.owner.current, TRAIT_DISFIGURED, TRAIT_VAMPIRE) + + to_chat(vassaldatum.owner.current, "Additionally, you can now ventcrawl while naked, and are permanently disfigured.") diff --git a/code/modules/antagonists/vampire/clans/tremere.dm b/code/modules/antagonists/vampire/clans/tremere.dm new file mode 100644 index 0000000000000..ea4cb9b104e19 --- /dev/null +++ b/code/modules/antagonists/vampire/clans/tremere.dm @@ -0,0 +1,92 @@ +/datum/vampire_clan/tremere + name = CLAN_TREMERE + description = "The Tremere Clan is extremely weak to True Faith, and will burn when entering areas considered such, like the Chapel. \n\ + Additionally, a whole new moveset is learned, built on Blood magic rather than Blood abilities, which are upgraded overtime. \n\ + More ranks can be gained by Vassalizing crewmembers. \n\ + The Favorite Vassal gains the ability to morph themselves into a bat at will." + clan_objective = /datum/objective/vampire/tremere_power + join_icon_state = "tremere" + join_description = "You will burn if you enter the Chapel, lose all default powers, \ + but gain Blood Magic instead, powers you level up overtime." + +/datum/vampire_clan/tremere/New(mob/living/carbon/user) + . = ..() + vampiredatum.remove_nondefault_powers(return_levels = TRUE) + for(var/datum/action/cooldown/vampire/power as anything in vampiredatum.all_vampire_powers) + if((initial(power.purchase_flags) & TREMERE_CAN_BUY) && initial(power.level_current) == 1) + vampiredatum.BuyPower(new power) + +/datum/vampire_clan/tremere/Destroy(force) + for(var/datum/action/cooldown/vampire/power in vampiredatum.powers) + if(power.purchase_flags & TREMERE_CAN_BUY) + vampiredatum.RemovePower(power) + return ..() + +/datum/vampire_clan/tremere/handle_clan_life(datum/antagonist/vampire/source) + . = ..() + var/area/current_area = get_area(vampiredatum.owner.current) + if(istype(current_area, /area/chapel)) + to_chat(vampiredatum.owner.current, "You don't belong in holy areas! The Faith burns you!") + vampiredatum.owner.current.adjustFireLoss(10) + vampiredatum.owner.current.adjust_fire_stacks(2) + vampiredatum.owner.current.IgniteMob() + +/datum/vampire_clan/tremere/spend_rank(datum/antagonist/vampire/source, mob/living/carbon/target, cost_rank = TRUE, blood_cost) + // Purchase Power Prompt + var/list/options = list() + for(var/datum/action/cooldown/vampire/targeted/tremere/power as anything in vampiredatum.powers) + if(!(power.purchase_flags & TREMERE_CAN_BUY)) + continue + if(isnull(power.upgraded_power)) + continue + options[initial(power.name)] = power + + if(options.len < 1) + to_chat(vampiredatum.owner.current, "You grow more ancient by the night!") + else + // Give them the UI to purchase a power. + var/choice = tgui_input_list(vampiredatum.owner.current, "You have the opportunity to grow more ancient. Select a power you wish to upgrade.", "Your Blood Thickens...", options) + // Prevent Vampires from closing/reopning their coffin to spam Levels. + if(cost_rank && vampiredatum.vampire_level_unspent <= 0) + return + // Did you choose a power? + if(!choice || !options[choice]) + to_chat(vampiredatum.owner.current, "You prevent your blood from thickening just yet, but you may try again later.") + return + // Prevent Vampires from purchasing a power while outside of their Coffin. + if(!istype(vampiredatum.owner.current.loc, /obj/structure/closet/crate/coffin)) + to_chat(vampiredatum.owner.current, "You must be in your Coffin to purchase Powers.") + return + + // Good to go - Buy Power! + var/datum/action/cooldown/vampire/purchased_power = options[choice] + var/datum/action/cooldown/vampire/targeted/tremere/tremere_power = purchased_power + if(isnull(tremere_power.upgraded_power)) + vampiredatum.owner.current.balloon_alert(vampiredatum.owner.current, "cannot upgrade [choice]!") + to_chat(vampiredatum.owner.current, "[choice] is already at max level!") + return + vampiredatum.BuyPower(new tremere_power.upgraded_power) + vampiredatum.RemovePower(tremere_power) + vampiredatum.owner.current.balloon_alert(vampiredatum.owner.current, "upgraded [choice]!") + to_chat(vampiredatum.owner.current, "You have upgraded [choice]!") + + finalize_spend_rank(vampiredatum, cost_rank, blood_cost) + +/datum/vampire_clan/tremere/on_favorite_vassal(datum/antagonist/vampire/source, datum/antagonist/vassal/vassaldatum) + var/obj/effect/proc_holder/spell/targeted/shapeshift/bat/batform = new + vassaldatum.owner.current.AddSpell(batform) + +/datum/vampire_clan/tremere/on_vassal_made(datum/antagonist/vampire/source, mob/living/user, mob/living/target) + ..() + to_chat(vampiredatum.owner.current, "You have now gained an additional Rank to spend!") + vampiredatum.vampire_level_unspent++ + +// Batform for special vassals +/obj/effect/proc_holder/spell/targeted/shapeshift/bat + name = "Bat Form" + desc = "Take on the shape a space bat." + invocation = "SQUEAAAAK!" + charge_max = 50 + cooldown_min = 50 + convert_damage = FALSE + shapeshift_type = /mob/living/simple_animal/hostile/retaliate/bat/vampire diff --git a/code/modules/antagonists/vampire/clans/ventrue.dm b/code/modules/antagonists/vampire/clans/ventrue.dm new file mode 100644 index 0000000000000..a7bbcc85cd3c2 --- /dev/null +++ b/code/modules/antagonists/vampire/clans/ventrue.dm @@ -0,0 +1,120 @@ +///The maximum level a Ventrue Vampire can be, before they have to level up their vassal instead. +#define VENTRUE_MAX_LEVEL 3 +///How much it costs for a Ventrue to rank up without a spare rank to spend. +#define VAMPIRE_BLOOD_RANKUP_COST (550) + +/datum/vampire_clan/ventrue + name = CLAN_VENTRUE + description = "The Ventrue Clan is extremely snobby with their meals, and refuse to drink blood from people without a mind. \n\ + You may only level yourself up to Level %MAX_LEVEL%, anything further will be ranks to spend on their Favorite Vassal through a Persuasion Rack. \n\ + The Favorite Vassal will slowly turn more Vampiric this way, until they finally lose their last bits of Humanity." + clan_objective = /datum/objective/vampire/embrace + join_icon_state = "ventrue" + join_description = "Lose the ability to drink from mindless mobs, can't level up or gain new powers, \ + instead you raise a vassal into a Vampire." + blood_drink_type = VAMPIRE_DRINK_SNOBBY + +/datum/vampire_clan/ventrue/New(datum/antagonist/vampire/owner_datum) + . = ..() + description = replacetext(description, "%MAX_LEVEL%", VENTRUE_MAX_LEVEL) + +/datum/vampire_clan/ventrue/spend_rank(datum/antagonist/vampire/source, mob/living/carbon/target, cost_rank = TRUE, blood_cost) + if(!target) + if(vampiredatum.vampire_level < VENTRUE_MAX_LEVEL) + return ..() + return FALSE + var/datum/antagonist/vassal/favorite/vassaldatum = IS_FAVORITE_VASSAL(target) + if(!vassaldatum) + return FALSE + // Purchase Power Prompt + var/list/options = list() + for(var/datum/action/cooldown/vampire/power as anything in vampiredatum.all_vampire_powers) + if(initial(power.purchase_flags) & VASSAL_CAN_BUY && !(locate(power) in vassaldatum.powers)) + options[initial(power.name)] = power + + if(options.len < 1) + to_chat(vampiredatum.owner.current, "You grow more ancient by the night!") + else + // Give them the UI to purchase a power. + var/choice = tgui_input_list(vampiredatum.owner.current, "You have the opportunity to level up your Favorite Vassal. Select a power you wish for them to receive.", "Your Blood Thickens...", options) + // Prevent Vampires from closing/reopning their coffin to spam Levels. + if(cost_rank && vampiredatum.vampire_level_unspent <= 0) + return + // Did you choose a power? + if(!choice || !options[choice]) + to_chat(vampiredatum.owner.current, "You prevent your blood from thickening just yet, but you may try again later.") + return + // Prevent Vampires from closing/reopning their coffin to spam Levels. + if((locate(options[choice]) in vassaldatum.powers)) + to_chat(vampiredatum.owner.current, "You prevent your blood from thickening just yet, but you may try again later.") + return + + // Good to go - Buy Power! + var/datum/action/cooldown/vampire/purchased_power = options[choice] + vassaldatum.BuyPower(new purchased_power) + vampiredatum.owner.current.balloon_alert(vampiredatum.owner.current, "taught [choice]!") + to_chat(vampiredatum.owner.current, "You taught [target] how to use [choice]!") + target.balloon_alert(target, "learned [choice]!") + to_chat(target, "Your master taught you how to use [choice]!") + + vassaldatum.vassal_level++ + switch(vassaldatum.vassal_level) + if(2) + ADD_TRAIT(vampiredatum.owner.current, TRAIT_MUTE, TRAIT_VAMPIRE) + ADD_TRAIT(vampiredatum.owner.current, TRAIT_NOBREATH, TRAIT_VAMPIRE) + ADD_TRAIT(vampiredatum.owner.current, TRAIT_AGEUSIA, TRAIT_VAMPIRE) + to_chat(target, "Your blood begins to feel cold, and as a mote of ash lands upon your tongue, you stop breathing...") + if(3) + ADD_TRAIT(vampiredatum.owner.current, TRAIT_NOCRITDAMAGE, TRAIT_VAMPIRE) + ADD_TRAIT(vampiredatum.owner.current, TRAIT_NOSOFTCRIT, TRAIT_VAMPIRE) + to_chat(target, "You feel your Master's blood reinforce you, strengthening you up.") + if(4) + ADD_TRAIT(vampiredatum.owner.current, TRAIT_SLEEPIMMUNE, TRAIT_VAMPIRE) + ADD_TRAIT(vampiredatum.owner.current, TRAIT_VIRUSIMMUNE, TRAIT_VAMPIRE) + to_chat(target, "You feel your Master's blood begin to protect you from bacteria.") + if(ishuman(target)) + var/mob/living/carbon/human/human_target = target + human_target.skin_tone = "albino" + if(5) + ADD_TRAIT(vampiredatum.owner.current, TRAIT_NOHARDCRIT, TRAIT_VAMPIRE) + to_chat(target, "You feel yourself able to take cuts and stabbings like it's nothing.") + if(6 to INFINITY) + to_chat(target, "You feel your heart stop pumping for the last time as you begin to thirst for blood, you feel... dead.") + message_admins("[vassaldatum.owner] has become a Vampire, and was created by [vampiredatum.owner].") + log_admin("[vampiredatum.owner] has become a Vampire, and was created by [vampiredatum.owner].") + target.mind.make_vampire() + + SEND_SIGNAL(vampiredatum.owner, COMSIG_ADD_MOOD_EVENT, "vampcandle", /datum/mood_event/vampcandle) + + finalize_spend_rank(vampiredatum, cost_rank, blood_cost) + vassaldatum.LevelUpPowers() + +/datum/vampire_clan/ventrue/interact_with_vassal(datum/antagonist/vampire/source, datum/antagonist/vassal/favorite/vassaldatum) + . = ..() + if(.) + return TRUE + if(!istype(vassaldatum)) + return FALSE + if(!vampiredatum.vampire_level_unspent <= 0) + vampiredatum.SpendRank(vassaldatum.owner.current) + return TRUE + if(vampiredatum.vampire_blood_volume >= VAMPIRE_BLOOD_RANKUP_COST) + // We don't have any ranks to spare? Let them upgrade... with enough Blood. + to_chat(vampiredatum.owner.current, "Do you wish to spend [VAMPIRE_BLOOD_RANKUP_COST] Blood to Rank [vassaldatum.owner.current] up?") + var/static/list/rank_options = list( + "Yes" = image(icon = 'icons/hud/radials/radial_generic.dmi', icon_state = "radial_yes"), + "No" = image(icon = 'icons/hud/radials/radial_generic.dmi', icon_state = "radial_no"), + ) + var/rank_response = show_radial_menu(vampiredatum.owner.current, vassaldatum.owner.current, rank_options, radius = 36, require_near = TRUE) + if(rank_response == "Yes") + vampiredatum.SpendRank(vassaldatum.owner.current, cost_rank = FALSE, blood_cost = VAMPIRE_BLOOD_RANKUP_COST) + return TRUE + to_chat(vampiredatum.owner.current, "You don't have any levels or enough Blood to Rank [vassaldatum.owner.current] up with.") + return TRUE + +/datum/vampire_clan/ventrue/on_favorite_vassal(datum/source, datum/antagonist/vassal/vassaldatum, mob/living/vampire) + to_chat(vampire, "* Vampire Tip: You can now upgrade your Favorite Vassal by buckling them onto a Candelabrum!") + vassaldatum.BuyPower(new /datum/action/cooldown/vampire/distress) + +#undef VAMPIRE_BLOOD_RANKUP_COST +#undef VENTRUE_MAX_LEVEL diff --git a/code/modules/antagonists/vampire/conversion_vampire.dm b/code/modules/antagonists/vampire/conversion_vampire.dm new file mode 100644 index 0000000000000..27b74adb8211c --- /dev/null +++ b/code/modules/antagonists/vampire/conversion_vampire.dm @@ -0,0 +1,73 @@ +/** + * Checks if the target's antag_datums contain any of the banned antags. + */ +/datum/antagonist/vampire/proc/IsBlacklistedAntag(mob/target) + for(var/datum/antagonist/antag_datum as anything in target.mind.antag_datums) + if(antag_datum.type in vassal_banned_antags) + return TRUE + return FALSE + +/** + * # can_make_vassal + * Checks if the person is allowed to turn into the Vampire's + * Vassal, ensuring they are a player and valid. + * If they are a Vassal themselves, will check if their master + * has broken the Masquerade, to steal them. + * Args: + * conversion_target - Person being vassalized + */ +/datum/antagonist/vampire/proc/can_make_vassal(mob/living/conversion_target) + var/mob/living/carbon/human/user = owner.current + + if(!my_clan) + user.balloon_alert(user, "enter a clan first.") + return FALSE + if(IsBlacklistedAntag(conversion_target) || !ishuman(conversion_target) || !conversion_target.mind || conversion_target.mind?.unconvertable) + user.balloon_alert(user, "can't be vassalized!") + return FALSE + var/datum/antagonist/vassal/vassaldatum = IS_VASSAL(conversion_target) + if(vassaldatum && !vassaldatum?.master.broke_masquerade) + user.balloon_alert(user, "someone else's vassal!") + return FALSE + if(conversion_target.stat > UNCONSCIOUS) + user.balloon_alert(user, "must be awake!") + return FALSE + if(length(vassals) >= return_current_max_vassals()) + user.balloon_alert(user, "max vassals reached!") + return FALSE + var/mob/living/master = conversion_target.mind.enslaved_to + if(master && master != owner.current) + user.balloon_alert(user, "enslaved to someone else!") + return FALSE + + return TRUE + +/** + * This proc is responsible for calculating how many vassals you can have at any given + * time, ranges from 1 at 20 pop to 4 at 40 pop + */ +/datum/antagonist/vampire/proc/return_current_max_vassals() + var/total_players = GLOB.joined_player_list.len + switch(total_players) + if(1 to 20) + return 1 + if(21 to 30) + return 3 + else + return 4 + +/datum/antagonist/vampire/proc/make_vassal(mob/living/conversion_target) + //Check if they used to be a Vassal and was stolen. + if(IS_VASSAL(conversion_target)) + conversion_target.mind.remove_antag_datum(/datum/antagonist/vassal) + + SelectTitle(am_fledgling = FALSE) + + //Set the master, then give the datum. + var/datum/antagonist/vassal/vassaldatum = new(conversion_target.mind) + vassaldatum.master = src + conversion_target.mind.add_antag_datum(vassaldatum) + + message_admins("[conversion_target] has become a Vassal, and is enslaved to [owner.current].") + log_admin("[conversion_target] has become a Vassal, and is enslaved to [owner.current].") + return TRUE diff --git a/code/modules/antagonists/vampire/datum_vampire.dm b/code/modules/antagonists/vampire/datum_vampire.dm new file mode 100644 index 0000000000000..690a795ddb0df --- /dev/null +++ b/code/modules/antagonists/vampire/datum_vampire.dm @@ -0,0 +1,499 @@ +/datum/antagonist/vampire + name = "\improper Vampire" + roundend_category = "vampires" + antagpanel_category = "Vampire" + banning_key = ROLE_VAMPIRE + required_living_playtime = 4 + ui_name = "AntagInfoVampire" + hijack_speed = 0.5 + /// How much blood we have, starting off at default blood levels. + var/vampire_blood_volume = BLOOD_VOLUME_NORMAL + /// How much blood we can have at once, increases per level. + var/max_blood_volume = 600 + + // Only created if vampire makes vassals + var/datum/team/vampire/vampire_team + + var/datum/vampire_clan/my_clan + + // TIMERS // + ///Timer between alerts for Burn messages + COOLDOWN_DECLARE(vampire_spam_sol_burn) + ///Timer between alerts for Healing messages + COOLDOWN_DECLARE(vampire_spam_healing) + + ///Used for assigning your name + var/vampire_name + ///Used for assigning your title + var/vampire_title + ///Used for assigning your reputation + var/vampire_reputation + + ///Have we been broken the Masquerade? + var/broke_masquerade = FALSE + ///How many Masquerade Infractions do we have? + var/masquerade_infractions = 0 + ///Blood required to enter Frenzy + var/frenzy_threshold = FRENZY_THRESHOLD_ENTER + ///If we are currently in a Frenzy + var/frenzied = FALSE + + ///ALL Powers currently owned + var/list/datum/action/cooldown/vampire/powers = list() + ///Frenzy Grab Martial art given to Vampires in a Frenzy + var/datum/martial_art/frenzygrab/frenzygrab = new + + ///Vassals under my control. Periodically remove the dead ones. + var/list/datum/antagonist/vassal/vassals = list() + ///Special vassals I own, to not have double of the same type. + var/list/datum/antagonist/vassal/special_vassals = list() + + var/vampire_level = 0 + var/vampire_level_unspent = 0 + var/additional_regen + var/vampire_regen_rate = 0.3 + + // Used for Vampire Objectives + var/area/vampire_lair_area + var/obj/structure/closet/crate/coffin + var/total_blood_drank = 0 + + ///Blood display HUD + var/atom/movable/screen/vampire/blood_counter/blood_display + ///Vampire level display HUD + var/atom/movable/screen/vampire/rank_counter/vamprank_display + ///Sunlight timer HUD + var/atom/movable/screen/vampire/sunlight_counter/sunlight_display + ///Used in life_vampire.dm to stop final_death being called multiple times + var/has_succumb_to_final_death = FALSE + + /// Static typecache of all vampire powers. + var/static/list/all_vampire_powers = typecacheof(/datum/action/cooldown/vampire, ignore_root_path = TRUE) + /// Antagonists that cannot be Vassalized no matter what + var/static/list/vassal_banned_antags = list( + /datum/antagonist/vampire, + /datum/antagonist/changeling, + /datum/antagonist/cult, + /datum/antagonist/servant_of_ratvar, + ) + ///Default Vampire traits + var/static/list/vampire_traits = list( + TRAIT_NOBREATH, + TRAIT_SLEEPIMMUNE, + TRAIT_NOCRITDAMAGE, + TRAIT_RESISTCOLD, + TRAIT_RADIMMUNE, + TRAIT_STABLEHEART, + TRAIT_NOSOFTCRIT, + TRAIT_NOHARDCRIT, + TRAIT_AGEUSIA, + TRAIT_COLDBLOODED, + TRAIT_VIRUSIMMUNE, + TRAIT_TOXIMMUNE, + ) + + var/static/list/torpor_traits = list( + TRAIT_NODEATH, + TRAIT_FAKEDEATH, + TRAIT_DEATHCOMA, + TRAIT_RESISTLOWPRESSURE, + TRAIT_RESISTHIGHPRESSURE, + ) + +/datum/antagonist/vampire/proc/create_vampire_team() + var/static/count = 0 + vampire_team = new(owner) + vampire_team.hud = new/datum/atom_hud/antag() + vampire_team.name = "Vampire team #[++count]" // only displayed to admins + vampire_team.master_vampire = src + +/datum/team/vampire + name = "vampire team" + var/datum/atom_hud/antag/hud + var/datum/antagonist/vampire/master_vampire +/** + * Apply innate effects is everything given to the mob + * When a body is tranferred, this is called on the new mob + * while on_gain is called ONCE per ANTAG, this is called ONCE per BODY. + */ +/datum/antagonist/vampire/apply_innate_effects(mob/living/mob_override) + . = ..() + var/mob/living/current_mob = mob_override || owner.current + RegisterSignal(current_mob, COMSIG_LIVING_LIFE, PROC_REF(LifeTick)) + RegisterSignal(current_mob, COMSIG_LIVING_DEATH, PROC_REF(on_death)) + handle_clown_mutation(current_mob, mob_override ? null : "Your clownish nature has been subdued by your thirst for blood.") + + set_antag_hud(current_mob, "vampire") + create_vampire_team() + vampire_team.hud.join_hud(current_mob) + + current_mob.faction |= FACTION_VAMPIRE + + if(current_mob.hud_used) + on_hud_created() + else + RegisterSignal(current_mob, COMSIG_MOB_HUD_CREATED, PROC_REF(on_hud_created)) +#ifdef VAMPIRE_TESTING + var/turf/user_loc = get_turf(current_mob) + new /obj/structure/closet/crate/coffin(user_loc) + new /obj/structure/vampire/vassalrack(user_loc) +#endif + +/** + * Remove innate effects is everything given to the mob + * When a body is tranferred, this is called on the old mob. + * while on_removal is called ONCE per ANTAG, this is called ONCE per BODY. + */ +/datum/antagonist/vampire/remove_innate_effects(mob/living/mob_override) + . = ..() + var/mob/living/current_mob = mob_override || owner.current + UnregisterSignal(current_mob, list(COMSIG_LIVING_LIFE, COMSIG_PARENT_EXAMINE, COMSIG_LIVING_DEATH)) + handle_clown_mutation(current_mob, removing = FALSE) + + if(current_mob.hud_used) + var/datum/hud/hud_used = current_mob.hud_used + hud_used.infodisplay -= blood_display + hud_used.infodisplay -= vamprank_display + hud_used.infodisplay -= sunlight_display + QDEL_NULL(blood_display) + QDEL_NULL(vamprank_display) + QDEL_NULL(sunlight_display) + + vampire_team.hud.leave_hud(current_mob) + set_antag_hud(current_mob, null) + + current_mob.faction -= FACTION_VAMPIRE + +/datum/antagonist/vampire/proc/on_hud_created(datum/source) + SIGNAL_HANDLER + var/datum/hud/vampire_hud = owner.current.hud_used + + blood_display = new /atom/movable/screen/vampire/blood_counter() + blood_display.hud = vampire_hud + vampire_hud.infodisplay += blood_display + + vamprank_display = new /atom/movable/screen/vampire/rank_counter() + vamprank_display.hud = vampire_hud + vampire_hud.infodisplay += vamprank_display + + sunlight_display = new /atom/movable/screen/vampire/sunlight_counter() + sunlight_display.hud = vampire_hud + vampire_hud.infodisplay += sunlight_display + + vampire_hud.show_hud(vampire_hud.hud_version) + UnregisterSignal(owner.current, COMSIG_MOB_HUD_CREATED) + +/datum/antagonist/vampire/get_admin_commands() + . = ..() + .["Give Level"] = CALLBACK(src, PROC_REF(RankUp)) + if(vampire_level_unspent > 0) + .["Remove Level"] = CALLBACK(src, PROC_REF(RankDown)) + + if(broke_masquerade) + .["Fix Masquerade"] = CALLBACK(src, PROC_REF(fix_masquerade)) + else + .["Break Masquerade"] = CALLBACK(src, PROC_REF(break_masquerade)) + + if(my_clan) + .["Remove Clan"] = CALLBACK(src, PROC_REF(remove_clan)) + else + .["Add Clan"] = CALLBACK(src, PROC_REF(admin_set_clan)) + +///Called when you get the antag datum, called only ONCE per antagonist. +/datum/antagonist/vampire/on_gain() + RegisterSignal(SSsunlight, COMSIG_SOL_RANKUP_VAMPIRES, PROC_REF(sol_rank_up)) + RegisterSignal(SSsunlight, COMSIG_SOL_NEAR_START, PROC_REF(sol_near_start)) + RegisterSignal(SSsunlight, COMSIG_SOL_END, PROC_REF(on_sol_end)) + RegisterSignal(SSsunlight, COMSIG_SOL_RISE_TICK, PROC_REF(handle_sol)) + RegisterSignal(SSsunlight, COMSIG_SOL_WARNING_GIVEN, PROC_REF(give_warning)) + + if(IS_FAVORITE_VASSAL(owner.current)) // Vassals shouldnt be getting the same benefits as Vampires. + vampire_level_unspent = 0 + show_in_roundend = FALSE + else + // Start Sunlight if first Vampire + check_start_sunlight() + // Name and Titles + SelectFirstName() + SelectTitle(am_fledgling = TRUE) + SelectReputation(am_fledgling = TRUE) + // Objectives + forge_vampire_objectives() + + . = ..() + // Assign Powers + give_starting_powers() + assign_starting_stats() + +/// Called by the remove_antag_datum() and remove_all_antag_datums() mind procs for the antag datum to handle its own removal and deletion. +/datum/antagonist/vampire/on_removal() + UnregisterSignal(SSsunlight, list(COMSIG_SOL_RANKUP_VAMPIRES, COMSIG_SOL_NEAR_START, COMSIG_SOL_END, COMSIG_SOL_RISE_TICK, COMSIG_SOL_WARNING_GIVEN)) + clear_powers_and_stats() + check_cancel_sunlight() //check if sunlight should end + //Remove Language + owner.current.remove_language(/datum/language/vampiric) + return ..() + +/datum/antagonist/vampire/on_body_transfer(mob/living/old_body, mob/living/new_body) + . = ..() + for(var/datum/action/cooldown/vampire/all_powers as anything in powers) + if(old_body) + all_powers.Remove(old_body) + all_powers.Grant(new_body) + + var/mob/living/carbon/human/old_body_human = old_body + if(ishuman(old_body_human)) + old_body_human.dna.species.punchdamage -= 2 + + var/mob/living/carbon/human/user = owner.current + if(ishuman(owner.current)) + var/datum/species/user_species = user.dna.species + user_species.species_traits += TRAIT_DRINKSBLOOD + user_species.punchdamage += 2 + + //Give Vampire Traits + old_body?.remove_traits(vampire_traits, TRAIT_VAMPIRE) + new_body.add_traits(vampire_traits, TRAIT_VAMPIRE) + +/datum/antagonist/vampire/greet() + . = ..() + var/fullname = return_full_name() + to_chat(owner, "You are [fullname], a strain of vampire known as a Vampire!") + owner.announce_objectives() + if(vampire_level_unspent >= 1) + to_chat(owner, "As a latejoin, you have [vampire_level_unspent] bonus Ranks, entering your claimed coffin allows you to spend a Rank.") + owner.current.playsound_local(null, 'sound/vampires/VampireAlert.ogg', 100, FALSE, pressure_affected = FALSE) + antag_memory += "Although you were born a mortal, in undeath you earned the name [fullname].
" + +/datum/antagonist/vampire/farewell() + to_chat(owner.current, "With a snap, your curse has ended. You are no longer a Vampire. You live once more!") + // Refill with Blood so they don't instantly die. + if(!HAS_TRAIT(owner.current, TRAIT_NO_BLOOD)) + owner.current.blood_volume = max(owner.current.blood_volume, BLOOD_VOLUME_NORMAL) + +// Called when using admin tools to give antag status +/datum/antagonist/vampire/admin_add(datum/mind/new_owner, mob/admin) + var/levels = input("How many unspent Ranks would you like [new_owner] to have?","Vampire Rank", vampire_level_unspent) as null | num + var/msg = " made [key_name_admin(new_owner)] into \a [name]" + if(levels > 0) + vampire_level_unspent = levels + msg += " with [levels] extra unspent Ranks." + message_admins("[key_name_admin(usr)][msg]") + log_admin("[key_name(usr)][msg]") + new_owner.add_antag_datum(src) + +/datum/antagonist/vampire/ui_static_data(mob/user) + var/list/data = list() + //we don't need to update this that much. + data["in_clan"] = !!my_clan + var/list/clan_data = list() + if(my_clan) + clan_data["clan_name"] = my_clan.name + clan_data["clan_description"] = my_clan.description + clan_data["clan_icon"] = my_clan.join_icon_state + + data["clan"] += list(clan_data) + + for(var/datum/action/cooldown/vampire/power as anything in powers) + var/list/power_data = list() + + power_data["power_name"] = power.name + power_data["power_explanation"] = power.power_explanation + power_data["power_icon"] = power.button_icon_state + + data["power"] += list(power_data) + + return data + ..() + +/datum/antagonist/vampire/ui_act(action, params, datum/tgui/ui) + . = ..() + if(.) + return + + switch(action) + if("join_clan") + if(my_clan) + return + assign_clan_and_bane() + ui.send_full_update(force = TRUE) + return + +/datum/antagonist/vampire/roundend_report() + var/list/report = list() + + // Vamp name + report += "
\"[return_full_name()]\"" + report += printplayer(owner) + if(my_clan) + report += "They were part of the [my_clan.name]!" + + // Default Report + var/objectives_complete = TRUE + if(objectives.len) + report += printobjectives(objectives) + for(var/datum/objective/objective in objectives) + if(objective.name == "Optional Objective") + continue + if(!objective.check_completion()) + objectives_complete = FALSE + break + + // Now list their vassals + if(vassals.len) + report += "Their Vassals were..." + for(var/datum/antagonist/vassal/all_vassals as anything in vassals) + if(!all_vassals.owner) + continue + var/list/vassal_report = list() + vassal_report += "[all_vassals.owner.name]" + + if(all_vassals.owner.assigned_role) + vassal_report += " the [all_vassals.owner.assigned_role]" + if(IS_FAVORITE_VASSAL(all_vassals.owner.current)) + vassal_report += " and was the Favorite Vassal" + else if(IS_REVENGE_VASSAL(all_vassals.owner.current)) + vassal_report += " and was the Revenge Vassal" + report += vassal_report.Join() + + if(objectives.len == 0 || objectives_complete) + report += "The [name] was successful!" + else + report += "The [name] has failed!" + + return report.Join("
") + +/datum/antagonist/vampire/proc/give_starting_powers() + for(var/datum/action/cooldown/vampire/all_powers as anything in all_vampire_powers) + if(!(initial(all_powers.purchase_flags) & VAMPIRE_DEFAULT_POWER)) + continue + BuyPower(new all_powers) + +/datum/antagonist/vampire/proc/assign_starting_stats() + var/mob/living/carbon/human/user = owner.current + + //Traits: Species + if(ishuman(user)) + var/datum/species/user_species = user.dna.species + user_species.species_traits += TRAIT_DRINKSBLOOD + user_species.punchdamage += 2 + user.dna?.remove_all_mutations() + //Give Vampire Traits + user.add_traits(vampire_traits, TRAIT_VAMPIRE) + //Clear Addictions + user.reagents.addiction_list = new() + owner.remove_quirk(/datum/quirk/junkie) + owner.remove_quirk(/datum/quirk/junkie/smoker) + //No Skittish "People" allowed + if(HAS_TRAIT(user, TRAIT_SKITTISH)) + REMOVE_TRAIT(user, TRAIT_SKITTISH, ROUNDSTART_TRAIT) + // Tongue & Language + user.grant_all_languages(FALSE, FALSE, TRUE) + user.grant_language(/datum/language/vampiric) + /// Clear Disabilities & Organs + heal_vampire_organs() + +/** + * ##clear_power_and_stats() + * + * Removes all Vampire related Powers/Stats changes, setting them back to pre-Vampire + * Order of steps and reason why: + * Remove clan - Clans like Nosferatu give Powers on removal, we have to make sure this is given before removing Powers. + * Powers - Remove all Powers, so things like Masquerade are off. + * Species traits, Traits, MaxHealth, Language - Misc stuff, has no priority. + * Organs - At the bottom to ensure everything that changes them has reverted themselves already. + * Update Sight - Done after Eyes are regenerated. + */ +/datum/antagonist/vampire/proc/clear_powers_and_stats() + var/mob/living/carbon/user = owner.current + + // Remove clan first + if(my_clan) + QDEL_NULL(my_clan) + // Powers + for(var/datum/action/cooldown/vampire/all_powers as anything in powers) + RemovePower(all_powers) + /// Stats + if(ishuman(owner.current)) + //var/mob/living/carbon/human/user = owner.current + var/datum/species/user_species = user.dna.species + user_species.species_traits -= TRAIT_DRINKSBLOOD + // Remove all vampire traits + user.remove_traits(vampire_traits, TRAIT_VAMPIRE) + // Update Health + owner.current.setMaxHealth(initial(owner.current.maxHealth)) + // Language + owner.current.remove_language(/datum/language/vampiric) + // Heart + var/obj/item/organ/heart/newheart = owner.current.getorganslot(ORGAN_SLOT_HEART) + newheart?.beating = initial(newheart.beating) + // Eyes + var/obj/item/organ/eyes/user_eyes = user.getorganslot(ORGAN_SLOT_EYES) + user_eyes?.flash_protect = initial(user_eyes.flash_protect) + user_eyes?.sight_flags = initial(user_eyes.sight_flags) + user_eyes?.see_in_dark = NIGHTVISION_FOV_RANGE + user_eyes?.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE + user.update_sight() + +/datum/antagonist/vampire/proc/claim_coffin(obj/structure/closet/crate/claimed, area/current_area) + // ALREADY CLAIMED + if(claimed.resident) + if(claimed.resident == owner.current) + to_chat(owner, "This is your [src].") + else + to_chat(owner, "This [src] has already been claimed by another.") + return FALSE + if(!(GLOB.the_station_areas.Find(current_area.type))) + claimed.balloon_alert(owner.current, "not part of station!") + return + // This is my Lair + coffin = claimed + vampire_lair_area = current_area + if(!(/datum/crafting_recipe/vassalrack in owner?.learned_recipes)) + owner.teach_crafting_recipe(/datum/crafting_recipe/vassalrack) + owner.teach_crafting_recipe(/datum/crafting_recipe/candelabrum) + owner.teach_crafting_recipe(/datum/crafting_recipe/bloodthrone) + owner.teach_crafting_recipe(/datum/crafting_recipe/meatcoffin) + owner.current.balloon_alert(owner.current, "new recipes learned!") + to_chat(owner, "You have claimed the [claimed] as your place of immortal rest! Your lair is now [vampire_lair_area].") + to_chat(owner, "Vampire Tip: Find new lair recipes in the Structures tab of the Crafting Menu, including the Persuasion Rack for converting crew into Vassals.") + return TRUE + +/// Name shown on antag list +/datum/antagonist/vampire/antag_listing_name() + return ..() + "([return_full_name()])" + +/// Whatever interesting things happened to the antag admins should know about +/// Include additional information about antag in this part +/datum/antagonist/vampire/antag_listing_status() + if(owner && !considered_alive(owner)) + return "Final Death" + return ..() + +/datum/antagonist/vampire/proc/forge_vampire_objectives() + // Claim a Lair Objective + var/datum/objective/vampire/lair/lair_objective = new + lair_objective.owner = owner + objectives += lair_objective + // Survive Objective + var/datum/objective/survive/vampire/survive_objective = new + survive_objective.owner = owner + objectives += survive_objective + + // Objective 1: Vassalize a Head/Command, or a specific target + switch(rand(1, 3)) + if(1) // Conversion Objective + var/datum/objective/vampire/conversion/chosen_subtype = pick(subtypesof(/datum/objective/vampire/conversion)) + var/datum/objective/vampire/conversion/conversion_objective = new chosen_subtype + conversion_objective.owner = owner + conversion_objective.name = "Optional Objective" + objectives += conversion_objective + if(2) // Heart Thief Objective + var/datum/objective/vampire/heartthief/heartthief_objective = new + heartthief_objective.owner = owner + heartthief_objective.name = "Optional Objective" + objectives += heartthief_objective + if(3) // Drink Blood Objective + var/datum/objective/vampire/gourmand/gourmand_objective = new + gourmand_objective.owner = owner + gourmand_objective.name = "Optional Objective" + objectives += gourmand_objective diff --git a/code/modules/antagonists/vampire/daylight_vampire.dm b/code/modules/antagonists/vampire/daylight_vampire.dm new file mode 100644 index 0000000000000..799b6b3c56225 --- /dev/null +++ b/code/modules/antagonists/vampire/daylight_vampire.dm @@ -0,0 +1,177 @@ +/** + * # Assigning Sol + * + * Sol is the sunlight, during this period, all Vampires must be in their coffin, else they burn. + */ + +/// Start Sol, called when someone is assigned Vampire +/datum/antagonist/vampire/proc/check_start_sunlight() + var/list/existing_suckers = get_antag_minds(/datum/antagonist/vampire) - owner + if(!length(existing_suckers)) + message_admins("New Sol has been created due to Vampire assignment.") + SSsunlight.can_fire = TRUE + +/// End Sol, if you're the last Vampire +/datum/antagonist/vampire/proc/check_cancel_sunlight() + var/list/existing_suckers = get_antag_minds(/datum/antagonist/vampire) - owner + if(!length(existing_suckers)) + message_admins("Sol has been deleted due to the lack of Vampires") + SSsunlight.can_fire = FALSE + +///Ranks the Vampire up, called by Sol. +/datum/antagonist/vampire/proc/sol_rank_up(atom/source) + SIGNAL_HANDLER + + INVOKE_ASYNC(src, PROC_REF(RankUp)) + +///Called when Sol is near starting. +/datum/antagonist/vampire/proc/sol_near_start(atom/source) + SIGNAL_HANDLER + if(vampire_lair_area && !(locate(/datum/action/cooldown/vampire/gohome) in powers)) + BuyPower(new /datum/action/cooldown/vampire/gohome) + +///Called when Sol first ends. +/datum/antagonist/vampire/proc/on_sol_end(atom/source) + SIGNAL_HANDLER + check_end_torpor() + for(var/datum/action/cooldown/vampire/power in powers) + if(istype(power, /datum/action/cooldown/vampire/gohome)) + RemovePower(power) + +/// Cycle through all vampires and check if they're inside a closet. +/datum/antagonist/vampire/proc/handle_sol() + SIGNAL_HANDLER + if(!owner || !owner.current) + return + + if(!istype(owner.current.loc, /obj/structure)) + if(COOLDOWN_FINISHED(src, vampire_spam_sol_burn)) + if(vampire_level > 0) + to_chat(owner, "The solar flare sets your skin ablaze!") + else + to_chat(owner, "The solar flare scalds your neophyte skin!") + COOLDOWN_START(src, vampire_spam_sol_burn, VAMPIRE_SPAM_SOL) //This should happen twice per Sol + + if(owner.current.fire_stacks <= 0) + owner.current.fire_stacks = 0 + if(vampire_level > 0) + owner.current.adjust_fire_stacks(0.2 + vampire_level / 10) + owner.current.IgniteMob() + owner.current.adjustFireLoss(2 + (vampire_level / 2)) + owner.current.updatehealth() + SEND_SIGNAL(owner.current, COMSIG_ADD_MOOD_EVENT, "vampsleep", /datum/mood_event/daylight_2) + return + + if(istype(owner.current.loc, /obj/structure/closet/crate/coffin)) // Coffins offer the BEST protection + if(check_staked() && COOLDOWN_FINISHED(src, vampire_spam_sol_burn)) + to_chat(owner.current, "You are staked! Remove the offending weapon from your heart before sleeping.") + COOLDOWN_START(src, vampire_spam_sol_burn, VAMPIRE_SPAM_SOL) //This should happen twice per Sol + if(!is_in_torpor()) + check_begin_torpor(TRUE) + SEND_SIGNAL(owner.current, COMSIG_ADD_MOOD_EVENT, "vampsleep", /datum/mood_event/coffinsleep) + return + + if(COOLDOWN_FINISHED(src, vampire_spam_sol_burn)) // Closets offer SOME protection + to_chat(owner, "Your skin sizzles. [owner.current.loc] doesn't protect well against UV bombardment.") + COOLDOWN_START(src, vampire_spam_sol_burn, VAMPIRE_SPAM_SOL) //This should happen twice per Sol + owner.current.adjustFireLoss(0.5 + (vampire_level / 4)) + owner.current.updatehealth() + SEND_SIGNAL(owner.current, COMSIG_ADD_MOOD_EVENT, "vampsleep", /datum/mood_event/daylight_1) + +/datum/antagonist/vampire/proc/give_warning(atom/source, danger_level, vampire_warning_message, vassal_warning_message) + SIGNAL_HANDLER + if(!owner) + return + to_chat(owner, vampire_warning_message) + + switch(danger_level) + if(DANGER_LEVEL_FIRST_WARNING) + owner.current.playsound_local(null, 'sound/vampires/griffin_3.ogg', 50, 1) + if(DANGER_LEVEL_SECOND_WARNING) + owner.current.playsound_local(null, 'sound/vampires/griffin_5.ogg', 50, 1) + if(DANGER_LEVEL_THIRD_WARNING) + owner.current.playsound_local(null, 'sound/effects/alert.ogg', 75, 1) + if(DANGER_LEVEL_SOL_ROSE) + owner.current.playsound_local(null, 'sound/ambience/ambimystery.ogg', 75, 1) + if(DANGER_LEVEL_SOL_ENDED) + owner.current.playsound_local(null, 'sound/misc/ghosty_wind.ogg', 90, 1) + +/** + * # Torpor + * + * Torpor is what deals with the Vampire falling asleep, their healing, the effects, ect. + * This is basically what Sol is meant to do to them, but they can also trigger it manually if they wish to heal, as Burn is only healed through Torpor. + * You cannot manually exit Torpor, it is instead entered/exited by: + * + * Torpor is triggered by: + * - Being in a Coffin while Sol is on, dealt with by Sol + * - Entering a Coffin with more than 10 combined Brute/Burn damage, dealt with by /closet/crate/coffin/close() [vampire_coffin.dm] + * - Death, dealt with by /HandleDeath() + * Torpor is ended by: + * - Having less than 10 Brute damage while OUTSIDE of your Coffin while it isnt Sol. + * - Having less than 10 Brute & Burn Combined while INSIDE of your Coffin while it isnt Sol. + * - Sol being over, dealt with by /sunlight/process() [vampire_daylight.dm] +*/ +/datum/antagonist/vampire/proc/check_begin_torpor(SkipChecks = FALSE) + /// Are we entering Torpor via Sol/Death? Then entering it isnt optional! + if(SkipChecks) + torpor_begin() + return + var/mob/living/carbon/user = owner.current + var/total_brute = user.getBruteLoss_nonProsthetic() + var/total_burn = user.getFireLoss_nonProsthetic() + var/total_damage = total_brute + total_burn + /// Checks - Not daylight & Has more than 10 Brute/Burn & not already in Torpor + if(!SSsunlight.sunlight_active && total_damage >= 10 && !HAS_TRAIT_FROM(owner.current, TRAIT_NODEATH, TRAIT_TORPOR)) + torpor_begin() + +/datum/antagonist/vampire/proc/check_end_torpor() + var/mob/living/carbon/user = owner.current + var/total_brute = user.getBruteLoss_nonProsthetic() + var/total_burn = user.getFireLoss_nonProsthetic() + var/total_damage = total_brute + total_burn + if(total_burn >= 199) + return FALSE + if(SSsunlight.sunlight_active) + return FALSE + // You are in a Coffin, so instead we'll check TOTAL damage, here. + if(istype(user.loc, /obj/structure/closet/crate/coffin)) + if(total_damage <= 10) + torpor_end() + else + if(total_brute <= 10) + torpor_end() + +/datum/antagonist/vampire/proc/is_in_torpor() + if(QDELETED(owner.current)) + return FALSE + return HAS_TRAIT_FROM(owner.current, TRAIT_NODEATH, TRAIT_TORPOR) + +/datum/antagonist/vampire/proc/torpor_begin() + var/mob/living/current = owner.current + + REMOVE_TRAIT(current, TRAIT_SLEEPIMMUNE, TRAIT_VAMPIRE) + REMOVE_TRAIT(current, TRAIT_NOBREATH, TRAIT_VAMPIRE) + current.add_traits(torpor_traits, TRAIT_TORPOR) + current.jitteriness = 0 + + DisableAllPowers() + + to_chat(current, "You enter the horrible slumber of deathless Torpor. You will heal until you are renewed.") + +/datum/antagonist/vampire/proc/torpor_end() + var/mob/living/current = owner.current + current.grab_ghost() + + if(!HAS_TRAIT(current, TRAIT_MASQUERADE)) + ADD_TRAIT(current, TRAIT_SLEEPIMMUNE, TRAIT_VAMPIRE) + ADD_TRAIT(current, TRAIT_NOBREATH, TRAIT_VAMPIRE) + + current.remove_traits(torpor_traits, TRAIT_TORPOR) + if(!HAS_TRAIT(current, TRAIT_MASQUERADE)) + ADD_TRAIT(current, TRAIT_SLEEPIMMUNE, TRAIT_VAMPIRE) + + heal_vampire_organs() + + to_chat(current, "You have recovered from Torpor.") + SEND_SIGNAL(src, VAMPIRE_EXIT_TORPOR) diff --git a/code/modules/antagonists/vampire/frenzy_vampire.dm b/code/modules/antagonists/vampire/frenzy_vampire.dm new file mode 100644 index 0000000000000..521c19a4e3c9a --- /dev/null +++ b/code/modules/antagonists/vampire/frenzy_vampire.dm @@ -0,0 +1,94 @@ +/** + * # FrenzyGrab + * + * The martial art given to Vampires so they can instantly aggressively grab people. + */ +/datum/martial_art/frenzygrab + name = "Frenzy Grab" + id = MARTIALART_FRENZYGRAB + +/datum/martial_art/frenzygrab/grab_act(mob/living/user, mob/living/target) + if(user != target) + target.grabbedby(user) + target.grippedby(user, instant = TRUE) + return TRUE + return ..() + +/** + * # Status effect + * + * This is the status effect given to Vampires in a Frenzy + * This deals with everything entering/exiting Frenzy is meant to deal with. + */ + +/atom/movable/screen/alert/status_effect/frenzy + name = "Frenzy" + desc = "You are in a Frenzy! You are entirely Feral and, depending on your Clan, fighting for your life!" + icon_state = "frenzy" + alerttooltipstyle = "cult" + +/datum/status_effect/frenzy + id = "Frenzy" + status_type = STATUS_EFFECT_UNIQUE + duration = -1 + tick_interval = 10 + alert_type = /atom/movable/screen/alert/status_effect/frenzy + ///Boolean on whether they were an AdvancedToolUser, to give the trait back upon exiting. + var/was_tooluser = FALSE + /// The stored Vampire antag datum + var/datum/antagonist/vampire/vampiredatum + +/datum/status_effect/frenzy/get_examine_text() + return "They seem... inhumane, and feral!" + +/atom/movable/screen/alert/status_effect/masquerade/MouseEntered(location,control,params) + desc = initial(desc) + return ..() + +/datum/status_effect/frenzy/on_apply() + var/mob/living/carbon/human/user = owner + vampiredatum = IS_VAMPIRE(user) + + // Disable ALL Powers and notify their entry + vampiredatum.DisableAllPowers(forced = TRUE) + to_chat(owner, "BLOOD! YOU NEED BLOOD NOW!") + to_chat(owner, "* Vampire Tip: While in Frenzy, you instantly Aggresively grab, have stun resistance, cannot speak, hear, or use any powers outside of Feed and Trespass (If you have it).") + owner.balloon_alert(owner, "you enter a frenzy!") + SEND_SIGNAL(vampiredatum, VAMPIRE_ENTERS_FRENZY) + + // Give the other Frenzy effects + ADD_TRAIT(owner, TRAIT_MUTE, TRAIT_FRENZY) + ADD_TRAIT(owner, TRAIT_DEAF, TRAIT_FRENZY) + if(!HAS_TRAIT(owner, TRAIT_DISCOORDINATED)) + was_tooluser = TRUE + ADD_TRAIT(owner, TRAIT_DISCOORDINATED, TRAIT_FRENZY) + + owner.add_movespeed_modifier(/datum/movespeed_modifier/dna_vault_speedup) + owner.add_client_colour(/datum/client_colour/cursed_heart_blood) + vampiredatum.frenzygrab.teach(user, TRUE) + user.Jitter(60 SECONDS) + user.uncuff() + vampiredatum.frenzied = TRUE + return ..() + +/datum/status_effect/frenzy/on_remove() + var/mob/living/carbon/human/user = owner + owner.balloon_alert(owner, "you come back to your senses.") + REMOVE_TRAIT(owner, TRAIT_MUTE, TRAIT_FRENZY) + REMOVE_TRAIT(owner, TRAIT_DEAF, TRAIT_FRENZY) + if(was_tooluser) + REMOVE_TRAIT(owner, TRAIT_DISCOORDINATED, TRAIT_FRENZY) + was_tooluser = FALSE + owner.remove_movespeed_modifier(/datum/movespeed_modifier/dna_vault_speedup) + vampiredatum.frenzygrab.remove(user) + owner.remove_client_colour(/datum/client_colour/cursed_heart_blood) + + SEND_SIGNAL(vampiredatum, VAMPIRE_EXITS_FRENZY) + vampiredatum.frenzied = FALSE + return ..() + +/datum/status_effect/frenzy/tick() + var/mob/living/carbon/human/user = owner + if(!vampiredatum?.frenzied) + return + user.adjustFireLoss(1.5) diff --git a/code/modules/antagonists/vampire/life_vampire.dm b/code/modules/antagonists/vampire/life_vampire.dm new file mode 100644 index 0000000000000..dc8aaeb9df2a3 --- /dev/null +++ b/code/modules/antagonists/vampire/life_vampire.dm @@ -0,0 +1,333 @@ +///How much Blood it costs to live. +#define VAMPIRE_PASSIVE_BLOOD_DRAIN 0.1 + +/// Runs from COMSIG_LIVING_LIFE, handles Vampire constant proccesses. +/datum/antagonist/vampire/proc/LifeTick(mob/living/source, seconds_per_tick, times_fired) + SIGNAL_HANDLER + + if(isbrain(owner.current)) + return + if(HAS_TRAIT(owner.current, TRAIT_NODEATH)) + check_end_torpor() + // Deduct Blood + if(owner.current.stat == CONSCIOUS && !HAS_TRAIT(owner.current, TRAIT_IMMOBILIZED) && !HAS_TRAIT(owner.current, TRAIT_NODEATH)) + INVOKE_ASYNC(src, PROC_REF(AddBloodVolume), -VAMPIRE_PASSIVE_BLOOD_DRAIN) + if(handle_healing()) + if((COOLDOWN_FINISHED(src, vampire_spam_healing)) && vampire_blood_volume > 0) + to_chat(owner.current, "The power of your blood knits your wounds...") + COOLDOWN_START(src, vampire_spam_healing, VAMPIRE_SPAM_HEALING) + // Standard Updates + SEND_SIGNAL(src, COMSIG_VAMPIRE_ON_LIFETICK) + INVOKE_ASYNC(src, PROC_REF(HandleStarving)) + INVOKE_ASYNC(src, PROC_REF(update_blood)) + + INVOKE_ASYNC(src, PROC_REF(update_hud)) + +/** + * ## BLOOD STUFF + */ +/datum/antagonist/vampire/proc/AddBloodVolume(value) + vampire_blood_volume = clamp(vampire_blood_volume + value, 0, max_blood_volume) + +/// mult: SILENT feed is 1/3 the amount +/datum/antagonist/vampire/proc/handle_feeding(mob/living/carbon/target, mult=1, power_level) + // Starts at 15 (now 8 since we doubled the Feed time) + var/feed_amount = 15 + (power_level * 2) + var/blood_taken = min(feed_amount, target.blood_volume) * mult + target.blood_volume -= blood_taken + + /////////// + // Shift Body Temp (toward Target's temp, by volume taken) + owner.current.bodytemperature = ((vampire_blood_volume * owner.current.bodytemperature) + (blood_taken * target.bodytemperature)) / (vampire_blood_volume + blood_taken) + // our volume * temp, + their volume * temp, / total volume + /////////// + // Reduce Value Quantity + if(target.stat == DEAD) // Penalty for Dead Blood + blood_taken /= 3 + if(!ishuman(target)) // Penalty for Non-Human Blood + blood_taken /= 2 + //if (!iscarbon(target)) // Penalty for Animals (they're junk food) + // Apply to Volume + AddBloodVolume(blood_taken) + // Reagents (NOT Blood!) + if(target.reagents && target.reagents.total_volume) + target.reagents.trans_to(owner.current, INGEST, 1) // Run transfer of 1 unit of reagent from them to me. + owner.current.playsound_local(null, 'sound/effects/singlebeat.ogg', 40, 1) // Play THIS sound for user only. The "null" is where turf would go if a location was needed. Null puts it right in their head. + total_blood_drank += blood_taken + return blood_taken + +/** + * ## HEALING + */ + +/// Constantly runs on Vampire's LifeTick, and is increased by being in Torpor/Coffins +/datum/antagonist/vampire/proc/handle_healing(mult = 1) + if(QDELETED(owner?.current)) + return + var/in_torpor = is_in_torpor() + // Don't heal if I'm staked or on Masquerade (+ not in a Coffin). Masqueraded Vampires in a Coffin however, will heal. + if(check_staked()) + return FALSE + if(!in_torpor && HAS_TRAIT(owner.current, TRAIT_MASQUERADE)) + return FALSE + var/actual_regen = vampire_regen_rate + additional_regen + owner.current.adjustCloneLoss(-1 * (actual_regen * 4) * mult) + owner.current.adjustOrganLoss(ORGAN_SLOT_BRAIN, -1 * (actual_regen * 4) * mult) //adjustBrainLoss(-1 * (actual_regen * 4) * mult, 0) + if(!iscarbon(owner.current)) // Damage Heal: Do I have damage to ANY bodypart? + return + var/mob/living/carbon/user = owner.current + var/costMult = 1 // Coffin makes it cheaper + var/bruteheal = min(user.getBruteLoss_nonProsthetic(), actual_regen) // BRUTE: Always Heal + var/fireheal = 0 // BURN: Heal in Coffin while Fakedeath, or when damage above maxhealth (you can never fully heal fire) + // Checks if you're in torpor here, additionally checks if you're in a coffin right below it. + if(in_torpor) + if(istype(user.loc, /obj/structure/closet/crate/coffin)) + if(HAS_TRAIT(owner.current, TRAIT_MASQUERADE) && (COOLDOWN_FINISHED(src, vampire_spam_healing))) + to_chat(user, "You do not heal while your Masquerade ability is active.") + COOLDOWN_START(src, vampire_spam_healing, VAMPIRE_SPAM_MASQUERADE) + return + fireheal = min(user.getFireLoss_nonProsthetic(), actual_regen) + mult *= 5 // Increase multiplier if we're sleeping in a coffin. + costMult /= 2 // Decrease cost if we're sleeping in a coffin. + user.ExtinguishMob() + user.remove_all_embedded_objects() // Remove Embedded! + if(check_limbs(costMult)) + return TRUE + // In Torpor, but not in a Coffin? Heal faster anyways. + else + fireheal = min(user.getFireLoss_nonProsthetic(), actual_regen) / 1.2 // 20% slower than being in a coffin + mult *= 3 + // Heal if Damaged + if((bruteheal + fireheal > 0) && mult > 0) // Just a check? Don't heal/spend, and return. + // We have damage. Let's heal (one time) + user.heal_overall_damage(brute = bruteheal * mult, burn = fireheal * mult) // Heal BRUTE / BURN in random portions throughout the body. + AddBloodVolume(((bruteheal * -0.5) + (fireheal * -1)) * costMult * mult) // Costs blood to heal + return TRUE + +/datum/antagonist/vampire/proc/check_limbs(costMult = 1) + var/limb_regen_cost = 50 * -costMult + var/mob/living/carbon/user = owner.current + var/list/missing = user.get_missing_limbs() + if(missing.len && (vampire_blood_volume < limb_regen_cost + 5)) + return FALSE + for(var/missing_limb in missing) //Find ONE Limb and regenerate it. + user.regenerate_limb(missing_limb, FALSE) + AddBloodVolume(-limb_regen_cost) + var/obj/item/bodypart/missing_bodypart = user.get_bodypart(missing_limb) // 2) Limb returns Damaged + missing_bodypart.brute_dam = 60 + to_chat(user, "Your flesh knits as it regrows your [missing_bodypart]!") + playsound(user, 'sound/magic/demon_consume.ogg', 50, TRUE) + return TRUE + +/* + * # Heal Vampire Organs + * + * This is used by Vampires, these are the steps of this proc: + * Step 1 - Cure husking and Regenerate organs. regenerate_organs() removes their Vampire Heart & Eye augments, which leads us to... + * Step 2 - Repair any (shouldn't be possible) Organ damage, then return their Vampiric Heart & Eye benefits. + * Step 3 - Revive them, clear all wounds, remove any Tumors (If any). + * + * This is called on Vampire's Assign, and when they end Torpor. + */ + +/datum/antagonist/vampire/proc/heal_vampire_organs() + var/mob/living/carbon/user = owner.current + + user.cure_husk() + user.regenerate_organs() + + for(var/obj/item/organ/organ as anything in user.internal_organs) + organ.setOrganDamage(0) + if(!HAS_TRAIT(user, TRAIT_MASQUERADE)) + var/obj/item/organ/heart/current_heart = user.getorganslot(ORGAN_SLOT_HEART) + current_heart?.Stop() + // Eyes + var/obj/item/organ/eyes/current_eyes = user.getorganslot(ORGAN_SLOT_EYES) + current_eyes?.flash_protect = max(initial(current_eyes.flash_protect) - 1, - 1) + current_eyes?.sight_flags = SEE_MOBS + current_eyes?.see_in_dark = NIGHTVISION_FOV_RANGE + current_eyes?.lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE + user.update_sight() + + if(user.stat == DEAD) + user.revive() + // From [powers/panacea.dm] + var/list/bad_organs = list( + user.getorgan(/obj/item/organ/body_egg), + user.getorgan(/obj/item/organ/zombie_infection)) + for(var/tumors in bad_organs) + var/obj/item/organ/yucky_organs = tumors + if(!istype(yucky_organs)) + continue + yucky_organs.Remove(user) + yucky_organs.forceMove(get_turf(user)) + + user.adjustOxyLoss(-200) + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +// DEATH + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/datum/antagonist/vampire/proc/on_death(mob/living/source, gibbed) + SIGNAL_HANDLER + + if(source.stat != DEAD) // weirdness shield + return + if(gibbed) + INVOKE_ASYNC(src, PROC_REF(final_death)) + return + + RegisterSignal(owner.current, COMSIG_LIVING_REVIVE, PROC_REF(on_revive)) + RegisterSignal(src, COMSIG_VAMPIRE_ON_LIFETICK, PROC_REF(handle_death)) + +/datum/antagonist/vampire/proc/on_revive() + SIGNAL_HANDLER + + UnregisterSignal(owner.current, COMSIG_LIVING_REVIVE) + UnregisterSignal(src, COMSIG_VAMPIRE_ON_LIFETICK) + +/datum/antagonist/vampire/proc/handle_death() + var/static/handling_death = FALSE + if(handling_death) + return + handling_death = TRUE + do_handle_death() + handling_death = FALSE + +/// FINAL DEATH. +/// Don't call this directly, use handle_death(). +/datum/antagonist/vampire/proc/do_handle_death() + // Not "Alive"? + if(QDELETED(owner.current)) + final_death() + return + // Fire Damage? (above double health) + if(owner.current.getFireLoss() >= (owner.current.maxHealth * 2.5)) + final_death() + return + // Staked while "Temp Death" or Asleep + if(can_stake_kill() && check_staked()) + final_death() + return + // Temporary Death? Convert to Torpor. + if(is_in_torpor()) + return + to_chat(owner.current, "Your immortal body will not yet relinquish your soul to the abyss. You enter Torpor.") + check_begin_torpor(TRUE) + +/datum/antagonist/vampire/proc/HandleStarving() // I am thirsty for blood! + // Nutrition - The amount of blood is how full we are. + owner.current.set_nutrition(min(vampire_blood_volume, NUTRITION_LEVEL_FED)) + + // BLOOD_VOLUME_GOOD: [336] - Pale + // handled in vampire_integration.dm + + // BLOOD_VOLUME_EXIT: [250] - Exit Frenzy (If in one) This is high because we want enough to kill the poor soul they feed off of. + if(vampire_blood_volume >= FRENZY_THRESHOLD_EXIT && frenzied) + owner.current.remove_status_effect(/datum/status_effect/frenzy) + // BLOOD_VOLUME_BAD: [224] - Jitter + if(vampire_blood_volume < BLOOD_VOLUME_BAD && prob(0.5) && !HAS_TRAIT(owner.current, TRAIT_NODEATH) && !HAS_TRAIT(owner.current, TRAIT_MASQUERADE)) + owner.current.jitteriness = 3 SECONDS + // BLOOD_VOLUME_SURVIVE: [122] - Blur Vision + if(vampire_blood_volume < BLOOD_VOLUME_SURVIVE) + owner.current.set_blurriness((8 - 8 * (vampire_blood_volume / BLOOD_VOLUME_BAD))*2 SECONDS) + + // The more blood, the better the Regeneration, get too low blood, and you enter Frenzy. + if(vampire_blood_volume < FRENZY_THRESHOLD_ENTER && !frenzied) + owner.current.apply_status_effect(/datum/status_effect/frenzy) + else if(vampire_blood_volume < BLOOD_VOLUME_BAD) + additional_regen = 0.1 + else if(vampire_blood_volume < BLOOD_VOLUME_OKAY) + additional_regen = 0.2 + else if(vampire_blood_volume < BLOOD_VOLUME_NORMAL) + additional_regen = 0.3 + else if(vampire_blood_volume < BS_BLOOD_VOLUME_MAX_REGEN) + additional_regen = 0.4 + else + additional_regen = 0.5 + +/// Makes your blood_volume look like your vampire blood, unless you're Masquerading. +/datum/antagonist/vampire/proc/update_blood() + if(HAS_TRAIT(owner.current, TRAIT_NO_BLOOD)) + return + //If we're on Masquerade, we appear to have full blood, unless we are REALLY low, in which case we don't look as bad. + if(HAS_TRAIT(owner.current, TRAIT_MASQUERADE)) + switch(vampire_blood_volume) + if(BLOOD_VOLUME_OKAY to INFINITY) // 336 and up, we are perfectly fine. + owner.current.blood_volume = initial(vampire_blood_volume) + if(BLOOD_VOLUME_BAD to BLOOD_VOLUME_OKAY) // 224 to 336 + owner.current.blood_volume = BLOOD_VOLUME_SAFE + else // 224 and below + owner.current.blood_volume = BLOOD_VOLUME_OKAY + return + + owner.current.blood_volume = vampire_blood_volume + +/// Gibs the Vampire, roundremoving them. +/datum/antagonist/vampire/proc/final_death() + if(has_succumb_to_final_death) + return + has_succumb_to_final_death = TRUE + + var/mob/living/carbon/user = owner.current + + // Free vassals + for(var/datum/antagonist/vassal/vassal in vassals) + if(vassal.special_type == REVENGE_VASSAL) + continue + var/datum/antagonist/ex_vassal/ex_vassal = new() + ex_vassal.vampire_team = vampire_team + vassal.owner.add_antag_datum(ex_vassal) + + vassal.owner.remove_antag_datum(/datum/antagonist/vassal) + + // If we have no body, end here. + if(!user) + return + UnregisterSignal(src, list( + COMSIG_VAMPIRE_ON_LIFETICK, + COMSIG_LIVING_REVIVE, + COMSIG_LIVING_LIFE, + COMSIG_LIVING_DEATH, + )) + UnregisterSignal(SSsunlight, list( + COMSIG_SOL_RANKUP_VAMPIRES, + COMSIG_SOL_NEAR_START, + COMSIG_SOL_END, + COMSIG_SOL_RISE_TICK, + COMSIG_SOL_WARNING_GIVEN, + )) + + DisableAllPowers(forced = TRUE) + if(!iscarbon(user)) + user.gib(TRUE, FALSE, FALSE) + return + // Drop anything in us and play a tune + user.drop_all_held_items() + user.unequip_everything() + user.remove_all_embedded_objects() + playsound(user, 'sound/effects/tendril_destroyed.ogg', 40, TRUE) + + var/unique_death = SEND_SIGNAL(src, VAMPIRE_FINAL_DEATH) + if(unique_death & DONT_DUST) + return + + // Elders get dusted, Fledglings get gibbed. + if(vampire_level >= 4) + user.visible_message( + "[user]'s skin crackles and dries, their skin and bones withering to dust. A hollow cry whips from what is now a sandy pile of remains.", + "Your soul escapes your withering body as the abyss welcomes you to your Final Death.", + "You hear a dry, crackling sound.", + ) + addtimer(CALLBACK(user, TYPE_PROC_REF(/mob/living, dust)), 5 SECONDS, TIMER_UNIQUE|TIMER_STOPPABLE) + return + + user.visible_message( + "[user]'s skin bursts forth in a spray of gore and detritus. A horrible cry echoes from what is now a wet pile of decaying meat.", + "Your soul escapes your withering body as the abyss welcomes you to your Final Death.", + "You hear a wet, bursting sound.", + ) + addtimer(CALLBACK(user, TYPE_PROC_REF(/mob/living, gib), TRUE, FALSE, FALSE), 2 SECONDS, TIMER_UNIQUE|TIMER_STOPPABLE) + +#undef VAMPIRE_PASSIVE_BLOOD_DRAIN diff --git a/code/modules/antagonists/vampire/misc_procs_vampire.dm b/code/modules/antagonists/vampire/misc_procs_vampire.dm new file mode 100644 index 0000000000000..fbe50080c6dd9 --- /dev/null +++ b/code/modules/antagonists/vampire/misc_procs_vampire.dm @@ -0,0 +1,137 @@ +///Called when a Vampire buys a power: (power) +/datum/antagonist/vampire/proc/BuyPower(datum/action/cooldown/vampire/power) + for(var/datum/action/cooldown/vampire/current_powers as anything in powers) + if(current_powers.type == power.type) + return FALSE + powers += power + + power.Grant(owner.current) + log_game("[key_name(owner.current)] purchased [power].") + return TRUE + +///Called when a Vampire loses a power: (power) +/datum/antagonist/vampire/proc/RemovePower(datum/action/cooldown/vampire/power) + if(power.active) + power.DeactivatePower() + powers -= power + power.Remove(owner.current) + +///When a Vampire breaks the Masquerade, they get their HUD icon changed, and Malkavian Vampires get alerted. +/datum/antagonist/vampire/proc/break_masquerade(mob/admin) + if(broke_masquerade) + return + + owner.current.playsound_local(null, 'sound/vampires/lunge_warn.ogg', 100, FALSE, pressure_affected = FALSE) + to_chat(owner.current, "You have broken the Masquerade!") + to_chat(owner.current, "Vampire Tip: When you break the Masquerade, you become open for termination by fellow Vampires, and your Vassals are no longer completely loyal to you, as other Vampires can steal them for themselves!") + broke_masquerade = TRUE + set_antag_hud(owner.current, "masquerade_broken") + SEND_GLOBAL_SIGNAL(COMSIG_VAMPIRE_BROKE_MASQUERADE, src) + +///This is admin-only of reverting a broken masquerade, sadly it doesn't remove the Malkavian objectives yet. +/datum/antagonist/vampire/proc/fix_masquerade(mob/admin) + if(!broke_masquerade) + return + set_antag_hud(owner.current, "vampire") + to_chat(owner.current, "You have re-entered the Masquerade.") + broke_masquerade = FALSE + +/datum/antagonist/vampire/proc/give_masquerade_infraction() + if(broke_masquerade) + return + masquerade_infractions++ + if(masquerade_infractions >= 3) + break_masquerade() + else + to_chat(owner.current, "You violated the Masquerade! Break the Masquerade [3 - masquerade_infractions] more times and you will become a criminal to the Vampire's Cause!") + +/datum/antagonist/vampire/proc/RankUp() + if(!owner || !owner.current || IS_FAVORITE_VASSAL(owner.current)) + return + vampire_level_unspent++ + if(!my_clan) + to_chat(owner.current, "You have gained a rank. Join a Clan to spend it.") + return + // Spend Rank Immediately? + if(!istype(owner.current.loc, /obj/structure/closet/crate/coffin)) + to_chat(owner, "You have grown more ancient! Sleep in a coffin that you have claimed to thicken your blood and become more powerful[istype(my_clan, /datum/vampire_clan/ventrue) ? ", or put your Favorite Vassal on a persuasion rack to level them up" : ""]") + return + SpendRank() + +/datum/antagonist/vampire/proc/RankDown() + vampire_level_unspent-- + +/datum/antagonist/vampire/proc/remove_nondefault_powers(return_levels = FALSE) + for(var/datum/action/cooldown/vampire/power as anything in powers) + if(power.purchase_flags & VAMPIRE_DEFAULT_POWER) + continue + RemovePower(power) + if(return_levels) + vampire_level_unspent++ + +/datum/antagonist/vampire/proc/LevelUpPowers() + for(var/datum/action/cooldown/vampire/power as anything in powers) + if(power.purchase_flags & TREMERE_CAN_BUY) + continue + power.upgrade_power() + +///Disables all powers, accounting for torpor +/datum/antagonist/vampire/proc/DisableAllPowers(forced = FALSE) + for(var/datum/action/cooldown/vampire/power as anything in powers) + if(forced || ((power.check_flags & BP_CANT_USE_IN_TORPOR) && HAS_TRAIT(owner.current, TRAIT_NODEATH))) + if(power.active) + power.DeactivatePower() + +/datum/antagonist/vampire/proc/SpendRank(mob/living/carbon/human/target, cost_rank = TRUE, blood_cost) + if(!owner || !owner.current || !owner.current.client || (cost_rank && vampire_level_unspent <= 0)) + return + SEND_SIGNAL(src, VAMPIRE_RANK_UP, target, cost_rank, blood_cost) + +/// Do I have a stake in my heart? +/datum/antagonist/vampire/proc/check_staked() + var/obj/item/bodypart/chosen_bodypart = owner.current.get_bodypart(BODY_ZONE_CHEST) + if(!chosen_bodypart) + return FALSE + for(var/obj/item/embedded_stake in chosen_bodypart.embedded_objects) + if(istype(embedded_stake, /obj/item/stake)) + return TRUE + return FALSE + +/// You can't go to sleep in a coffin with a stake in you. +/datum/antagonist/vampire/proc/can_stake_kill() + if(owner.current.IsSleeping()) + return TRUE + if(owner.current.stat >= UNCONSCIOUS) + return TRUE + if(HAS_TRAIT(owner.current, TRAIT_TORPOR)) + return TRUE + return FALSE + +/** + * CARBON INTEGRATION + * + * All overrides of mob/living and mob/living/carbon + */ +/// Brute +/mob/living/proc/getBruteLoss_nonProsthetic() + return getBruteLoss() + +/mob/living/carbon/getBruteLoss_nonProsthetic() + var/amount = 0 + for(var/obj/item/bodypart/chosen_bodypart as anything in bodyparts) + if(!IS_ORGANIC_LIMB(chosen_bodypart)) + continue + amount += chosen_bodypart.brute_dam + return amount + +/// Burn +/mob/living/proc/getFireLoss_nonProsthetic() + return getFireLoss() + +/mob/living/carbon/getFireLoss_nonProsthetic() + var/amount = 0 + for(var/obj/item/bodypart/chosen_bodypart as anything in bodyparts) + if(!IS_ORGANIC_LIMB(chosen_bodypart)) + continue + amount += chosen_bodypart.burn_dam + return amount diff --git a/code/modules/antagonists/vampire/moodlets_vampire.dm b/code/modules/antagonists/vampire/moodlets_vampire.dm new file mode 100644 index 0000000000000..fc3dd48d3938e --- /dev/null +++ b/code/modules/antagonists/vampire/moodlets_vampire.dm @@ -0,0 +1,50 @@ +/datum/mood_event/drankblood + description = "I have fed greedly from that which nourishes me.\n" + mood_change = 10 + timeout = 8 MINUTES + +/datum/mood_event/drankblood_bad + description = "I drank the blood of a lesser creature. Disgusting.\n" + mood_change = -4 + timeout = 3 MINUTES + +/datum/mood_event/drankblood_dead + description = "I drank dead blood. I am better than this.\n" + mood_change = -7 + timeout = 8 MINUTES + +/datum/mood_event/drankblood_synth + description = "I drank synthetic blood. What is wrong with me?\n" + mood_change = -7 + timeout = 8 MINUTES + +/datum/mood_event/drankkilled + description = "I fed off of a dead person. I feel... inhuman.\n" + mood_change = -15 + timeout = 10 MINUTES + +/datum/mood_event/madevamp + description = "A mortal has reached the undeath- by my own hand.\n" + mood_change = 15 + timeout = 20 MINUTES + +/datum/mood_event/coffinsleep + description = "I slept in a coffin during the day. I feel whole again.\n" + mood_change = 10 + timeout = 6 MINUTES + +/datum/mood_event/daylight_1 + description = "I slept poorly in a makeshift coffin during the day.\n" + mood_change = -3 + timeout = 6 MINUTES + +/datum/mood_event/daylight_2 + description = "I have been scorched by the unforgiving rays of the sun.\n" + mood_change = -6 + timeout = 6 MINUTES + +///Candelabrum's mood event to non Vampire/Vassals +/datum/mood_event/vampcandle + description = "Something is making your mind feel... loose.\n" + mood_change = -15 + timeout = 5 MINUTES diff --git a/code/modules/antagonists/vampire/names_vampire.dm b/code/modules/antagonists/vampire/names_vampire.dm new file mode 100644 index 0000000000000..4d3dbe9e02d0b --- /dev/null +++ b/code/modules/antagonists/vampire/names_vampire.dm @@ -0,0 +1,135 @@ +/datum/antagonist/vampire/proc/return_full_name() + var/fullname = vampire_name ? vampire_name : owner.current.name + if(vampire_title) + fullname = "[vampire_title] [fullname]" + if(vampire_reputation) + fullname += " the [vampire_reputation]" + + return fullname + +///Returns a First name for the Vampire. +/datum/antagonist/vampire/proc/SelectFirstName() + if(owner.current.gender == MALE) + vampire_name = pick( + "Desmond","Rudolph","Dracula","Vlad","Pyotr","Gregor", + "Cristian","Christoff","Marcu","Andrei","Constantin", + "Gheorghe","Grigore","Ilie","Iacob","Luca","Mihail","Pavel", + "Vasile","Octavian","Sorin","Sveyn","Aurel","Alexe","Iustin", + "Theodor","Dimitrie","Octav","Damien","Magnus","Caine","Abel", // Romanian/Ancient + "Lucius","Gaius","Otho","Balbinus","Arcadius","Romanos","Alexios","Vitellius", // Latin + "Melanthus","Teuthras","Orchamus","Amyntor","Axion", // Greek + "Thoth","Thutmose","Osorkon,","Nofret","Minmotu","Khafra", // Egyptian + "Dio", + ) + else + vampire_name = pick( + "Islana","Tyrra","Greganna","Pytra","Hilda", + "Andra","Crina","Viorela","Viorica","Anemona", + "Camelia","Narcisa","Sorina","Alessia","Sophia", + "Gladda","Arcana","Morgan","Lasarra","Ioana","Elena", + "Alina","Rodica","Teodora","Denisa","Mihaela", + "Svetla","Stefania","Diyana","Kelssa","Lilith", // Romanian/Ancient + "Alexia","Athanasia","Callista","Karena","Nephele","Scylla","Ursa", // Latin + "Alcestis","Damaris","Elisavet","Khthonia","Teodora", // Greek + "Nefret","Ankhesenpep", // Egyptian + ) + +///Returns a Title for the Vampire. +/datum/antagonist/vampire/proc/SelectTitle(am_fledgling = 0, forced = FALSE) + // Already have Title + if(!forced && vampire_title != null) + return + // Titles [Master] + if(am_fledgling) + vampire_title = null + return + if(owner.current.gender == MALE) + vampire_title = pick( + "Count", + "Baron", + "Viscount", + "Prince", + "Duke", + "Tzar", + "Dreadlord", + "Lord", + "Master", + ) + else + vampire_title = pick( + "Countess", + "Baroness", + "Viscountess", + "Princess", + "Duchess", + "Tzarina", + "Dreadlady", + "Lady", + "Mistress", + ) + to_chat(owner, "You have earned a title! You are now known as [return_full_name()]!") + +///Returns a Reputation for the Vampire. +/datum/antagonist/vampire/proc/SelectReputation(am_fledgling = FALSE, forced = FALSE) + // Already have Reputation + if(!forced && vampire_reputation != null) + return + + if(am_fledgling) + vampire_reputation = pick( + "Crude", + "Callow", + "Unlearned", + "Neophyte", + "Novice", + "Unseasoned", + "Fledgling", + "Young", + "Neonate", + "Scrapling", + "Untested", + "Unproven", + "Unknown", + "Newly Risen", + "Born", + "Scavenger", + "Unknowing", + "Unspoiled", + "Disgraced", + "Defrocked", + "Shamed", + "Meek", + "Timid", + "Broken", + "Fresh", + ) + else if(owner.current.gender == MALE && prob(10)) + vampire_reputation = pick( + "King of the Damned", + "Blood King", + "Emperor of Blades", + "Sinlord", + "God-King", + ) + else if(owner.current.gender == FEMALE && prob(10)) + vampire_reputation = pick( + "Queen of the Damned", + "Blood Queen", + "Empress of Blades", + "Sinlady", + "God-Queen", + ) + else + vampire_reputation = pick( + "Butcher","Blood Fiend","Crimson","Red","Black","Terror", + "Nightman","Feared","Ravenous","Fiend","Malevolent","Wicked", + "Ancient","Plaguebringer","Sinister","Forgotten","Wretched","Baleful", + "Inqisitor","Harvester","Reviled","Robust","Betrayer","Destructor", + "Damned","Accursed","Terrible","Vicious","Profane","Vile", + "Depraved","Foul","Slayer","Manslayer","Sovereign","Slaughterer", + "Forsaken","Mad","Dragon","Savage","Villainous","Nefarious", + "Inquisitor","Marauder","Horrible","Immortal","Undying","Overlord", + "Corrupt","Hellspawn","Tyrant","Sanguineous", + ) + + to_chat(owner, "You have earned a reputation! You are now known as [return_full_name()]!") diff --git a/code/modules/antagonists/vampire/objectives_vampire.dm b/code/modules/antagonists/vampire/objectives_vampire.dm new file mode 100644 index 0000000000000..c4bba1abe030f --- /dev/null +++ b/code/modules/antagonists/vampire/objectives_vampire.dm @@ -0,0 +1,326 @@ +/datum/objective/vampire + martyr_compatible = TRUE + +// GENERATE +/datum/objective/vampire/New() + update_explanation_text() + ..() + +////////////////////////////////////////////////////////////////////////////// +// // PROCS // // + +/// Look at all crew members, and for/loop through. +/datum/objective/vampire/proc/return_possible_targets() + var/list/possible_targets = list() + for(var/datum/mind/possible_target in get_crewmember_minds()) + // Check One: Default Valid User + if(possible_target != owner && ishuman(possible_target.current) && possible_target.current.stat != DEAD) + // Check Two: Am Vampire? + if(IS_VAMPIRE(possible_target.current)) + continue + possible_targets += possible_target + + return possible_targets + +/// Check Vassals and get their occupations +/datum/objective/vampire/proc/get_vassal_occupations() + var/datum/antagonist/vampire/vampiredatum = owner.has_antag_datum(/datum/antagonist/vampire) + if(!length(vampiredatum?.vassals)) + return FALSE + var/list/all_vassal_jobs = list() + var/vassal_job + for(var/datum/antagonist/vassal/vampire_vassals in vampiredatum.vassals) + if(!vampire_vassals || !vampire_vassals.owner) // Must exist somewhere, and as a vassal. + continue + // Mind Assigned + if(vampire_vassals.owner?.assigned_role) + vassal_job = vampire_vassals.owner.assigned_role + // Mob Assigned + else if(vampire_vassals.owner?.current?.job) + vassal_job = SSjob.GetJob(vampire_vassals.owner.current.job) + // PDA Assigned + else if(vampire_vassals.owner?.current && ishuman(vampire_vassals.owner.current)) + var/mob/living/carbon/human/vassal = vampire_vassals.owner.current + vassal_job = SSjob.GetJob(vassal.get_assignment()) + if(vassal_job) + all_vassal_jobs += vassal_job + return all_vassal_jobs + +////////////////////////////////////////////////////////////////////////////////////// +// // OBJECTIVES // // +////////////////////////////////////////////////////////////////////////////////////// + +////////////////////////////// +// DEFAULT OBJECTIVES // +////////////////////////////// + +/datum/objective/vampire/lair + name = "claimlair" + +// EXPLANATION +/datum/objective/vampire/lair/update_explanation_text() + explanation_text = "Create a lair by claiming a coffin, and protect it until the end of the shift."// Make sure to keep it safe!" + +// WIN CONDITIONS? +/datum/objective/vampire/lair/check_completion() + var/datum/antagonist/vampire/vampiredatum = owner.has_antag_datum(/datum/antagonist/vampire) + if(vampiredatum && vampiredatum.coffin && vampiredatum.vampire_lair_area) + return TRUE + return FALSE + +/// Space_Station_13_areas.dm <--- all the areas + +////////////////////////////////////////////////////////////////////////////////////// + +/datum/objective/survive/vampire + name = "vampiresurvive" + explanation_text = "Survive the entire shift without succumbing to Final Death." + +// WIN CONDITIONS? +// Handled by parent + +////////////////////////////////////////////////////////////////////////////////////// + + +/// Vassalize a certain person / people +/datum/objective/vampire/conversion + name = "vassalization" + +///////////////////////////////// + +// Vassalize a head of staff +/datum/objective/vampire/conversion/command + name = "vassalizationcommand" + explanation_text = "Guarantee a Vassal ends up as a Department Head or in a Leadership role." + target_amount = 1 + +// WIN CONDITIONS? +/datum/objective/vampire/conversion/command/check_completion() + var/list/vassal_jobs = get_vassal_occupations() + for(var/datum/job/checked_job in vassal_jobs) + if(checked_job.departments & DEPT_BITFLAG_COM) + return TRUE // We only need one, so we stop as soon as we get a match + return FALSE + +///////////////////////////////// + +// Vassalize crewmates in a department +/datum/objective/vampire/conversion/department + name = "vassalize department" + + ///The selected department we have to vassalize. + var/target_department + ///List of all departments that can be selected for the objective. + var/static/list/possible_departments = list( + "engineering" = DEPT_BITFLAG_ENG, + "medical" = DEPT_BITFLAG_MED, + "science" = DEPT_BITFLAG_SCI, + "cargo" = DEPT_BITFLAG_CAR, + "service" = DEPT_BITFLAG_SRV, + ) + + +// GENERATE! +/datum/objective/vampire/conversion/department/New() + target_department = pick(possible_departments) + target_amount = rand(2, 3) + return ..() + +// EXPLANATION +/datum/objective/vampire/conversion/department/update_explanation_text() + explanation_text = "Have [target_amount] Vassal[target_amount == 1 ? "" : "s"] in the [target_department] department." + return ..() + +// WIN CONDITIONS? +/datum/objective/vampire/conversion/department/check_completion() + var/list/vassal_jobs = get_vassal_occupations() + var/converted_count = 0 + for(var/datum/job/checked_job in vassal_jobs) + if(checked_job.departments & target_department) + converted_count++ + if(converted_count >= target_amount) + return TRUE + return FALSE + + /** + * # IMPORTANT NOTE!! + * + * Look for Job Values on mobs! This is assigned at the start, but COULD be changed via the HoP + * ALSO - Search through all jobs (look for prefs earlier that look for all jobs, and search through all jobs to see if their head matches the head listed, or it IS the head) + * ALSO - registered_account in _vending.dm for banks, and assigning new ones. + */ + +////////////////////////////////////////////////////////////////////////////////////// + +// NOTE: Look up /steal in objective.dm for inspiration. +/// Steal hearts. You just really wanna have some hearts. +/datum/objective/vampire/heartthief + name = "heartthief" + +// GENERATE! +/datum/objective/vampire/heartthief/New() + target_amount = rand(2,3) + ..() + +// EXPLANATION +/datum/objective/vampire/heartthief/update_explanation_text() + . = ..() + explanation_text = "Steal and keep [target_amount] organic heart\s." + +// WIN CONDITIONS? +/datum/objective/vampire/heartthief/check_completion() + if(!owner.current) + return FALSE + + var/list/all_items = owner.current.get_contents() + var/heart_count = 0 + for(var/obj/item/organ/heart/current_hearts in all_items) + if(current_hearts.organ_flags & ORGAN_SYNTHETIC) // No robo-hearts allowed + continue + heart_count++ + + if(heart_count >= target_amount) + return TRUE + return FALSE + +////////////////////////////////////////////////////////////////////////////////////// + +///Eat blood from a lot of people +/datum/objective/vampire/gourmand + name = "gourmand" + +// GENERATE! +/datum/objective/vampire/gourmand/New() + target_amount = rand(450,650) + ..() + +// EXPLANATION +/datum/objective/vampire/gourmand/update_explanation_text() + . = ..() + explanation_text = "Using your Feed ability, drink [target_amount] units of Blood." + +// WIN CONDITIONS? +/datum/objective/vampire/gourmand/check_completion() + var/datum/antagonist/vampire/vampiredatum = owner.current.mind.has_antag_datum(/datum/antagonist/vampire) + if(!vampiredatum) + return FALSE + var/stolen_blood = vampiredatum.total_blood_drank + if(stolen_blood >= target_amount) + return TRUE + return FALSE + +// HOW: Track each feed (if human). Count victory. + +// NOTE: Look up /assassinate in objective.dm for inspiration.6 +/// Vassalize a target. +/datum/objective/vampire/vassalhim + name = "vassalhim" + var/target_department_type = FALSE + +/datum/objective/vampire/vassalhim/New() + find_target() + ..() + +// EXPLANATION +/datum/objective/vampire/vassalhim/update_explanation_text() + . = ..() + if(target?.current) + explanation_text = "Ensure [target.name], the [target.assigned_role], is Vassalized via the Persuasion Rack." + else + explanation_text = "Free Objective" + +/datum/objective/vampire/vassalhim/admin_edit(mob/admin) + admin_simple_target_pick(admin) + +// WIN CONDITIONS? +/datum/objective/vampire/vassalhim/check_completion() + if(!target || target.has_antag_datum(/datum/antagonist/vassal)) + return TRUE + return FALSE + + + +////////////////////////////// +// CLAN OBJECTIVES // +////////////////////////////// + +/// Steal the Archive of the Kindred - Nosferatu Clan objective +/datum/objective/vampire/kindred + name = "steal kindred" + +// EXPLANATION +/datum/objective/vampire/kindred/update_explanation_text() + . = ..() + explanation_text = "Ensure Nosferatu steals and keeps control over the Archive of the Kindred." + +// WIN CONDITIONS? +/datum/objective/vampire/kindred/check_completion() + if(!owner.current) + return FALSE + var/datum/antagonist/vampire/vampiredatum = owner.current.mind.has_antag_datum(/datum/antagonist/vampire) + if(!vampiredatum) + return FALSE + + for(var/datum/mind/vampire_minds as anything in get_antag_minds(/datum/antagonist/vampire)) + var/obj/item/book/kindred/the_book = locate() in vampire_minds.current.get_contents() + if(the_book) + return TRUE + return FALSE + +////////////////////////////////////////////////////////////////////////////////////// + +/// Max out a Tremere Power - Tremere Clan objective +/datum/objective/vampire/tremere_power + name = "tremerepower" + +// EXPLANATION +/datum/objective/vampire/tremere_power/update_explanation_text() + explanation_text = "Upgrade a Blood Magic power to the maximum level, remember that Vassalizing gives more Ranks!" + +// WIN CONDITIONS? +/datum/objective/vampire/tremere_power/check_completion() + var/datum/antagonist/vampire/vampiredatum = owner.has_antag_datum(/datum/antagonist/vampire) + for(var/datum/action/cooldown/vampire/targeted/tremere/tremere_powers in vampiredatum.powers) + if(tremere_powers.level_current >= 5) + return TRUE + return FALSE + +////////////////////////////////////////////////////////////////////////////////////// + +/// Convert a crewmate - Ventrue Clan objective +/datum/objective/vampire/embrace + name = "embrace" + +// EXPLANATION +/datum/objective/vampire/embrace/update_explanation_text() + . = ..() + explanation_text = "Use the Persuasion rack to Rank your Favorite Vassal up enough to become a Vampire." + +// WIN CONDITIONS? +/datum/objective/vampire/embrace/check_completion() + var/datum/antagonist/vampire/vampiredatum = owner.current.mind.has_antag_datum(/datum/antagonist/vampire) + if(!vampiredatum) + return FALSE + for(var/datum/antagonist/vassal/vassaldatum in vampiredatum.vassals) + if(IS_FAVORITE_VASSAL(vassaldatum.owner.current)) + if(vassaldatum.owner.has_antag_datum(/datum/antagonist/vampire)) + return TRUE + return FALSE + + + +////////////////////////////// +// VASSAL OBJECTIVES // +////////////////////////////// + +/datum/objective/vampire/vassal + +// EXPLANATION +/datum/objective/vampire/vassal/update_explanation_text() + . = ..() + explanation_text = "Guarantee the success of your Master's mission!" + +// WIN CONDITIONS? +/datum/objective/vampire/vassal/check_completion() + var/datum/antagonist/vassal/antag_datum = owner.has_antag_datum(/datum/antagonist/vassal) + return antag_datum.master?.owner?.current?.stat != DEAD diff --git a/code/modules/antagonists/vampire/powers/_power.dm b/code/modules/antagonists/vampire/powers/_power.dm new file mode 100644 index 0000000000000..46cdd87518574 --- /dev/null +++ b/code/modules/antagonists/vampire/powers/_power.dm @@ -0,0 +1,197 @@ +/datum/action/cooldown/vampire + name = "Vampiric Gift" + desc = "A vampiric gift." + button_icon = 'icons/vampires/actions_vampire.dmi' + background_icon_state = "vamp_power_off" + icon_icon = 'icons/vampires/actions_vampire.dmi' + button_icon_state = "power_feed" + buttontooltipstyle = "cult" + transparent_when_unavailable = TRUE + + /// Cooldown you'll have to wait between each use, decreases depending on level. + cooldown_time = 2 SECONDS + + var/background_icon_state_on = "vamp_power_on" + var/background_icon_state_off = "vamp_power_off" + + /// A sort of tutorial text found in the Antagonist tab. + var/power_explanation = "" + ///The owner's stored Vampire datum + var/datum/antagonist/vampire/vampiredatum_power + + /// The effects on this Power (Toggled/Single Use/Static Cooldown) + var/power_flags = BP_AM_TOGGLE|BP_AM_SINGLEUSE|BP_AM_STATIC_COOLDOWN|BP_AM_COSTLESS_UNCONSCIOUS + /// Requirement flags for checks + check_flags = BP_CANT_USE_IN_TORPOR|BP_CANT_USE_IN_FRENZY|BP_CANT_USE_WHILE_STAKED|BP_CANT_USE_WHILE_INCAPACITATED|BP_CANT_USE_WHILE_UNCONSCIOUS + /// Who can purchase the Power + var/purchase_flags = NONE // VAMPIRE_CAN_BUY|VAMPIRE_DEFAULT_POWER|TREMERE_CAN_BUY|VASSAL_CAN_BUY + + /// If the Power is currently active, differs from action cooldown because of how powers are handled. + var/active = FALSE + ///Can increase to yield new abilities - Each Power ranks up each Rank + var/level_current = 0 + ///The cost to ACTIVATE this Power + var/bloodcost = 0 + ///The cost to MAINTAIN this Power - Only used for Constant Cost Powers + var/constant_bloodcost = 0 + +// Modify description to add cost. +/datum/action/cooldown/vampire/New(Target) + . = ..() + if(bloodcost > 0) + desc += "

COST: [bloodcost] Blood" + if(constant_bloodcost > 0) + desc += "

CONSTANT COST: [name] costs [constant_bloodcost] Blood maintain active." + if(power_flags & BP_AM_SINGLEUSE) + desc += "

SINGLE USE:
[name] can only be used once per night." + +/datum/action/cooldown/vampire/Destroy() + vampiredatum_power = null + return ..() + +/datum/action/cooldown/vampire/IsAvailable(feedback = FALSE) + return next_use_time <= world.time + +/datum/action/cooldown/vampire/Grant(mob/user) + . = ..() + var/datum/antagonist/vampire/vampiredatum = IS_VAMPIRE(owner) + if(vampiredatum) + vampiredatum_power = vampiredatum + +//This is when we CLICK on the ability Icon, not USING. +/datum/action/cooldown/vampire/Trigger(trigger_flags, atom/target) + if(active) + DeactivatePower() + return FALSE + if(!can_pay_cost() || !can_use()) + return FALSE + pay_cost() + ActivatePower(trigger_flags) + if(!(power_flags & BP_AM_TOGGLE) || !active) + StartCooldown() + return TRUE + +///Called when the Power is upgraded. +/datum/action/cooldown/vampire/proc/upgrade_power() + level_current++ + // Decrease cooldown time + if(power_flags & !BP_AM_STATIC_COOLDOWN) + cooldown_time = max(initial(cooldown_time) / 2, initial(cooldown_time) - (initial(cooldown_time) / 16 * (level_current - 1))) + +/datum/action/cooldown/vampire/proc/can_pay_cost() + if(!owner || !owner.mind) + return FALSE + // Cooldown? + if(!COOLDOWN_FINISHED(src, next_use_time)) + owner.balloon_alert(owner, "power unavailable!") + return FALSE + if(!vampiredatum_power) + var/mob/living/living_owner = owner + if(!HAS_TRAIT(living_owner, TRAIT_NO_BLOOD) && living_owner.blood_volume < bloodcost) + to_chat(owner, "You need at least [bloodcost] blood to activate [name]") + return FALSE + return TRUE + + // Have enough blood? Vampires in a Frenzy don't need to pay them + if(vampiredatum_power.frenzied) + return TRUE + if(vampiredatum_power.vampire_blood_volume < bloodcost) + to_chat(owner, "You need at least [bloodcost] blood to activate [name]") + return FALSE + return TRUE + +///Checks if the Power is available to use. +/datum/action/cooldown/vampire/proc/can_use() + var/mob/living/carbon/user = owner + + if(!owner) + return FALSE + if(!isliving(user)) + return FALSE + // Torpor? + if((check_flags & BP_CANT_USE_IN_TORPOR) && HAS_TRAIT(user, TRAIT_TORPOR)) + to_chat(user, "Not while you're in Torpor.") + return FALSE + // Frenzy? + if((check_flags & BP_CANT_USE_IN_FRENZY) && vampiredatum_power?.frenzied) + to_chat(user, "You cannot use powers while in a Frenzy!") + return FALSE + // Stake? + if((check_flags & BP_CANT_USE_WHILE_STAKED) && vampiredatum_power?.check_staked()) + to_chat(user, "You have a stake in your chest! Your powers are useless.") + return FALSE + // Conscious? -- We use our own (AB_CHECK_CONSCIOUS) here so we can control it more, like the error message. + if((check_flags & BP_CANT_USE_WHILE_UNCONSCIOUS) && user.stat != CONSCIOUS) + to_chat(user, "You can't do this while you are unconcious!") + return FALSE + // Incapacitated? + if((check_flags & BP_CANT_USE_WHILE_INCAPACITATED) && user.incapacitated(IGNORE_RESTRAINTS, IGNORE_GRAB)) + to_chat(user, "Not while you're incapacitated!") + return FALSE + // Constant Cost (out of blood) + if(constant_bloodcost > 0 && vampiredatum_power?.vampire_blood_volume <= 0) + to_chat(user, "You don't have the blood to upkeep [src].") + return FALSE + return TRUE + +/datum/action/cooldown/vampire/UpdateButtonIcon(force = FALSE) + background_icon_state = active ? background_icon_state_on : background_icon_state_off + . = ..() + +/datum/action/cooldown/vampire/proc/pay_cost() + // Vassals get powers too! + if(!vampiredatum_power) + var/mob/living/living_owner = owner + if(!HAS_TRAIT(living_owner, TRAIT_NO_BLOOD)) + living_owner.blood_volume -= bloodcost + return + // Vampires in a Frenzy don't have enough Blood to pay it, so just don't. + if(!vampiredatum_power.frenzied) + vampiredatum_power.vampire_blood_volume -= bloodcost + vampiredatum_power.update_hud() + +/datum/action/cooldown/vampire/proc/ActivatePower(trigger_flags) + active = TRUE + if(power_flags & BP_AM_TOGGLE) + RegisterSignal(owner, COMSIG_LIVING_LIFE, PROC_REF(UsePower)) + + owner.log_message("used [src][bloodcost != 0 ? " at the cost of [bloodcost]" : ""].", LOG_ATTACK, color="red") + UpdateButtonIcon() + +/datum/action/cooldown/vampire/proc/DeactivatePower() + if(!active) //Already inactive? Return + return + if(power_flags & BP_AM_TOGGLE) + UnregisterSignal(owner, COMSIG_LIVING_LIFE) + if(power_flags & BP_AM_SINGLEUSE) + remove_after_use() + return + active = FALSE + StartCooldown() + UpdateButtonIcon() + +///Used by powers that are continuously active (That have BP_AM_TOGGLE flag) +/datum/action/cooldown/vampire/proc/UsePower(mob/living/user) + if(!ContinueActive(user)) // We can't afford the Power? Deactivate it. + DeactivatePower() + return FALSE + // We can keep this up (For now), so Pay Cost! + if(!(power_flags & BP_AM_COSTLESS_UNCONSCIOUS) && user.stat != CONSCIOUS) + if(vampiredatum_power) + vampiredatum_power.AddBloodVolume(-constant_bloodcost) + else + var/mob/living/living_user = user + if(!HAS_TRAIT(living_user, TRAIT_NO_BLOOD)) + living_user.blood_volume -= constant_bloodcost + return TRUE + +/// Checks to make sure this power can stay active +/datum/action/cooldown/vampire/proc/ContinueActive(mob/living/user, mob/living/target) + if(!constant_bloodcost > 0 || vampiredatum_power.vampire_blood_volume > 0) + return TRUE + return FALSE + +/// Used to unlearn Single-Use Powers +/datum/action/cooldown/vampire/proc/remove_after_use() + vampiredatum_power?.powers -= src + Remove(owner) diff --git a/code/modules/antagonists/vampire/powers/cloak.dm b/code/modules/antagonists/vampire/powers/cloak.dm new file mode 100644 index 0000000000000..3663fdadb857b --- /dev/null +++ b/code/modules/antagonists/vampire/powers/cloak.dm @@ -0,0 +1,55 @@ +/datum/action/cooldown/vampire/cloak + name = "Cloak of Darkness" + desc = "Blend into the shadows and become invisible to the untrained and Artificial eye." + button_icon_state = "power_cloak" + power_explanation = "\ + Activate this Power in the shadows and you will turn nearly invisible, scaling with your rank. \ + Additionally, while Cloak is active, you are completely invisible to the AI." + power_flags = BP_AM_TOGGLE + check_flags = BP_CANT_USE_IN_TORPOR|BP_CANT_USE_IN_FRENZY|BP_CANT_USE_WHILE_UNCONSCIOUS + purchase_flags = VAMPIRE_CAN_BUY|VASSAL_CAN_BUY + bloodcost = 5 + constant_bloodcost = 0.2 + cooldown_time = 5 SECONDS + +/// Must have nobody around to see the cloak +/datum/action/cooldown/vampire/cloak/can_use(mob/living/carbon/user, trigger_flags) + . = ..() + if(!.) + return FALSE + for(var/mob/living/watchers in view(9, owner) - owner) + owner.balloon_alert(owner, "you can only vanish unseen.") + return FALSE + return TRUE + +/datum/action/cooldown/vampire/cloak/ActivatePower(trigger_flags) + . = ..() + var/mob/living/user = owner + owner.add_movespeed_modifier(/datum/movespeed_modifier/obesity) + user.AddElement(/datum/element/digital_camo) + user.balloon_alert(user, "cloak turned on.") + +/datum/action/cooldown/vampire/cloak/UsePower(seconds_per_tick) + . = ..() + if(!.) + return + + animate(owner, alpha = max(25, owner.alpha - min(75, 10 + 5 * level_current)), time = 1.5 SECONDS) + +/datum/action/cooldown/vampire/cloak/ContinueActive(mob/living/user, mob/living/target) + . = ..() + if(!.) + return FALSE + if(user.stat != CONSCIOUS) + to_chat(owner, "Your cloak failed because you fell unconcious!") + return FALSE + return TRUE + +/datum/action/cooldown/vampire/cloak/DeactivatePower() + var/mob/living/user = owner + + animate(user, alpha = 255, time = 1 SECONDS) + user.RemoveElement(/datum/element/digital_camo) + owner.remove_movespeed_modifier(/datum/movespeed_modifier/obesity) + user.balloon_alert(user, "cloak turned off.") + return ..() diff --git a/code/modules/antagonists/vampire/powers/feed.dm b/code/modules/antagonists/vampire/powers/feed.dm new file mode 100644 index 0000000000000..059265f70e270 --- /dev/null +++ b/code/modules/antagonists/vampire/powers/feed.dm @@ -0,0 +1,245 @@ +#define FEED_NOTICE_RANGE 2 +#define FEED_DEFAULT_TIMER (10 SECONDS) + +/datum/action/cooldown/vampire/feed + name = "Feed" + desc = "Feed blood off of a living creature." + button_icon_state = "power_feed" + power_explanation = "\ + Activate Feed while next to someone and you will begin to feed blood off of them. \ + The time needed before you start feeding decreases the higher level you are. \ + Feeding off of someone while you have them aggressively grabbed will put them to sleep. \ + You are given a Masquerade Infraction if you feed too close to a mortal. \ + If you are in desperate need of blood, mice can be fed off of, at a cost of your humanity." + power_flags = BP_AM_TOGGLE|BP_AM_STATIC_COOLDOWN + check_flags = BP_CANT_USE_IN_TORPOR|BP_CANT_USE_WHILE_STAKED|BP_CANT_USE_WHILE_INCAPACITATED|BP_CANT_USE_WHILE_UNCONSCIOUS + purchase_flags = VAMPIRE_CAN_BUY|VAMPIRE_DEFAULT_POWER + bloodcost = 0 + cooldown_time = 15 SECONDS + ///Amount of blood taken, reset after each Feed. Used for logging. + var/blood_taken = 0 + ///The amount of Blood a target has since our last feed, this loops and lets us not spam alerts of low blood. + var/warning_target_bloodvol = BLOOD_VOLUME_MAXIMUM + ///Reference to the target we've fed off of + var/datum/weakref/target_ref + ///Are we feeding with passive grab or not? + var/silent_feed = TRUE + +/datum/action/cooldown/vampire/feed/can_use(mob/living/carbon/user, trigger_flags) + . = ..() + if(!.) + return FALSE + if(target_ref) //already sucking blood. + return FALSE + if(user?.is_mouth_covered() && !isplasmaman(user)) + owner.balloon_alert(owner, "mouth covered!") + return FALSE + //Find target, it will alert what the problem is, if any. + if(!find_target()) + return FALSE + return TRUE + +/datum/action/cooldown/vampire/feed/ContinueActive(mob/living/user, mob/living/target) + if(!target) + return FALSE + if(!user.Adjacent(target)) + return FALSE + return TRUE + +/datum/action/cooldown/vampire/feed/DeactivatePower() + var/mob/living/user = owner + if(target_ref) + var/mob/living/feed_target = target_ref.resolve() + log_combat(user, feed_target, "fed on blood", addition="(and took [blood_taken] blood)") + to_chat(user, "You slowly release [feed_target].") + if(feed_target.stat == DEAD) + SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "drankkilled", /datum/mood_event/drankkilled) + target_ref = null + + warning_target_bloodvol = BLOOD_VOLUME_MAXIMUM + blood_taken = 0 + REMOVE_TRAIT(user, TRAIT_IMMOBILIZED, TRAIT_FEED) + REMOVE_TRAIT(user, TRAIT_MUTE, TRAIT_FEED) + return ..() + +/datum/action/cooldown/vampire/feed/ActivatePower(trigger_flags) + var/mob/living/feed_target = target_ref.resolve() + if(istype(feed_target, /mob/living/simple_animal/mouse)) + to_chat(owner, "You recoil at the taste of a lesser lifeform.") + if(vampiredatum_power.my_clan && vampiredatum_power.my_clan.blood_drink_type != VAMPIRE_DRINK_INHUMANELY) + var/mob/living/user = owner + SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "drankblood", /datum/mood_event/drankblood_bad) + vampiredatum_power.AddBloodVolume(25) + DeactivatePower() + feed_target.death() + return + var/feed_timer = clamp(round(FEED_DEFAULT_TIMER / (1.25 * (level_current || 1))), 1, FEED_DEFAULT_TIMER) + if(vampiredatum_power.frenzied) + feed_timer = 2 SECONDS + + owner.balloon_alert(owner, "feeding off [feed_target]...") + if(!do_after(owner, feed_timer, feed_target, NONE, TRUE)) + owner.balloon_alert(owner, "feed stopped") + DeactivatePower() + return + if(owner.pulling == feed_target && owner.grab_state >= GRAB_AGGRESSIVE) + if(!IS_VAMPIRE(feed_target) && !IS_VASSAL(feed_target) && !IS_CURATOR(feed_target)) + feed_target.Unconscious((5 + level_current) SECONDS) + if(!feed_target.density) + feed_target.Move(owner.loc) + owner.visible_message( + "[owner] closes [owner.p_their()] mouth around [feed_target]'s neck!", + "You sink your fangs into [feed_target]'s neck." + ) + silent_feed = FALSE //no more mr nice guy + else + // Only people who AREN'T the target will notice this action. + var/dead_message = feed_target.stat != DEAD ? " [feed_target.p_they(TRUE)] looks dazed, and will not remember this." : "" + owner.visible_message( + "[owner] puts [feed_target]'s wrist up to [owner.p_their()] mouth.", \ + "You slip your fangs into [feed_target]'s wrist.[dead_message]", \ + vision_distance = FEED_NOTICE_RANGE, ignored_mobs = feed_target) + + //check if we were seen + for(var/mob/living/watcher in oviewers(FEED_NOTICE_RANGE) - feed_target) + if(!watcher.client) + continue + if(watcher.has_unlimited_silicon_privilege) + continue + if(watcher.stat >= DEAD) + continue + if(watcher.is_blind() || HAS_TRAIT(watcher, TRAIT_NEARSIGHT)) + continue + if(IS_VAMPIRE(watcher) || IS_VASSAL(watcher)) + continue + owner.balloon_alert(owner, "feed noticed!") + vampiredatum_power.give_masquerade_infraction() + break + + ADD_TRAIT(owner, TRAIT_MUTE, TRAIT_FEED) + ADD_TRAIT(owner, TRAIT_IMMOBILIZED, TRAIT_FEED) + return ..() + +/datum/action/cooldown/vampire/feed/UsePower(seconds_per_tick) + if(!active) //If we aren't active (running on SSfastprocess) + return ..() //Manage our cooldown timers + var/mob/living/user = owner + var/mob/living/feed_target = target_ref.resolve() + if(!ContinueActive(user, feed_target)) + if(!silent_feed) + user.visible_message( + "[user] is ripped from [feed_target]'s throat. [feed_target.p_their(TRUE)] blood sprays everywhere!", + "Your teeth are ripped from [feed_target]'s throat. [feed_target.p_their(TRUE)] blood sprays everywhere!", + ) + // Deal Damage to Target (should have been more careful!) + if(iscarbon(feed_target)) + var/mob/living/carbon/carbon_target = feed_target + carbon_target.bleed(15) + playsound(get_turf(feed_target), 'sound/effects/splat.ogg', 40, TRUE) + if(ishuman(feed_target)) + var/mob/living/carbon/human/target_user = feed_target + target_user.add_bleeding(BLEED_CRITICAL) + feed_target.add_splatter_floor(get_turf(feed_target)) + user.add_mob_blood(feed_target) // Put target's blood on us. The donor goes in the ( ) + feed_target.add_mob_blood(feed_target) + feed_target.apply_damage(10, BRUTE, BODY_ZONE_HEAD) + INVOKE_ASYNC(feed_target, TYPE_PROC_REF(/mob, emote), "scream") + DeactivatePower() + return + + var/feed_strength_mult = 0 + if(vampiredatum_power.frenzied) + feed_strength_mult = 2 + else if(owner.pulling == feed_target && owner.grab_state >= GRAB_AGGRESSIVE) + feed_strength_mult = 1 + else + feed_strength_mult = 0.3 + blood_taken += vampiredatum_power.handle_feeding(feed_target, feed_strength_mult, level_current) + + if(feed_strength_mult > 5 && feed_target.stat < DEAD) + SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "drankblood", /datum/mood_event/drankblood) + // Drank mindless as Ventrue? - BAD + if((vampiredatum_power.my_clan?.blood_drink_type == VAMPIRE_DRINK_SNOBBY) && !feed_target.mind) + SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "drankblood", /datum/mood_event/drankblood_bad) + if(feed_target.stat >= DEAD) + SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "drankblood", /datum/mood_event/drankblood_bad) + + if(!IS_VAMPIRE(feed_target)) + if(feed_target.blood_volume <= BLOOD_VOLUME_BAD && warning_target_bloodvol > BLOOD_VOLUME_BAD) + owner.balloon_alert(owner, "your victim's blood is fatally low!") + else if(feed_target.blood_volume <= BLOOD_VOLUME_OKAY && warning_target_bloodvol > BLOOD_VOLUME_OKAY) + owner.balloon_alert(owner, "your victim's blood is dangerously low.") + else if(feed_target.blood_volume <= BLOOD_VOLUME_SAFE && warning_target_bloodvol > BLOOD_VOLUME_SAFE) + owner.balloon_alert(owner, "your victim's blood is at an unsafe level.") + warning_target_bloodvol = feed_target.blood_volume + + if(vampiredatum_power.vampire_blood_volume >= vampiredatum_power.max_blood_volume) + user.balloon_alert(owner, "full on blood!") + DeactivatePower() + return + if(feed_target.blood_volume <= 0) + user.balloon_alert(owner, "no blood left!") + DeactivatePower() + return + owner.playsound_local(null, 'sound/effects/singlebeat.ogg', 40, TRUE) + //play sound to target to show they're dying. + if(owner.pulling == feed_target && owner.grab_state >= GRAB_AGGRESSIVE) + feed_target.playsound_local(null, 'sound/effects/singlebeat.ogg', 40, TRUE) + +/datum/action/cooldown/vampire/feed/proc/find_target() + if(owner.pulling && isliving(owner.pulling)) + if(!can_feed_from(owner.pulling, give_warnings = TRUE)) + return FALSE + target_ref = WEAKREF(owner.pulling) + return TRUE + + var/list/close_living_mobs = list() + var/list/close_dead_mobs = list() + for(var/mob/living/near_targets in oview(1, owner)) + if(!owner.Adjacent(near_targets)) + continue + if(near_targets.stat) + close_living_mobs |= near_targets + else + close_dead_mobs |= near_targets + //Check living first + for(var/mob/living/suckers in close_living_mobs) + if(can_feed_from(suckers)) + target_ref = WEAKREF(suckers) + return TRUE + //If not, check dead + for(var/mob/living/suckers in close_dead_mobs) + if(can_feed_from(suckers)) + target_ref = WEAKREF(suckers) + return TRUE + //No one to suck blood from. + return FALSE + +/datum/action/cooldown/vampire/feed/proc/can_feed_from(mob/living/target, give_warnings = FALSE) + if(istype(target, /mob/living/simple_animal/mouse)) + if(vampiredatum_power.my_clan?.blood_drink_type == VAMPIRE_DRINK_SNOBBY) + if(give_warnings) + owner.balloon_alert(owner, "too disgusting!") + return FALSE + return TRUE + //Mice check done, only humans are otherwise allowed + if(!ishuman(target)) + return FALSE + + var/mob/living/carbon/human/target_user = target + if(!(target_user.dna?.species) || !(target_user.mob_biotypes & MOB_ORGANIC)) + if(give_warnings) + owner.balloon_alert(owner, "no blood!") + return FALSE + if(!target_user.can_inject(owner, BODY_ZONE_HEAD, (1 << 0))) + if(give_warnings) + owner.balloon_alert(owner, "suit too thick!") + return FALSE + if((vampiredatum_power.my_clan && vampiredatum_power.my_clan.blood_drink_type == VAMPIRE_DRINK_SNOBBY) && !target_user.mind && !vampiredatum_power.frenzied) + if(give_warnings) + owner.balloon_alert(owner, "cant drink from mindless!") + return FALSE + return TRUE + +#undef FEED_NOTICE_RANGE +#undef FEED_DEFAULT_TIMER diff --git a/code/modules/antagonists/vampire/powers/fortitude.dm b/code/modules/antagonists/vampire/powers/fortitude.dm new file mode 100644 index 0000000000000..45440b6cc09c7 --- /dev/null +++ b/code/modules/antagonists/vampire/powers/fortitude.dm @@ -0,0 +1,65 @@ +/datum/action/cooldown/vampire/fortitude + name = "Fortitude" + desc = "Withstand egregious physical wounds and walk away from attacks that would stun, pierce, and dismember lesser beings." + button_icon_state = "power_fortitude" + power_explanation = "\ + Activating Fortitude will provide pierce, dismember, and push immunity. \ + You will additionally gain Brute and Stamina resistance, scaling with your rank. \ + At level 4, you gain complete stun immunity." + power_flags = BP_AM_TOGGLE|BP_AM_COSTLESS_UNCONSCIOUS + check_flags = BP_CANT_USE_IN_TORPOR|BP_CANT_USE_IN_FRENZY + purchase_flags = VAMPIRE_CAN_BUY|VASSAL_CAN_BUY + bloodcost = 30 + cooldown_time = 8 SECONDS + constant_bloodcost = 0.2 + var/fortitude_resist // So we can raise and lower your brute resist based on what your level_current WAS. + +/datum/action/cooldown/vampire/fortitude/ActivatePower(trigger_flags) + . = ..() + if(!.) + return + + owner.balloon_alert(owner, "fortitude turned on.") + to_chat(owner, "Your flesh has become as hard as steel!") + // Traits & Effects + ADD_TRAIT(owner, TRAIT_PIERCEIMMUNE, TRAIT_VAMPIRE) + ADD_TRAIT(owner, TRAIT_NODISMEMBER, TRAIT_VAMPIRE) + ADD_TRAIT(owner, TRAIT_PUSHIMMUNE, TRAIT_VAMPIRE) + if(level_current >= 4) + ADD_TRAIT(owner, TRAIT_STUNIMMUNE, TRAIT_VAMPIRE) // They'll get stun resistance + this, who cares. + var/mob/living/carbon/human/vampire_user = owner + if(IS_VAMPIRE(owner) || IS_VASSAL(owner)) + fortitude_resist = max(0.3, 0.7 - level_current * 0.1) + vampire_user.physiology.brute_mod *= fortitude_resist + vampire_user.physiology.stamina_mod *= fortitude_resist + + owner.add_movespeed_modifier(/datum/movespeed_modifier/obesity) + +/datum/action/cooldown/vampire/fortitude/UsePower(seconds_per_tick) + . = ..() + if(!. || !active) + return + + /// We don't want people using fortitude being able to use vehicles + var/mob/living/carbon/user = owner + if(user.buckled && istype(user.buckled, /obj/vehicle)) + user.buckled.unbuckle_mob(src, force=TRUE) + +/datum/action/cooldown/vampire/fortitude/DeactivatePower() + if(!ishuman(owner)) + return + var/mob/living/carbon/human/vampire_user = owner + if(IS_VAMPIRE(owner) || IS_VASSAL(owner)) + vampire_user.physiology.brute_mod /= fortitude_resist + if(!HAS_TRAIT_FROM(vampire_user, TRAIT_STUNIMMUNE, TRAIT_VAMPIRE)) + vampire_user.physiology.stamina_mod /= fortitude_resist + // Remove Traits & Effects + REMOVE_TRAIT(owner, TRAIT_PIERCEIMMUNE, TRAIT_VAMPIRE) + REMOVE_TRAIT(owner, TRAIT_NODISMEMBER, TRAIT_VAMPIRE) + REMOVE_TRAIT(owner, TRAIT_PUSHIMMUNE, TRAIT_VAMPIRE) + REMOVE_TRAIT(owner, TRAIT_STUNIMMUNE, TRAIT_VAMPIRE) + + owner.remove_movespeed_modifier(/datum/movespeed_modifier/obesity) + owner.balloon_alert(owner, "fortitude turned off.") + + return ..() diff --git a/code/modules/antagonists/vampire/powers/gohome.dm b/code/modules/antagonists/vampire/powers/gohome.dm new file mode 100644 index 0000000000000..11896d189b79e --- /dev/null +++ b/code/modules/antagonists/vampire/powers/gohome.dm @@ -0,0 +1,120 @@ +#define GOHOME_START 0 +#define GOHOME_FLICKER_ONE 2 +#define GOHOME_FLICKER_TWO 4 +#define GOHOME_TELEPORT 6 + +/** + * Given to Vampires near Sol if they have a Coffin claimed. + * Teleports them to their Coffin after a delay. + * Makes them drop everything if someone witnesses the act. + */ +/datum/action/cooldown/vampire/gohome + name = "Vanishing Act" + desc = "As dawn aproaches, disperse into mist and return directly to your Lair.
WARNING: You will drop ALL of your possessions if observed by mortals." + button_icon_state = "power_gohome" + power_explanation = "\ + Activating Vanishing Act will, after a short delay, teleport you to your Claimed Coffin. \ + Immediately after activating, lights around the user will begin to flicker. \ + Once the user teleports to their coffin, in their place will be a Rat or Bat." + power_flags = BP_AM_TOGGLE|BP_AM_SINGLEUSE|BP_AM_STATIC_COOLDOWN + check_flags = BP_CANT_USE_IN_FRENZY|BP_CANT_USE_WHILE_STAKED + purchase_flags = NONE + bloodcost = 100 + constant_bloodcost = 2 + cooldown_time = 100 SECONDS + ///What stage of the teleportation are we in + var/teleporting_stage = GOHOME_START + ///The types of mobs that will drop post-teleportation. + var/static/list/spawning_mobs = list( + /mob/living/simple_animal/mouse = 3, + /mob/living/simple_animal/hostile/retaliate/bat = 1, + ) + +/datum/action/cooldown/vampire/gohome/can_use(mob/living/carbon/user, trigger_flags) + if(!..()) + return FALSE + /// Have No Lair (NOTE: You only got this power if you had a lair, so this means it's destroyed) + if(!istype(vampiredatum_power) || !vampiredatum_power.coffin) + owner.balloon_alert(owner, "coffin was destroyed!") + return FALSE + return TRUE + +/datum/action/cooldown/vampire/gohome/ActivatePower(trigger_flags) + ..() + owner.balloon_alert(owner, "preparing to teleport...") + if(do_after(owner, GOHOME_TELEPORT SECONDS, timed_action_flags=(IGNORE_USER_LOC_CHANGE | IGNORE_INCAPACITATED | IGNORE_HELD_ITEM))) + teleport_to_coffin(owner) + +/datum/action/cooldown/vampire/gohome/UsePower(seconds_per_tick) + if(!..()) + return FALSE + switch(teleporting_stage) + if(GOHOME_START) + INVOKE_ASYNC(src, PROC_REF(flicker_lights), 3, 20) + if(GOHOME_FLICKER_ONE) + INVOKE_ASYNC(src, PROC_REF(flicker_lights), 4, 40) + if(GOHOME_FLICKER_TWO) + INVOKE_ASYNC(src, PROC_REF(flicker_lights), 4, 60) + teleporting_stage++ + +/datum/action/cooldown/vampire/gohome/ContinueActive(mob/living/user, mob/living/target) + if(!..()) + return FALSE + if(!isturf(owner.loc)) + return FALSE + if(!vampiredatum_power.coffin) + user.balloon_alert(user, "coffin destroyed!") + to_chat(owner, "Your coffin has been destroyed! You no longer have a destination.") + return FALSE + return TRUE + +/datum/action/cooldown/vampire/gohome/proc/flicker_lights(flicker_range, beat_volume) + for(var/obj/machinery/light/nearby_lights in view(flicker_range, get_turf(owner))) + nearby_lights.flicker(5) + playsound(get_turf(owner), 'sound/effects/singlebeat.ogg', beat_volume, 1) + +/datum/action/cooldown/vampire/gohome/proc/teleport_to_coffin(mob/living/carbon/user) + var/drop_item = FALSE + var/turf/current_turf = get_turf(owner) + // If we aren't in the dark, anyone watching us will cause us to drop out stuff + if(!QDELETED(current_turf?.lighting_object) && current_turf.get_lumcount() >= 0.2) + for(var/mob/living/watcher in viewers(world.view, get_turf(owner)) - owner) + if(!watcher.client) + continue + if(watcher.has_unlimited_silicon_privilege) + continue + if(watcher.is_blind()) + continue + if(!IS_VAMPIRE(watcher) && !IS_VASSAL(watcher)) + drop_item = TRUE + break + user.uncuff() + if(drop_item) + for(var/obj/item/literally_everything in owner) + owner.dropItemToGround(literally_everything, TRUE) + + playsound(current_turf, 'sound/magic/summon_karp.ogg', 60, 1) + + var/datum/effect_system/steam_spread/vampire/puff = new /datum/effect_system/steam_spread/vampire() + puff.set_up(3, 0, current_turf) + puff.start() + + /// STEP FIVE: Create animal at prev location + var/mob/living/simple_animal/new_mob = pick_weight(spawning_mobs) + new new_mob(current_turf) + /// TELEPORT: Move to Coffin & Close it! + user.set_resting(TRUE, TRUE, FALSE) + do_teleport(owner, vampiredatum_power.coffin, channel = TELEPORT_CHANNEL_MAGIC, bypass_area_restriction = TRUE, no_effects = TRUE) + vampiredatum_power.coffin.close(owner) + vampiredatum_power.coffin.take_contents() + playsound(vampiredatum_power.coffin.loc, vampiredatum_power.coffin.close_sound, 15, 1, -3) + + DeactivatePower() + +/datum/effect_system/steam_spread/vampire + effect_type = /obj/effect/particle_effect/smoke/vampsmoke + +#undef GOHOME_START +#undef GOHOME_FLICKER_ONE +#undef GOHOME_FLICKER_TWO +#undef GOHOME_TELEPORT diff --git a/code/modules/antagonists/vampire/powers/masquerade.dm b/code/modules/antagonists/vampire/powers/masquerade.dm new file mode 100644 index 0000000000000..4b6105c21b539 --- /dev/null +++ b/code/modules/antagonists/vampire/powers/masquerade.dm @@ -0,0 +1,91 @@ +/** + * # WITHOUT THIS POWER: + * + * - Mid-Blood: SHOW AS PALE + * - Low-Blood: SHOW AS DEAD + * - No Heartbeat + * - Examine shows actual blood + * - Thermal homeostasis (ColdBlooded) + * WITH THIS POWER: + * - Normal body temp -- remove Cold Blooded (return on deactivate) + */ + +/datum/action/cooldown/vampire/masquerade + name = "Masquerade" + desc = "Feign the vital signs of a mortal, and escape both casual and medical notice as the monster you truly are." + button_icon_state = "power_human" + power_explanation = "\ + Masquerade will forge your identity to be practically identical to that of a human;\ + You lose nearly all Vampire benefits, including your passive healing.\ + You gain a Genetic sequence, and appear to have 100% blood when scanned by a Health Analyzer.\ + You will not appear as Pale when examined. Anything further than Pale, however, will not be hidden.\ + After deactivating Masquerade, you will re-gain your Vampiric abilities, as well as lose any Diseases or mutations you might have." + power_flags = BP_AM_TOGGLE|BP_AM_STATIC_COOLDOWN|BP_AM_COSTLESS_UNCONSCIOUS + check_flags = BP_CANT_USE_IN_FRENZY + purchase_flags = VAMPIRE_CAN_BUY|VAMPIRE_DEFAULT_POWER + bloodcost = 10 + cooldown_time = 5 SECONDS + constant_bloodcost = 0.1 + +/datum/action/cooldown/vampire/masquerade/ActivatePower(trigger_flags) + . = ..() + var/mob/living/carbon/user = owner + owner.balloon_alert(owner, "masquerade turned on.") + to_chat(user, "Your heart beats falsely within your lifeless chest. You may yet pass for a mortal.") + to_chat(user, "Your vampiric healing is halted while imitating life.") + + // Give status effect + user.apply_status_effect(/datum/status_effect/masquerade) + + // Handle Traits + user.remove_traits(vampiredatum_power.vampire_traits, TRAIT_VAMPIRE) + ADD_TRAIT(user, TRAIT_MASQUERADE, TRAIT_VAMPIRE) + // Handle organs + var/obj/item/organ/heart/vampheart = user.getorgan(/obj/item/organ/heart) + vampheart?.Restart() + var/obj/item/organ/eyes/eyes = user.getorgan(/obj/item/organ/eyes) + eyes?.flash_protect = initial(eyes.flash_protect) + +/datum/action/cooldown/vampire/masquerade/DeactivatePower() + . = ..() + var/mob/living/carbon/user = owner + owner.balloon_alert(owner, "masquerade turned off.") + + // Remove status effect, mutations & diseases that you got while on masq. + user.remove_status_effect(/datum/status_effect/masquerade) + user.dna.remove_all_mutations() + for(var/datum/disease/diseases as anything in user.diseases) + diseases.cure() + + // Handle Traits + user.add_traits(vampiredatum_power.vampire_traits, TRAIT_VAMPIRE) + REMOVE_TRAIT(user, TRAIT_MASQUERADE, TRAIT_VAMPIRE) + + // Handle organs + var/obj/item/organ/heart/vampheart = user.getorganslot(ORGAN_SLOT_HEART) + vampheart?.Stop() + var/obj/item/organ/eyes/eyes = user.getorganslot(ORGAN_SLOT_EYES) + eyes?.flash_protect = max(initial(eyes.flash_protect) - 1, - 1) + to_chat(user, "Your heart beats one final time, while your skin dries out and your icy pallor returns.") + +/** + * # Status effect + * + * This is what the Masquerade power gives, handles their bonuses and gives them a neat icon to tell them they're on Masquerade. + */ + +/datum/status_effect/masquerade + id = "masquerade" + duration = -1 + tick_interval = -1 + alert_type = /atom/movable/screen/alert/status_effect/masquerade + +/atom/movable/screen/alert/status_effect/masquerade + name = "Masquerade" + desc = "You are currently hiding your identity using the Masquerade power. This halts Vampiric healing." + icon_state = "masquerade_active" + alerttooltipstyle = "cult" + +/atom/movable/screen/alert/status_effect/masquerade/MouseEntered(location,control,params) + desc = initial(desc) + return ..() diff --git a/code/modules/antagonists/vampire/powers/targeted/_targeted.dm b/code/modules/antagonists/vampire/powers/targeted/_targeted.dm new file mode 100644 index 0000000000000..26a6e2d51cd05 --- /dev/null +++ b/code/modules/antagonists/vampire/powers/targeted/_targeted.dm @@ -0,0 +1,104 @@ +// NOTE: All Targeted spells are Toggles! We just don't bother checking here. +/datum/action/cooldown/vampire/targeted + power_flags = BP_AM_TOGGLE + + ///If set, how far the target has to be for the power to work. + var/target_range + ///Message sent to chat when clicking on the power, before you use it. + var/prefire_message + ///Most powers happen the moment you click. Some, like Mesmerize, require time and shouldn't cost you if they fail. + var/power_activates_immediately = TRUE + ///Is this power LOCKED due to being used? + var/power_in_use = FALSE + +/// Modify description to add notice that this is aimed. +/datum/action/cooldown/vampire/targeted/New(Target) + desc += "
\[Targeted Power\]" + return ..() + +/datum/action/cooldown/vampire/targeted/Remove(mob/living/remove_from) + . = ..() + if(remove_from.click_intercept == src) + unset_click_ability(remove_from) + +/datum/action/cooldown/vampire/targeted/Trigger(trigger_flags, atom/target) + if(active) + DeactivatePower() + return FALSE + if(!can_pay_cost(owner) || !can_use(owner, trigger_flags)) + return FALSE + + if(prefire_message) + to_chat(owner, "[prefire_message]") + + ActivatePower(trigger_flags) + if(target) + return InterceptClickOn(owner, null, target) + + return set_click_ability(owner) + +/datum/action/cooldown/vampire/targeted/DeactivatePower() + if(power_flags & BP_AM_TOGGLE) + UnregisterSignal(owner, COMSIG_LIVING_LIFE) + active = FALSE + UpdateButtonIcon() + unset_click_ability(owner) + +/// Check if target is VALID (wall, turf, or character?) +/datum/action/cooldown/vampire/targeted/proc/CheckValidTarget(atom/target_atom) + return !(target_atom == owner) + +/// Check if valid target meets conditions +/datum/action/cooldown/vampire/targeted/proc/CheckCanTarget(atom/target_atom) + if(target_range) + // Out of Range + if(!(target_atom in view(target_range, owner))) + if(target_range > 1) // Only warn for range if it's greater than 1. Brawn doesn't need to announce itself. + owner.balloon_alert(owner, "out of range.") + return FALSE + return istype(target_atom) + +/datum/action/cooldown/vampire/targeted/proc/unset_click_ability(mob/on_who, refund_cooldown = TRUE) + owner.client.mouse_pointer_icon = null + SHOULD_CALL_PARENT(TRUE) + + on_who.click_intercept = null + UpdateButtonIcon() + return TRUE + +/datum/action/cooldown/vampire/targeted/proc/set_click_ability(mob/on_who) + owner.client.mouse_pointer_icon = 'icons/effects/cult_target.dmi' + SHOULD_CALL_PARENT(TRUE) + + on_who.click_intercept = src + UpdateButtonIcon() + return TRUE + +/// Click Target +/datum/action/cooldown/vampire/targeted/proc/click_with_power(atom/target_atom) + // CANCEL RANGED TARGET check + if(power_in_use || !CheckValidTarget(target_atom)) + return FALSE + // Valid? (return true means DON'T cancel power!) + if(!can_pay_cost() || !can_use(owner) || !CheckCanTarget(target_atom)) + return TRUE + power_in_use = TRUE // Lock us into this ability until it successfully fires off. Otherwise, we pay the blood even if we fail. + FireTargetedPower(target_atom) // We use this instead of ActivatePower(trigger_flags), which has no input + // Skip this part so we can return TRUE right away. + if(power_activates_immediately) + power_activated_sucessfully() // Mesmerize pays only after success. + power_in_use = FALSE + return TRUE + +/datum/action/cooldown/vampire/targeted/proc/FireTargetedPower(atom/target_atom) + log_combat(owner, target_atom, "used [name] on") + +/// The power went off! We now pay the cost of the power. +/datum/action/cooldown/vampire/targeted/proc/power_activated_sucessfully() + unset_click_ability(owner) + pay_cost() + StartCooldown() + DeactivatePower() + +/datum/action/cooldown/vampire/targeted/proc/InterceptClickOn(mob/living/caller, params, atom/target) + click_with_power(target) diff --git a/code/modules/antagonists/vampire/powers/targeted/brawn.dm b/code/modules/antagonists/vampire/powers/targeted/brawn.dm new file mode 100644 index 0000000000000..f58bb5ac3b324 --- /dev/null +++ b/code/modules/antagonists/vampire/powers/targeted/brawn.dm @@ -0,0 +1,176 @@ +/datum/action/cooldown/vampire/targeted/brawn + name = "Brawn" + desc = "Snap restraints, break lockers and doors, or deal terrible damage with your bare hands." + button_icon_state = "power_strength" + power_explanation = "\ + Click any person to bash into them, break restraints, or knock your grabber down. Only one of these can be done per use. \ + Punching a Cyborg will EMP it and deal high damage. \ + At level 3, you can break closets open, and additionally you can break restraints. \ + At level 4, you can bash airlocks open. \ + Higher ranks will increase the damage when punching someone." + power_flags = BP_AM_TOGGLE + check_flags = BP_CANT_USE_IN_TORPOR|BP_CANT_USE_IN_FRENZY|BP_CANT_USE_WHILE_INCAPACITATED|BP_CANT_USE_WHILE_UNCONSCIOUS + purchase_flags = VAMPIRE_CAN_BUY|VASSAL_CAN_BUY + bloodcost = 8 + cooldown_time = 9 SECONDS + target_range = 1 + power_activates_immediately = TRUE + prefire_message = "Select a target." + +/datum/action/cooldown/vampire/targeted/brawn/ActivatePower(trigger_flags) + // Did we break out of our handcuffs? + if(break_restraints()) + power_activated_sucessfully() + return FALSE + // Did we knock a grabber down? We can only do this while not also breaking restraints if strong enough. + if(level_current >= 3 && escape_puller()) + power_activated_sucessfully() + return FALSE + // Did neither, now we can PUNCH. + return ..() + +// Look at 'biodegrade.dm' for reference +/datum/action/cooldown/vampire/targeted/brawn/proc/break_restraints() + var/mob/living/carbon/human/user = owner + ///Only one form of shackles removed per use + var/used = FALSE + + // Breaks out of lockers + if(istype(user.loc, /obj/structure/closet)) + var/obj/structure/closet/closet = user.loc + if(!istype(closet)) + return FALSE + closet.visible_message( + "[closet] tears apart as [user] bashes it open from within!", + "[closet] tears apart as you bash it open from within!", + ) + to_chat(user, "We bash [closet] wide open!") + addtimer(CALLBACK(src, PROC_REF(break_closet), user, closet), 1) + used = TRUE + + if(!used) + user.uncuff() + user.visible_message( + "[user] discards their restraints like it's nothing!", + "We break through our restraints!", + ) + used = TRUE + + // Remove Straightjackets + if(user.wear_suit?.breakouttime && !used) + var/obj/item/clothing/suit/straightjacket = user.get_item_by_slot(ITEM_SLOT_OCLOTHING) + user.visible_message( + "[user] rips straight through the [user.p_their()] [straightjacket]!", + "We tear through our [straightjacket]!", + ) + if(straightjacket && user.wear_suit == straightjacket) + qdel(straightjacket) + used = TRUE + + // Did we end up using our ability? If so, play the sound effect and return TRUE + if(used) + playsound(get_turf(user), 'sound/effects/grillehit.ogg', 80, 1, -1) + return used + +// This is its own proc because its done twice, to repeat code copypaste. +/datum/action/cooldown/vampire/targeted/brawn/proc/break_closet(mob/living/carbon/human/user, obj/structure/closet/closet) + if(closet) + closet.welded = FALSE + closet.locked = FALSE + closet.broken = TRUE + closet.open() + +/datum/action/cooldown/vampire/targeted/brawn/proc/escape_puller() + if(!owner.pulledby) // || owner.pulledby.grab_state <= GRAB_PASSIVE) + return FALSE + var/mob/pulled_mob = owner.pulledby + var/pull_power = pulled_mob.grab_state + playsound(get_turf(pulled_mob), 'sound/effects/woodhit.ogg', 75, 1, -1) + // Knock Down (if Living) + if(isliving(pulled_mob)) + var/mob/living/hit_target = pulled_mob + hit_target.Knockdown(pull_power * 10 + 20) + // Knock Back (before Knockdown, which probably cancels pull) + var/send_dir = get_dir(owner, pulled_mob) + var/turf/turf_thrown_at = get_ranged_target_turf(pulled_mob, send_dir, pull_power) + owner.newtonian_move(send_dir) // Bounce back in 0 G + pulled_mob.throw_at(turf_thrown_at, pull_power, TRUE, owner, FALSE) // Throw distance based on grab state! Harder grabs punished more aggressively. + log_combat(owner, pulled_mob, "used Brawn power") + owner.visible_message( + "[owner] tears free of [pulled_mob]'s grasp!", + "You shrug off [pulled_mob]'s grasp!", + ) + owner.pulledby = null // It's already done, but JUST IN CASE. + return TRUE + +/datum/action/cooldown/vampire/targeted/brawn/FireTargetedPower(atom/target_atom) + . = ..() + var/mob/living/user = owner + + // Living Targets + if(isliving(target_atom)) + var/mob/living/target = target_atom + var/mob/living/carbon/carbonuser = user + var/hitStrength = carbonuser.dna.species.punchdamage * 1.25 + 2 + // Knockdown! + var/powerlevel = min(5, 1 + level_current) + if(rand(5 + powerlevel) >= 5) + target.visible_message( + "[user] lands a vicious punch, sending [target] away!", \ + "[user] has landed a horrifying punch on you and sends you flying!", + ) + target.Knockdown(min(5, rand(10, 10 * powerlevel))) + // Attack! + owner.balloon_alert(owner, "you punch [target]!") + playsound(get_turf(target), 'sound/weapons/punch4.ogg', 60, 1, -1) + user.do_attack_animation(target, ATTACK_EFFECT_SMASH) + var/obj/item/bodypart/affecting = target.get_bodypart(ran_zone(target.get_combat_bodyzone())) + target.apply_damage(hitStrength, BRUTE, affecting) + // Knockback + var/send_dir = get_dir(owner, target) + var/turf/turf_thrown_at = get_ranged_target_turf(target, send_dir, powerlevel) + owner.newtonian_move(send_dir) // Bounce back in 0 G + target.throw_at(turf_thrown_at, powerlevel, TRUE, owner) + // Target Type: Cyborg (Also gets the effects above) + if(issilicon(target)) + target.emp_act(EMP_HEAVY) + // Lockers + else if(istype(target_atom, /obj/structure/closet) && level_current >= 3) + var/obj/structure/closet/target_closet = target_atom + user.balloon_alert(user, "you prepare to bash [target_closet] open...") + if(!do_after(user, 2.5 SECONDS, target_closet)) + user.balloon_alert(user, "interrupted!") + return FALSE + target_closet.visible_message("[target_closet] breaks open as [user] bashes it!") + addtimer(CALLBACK(src, PROC_REF(break_closet), user, target_closet), 1) + playsound(get_turf(user), 'sound/effects/grillehit.ogg', 80, TRUE, -1) + // Airlocks + else if(istype(target_atom, /obj/machinery/door) && level_current >= 4) + var/obj/machinery/door/target_airlock = target_atom + playsound(get_turf(user), 'sound/machines/airlock_alien_prying.ogg', 40, TRUE, -1) + owner.balloon_alert(owner, "you prepare to tear open [target_airlock]...") + if(!do_after(user, 2.5 SECONDS, target_airlock)) + user.balloon_alert(user, "interrupted!") + return FALSE + if(target_airlock.Adjacent(user)) + target_airlock.visible_message("[target_airlock] breaks open as [user] bashes it!") + user.Stun(10) + user.do_attack_animation(target_airlock, ATTACK_EFFECT_SMASH) + playsound(get_turf(target_airlock), 'sound/effects/bang.ogg', 30, 1, -1) + target_airlock.open(2) // open(2) is like a crowbar or jaws of life. + +/datum/action/cooldown/vampire/targeted/brawn/CheckValidTarget(atom/target_atom) + . = ..() + if(!.) + return FALSE + return isliving(target_atom) || istype(target_atom, /obj/machinery/door) || istype(target_atom, /obj/structure/closet) + +/datum/action/cooldown/vampire/targeted/brawn/CheckCanTarget(atom/target_atom) + . = ..() + if(!.) + return FALSE + + // Can't be in a locker when targeting someone + if(istype(owner.loc, /obj/structure/closet)) + return FALSE + return isliving(target_atom) || istype(target_atom, /obj/machinery/door) || istype(target_atom, /obj/structure/closet) diff --git a/code/modules/antagonists/vampire/powers/targeted/haste.dm b/code/modules/antagonists/vampire/powers/targeted/haste.dm new file mode 100644 index 0000000000000..c9c71c3961905 --- /dev/null +++ b/code/modules/antagonists/vampire/powers/targeted/haste.dm @@ -0,0 +1,89 @@ +/* Level 1: Speed to location + * Level 2: Dodge Bullets + * Level 3: Stun People Passed + */ + +/datum/action/cooldown/vampire/targeted/haste + name = "Immortal Haste" + desc = "Dash somewhere with supernatural speed. Those nearby may be knocked away, stunned, or left empty-handed." + button_icon_state = "power_speed" + power_explanation = "\ + Click anywhere to immediately dash towards that location. \ + The Power will not work if you are lying down, in no gravity, or are aggressively grabbed. \ + Anyone in your way during your Haste will be knocked down. \ + Higher levels will increase the knockdown dealt to enemies." + power_flags = BP_AM_TOGGLE + check_flags = BP_CANT_USE_IN_TORPOR|BP_CANT_USE_IN_FRENZY|BP_CANT_USE_WHILE_INCAPACITATED|BP_CANT_USE_WHILE_UNCONSCIOUS + purchase_flags = VAMPIRE_CAN_BUY|VASSAL_CAN_BUY + bloodcost = 6 + cooldown_time = 12 SECONDS + target_range = 15 + power_activates_immediately = TRUE + ///List of all people hit by our power, so we don't hit them again. + var/list/hit = list() + +/datum/action/cooldown/vampire/targeted/haste/can_use(mob/living/carbon/user, trigger_flags) + . = ..() + if(!.) + return FALSE + // Being Grabbed + if(user.pulledby && user.pulledby.grab_state >= GRAB_AGGRESSIVE) + user.balloon_alert(user, "you're being grabbed!") + return FALSE + if(!user.has_gravity(user.loc)) //We dont want people to be able to use this to fly around in space + user.balloon_alert(user, "you cannot dash while floating!") + return FALSE + if(user.body_position == LYING_DOWN) + user.balloon_alert(user, "you must be standing to tackle!") + return FALSE + return TRUE + +/// Anything will do, if it's not me or my square +/datum/action/cooldown/vampire/targeted/haste/CheckValidTarget(atom/target_atom) + . = ..() + if(!.) + return FALSE + return target_atom.loc != owner.loc + +/// This is a non-async proc to make sure the power is "locked" until this finishes. +/datum/action/cooldown/vampire/targeted/haste/FireTargetedPower(atom/target_atom) + . = ..() + RegisterSignal(owner, COMSIG_MOVABLE_MOVED, PROC_REF(on_move)) + var/mob/living/user = owner + var/turf/targeted_turf = isturf(target_atom) ? target_atom : get_turf(target_atom) + // Pulled? Not anymore. + user.pulledby?.stop_pulling() + // Go to target turf + // DO NOT USE WALK TO. + owner.balloon_alert(owner, "you dash into the air!") + playsound(get_turf(owner), 'sound/weapons/punchmiss.ogg', 25, 1, -1) + var/safety = get_dist(user, targeted_turf) * 3 + 1 + var/consequetive_failures = 0 + while(--safety && (get_turf(user) != targeted_turf)) + var/success = step_towards(user, targeted_turf) //This does not try to go around obstacles. + if(!success) + success = step_to(user, targeted_turf) //this does + if(!success) + consequetive_failures++ + if(consequetive_failures >= 3) //if 3 steps don't work + break //just stop + else + consequetive_failures = 0 //reset so we can keep moving + if(user.resting || user.incapacitated(IGNORE_RESTRAINTS, IGNORE_GRAB)) //actually down? stop. + break + if(success) //don't sleep if we failed to move. + sleep(world.tick_lag) + +/datum/action/cooldown/vampire/targeted/haste/power_activated_sucessfully() + . = ..() + UnregisterSignal(owner, COMSIG_MOVABLE_MOVED) + hit.Cut() + +/datum/action/cooldown/vampire/targeted/haste/proc/on_move() + for(var/mob/living/hit_living in dview(1, get_turf(owner)) - owner) + if(hit.Find(hit_living)) + continue + hit += hit_living + playsound(hit_living, "sound/weapons/punch[rand(1,4)].ogg", 15, 1, -1) + hit_living.Knockdown(10 + level_current * 4) + hit_living.spin(10, 1) diff --git a/code/modules/antagonists/vampire/powers/targeted/lunge.dm b/code/modules/antagonists/vampire/powers/targeted/lunge.dm new file mode 100644 index 0000000000000..2b5545a87ecdd --- /dev/null +++ b/code/modules/antagonists/vampire/powers/targeted/lunge.dm @@ -0,0 +1,161 @@ +/datum/action/cooldown/vampire/targeted/lunge + name = "Predatory Lunge" + desc = "Spring at your target to grapple them without warning, or tear the dead's heart out. Attacks from concealment or the rear may even knock them down if strong enough." + button_icon_state = "power_lunge" + power_explanation = "Predatory Lunge:\n\ + Click any player to start spinning wildly and, after a short delay, lunge at them. \ + When lunging at someone, you will aggressively grab them, unless they are a curator. \ + You cannot use Lunge if you are already grabbing someone, or are being grabbed. \ + If you grab from behind or darkness, you will knock the target down, scaling with your rank. \ + If used on a dead body, you will tear their organs out. \ + At level 4, you will instantly lunge, but are limited to tackling from only 6 tiles away." + power_flags = NONE + check_flags = BP_CANT_USE_IN_TORPOR|BP_CANT_USE_IN_FRENZY|BP_CANT_USE_WHILE_INCAPACITATED|BP_CANT_USE_WHILE_UNCONSCIOUS + purchase_flags = VAMPIRE_CAN_BUY|VASSAL_CAN_BUY + bloodcost = 10 + cooldown_time = 10 SECONDS + power_activates_immediately = FALSE + +/datum/action/cooldown/vampire/targeted/lunge/upgrade_power() + . = ..() + //range is lowered when you get stronger. + if(level_current > 3) + target_range = 6 + +/datum/action/cooldown/vampire/targeted/lunge/can_use(mob/living/carbon/user, trigger_flags) + . = ..() + if(!.) + return FALSE + + if(user.pulledby && user.pulledby.grab_state >= GRAB_AGGRESSIVE) + owner.balloon_alert(user, "grabbed!") + return FALSE + if(user.pulling) + owner.balloon_alert(user, "grabbing someone!") + return FALSE + if(datum_flags & DF_ISPROCESSING) + owner.balloon_alert(user, "already lunging!") + return FALSE + return TRUE + +/// Check: Are we lunging at a person? +/datum/action/cooldown/vampire/targeted/lunge/CheckValidTarget(atom/target_atom) + . = ..() + if(!.) + return FALSE + return isliving(target_atom) + +/datum/action/cooldown/vampire/targeted/lunge/CheckCanTarget(atom/target_atom) + . = ..() + if(!.) + return FALSE + + if(!isturf(target_atom.loc)) + return FALSE + // Check: can the Vampire even move? + var/mob/living/user = owner + if(user.body_position == LYING_DOWN || HAS_TRAIT(owner, TRAIT_IMMOBILIZED)) + return FALSE + return TRUE + +/datum/action/cooldown/vampire/targeted/lunge/FireTargetedPower(atom/target_atom) + . = ..() + owner.face_atom(target_atom) + if(level_current > 3) + do_lunge(target_atom) + return + + prepare_target_lunge(target_atom) + return TRUE + +///Starts processing the power and prepares the lunge by spinning, calls lunge at the end of it. +/datum/action/cooldown/vampire/targeted/lunge/proc/prepare_target_lunge(atom/target_atom) + START_PROCESSING(SSprocessing, src) + owner.balloon_alert(owner, "lunge started!") + //animate them shake + var/base_x = owner.base_pixel_x + var/base_y = owner.base_pixel_y + animate(owner, pixel_x = base_x, pixel_y = base_y, time = 1, loop = -1) + for(var/i in 1 to 25) + var/x_offset = base_x + rand(-3, 3) + var/y_offset = base_y + rand(-3, 3) + animate(pixel_x = x_offset, pixel_y = y_offset, time = 1) + + if(!do_after(owner, 4 SECONDS, timed_action_flags = (IGNORE_USER_LOC_CHANGE|IGNORE_TARGET_LOC_CHANGE), extra_checks = CALLBACK(src, PROC_REF(CheckCanTarget), target_atom))) + end_target_lunge(base_x, base_y) + + return FALSE + + end_target_lunge() + do_lunge(target_atom) + return TRUE + +///When preparing to lunge ends, this clears it up. +/datum/action/cooldown/vampire/targeted/lunge/proc/end_target_lunge(base_x, base_y) + animate(owner, pixel_x = base_x, pixel_y = base_y, time = 1) + STOP_PROCESSING(SSprocessing, src) + +/datum/action/cooldown/vampire/targeted/lunge/process() + if(!active) //If running SSfasprocess (on cooldown) + return ..() //Manage our cooldown timers + if(prob(75)) + owner.spin(8, 1) + owner.balloon_alert_to_viewers("spins wildly!", "you spin!") + return + do_smoke(0, owner.loc, smoke_type = /obj/effect/particle_effect/smoke/transparent) + +///Actually lunges the target, then calls lunge end. +/datum/action/cooldown/vampire/targeted/lunge/proc/do_lunge(atom/hit_atom) + var/turf/targeted_turf = get_turf(hit_atom) + + var/safety = get_dist(owner, targeted_turf) * 3 + 1 + var/consequetive_failures = 0 + while(--safety && !hit_atom.Adjacent(owner)) + if(!step_to(owner, targeted_turf)) + consequetive_failures++ + if(consequetive_failures >= 3) // If 3 steps don't work, just stop. + break + + lunge_end(hit_atom, targeted_turf) + +/datum/action/cooldown/vampire/targeted/lunge/proc/lunge_end(atom/hit_atom, turf/target_turf) + power_activated_sucessfully() + // Am I next to my target to start giving the effects? + if(!owner.Adjacent(hit_atom)) + return + + var/mob/living/user = owner + var/mob/living/carbon/target = hit_atom + + // Did I slip or get knocked unconscious? + if(user.body_position != STANDING_UP || user.incapacitated()) + var/send_dir = get_dir(user, target_turf) + new /datum/forced_movement(user, get_ranged_target_turf(user, send_dir, 1), 1, FALSE) + user.spin(10) + return + + if(IS_CURATOR(target) || target.is_shove_knockdown_blocked()) + owner.balloon_alert(owner, "pushed away!") + target.grabbedby(owner) + return + + owner.balloon_alert(owner, "you lunge at [target]!") + if(target.stat == DEAD) + playsound(get_turf(target), 'sound/effects/splat.ogg', 40, TRUE) + owner.visible_message( + "[owner] tears into [target]'s chest!", + "You tear into [target]'s chest!", + ) + var/obj/item/bodypart/chest/chest = target.get_bodypart(BODY_ZONE_CHEST) + chest.dismember() + else + target.grabbedby(owner) + target.grippedby(owner, instant = TRUE) + // Did we knock them down? + if(!is_source_facing_target(target, owner) || owner.alpha <= 40) + target.Knockdown(10 + level_current * 5) + target.Paralyze(0.1) + +/datum/action/cooldown/vampire/targeted/lunge/DeactivatePower() + REMOVE_TRAIT(owner, TRAIT_IMMOBILIZED, TRAIT_VAMPIRE) + return ..() diff --git a/code/modules/antagonists/vampire/powers/targeted/mesmerize.dm b/code/modules/antagonists/vampire/powers/targeted/mesmerize.dm new file mode 100644 index 0000000000000..ed4aebfb72bd1 --- /dev/null +++ b/code/modules/antagonists/vampire/powers/targeted/mesmerize.dm @@ -0,0 +1,139 @@ +/** + * MEZMERIZE + * Locks a target in place for a certain amount of time. + * + * Level 2: Additionally mutes + * Level 3: Can be used through face protection + * Level 5: Doesn't need to be facing you anymore + */ + +/datum/action/cooldown/vampire/targeted/mesmerize + name = "Mesmerize" + desc = "Dominate the mind of a mortal who can see your eyes." + button_icon_state = "power_mez" + power_explanation = "\ + Click any player to attempt to mesmerize them, and freeze them in place. \ + You cannot wear anything covering your face, and both parties must be facing eachother. \ + If your target is already mesmerized or a Curator, you will fail. \ + Once mesmerized, the target will be unable to move for a certain amount of time, scaling your rank. \ + At level 2, your target will additionally be muted. \ + At level 3, you will be able to use the power through masks and helmets. \ + At level 5, you will be able to mesmerize regardless of your target's direction." + power_flags = NONE + check_flags = BP_CANT_USE_IN_TORPOR|BP_CANT_USE_IN_FRENZY|BP_CANT_USE_WHILE_INCAPACITATED|BP_CANT_USE_WHILE_UNCONSCIOUS + purchase_flags = VAMPIRE_CAN_BUY|VASSAL_CAN_BUY + bloodcost = 30 + cooldown_time = 20 SECONDS + target_range = 8 + power_activates_immediately = FALSE + prefire_message = "Whom will you subvert to your will?" + ///Our mesmerized target - Prevents several mesmerizes. + var/datum/weakref/target_ref + +/datum/action/cooldown/vampire/targeted/mesmerize/can_use(mob/living/carbon/user, trigger_flags) + . = ..() + if(!.) // Default checks + return FALSE + if(!user.getorganslot(ORGAN_SLOT_EYES)) + // Cant use balloon alert, they've got no eyes! + to_chat(user, "You have no eyes with which to mesmerize.") + return FALSE + // Check: Eyes covered? + if(istype(user) && (user.is_eyes_covered() && level_current <= 2) || !isturf(user.loc)) + user.balloon_alert(user, "your eyes are concealed from sight.") + return FALSE + return TRUE + +/datum/action/cooldown/vampire/targeted/mesmerize/CheckValidTarget(atom/target_atom) + . = ..() + if(!.) + return FALSE + return isliving(target_atom) + +/datum/action/cooldown/vampire/targeted/mesmerize/CheckCanTarget(atom/target_atom) + . = ..() + if(!.) + return FALSE + var/mob/living/current_target = target_atom // We already know it's carbon due to CheckValidTarget() + // No mind + if(!current_target.mind) + owner.balloon_alert(owner, "[current_target] is mindless.") + return FALSE + // Vampire + if(IS_VAMPIRE(current_target)) + owner.balloon_alert(owner, "vampires are immune to [src].") + return FALSE + // Dead/Unconscious + if(current_target.stat > CONSCIOUS) + owner.balloon_alert(owner, "[current_target] is not [(current_target.stat == DEAD || HAS_TRAIT(current_target, TRAIT_FAKEDEATH)) ? "alive" : "conscious"].") + return FALSE + // Target has eyes? + if(!current_target.getorganslot(ORGAN_SLOT_EYES) && !issilicon(current_target)) + owner.balloon_alert(owner, "[current_target] has no eyes.") + return FALSE + // Target blind? + if(current_target.is_blind() && !issilicon(current_target)) + owner.balloon_alert(owner, "[current_target] is blind.") + return FALSE + // Facing target? + if(!is_source_facing_target(owner, current_target)) // in unsorted.dm + owner.balloon_alert(owner, "you must be facing [current_target].") + return FALSE + // Target facing me? (On the floor, they're facing everyone) + if(((current_target.mobility_flags & MOBILITY_STAND) && !is_source_facing_target(current_target, owner) && level_current <= 4)) + owner.balloon_alert(owner, "[current_target] must be facing you.") + return FALSE + + // Gone through our checks, let's mark our guy. + target_ref = WEAKREF(current_target) + return TRUE + +/datum/action/cooldown/vampire/targeted/mesmerize/FireTargetedPower(atom/target_atom) + . = ..() + + var/mob/living/user = owner + var/mob/living/carbon/mesmerized_target = target_ref.resolve() + + if(issilicon(mesmerized_target)) + var/mob/living/silicon/mesmerized = mesmerized_target + mesmerized.emp_act(EMP_HEAVY) + owner.balloon_alert(owner, "temporarily shut [mesmerized] down.") + power_activated_sucessfully() // PAY COST! BEGIN COOLDOWN! + return + + if(istype(mesmerized_target)) + owner.balloon_alert(owner, "attempting to hypnotically gaze [mesmerized_target]...") + + if(!do_after(user, 4 SECONDS, mesmerized_target, NONE, TRUE, extra_checks = CALLBACK(src, PROC_REF(ContinueActive), user, mesmerized_target))) + return + + var/power_time = 9 SECONDS + level_current * 1.5 SECONDS + if(IS_CURATOR(mesmerized_target)) + to_chat(mesmerized_target, "You feel your eyes burn for a while, but it passes.") + return + if(HAS_TRAIT_FROM(mesmerized_target, TRAIT_MUTE, TRAIT_VAMPIRE)) + owner.balloon_alert(owner, "[mesmerized_target] is already in a hypnotic gaze.") + return + if(iscarbon(mesmerized_target)) + owner.balloon_alert(owner, "successfully mesmerized [mesmerized_target].") + if(level_current >= 2) + ADD_TRAIT(mesmerized_target, TRAIT_MUTE, TRAIT_VAMPIRE) + mesmerized_target.Immobilize(power_time) + mesmerized_target.next_move = world.time + power_time // <--- Use direct change instead. We want an unmodified delay to their next move // mesmerized_target.changeNext_move(power_time) // check click.dm + mesmerized_target.notransform = TRUE // <--- Fuck it. We tried using next_move, but they could STILL resist. We're just doing a hard freeze. + addtimer(CALLBACK(src, PROC_REF(end_mesmerize), user, mesmerized_target), power_time) + power_activated_sucessfully() // PAY COST! BEGIN COOLDOWN! + +/datum/action/cooldown/vampire/targeted/mesmerize/DeactivatePower() + target_ref = null + . = ..() + +/datum/action/cooldown/vampire/targeted/mesmerize/proc/end_mesmerize(mob/living/user, mob/living/target) + target.notransform = FALSE + REMOVE_TRAIT(target, TRAIT_MUTE, TRAIT_VAMPIRE) + // They Woke Up! (Notice if within view) + if(istype(user) && target.stat == CONSCIOUS && (target in view(6, get_turf(user)))) + owner.balloon_alert(owner, "[target] snapped out of their trance.") + +/datum/action/cooldown/vampire/targeted/mesmerize/ContinueActive(mob/living/user, mob/living/target) + return ..() && can_use(user) && CheckCanTarget(target) diff --git a/code/modules/antagonists/vampire/powers/targeted/trespass.dm b/code/modules/antagonists/vampire/powers/targeted/trespass.dm new file mode 100644 index 0000000000000..76b69592001cd --- /dev/null +++ b/code/modules/antagonists/vampire/powers/targeted/trespass.dm @@ -0,0 +1,103 @@ +/datum/action/cooldown/vampire/targeted/trespass + name = "Trespass" + desc = "Become mist and advance two tiles in one direction. Useful for skipping past doors and barricades." + button_icon_state = "power_tres" + power_explanation = "\ + Click anywhere from 1-2 tiles away from you to teleport. \ + This power goes through all obstacles except Walls. \ + Higher levels decrease the sound played from using the Power, and increase the speed of the transition." + power_flags = BP_AM_TOGGLE + check_flags = BP_CANT_USE_IN_TORPOR|BP_CANT_USE_WHILE_INCAPACITATED|BP_CANT_USE_WHILE_UNCONSCIOUS + purchase_flags = VAMPIRE_CAN_BUY|VASSAL_CAN_BUY + bloodcost = 10 + cooldown_time = 8 SECONDS + prefire_message = "Select a destination." + //target_range = 2 + var/turf/target_turf // We need to decide where we're going based on where we clicked. It's not actually the tile we clicked. + +/datum/action/cooldown/vampire/targeted/trespass/can_use(mob/living/carbon/user, trigger_flags) + . = ..() + if(!.) + return FALSE + if(user.notransform || !get_turf(user)) + return FALSE + return TRUE + + +/datum/action/cooldown/vampire/targeted/trespass/CheckValidTarget(atom/target_atom) + . = ..() + if(!.) + return FALSE + // Can't target my tile + if(target_atom == get_turf(owner) || get_turf(target_atom) == get_turf(owner)) + return FALSE + return TRUE // All we care about is destination. Anything you click is fine. + + +/datum/action/cooldown/vampire/targeted/trespass/CheckCanTarget(atom/target_atom) + var/final_turf = isturf(target_atom) ? target_atom : get_turf(target_atom) + + // Are either tiles WALLS? + var/turf/from_turf = get_turf(owner) + var/this_dir + for(var/i = 1 to 2) + // Keep Prev Direction if we've reached final turf + if(from_turf != final_turf) + this_dir = get_dir(from_turf, final_turf) // Recalculate dir so we don't overshoot on a diagonal. + from_turf = get_step(from_turf, this_dir) + // ERROR! Wall! + if(iswallturf(from_turf)) + var/wallwarning = (i == 1) ? "in the way" : "at your destination" + owner.balloon_alert(owner, "There is a wall [wallwarning].") + return FALSE + // Done + target_turf = from_turf + + return TRUE + +/datum/action/cooldown/vampire/targeted/trespass/FireTargetedPower(atom/target_atom) + . = ..() + + // Find target turf, at or below Atom + var/mob/living/carbon/user = owner + var/turf/my_turf = get_turf(owner) + + user.visible_message( + "[user]'s form dissipates into a cloud of mist!", + "You disspiate into formless mist.", + ) + // Effect Origin + var/sound_strength = max(60, 70 - level_current * 10) + playsound(get_turf(owner), 'sound/magic/summon_karp.ogg', sound_strength, 1) + var/datum/effect_system/steam_spread/vampire/puff = new /datum/effect_system/steam_spread() + puff.set_up(3, 0, my_turf) + puff.start() + + var/mist_delay = max(5, 20 - level_current * 2.5) // Level up and do this faster. + + // Freeze Me + user.Stun(mist_delay, ignore_canstun = TRUE) + user.density = FALSE + var/invis_was = user.invisibility + user.invisibility = INVISIBILITY_MAXIMUM + + // Wait... + sleep(mist_delay / 2) + // Move & Freeze + if(isturf(target_turf)) + do_teleport(owner, target_turf, no_effects=TRUE, channel = TELEPORT_CHANNEL_QUANTUM) // in teleport.dm? + user.Stun(mist_delay / 2, ignore_canstun = TRUE) + + // Wait... + sleep(mist_delay / 2) + // Un-Hide & Freeze + user.dir = get_dir(my_turf, target_turf) + user.Stun(mist_delay / 2, ignore_canstun = TRUE) + user.density = 1 + user.invisibility = invis_was + // Effect Destination + playsound(get_turf(owner), 'sound/magic/summon_karp.ogg', 60, 1) + puff = new /datum/effect_system/steam_spread/() + puff.effect_type = /obj/effect/particle_effect/smoke/vampsmoke + puff.set_up(3, 0, target_turf) + puff.start() diff --git a/code/modules/antagonists/vampire/powers/tremere/_tremere.dm b/code/modules/antagonists/vampire/powers/tremere/_tremere.dm new file mode 100644 index 0000000000000..baf56a95eafa7 --- /dev/null +++ b/code/modules/antagonists/vampire/powers/tremere/_tremere.dm @@ -0,0 +1,26 @@ +/** + * # Tremere Powers + * + * This file is for Tremere power procs and Vampire procs that deals exclusively with Tremere. + * Tremere has quite a bit of unique things to it, so I thought it's own subtype would be nice + */ + +/datum/action/cooldown/vampire/targeted/tremere + name = "Tremere Gift" + desc = "A Tremere exclusive gift." + background_icon_state = "tremere_power_off" + button_icon_state = "power_auspex" + + background_icon_state_on = "tremere_power_on" + background_icon_state_off = "tremere_power_off" + + // Tremere powers don't level up, we have them hardcoded. + level_current = 0 + // Re-defining these as we want total control over them + power_flags = BP_AM_TOGGLE|BP_AM_STATIC_COOLDOWN + purchase_flags = TREMERE_CAN_BUY + // Targeted stuff + power_activates_immediately = FALSE + + ///The upgraded version of this Power. 'null' means it's the max level. + var/upgraded_power = null diff --git a/code/modules/antagonists/vampire/powers/tremere/auspex.dm b/code/modules/antagonists/vampire/powers/tremere/auspex.dm new file mode 100644 index 0000000000000..8f5dd4286a94a --- /dev/null +++ b/code/modules/antagonists/vampire/powers/tremere/auspex.dm @@ -0,0 +1,119 @@ +/** + * # Auspex + * + * Level 1 - Cloak of Darkness until clicking an area, teleports the user to the selected area (max 2 tile) + * Level 2 - Cloak of Darkness until clicking an area, teleports the user to the selected area (max 3 tiles) + * Level 3 - Cloak of Darkness until clicking an area, teleports the user to the selected area + * Level 4 - Cloak of Darkness until clicking an area, teleports the user to the selected area, causes nearby people to bleed. + * Level 5 - Cloak of Darkness until clicking an area, teleports the user to the selected area, causes nearby people to fall asleep. + */ + +// Look to /datum/action/cooldown/spell/pointed/void_phase for help. + +/datum/action/cooldown/vampire/targeted/tremere/auspex + name = "Level 1: Auspex" + upgraded_power = /datum/action/cooldown/vampire/targeted/tremere/auspex/two + level_current = 1 + desc = "Hide yourself within a Cloak of Darkness, click on an area to teleport up to 2 tiles away." + button_icon_state = "power_auspex" + power_explanation = "\ + When Activated, you will be hidden in a Cloak of Darkness. \ + Click any area up to 2 tiles away to teleport there and reveal yourself." + check_flags = BP_CANT_USE_IN_TORPOR|BP_CANT_USE_WHILE_INCAPACITATED|BP_CANT_USE_WHILE_UNCONSCIOUS + bloodcost = 5 + constant_bloodcost = 2 + cooldown_time = 12 SECONDS + target_range = 2 + prefire_message = "Where do you wish to teleport to?" + +/datum/action/cooldown/vampire/targeted/tremere/auspex/two + name = "Level 2: Auspex" + upgraded_power = /datum/action/cooldown/vampire/targeted/tremere/auspex/three + level_current = 2 + desc = "Hide yourself within a Cloak of Darkness, click on an area to teleport up to 3 tiles away." + power_explanation = "\ + When Activated, you will be hidden in a Cloak of Darkness. \ + Click any area up to 3 tiles away to teleport there and reveal yourself." + bloodcost = 10 + cooldown_time = 10 SECONDS + target_range = 3 + +/datum/action/cooldown/vampire/targeted/tremere/auspex/three + name = "Level 3: Auspex" + upgraded_power = /datum/action/cooldown/vampire/targeted/tremere/auspex/advanced + level_current = 3 + desc = "Hide yourself within a Cloak of Darkness, click on an area to teleport." + power_explanation = "\ + When Activated, you will be hidden in a Cloak of Darkness. \ + Click any area to teleport there and reveal yourself." + bloodcost = 15 + cooldown_time = 8 SECONDS + target_range = null + +/datum/action/cooldown/vampire/targeted/tremere/auspex/advanced + name = "Level 4: Auspex" + upgraded_power = /datum/action/cooldown/vampire/targeted/tremere/auspex/advanced/two + level_current = 4 + desc = "Hide yourself within a Cloak of Darkness, click on an area to teleport, leaving nearby people bleeding." + power_explanation = "\ + When Activated, you will be hidden in a Cloak of Darkness. \ + Click any area to teleport there and reveal yourself. \ + Additionally, people at your current location will be left bleeding." + background_icon_state_on = "tremere_power_gold_on" + background_icon_state_off = "tremere_power_gold_off" + bloodcost = 20 + cooldown_time = 6 SECONDS + target_range = null + +/datum/action/cooldown/vampire/targeted/tremere/auspex/advanced/two + name = "Level 5: Auspex" + upgraded_power = null + level_current = 5 + desc = "Hide yourself within a Cloak of Darkness, click on an area to teleport, leaving nearby people bleeding and asleep." + power_explanation = "\ + When Activated, you will be hidden in a Cloak of Darkness. \ + Click any area to teleport there and reveal yourself. \ + Additionally, people at your targeted location will fall over in pain." + bloodcost = 25 + cooldown_time = 8 SECONDS + +/datum/action/cooldown/vampire/targeted/tremere/auspex/CheckValidTarget(atom/target_atom) + . = ..() + if(!.) + return FALSE + return isturf(target_atom) + +/datum/action/cooldown/vampire/targeted/tremere/auspex/ActivatePower(trigger_flags) + . = ..() + owner.AddElement(/datum/element/digital_camo) + animate(owner, alpha = 15, time = 1 SECONDS) + +/datum/action/cooldown/vampire/targeted/tremere/auspex/DeactivatePower() + animate(owner, alpha = 255, time = 1 SECONDS) + owner.RemoveElement(/datum/element/digital_camo) + return ..() + +/datum/action/cooldown/vampire/targeted/tremere/auspex/FireTargetedPower(atom/target_atom) + . = ..() + var/mob/living/user = owner + var/turf/targeted_turf = get_turf(target_atom) + auspex_blink(user, targeted_turf) + +/datum/action/cooldown/vampire/targeted/tremere/auspex/proc/auspex_blink(mob/living/user, turf/targeted_turf) + playsound(user, 'sound/magic/summon_karp.ogg', 60) + playsound(targeted_turf, 'sound/magic/summon_karp.ogg', 60) + + new /obj/effect/particle_effect/smoke/vampsmoke(user.drop_location()) + new /obj/effect/particle_effect/smoke/vampsmoke(targeted_turf) + + for(var/mob/living/carbon/living_mob in range(1, targeted_turf)-user) + if(IS_VAMPIRE(living_mob) || IS_VASSAL(living_mob)) + continue + if(level_current >= 4) + living_mob.add_bleeding(BLEED_CRITICAL) + living_mob.adjustBruteLoss(15) + if(level_current >= 5) + living_mob.Knockdown(10 SECONDS, ignore_canstun = TRUE) + + do_teleport(owner, targeted_turf, no_effects = TRUE, channel = TELEPORT_CHANNEL_QUANTUM) + power_activated_sucessfully() diff --git a/code/modules/antagonists/vampire/powers/tremere/dominate.dm b/code/modules/antagonists/vampire/powers/tremere/dominate.dm new file mode 100644 index 0000000000000..45b09ca274208 --- /dev/null +++ b/code/modules/antagonists/vampire/powers/tremere/dominate.dm @@ -0,0 +1,195 @@ +/** + * # Dominate; + * + * Level 1 - Mesmerizes target + * Level 2 - Mesmerizes and mutes target + * Level 3 - Mesmerizes, blinds and mutes target + * Level 4 - Target (if at least in crit & has a mind) will revive as a Mute/Deaf Vassal for 5 minutes before dying. + * Level 5 - Target (if at least in crit & has a mind) will revive as a Vassal for 8 minutes before dying. + */ + +// Copied from mesmerize.dm + +/datum/action/cooldown/vampire/targeted/tremere/dominate + name = "Level 1: Dominate" + upgraded_power = /datum/action/cooldown/vampire/targeted/tremere/dominate/two + level_current = 1 + desc = "Mesmerize any foe who stands still long enough." + button_icon_state = "power_dominate" + power_explanation = "\ + Click any person to mesmerize them after 4 seconds. \ + This will completely immobilize them for the next 10 seconds." + check_flags = BP_CANT_USE_IN_TORPOR|BP_CANT_USE_IN_FRENZY|BP_CANT_USE_WHILE_UNCONSCIOUS + bloodcost = 15 + constant_bloodcost = 2 + cooldown_time = 50 SECONDS + target_range = 6 + prefire_message = "Select a target." + +/datum/action/cooldown/vampire/targeted/tremere/dominate/two + name = "Level 2: Dominate" + upgraded_power = /datum/action/cooldown/vampire/targeted/tremere/dominate/three + level_current = 2 + desc = "Mesmerize and mute any foe who stands still long enough." + power_explanation = "\ + Click any person to mesmerize them after 4 seconds. \ + This will completely immobilize and mute them for the next 12 seconds." + bloodcost = 20 + cooldown_time = 40 SECONDS + +/datum/action/cooldown/vampire/targeted/tremere/dominate/three + name = "Level 3: Dominate" + upgraded_power = /datum/action/cooldown/vampire/targeted/tremere/dominate/advanced + level_current = 3 + desc = "Mesmerize, mute and blind any foe who stands still long enough." + power_explanation = "\ + Click any person to mesmerize them after 4 seconds. \ + This will completely immobilize, mute, and blind them for the next 14 seconds." + bloodcost = 30 + cooldown_time = 35 SECONDS + +/datum/action/cooldown/vampire/targeted/tremere/dominate/CheckValidTarget(atom/target_atom) + . = ..() + if(!.) + return FALSE + return isliving(target_atom) + +/datum/action/cooldown/vampire/targeted/tremere/dominate/CheckCanTarget(atom/target_atom) + . = ..() + if(!.) + return FALSE + var/mob/living/selected_target = target_atom + if(!selected_target.mind) + owner.balloon_alert(owner, "[selected_target] is mindless.") + return FALSE + return TRUE + +/datum/action/cooldown/vampire/targeted/tremere/dominate/advanced + name = "Level 4: Possession" + upgraded_power = /datum/action/cooldown/vampire/targeted/tremere/dominate/advanced/two + level_current = 4 + desc = "Mesmerize, mute and blind any foe who stands still long enough, or convert the damaged to temporary Vassals." + power_explanation = "\ + Click any person to mesmerize them after 4 seconds.\ + This will completely immobilize, mute, and blind them for the next 14 seconds. \ + However, if you are adjacent to the target, and they are in critical condition or dead, they will be turned into a temporary mute Vassal. \ + After 5 minutes, they will die. \ + If you use this on a dead Vassal, you will revive them." + background_icon_state = "tremere_power_gold_off" + background_icon_state_on = "tremere_power_gold_on" + background_icon_state_off = "tremere_power_gold_off" + bloodcost = 80 + cooldown_time = 3 MINUTES + +/datum/action/cooldown/vampire/targeted/tremere/dominate/advanced/two + name = "Level 5: Possession" + desc = "Mesmerize, mute and blind any foe who stands still long enough, or convert the damaged to temporary Vassals." + level_current = 5 + upgraded_power = null + power_explanation = "\ + Click any person to mesmerize them after 4 seconds.\ + This will completely immobilize, mute, and blind them for the next 14 seconds. \ + However, if you are adjacent to the target, and they are in critical condition or dead, they will be turned into a temporary mute Vassal. \ + After 8 minutes, they will die. \ + If you use this on a dead Vassal, you will revive them." + bloodcost = 100 + cooldown_time = 2 MINUTES + +// The advanced version +/datum/action/cooldown/vampire/targeted/tremere/dominate/advanced/CheckCanTarget(atom/target_atom) + . = ..() + if(!.) + return FALSE + + var/mob/living/selected_target = target_atom + if((IS_VASSAL(selected_target) || selected_target.stat >= SOFT_CRIT) && !owner.Adjacent(selected_target)) + owner.balloon_alert(owner, "out of range.") + return FALSE + return TRUE + +/datum/action/cooldown/vampire/targeted/tremere/dominate/FireTargetedPower(atom/target_atom) + . = ..() + var/mob/living/target = target_atom + var/mob/living/user = owner + if(target.stat >= SOFT_CRIT && user.Adjacent(target) && level_current >= 4) + attempt_vassalize(target, user) + return + else if(IS_VASSAL(target)) + owner.balloon_alert(owner, "vassal cant be revived") + return + attempt_mesmerize(target, user) + +/datum/action/cooldown/vampire/targeted/tremere/dominate/proc/attempt_mesmerize(mob/living/target, mob/living/user) + owner.balloon_alert(owner, "attempting to mesmerize.") + if(!do_after(user, 3 SECONDS, target, NONE, TRUE)) + return + + power_activated_sucessfully() + var/power_time = 90 + level_current * 15 + if(IS_CURATOR(target)) + to_chat(target, "You feel you something crawling under your skin, but it passes.") + return + if(HAS_TRAIT_FROM(target, TRAIT_MUTE, TRAIT_VAMPIRE)) + owner.balloon_alert(owner, "[target] is already in some form of hypnotic gaze.") + return + if(iscarbon(target)) + var/mob/living/carbon/mesmerized = target + owner.balloon_alert(owner, "successfully mesmerized [mesmerized].") + if(level_current >= 2) + ADD_TRAIT(target, TRAIT_MUTE, TRAIT_VAMPIRE) + if(level_current >= 3) + target.become_blind(TRAIT_VAMPIRE) + mesmerized.Immobilize(power_time) + mesmerized.next_move = world.time + power_time + mesmerized.notransform = TRUE + addtimer(CALLBACK(src, PROC_REF(end_mesmerize), user, target), power_time) + if(issilicon(target)) + var/mob/living/silicon/mesmerized = target + mesmerized.emp_act(EMP_HEAVY) + owner.balloon_alert(owner, "temporarily shut [mesmerized] down.") + +/datum/action/cooldown/vampire/targeted/tremere/proc/end_mesmerize(mob/living/user, mob/living/target) + target.notransform = FALSE + target.cure_blind(TRAIT_VAMPIRE) + REMOVE_TRAIT(target, TRAIT_MUTE, TRAIT_VAMPIRE) + if(istype(user) && target.stat == CONSCIOUS && (target in view(6, get_turf(user)))) + owner.balloon_alert(owner, "[target] snapped out of their trance.") + +/datum/action/cooldown/vampire/targeted/tremere/dominate/proc/attempt_vassalize(mob/living/target, mob/living/user) + owner.balloon_alert(owner, "attempting to vassalize.") + if(!do_after(user, 6 SECONDS, target, NONE, TRUE)) + return + + if(IS_VASSAL(target)) + power_activated_sucessfully() + to_chat(user, "We revive [target]!") + target.mind.grab_ghost() + target.revive(full_heal = TRUE) + return + if(IS_CURATOR(target)) + to_chat(target, "Their body refuses to react...") + return + if(!vampiredatum_power.can_make_vassal(target)) + return + vampiredatum_power.make_vassal(target) + power_activated_sucessfully() + to_chat(user, "We revive [target]!") + target.mind.grab_ghost() + target.revive(full_heal = TRUE) + var/datum/antagonist/vassal/vassaldatum = target.mind.has_antag_datum(/datum/antagonist/vassal) + vassaldatum.special_type = TREMERE_VASSAL //don't turn them into a favorite please + var/living_time + if(level_current == 4) + living_time = 5 MINUTES + ADD_TRAIT(target, TRAIT_MUTE, TRAIT_VAMPIRE) + ADD_TRAIT(owner, TRAIT_DEAF, TRAIT_VAMPIRE) + else if(level_current == 5) + living_time = 8 MINUTES + addtimer(CALLBACK(src, PROC_REF(end_possession), target), living_time) + +/datum/action/cooldown/vampire/targeted/tremere/proc/end_possession(mob/living/user) + REMOVE_TRAIT(user, TRAIT_MUTE, TRAIT_VAMPIRE) + REMOVE_TRAIT(user, TRAIT_DEAF, TRAIT_VAMPIRE) + user.mind.remove_antag_datum(/datum/antagonist/vassal) + to_chat(user, "You feel the Blood of your Master run out!") + user.death() diff --git a/code/modules/antagonists/vampire/powers/tremere/thaumaturgey.dm b/code/modules/antagonists/vampire/powers/tremere/thaumaturgey.dm new file mode 100644 index 0000000000000..6b6df79d79124 --- /dev/null +++ b/code/modules/antagonists/vampire/powers/tremere/thaumaturgey.dm @@ -0,0 +1,184 @@ +/** + * # Thaumaturgy + * + * Level 1 - One shot bloodbeam spell + * Level 2 - Bloodbeam spell - Gives them a Blood shield until they use Bloodbeam + * Level 3 - Bloodbeam spell that breaks open lockers/doors - Gives them a Blood shield until they use Bloodbeam + * Level 4 - Bloodbeam spell that breaks open lockers/doors + double damage to victims - Gives them a Blood shield until they use Bloodbeam + * Level 5 - Bloodbeam spell that breaks open lockers/doors + double damage & steals blood - Gives them a Blood shield until they use Bloodbeam + */ + +/datum/action/cooldown/vampire/targeted/tremere/thaumaturgy + name = "Level 1: Thaumaturgy" + upgraded_power = /datum/action/cooldown/vampire/targeted/tremere/thaumaturgy/two + desc = "Fire a blood bolt at your enemy, dealing Burn damage." + level_current = 1 + button_icon_state = "power_thaumaturgy" + power_explanation = "Shoots a blood bolt spell that deals burn damage" + check_flags = BP_CANT_USE_IN_TORPOR|BP_CANT_USE_IN_FRENZY|BP_CANT_USE_WHILE_UNCONSCIOUS + bloodcost = 20 + constant_bloodcost = 0 + cooldown_time = 6 SECONDS + prefire_message = "Click where you wish to fire." + ///Blood shield given while this Power is active. + var/datum/weakref/blood_shield + +/datum/action/cooldown/vampire/targeted/tremere/thaumaturgy/two + name = "Level 2: Thaumaturgy" + upgraded_power = /datum/action/cooldown/vampire/targeted/tremere/thaumaturgy/three + desc = "Create a Blood shield and fire a blood bolt at your enemy, dealing Burn damage." + level_current = 2 + power_explanation = "\ + Activating Thaumaturgy will temporarily give you a Blood Shield, \ + The blood shield has a 75% block chance, but costs 15 Blood per hit to maintain. \ + You can also fire a blood bolt which will deactivate your shield." + prefire_message = "Click where you wish to fire (using your power removes blood shield)." + bloodcost = 40 + cooldown_time = 4 SECONDS + +/datum/action/cooldown/vampire/targeted/tremere/thaumaturgy/three + name = "Level 3: Thaumaturgy" + upgraded_power = /datum/action/cooldown/vampire/targeted/tremere/thaumaturgy/advanced + desc = "Create a Blood shield and fire a blood bolt, dealing Burn damage and opening doors/lockers." + level_current = 3 + power_explanation = "\ + Activating Thaumaturgy will temporarily give you a Blood Shield, \ + The blood shield has a 75% block chance, but costs 15 Blood per hit to maintain. \ + You can also fire a blood bolt which will deactivate your shield. \ + If the blood bolt hits a locker or door, it will open it." + bloodcost = 50 + cooldown_time = 6 SECONDS + +/datum/action/cooldown/vampire/targeted/tremere/thaumaturgy/advanced + name = "Level 4: Blood Strike" + upgraded_power = /datum/action/cooldown/vampire/targeted/tremere/thaumaturgy/advanced/two + desc = "Create a Blood shield and fire a blood bolt, dealing Burn damage and opening doors/lockers." + level_current = 4 + power_explanation = "\ + Activating Thaumaturgy will temporarily give you a Blood Shield, \ + The blood shield has a 75% block chance, but costs 15 Blood per hit to maintain. \ + You can also fire a blood bolt which will deactivate your shield. \ + If the blood bolt hits a locker or door, it will open it. \ + Your blood bolt does more damage." + background_icon_state = "tremere_power_gold_off" + background_icon_state_on = "tremere_power_gold_on" + background_icon_state_off = "tremere_power_gold_off" + prefire_message = "Click where you wish to fire (using your power removes blood shield)." + bloodcost = 60 + cooldown_time = 6 SECONDS + +/datum/action/cooldown/vampire/targeted/tremere/thaumaturgy/advanced/two + name = "Level 5: Blood Strike" + upgraded_power = null + desc = "Create a Blood shield and fire a blood bolt, dealing Burn damage, stealing Blood and opening doors/lockers." + level_current = 5 + power_explanation = "\ + Activating Thaumaturgy will temporarily give you a Blood Shield, \ + The blood shield has a 75% block chance, but costs 15 Blood per hit to maintain. \ + You can also fire a blood bolt which will deactivate your shield. \ + If the blood bolt hits a locker or door, it will open it. \ + Your blood bolt does more damage, and if it hits a person will steal blood" + bloodcost = 80 + cooldown_time = 8 SECONDS + +/datum/action/cooldown/vampire/targeted/tremere/thaumaturgy/ActivatePower(trigger_flags) + . = ..() + owner.balloon_alert(owner, "you start thaumaturgy") + if(level_current >= 2) // Only if we're at least level 2. + var/obj/item/shield/vampire/new_shield = new + blood_shield = WEAKREF(new_shield) + if(!owner.put_in_inactive_hand(new_shield)) + owner.balloon_alert(owner, "off hand is full!") + to_chat(owner, "Blood shield couldn't be activated as your off hand is full.") + return FALSE + owner.visible_message( + "[owner]\'s hands begins to bleed and forms into a blood shield!", + "We activate our Blood shield!", + "You hear liquids forming together.", + ) + +/datum/action/cooldown/vampire/targeted/tremere/thaumaturgy/DeactivatePower() + if(blood_shield) + QDEL_NULL(blood_shield) + return ..() + +/datum/action/cooldown/vampire/targeted/tremere/thaumaturgy/FireTargetedPower(atom/target_atom) + . = ..() + + var/mob/living/user = owner + owner.balloon_alert(owner, "you fire a blood bolt!") + to_chat(user, "You fire a blood bolt!") + user.changeNext_move(CLICK_CD_RANGE) + user.newtonian_move(get_dir(target_atom, user)) + var/obj/projectile/magic/arcane_barrage/vampire/bolt = new(user.loc) + bolt.vampire_power = src + bolt.firer = user + bolt.def_zone = ran_zone(user.get_combat_bodyzone()) + bolt.preparePixelProjectile(target_atom, user) + INVOKE_ASYNC(bolt, TYPE_PROC_REF(/obj/projectile, fire)) + playsound(user, 'sound/magic/wand_teleport.ogg', 60, TRUE) + power_activated_sucessfully() + +/** + * # Blood Bolt + * + * This is the projectile this Power will fire. + */ +/obj/projectile/magic/arcane_barrage/vampire + name = "blood bolt" + icon_state = "mini_leaper" + damage = 20 + var/datum/action/cooldown/vampire/targeted/tremere/thaumaturgy/vampire_power + +/obj/projectile/magic/arcane_barrage/vampire/on_hit(target) + if(istype(target, /obj/structure/closet) && vampire_power.level_current >= 3) + var/obj/structure/closet/hit_closet = target + if(hit_closet) + hit_closet.welded = FALSE + hit_closet.locked = FALSE + hit_closet.broken = TRUE + hit_closet.update_appearance() + qdel(src) + return BULLET_ACT_HIT + if(istype(target, /obj/machinery/door) && vampire_power.level_current >= 3) + var/obj/machinery/door/hit_airlock = target + hit_airlock.open(2) + qdel(src) + return BULLET_ACT_HIT + if(ismob(target)) + if(vampire_power.level_current >= 4) + damage = 40 + if(vampire_power.level_current >= 5) + var/mob/living/person_hit = target + person_hit.blood_volume -= 60 + vampire_power.vampiredatum_power.AddBloodVolume(60) + qdel(src) + return BULLET_ACT_HIT + . = ..() + +/** + * # Blood Shield + * + * The shield spawned when using Thaumaturgy when strong enough. + * Copied mostly from '/obj/item/shield/changeling' + */ + +/obj/item/shield/vampire + name = "blood shield" + desc = "A shield made out of blood, requiring blood to sustain hits." + item_flags = ABSTRACT | DROPDEL + icon = 'icons/vampires/vamp_obj.dmi' + icon_state = "blood_shield" + lefthand_file = 'icons/vampires/bs_leftinhand.dmi' + righthand_file = 'icons/vampires/bs_rightinhand.dmi' + block_power = 75 + +/obj/item/shield/vampire/Initialize(mapload) + . = ..() + ADD_TRAIT(src, TRAIT_NODROP, TRAIT_VAMPIRE) + +/obj/item/shield/vampire/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK) + var/datum/antagonist/vampire/vampiredatum = owner.mind.has_antag_datum(/datum/antagonist/vampire) + if(vampiredatum) + vampiredatum.AddBloodVolume(-15) + return ..() diff --git a/code/modules/antagonists/vampire/powers/vassal/distress.dm b/code/modules/antagonists/vampire/powers/vassal/distress.dm new file mode 100644 index 0000000000000..c278de333d440 --- /dev/null +++ b/code/modules/antagonists/vampire/powers/vassal/distress.dm @@ -0,0 +1,21 @@ +/datum/action/cooldown/vampire/distress + name = "Distress" + desc = "Injure yourself, allowing you to make a desperate call for help to your Master." + button_icon_state = "power_distress" + power_explanation = "Use this Power anywhere and your Master will instantly be alerted to your location." + power_flags = NONE + check_flags = NONE + purchase_flags = NONE + bloodcost = 10 + cooldown_time = 10 SECONDS + +/datum/action/cooldown/vampire/distress/ActivatePower(trigger_flags) + . = ..() + var/turf/open/floor/target_area = get_area(owner) + var/datum/antagonist/vassal/vassaldatum = IS_VASSAL(owner) + + owner.balloon_alert(owner, "you call out for your master!") + to_chat(vassaldatum.master.owner, "[owner], your loyal Vassal, is desperately calling for aid at [target_area]!") + + var/mob/living/user = owner + user.adjustBruteLoss(10) diff --git a/code/modules/antagonists/vampire/powers/vassal/recuperate.dm b/code/modules/antagonists/vampire/powers/vassal/recuperate.dm new file mode 100644 index 0000000000000..56a0b7288ee70 --- /dev/null +++ b/code/modules/antagonists/vampire/powers/vassal/recuperate.dm @@ -0,0 +1,63 @@ +/// Used by Vassals +/datum/action/cooldown/vampire/recuperate + name = "Sanguine Recuperation" + desc = "Slowly heals you overtime using your master's blood, in exchange for some of your own blood and effort." + button_icon_state = "power_recup" + power_explanation = "\ + Activating this Power will begin to heal your wounds. \ + You will heal Brute and Toxin damage at the cost of your Stamina and blood from both you and your Master. \ + If you aren't a bloodless race, you will additionally heal Burn damage." + power_flags = BP_AM_TOGGLE + check_flags = BP_CANT_USE_WHILE_INCAPACITATED|BP_CANT_USE_WHILE_UNCONSCIOUS + purchase_flags = NONE + bloodcost = 1.5 + cooldown_time = 10 SECONDS + +/datum/action/cooldown/vampire/recuperate/can_use(mob/living/carbon/user, trigger_flags) + . = ..() + if(!.) + return + if(user.stat >= DEAD || user.incapacitated()) + user.balloon_alert(user, "you are incapacitated...") + return FALSE + return TRUE + +/datum/action/cooldown/vampire/recuperate/ActivatePower(trigger_flags) + . = ..() + to_chat(owner, "Your muscles clench as your master's immortal blood mixes with your own, knitting your wounds.") + owner.balloon_alert(owner, "recuperate turned on.") + +/datum/action/cooldown/vampire/recuperate/UsePower(seconds_per_tick) + . = ..() + if(!.) + return + + if(!active) + return + var/mob/living/carbon/user = owner + var/datum/antagonist/vassal/vassaldatum = IS_VASSAL(user) + vassaldatum.master.AddBloodVolume(-1) + user.Jitter(5 SECONDS) + user.adjustStaminaLoss(bloodcost * 1.1) + user.adjustBruteLoss(-2.5) + user.adjustToxLoss(-2, forced = TRUE) + // Plasmamen won't lose blood, they don't have any, so they don't heal from Burn. + if(!HAS_TRAIT(user, TRAIT_NO_BLOOD)) + user.blood_volume -= bloodcost + user.adjustFireLoss(-1.5) + // Stop Bleeding + if(istype(user) && user.is_bleeding()) + for(var/obj/item/bodypart/part in user.bodyparts) + user.add_bleeding(-10) + +/datum/action/cooldown/vampire/recuperate/ContinueActive(mob/living/user, mob/living/target) + if(user.stat >= DEAD) + return FALSE + if(user.incapacitated()) + owner.balloon_alert(owner, "too exhausted...") + return FALSE + return TRUE + +/datum/action/cooldown/vampire/recuperate/DeactivatePower() + owner.balloon_alert(owner, "recuperate turned off.") + return ..() diff --git a/code/modules/antagonists/vampire/powers/vassal/revenge_bloodbag.dm b/code/modules/antagonists/vampire/powers/vassal/revenge_bloodbag.dm new file mode 100644 index 0000000000000..54919448a22fd --- /dev/null +++ b/code/modules/antagonists/vampire/powers/vassal/revenge_bloodbag.dm @@ -0,0 +1,57 @@ +/datum/action/cooldown/vampire/vassal_blood + name = "Create Blood" + desc = "Convert a blood bag into Vampiric Blood." + button_icon_state = "power_bleed" + power_explanation = "Use this power with a bloodbag in hand to fill it with Vampiric Blood which is used to reset ex-vassal deconversion timers." + power_flags = NONE + check_flags = NONE + purchase_flags = NONE + bloodcost = 150 + cooldown_time = 10 SECONDS + +/datum/action/cooldown/vampire/vassal_blood/can_use(mob/living/carbon/user, trigger_flags) + . = ..() + if(!.) + return FALSE + + var/blood_bag = locate(/obj/item/reagent_containers/blood) in owner?.held_items + if(!blood_bag) + owner.balloon_alert(owner, "blood bag needed!") + return FALSE + if(istype(blood_bag, /obj/item/reagent_containers/blood/OMinus/vampire)) + owner.balloon_alert(owner, "already vampire blood!") + return FALSE + return TRUE + +/datum/action/cooldown/vampire/vassal_blood/ActivatePower(trigger_flags) + var/blood_bag = locate(/obj/item/reagent_containers/blood) in owner.held_items + if(blood_bag) + QDEL_NULL(blood_bag) + var/obj/item/reagent_containers/blood/OMinus/vampire/new_bag = new(owner.loc) + owner.put_in_active_hand(new_bag) + DeactivatePower() + +/* + * Vampire Blood + * Slighty darker than normal blood + * Artificially made, this must be fed to ex-vassals to keep them on their high. + */ +/datum/reagent/blood/vampire + color = "#960000" + +/datum/reagent/blood/vampire/on_mob_metabolize(mob/living/living) + var/datum/antagonist/ex_vassal/former_vassal = IS_EX_VASSAL(living) + if(former_vassal) + to_chat(living, "You feel the blood restore you... You feel safe.") + COOLDOWN_RESET(former_vassal, blood_timer) + COOLDOWN_START(former_vassal, blood_timer, 10 MINUTES) + return ..() + + +/obj/item/reagent_containers/blood/OMinus/vampire + unique_blood = /datum/reagent/blood/vampire + +/obj/item/reagent_containers/blood/OMinus/vampire/examine(mob/user) + . = ..() + if(IS_EX_VASSAL(user) || IS_REVENGE_VASSAL(user)) + . += "Seems to be just about the same color as your old Master's..." diff --git a/code/modules/antagonists/vampire/powers/vassal/revenge_checkstatus.dm b/code/modules/antagonists/vampire/powers/vassal/revenge_checkstatus.dm new file mode 100644 index 0000000000000..c05cbe31b856c --- /dev/null +++ b/code/modules/antagonists/vampire/powers/vassal/revenge_checkstatus.dm @@ -0,0 +1,33 @@ +/datum/action/cooldown/vampire/vassal_checkstatus + name = "Check Vassals" + desc = "Check each ex vassal's status" + button_icon_state = "power_mez" + power_explanation = "Use this power to check the health and location of all allied vassals" + power_flags = NONE + check_flags = NONE + purchase_flags = NONE + bloodcost = 10 + cooldown_time = 10 SECONDS + +/datum/action/cooldown/vampire/vassal_checkstatus/can_use(mob/living/carbon/user, trigger_flags) + . = ..() + if(!.) + return FALSE + + var/datum/antagonist/vassal/revenge/revenge_vassal = IS_REVENGE_VASSAL(owner) + if(!revenge_vassal?.ex_vassals.len) + owner.balloon_alert(owner, "no vassals!") + return FALSE + return TRUE + +/datum/action/cooldown/vampire/vassal_checkstatus/ActivatePower(trigger_flags) + var/datum/antagonist/vassal/revenge/revenge_vassal = IS_REVENGE_VASSAL(owner) + for(var/datum/antagonist/ex_vassal/former_vassals as anything in revenge_vassal.ex_vassals) + var/turf/open/floor/target_area = get_area(owner) + var/information = "[former_vassals.owner.current] has [round(COOLDOWN_TIMELEFT(former_vassals, blood_timer) / 600)] minutes left of Blood \ + [target_area ? "- currently at [target_area]." : "- their location is unknown!"] \ + [former_vassals.owner.current.stat == DEAD ? "- DEAD." : ""]" + + to_chat(owner, information) + + DeactivatePower() diff --git a/code/modules/antagonists/vampire/powers/vassal/revenge_fold.dm b/code/modules/antagonists/vampire/powers/vassal/revenge_fold.dm new file mode 100644 index 0000000000000..0dc1259d8fe68 --- /dev/null +++ b/code/modules/antagonists/vampire/powers/vassal/revenge_fold.dm @@ -0,0 +1,39 @@ +/datum/action/cooldown/vampire/vassal_fold + name = "Reconvert Ex-Vassal" + desc = "Bring an Ex-Vassal back into the fold." + button_icon_state = "power_torpor" + power_explanation = "Use this power while you are grabbing an ex-Vassal to bring them back into the fold." + power_flags = NONE + check_flags = NONE + purchase_flags = NONE + bloodcost = 50 + cooldown_time = 10 SECONDS + +/datum/action/cooldown/vampire/vassal_fold/can_use(mob/living/carbon/user, trigger_flags) + . = ..() + if(!.) + return FALSE + + var/mob/living/target = owner.pulling + var/datum/antagonist/ex_vassal/former_vassal = IS_EX_VASSAL(target) + if(!isliving(target)) + return FALSE + if(!former_vassal) + owner.balloon_alert(owner, "not a former vassal!") + return FALSE + if(former_vassal?.revenge_vassal) + owner.balloon_alert(owner, "already converted!") + return FALSE + return TRUE + +/datum/action/cooldown/vampire/vassal_fold/ActivatePower(trigger_flags) + var/mob/living/target = owner.pulling + if(!target) + return FALSE + var/datum/antagonist/ex_vassal/former_vassal = IS_EX_VASSAL(target) + if(!former_vassal || former_vassal?.revenge_vassal) + return FALSE + + if(do_after(owner, 5 SECONDS, target)) + former_vassal.return_to_fold(IS_REVENGE_VASSAL(owner)) + DeactivatePower() diff --git a/code/modules/antagonists/vampire/powers/veil.dm b/code/modules/antagonists/vampire/powers/veil.dm new file mode 100644 index 0000000000000..8fe7aeee9bc1b --- /dev/null +++ b/code/modules/antagonists/vampire/powers/veil.dm @@ -0,0 +1,135 @@ +/datum/action/cooldown/vampire/veil + name = "Veil of Many Faces" + desc = "Disguise yourself in the illusion of another identity." + button_icon_state = "power_veil" + power_explanation = "\ + Activating Veil of Many Faces will shroud you in smoke and forge you a new identity.\ + Your name and appearance will be completely randomized, deactivating the ability off again will restore you to your former self." + power_flags = BP_AM_TOGGLE + check_flags = BP_CANT_USE_IN_FRENZY + purchase_flags = VAMPIRE_DEFAULT_POWER|VASSAL_CAN_BUY + bloodcost = 15 + constant_bloodcost = 0.1 + cooldown_time = 10 SECONDS + + // Identity Vars + var/prev_name + var/prev_gender + var/prev_skin_tone + var/prev_hair_style + var/prev_facial_hair_style + var/prev_hair_color + var/prev_facial_hair_color + var/prev_underwear + var/prev_undershirt + var/prev_socks + var/prev_disfigured + var/prev_eye_color + var/list/prev_features // For lizards and such + +/datum/action/cooldown/vampire/veil/ActivatePower(trigger_flags) + . = ..() + cast_effect() // POOF + veil_user() + owner.balloon_alert(owner, "veil turned on.") + +/datum/action/cooldown/vampire/veil/proc/veil_user() + var/mob/living/carbon/human/user = owner + + // Store Prev Appearance + prev_gender = user.gender + prev_skin_tone = user.skin_tone + prev_hair_style = user.hair_style + prev_facial_hair_style = user.facial_hair_style + prev_hair_color = user.hair_color + prev_facial_hair_color = user.facial_hair_color + prev_underwear = user.underwear + prev_undershirt = user.undershirt + prev_socks = user.socks + prev_eye_color = user.eye_color + prev_disfigured = HAS_TRAIT(user, TRAIT_DISFIGURED) // I was disfigured! + prev_features = user.dna.features + + // Change Name + prev_name = user.name + var/newname = user.dna.species.random_name() + user.real_name = newname + user.name = newname + + // Change Appearance + user.gender = pick(MALE, FEMALE, PLURAL) + user.skin_tone = random_skin_tone() + user.hair_style = random_hair_style(user.gender) + user.facial_hair_style = pick(random_facial_hair_style(user.gender), "Shaved") + user.hair_color = random_short_color() + user.facial_hair_color = user.hair_color + user.underwear = random_underwear(user.gender) + user.undershirt = random_undershirt(user.gender) + user.socks = random_socks(user.gender) + user.eye_color = random_eye_color() + if(prev_disfigured) + REMOVE_TRAIT(user, TRAIT_DISFIGURED, null) + user.dna.features = random_features() + + // Apply Appearance + user.SetSpecialVoice(user.name) + user.update_body() // Outfit and underwear, also body. + user.update_mutant_bodyparts() // Lizard tails etc + user.update_hair() + user.update_body_parts() + + to_chat(owner, "You mystify the air around your person. Your identity is now altered.") + +/datum/action/cooldown/vampire/veil/DeactivatePower() + . = ..() + if(!ishuman(owner)) + return + var/mob/living/carbon/human/user = owner + + // Revert Name + user.name = prev_name + user.real_name = prev_name + + // Revert Appearance + user.gender = prev_gender + user.skin_tone = prev_skin_tone + user.hair_style = prev_hair_style + user.facial_hair_style = prev_facial_hair_style + user.hair_color = prev_hair_color + user.facial_hair_color = prev_facial_hair_color + user.underwear = prev_underwear + user.undershirt = prev_undershirt + user.socks = prev_socks + user.eye_color = prev_eye_color + + if(prev_disfigured) + //We are ASSUMING husk. // user.status_flags |= DISFIGURED // Restore "Unknown" disfigurement + ADD_TRAIT(user, TRAIT_DISFIGURED, TRAIT_HUSK) + user.dna.features = prev_features + + // Apply Appearance + user.UnsetSpecialVoice() + user.update_body() // Outfit and underwear, also body. + user.update_hair() + user.update_body_parts() // Body itself, maybe skin color? + + cast_effect() // POOF + owner.balloon_alert(owner, "veil turned off.") + + +// CAST EFFECT // General effect (poof, splat, etc) when you cast. Doesn't happen automatically! +/datum/action/cooldown/vampire/veil/proc/cast_effect() + // Effect + playsound(get_turf(owner), 'sound/magic/smoke.ogg', 20, 1) + var/datum/effect_system/steam_spread/vampire/puff = new /datum/effect_system/steam_spread/() + puff.set_up(3, 0, get_turf(owner)) + puff.attach(owner) //OPTIONAL + puff.start() + owner.spin(8, 1) //Spin around like a loon. + +/obj/effect/particle_effect/smoke/vampsmoke + opacity = FALSE + lifetime = 0 + +/obj/effect/particle_effect/smoke/vampsmoke/fade_out(frames = 0.8 SECONDS) + ..(frames) diff --git a/code/modules/antagonists/vampire/vassals/datum_vassal.dm b/code/modules/antagonists/vampire/vassals/datum_vassal.dm new file mode 100644 index 0000000000000..506d33e57c899 --- /dev/null +++ b/code/modules/antagonists/vampire/vassals/datum_vassal.dm @@ -0,0 +1,139 @@ +/datum/antagonist/vassal + name = "\improper Vassal" + roundend_category = "vassals" + antagpanel_category = "Vampire" + banning_key = ROLE_VAMPIRE + show_in_roundend = FALSE + + var/vassal_hud_name = "vassal" + + /// The Master Vampire's antag datum. + var/datum/antagonist/vampire/master + /// The Vampire's team + var/datum/team/vampire/vampire_team + /// List of all Purchased Powers, like Vampires. + var/list/datum/action/powers = list() + ///Whether this vassal is already a special type of Vassal. + var/special_type = FALSE + ///Description of what this Vassal does. + var/vassal_description + +/datum/antagonist/vassal/antag_panel_data() + return "Master : [master.owner.name]" + +/datum/antagonist/vassal/apply_innate_effects(mob/living/mob_override) + . = ..() + var/mob/living/current_mob = mob_override || owner.current + + current_mob.faction |= FACTION_VAMPIRE + + vampire_team = master.vampire_team + vampire_team.add_member(current_mob.mind) + + vampire_team.hud.join_hud(current_mob) + set_antag_hud(current_mob, vassal_hud_name) + +/datum/antagonist/vassal/remove_innate_effects(mob/living/mob_override) + . = ..() + var/mob/living/current_mob = mob_override || owner.current + + vampire_team.remove_member(current_mob.mind) + vampire_team.hud.leave_hud(current_mob) + set_antag_hud(current_mob, null) + current_mob.faction -= FACTION_VAMPIRE + +/datum/antagonist/vassal/on_gain() + RegisterSignal(SSsunlight, COMSIG_SOL_WARNING_GIVEN, PROC_REF(give_warning)) + /// Enslave them to their Master + if(!master || !istype(master, master)) + return + if(special_type) + if(!master.special_vassals[special_type]) + master.special_vassals[special_type] = list() + master.special_vassals[special_type] |= src + master.vassals |= src + owner.enslave_mind_to_creator(master.owner.current) + owner.current.log_message("has been vassalized by [master.owner.current]!", LOG_ATTACK, color="#960000") + /// Give Recuperate Power + BuyPower(new /datum/action/cooldown/vampire/recuperate) + /// Give Objectives + var/datum/objective/vampire/vassal/vassal_objective = new + vassal_objective.owner = owner + objectives += vassal_objective + /// Give Vampire Language + owner.current.grant_all_languages(FALSE, FALSE, TRUE) + owner.current.grant_language(/datum/language/vampiric) + return ..() + +/datum/antagonist/vassal/on_removal() + UnregisterSignal(owner.current, COMSIG_PARENT_EXAMINE) + UnregisterSignal(SSsunlight, COMSIG_SOL_WARNING_GIVEN) + //Free them from their Master + if(master?.owner) + if(special_type && master.special_vassals[special_type]) + master.special_vassals[special_type] -= src + master.vassals -= src + owner.enslaved_to = null + + for(var/all_status_traits in owner.current.status_traits) + REMOVE_TRAIT(owner.current, all_status_traits, TRAIT_VAMPIRE) + + for(var/datum/action/cooldown/vampire/power as anything in powers) + powers -= power + power.Remove(owner.current) + + owner.current.remove_language(/datum/language/vampiric) + return ..() + +/datum/antagonist/vassal/on_body_transfer(mob/living/old_body, mob/living/new_body) + . = ..() + for(var/datum/action/cooldown/vampire/power as anything in powers) + power.Remove(old_body) + power.Grant(new_body) + +/datum/antagonist/vassal/greet() + . = ..() + if(silent) + return + + to_chat(owner, "You are now the mortal servant of [master.owner.current], a Vampire!") + to_chat(owner, "The power of [master.owner.current.p_their()] immortal blood compels you to obey [master.owner.current.p_them()] in all things, even offering your own life to prolong theirs.\n\ + You are not required to obey any other Vampire, for only [master.owner.current] is your master. The laws of Nanotrasen do not apply to you now; only your vampiric master's word must be obeyed.") // if only there was a /p_theirs() proc... + owner.current.playsound_local(null, 'sound/magic/mutate.ogg', 100, FALSE, pressure_affected = FALSE) + antag_memory += "You are the mortal servant of [master.owner.current], a bloodsucking vampire!
" + /// Message told to your Master. + to_chat(master.owner, "[owner.current] has become addicted to your immortal blood. [owner.current.p_they(TRUE)] [owner.current.p_are()] now your undying servant") + master.owner.current.playsound_local(null, 'sound/magic/mutate.ogg', 100, FALSE, pressure_affected = FALSE) + +/datum/antagonist/vassal/farewell() + if(silent) + return + + owner.current.visible_message( + "[owner.current]'s eyes dart feverishly from side to side, and then stop. [owner.current.p_they(TRUE)] seem[owner.current.p_s()] calm, \ + like [owner.current.p_they()] [owner.current.p_have()] regained some lost part of [owner.current.p_them()]self.", \ + "With a snap, you are no longer enslaved to [master.owner]! You breathe in heavily, having regained your free will.") + owner.current.playsound_local(null, 'sound/magic/mutate.ogg', 100, FALSE, pressure_affected = FALSE) + /// Message told to your (former) Master. + if(master && master.owner) + to_chat(master.owner, "You feel the bond with your vassal [owner.current] has somehow been broken!") + +/datum/antagonist/vassal/admin_add(datum/mind/new_owner, mob/admin) + var/list/datum/mind/possible_vampires = list() + for(var/datum/antagonist/vampire/vampiredatums in GLOB.antagonists) + var/datum/mind/vamp = vampiredatums.owner + if(!vamp || !vamp?.current || vamp?.current?.stat == DEAD) + continue + possible_vampires += vamp + + if(!length(possible_vampires)) + message_admins("[key_name_admin(usr)] tried vassalizing [key_name_admin(new_owner)], but there were no vampires!") + return + var/datum/mind/choice = input("Which vampire should this vassal belong to?", "Vampire") in possible_vampires + if(!choice) + return + log_admin("[key_name_admin(usr)] turned [key_name_admin(new_owner)] into a vassal of [key_name_admin(choice)]!") + var/datum/antagonist/vampire/vampire = choice.has_antag_datum(/datum/antagonist/vampire) + master = vampire + new_owner.add_antag_datum(src) + to_chat(choice, "Through divine intervention, you've gained a new vassal!") diff --git a/code/modules/antagonists/vampire/vassals/ex_vassal.dm b/code/modules/antagonists/vampire/vassals/ex_vassal.dm new file mode 100644 index 0000000000000..cc8a5c523b411 --- /dev/null +++ b/code/modules/antagonists/vampire/vassals/ex_vassal.dm @@ -0,0 +1,64 @@ +/datum/antagonist/ex_vassal + name = "\improper Ex-Vassal" + roundend_category = "vassals" + antagpanel_category = "Vampire" + banning_key = ROLE_VAMPIRE + var/vassal_hud_name = "vassal_grey" + show_in_roundend = FALSE + show_in_antagpanel = FALSE + silent = TRUE + ui_name = FALSE + + ///The revenge vassal that brought us into the fold. + var/datum/antagonist/vassal/revenge/revenge_vassal + ///Reuse the vampire team + var/datum/team/vampire/vampire_team + ///Timer we have to live + COOLDOWN_DECLARE(blood_timer) + +/datum/antagonist/ex_vassal/apply_innate_effects(mob/living/mob_override) + . = ..() + set_antag_hud(owner.current, vassal_hud_name) + +/datum/antagonist/ex_vassal/remove_innate_effects(mob/living/mob_override) + . = ..() + set_antag_hud(owner.current, null) + +/datum/antagonist/ex_vassal/on_removal() + if(revenge_vassal) + revenge_vassal.ex_vassals -= src + revenge_vassal = null + blood_timer = null + + vampire_team.remove_member(owner.current.mind) + vampire_team.hud.leave_hud(owner.current) + set_antag_hud(owner.current, null) + + return ..() + +/* + * Fold return + * + * Called when a Revenge vampire gets a vassal back into the fold. + */ +/datum/antagonist/ex_vassal/proc/return_to_fold(datum/antagonist/vassal/revenge/mike_ehrmantraut) + revenge_vassal = mike_ehrmantraut // what did john fulp willard mean by this + revenge_vassal.ex_vassals += src + + vampire_team.add_member(owner.current.mind) + vampire_team.hud.join_hud(owner.current) + set_antag_hud(owner.current, vassal_hud_name) + + COOLDOWN_START(src, blood_timer, 10 MINUTES) + RegisterSignal(src, COMSIG_LIVING_LIFE, PROC_REF(on_life)) + +/datum/antagonist/ex_vassal/proc/on_life(datum/source, seconds_per_tick, times_fired) + SIGNAL_HANDLER + + if(COOLDOWN_TIMELEFT(src, blood_timer) <= 5 MINUTES + 2 && COOLDOWN_TIMELEFT(src, blood_timer) >= 5 MINUTES - 2) //just about halfway + to_chat(owner.current, "You need new blood from your Master!") + if(!COOLDOWN_FINISHED(src, blood_timer)) + return + to_chat(owner.current, "You are out of blood!") + to_chat(revenge_vassal.owner.current, "[owner.current] has ran out of blood and has permanently left the fold!") + owner.remove_antag_datum(/datum/antagonist/ex_vassal) diff --git a/code/modules/antagonists/vampire/vassals/favorite_vassal.dm b/code/modules/antagonists/vampire/vassals/favorite_vassal.dm new file mode 100644 index 0000000000000..5f84b9de1ea31 --- /dev/null +++ b/code/modules/antagonists/vampire/vassals/favorite_vassal.dm @@ -0,0 +1,23 @@ +/** + * Favorite Vassal + * + * Gets some cool abilities depending on the Clan. + */ +/datum/antagonist/vassal/favorite + name = "\improper Favorite Vassal" + show_in_antagpanel = FALSE + vassal_hud_name = "vassal6" + special_type = FAVORITE_VASSAL + vassal_description = "The Favorite Vassal gets unique abilities over other Vassals depending on your Clan \ + and becomes completely immune to Mindshields. If part of Ventrue, this is the Vassal you will rank up." + + ///Vampire levels, but for Vassals, used by Ventrue. + var/vassal_level + +/datum/antagonist/vassal/favorite/on_gain() + . = ..() + SEND_SIGNAL(master, VAMPIRE_MAKE_FAVORITE, src) + +///Set the Vassal's rank to their Vampire level +/datum/antagonist/vassal/favorite/proc/set_vassal_level(mob/living/carbon/human/target) + master.vampire_level = vassal_level diff --git a/code/modules/antagonists/vampire/vassals/misc_procs_vassal.dm b/code/modules/antagonists/vampire/vassals/misc_procs_vassal.dm new file mode 100644 index 0000000000000..b911ffb6dbe2b --- /dev/null +++ b/code/modules/antagonists/vampire/vassals/misc_procs_vassal.dm @@ -0,0 +1,36 @@ +/datum/antagonist/vassal/proc/give_warning(atom/source, danger_level, vampire_warning_message, vassal_warning_message) + SIGNAL_HANDLER + if(vassal_warning_message) + to_chat(owner, vassal_warning_message) + +/// Used when your Master teaches you a new Power. +/datum/antagonist/vassal/proc/BuyPower(datum/action/cooldown/vampire/power) + powers += power + power.Grant(owner.current) + log_game("[key_name(owner.current)] purchased [power] as a vassal.") + +/datum/antagonist/vassal/proc/LevelUpPowers() + for(var/datum/action/cooldown/vampire/power in powers) + power.level_current++ + +/// Called when we are made into the Favorite Vassal +/datum/antagonist/vassal/proc/make_special(datum/antagonist/vassal/vassal_type) + //store what we need + var/datum/mind/vassal_owner = owner + var/datum/antagonist/vampire/vampiredatum = master + + //remove our antag datum + silent = TRUE + vassal_owner.remove_antag_datum(/datum/antagonist/vassal) + + //give our new one + var/datum/antagonist/vassal/vassaldatum = new vassal_type(vassal_owner) + vassaldatum.master = vampiredatum + vassaldatum.silent = TRUE + vassal_owner.add_antag_datum(vassaldatum) + vassaldatum.silent = FALSE + + //send alerts of completion + to_chat(master, "You have turned [vassal_owner.current] into your [vassaldatum.name]! They will no longer be deconverted upon Mindshielding!") + to_chat(vassal_owner, "As Blood drips over your body, you feel closer to your Master... You are now the Favorite Vassal!") + vassal_owner.current.playsound_local(null, 'sound/magic/mutate.ogg', 75, FALSE, pressure_affected = FALSE) diff --git a/code/modules/antagonists/vampire/vassals/revenge_vassal.dm b/code/modules/antagonists/vampire/vassals/revenge_vassal.dm new file mode 100644 index 0000000000000..96f9b04eb3665 --- /dev/null +++ b/code/modules/antagonists/vampire/vassals/revenge_vassal.dm @@ -0,0 +1,89 @@ +/** + * Revenge Vassal + * + * Has the goal to 'get revenge' when their Master dies. + */ +/datum/antagonist/vassal/revenge + name = "\improper Revenge Vassal" + roundend_category = "abandoned Vassals" + show_in_roundend = FALSE + show_in_antagpanel = FALSE + vassal_hud_name = "vassal4" + special_type = REVENGE_VASSAL + vassal_description = "The Revenge Vassal will not deconvert on your Final Death, \ + instead they will gain all your Powers, and the objective to take revenge for your demise. \ + They additionally maintain your Vassals after your departure, rather than become aimless." + + ///all ex-vassals brought back into the fold. + var/list/datum/antagonist/ex_vassal/ex_vassals = list() + +/datum/antagonist/vassal/revenge/roundend_report() + var/list/report = list() + report += printplayer(owner) + if(objectives.len) + report += printobjectives(objectives) + + // Now list their vassals + if(ex_vassals.len) + report += "The Vassals brought back into the fold were..." + for(var/datum/antagonist/ex_vassal/all_vassals as anything in ex_vassals) + if(!all_vassals.owner) + continue + report += "[all_vassals.owner.name] the [all_vassals.owner.assigned_role]" + + return report.Join("
") + +/datum/antagonist/vassal/revenge/on_gain() + . = ..() + RegisterSignal(master, VAMPIRE_FINAL_DEATH, PROC_REF(on_master_death)) + +/datum/antagonist/vassal/revenge/on_removal() + UnregisterSignal(master, VAMPIRE_FINAL_DEATH) + return ..() + +/datum/antagonist/vassal/revenge/ui_static_data(mob/user) + var/list/data = list() + for(var/datum/action/cooldown/vampire/power as anything in powers) + var/list/power_data = list() + + power_data["power_name"] = power.name + power_data["power_explanation"] = power.power_explanation + power_data["power_icon"] = power.button_icon_state + + data["power"] += list(power_data) + + return data + ..() + +/datum/antagonist/vassal/revenge/proc/on_master_death(datum/antagonist/vampire/vampiredatum, mob/living/carbon/master) + SIGNAL_HANDLER + + show_in_roundend = TRUE + for(var/datum/objective/all_objectives as anything in objectives) + objectives -= all_objectives + + BuyPower(new /datum/action/cooldown/vampire/vassal_blood) + BuyPower(new /datum/action/cooldown/vampire/vassal_checkstatus) + BuyPower(new /datum/action/cooldown/vampire/vassal_fold) + for(var/datum/action/cooldown/vampire/master_powers as anything in vampiredatum.powers) + if(master_powers.purchase_flags & VAMPIRE_DEFAULT_POWER) + continue + master_powers.Grant(owner.current) + + var/datum/objective/survive/new_objective = new + new_objective.name = "Avenge Vampire" + new_objective.explanation_text = "Avenge your Vampire's death by recruiting their ex-vassals and continuing their operations." + new_objective.owner = owner + objectives += new_objective + + if(info_button_ref) + QDEL_NULL(info_button_ref) + + ui_name = "AntagInfoRevengeVassal" //give their new ui + var/datum/action/antag_info/info_button = new(src) + info_button.Grant(owner.current) + info_button_ref = WEAKREF(info_button) + INVOKE_ASYNC(src, PROC_REF(ui_interact), owner.current) + + // Alert vassal that their master is dead + to_chat(owner.current, "Your master has succumbed to final death! Avenge your Vampire's death by recruiting their ex-vassals and continuing their operations.") + owner.current.playsound_local(get_turf(owner.current), 'sound/effects/tendril_destroyed.ogg', 30) diff --git a/code/modules/antagonists/wizard/equipment/soulstone.dm b/code/modules/antagonists/wizard/equipment/soulstone.dm index 4b72737714311..59377c78d26b5 100644 --- a/code/modules/antagonists/wizard/equipment/soulstone.dm +++ b/code/modules/antagonists/wizard/equipment/soulstone.dm @@ -46,6 +46,10 @@ name = "mysterious old shard" old_shard = TRUE +/obj/item/soulstone/vampire + theme = THEME_WIZARD + required_role = /datum/antagonist/vassal + /obj/item/soulstone/pickup(mob/living/user) ..() if(!role_check(user)) diff --git a/code/modules/asset_cache/asset_list_items.dm b/code/modules/asset_cache/asset_list_items.dm index 4e3fdb50ea5cb..fe289d2f70bca 100644 --- a/code/modules/asset_cache/asset_list_items.dm +++ b/code/modules/asset_cache/asset_list_items.dm @@ -547,6 +547,28 @@ "spiderhunter.png"= 'html/img/spiderhunter.png', "spiderviper.png"= 'html/img/spiderviper.png', "spidertarantula.png"= 'html/img/spidertarantula.png', + "vampire.caitiff.png"= 'html/img/vampire.caitiff.png', + "vampire.malkavian.png"= 'html/img/vampire.malkavian.png', + "vampire.nosferatu.png"= 'html/img/vampire.nosferatu.png', + "vampire.tremere.png"= 'html/img/vampire.tremere.png', + "vampire.power_bleed"= 'html/img/vampire.power_bleed.png', + "vampire.power_auspex.png"= 'html/img/vampire.power_auspex.png', + "vampire.power_cloak.png"= 'html/img/vampire.power_cloak.png', + "vampire.power_distress.png"= 'html/img/vampire.power_distress.png', + "vampire.power_dominate.png"= 'html/img/vampire.power_dominate.png', + "vampire.power_feed.png"= 'html/img/vampire.power_feed.png', + "vampire.power_gohome.png"= 'html/img/vampire.power_gohome.png', + "vampire.power_fortitude.png"= 'html/img/vampire.power_fortitude.png', + "vampire.power_human.png"= 'html/img/vampire.power_human.png', + "vampire.power_lunge.png"= 'html/img/vampire.power_lunge.png', + "vampire.power_mez.png"= 'html/img/vampire.power_mez.png', + "vampire.power_recup.png"= 'html/img/vampire.power_recup.png', + "vampire.power_speed.png"= 'html/img/vampire.power_speed.png', + "vampire.power_strength.png"= 'html/img/vampire.power_strength.png', + "vampire.power_thaumaturgy.png"= 'html/img/vampire.power_thaumaturgy.png', + "vampire.power_torpor.png"= 'html/img/vampire.power_torpor.png', + "vampire.power_tres.png"= 'html/img/vampire.power_tres.png', + "vampire.power_veil.png"= 'html/img/vampire.power_veil.png', ) /datum/asset/simple/orbit diff --git a/code/modules/language/language_holder.dm b/code/modules/language/language_holder.dm index d3c6a80640bb4..0dff4253872b7 100644 --- a/code/modules/language/language_holder.dm +++ b/code/modules/language/language_holder.dm @@ -516,6 +516,12 @@ GLOBAL_LIST_INIT(prototype_language_holders, init_language_holder_prototypes()) /datum/language/sylvan = list(LANGUAGE_ATOM) ) +/datum/language_holder/vampire + understood_languages = list(/datum/language/common = list(LANGUAGE_ATOM), + /datum/language/vampiric = list(LANGUAGE_ATOM)) + spoken_languages = list(/datum/language/common = list(LANGUAGE_ATOM), + /datum/language/vampiric = list(LANGUAGE_ATOM)) + /datum/language_holder/empty understood_languages = null spoken_languages = null diff --git a/code/modules/language/vampiric.dm b/code/modules/language/vampiric.dm new file mode 100644 index 0000000000000..ed2d2cffb7217 --- /dev/null +++ b/code/modules/language/vampiric.dm @@ -0,0 +1,21 @@ +/datum/language/vampiric + name = "Blah-Sucker" + desc = "The native language of the Vampire elders, learned intuitively by Fledglings as they pass from death into immortality." + key = "l" + space_chance = 40 + default_priority = 90 + + flags = TONGUELESS_SPEECH | LANGUAGE_HIDE_ICON_IF_NOT_UNDERSTOOD__LINGUIST_ONLY + syllables = list( + "luk","cha","no","kra","pru","chi","busi","tam","pol","spu","och", + "umf","ora","stu","si","ri","li","ka","red","ani","lup","ala","pro", + "to","siz","nu","pra","ga","ump","ort","a","ya","yach","tu","lit", + "wa","mabo","mati","anta","tat","tana","prol", + "tsa","si","tra","te","ele","fa","inz", + "nza","est","sti","ra","pral","tsu","ago","esch","chi","kys","praz", + "froz","etz","tzil", + "t'","k'","t'","k'","th'","tz'" + ) + + icon_state = "vampire" + icon = 'icons/vampires/vampiric.dmi' diff --git a/code/modules/library/lib_codex_gigas.dm b/code/modules/library/lib_codex_gigas.dm index d157ef3e97069..a64759ecc6cf3 100644 --- a/code/modules/library/lib_codex_gigas.dm +++ b/code/modules/library/lib_codex_gigas.dm @@ -10,3 +10,97 @@ author = "Forces beyond your comprehension" unique = 1 title = "the Codex Gigas" + +/obj/item/book/codex_gigas/Initialize(mapload) + . = ..() + var/turf/current_turf = get_turf(src) + new /obj/item/book/kindred(current_turf) + +/** + * # Archives of the Kindred: + * + * A book that can only be used by Curators. + * When used on a player, after a short timer, will reveal if the player is a Vampire, including their real name and Clan. + * This book should not work on Vampires using the Masquerade ability. + * If it reveals a Vampire, the Curator will then be able to tell they are a Vampire on examine (Like a Vassal). + * Reading it normally will allow Curators to read what each Clan does, with some extra flavor text ones. + * + * Regular Vampires won't have any negative effects from the book, while everyone else will get burns/eye damage. + */ +/obj/item/book/kindred + name = "\improper Archive of the Kindred" + title = "the Archive of the Kindred" + desc = "Cryptic documents explaining hidden truths behind Undead beings. It is said only Curators can decipher what they really mean." + icon = 'icons/vampires/vamp_obj.dmi' + lefthand_file = 'icons/vampires/bs_leftinhand.dmi' + righthand_file = 'icons/vampires/bs_rightinhand.dmi' + icon_state = "kindred_book" + author = "dozens of generations of Curators" + unique = TRUE + throw_speed = 1 + throw_range = 10 + resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF + ///Boolean on whether the book is currently being used, so you can only use it on one person at a time. + var/in_use = FALSE + +/obj/item/book/kindred/Initialize(mapload) + . = ..() + AddComponent(/datum/component/stationloving, FALSE, TRUE) + +///Attacking someone with the book. +/obj/item/book/kindred/afterattack(mob/living/target, mob/living/user, flag, params) + . = ..() + if(!user.can_read(src) || in_use || (target == user) || !ismob(target)) + return + if(!IS_CURATOR(user)) + if(IS_VAMPIRE(user)) + to_chat(user, "[src] seems to be too complicated for you. It would be best to leave this for someone else to take.") + return + to_chat(user, "[src] burns your hands as you try to use it!") + user.apply_damage(3, BURN, pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM)) + return + + in_use = TRUE + user.balloon_alert_to_viewers(user, "reading book...", "looks at [target] and [src]") + if(!do_after(user, 3 SECONDS, target, timed_action_flags = NONE, progress = TRUE)) + to_chat(user, "You quickly close [src].") + in_use = FALSE + return + in_use = FALSE + + var/datum/antagonist/vampire/vampiredatum = IS_VAMPIRE(target) + // Are we a Vampire | Are we on Masquerade. If one is true, they will fail. + if(IS_VAMPIRE(target) && !HAS_TRAIT(target, TRAIT_MASQUERADE)) + if(vampiredatum.broke_masquerade) + to_chat(user, "[target], also known as '[vampiredatum.return_full_name()]', is indeed a Vampire, but you already knew this.") + return + to_chat(user, "[target], also known as '[vampiredatum.return_full_name()]', [vampiredatum.my_clan ? "is part of the [vampiredatum.my_clan]!" : "is not part of a clan."] You quickly note this information down, memorizing it.") + vampiredatum.break_masquerade() + else + to_chat(user, "You fail to draw any conclusions to [target] being a Vampire.") + +/obj/item/book/kindred/attack_self(mob/living/user) + if(!IS_CURATOR(user)) + if(IS_VAMPIRE(user)) + to_chat(user, "[src] seems to be too complicated for you. It would be best to leave this for someone else to take.") + else + to_chat(user, "You feel your eyes unable to read the boring texts...") + return + ui_interact(user) + +/obj/item/book/kindred/ui_interact(mob/living/user, datum/tgui/ui) + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "KindredBook", name) + ui.open() + +/obj/item/book/kindred/ui_static_data(mob/user) + var/data = list() + + for(var/datum/vampire_clan/clans as anything in subtypesof(/datum/vampire_clan)) + var/clan_data = list() + clan_data["clan_name"] = initial(clans.name) + clan_data["clan_desc"] = initial(clans.description) + data["clans"] += list(clan_data) + + return data diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm index c2c8abb594648..1abc1ce21b0bf 100644 --- a/code/modules/mining/lavaland/necropolis_chests.dm +++ b/code/modules/mining/lavaland/necropolis_chests.dm @@ -160,6 +160,10 @@ return ..() /obj/item/clothing/neck/necklace/memento_mori/proc/memento(mob/living/carbon/human/user) + if(IS_VAMPIRE(user)) + to_chat(user, "The Memento notices your undead soul, and refuses to react..") + return + to_chat(user, "You feel your life being drained by the pendant...") if(do_after(user, 40, target = user)) to_chat(user, "Your lifeforce is now linked to the pendant! You feel like removing it would kill you, and yet you instinctively know that until then, you won't die.") diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index 91d2491cfd301..2087105757a8a 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -260,6 +260,8 @@ bleedsuppress has been replaced for is_bandaged(). Note that is_bleeding() retur // Takes care blood loss and regeneration /mob/living/carbon/human/handle_blood() + if(mind && IS_VAMPIRE(src)) // vampires should not be affected by blood + return FALSE if((NOBLOOD in dna.species.species_traits) || HAS_TRAIT(src, TRAIT_NO_BLOOD)) cauterise_wounds() diff --git a/code/modules/mob/living/carbon/human/death.dm b/code/modules/mob/living/carbon/human/death.dm index 95b5d8cab1761..c5a61800400e1 100644 --- a/code/modules/mob/living/carbon/human/death.dm +++ b/code/modules/mob/living/carbon/human/death.dm @@ -99,7 +99,7 @@ readout += "
[round(reagent.volume, 0.001)] units of [reagent.name]" /* readout += "
Stomach:" - var/obj/item/organ/internal/stomach/belly = getorganslot(ORGAN_SLOT_STOMACH) + var/obj/item/organ/stomach/belly = getorganslot(ORGAN_SLOT_STOMACH) for(var/datum/reagent/bile in belly?.reagents?.reagent_list) if(!belly.food_reagents[bile.type]) readout += "
[round(bile.volume, 0.001)] units of [bile.name]" diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 6cb3b134322a1..320c8a2ff3713 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1300,9 +1300,6 @@ CREATION_TEST_IGNORE_SUBTYPES(/mob/living/carbon/human/species) /mob/living/carbon/human/species/skeleton race = /datum/species/skeleton -/mob/living/carbon/human/species/vampire - race = /datum/species/vampire - /mob/living/carbon/human/species/zombie race = /datum/species/zombie diff --git a/code/modules/mob/living/carbon/human/species_types/vampire.dm b/code/modules/mob/living/carbon/human/species_types/vampire.dm deleted file mode 100644 index e9e06773bef24..0000000000000 --- a/code/modules/mob/living/carbon/human/species_types/vampire.dm +++ /dev/null @@ -1,205 +0,0 @@ -/datum/species/vampire - name = "\improper Vampire" - id = SPECIES_VAMPIRE - default_color = "FFFFFF" - species_traits = list(EYECOLOR,HAIR,FACEHAIR,LIPS) - inherent_traits = list(TRAIT_NOHUNGER,TRAIT_NOBREATH,TRAIT_DRINKSBLOOD) - inherent_biotypes = list(MOB_UNDEAD, MOB_HUMANOID) - mutant_bodyparts = list("tail_human" = "None", "ears" = "None", "wings" = "None", "body_size" = "Normal") - changesource_flags = MIRROR_BADMIN | WABBAJACK | MIRROR_PRIDE | MIRROR_MAGIC | ERT_SPAWN - exotic_bloodtype = "U" - use_skintones = TRUE - mutantheart = /obj/item/organ/heart/vampire - mutanttongue = /obj/item/organ/tongue/vampire - examine_limb_id = SPECIES_HUMAN - skinned_type = /obj/item/stack/sheet/animalhide/human - var/info_text = "You are a Vampire. You will slowly but constantly lose blood if outside of a coffin. If inside a coffin, you will slowly heal. You may gain more blood by grabbing a live victim and using your drain ability." - var/obj/effect/proc_holder/spell/targeted/shapeshift/bat/batform //attached to the datum itself to avoid cloning memes, and other duplicates - -/datum/species/vampire/check_roundstart_eligible() - if(SSevents.holidays && SSevents.holidays[HALLOWEEN]) - return TRUE - return ..() - -/datum/species/vampire/on_species_gain(mob/living/carbon/human/C, datum/species/old_species) - . = ..() - to_chat(C, "[info_text]") - C.skin_tone = "albino" - C.update_body(0) - if(isnull(batform)) - batform = new - C.AddSpell(batform) - -/datum/species/vampire/on_species_loss(mob/living/carbon/C) - . = ..() - if(!isnull(batform)) - C.RemoveSpell(batform) - QDEL_NULL(batform) - -/datum/species/vampire/spec_life(mob/living/carbon/human/C) - . = ..() - if(istype(C.loc, /obj/structure/closet/crate/coffin)) - C.heal_overall_damage(4,4,0, BODYTYPE_ORGANIC) - C.adjustToxLoss(-4) - C.adjustOxyLoss(-4) - C.adjustCloneLoss(-4) - return - C.blood_volume -= 0.75 - if(C.blood_volume <= BLOOD_VOLUME_SURVIVE) - to_chat(C, "You ran out of blood!") - var/obj/shapeshift_holder/H = locate() in C - if(H) - H.shape.dust() //make sure we're killing the bat if you are out of blood, if you don't it creates weird situations where the bat is alive but the caster is dusted. - C.investigate_log("has been dusted by a lack of blood (vampire).", INVESTIGATE_DEATHS) - C.dust() - var/area/A = get_area(C) - if(istype(A, /area/chapel)) - to_chat(C, "You don't belong here!") - C.adjustFireLoss(20) - C.adjust_fire_stacks(6) - C.IgniteMob() - -/datum/species/vampire/check_species_weakness(obj/item/weapon, mob/living/attacker) - if(istype(weapon, /obj/item/nullrod/whip)) - return 1 //Whips deal 2x damage to vampires. Vampire killer. - return 0 - -/datum/species/vampire/get_species_description() - return "A classy Vampire! They descend upon Space Station Thirteen Every year to spook the crew! \"Bleeg!!\"" - -/datum/species/vampire/get_species_lore() - return list( - "Vampires are unholy beings blessed and cursed with The Thirst. \ - The Thirst requires them to feast on blood to stay alive, and in return it gives them many bonuses." - ) - -/datum/species/vampire/create_pref_unique_perks() - var/list/to_add = list() - - to_add += list( - list( - SPECIES_PERK_TYPE = SPECIES_POSITIVE_PERK, - SPECIES_PERK_ICON = "bed", - SPECIES_PERK_NAME = "Coffin Brooding", - SPECIES_PERK_DESC = "Vampires can delay The Thirst and heal by resting in a coffin. So THAT'S why they do that!", - ), - list( - SPECIES_PERK_TYPE = SPECIES_NEGATIVE_PERK, - SPECIES_PERK_ICON = "cross", - SPECIES_PERK_NAME = "Against God and Nature", - SPECIES_PERK_DESC = "Almost all higher powers are disgusted by the existence of \ - Vampires, and entering the Chapel is essentially suicide. Do not do it!", - ), - ) - - return to_add - -// Vampire blood is special, so it needs to be handled with its own entry. -/datum/species/vampire/create_pref_blood_perks() - var/list/to_add = list() - - to_add += list(list( - SPECIES_PERK_TYPE = SPECIES_NEGATIVE_PERK, - SPECIES_PERK_ICON = "tint", - SPECIES_PERK_NAME = "The Thirst", - SPECIES_PERK_DESC = "In place of eating, Vampires suffer from The Thirst. \ - Thirst of what? Blood! Their tongue allows them to grab people and drink \ - their blood, and they will die if they run out. As a note, it doesn't \ - matter whose blood you drink, it will all be converted into your blood \ - type when consumed.", - )) - - return to_add - -// There isn't a "Minor Undead" biotype, so we have to explain it in an override (see: dullahans) -/datum/species/vampire/create_pref_biotypes_perks() - var/list/to_add = list() - - to_add += list(list( - SPECIES_PERK_TYPE = SPECIES_POSITIVE_PERK, - SPECIES_PERK_ICON = "skull", - SPECIES_PERK_NAME = "Minor Undead", - SPECIES_PERK_DESC = "[name] are minor undead. \ - Minor undead enjoy some of the perks of being dead, like \ - not needing to breathe or eat, but do not get many of the \ - environmental immunities involved with being fully undead.", - )) - - return to_add - -/obj/item/organ/tongue/vampire - name = "vampire tongue" - actions_types = list(/datum/action/item_action/organ_action/vampire) - color = "#1C1C1C" - var/drain_cooldown = 0 - -#define VAMP_DRAIN_AMOUNT 50 - -/datum/action/item_action/organ_action/vampire - name = "Drain Victim" - desc = "Leech blood from any carbon victim you are passively grabbing." - -/datum/action/item_action/organ_action/vampire/Trigger() - . = ..() - if(iscarbon(owner)) - var/mob/living/carbon/H = owner - var/obj/item/organ/tongue/vampire/V = target - if(V.drain_cooldown >= world.time) - to_chat(H, "You just drained blood, wait a few seconds.") - return - if(H.pulling && iscarbon(H.pulling)) - var/mob/living/carbon/victim = H.pulling - if(H.blood_volume >= BLOOD_VOLUME_MAXIMUM) - to_chat(H, "You're already full!") - return - if(victim.stat == DEAD) - to_chat(H, "You need a living victim!") - return - if(!victim.blood_volume || (victim.dna && ((NOBLOOD in victim.dna.species.species_traits) || victim.dna.species.exotic_blood))) - to_chat(H, "[victim] doesn't have blood!") - return - V.drain_cooldown = world.time + 30 - if(victim.anti_magic_check(FALSE, TRUE, FALSE)) - to_chat(victim, "[H] tries to bite you, but stops before touching you!") - to_chat(H, "[victim] is blessed! You stop just in time to avoid catching fire.") - return - if(victim?.reagents?.has_reagent(/datum/reagent/consumable/garlic)) - to_chat(victim, "[H] tries to bite you, but recoils in disgust!") - to_chat(H, "[victim] reeks of garlic! you can't bring yourself to drain such tainted blood.") - return - if(!do_after(H, 3 SECONDS, target = victim, hidden = TRUE)) - return - var/blood_volume_difference = BLOOD_VOLUME_MAXIMUM - H.blood_volume //How much capacity we have left to absorb blood - var/drained_blood = min(victim.blood_volume, VAMP_DRAIN_AMOUNT, blood_volume_difference) - to_chat(victim, "[H] is draining your blood!") - to_chat(H, "You drain some blood!") - playsound(H, 'sound/items/drink.ogg', 30, 1, -2) - victim.blood_volume = clamp(victim.blood_volume - drained_blood, 0, BLOOD_VOLUME_MAXIMUM) - H.blood_volume = clamp(H.blood_volume + drained_blood, 0, BLOOD_VOLUME_MAXIMUM) - if(!victim.blood_volume) - to_chat(H, "You finish off [victim]'s blood supply!") - -#undef VAMP_DRAIN_AMOUNT - -/obj/item/organ/heart/vampire - name = "vampire heart" - actions_types = list(/datum/action/item_action/organ_action/vampire_heart) - color = "#1C1C1C" - -/datum/action/item_action/organ_action/vampire_heart - name = "Check Blood Level" - desc = "Check how much blood you have remaining." - -/datum/action/item_action/organ_action/vampire_heart/Trigger() - . = ..() - if(iscarbon(owner)) - var/mob/living/carbon/H = owner - to_chat(H, "Current blood level: [H.blood_volume]/[BLOOD_VOLUME_MAXIMUM].") - -/obj/effect/proc_holder/spell/targeted/shapeshift/bat - name = "Bat Form" - desc = "Take on the shape a space bat." - invocation = "Squeak!" - charge_max = 50 - cooldown_min = 50 - shapeshift_type = /mob/living/simple_animal/hostile/retaliate/bat/vampire diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index 89655acc213bf..6b9c02602af17 100755 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -429,7 +429,7 @@ metabolization_rate = 0.15 * REAGENTS_METABOLISM /datum/reagent/consumable/garlic/on_mob_life(mob/living/carbon/M) - if(isvampire(M)) //incapacitating but not lethal. Unfortunately, vampires cannot vomit. + if(IS_VAMPIRE(M)) //incapacitating but not lethal. Unfortunately, vampires cannot vomit. if(prob(min(25,current_cycle))) to_chat(M, "You can't get the scent of garlic out of your nose! You can barely think...") M.Paralyze(10) diff --git a/code/modules/reagents/reagent_containers/blood_pack.dm b/code/modules/reagents/reagent_containers/blood_pack.dm index 37cb861f31e3b..1b9f0552c979e 100644 --- a/code/modules/reagents/reagent_containers/blood_pack.dm +++ b/code/modules/reagents/reagent_containers/blood_pack.dm @@ -87,21 +87,34 @@ /obj/item/reagent_containers/blood/universal blood_type = "U" -/obj/item/reagent_containers/blood/attackby(obj/item/I, mob/user, params) - if (istype(I, /obj/item/pen) || istype(I, /obj/item/toy/crayon)) - if(!user.is_literate()) - to_chat(user, "You scribble illegibly on the label of [src]!") - return - var/t = stripped_input(user, "What would you like to label the blood pack?", name, null, 53) - if(!user.canUseTopic(src, BE_CLOSE)) - return - if(user.get_active_held_item() != I) +/obj/item/reagent_containers/blood/attack(mob/living/victim, mob/living/attacker, params) + if(!can_drink(victim, attacker)) + return + + if(victim != attacker) + if(!do_after(victim, 5 SECONDS, attacker)) return - if(t) - labelled = 1 - name = "blood pack - [t]" - else - labelled = 0 - update_pack_name() - else - return ..() + attacker.visible_message( + "[attacker] forces [victim] to drink from the [src].", + "You put the [src] up to [victim]'s mouth.", + ) + reagents.trans_to(victim, 5, transfered_by = attacker, method = INGEST) + playsound(victim.loc, 'sound/items/drink.ogg', 30, 1) + return TRUE + + while(do_after(victim, 1 SECONDS, timed_action_flags = IGNORE_USER_LOC_CHANGE, extra_checks = CALLBACK(src, PROC_REF(can_drink), victim, attacker))) + victim.visible_message( + "[victim] puts the [src] up to their mouth.", + "You take a sip from the [src].", + ) + reagents.trans_to(victim, 5, transfered_by = attacker, method = INGEST) + playsound(victim.loc, 'sound/items/drink.ogg', 30, 1) + return TRUE + +/obj/item/reagent_containers/blood/proc/can_drink(mob/living/victim, mob/living/attacker) + if(!canconsume(victim, attacker)) + return FALSE + if(!reagents || !reagents.total_volume) + to_chat(victim, "[src] is empty!") + return FALSE + return TRUE diff --git a/config/game_options.txt b/config/game_options.txt index d6640f5e05b08..64b39cb0b217b 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -519,7 +519,6 @@ ROUNDSTART_RACES plasmaman #ROUNDSTART_RACES shadow #ROUNDSTART_RACES dullahan #ROUNDSTART_RACES pumpkin_man -#ROUNDSTART_RACES vampire ## OP Halloween races: #ROUNDSTART_RACES skeleton diff --git a/html/img/vampire.caitiff.png b/html/img/vampire.caitiff.png new file mode 100644 index 0000000000000..0fb3cc1240e52 Binary files /dev/null and b/html/img/vampire.caitiff.png differ diff --git a/html/img/vampire.malkavian.png b/html/img/vampire.malkavian.png new file mode 100644 index 0000000000000..b9c8adcaef348 Binary files /dev/null and b/html/img/vampire.malkavian.png differ diff --git a/html/img/vampire.nosferatu.png b/html/img/vampire.nosferatu.png new file mode 100644 index 0000000000000..f43d3798f6cd3 Binary files /dev/null and b/html/img/vampire.nosferatu.png differ diff --git a/html/img/vampire.power_auspex.png b/html/img/vampire.power_auspex.png new file mode 100644 index 0000000000000..4c25d628151aa Binary files /dev/null and b/html/img/vampire.power_auspex.png differ diff --git a/html/img/vampire.power_bleed.png b/html/img/vampire.power_bleed.png new file mode 100644 index 0000000000000..92c8a08823668 Binary files /dev/null and b/html/img/vampire.power_bleed.png differ diff --git a/html/img/vampire.power_cloak.png b/html/img/vampire.power_cloak.png new file mode 100644 index 0000000000000..e6ff781d11c27 Binary files /dev/null and b/html/img/vampire.power_cloak.png differ diff --git a/html/img/vampire.power_distress.png b/html/img/vampire.power_distress.png new file mode 100644 index 0000000000000..3babc09f3c586 Binary files /dev/null and b/html/img/vampire.power_distress.png differ diff --git a/html/img/vampire.power_dominate.png b/html/img/vampire.power_dominate.png new file mode 100644 index 0000000000000..a82a836b4617e Binary files /dev/null and b/html/img/vampire.power_dominate.png differ diff --git a/html/img/vampire.power_feed.png b/html/img/vampire.power_feed.png new file mode 100644 index 0000000000000..4eb79d6078c07 Binary files /dev/null and b/html/img/vampire.power_feed.png differ diff --git a/html/img/vampire.power_fortitude.png b/html/img/vampire.power_fortitude.png new file mode 100644 index 0000000000000..a8433aef88cbb Binary files /dev/null and b/html/img/vampire.power_fortitude.png differ diff --git a/html/img/vampire.power_gohome.png b/html/img/vampire.power_gohome.png new file mode 100644 index 0000000000000..8f25556d15768 Binary files /dev/null and b/html/img/vampire.power_gohome.png differ diff --git a/html/img/vampire.power_human.png b/html/img/vampire.power_human.png new file mode 100644 index 0000000000000..6eef4c5308229 Binary files /dev/null and b/html/img/vampire.power_human.png differ diff --git a/html/img/vampire.power_lunge.png b/html/img/vampire.power_lunge.png new file mode 100644 index 0000000000000..981ab3937582d Binary files /dev/null and b/html/img/vampire.power_lunge.png differ diff --git a/html/img/vampire.power_mez.png b/html/img/vampire.power_mez.png new file mode 100644 index 0000000000000..46ecf67d6d3ad Binary files /dev/null and b/html/img/vampire.power_mez.png differ diff --git a/html/img/vampire.power_recup.png b/html/img/vampire.power_recup.png new file mode 100644 index 0000000000000..2732354225710 Binary files /dev/null and b/html/img/vampire.power_recup.png differ diff --git a/html/img/vampire.power_speed.png b/html/img/vampire.power_speed.png new file mode 100644 index 0000000000000..e7d1e87a196d6 Binary files /dev/null and b/html/img/vampire.power_speed.png differ diff --git a/html/img/vampire.power_strength.png b/html/img/vampire.power_strength.png new file mode 100644 index 0000000000000..019abacc62bb1 Binary files /dev/null and b/html/img/vampire.power_strength.png differ diff --git a/html/img/vampire.power_thaumaturgy.png b/html/img/vampire.power_thaumaturgy.png new file mode 100644 index 0000000000000..9db64190f9f06 Binary files /dev/null and b/html/img/vampire.power_thaumaturgy.png differ diff --git a/html/img/vampire.power_torpor.png b/html/img/vampire.power_torpor.png new file mode 100644 index 0000000000000..14c74329e4291 Binary files /dev/null and b/html/img/vampire.power_torpor.png differ diff --git a/html/img/vampire.power_tres.png b/html/img/vampire.power_tres.png new file mode 100644 index 0000000000000..bb3c70b2b3411 Binary files /dev/null and b/html/img/vampire.power_tres.png differ diff --git a/html/img/vampire.power_veil.png b/html/img/vampire.power_veil.png new file mode 100644 index 0000000000000..4d38520f8730f Binary files /dev/null and b/html/img/vampire.power_veil.png differ diff --git a/html/img/vampire.tremere.png b/html/img/vampire.tremere.png new file mode 100644 index 0000000000000..a22c115bdf806 Binary files /dev/null and b/html/img/vampire.tremere.png differ diff --git a/html/img/vampire.ventrue.png b/html/img/vampire.ventrue.png new file mode 100644 index 0000000000000..c7abf49b2be16 Binary files /dev/null and b/html/img/vampire.ventrue.png differ diff --git a/icons/effects/effects.dmi b/icons/effects/effects.dmi index 27b73165e759f..3625796d0dfd5 100644 Binary files a/icons/effects/effects.dmi and b/icons/effects/effects.dmi differ diff --git a/icons/hud/radials/radial_generic.dmi b/icons/hud/radials/radial_generic.dmi index 9406148c1def9..d89ea135388f2 100644 Binary files a/icons/hud/radials/radial_generic.dmi and b/icons/hud/radials/radial_generic.dmi differ diff --git a/icons/hud/screen_alert.dmi b/icons/hud/screen_alert.dmi index 13d032eeee32e..57b8e83441c5b 100644 Binary files a/icons/hud/screen_alert.dmi and b/icons/hud/screen_alert.dmi differ diff --git a/icons/mob/hud.dmi b/icons/mob/hud.dmi index cda07d5a8a15a..65ed70938793d 100644 Binary files a/icons/mob/hud.dmi and b/icons/mob/hud.dmi differ diff --git a/icons/vampires/actions_vampire.dmi b/icons/vampires/actions_vampire.dmi new file mode 100644 index 0000000000000..a2c60fa1189a4 Binary files /dev/null and b/icons/vampires/actions_vampire.dmi differ diff --git a/icons/vampires/bs_leftinhand.dmi b/icons/vampires/bs_leftinhand.dmi new file mode 100644 index 0000000000000..da5a9376ba9a8 Binary files /dev/null and b/icons/vampires/bs_leftinhand.dmi differ diff --git a/icons/vampires/bs_rightinhand.dmi b/icons/vampires/bs_rightinhand.dmi new file mode 100644 index 0000000000000..efd8a40a9d2c6 Binary files /dev/null and b/icons/vampires/bs_rightinhand.dmi differ diff --git a/icons/vampires/clan_icons.dmi b/icons/vampires/clan_icons.dmi new file mode 100644 index 0000000000000..f6242a2143db5 Binary files /dev/null and b/icons/vampires/clan_icons.dmi differ diff --git a/icons/vampires/stakes.dmi b/icons/vampires/stakes.dmi new file mode 100644 index 0000000000000..dfc1dc08bf433 Binary files /dev/null and b/icons/vampires/stakes.dmi differ diff --git a/icons/vampires/vamp_obj.dmi b/icons/vampires/vamp_obj.dmi new file mode 100644 index 0000000000000..a6386883b35ce Binary files /dev/null and b/icons/vampires/vamp_obj.dmi differ diff --git a/icons/vampires/vamp_obj_64.dmi b/icons/vampires/vamp_obj_64.dmi new file mode 100644 index 0000000000000..4367da28b32b8 Binary files /dev/null and b/icons/vampires/vamp_obj_64.dmi differ diff --git a/icons/vampires/vampiric.dmi b/icons/vampires/vampiric.dmi new file mode 100644 index 0000000000000..258cc7a542f9b Binary files /dev/null and b/icons/vampires/vampiric.dmi differ diff --git a/sound/misc/ghosty_wind.ogg b/sound/misc/ghosty_wind.ogg new file mode 100644 index 0000000000000..39bdb52a7d28a Binary files /dev/null and b/sound/misc/ghosty_wind.ogg differ diff --git a/sound/vampires/VampireAlert.ogg b/sound/vampires/VampireAlert.ogg new file mode 100644 index 0000000000000..100e81018c388 Binary files /dev/null and b/sound/vampires/VampireAlert.ogg differ diff --git a/sound/vampires/blood_vial_slurp.ogg b/sound/vampires/blood_vial_slurp.ogg new file mode 100644 index 0000000000000..89504b3f5d71d Binary files /dev/null and b/sound/vampires/blood_vial_slurp.ogg differ diff --git a/sound/vampires/coffin_close.ogg b/sound/vampires/coffin_close.ogg new file mode 100644 index 0000000000000..9f5852d65b814 Binary files /dev/null and b/sound/vampires/coffin_close.ogg differ diff --git a/sound/vampires/coffin_open.ogg b/sound/vampires/coffin_open.ogg new file mode 100644 index 0000000000000..d936db143e77e Binary files /dev/null and b/sound/vampires/coffin_open.ogg differ diff --git a/sound/vampires/griffin_1.ogg b/sound/vampires/griffin_1.ogg new file mode 100644 index 0000000000000..d722f609e70c7 Binary files /dev/null and b/sound/vampires/griffin_1.ogg differ diff --git a/sound/vampires/griffin_10.ogg b/sound/vampires/griffin_10.ogg new file mode 100644 index 0000000000000..b1c1138d70e6e Binary files /dev/null and b/sound/vampires/griffin_10.ogg differ diff --git a/sound/vampires/griffin_2.ogg b/sound/vampires/griffin_2.ogg new file mode 100644 index 0000000000000..4b122afcde4ab Binary files /dev/null and b/sound/vampires/griffin_2.ogg differ diff --git a/sound/vampires/griffin_3.ogg b/sound/vampires/griffin_3.ogg new file mode 100644 index 0000000000000..7d73ad576531d Binary files /dev/null and b/sound/vampires/griffin_3.ogg differ diff --git a/sound/vampires/griffin_4.ogg b/sound/vampires/griffin_4.ogg new file mode 100644 index 0000000000000..38835540a7218 Binary files /dev/null and b/sound/vampires/griffin_4.ogg differ diff --git a/sound/vampires/griffin_5.ogg b/sound/vampires/griffin_5.ogg new file mode 100644 index 0000000000000..878fd6f40ecb6 Binary files /dev/null and b/sound/vampires/griffin_5.ogg differ diff --git a/sound/vampires/griffin_6.ogg b/sound/vampires/griffin_6.ogg new file mode 100644 index 0000000000000..4f7e0eb2c6374 Binary files /dev/null and b/sound/vampires/griffin_6.ogg differ diff --git a/sound/vampires/griffin_7.ogg b/sound/vampires/griffin_7.ogg new file mode 100644 index 0000000000000..f3b76da177169 Binary files /dev/null and b/sound/vampires/griffin_7.ogg differ diff --git a/sound/vampires/griffin_8.ogg b/sound/vampires/griffin_8.ogg new file mode 100644 index 0000000000000..8c328fd723249 Binary files /dev/null and b/sound/vampires/griffin_8.ogg differ diff --git a/sound/vampires/griffin_9.ogg b/sound/vampires/griffin_9.ogg new file mode 100644 index 0000000000000..f7d6fcbdd254e Binary files /dev/null and b/sound/vampires/griffin_9.ogg differ diff --git a/sound/vampires/jackinthebomb.ogg b/sound/vampires/jackinthebomb.ogg new file mode 100644 index 0000000000000..a49fa02eac15e Binary files /dev/null and b/sound/vampires/jackinthebomb.ogg differ diff --git a/sound/vampires/lunge_warn.ogg b/sound/vampires/lunge_warn.ogg new file mode 100644 index 0000000000000..db49b1e56ce2f Binary files /dev/null and b/sound/vampires/lunge_warn.ogg differ diff --git a/sound/vampires/monsterhunterintro.ogg b/sound/vampires/monsterhunterintro.ogg new file mode 100644 index 0000000000000..d3a0367a08192 Binary files /dev/null and b/sound/vampires/monsterhunterintro.ogg differ diff --git a/sound/vampires/moonlightbeam.ogg b/sound/vampires/moonlightbeam.ogg new file mode 100644 index 0000000000000..d54302a611565 Binary files /dev/null and b/sound/vampires/moonlightbeam.ogg differ diff --git a/sound/vampires/moonlightsword.ogg b/sound/vampires/moonlightsword.ogg new file mode 100644 index 0000000000000..95df7ba5d71cf Binary files /dev/null and b/sound/vampires/moonlightsword.ogg differ diff --git a/sound/vampires/owl_1.ogg b/sound/vampires/owl_1.ogg new file mode 100644 index 0000000000000..ed25c6ac4148c Binary files /dev/null and b/sound/vampires/owl_1.ogg differ diff --git a/sound/vampires/owl_10.oga b/sound/vampires/owl_10.oga new file mode 100644 index 0000000000000..97f45d4337886 Binary files /dev/null and b/sound/vampires/owl_10.oga differ diff --git a/sound/vampires/owl_2.ogg b/sound/vampires/owl_2.ogg new file mode 100644 index 0000000000000..12f26fb6223ea Binary files /dev/null and b/sound/vampires/owl_2.ogg differ diff --git a/sound/vampires/owl_3.ogg b/sound/vampires/owl_3.ogg new file mode 100644 index 0000000000000..f64b193e4ee3e Binary files /dev/null and b/sound/vampires/owl_3.ogg differ diff --git a/sound/vampires/owl_5.ogg b/sound/vampires/owl_5.ogg new file mode 100644 index 0000000000000..e4fd7cd2bb083 Binary files /dev/null and b/sound/vampires/owl_5.ogg differ diff --git a/sound/vampires/owl_6.ogg b/sound/vampires/owl_6.ogg new file mode 100644 index 0000000000000..8dacf98503728 Binary files /dev/null and b/sound/vampires/owl_6.ogg differ diff --git a/sound/vampires/owl_7.ogg b/sound/vampires/owl_7.ogg new file mode 100644 index 0000000000000..249f171052cf7 Binary files /dev/null and b/sound/vampires/owl_7.ogg differ diff --git a/sound/vampires/owl_8.ogg b/sound/vampires/owl_8.ogg new file mode 100644 index 0000000000000..0439517a30f17 Binary files /dev/null and b/sound/vampires/owl_8.ogg differ diff --git a/sound/vampires/owl_9.ogg b/sound/vampires/owl_9.ogg new file mode 100644 index 0000000000000..54bc5f971ff11 Binary files /dev/null and b/sound/vampires/owl_9.ogg differ diff --git a/sound/vampires/paradoxskip.ogg b/sound/vampires/paradoxskip.ogg new file mode 100644 index 0000000000000..3742a630717e6 Binary files /dev/null and b/sound/vampires/paradoxskip.ogg differ diff --git a/sound/vampires/rabbitlocator.ogg b/sound/vampires/rabbitlocator.ogg new file mode 100644 index 0000000000000..027d9201e44a4 Binary files /dev/null and b/sound/vampires/rabbitlocator.ogg differ diff --git a/sound/vampires/weaponsmithing.ogg b/sound/vampires/weaponsmithing.ogg new file mode 100644 index 0000000000000..2e54f919dda56 Binary files /dev/null and b/sound/vampires/weaponsmithing.ogg differ diff --git a/sound/vampires/wonderlandmusic.ogg b/sound/vampires/wonderlandmusic.ogg new file mode 100644 index 0000000000000..12d4e80f126ff Binary files /dev/null and b/sound/vampires/wonderlandmusic.ogg differ diff --git a/strings/malkavian_revelations.json b/strings/malkavian_revelations.json new file mode 100644 index 0000000000000..3fedeba06a2c9 --- /dev/null +++ b/strings/malkavian_revelations.json @@ -0,0 +1,117 @@ +{ + "revelations": [ + "#There could have an entirely separate dimension only visible through pools of Blood, and we will never see it.", + "#Explosions happen often, I wonder if one will strike me one day. I wonder if I'll survive.", + "#The Captain will fall eventually, everything is only a matter of time.", + "#There's always something there to be enlightened from. Something to learn. Something to teach.", + "#Why have we been abandoned in this universe... When will we be taken away to the rest of the living?", + "#When will the dreams stop following me? Why have they picked me, of all people?", + "#The one listening to the voices in his head is called foolish from those unaware, but does that make him insane?", + "#Oh dear... perhaps I've taken my life a little too far today. I wonder what's next.", + "#Sometimes I feel like I am the last prophet to ever exist... Maybe I am.", + "#I wonder what made me this way. Is it my Malkavian blood? My hatred for those around me?", + "#Maybe I should start to think about what consequences my actions lead me to. Or maybe it's best not to think about it.", + "#If I focus on my goals, rather than what I want to do, am I truly happy?", + "#Maybe... in an alternate universe... I could be part of another family. One that cares more about me...", + ",lI wonder what other people think of me... Possibly terribly.", + "#...What would happen if I Vassalized a Clown?", + "#Why can't we just walk? Does anyone walk anymore? Why do we run? What rush are we in?", + "#Medbay is overworking, I wonder why they are always so shortstaffed.", + "#Why do we take a pod instead of the shuttle? Where's the fun in that?", + ",lHuh...", + "#I was so close to a new revelation, but I lost my train of thought for a moment there.", + "#What happens once all the organics die? Would just the unorganics remain?", + "#Hmmm... What would happen if I killed a Command member...", + "#Supermatters unnaturally look like candy... I wonder what would happen if I licked it...", + "#Everyone thinks of me as a freak, at least I'm not a creep, then they'd be sorry.", + ",lDon't forget to use the Mentor tab to ask for help!", + "#I wonder what they put on the bikes to cost a million credits...", + "#I wonder if my upstream would accept me for who I am.", + "#Is it possible... for the undead to get a heart attack? Nevermind, strange question.", + ",lWhat would happen if a Vampire got their hands on a Power Miner?", + "#There are Aliens, they exist. It isn't a conspiracy. The real question is when they will attack us.", + "#Is Brain damage real, or is it just our brains adapting to reality?", + "#How do we all understand eachother when we speak over eachother on the radio?", + "#Huds are broken again, it seems...", + "#Never make a deal with the devil... worst mistake of my life.", + "#Does plasma still affect the minds of people who can't get poisoned?", + "#Who thought sending a research station into a contested area was a good idea? Unless it's just sick and twisted humor... like a game!", + "#How well would a Cryogenic Blob deal against my power?", + "#It's possible to learn how to bloodcrawl...", + "#Changelings are the purest form of a Human... if Humans were the most unpure thing.", + "#I would like to take a stroll around the station, floating through the space around us... must feel nice.", + "#Who thought of the idea of Health Analyzers? Like, something that instantly knows everything wrong with you?", + "#How much of our soul does Nanotrasen REALLY own... they certainly don't own enough if they always have traitors among their crew...", + "#I wonder how the Devil is doing today... haven't seen them in a long time.", + "#We straight gassing cutting straight to the bricks ha ha.", + "#This shit ain't nothing to me man.", + "#I had to do it to them snipe.", + "#I'm not loyal to anybody I'm a demon.", + "#I have no loyalty for anyone never did never will.", + "#Shorty chose to be with a demon sounds like her problem to, me ha ha!", + "#Moving like Dracula we get it back in blood.", + "#You see it I really did this I'm really him.", + "#Flipped a whole brick into an empire stop playing with me.", + "#Smoking fentanyl-laced blood; I see God.", + "#Yeah we getting that Pirate Bay alien shish kabab cordycep money.", + "#I just popped a whole garbanzo bean, fuck you mean?", + "#I smoke real Emrānī rapscallion ghost nuggets.", + "I'm him! I been him!! I will continue to be him!!!", + "#They thought they could stop the demon, I'm back!", + "#The zaza got me speaking Esperanto.", + "#You can't trust me, I don't even trust myself. I don't even know who I am anymore, I'm getting too much money.", + "#Get the Captain on the holocall now! I fronted him a brick, I need my money!", + "#We smokin' Symbiotes.", + "#Smokin' that Whoopi Goldberg south Egyptian kindred deluxe Mega Millions scratcher skunk bubba kush.", + "#We smokin' Sequoia banshee boogers.", + "#They must have amnesia, they forgot that I'm him.", + "#Motherfucker look like a Resident Evil 5 campaign extra after we was done with him.", + "#Ops wanted some initiative, blew up their entire quadrant, I'm moving like Cuban Pete.", + "#I was flipping bricks for Mansa Musa before y'all even became a type 1 civilization.", + "#I have seen the Magna Carta. I've seen the Eye of Hora.", + "#You think I care about this shit? Ask me if I care about this shit, 'cause I don't give a shit! If I had a credit for every time they said I gave a shit, I'd be broke 'Cause I don't give a shit!", + "#This .357 got me moving like an invasive species.", + "#I got Midas touch shitter.", + "#I'm at the vault boutta withdraw all of it.", + "#That Fentanyl gave me Vitruvian Man flexibility. Got me in a state of rigor mortis.", + "#Caught a broke boy trying to come up on my Amazon package, so I skinned his ass alive.", + "#We smokin' Serge Ibaka spinal fluid infused quick-release percs.", + "#They needеd a stealth soldier, so I put my hands on the hibachi hot plate at Benihana, and burned my fucking finger prints off. They will not find me...", + "#Konichiwa you little jit.", + "#Snortin' some premium Matisyahu got me fightin' for my life.", + "#The Cuban link will turn the diamond tester into a pipe bomb.", + "#Stechkin shivered his timbers.", + "#I'm smoking Mesopotamian, Stanley Cup triple-award-winning, soul-bleeder, J.D. Power Associates, dingleberry zaza.", + "#We smoking that IBM Quantum Computer.", + "#My diamonds come from the most horrific situations possible.", + "#Fuck it, I ate the opp.", + "#Fuck it, I'm coming for every enzyme.", + "#I'll fucking kill you!.", + "#The first time I smoked runts, I coughed so fucking hard, I started passing kidney stones, then toolboxed myself in front of the gang!", + "#Hold on, lemme get some sip.", + "#The Codex should be treated like a Nuclear Authentication Disk, it is what guards this realm from the one below, afterall...", + "#No one knows how to read anymore, no matter how 'in your face' you put things, they'll never get it.", + "#150, 149, 148... 147, 146, 145, 144... What number was I at, again?", + "#No matter what we do, the feeling of pain will be inevitable.", + "#It seems Revolutionaries might take over the station today", + "#Huh, Nuclear Operatives lost in space. That's new.", + ",lWhere did I go wrong in my mortal life to end up here...", + "#The one that knows the Monster's tricks is sure to arrive. Only time will tell when.", + "#What are we even doing on such a Station? Don't we all know this will end in disaster?", + "#I can't think properly...", + "#I wonder what the Ancient Greek philosophers would say if they were alive today.", + "#I could go for some food just about now...", + "#Some coffee would be life-changing right about now...", + "#If only everyone saw the world in the same way I have", + "#What did Humanity do to deserve my creation?", + "#If we were all born for a reason, mine is completely idiotic.", + "#If there really is a God, why would they allow me to exist?", + "#...I think I lost track of something... I can't remember what...", + "#Who is humanity to decide who someone is? Why should they meddle in my affairs?", + "#The person everyone tries to silence, is the one people will miss the most", + "#It's hard to tell if people just don't understand my level of philosophy, or if they just play dumb to get reactions out of me.", + ";This is your fault.", + ",lWhy do we always infight, what's wrong with a little teamwork, it gets us further.", + "#What's a hacked autodrobe but a machine forced to show itself to you. Is it moral?" + ] +} diff --git a/tgui/packages/tgui/interfaces/AntagInfoRevengeVassal.tsx b/tgui/packages/tgui/interfaces/AntagInfoRevengeVassal.tsx new file mode 100644 index 0000000000000..3bcf227719043 --- /dev/null +++ b/tgui/packages/tgui/interfaces/AntagInfoRevengeVassal.tsx @@ -0,0 +1,128 @@ +import { resolveAsset } from '../assets'; +import { BooleanLike } from 'common/react'; +import { useBackend, useLocalState } from '../backend'; +import { Box, Button, Divider, Dropdown, Section, Stack } from '../components'; +import { Window } from '../layouts'; + +type Objective = { + count: number; + name: string; + explanation: string; + complete: BooleanLike; + was_uncompleted: BooleanLike; + reward: number; +}; + +type VampireInformation = { + power: PowerInfo[]; +}; + +type PowerInfo = { + power_name: string; + power_explanation: string; + power_icon: string; +}; + +type Info = { + objectives: Objective[]; +}; + +const ObjectivePrintout = (props: any, context: any) => { + const { data } = useBackend(context); + const { objectives } = data; + return ( + + Your current objectives: + + {(!objectives && 'None!') || + objectives.map((objective) => ( + + #{objective.count}: {objective.explanation} + + ))} + + + ); +}; + +export const AntagInfoRevengeVassal = (props: any, context: any) => { + return ( + + + + + + ); +}; + +const VassalInfo = () => { + return ( + + +
+ + + You are a Vassal tasked with taking revenge for the death of your Master! + + + + + +
+
+ +
+ + + + You have gained your Master's old Powers, and a brand new power. You will have to survive and maintain your + old Master's integrity. Bring their old Vassals back into the fold using your new Ability. + + + +
+
+ + + +
+ ); +}; + +const PowerSection = (props: any, context: any) => { + const { act, data } = useBackend(context); + const { power } = data; + if (!power) { + return
; + } + + const [selectedPower, setSelectedPower] = useLocalState(context, 'power', power[0]); + + return ( +
}> + + + powers.power_name)} + onSelected={(powerName: string) => setSelectedPower(power.find((p) => p.power_name === powerName) || power[0])} + /> + {selectedPower && ( + + )} + + + + + {selectedPower && selectedPower.power_explanation} + + +
+ ); +}; diff --git a/tgui/packages/tgui/interfaces/AntagInfoVampire.tsx b/tgui/packages/tgui/interfaces/AntagInfoVampire.tsx new file mode 100644 index 0000000000000..572616f960c9a --- /dev/null +++ b/tgui/packages/tgui/interfaces/AntagInfoVampire.tsx @@ -0,0 +1,243 @@ +import { resolveAsset } from '../assets'; +import { BooleanLike } from 'common/react'; +import { useBackend, useLocalState } from '../backend'; +import { Box, Button, Divider, Dropdown, Section, Stack, Tabs } from '../components'; +import { Window } from '../layouts'; + +type Objective = { + count: number; + name: string; + explanation: string; + complete: BooleanLike; + was_uncompleted: BooleanLike; + reward: number; +}; + +type VampireInformation = { + clan: ClanInfo[]; + in_clan: BooleanLike; + power: PowerInfo[]; +}; + +type ClanInfo = { + clan_name: string; + clan_description: string; + clan_icon: string; +}; + +type PowerInfo = { + power_name: string; + power_explanation: string; + power_icon: string; +}; + +type Info = { + objectives: Objective[]; +}; + +const ObjectivePrintout = (props: any, context: any) => { + const { data } = useBackend(context); + const { objectives } = data; + return ( + + Your current objectives: + + {(!objectives && 'None!') || + objectives.map((objective) => ( + + #{objective.count}: {objective.explanation} + + ))} + + + ); +}; + +export const AntagInfoVampire = (props: any, context: any) => { + const [tab, setTab] = useLocalState(context, 'tab', 1); + return ( + + + + setTab(1)}> + Introduction + + setTab(2)}> + Clan & Powers + + + {tab === 1 && } + {tab === 2 && } + + + ); +}; + +const VampireIntro = () => { + return ( + + +
+ + + You are a Vampire, an undead blood-seeking monster living aboard Space Station 13 + + + + + +
+
+ +
+ + + + You regenerate your health slowly, you're weak to fire, and you depend on blood to survive. Don't allow + your blood to run too low, or you'll enter a + + Frenzy!
+
+ + Avoid using your Feed ability while near mortals, or else you will risk breaking the Masquerade! + +
+
+
+
+ +
+ + + Rest in a Coffin to claim it, and that area, as your lair. +
+ Examine your new structures to see how they function! +
+ Medical and Genetic Analyzers can sell you out, your Masquerade ability will hide your identity to prevent this. +
+
+ +
+ Other Vampires are not necessarily your friends, but your survival may depend on cooperation. Betray them at + your own discretion and peril. +
+
+
+
+
+
+ ); +}; + +const VampireClan = (props: any, context: any) => { + const { act, data } = useBackend(context); + const { clan, in_clan } = data; + + if (!in_clan) { + return ( +
+ + You are not in a Clan. + + +
+ ); + } + + return ( + + +
+ + + {clan.map((ClanInfo) => ( + <> + + + You are part of the {ClanInfo.clan_name} + + {ClanInfo.clan_description} + + ))} + + +
+ +
+
+ ); +}; + +const PowerSection = (props: any, context: any) => { + const { act, data } = useBackend(context); + const { power } = data; + if (!power) { + return
; + } + + const [selectedPower, setSelectedPower] = useLocalState(context, 'power', power[0]); + + return ( +
+ }> + + + + powers.power_name)} + onSelected={(powerName: string) => setSelectedPower(power.find((p) => p.power_name === powerName) || power[0])} + /> + + + + {selectedPower && selectedPower.power_explanation} + + +
+ ); +}; diff --git a/tgui/packages/tgui/interfaces/KindredBook.tsx b/tgui/packages/tgui/interfaces/KindredBook.tsx new file mode 100644 index 0000000000000..306c567e9917e --- /dev/null +++ b/tgui/packages/tgui/interfaces/KindredBook.tsx @@ -0,0 +1,41 @@ +import { useBackend } from '../backend'; +import { Collapsible, Table, Section } from '../components'; +import { Window } from '../layouts'; + +type Data = { + clans: ClanInfo[]; +}; + +type ClanInfo = { + clan_name: string; + clan_desc: string; +}; + +export const KindredBook = (props, context) => { + const { data } = useBackend(context); + const { clans } = data; + return ( + + +
+ + + Written by generations of Curators, this holds all information we the Curators know about the undead threat that + looms the station... + + So, what Clan are you interested in? +
+ + + {clans.map((clan) => ( + + {clan.clan_desc} + + ))} + +
+
+
+
+ ); +};