Files
Bubberstation/code/datums/components/fantasy/suffixes.dm
nevimer 424ed3d160 Revert "Revert "Merge upstream""
This reverts commit e6bb4098c4.

# Conflicts:
#	_maps/RandomRuins/LavaRuins/skyrat/lavaland_surface_syndicate_base1_skyrat.dmm
#	_maps/RandomRuins/SpaceRuins/bus.dmm
#	_maps/RandomZLevels/blackmesa.dmm
#	_maps/map_files/generic/CentCom_skyrat_z2.dmm
#	_maps/shuttles/skyrat/goldeneye_cruiser.dmm
#	_maps/templates/lazy_templates/wizard_den.dmm
#	code/__DEFINES/callbacks.dm
#	code/datums/components/transforming.dm
#	code/datums/elements/bane.dm
#	code/datums/votes/map_vote.dm
#	code/game/objects/items/AI_modules/hacked.dm
#	code/game/objects/items/food/egg.dm
#	code/game/objects/items/stacks/sheets/glass.dm
#	code/modules/antagonists/fugitive/hunters/hunter.dm
#	code/modules/antagonists/traitor/objectives/final_objective/final_objective.dm
#	code/modules/antagonists/traitor/objectives/kidnapping.dm
#	code/modules/art/statues.dm
#	code/modules/events/ghost_role/changeling_event.dm
#	code/modules/events/spacevine.dm
#	code/modules/mining/machine_redemption.dm
#	code/modules/mob/living/simple_animal/friendly/farm_animals.dm
#	code/modules/mob_spawn/mob_spawn.dm
#	code/modules/projectiles/guns/ballistic/pistol.dm
#	code/modules/projectiles/guns/ballistic/rifle.dm
#	code/modules/uplink/uplink_items.dm
#	code/modules/vending/autodrobe.dm
#	html/changelogs/archive/2023-03.yml
#	icons/mob/clothing/feet.dmi
#	icons/mob/clothing/under/costume.dmi
#	icons/mob/inhands/clothing/shoes_lefthand.dmi
#	icons/mob/inhands/clothing/shoes_righthand.dmi
#	icons/mob/inhands/clothing/suits_lefthand.dmi
#	icons/mob/inhands/clothing/suits_righthand.dmi
#	icons/mob/species/human/human_face.dmi
#	icons/obj/clothing/shoes.dmi
#	icons/obj/clothing/under/costume.dmi
#	modular_skyrat/master_files/code/datums/components/fullauto.dm
#	modular_skyrat/master_files/code/modules/clothing/under/jobs/security.dm
#	modular_skyrat/master_files/code/modules/projectiles/guns/gun.dm
#	modular_skyrat/master_files/icons/mob/clothing/under/civilian.dmi
#	modular_skyrat/master_files/icons/mob/clothing/under/civilian_digi.dmi
#	modular_skyrat/modules/aesthetics/guns/code/guns.dm
#	modular_skyrat/modules/aesthetics/guns/icons/guns.dmi
#	modular_skyrat/modules/blueshield/code/blueshield.dm
#	modular_skyrat/modules/customization/modules/clothing/under/misc.dm
#	modular_skyrat/modules/ghostcafe/code/ghost_role_spawners.dm
#	modular_skyrat/modules/gunsgalore/icons/guns/gunsgalore_guns40x32.dmi
#	modular_skyrat/modules/manufacturer_examine/code/gun_company_additions.dm
#	modular_skyrat/modules/manufacturer_examine/code/manufacturer_component.dm
#	modular_skyrat/modules/mapping/code/mob_spawns.dm
#	modular_skyrat/modules/modular_weapons/code/rifle.dm
#	modular_skyrat/modules/novaya_ert/code/automatic.dm
#	modular_skyrat/modules/sec_haul/code/guns/guns.dm
#	modular_skyrat/modules/tribal_extended/code/weapons/bow.dm
#	tgstation.dme
#	tgui/packages/tgui/interfaces/OreRedemptionMachine.js
#	tgui/packages/tgui/interfaces/VotePanel.tsx
2023-05-20 22:06:42 -04:00

211 lines
7.2 KiB
Plaintext

/datum/fantasy_affix/cosmetic_suffixes
name = "purely cosmetic suffix"
placement = AFFIX_SUFFIX
alignment = AFFIX_GOOD | AFFIX_EVIL
var/list/goodSuffixes
var/list/badSuffixes
/datum/fantasy_affix/cosmetic_suffixes/New()
goodSuffixes = list(
"dexterity",
"constitution",
"intelligence",
"wisdom",
"charisma",
"the forest",
"the hills",
"the plains",
"the sea",
"the sun",
"the moon",
"the void",
"the world",
"many secrets",
"many tales",
"many colors",
"rending",
"sundering",
"the night",
"the day",
)
badSuffixes = list(
"draining",
"burden",
"discomfort",
"awkwardness",
"poor hygiene",
"timidity",
)
weight = (length(goodSuffixes) + length(badSuffixes)) * 10
/datum/fantasy_affix/cosmetic_suffixes/apply(datum/component/fantasy/comp, newName)
if(comp.quality > 0 || (comp.quality == 0 && prob(50)))
return "[newName] of [pick(goodSuffixes)]"
else
return "[newName] of [pick(badSuffixes)]"
//////////// Good suffixes
/datum/fantasy_affix/bane
name = "of <mobtype> slaying (random species, carbon or simple animal)"
placement = AFFIX_SUFFIX
alignment = AFFIX_GOOD
var/list/target_types_by_comp = list()
/datum/fantasy_affix/bane/apply(datum/component/fantasy/comp, newName)
. = ..()
// This is set up to be easy to add to these lists as I expect it will need modifications
var/static/list/possible_mobtypes
if(!possible_mobtypes)
// The base list of allowed mob/species types
possible_mobtypes = zebra_typecacheof(list(
/mob/living/simple_animal = TRUE,
/mob/living/carbon = TRUE,
/datum/species = TRUE,
// Some types to remove them and their subtypes
/mob/living/carbon/human/species = FALSE,
))
// Some particular types to disallow if they're too broad/abstract
// Not in the above typecache generator because it includes subtypes and this doesn't.
possible_mobtypes -= list(
/mob/living/simple_animal/hostile,
)
var/mob/picked_mobtype = pick(possible_mobtypes)
// This works even with the species picks since we're only accessing the name
var/obj/item/master = comp.parent
master.AddElement(/datum/element/bane, target_type = picked_mobtype)
target_types_by_comp[comp] = picked_mobtype
return "[newName] of [initial(picked_mobtype.name)] slaying"
/datum/fantasy_affix/bane/remove(datum/component/fantasy/comp)
var/picked_mobtype = target_types_by_comp[comp]
var/obj/item/master = comp.parent
master.RemoveElement(/datum/element/bane, picked_mobtype)
target_types_by_comp -= comp
/datum/fantasy_affix/summoning
name = "of <mobtype> summoning (dangerous, can pick all but megafauna tier stuff)"
placement = AFFIX_SUFFIX
alignment = AFFIX_GOOD
weight = 5
/datum/fantasy_affix/summoning/apply(datum/component/fantasy/comp, newName)
. = ..()
// This is set up to be easy to add to these lists as I expect it will need modifications
var/static/list/possible_mobtypes
if(!possible_mobtypes)
// The base list of allowed mob/species types
possible_mobtypes = zebra_typecacheof(list(
/mob/living/simple_animal = TRUE,
/mob/living/carbon = TRUE,
/datum/species = TRUE,
// Some types to remove them and their subtypes
/mob/living/carbon/human/species = FALSE,
/mob/living/simple_animal/hostile/asteroid/elite = FALSE,
/mob/living/simple_animal/hostile/megafauna = FALSE,
))
// Some particular types to disallow if they're too broad/abstract
// Not in the above typecache generator because it includes subtypes and this doesn't.
possible_mobtypes -= list(
/mob/living/simple_animal/hostile,
)
var/mob/picked_mobtype = pick(possible_mobtypes)
// This works even with the species picks since we're only accessing the name
var/obj/item/master = comp.parent
var/max_mobs = max(CEILING(comp.quality/2, 1), 1)
var/spawn_delay = 300 - 30 * comp.quality
comp.appliedComponents += master.AddComponent(/datum/component/summoning, list(picked_mobtype), 100, max_mobs, spawn_delay)
return "[newName] of [initial(picked_mobtype.name)] summoning"
/datum/fantasy_affix/shrapnel
name = "shrapnel"
placement = AFFIX_SUFFIX
alignment = AFFIX_GOOD
/datum/fantasy_affix/shrapnel/validate(obj/item/attached)
if(isgun(attached))
return TRUE
return FALSE
/datum/fantasy_affix/shrapnel/apply(datum/component/fantasy/comp, newName)
. = ..()
// higher means more likely
var/list/weighted_projectile_types = list(/obj/projectile/meteor = 1,
/obj/projectile/energy/nuclear_particle = 1,
/obj/projectile/beam/pulse = 1,
/obj/projectile/bullet/honker = 15,
/obj/projectile/temp = 15,
/obj/projectile/ion = 15,
/obj/projectile/magic/door = 15,
/obj/projectile/magic/locker = 15,
/obj/projectile/magic/fetch = 15,
/obj/projectile/beam/emitter = 15,
/obj/projectile/magic/flying = 15,
/obj/projectile/energy/net = 15,
/obj/projectile/bullet/incendiary/c9mm = 15,
/obj/projectile/temp/hot = 15,
/obj/projectile/beam/disabler = 15)
var/obj/projectile/picked_projectiletype = pick_weight(weighted_projectile_types)
var/obj/item/master = comp.parent
comp.appliedComponents += master.AddComponent(/datum/component/mirv, picked_projectiletype)
return "[newName] of [initial(picked_projectiletype.name)] shrapnel"
/datum/fantasy_affix/strength
name = "of strength (knockback)"
placement = AFFIX_SUFFIX
alignment = AFFIX_GOOD
/datum/fantasy_affix/strength/apply(datum/component/fantasy/comp, newName)
. = ..()
var/obj/item/master = comp.parent
master.AddElement(/datum/element/knockback, CEILING(comp.quality/2, 1), FLOOR(comp.quality/10, 1))
return "[newName] of strength"
/datum/fantasy_affix/strength/remove(datum/component/fantasy/comp)
var/obj/item/master = comp.parent
master.RemoveElement(/datum/element/knockback, CEILING(comp.quality/2, 1), FLOOR(comp.quality/10, 1))
//////////// Bad suffixes
/datum/fantasy_affix/fool
name = "of the fool (honking)"
placement = AFFIX_SUFFIX
alignment = AFFIX_EVIL
/datum/fantasy_affix/fool/apply(datum/component/fantasy/comp, newName)
. = ..()
var/obj/item/master = comp.parent
comp.appliedComponents += master.AddComponent(/datum/component/squeak, list('sound/items/bikehorn.ogg' = 1), 50, falloff_exponent = 20)
return "[newName] of the fool"
/datum/fantasy_affix/curse_of_hunger
name = "curse of hunger"
placement = AFFIX_SUFFIX
alignment = AFFIX_EVIL
/datum/fantasy_affix/curse_of_hunger/validate(obj/item/attached)
//curse of hunger that attaches onto food has the ability to eat itself. it's hilarious.
if(!IS_EDIBLE(attached))
return TRUE
return TRUE
/datum/fantasy_affix/curse_of_hunger/apply(datum/component/fantasy/comp, newName)
. = ..()
var/obj/item/master = comp.parent
var/filter_color = "#8a0c0ca1" //clarified args
var/new_name = pick(", eternally hungry", " of the glutton", " cursed with hunger", ", consumer of all", " of the feast")
master.AddElement(/datum/element/curse_announcement, "[master] is cursed with the curse of hunger!", filter_color, new_name, comp)
comp.appliedComponents += master.AddComponent(/datum/component/curse_of_hunger)
return newName //no spoilers!
/datum/fantasy_affix/curse_of_hunger/remove(datum/component/fantasy/comp)
var/obj/item/master = comp.parent
master.RemoveElement(/datum/element/curse_announcement) //just in case