[MIRROR] [READY] Highlander mode now includes silicons (#1122)

* Merge pull request #53702 from zxaber/kiltborg

[READY] Highlander mode now includes silicons

* [READY] Highlander mode now includes silicons

Co-authored-by: nemvar <47324920+nemvar@users.noreply.github.com>
This commit is contained in:
SkyratBot
2020-10-02 19:10:58 +02:00
committed by GitHub
co-authored by nemvar
parent ed931dabff
commit ec5324bc1a
13 changed files with 148 additions and 20 deletions
@@ -51,6 +51,10 @@
* * module_num - the slot number being equipped to.
*/
/mob/living/silicon/robot/proc/equip_module_to_slot(obj/item/item_module, module_num)
var/storage_was_closed = FALSE //Just to be consistant and all
if(!shown_robot_modules) //Tools may be invisible if the collection is hidden
hud_used.toggle_show_robot_modules()
storage_was_closed = TRUE
switch(module_num)
if(1)
item_module.screen_loc = inv1.screen_loc
@@ -72,6 +76,9 @@
update_sight()
observer_screen_update(item_module, TRUE)
if(storage_was_closed)
hud_used.toggle_show_robot_modules()
return TRUE
/**
@@ -73,7 +73,7 @@
var/lawupdate = 1 //Cyborgs will sync their laws with their AI by default
var/scrambledcodes = FALSE // Used to determine if a borg shows up on the robotics console. Setting to TRUE hides them.
var/lockcharge //Boolean of whether the borg is locked down or not
var/lockcharge = FALSE //Boolean of whether the borg is locked down or not
var/toner = 0
var/tonermax = 40
@@ -729,6 +729,8 @@
/mob/living/silicon/robot/updatehealth()
..()
if(!module.breakable_modules)
return
/// the current percent health of the robot (-1 to 1)
var/percent_hp = health/maxHealth
@@ -100,6 +100,9 @@ GLOBAL_LIST_INIT(blacklisted_borg_hats, typecacheof(list( //Hats that don't real
return
if(W.slot_flags & ITEM_SLOT_HEAD && hat_offset != INFINITY && user.a_intent == INTENT_HELP && !is_type_in_typecache(W, GLOB.blacklisted_borg_hats))
if(HAS_TRAIT(hat, TRAIT_NODROP))
to_chat(user, "<span class='warn'>You can't seem to remove [src]'s existing headwear!</span>")
return
to_chat(user, "<span class='notice'>You begin to place [W] on [src]'s head...</span>")
to_chat(src, "<span class='notice'>[user] is placing [W] on your head...</span>")
if(do_after(user, 30, target = src))
@@ -7,6 +7,8 @@
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
flags_1 = CONDUCT_1
///Host of this module
var/mob/living/silicon/robot/robot
var/list/basic_modules = list() //a list of paths, converted to a list of instances on New()
var/list/emag_modules = list() //ditto
@@ -24,6 +26,8 @@
var/can_be_pushed = TRUE
var/magpulsing = FALSE
var/clean_on_move = FALSE
var/breakable_modules = TRUE //Whether the borg loses tool slots with damage.
var/locked_transform = TRUE //Whether swapping to this module should lockcharge the borg
var/did_feedback = FALSE
@@ -183,6 +187,7 @@
/obj/item/robot_module/proc/transform_to(new_module_type)
var/mob/living/silicon/robot/R = loc
var/obj/item/robot_module/RM = new new_module_type(R)
RM.robot = R
if(!RM.be_transformed_to(src))
qdel(RM)
return
@@ -221,15 +226,15 @@
sleep(1)
flick("[cyborg_base_icon]_transform", R)
R.notransform = TRUE
R.SetLockdown(1)
R.set_anchored(TRUE)
if(locked_transform)
R.SetLockdown(TRUE)
R.set_anchored(TRUE)
R.logevent("Chassis configuration has been set to [name].")
sleep(1)
for(var/i in 1 to 4)
playsound(R, pick('sound/items/drill_use.ogg', 'sound/items/jaws_cut.ogg', 'sound/items/jaws_pry.ogg', 'sound/items/welder.ogg', 'sound/items/ratchet.ogg'), 80, TRUE, -1)
sleep(7)
if(!prev_lockcharge)
R.SetLockdown(0)
R.SetLockdown(prev_lockcharge)
R.setDir(SOUTH)
R.set_anchored(FALSE)
R.notransform = FALSE
@@ -647,6 +652,34 @@
hat_offset = -4
canDispose = TRUE
/obj/item/robot_module/syndicate/kiltborg
name = "Highlander"
basic_modules = list(
/obj/item/claymore/highlander/robot,
/obj/item/pinpointer/nuke,)
moduleselect_icon = "kilt"
cyborg_base_icon = "kilt"
hat_offset = -2
breakable_modules = FALSE
locked_transform = FALSE //GO GO QUICKLY AND SLAUGHTER THEM ALL
/obj/item/robot_module/syndicate/kiltborg/be_transformed_to(obj/item/robot_module/old_module)
. = ..()
qdel(robot.radio)
robot.radio = new /obj/item/radio/borg/syndicate(robot)
robot.scrambledcodes = TRUE
robot.maxHealth = 50 //DIE IN THREE HITS, LIKE A REAL SCOT
robot.break_cyborg_slot(3) //YOU ONLY HAVE TWO ITEMS ANYWAY
var/obj/item/pinpointer/nuke/diskyfinder = locate(/obj/item/pinpointer/nuke) in basic_modules
diskyfinder.attack_self(robot)
/obj/item/robot_module/syndicate/kiltborg/do_transform_delay() //AUTO-EQUIPPING THESE TOOLS ANY EARLIER CAUSES RUNTIMES OH YEAH
. = ..()
robot.equip_module_to_slot(locate(/obj/item/claymore/highlander/robot) in basic_modules, 1)
robot.equip_module_to_slot(locate(/obj/item/pinpointer/nuke) in basic_modules, 2)
robot.place_on_head(new /obj/item/clothing/head/beret/highlander(robot)) //THE ONLY PART MORE IMPORTANT THAN THE SWORD IS THE HAT
ADD_TRAIT(robot.hat, TRAIT_NODROP, HIGHLANDER)
/datum/robot_energy_storage
var/name = "Generic energy storage"
var/max_energy = 30000