Merge pull request #3313 from CHOMPStation2/upstream-merge-11991

[MIRROR] Makes bluespace harpoon capable of televore
This commit is contained in:
Nadyr
2021-12-12 06:25:11 -05:00
committed by GitHub

View File

@@ -18,6 +18,7 @@
var/transforming = 0
var/failure_chance = 15 // This can become negative with part tiers above 3, which helps offset penalties
var/obj/item/weapon/stock_parts/scanning_module/scanmod
var/dropnoms_active = TRUE
/obj/item/weapon/bluespace_harpoon/Initialize()
. = ..()
@@ -26,6 +27,8 @@
/obj/item/weapon/bluespace_harpoon/examine(var/mob/user)
. = ..()
. += "It is currently in [mode ? "transmitting" : "recieving"] mode."
. += "Spatial rearrangement is [dropnoms_active ? "active" : "inactive"]."
if(Adjacent(user))
. += "It has [scanmod ? scanmod : "no scanner module"] installed."
@@ -80,7 +83,7 @@
playsound(src, 'sound/weapons/wave.ogg', 60, 1)
return
var/turf/T = get_turf(A)
if(!T || (T.check_density() && mode == 1))
if(!T || (T.check_density(ignore_mobs = TRUE) && mode == 1))
to_chat(user,"<span class = 'warning'>That's a little too solid to harpoon into!</span>")
return
var/turf/ownturf = get_turf(src)
@@ -118,12 +121,47 @@
for(var/rider in L.buckled_mobs)
sendfailchance += 15
var/mob/living/living_user = user
var/can_dropnom = TRUE
if(!dropnoms_active || !istype(living_user))
can_dropnom = FALSE
if(mode)
if(user in FromTurf)
if(prob(sendfailchance))
user.forceMove(pick(trange(24,user)))
else
user.forceMove(ToTurf)
var/vore_happened = FALSE
if(can_dropnom && living_user.can_be_drop_pred)
var/obj/belly/belly_dest
if(living_user.vore_selected)
belly_dest = living_user.vore_selected
else if(living_user.vore_organs.len)
belly_dest = pick(living_user.vore_organs)
if(belly_dest)
for(var/mob/living/prey in ToTurf)
if(prey != user && prey.can_be_drop_prey)
prey.forceMove(belly_dest)
vore_happened = TRUE
to_chat(prey, "<span class='danger'>[living_user] materializes around you, as you end up in their [belly_dest]!</span>")
to_chat(living_user, "<span class='notice'>You materialize around [prey] as they end up in your [belly_dest]!</span>")
if(can_dropnom && !vore_happened && living_user.can_be_drop_prey)
var/mob/living/pred
for(var/mob/living/potential_pred in ToTurf)
if(potential_pred != user && potential_pred.can_be_drop_pred)
pred = potential_pred
if(pred)
var/obj/belly/belly_dest
if(pred.vore_selected)
belly_dest = pred.vore_selected
else if(pred.vore_organs.len)
belly_dest = pick(pred.vore_organs)
if(belly_dest)
living_user.forceMove(belly_dest)
to_chat(pred, "<span class='notice'>[living_user] materializes inside you as they end up in your [belly_dest]!</span>")
to_chat(living_user, "<span class='danger'>You materialize inside [pred] as you end up in their [belly_dest]!</span>")
else
for(var/obj/O in FromTurf)
if(O.anchored) continue
@@ -132,25 +170,58 @@
else
O.forceMove(ToTurf)
var/user_vored = FALSE
for(var/mob/living/M in FromTurf)
if(prob(recievefailchance))
M.forceMove(pick(trange(24,user)))
else
M.forceMove(ToTurf)
if(can_dropnom && living_user.can_be_drop_pred && M.can_be_drop_prey)
var/obj/belly/belly_dest
if(living_user.vore_selected)
belly_dest = living_user.vore_selected
else if(living_user.vore_organs.len)
belly_dest = pick(living_user.vore_organs)
if(belly_dest)
M.forceMove(belly_dest)
to_chat(living_user, "<span class='notice'>[M] materializes inside you as they end up in your [belly_dest]!</span>")
to_chat(M, "<span class='danger'>You materialize inside [living_user] as you end up in their [belly_dest]!</span>")
else if(can_dropnom && living_user.can_be_drop_prey && M.can_be_drop_pred && !user_vored)
var/obj/belly/belly_dest
if(M.vore_selected)
belly_dest = M.vore_selected
else if(M.vore_organs.len)
belly_dest = pick(M.vore_organs)
if(belly_dest)
living_user.forceMove(belly_dest)
user_vored = TRUE
to_chat(living_user, "<span class='danger'>[M] materializes around you, as you end up in their [belly_dest]!</span>")
to_chat(M, "<span class='notice'>You materialize around [living_user] as they end up in your [belly_dest]!</span>")
/obj/item/weapon/bluespace_harpoon/attack_self(mob/living/user as mob)
return chande_fire_mode(user)
/obj/item/weapon/bluespace_harpoon/verb/chande_fire_mode(mob/user as mob)
set name = "Change fire mode"
set name = "Change Fire Mode"
set category = "Object"
set src in oview(1)
set src in range(0)
if(transforming) return
mode = !mode
transforming = 1
to_chat(user,"<span class = 'info'>You change \the [src]'s mode to [mode ? "transmiting" : "receiving"].</span>")
update_icon()
/obj/item/weapon/bluespace_harpoon/verb/chande_dropnom_mode(mob/user as mob)
set name = "Toggle Spatial Rearrangement"
set category = "Object"
set src in range(0)
dropnoms_active = !dropnoms_active
to_chat(user,"<span class = 'info'>You switch \the [src]'s spatial rearrangement [dropnoms_active ? "on" : "off"]. (Telenoms [dropnoms_active ? "enabled" : "dsiabled"])</span>")
/obj/item/weapon/bluespace_harpoon/update_icon()
if(transforming)
switch(mode)