Added hats for drones.

This commit is contained in:
Zuhayr
2015-07-06 04:36:58 +09:30
parent 0d7b2570db
commit 2f6a1f2830
6 changed files with 86 additions and 23 deletions

View File

@@ -275,6 +275,17 @@ BLIND // can't see anything
update_icon(user)
user.update_action_buttons()
/obj/item/clothing/head/attack_ai(var/mob/user)
if(Adjacent(user) && istype(user, /mob/living/silicon/robot/drone))
var/mob/living/silicon/robot/drone/D = user
if(!D.hat)
D.wear_hat(src)
D << "<span class='notice'>You crawl under \the [src].</span>"
else
D << "<span class='warning'>You are already wearing \the [D.hat].</span>"
return
return ..()
/obj/item/clothing/head/update_icon(var/mob/user)
overlays.Cut()

View File

@@ -125,7 +125,8 @@
//this handles hud updates. Calls update_vision() and handle_hud_icons()
/mob/living/handle_regular_hud_updates()
if(!client) return 0
if(!client)
return 0
..()
handle_vision()

View File

@@ -1,3 +1,5 @@
var/list/drone_hat_cache = list()
/mob/living/silicon/robot/drone
name = "drone"
real_name = "drone"
@@ -29,9 +31,26 @@
var/module_type = /obj/item/weapon/robot_module/drone
var/can_pull_size = 2
var/can_pull_mobs
var/obj/item/hat
var/hat_x_offset = 0
var/hat_y_offset = -13
holder_type = /obj/item/weapon/holder/drone
/mob/living/silicon/robot/drone/Destroy()
if(hat)
hat.loc = get_turf(src)
..()
/mob/living/silicon/robot/drone/construction
icon_state = "constructiondrone"
law_type = /datum/ai_laws/construction_drone
module_type = /obj/item/weapon/robot_module/drone/construction
can_pull_size = 5
can_pull_mobs = 1
hat_x_offset = 1
hat_y_offset = -12
/mob/living/silicon/robot/drone/New()
..()
@@ -83,16 +102,51 @@
else
overlays -= "eyes"
if(hat)
// Copied from human inventory.
// Let the drones wear hats.
var/t_state = hat.icon_state
if(hat.item_state_slots && hat.item_state_slots[slot_head_str])
t_state = hat.item_state_slots[slot_head_str]
else if(hat.item_state)
t_state = hat.item_state
if(!drone_hat_cache["[t_state]-[icon_state]"]) // Not ideal as there's no guarantee all hat icon_states
var/t_icon = INV_HEAD_DEF_ICON // are unique across multiple dmis, but whatever.
if(hat.icon_override)
t_icon = hat.icon_override
else if(hat.item_icons && (slot_head_str in hat.item_icons))
t_icon = hat.item_icons[slot_head_str]
var/image/I = image(icon = t_icon, icon_state = t_state)
I.pixel_x = hat_x_offset
I.pixel_y = hat_y_offset
drone_hat_cache[t_state] = I
overlays |= drone_hat_cache[t_state]
/mob/living/silicon/robot/drone/choose_icon()
return
/mob/living/silicon/robot/drone/pick_module()
return
//Drones cannot be upgraded with borg modules so we need to catch some items before they get used in ..().
/mob/living/silicon/robot/drone/attackby(obj/item/weapon/W as obj, mob/user as mob)
/mob/living/silicon/robot/drone/proc/wear_hat(var/obj/item/new_hat)
if(hat)
return
hat = new_hat
new_hat.loc = src
updateicon()
if(istype(W, /obj/item/borg/upgrade/))
//Drones cannot be upgraded with borg modules so we need to catch some items before they get used in ..().
/mob/living/silicon/robot/drone/attackby(var/obj/item/weapon/W, var/mob/user)
if(user.a_intent == "help" && istype(W, /obj/item/clothing/head))
if(hat)
user << "<span class='warning'>\The [src] is already wearing \the [hat].</span>"
return
user.unEquip(W)
wear_hat(W)
user.visible_message("<span class='notice'>\The [user] puts \the [W] on \the [src].</span>")
return
else if(istype(W, /obj/item/borg/upgrade/))
user << "<span class='danger'>\The [src] is not compatible with \the [W].</span>"
return
@@ -279,13 +333,6 @@
/mob/living/silicon/robot/drone/remove_robot_verbs()
src.verbs -= silicon_subsystems
/mob/living/silicon/robot/drone/construction
icon_state = "constructiondrone"
law_type = /datum/ai_laws/construction_drone
module_type = /obj/item/weapon/robot_module/drone/construction
can_pull_size = 5
can_pull_mobs = 1
/mob/living/silicon/robot/drone/construction/welcome_drone()
src << "<b>You are a construction drone, an autonomous engineering and fabrication system.</b>."
src << "You are assigned to a Sol Central construction project. The name is irrelevant. Your task is to complete construction and subsystem integration as soon as possible."

View File

@@ -10,13 +10,13 @@
mail_destination = ""
return
src << "\blue You configure your internal beacon, tagging yourself for delivery to '[new_tag]'."
src << "<span class='notice'>You configure your internal beacon, tagging yourself for delivery to '[new_tag]'.</span>"
mail_destination = new_tag
//Auto flush if we use this verb inside a disposal chute.
var/obj/machinery/disposal/D = src.loc
if(istype(D))
src << "\blue \The [D] acknowledges your signal."
src << "<span class='notice'>\The [D] acknowledges your signal.</span>"
D.flush_count = D.flush_every_ticks
return
@@ -27,5 +27,11 @@
if(H.a_intent == "help")
get_scooped(H)
return
else if(H.a_intent == "grab" && hat && !(H.l_hand && H.r_hand))
hat.loc = get_turf(src)
H.put_in_hands(hat)
H.visible_message("<span class='danger'>\The [H] removes \the [src]'s [hat].</span>")
hat = null
updateicon()
else
return ..()

View File

@@ -78,7 +78,8 @@
flick("h_lathe_leave",src)
time_last_drone = world.time
var/mob/living/silicon/robot/drone/new_drone = new drone_type(get_turf(src))
if(player.mob && player.mob.mind) player.mob.mind.reset()
var/mob/living/silicon/robot/drone/new_drone = PoolOrNew(drone_type, get_turf(src))
new_drone.transfer_personality(player)
new_drone.master_fabricator = src
@@ -90,7 +91,6 @@
set name = "Join As Drone"
set desc = "If there is a powered, enabled fabricator in the game world with a prepared chassis, join as a maintenance drone."
if(ticker.current_state < GAME_STATE_PLAYING)
src << "<span class='danger'>The game hasn't started yet!</span>"
return
@@ -113,12 +113,6 @@
return
var/deathtime = world.time - src.timeofdeath
if(istype(src,/mob/dead/observer))
var/mob/dead/observer/G = src
if(G.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
usr << "<span class='notice'>Upon using the antagHUD you forfeighted the ability to join the round.</span>"
return
var/deathtimeminutes = round(deathtime / 600)
var/pluralcheck = "minute"
if(deathtimeminutes == 0)

View File

@@ -0,0 +1,4 @@
author: Zuhayr
delete-after: True
changes:
- rscadd: "Click a hat on a drone with help intent to equip it. Drag the drone onto yourself with grab intent to remove it."