Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

artifacts! #2622

Merged
merged 23 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 125 additions & 0 deletions code/__DEFINES/artifacts.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
#define ART_PROCESS_NEEDS_MOB (1 << 0)
#define CURSED -1
#define UNCURSED 0
#define BLESSED 1

#define ART_RARITY_COMMON "1"
#define ART_RARITY_UNCOMMON "2"
#define ART_RARITY_RARE "3"
#define ART_RARITY_UNIQUE "4"

#define ART_MOB_CHANGED (1 << 0)
#define ART_HOLDER_CHANGED (1 << 1)
#define ART_SLUT_CHANGED (1 << 2)

/// OVERRIDES SENT TO THE ARTIFACT COMPONENT, NOT THE EFFECT
#define ARTVAR_CRUD_IT_UP "ARTVAR_CRUD_IT_UP"

/// BASE EFFECT OVERRIDES -- used in all effects!!
#define ARTVAR_NAME "ARTVAR_NAME"
#define ARTVAR_DESIRED_SLOTS "ARTVAR_DESIRED_SLOTS"
#define ARTVAR_PREFERED_CONTAINER "ARTVAR_PREFERED_CONTAINER"
#define ARTVAR_TARGET_PATH "ARTVAR_TARGET_PATH"
#define ARTVAR_IS_BUFF "ARTVAR_IS_BUFF"
#define ARTVAR_KIND "ARTVAR_KIND"
#define ARTVAR_ALLOW_DUPES "ARTVAR_ALLOW_DUPES"
#define ARTVAR_DELETE "ARTVAR_DELETE"

#define ART_NO_PREFIX "NO_PREFIX_PLZ"
#define ART_NO_SUFFIX "NO_SUFFIX_PLZ"
#define ART_NO_COLOR "ART_NO_COLOR"

#define ARTCOMP_PREFIX "ARTCOMP_PREFIX"
#define ARTCOMP_SUFFIX "ARTCOMP_SUFFIX"
#define ARTCOMP_COLOR "ARTCOMP_COLOR"
#define ARTCOMP_PREROLLED "ARTCOMP_PREROLLED"

#define ART_FORCE_SPECIFIC_UNIQUE "ART_FORCE_SPECIFIC_UNIQUE"
#define ART_UNIQUE_TAG "ART_UNIQUE_TAG"

/// MAX HP MODIFIER
#define ARTMOD_MAX_HP "ARTMOD_MAX_HP"
#define ARTVAR_HP_CHANGE "ARTVAR_HP_CHANGE"
#define ARTVAR_EQUIP_MESSAGE "ARTVAR_EQUIP_MESSAGE"
#define ARTVAR_UNEQUIP_MESSAGE "ARTVAR_UNEQUIP_MESSAGE"

/// SPEED MODIFIER
#define ARTMOD_SPEED "ARTMOD_SPEED"
#define ARTVAR_SPEED_ADJUSTMENT "ARTVAR_SPEED_ADJUSTMENT"

/// TRAIT GIVER
#define ARTVAR_TRAIT_TO_GIVE "ARTVAR_TRAIT_TO_GIVE"
#define ARTVAR_CUSTOM_PREFIX "ARTVAR_CUSTOM_PREFIX"
#define ARTVAR_CUSTOM_SUFFIX "ARTVAR_CUSTOM_SUFFIX"
#define ARTVAR_CUSTOM_DESC "ARTVAR_CUSTOM_DESC"

/// DAMAGE/HEAL OVERRIDES
#define ARTMOD_PASSIVE_DOT "ARTMOD_PASSIVE_DOT"
#define ARTMOD_PASSIVE_DOT_RANDOM "ARTMOD_PASSIVE_DOT_RANDOM" // uses the same overrides
#define ARTVAR_MIN_HEALTH "ARTVAR_MIN_HEALTH"
#define ARTVAR_BRUTE "ARTVAR_BRUTE"
#define ARTVAR_BURN "ARTVAR_BURN"
#define ARTVAR_TOXIN "ARTVAR_TOXIN"
#define ARTVAR_OXY "ARTVAR_OXY"
#define ARTVAR_CLONE "ARTVAR_CLONE"
#define ARTVAR_BRAIN "ARTVAR_BRAIN"
#define ARTVAR_IS_DPS "ARTVAR_IS_DPS"
#define ARTVAR_TOO_INJURED "ARTVAR_TOO_INJURED"
#define ARTVAR_INJURED "ARTVAR_INJURED"
#define ARTVAR_ARMOR_FLAG "ARTVAR_ARMOR_FLAG"
#define ARTFLAG_DAMAGE_PRESET "ARTFLAG_DAMAGE_PRESET"

/// HEAL OVERRIDES -- ALSO USES DAMAGE/HEAL OVERRIDES!
#define ARTMOD_PASSIVE_HEAL "ARTMOD_PASSIVE_HEAL"
#define ARTVAR_MAX_HEALTH "ARTVAR_MAX_HEALTH"
#define ARTFLAG_BLOCK_DAMAGE_RANDOM "ARTFLAG_BLOCK_DAMAGE_RANDOM"

/// STAMINA OVERRIDES
#define ARTMOD_STAMINA "ARTMOD_STAMINA"
#define ARTVAR_STAMINA_ADJUSTMENT "ARTVAR_STAMINA_ADJUSTMENT"
#define ARTVAR_STAMCRIT_COOLDOWN "ARTVAR_STAMCRIT_COOLDOWN"

/// RADIATION OVERRIDES
#define ARTMOD_RADIATION "ARTMOD_RADIATION"
#define ARTVAR_RADIATION_ADJUSTMENT "ARTVAR_RADIATION_ADJUSTMENT"
#define ARTVAR_TARGET_RADIATION "ARTVAR_TARGET_RADIATION"

/// BLOOD OVERRIDES
#define ARTMOD_BLOOD "ARTMOD_BLOOD"
#define ARTVAR_BLOOD_ADJUSTMENT "ARTVAR_BLOOD_ADJUSTMENT"
#define ARTVAR_TARGET_BLOOD "ARTVAR_TARGET_BLOOD"

/// NUTRITION OVERRIDES
#define ARTMOD_FEEDER "ARTMOD_FEEDER"
#define ARTVAR_NUTRITION_ADJUSTMENT "ARTVAR_NUTRITION_ADJUSTMENT"
#define ARTVAR_TARGET_NUTRITION "ARTVAR_TARGET_NUTRITION"

/// UNIQUE DEFINES
#define ART_UNIQUE_APOTHEOSIS "ART_UNIQUE_APOTHEOSIS"
#define ART_UNIQUE_PERFECTION "ART_UNIQUE_PERFECTION"
#define ART_UNIQUE_PENANCE "ART_UNIQUE_PENANCE"
#define ART_UNIQUE_BUBBLE "ART_UNIQUE_BUBBLE"

#define ARTMOD_TIMER_PENANCE "ARTMOD_TIMER_PENANCE"

/// TRAIT GIVER DEFINES
#define ARTMOD_TRAIT_GIVER "ARTMOD_TRAIT_GIVER"
#define ARTMOD_TRAIT_GIVER_PENANCE "ARTMOD_TRAIT_GIVER_PENANCE"

/// TIMER DEFINES
#define ARTMOD_TIMER "ARTMOD_TIMER"
#define ARTVAR_TARGET_TIME "ARTVAR_TARGET_TIME"
#define ARTVAR_MAX_DELTA "ARTVAR_MAX_DELTA"

#define ART_IDENT_MAX_DELTA 5 SECONDS
#define ART_IDENT_TIME 10 MINUTES

#define ART_PENANCE_TIME 20 MINUTES

/// Be sure to update this if you change their jobnames
#define ART_SCI_JOBS list(\
"Town Scientist",\
"Enclave Scientist",\
"Vault-tec Scientist",\
"Scientist",\
)
33 changes: 33 additions & 0 deletions code/__DEFINES/cooldowns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,36 @@
#define COOLDOWN_RESET(cd_source, cd_index) cd_source.cd_index = 0

#define COOLDOWN_TIMELEFT(cd_source, cd_index) (max(0, cd_source.cd_index - world.time))

//////////////////////////////////////////////////////////////////////////////////////////////////////
/// holds a progress thing that'll only count up when told to count up. //////////////////////////////
/// mainly for things that are supposed to take a certain amount of time under certain conditions. ///
/datum/counter_holder
var/last_tick = 0
var/progress = 0
var/target_time = 0
var/max_delta = 0
var/complete = FALSE

/datum/counter_holder/New(target_time, max_delta)
src.last_tick = world.time
src.target_time = target_time
src.max_delta = max_delta

/datum/counter_holder/proc/reset()
last_tick = world.time
progress = 0
complete = FALSE

/datum/counter_holder/proc/tick()
progress += min(world.time - last_tick, max_delta)

/datum/counter_holder/proc/check_complete()
return progress >= target_time

/datum/counter_holder/proc/mark_complete()
complete = TRUE

/datum/counter_holder/proc/is_complete()
return complete

21 changes: 19 additions & 2 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,12 @@
#define COMSIG_ATOM_GET_EXAMINE_NAME "atom_examine_name"
#define COMSIG_PARENT_EXAMINE_MORE "atom_examine_more" ///from base of atom/examine_more(): (/mob)
//Positions for overrides list
#define EXAMINE_POSITION_ARTICLE (1<<0)
#define EXAMINE_POSITION_BEFORE (1<<1)
#define EXAMINE_POSITION_ARTICLE 1
#define EXAMINE_POSITION_GRODY 2
#define EXAMINE_POSITION_PREFIX 3
#define EXAMINE_POSITION_NAME 4
#define EXAMINE_POSITION_SUFFIX 5
#define EXAMINE_LIST_LEN 5
//End positions
#define COMPONENT_EXNAME_CHANGED (1<<0)
#define COMSIG_ATOM_UPDATE_ICON "atom_update_icon" //from base of atom/update_icon(): ()
Expand Down Expand Up @@ -440,6 +444,19 @@
#define COMSIG_ITEM_MINE_TRIGGERED "itemineboom" ///from [/obj/item/mine/proc/triggermine]:
#define COMSIG_ITEM_RESKINNABLE "can_reskin" ///from [/obj/item/mine/proc/triggermine]:
#define COMSIG_ITEM_GET_CURRENT_RESKIN "get_state" // (datum/source, list/my_iconstate)
#define COMSIG_ITEM_GET_COST "get_cost"

/// Artifact/effect signals
#define COMSIG_ITEM_ARTIFACT_GET_EFFECTS "artifact_get_effects" // (datum/source, list/effect)
#define COMSIG_ITEM_ARTIFACT_COMPONENT "artifact_component" // returns the component. unused
#define COMSIG_ITEM_ARTIFACT_EXISTS "artifact_exists" // just returns if theres this component there
#define COMSIG_ITEM_ARTIFACT_MAKE_UNIQUE "artifact_make_unique" // (datum/source, datum/artifact_unique/AU)
#define COMSIG_ITEM_ARTIFACT_IDENTIFIED "artifact_identified" // (datum/source, mob/user)
#define COMSIG_ITEM_ARTIFACT_ADD_EFFECT "artifact_add_effect" // (datum/source, datum/artifact_effect/AE_path, list/parameters = list())
#define COMSIG_ITEM_ARTIFACT_FINALIZE "artifact_finalize" // tells the artifact we're done adding effects, and to crud it up, if applicable
#define COMSIG_ITEM_ARTIFACT_READ_PARAMETERS "artifact_read_parameters" // tells the artifact we're done adding effects, and to crud it up, if applicable

#define COMSIG_ATOM_GET_VALUE "get_value" /// returns the value of the atom

/// datum/source, mob/spawner
#define COMSIG_ITEM_MOB_DROPPED "mobdropped" /// from [/mob/living/simple_animal/proc/drop_loot()]
Expand Down
4 changes: 4 additions & 0 deletions code/__DEFINES/maths.dm
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@
var/roundie = 1 * (0.1**decimals)
return "[round(number, roundie)][unit]"



#define RANDOM(min, max) (rand(min*1000, max*1000)*0.001)

/proc/pad_number(number, decimals = 0) // this proc doesnt work, lol
if(decimals <= 0)
return "[number]"
Expand Down
4 changes: 2 additions & 2 deletions code/__DEFINES/radiation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Changes here can have widespread effects: make sure you test well.
Ask ninjanomnom if they're around
*/

#define RAD_BACKGROUND_RADIATION 9 // How much radiation is harmless to a mob, this is also when radiation waves stop spreading
#define RAD_BACKGROUND_RADIATION 1 // How much radiation is harmless to a mob, this is also when radiation waves stop spreading
// WARNING: Lowering this value significantly increases SSradiation load

// apply_effect((amount*RAD_MOB_COEFFICIENT)/max(1, (radiation**2)*RAD_OVERDOSE_REDUCTION), IRRADIATE, blocked)
#define RAD_MOB_COEFFICIENT 0.20 // Radiation applied is multiplied by this
#define RAD_MOB_SKIN_PROTECTION ((1/RAD_MOB_COEFFICIENT)+RAD_BACKGROUND_RADIATION)
#define RAD_MOB_SKIN_PROTECTION 1

#define RAD_LOSS_PER_TICK 0.5
#define RAD_TOX_COEFFICIENT 0.05 // Toxin damage per tick coefficient
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
#define INIT_ORDER_TIMETRACK 47
#define INIT_ORDER_NETWORKS 40
#define INIT_ORDER_HOLODECK 35
#define INIT_ORDER_ARTIFACT 34
#define INIT_ORDER_ATOMS 30
#define INIT_ORDER_ITEMSPAWNERS 29
#define INIT_ORDER_VALIDBALL 28
Expand Down
6 changes: 6 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,12 @@
#define TRAIT_NO_STORAGE_INSERT "no_storage_insert"
/// Can't leave a storage!
#define TRAIT_NO_STORAGE_REMOVE "TRAIT_NO_STORAGE_REMOVE"
#define TRAIT_ARTIFACT_BLOCKER "TRAIT_ARTIFACT_BLOCKER"

/// Artifact traits
#define TRAIT_PENANCE "penance" // died with the wretched thing
#define TRAIT_PENANCE_COMPLETE "penance_complete" // held that wretched thing for a long time
#define TRAIT_ARTIFACT_IDENTIFY "artifact_identify" // always knows everything about artifacts

// common trait sources
#define TRAIT_GENERIC "generic"
Expand Down
8 changes: 8 additions & 0 deletions code/__DEFINES/weather.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@
Z_LEVEL_REDWATER,\
Z_LEVEL_REDLICK,\
Z_LEVEL_GARLAND)
#define ARTIFACT_Z_LEVELS list(\
Z_LEVEL_NASH_UNDERGROUND,\
Z_LEVEL_NASH_COMMON,\
Z_LEVEL_NASH_LVL2,\
Z_LEVEL_NASH_LVL3,\
Z_LEVEL_REDWATER,\
Z_LEVEL_REDLICK,\
Z_LEVEL_GARLAND)

/* * * * * * * * * * * * *
* THE Z LEVELS~
Expand Down
11 changes: 11 additions & 0 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1627,6 +1627,17 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
if(haystack.loc)
return recursive_loc_search(haystack.loc, needle, max_depth - 1)

/// REcursively searches through the atom's loc, looking for a type path, aborting if it hits a turf
/proc/recursive_loc_path_search(atom/haystack, pathtype, max_depth = 5)
if(max_depth <= 0)
return // we've gone too deep
if(istype(haystack, pathtype))
return haystack
if(isturf(haystack))
return
if(haystack.loc)
return recursive_loc_path_search(haystack.loc, pathtype, max_depth - 1)

/// Recursively searches through everything in a turf for atoms. Will recursively search through all those atoms for atoms, and so on.
/proc/get_all_in_turf(turf/search_me, include_turf = FALSE, max_depth = 5)
if(!isturf(search_me))
Expand Down
15 changes: 14 additions & 1 deletion code/_globalvars/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,28 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_XENO_HOST" = TRAIT_XENO_HOST,
"TRAIT_XRAY_VISION" = TRAIT_XRAY_VISION,
"TRAIT_ZOOMIES" = TRAIT_ZOOMIES,
"TRAIT_SUPER_ZOOMIES" = TRAIT_SUPER_ZOOMIES,
"TRAIT_ENDLESS_RUNNER" = TRAIT_ENDLESS_RUNNER,
"TRAIT_PANICKED_ATTACKER" = TRAIT_PANICKED_ATTACKER,
"TRAIT_EXPLOSIVE_CRAFTING" = TRAIT_EXPLOSIVE_CRAFTING,
"TRAIT_ADVANCED_EXPLOSIVE_CRAFTING" = TRAIT_ADVANCED_EXPLOSIVE_CRAFTING,
"TRAIT_HEAL_TONGUE" = TRAIT_HEAL_TONGUE,
"TRAIT_HEAL_TOUCH" = TRAIT_HEAL_TOUCH,
"TRAIT_HEAL_TEND" = TRAIT_HEAL_TEND,
"TRAIT_IMPROVED_HEALING" = TRAIT_IMPROVED_HEALING,
"TRAIT_ARTIFACT_IDENTIFY" = TRAIT_ARTIFACT_IDENTIFY,
),
/obj/item/bodypart = list(
"TRAIT_PARALYSIS" = TRAIT_PARALYSIS
),
/obj/item = list(
"TRAIT_NODROP" = TRAIT_NODROP,
"TRAIT_PENANCE" = TRAIT_PENANCE,
"TRAIT_PENANCE_COMPLETE" = TRAIT_PENANCE_COMPLETE,
"TRAIT_NO_TELEPORT" = TRAIT_NO_TELEPORT,
"TRAIT_NO_STORAGE_INSERT" = TRAIT_NO_STORAGE_INSERT,
"TRAIT_NO_STORAGE_REMOVE" = TRAIT_NO_STORAGE_REMOVE
"TRAIT_NO_STORAGE_REMOVE" = TRAIT_NO_STORAGE_REMOVE,
"TRAIT_ARTIFACT_BLOCKER" = TRAIT_ARTIFACT_BLOCKER,
)
))

Expand Down
Loading
Loading