mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-10 14:44:05 +01:00
WIP: Porting gun targeting
This commit is contained in:
@@ -132,7 +132,7 @@ Please contact me on #coderbus IRC. ~Carn x
|
||||
//this proc is messy as I was forced to include some old laggy cloaking code to it so that I don't break cloakers
|
||||
//I'll work on removing that stuff by rewriting some of the cloaking stuff at a later date.
|
||||
/mob/living/carbon/human/update_icons()
|
||||
|
||||
world << "[src] CALLED THE HUMAN VERSION OF UPDATE_ICONS"
|
||||
lying_prev = lying //so we don't update overlays for lying/standing unless our stance changes again
|
||||
update_hud() //TODO: remove the need for this
|
||||
overlays = null
|
||||
@@ -443,18 +443,19 @@ proc/get_damage_icon_part(damage_state, body_part)
|
||||
update_hair(0)
|
||||
if(update_icons) update_icons()
|
||||
|
||||
/mob/living/carbon/human/proc/update_targeted(var/update_icons=1)
|
||||
/mob/living/carbon/human/update_targeted(var/update_icons=1)
|
||||
// If someone's targeting you
|
||||
if (targeted_by.len)
|
||||
|
||||
//If the target is already there and finished locking (after two seconds), put in locked state and be done
|
||||
if (overlays_standing[TARGETED_LAYER])
|
||||
if (overlays_standing[TARGETED_LAYER]||overlays_lying[TARGETED_LAYER])
|
||||
var/target_locked = image("icon" = 'icons/effects/Targeted.dmi', "icon_state" = "locked")
|
||||
overlays_lying[TARGETED_LAYER] = target_locked
|
||||
overlays_standing[TARGETED_LAYER] = target_locked
|
||||
return
|
||||
|
||||
var/target_locking = new/image("icon" = 'icons/effects/Targeted.dmi', "icon_state" = "locking")
|
||||
var/target_locking = image("icon" = 'icons/effects/Targeted.dmi', "icon_state" = "locking")
|
||||
world << "TARGET_LOCKING IS [target_locking]"
|
||||
|
||||
//Put in our overlay, since it isn't already there
|
||||
overlays_lying[TARGETED_LAYER] = target_locking
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
return
|
||||
|
||||
/mob/proc/update_icons()
|
||||
world << "[src] CALLED THE MOB VERSION OF UPDATE_ICONS"
|
||||
return
|
||||
|
||||
/mob/proc/update_hud()
|
||||
@@ -63,3 +64,6 @@
|
||||
|
||||
/mob/proc/update_inv_ears()
|
||||
return
|
||||
|
||||
/mob/proc/update_targeted()
|
||||
return
|
||||
|
||||
@@ -414,18 +414,20 @@ mob/proc
|
||||
so try not to get on their bad side.\black ))"
|
||||
if(targeted_by.len == 1)
|
||||
spawn(0)
|
||||
target_locked = new /obj/effect/target_locked(src) //Add the overlay
|
||||
overlays += target_locked
|
||||
//target_locked = new /obj/effect/target_locked(src) //Add the overlay
|
||||
//overlays += target_locked
|
||||
spawn(0) //Make it show the 2 states properly
|
||||
if(target_locked)
|
||||
target_locked.icon_state = "locking"
|
||||
if (ispath(src,mob/living/carbon/human))
|
||||
src:update_icons()
|
||||
//if(target_locked)
|
||||
// target_locked.icon_state = "locking"
|
||||
//update_icons()
|
||||
update_targeted()
|
||||
//overlays += target_locked
|
||||
sleep(20)
|
||||
if(target_locked)
|
||||
target_locked.icon_state = "locked"
|
||||
if (ispath(src,mob/living/carbon/human))
|
||||
src:update_icons()
|
||||
//if(target_locked)
|
||||
// target_locked.icon_state = "locked"
|
||||
//update_icons()
|
||||
update_targeted()
|
||||
//overlays += target_locked
|
||||
var/mob/T = I.loc
|
||||
//Adding the buttons to the controler person
|
||||
if(T)
|
||||
@@ -463,7 +465,7 @@ mob/proc
|
||||
if(!I.silenced)
|
||||
for(var/mob/M in viewers(src))
|
||||
M << 'TargetOff.ogg'
|
||||
del(target_locked) //Remove the overlay
|
||||
//del(target_locked) //Remove the overlay
|
||||
targeted_by -= I
|
||||
I.target.Remove(src) //De-target them
|
||||
if(!I.target.len)
|
||||
@@ -473,10 +475,8 @@ mob/proc
|
||||
del(T.item_use_icon)
|
||||
del(T.gun_move_icon)
|
||||
del(T.gun_run_icon)
|
||||
if(!targeted_by.len) del targeted_by
|
||||
spawn(1)
|
||||
if (ispath(src,mob/living/carbon/human))
|
||||
src:update_icons()
|
||||
//if(!targeted_by.len) del targeted_by
|
||||
spawn(1) /*update_icons()*/ update_targeted()
|
||||
|
||||
/* Captive(var/obj/item/weapon/gun/I)
|
||||
Sound(src,'CounterAttack.ogg')
|
||||
|
||||
Reference in New Issue
Block a user