Files
Bubberstation/code/modules/mob/mob_transformation_simple.dm
SkyratBot 3b23a57eeb [MIRROR] Cleans up unnecessary transformation options in admin player panel [MDB IGNORE] (#9826)
* Cleans up unnecessary transformation options in admin player panel (#62832)

I got tired of having to walk new admin candidates through the admin buttons and telling them about all of the antiquated buttons they'd never use, so I'm doing my part and removing a bunch of the transformation bloat from the player panel. Below is the current menu
The only button admins I know ever actually use is the human rudimentary transformation one, and literally nothing else. Judging by how the options are a random choice of some of the station pets, these options probably haven't been updated since like 2012. In addition, the non-rudimentary transformations only work if you're a human, so not sure why they show up for non human player panels.
Here's the new pared down selection, I figured these would be the only useful ones from the bunch. They work no matter what mob the target was previously, whether it be another living mob or a ghost. In addition, I also cut out the transformation equivalents from the VV dropdown, because lord knows that menu keeps getting longer and longer. Lastly, I refactored stuff where possible without getting too trapped in cursed pre-MSO era admincode.

* Cleans up unnecessary transformation options in admin player panel

Co-authored-by: Ryll Ryll <3589655+Ryll-Ryll@users.noreply.github.com>
2021-12-02 22:23:20 +00:00

61 lines
1.6 KiB
Plaintext

//This proc is the most basic of the procs. All it does is make a new mob on the same tile and transfer over a few variables.
//Returns the new mob
//Note that this proc does NOT do MMI related stuff!
/mob/proc/change_mob_type(new_type = null, turf/location = null, new_name = null as text, delete_old_mob = FALSE)
if(isnewplayer(src))
to_chat(usr, span_danger("Cannot convert players who have not entered yet."))
return
if(!new_type)
new_type = input("Mob type path:", "Mob type") as text|null
if(istext(new_type))
new_type = text2path(new_type)
if( !ispath(new_type) )
to_chat(usr, "Invalid type path (new_type = [new_type]) in change_mob_type(). Contact a coder.")
return
if(ispath(new_type, /mob/dead/new_player))
to_chat(usr, span_danger("Cannot convert into a new_player mob type."))
return
var/mob/M
if(isturf(location))
M = new new_type( location )
else
M = new new_type( src.loc )
if(!M || !ismob(M))
to_chat(usr, "Type path is not a mob (new_type = [new_type]) in change_mob_type(). Contact a coder.")
qdel(M)
return
if( istext(new_name) )
M.name = new_name
M.real_name = new_name
else
M.name = src.name
M.real_name = src.real_name
if(has_dna() && M.has_dna())
var/mob/living/carbon/C = src
var/mob/living/carbon/D = M
C.dna.transfer_identity(D)
D.updateappearance(mutcolor_update=1, mutations_overlay_update=1)
else if(ishuman(M))
var/mob/living/carbon/human/H = M
client?.prefs.safe_transfer_prefs_to(H)
H.dna.update_dna_identity()
if(mind && isliving(M))
mind.transfer_to(M, 1) // second argument to force key move to new mob
else
M.key = key
if(delete_old_mob)
QDEL_IN(src, 1)
return M