From 28f7a5890509671d8ba344ac1a2d20b8af9296fa Mon Sep 17 00:00:00 2001 From: Erthilo Date: Sun, 6 May 2012 21:01:19 +0100 Subject: [PATCH] TG: - Added a rudimentary transformation section to the options panel (show player panel verb). This allows rudimentary mob type changes to any mob. These are however generic and non-mob-specific, as they only copy over some of the most needed variables, such as the three name variables, dna and mind. They do not, for instance, create a MMI for cyborgs. A note of this is also added to the player panel. - Once you click one of the links a popup will appear asking you whether you'd like to delete the old mob of the player (yes or no) or cancel this transformation. Screenshot: http://www.kamletos.si/options%20panel%20rudamentary%20transformation.PNG Revision: r3534 Author: baloh.matevz --- baystation12.dme | 1 + code/defines/area/Space Station 13 areas.dm | 3 + code/modules/admin/admin.dm | 95 +++++++++++++++++++ code/modules/mob/living/carbon/alien/alien.dm | 3 +- code/modules/mob/mob_transformation_simple.dm | 53 +++++++++++ 5 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 code/modules/mob/mob_transformation_simple.dm diff --git a/baystation12.dme b/baystation12.dme index 62d42285ac..978db2d5c0 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -894,6 +894,7 @@ #include "code\modules\mob\mob_grab.dm" #include "code\modules\mob\mob_helpers.dm" #include "code\modules\mob\mob_movement.dm" +#include "code\modules\mob\mob_transformation_simple.dm" #include "code\modules\mob\say.dm" #include "code\modules\mob\screen.dm" #include "code\modules\mob\transform_procs.dm" diff --git a/code/defines/area/Space Station 13 areas.dm b/code/defines/area/Space Station 13 areas.dm index 030f77aee5..b520e2a216 100755 --- a/code/defines/area/Space Station 13 areas.dm +++ b/code/defines/area/Space Station 13 areas.dm @@ -144,12 +144,15 @@ proc/process_ghost_teleport_locs() music = "music/escape.ogg" /area/shuttle/escape/station + name = "Emergency Shuttle Station" icon_state = "shuttle2" /area/shuttle/escape/centcom + name = "Emergency Shuttle Centcom" icon_state = "shuttle" /area/shuttle/escape/transit // the area to pass through for 3 minute transit + name = "Emergency Shuttle Transit" icon_state = "shuttle" /area/shuttle/escape_pod1 diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 34da1f2daa..554df8637d 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -65,6 +65,76 @@ var/global/BSACooldown = 0 alert("You cannot perform this action. You must be of a higher administrative rank!") return + if(href_list["simplemake"]) + + if(!href_list["mob"]) + usr << "Invalid mob" + return + + var/mob/M = locate(href_list["mob"]) + + if(!M || !ismob(M)) + usr << "Cannot find mob" + return + + var/delmob = 0 + var/option = alert("Delete old mob?","Message","Yes","No","Cancel") + if(option == "Cancel") + return + if(option == "Yes") + delmob = 1 + + log_admin("[key_name(usr)] has used rudimentary transformation on [key_name(M)]. Transforming to [href_list["simplemake"]]; deletemob=[delmob]") + message_admins("\blue [key_name_admin(usr)] has used rudimentary transformation on [key_name_admin(M)]. Transforming to [href_list["simplemake"]]; deletemob=[delmob]", 1) + + switch(href_list["simplemake"]) + if("observer") + M.change_mob_type( /mob/dead/observer , null, null, delmob) + if("drone") + M.change_mob_type( /mob/living/carbon/alien/humanoid/drone , null, null, delmob) + if("hunter") + M.change_mob_type( /mob/living/carbon/alien/humanoid/hunter , null, null, delmob) + if("queen") + M.change_mob_type( /mob/living/carbon/alien/humanoid/queen , null, null, delmob) + if("sentinel") + M.change_mob_type( /mob/living/carbon/alien/humanoid/sentinel , null, null, delmob) + if("larva") + M.change_mob_type( /mob/living/carbon/alien/larva , null, null, delmob) + if("human") + M.change_mob_type( /mob/living/carbon/human , null, null, delmob) + if("metroid") + M.change_mob_type( /mob/living/carbon/metroid , null, null, delmob) + if("adultmetroid") + M.change_mob_type( /mob/living/carbon/metroid/adult , null, null, delmob) + if("monkey") + M.change_mob_type( /mob/living/carbon/monkey , null, null, delmob) + if("robot") + M.change_mob_type( /mob/living/silicon/robot , null, null, delmob) + if("cat") + M.change_mob_type( /mob/living/simple_animal/cat , null, null, delmob) + if("runtime") + M.change_mob_type( /mob/living/simple_animal/cat/Runtime , null, null, delmob) + if("corgi") + M.change_mob_type( /mob/living/simple_animal/corgi , null, null, delmob) + if("ian") + M.change_mob_type( /mob/living/simple_animal/corgi/Ian , null, null, delmob) + if("crab") + M.change_mob_type( /mob/living/simple_animal/crab , null, null, delmob) + if("coffee") + M.change_mob_type( /mob/living/simple_animal/crab/Coffee , null, null, delmob) + if("parrot") + M.change_mob_type( /mob/living/simple_animal/parrot , null, null, delmob) + if("drprofessor") + M.change_mob_type( /mob/living/simple_animal/parrot/DrProfessor , null, null, delmob) + if("constructarmoured") + M.change_mob_type( /mob/living/simple_animal/constructarmoured , null, null, delmob) + if("constructbuilder") + M.change_mob_type( /mob/living/simple_animal/constructbuilder , null, null, delmob) + if("constructwraith") + M.change_mob_type( /mob/living/simple_animal/constructwraith , null, null, delmob) + if("shade") + M.change_mob_type( /mob/living/simple_animal/shade , null, null, delmob) + if(href_list["view_player_info"]) show_player_info(href_list["view_player_info"]) @@ -885,6 +955,11 @@ var/global/BSACooldown = 0 if (href_list["sendtoprison"]) if ((src.rank in list( "Moderator", "Admin Candidate", "Temporary Admin", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) + + var/confirm = alert(usr, "Send to admin prison for the round?", "Message", "Yes", "No") + if(confirm != "Yes") + return + var/mob/M = locate(href_list["sendtoprison"]) if (ismob(M)) if(istype(M, /mob/living/silicon/ai)) @@ -954,6 +1029,11 @@ var/global/BSACooldown = 0 if (href_list["tdome1"]) if ((src.rank in list( "Admin Candidate", "Temporary Admin", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) + + var/confirm = alert(usr, "Confirm?", "Message", "Yes", "No") + if(confirm != "Yes") + return + var/mob/M = locate(href_list["tdome1"]) if (ismob(M)) if(istype(M, /mob/living/silicon/ai)) @@ -980,6 +1060,11 @@ var/global/BSACooldown = 0 if (href_list["tdome2"]) if ((src.rank in list( "Admin Candidate", "Temporary Admin", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) + + var/confirm = alert(usr, "Confirm?", "Message", "Yes", "No") + if(confirm != "Yes") + return + var/mob/M = locate(href_list["tdome2"]) if (ismob(M)) if(istype(M, /mob/living/silicon/ai)) @@ -1006,6 +1091,11 @@ var/global/BSACooldown = 0 if (href_list["tdomeadmin"]) if ((src.rank in list( "Admin Candidate", "Temporary Admin", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) + + var/confirm = alert(usr, "Confirm?", "Message", "Yes", "No") + if(confirm != "Yes") + return + var/mob/M = locate(href_list["tdomeadmin"]) if (ismob(M)) if(istype(M, /mob/living/silicon/ai)) @@ -1340,6 +1430,11 @@ var/global/BSACooldown = 0 if (href_list["getmob"]) if(rank in list( "Trial Admin", "Badmin", "Game Admin", "Game Master")) + + var/confirm = alert(usr, "Confirm?", "Message", "Yes", "No") + if(confirm != "Yes") + return + var/mob/M = locate(href_list["getmob"]) usr.client.Getmob(M) else diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 0098c849c0..6fc34c1c87 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -15,7 +15,8 @@ if(facehugger.stat == CONSCIOUS) var/image/activeIndicator = image('alien.dmi', loc = facehugger, icon_state = "facehugger_active") activeIndicator.override = 1 - client.images += activeIndicator + if(client) + client.images += activeIndicator /mob/living/carbon/alien/IsAdvancedToolUser() return has_fine_manipulation \ No newline at end of file diff --git a/code/modules/mob/mob_transformation_simple.dm b/code/modules/mob/mob_transformation_simple.dm new file mode 100644 index 0000000000..1a68430242 --- /dev/null +++ b/code/modules/mob/mob_transformation_simple.dm @@ -0,0 +1,53 @@ + +//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(var/new_type = null, var/turf/location = null, var/new_name = null as text, var/delete_old_mob = 0 as num) + + if(istype(src,/mob/new_player)) + usr << "\red 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) ) + usr << "Invalid type path (new_type = [new_type]) in change_mob_type(). Contact a coder." + return + + if( new_type == /mob/new_player ) + usr << "\red cannot convert into a new_player mob type." + return + + var/mob/M = null + if( !isnull(location) && isturf(location)) + M = new new_type( location ) + else + M = new new_type( src.loc ) + + if(!M || !ismob(M)) + usr << "Type path is not a mob (new_type = [new_type]) in change_mob_type(). Contact a coder." + return + + if( istext(new_name) ) + M.name = new_name + M.original_name = new_name + M.real_name = new_name + else + M.name = src.name + M.original_name = src.original_name + M.real_name = src.real_name + + M.dna = src.dna + + M.ckey = src.ckey + if(mind) + mind.transfer_to(M) + + if(delete_old_mob) + spawn(1) + del(src) + return M