mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-06-05 22:31:04 +01:00
acb96fee1d
## About The Pull Request So, a huge issue with memories and - what I personally believe is the reason why not many have been added since their inception is - they're very annoying to add! Normally, adding subtypes of stuff like traumas or hallucinations are as easy as doing just that, adding a subtype. But memories used this factory argument passing method combined with holding all their strings in a JSON file which made it just frustrating to add, debug, or just mess with. It also made it much harder to organize new memories keep it clean for stuff like downstreams. So I refactored it. Memories are now handled on a subtype by subtype basis, instead of all memories being a `/datum/memory`. Any variety of arguments can be passed into memories like addcomponent (KWARGS) so each subtype can have their own `new` parameters. This makes it much much easier to add a new memory. All you need to do is make your subtype and add it somewhere. Don't need to mess with jsons or defines or anything. To demonstrate this, I added a few memories. Some existing memories had their story values tweak to compensate. ## Why It's Good For The Game Makes it way simpler to add new memories. Maybe we'll get some more fun ones now? ## Changelog 🆑 Melbert add: Roundstart captains will now memorize the code to the spare ID safe. add: Traitors will now memorize the location and code to their uplink. add: Heads of staff winning a revolution will now get a memory of their success. add: Heads of staff and head revolutionaries who lose their respective sides of the revolution also get a memory of their failure. add: Completing a ritual of knowledge as a heretic grants you a quality memory. add: Successfully defusing a bomb now grants you a cool memory. Failing it will also grant you a memory, though you will likely not be alive to see it. add: Planting bombs now increase their memory quality depending on how cool the bomb is. refactor: Memories have been refactored to be much easier to add. /🆑
136 lines
3.2 KiB
Plaintext
136 lines
3.2 KiB
Plaintext
/mob/living/basic/pet
|
|
icon = 'icons/mob/simple/pets.dmi'
|
|
mob_size = MOB_SIZE_SMALL
|
|
mob_biotypes = MOB_ORGANIC|MOB_BEAST
|
|
blood_volume = BLOOD_VOLUME_NORMAL
|
|
|
|
/// if the mob is protected from being renamed by collars.
|
|
var/unique_pet = FALSE
|
|
/// If the mob has collar sprites, this is the base of the icon states.
|
|
var/collar_icon_state = null
|
|
/// We have a seperate _rest collar icon state when the pet is resting.
|
|
var/has_collar_resting_icon_state = FALSE
|
|
|
|
/// Our collar
|
|
var/obj/item/clothing/neck/petcollar/collar
|
|
|
|
/mob/living/basic/pet/Initialize(mapload)
|
|
. = ..()
|
|
|
|
/// Can set the collar var beforehand to start the pet with a collar.
|
|
if(collar)
|
|
collar = new(src)
|
|
|
|
update_icon(UPDATE_OVERLAYS)
|
|
|
|
/mob/living/basic/pet/Destroy()
|
|
. = ..()
|
|
|
|
QDEL_NULL(collar)
|
|
|
|
/mob/living/basic/pet/attackby(obj/item/thing, mob/user, params)
|
|
if(istype(thing, /obj/item/clothing/neck/petcollar) && !collar)
|
|
add_collar(thing, user)
|
|
return TRUE
|
|
|
|
if(istype(thing, /obj/item/newspaper) && !stat)
|
|
user.visible_message(span_notice("[user] baps [name] on the nose with the rolled up [thing]."))
|
|
dance_rotate(src)
|
|
return TRUE
|
|
|
|
return ..()
|
|
|
|
/mob/living/basic/pet/update_overlays()
|
|
. = ..()
|
|
|
|
if(!collar || !collar_icon_state)
|
|
return
|
|
|
|
// Determine which status tag to add to the middle of the icon state.
|
|
var/dead_tag = stat == DEAD ? "_dead" : null
|
|
var/rest_tag = has_collar_resting_icon_state && resting ? "_rest" : null
|
|
var/stat_tag = dead_tag || rest_tag || ""
|
|
|
|
. += mutable_appearance(icon, "[collar_icon_state][stat_tag]collar")
|
|
. += mutable_appearance(icon, "[collar_icon_state][stat_tag]tag")
|
|
|
|
/mob/living/basic/pet/gib()
|
|
. = ..()
|
|
|
|
remove_collar(drop_location(), update_visuals = FALSE)
|
|
|
|
/mob/living/basic/pet/revive(full_heal_flags = NONE, excess_healing = 0, force_grab_ghost = FALSE)
|
|
. = ..()
|
|
if(!.)
|
|
return
|
|
|
|
update_icon(UPDATE_OVERLAYS)
|
|
|
|
/mob/living/basic/pet/death(gibbed)
|
|
. = ..()
|
|
add_memory_in_range(src, 7, /datum/memory/pet_died, deuteragonist = src) //Protagonist is the person memorizing it
|
|
|
|
/mob/living/basic/pet/handle_atom_del(atom/deleting_atom)
|
|
. = ..()
|
|
|
|
if(deleting_atom != collar)
|
|
return
|
|
|
|
collar = null
|
|
|
|
if(QDELETED(src))
|
|
return
|
|
|
|
update_icon(UPDATE_OVERLAYS)
|
|
|
|
/mob/living/basic/pet/update_stat()
|
|
. = ..()
|
|
|
|
update_icon(UPDATE_OVERLAYS)
|
|
|
|
/mob/living/basic/pet/set_resting(new_resting, silent, instant)
|
|
. = ..()
|
|
|
|
if(!has_collar_resting_icon_state)
|
|
return
|
|
|
|
update_icon(UPDATE_OVERLAYS)
|
|
|
|
/**
|
|
* Add a collar to the pet.
|
|
*
|
|
* Arguments:
|
|
* * new_collar - the collar.
|
|
* * user - the user that did it.
|
|
*/
|
|
/mob/living/basic/pet/proc/add_collar(obj/item/clothing/neck/petcollar/new_collar, mob/user)
|
|
if(QDELETED(new_collar) || collar)
|
|
return
|
|
if(!user.transferItemToLoc(new_collar, src))
|
|
return
|
|
|
|
collar = new_collar
|
|
if(collar_icon_state)
|
|
update_icon(UPDATE_OVERLAYS)
|
|
|
|
to_chat(user, span_notice("You put [new_collar] around [src]'s neck."))
|
|
if(new_collar.tagname && !unique_pet)
|
|
fully_replace_character_name(null, "\proper [new_collar.tagname]")
|
|
|
|
/**
|
|
* Remove the collar from the pet.
|
|
*/
|
|
/mob/living/basic/pet/proc/remove_collar(atom/new_loc, update_visuals = TRUE)
|
|
if(!collar)
|
|
return
|
|
|
|
var/obj/old_collar = collar
|
|
|
|
collar.forceMove(new_loc)
|
|
collar = null
|
|
|
|
if(collar_icon_state && update_visuals)
|
|
update_icon(UPDATE_OVERLAYS)
|
|
|
|
return old_collar
|