-tg- pull refactor

This commit does the following:
 - Overhauls how pull works. It is now based on a mob verb,
   mob/verb/pulled()
 - Makes the pull icon much more responsive. It is now updated whenever a
   mob starts or stops pulling an object, and instantly updates.
   - This required HUD changes. God help me.
This commit is contained in:
Tigercat2000
2015-10-10 11:15:52 -07:00
parent 07770fdda7
commit ccdae149bb
40 changed files with 101 additions and 186 deletions
+3 -4
View File
@@ -135,10 +135,9 @@
nightvisionicon.name = "night vision"
nightvisionicon.screen_loc = ui_alien_nightvision
mymob.pullin = new /obj/screen()
mymob.pullin = new /obj/screen/pull()
mymob.pullin.icon = 'icons/mob/screen1_alien.dmi'
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.update_icon(mymob)
mymob.pullin.screen_loc = ui_pull_resist
alien_plasma_display = new /obj/screen()
@@ -171,4 +170,4 @@
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.toxin, mymob.fire, mymob.healths, nightvisionicon, mymob.pullin, alien_plasma_display, mymob.pullin, mymob.blind, mymob.flash) //, mymob.hands, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += src.adding + src.other
mymob.client.screen += mymob.client.void
mymob.client.screen += mymob.client.void
+3 -4
View File
@@ -56,10 +56,9 @@
nightvisionicon.name = "night vision"
nightvisionicon.screen_loc = ui_alien_nightvision
mymob.pullin = new /obj/screen()
mymob.pullin = new /obj/screen/pull()
mymob.pullin.icon = 'icons/mob/screen1_alien.dmi'
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.update_icon(mymob)
mymob.pullin.screen_loc = ui_pull_resist
mymob.blind = new /obj/screen()
@@ -69,7 +68,7 @@
mymob.blind.screen_loc = "CENTER-7,CENTER-7"
mymob.blind.layer = 0
mymob.blind.mouse_opacity = 0
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen1_alien.dmi'
mymob.flash.icon_state = "blank"
+2 -3
View File
@@ -422,10 +422,9 @@
mymob.nutrition_icon.name = "nutrition"
mymob.nutrition_icon.screen_loc = ui_nutrition
mymob.pullin = new /obj/screen()
mymob.pullin = new /obj/screen/pull()
mymob.pullin.icon = ui_style
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.update_icon(mymob)
mymob.pullin.screen_loc = ui_pull_resist
src.hotkeybuttons += mymob.pullin
+3 -4
View File
@@ -233,10 +233,9 @@
mymob.nutrition_icon.name = "nutrition"
mymob.nutrition_icon.screen_loc = ui_nutrition
mymob.pullin = new /obj/screen()
mymob.pullin = new /obj/screen/pull()
mymob.pullin.icon = ui_style
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.update_icon(mymob)
mymob.pullin.screen_loc = ui_pull_resist
src.hotkeybuttons += mymob.pullin
@@ -299,6 +298,6 @@
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.pressure, mymob.toxin, mymob.bodytemp, mymob.internals, mymob.fire, mymob.healths, mymob.healthdoll, mymob.nutrition_icon, mymob.pullin, mymob.blind, mymob.flash, mymob.damageoverlay, mymob.gun_setting_icon) //, mymob.hands, mymob.rest, mymob.sleep) //, mymob.mach )
mymob.client.screen += src.adding + src.hotkeybuttons
mymob.client.screen += mymob.client.void
mymob.client.screen += mymob.client.void
return
+3 -4
View File
@@ -18,10 +18,9 @@
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_health
mymob.pullin = new /obj/screen()
mymob.pullin = new /obj/screen/pull()
mymob.pullin.icon = 'icons/mob/screen1_corgi.dmi'
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.update_icon(mymob)
mymob.pullin.screen_loc = ui_construct_pull
mymob.oxygen = new /obj/screen()
@@ -67,4 +66,4 @@
mymob.client.screen = list()
mymob.client.screen += list(blobpwrdisplay, blobhealthdisplay)
mymob.client.screen += mymob.client.void
mymob.client.screen += mymob.client.void
+2 -3
View File
@@ -125,10 +125,9 @@
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_fire
mymob.pullin = new /obj/screen()
mymob.pullin = new /obj/screen/pull()
mymob.pullin.icon = 'icons/mob/screen1_robot.dmi'
mymob.pullin.icon_state = "pull0"
mymob.pullin.name = "pull"
mymob.pullin.update_icon(mymob)
mymob.pullin.screen_loc = ui_borg_pull
mymob.blind = new /obj/screen()
+15 -3
View File
@@ -170,6 +170,21 @@
overlays.Cut()
overlays += image('icons/mob/zone_sel.dmi', "[selecting]")
/obj/screen/pull
name = "stop pulling"
icon = 'icons/mob/screen1_Midnight.dmi'
icon_state = "pull"
/obj/screen/pull/Click()
usr.stop_pulling()
/obj/screen/pull/update_icon(mob/mymob)
if(!mymob) return
if(mymob.pulling)
icon_state = "pull"
else
icon_state = "pull0"
/obj/screen/Click(location, control, params)
if(!usr) return 1
@@ -347,9 +362,6 @@
if("disarm")
usr.a_intent = I_DISARM
usr.hud_used.action_intent.icon_state = "intent_disarm"
if("pull")
usr.stop_pulling()
if("throw")
if(!usr.stat && isturf(usr.loc) && !usr.restrained())
usr:toggle_throw_mode()