Adds dextrous guardian (#19254)

Added dextrous guardians to the code, able to hold and use items and store a single item within themselves.

Dextrous guardians do low damage on punches, have medium damage resist, and recalling or leashing will force them to drop any items in their hands.
This commit is contained in:
Joan Lung
2016-07-13 11:25:00 +12:00
committed by oranges
parent 7100277ca3
commit fe28096320
23 changed files with 351 additions and 169 deletions
+4 -67
View File
@@ -1,42 +1,14 @@
/datum/hud/drone/New(mob/owner, ui_style = 'icons/mob/screen_midnight.dmi')
/datum/hud/dextrous/drone/New(mob/owner, ui_style = 'icons/mob/screen_midnight.dmi')
..()
var/obj/screen/using
var/obj/screen/inventory/inv_box
using = new /obj/screen/drop()
using.icon = ui_style
using.screen_loc = ui_drone_drop
static_inventory += using
pull_icon = new /obj/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon(mymob)
pull_icon.screen_loc = ui_drone_pull
static_inventory += pull_icon
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "right hand"
inv_box.icon = ui_style
inv_box.icon_state = "hand_r"
inv_box.screen_loc = ui_rhand
inv_box.slot_id = slot_r_hand
static_inventory += inv_box
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "left hand"
inv_box.icon = ui_style
inv_box.icon_state = "hand_l"
inv_box.screen_loc = ui_lhand
inv_box.slot_id = slot_l_hand
static_inventory += inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "internal storage"
inv_box.icon = ui_style
inv_box.icon_state = "suit_storage"
// inv_box.icon_full = "template"
inv_box.screen_loc = ui_drone_storage
inv_box.slot_id = slot_drone_storage
inv_box.slot_id = slot_generic_dextrous_storage
static_inventory += inv_box
inv_box = new /obj/screen/inventory()
@@ -48,26 +20,6 @@
inv_box.slot_id = slot_head
static_inventory += inv_box
using = new /obj/screen/swap_hand()
using.icon = ui_style
using.icon_state = "swap_1_m"
using.screen_loc = ui_swaphand1
static_inventory += using
using = new /obj/screen/swap_hand()
using.icon = ui_style
using.icon_state = "swap_2"
using.screen_loc = ui_swaphand2
static_inventory += using
zone_select = new /obj/screen/zone_sel()
zone_select.icon = ui_style
zone_select.update_icon(mymob)
using = new /obj/screen/inventory/craft
using.icon = ui_style
static_inventory += using
for(var/obj/screen/inventory/inv in (static_inventory + toggleable_inventory))
if(inv.slot_id)
inv.hud = src
@@ -75,7 +27,7 @@
inv.update_icon()
/datum/hud/drone/persistant_inventory_update()
/datum/hud/dextrous/drone/persistant_inventory_update()
if(!mymob)
return
var/mob/living/simple_animal/drone/D = mymob
@@ -93,19 +45,4 @@
if(D.head)
D.head.screen_loc = null
if(hud_version != HUD_STYLE_NOHUD)
if(D.r_hand)
D.r_hand.screen_loc = ui_rhand
D.client.screen += D.r_hand
if(D.l_hand)
D.l_hand.screen_loc = ui_lhand
D.client.screen += D.l_hand
else
if(D.r_hand)
D.r_hand.screen_loc = null
if(D.l_hand)
D.l_hand.screen_loc = null
/mob/living/simple_animal/drone/create_mob_hud()
if(client && !hud_used)
hud_used = new /datum/hud/drone(src, ui_style2icon(client.prefs.UI_style))
..()
+14
View File
@@ -9,6 +9,12 @@
using.screen_loc = ui_drone_drop
static_inventory += using
pull_icon = new /obj/screen/pull()
pull_icon.icon = ui_style
pull_icon.update_icon(mymob)
pull_icon.screen_loc = ui_drone_pull
static_inventory += pull_icon
inv_box = new /obj/screen/inventory/hand()
inv_box.name = "right hand"
inv_box.icon = ui_style
@@ -37,6 +43,14 @@
using.screen_loc = ui_swaphand2
static_inventory += using
zone_select = new /obj/screen/zone_sel()
zone_select.icon = ui_style
zone_select.update_icon(mymob)
using = new /obj/screen/inventory/craft
using.icon = ui_style
static_inventory += using
mymob.client.screen = list()
for(var/obj/screen/inventory/inv in (static_inventory + toggleable_inventory))
+62 -1
View File
@@ -29,8 +29,69 @@
/mob/living/simple_animal/hostile/guardian/create_mob_hud()
if(client && !hud_used)
hud_used = new /datum/hud/guardian(src)
if(dextrous)
..()
else
hud_used = new /datum/hud/guardian(src, ui_style2icon(client.prefs.UI_style))
/datum/hud/dextrous/guardian/New(mob/living/simple_animal/hostile/guardian/owner, ui_style = 'icons/mob/screen_midnight.dmi') //for a dextrous guardian
..()
var/obj/screen/using
if(istype(owner, /mob/living/simple_animal/hostile/guardian/dextrous))
var/obj/screen/inventory/inv_box
inv_box = new /obj/screen/inventory()
inv_box.name = "internal storage"
inv_box.icon = ui_style
inv_box.icon_state = "suit_storage"
inv_box.screen_loc = ui_id
inv_box.slot_id = slot_generic_dextrous_storage
static_inventory += inv_box
using = new /obj/screen/guardian/Communicate()
using.screen_loc = ui_sstore1
static_inventory += using
else
using = new /obj/screen/guardian/Communicate()
using.screen_loc = ui_id
static_inventory += using
healths = new /obj/screen/healths/guardian()
infodisplay += healths
using = new /obj/screen/guardian/Manifest()
using.screen_loc = ui_belt
static_inventory += using
using = new /obj/screen/guardian/Recall()
using.screen_loc = ui_back
static_inventory += using
using = new owner.toggle_button_type()
using.screen_loc = ui_storage2
static_inventory += using
using = new /obj/screen/guardian/ToggleLight()
using.screen_loc = ui_inventory
static_inventory += using
/datum/hud/dextrous/guardian/persistant_inventory_update()
if(!mymob)
return
if(istype(mymob, /mob/living/simple_animal/hostile/guardian/dextrous))
var/mob/living/simple_animal/hostile/guardian/dextrous/D = mymob
if(hud_shown)
if(D.internal_storage)
D.internal_storage.screen_loc = ui_id
D.client.screen += D.internal_storage
else
if(D.internal_storage)
D.internal_storage.screen_loc = null
..()
/obj/screen/guardian
icon = 'icons/mob/guardian.dmi'