Fixes tentacles (#39992)

* Fixes tentacles, also moves throw callback to fire after the throw is fully completed.

* I knew i forgot something here.

* Undoes the callback change since it's fixed in another PR.

* Bluh
This commit is contained in:
AnturK
2018-09-02 05:55:55 +02:00
committed by yogstation13-bot
parent 9060b5a7e9
commit 8d9cb58450
4 changed files with 15 additions and 6 deletions

View File

@@ -238,6 +238,7 @@
fire_sound = 'sound/effects/splat.ogg'
force = 0
max_charges = 1
fire_delay = 1
throwforce = 0 //Just to be on the safe side
throw_range = 0
throw_speed = 0
@@ -254,6 +255,11 @@
/obj/item/gun/magic/tentacle/shoot_with_empty_chamber(mob/living/user as mob|obj)
to_chat(user, "<span class='warning'>The [name] is not ready yet.</span>")
/obj/item/gun/magic/tentacle/process_chamber()
. = ..()
if(charges == 0)
qdel(src)
/obj/item/gun/magic/tentacle/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] coils [src] tightly around [user.p_their()] neck! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (OXYLOSS)
@@ -302,8 +308,12 @@
/obj/item/projectile/tentacle/proc/tentacle_grab(mob/living/carbon/human/H, mob/living/carbon/C)
if(H.Adjacent(C))
if(H.get_active_held_item() && !H.get_inactive_held_item())
H.swap_hand()
if(H.get_active_held_item())
return
C.grabbedby(H)
C.grippedby(H) //instant aggro grab
C.grippedby(H, instant = TRUE) //instant aggro grab
/obj/item/projectile/tentacle/proc/tentacle_stab(mob/living/carbon/human/H, mob/living/carbon/C)
if(H.Adjacent(C))
@@ -318,7 +328,6 @@
/obj/item/projectile/tentacle/on_hit(atom/target, blocked = FALSE)
var/mob/living/carbon/human/H = firer
H.dropItemToGround(source.gun, TRUE) //Unequip thus delete the tentacle on hit
if(blocked >= 100)
return 0
if(isitem(target))

View File

@@ -156,7 +156,7 @@
else
..()
/mob/living/carbon/human/grippedby(mob/living/user)
/mob/living/carbon/human/grippedby(mob/living/user, instant = FALSE)
if(w_uniform)
w_uniform.add_fingerprint(user)
..()

View File

@@ -144,14 +144,14 @@
grippedby(user)
//proc to upgrade a simple pull into a more aggressive grab.
/mob/living/proc/grippedby(mob/living/carbon/user)
/mob/living/proc/grippedby(mob/living/carbon/user, instant = FALSE)
if(user.grab_state < GRAB_KILL)
user.changeNext_move(CLICK_CD_GRABBING)
playsound(src.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
if(user.grab_state) //only the first upgrade is instantaneous
var/old_grab_state = user.grab_state
var/grab_upgrade_time = 30
var/grab_upgrade_time = instant ? 0 : 30
visible_message("<span class='danger'>[user] starts to tighten [user.p_their()] grip on [src]!</span>", \
"<span class='userdanger'>[user] starts to tighten [user.p_their()] grip on you!</span>")
switch(user.grab_state)

View File

@@ -1,5 +1,5 @@
/mob/living/silicon/grippedby(mob/living/user)
/mob/living/silicon/grippedby(mob/living/user, instant = FALSE)
return //can't upgrade a simple pull into a more aggressive grab.
/mob/living/silicon/get_ear_protection()//no ears