Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combat Tentacles #7519

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions code/datums/beam.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
var/static_beam = 0
var/beam_type = /obj/effect/ebeam //must be subtype

/datum/beam/New(beam_origin,beam_target,beam_icon='icons/effects/beam.dmi',beam_icon_state="b_beam",time=50,maxdistance=10,btype = /obj/effect/ebeam)
/datum/beam/New(beam_origin,beam_target,beam_icon='icons/effects/beam.dmi',beam_icon_state="b_beam",time=50,maxdistance=10,btype = /obj/effect/ebeam,beam_sleep_time=3)
endtime = world.time+time
origin = beam_origin
origin_oldloc = get_turf(origin)
target = beam_target
target_oldloc = get_turf(target)
sleep_time = beam_sleep_time
if(origin_oldloc == origin && target_oldloc == target)
static_beam = 1
max_distance = maxdistance
Expand Down Expand Up @@ -117,13 +118,13 @@
/obj/effect/ebeam/Destroy()
owner = null
return ..()

/obj/effect/ebeam/deadly/Crossed(atom/A)
..()
A.ex_act(1)

/atom/proc/Beam(atom/BeamTarget,icon_state="b_beam",icon='icons/effects/beam.dmi',time=50, maxdistance=10,beam_type=/obj/effect/ebeam)
var/datum/beam/newbeam = new(src,BeamTarget,icon,icon_state,time,maxdistance,beam_type)
/atom/proc/Beam(atom/BeamTarget,icon_state="b_beam",icon='icons/effects/beam.dmi',time=50, maxdistance=10,beam_type=/obj/effect/ebeam,beam_sleep_time=3)
var/datum/beam/newbeam = new(src,BeamTarget,icon,icon_state,time,maxdistance,beam_type,beam_sleep_time)
spawn(0)
newbeam.Start()
return newbeam
183 changes: 180 additions & 3 deletions code/game/gamemodes/changeling/powers/mutations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@
dna_cost = -1
genetic_damage = 1000

var/silent = FALSE
var/weapon_type
var/weapon_name_simple

/obj/effect/proc_holder/changeling/weapon/try_to_sting(var/mob/user, var/mob/target)
if(istype(user.l_hand, weapon_type)) //Not the nicest way to do it, but eh
qdel(user.l_hand)
user.visible_message("<span class='warning'>With a sickening crunch, [user] reforms his [weapon_name_simple] into an arm!</span>", "<span class='notice'>We assimilate the [weapon_name_simple] back into our body.</span>", "<span class='warning>You hear organic matter ripping and tearing!</span>")
if(!silent)
user.visible_message("<span class='warning'>With a sickening crunch, [user] reforms his [weapon_name_simple] into an arm!</span>", "<span class='notice'>We assimilate the [weapon_name_simple] back into our body.</span>", "<span class='warning>You hear organic matter ripping and tearing!</span>")
user.update_inv_l_hand()
return
if(istype(user.r_hand, weapon_type))
qdel(user.r_hand)
user.visible_message("<span class='warning'>With a sickening crunch, [user] reforms his [weapon_name_simple] into an arm!</span>", "<span class='notice'>We assimilate the [weapon_name_simple] back into our body.</span>", "<span class='warning>You hear organic matter ripping and tearing!</span>")
if(!silent)
user.visible_message("<span class='warning'>With a sickening crunch, [user] reforms his [weapon_name_simple] into an arm!</span>", "<span class='notice'>We assimilate the [weapon_name_simple] back into our body.</span>", "<span class='warning>You hear organic matter ripping and tearing!</span>")
user.update_inv_r_hand()
return
..(user, target)
Expand All @@ -37,7 +40,7 @@
if(!user.drop_item())
to_chat(user, "The [user.get_active_hand()] is stuck to your hand, you cannot grow a [weapon_name_simple] over it!")
return
var/obj/item/W = new weapon_type(user)
var/obj/item/W = new weapon_type(user, silent)
user.put_in_hands(W)
return W

Expand Down Expand Up @@ -174,6 +177,180 @@
user.visible_message("<span class='warning'>[user] forces the airlock to open with \his [src]!</span>", "<span class='warning'>We force the airlock to open.</span>", "<span class='warning'>You hear a metal screeching sound.</span>")
A.open(2)

/***************************************\
|***********COMBAT TENTACLES*************|
\***************************************/

/obj/effect/proc_holder/changeling/weapon/tentacle
name = "Tentacle"
desc = "We ready a tentacle to grab items or victims with."
helptext = "We can use it once to retrieve a distant item. If used on living creatures, the effect depends on the intent: \
Help will simply drag them closer, Disarm will grab whatever they are holding instead of them, Grab will put the victim in our hold after catching it, \
and Harm will stun it, and stab it if we are also holding a sharp weapon. Cannot be used while in lesser form."
chemical_cost = 10
dna_cost = 2
genetic_damage = 5
req_human = 1
max_genetic_damage = 10
weapon_type = /obj/item/weapon/gun/magic/tentacle
weapon_name_simple = "tentacle"
silent = TRUE

/obj/item/weapon/gun/magic/tentacle
name = "tentacle"
desc = "A fleshy tentacle that can stretch out and grab things or people."
icon = 'icons/obj/weapons.dmi'
icon_state = "tentacle"
item_state = "tentacle"
flags = ABSTRACT | NODROP | NOBLUDGEON
w_class = WEIGHT_CLASS_HUGE
ammo_type = /obj/item/ammo_casing/magic/tentacle
fire_sound = 'sound/effects/splat.ogg'
force = 0
max_charges = 1
throwforce = 0 //Just to be on the safe side
throw_range = 0
throw_speed = 0

/obj/item/weapon/gun/magic/tentacle/New(location,silent)
..()
if(ismob(loc))
if(!silent)
loc.visible_message("<span class='warning'>[loc.name]\'s arm starts stretching inhumanly!</span>", "<span class='warning'>Our arm twists and mutates, transforming it into a tentacle.</span>", "<span class='italics'>You hear organic matter ripping and tearing!</span>")
else
to_chat(loc, "<span class='notice'>You prepare to extend a tentacle.</span>")

/obj/item/weapon/gun/magic/tentacle/dropped()
. = ..()
qdel(src)

/obj/item/weapon/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/weapon/gun/magic/tentacle/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] coils [src] tightly around \his neck! It looks like \he's trying to commit suicide.</span>")
return (OXYLOSS)

/obj/item/ammo_casing/magic/tentacle
name = "tentacle"
desc = "a tentacle."
projectile_type = /obj/item/projectile/tentacle
caliber = "tentacle"
icon_state = "tentacle_end"
var/obj/item/weapon/gun/magic/tentacle/gun //the item that shot it

/obj/item/ammo_casing/magic/tentacle/New(obj/item/weapon/gun/magic/tentacle/tentacle_gun)
gun = tentacle_gun
..()

/obj/item/ammo_casing/magic/tentacle/Destroy()
gun = null
return ..()

/obj/item/projectile/tentacle
name = "tentacle"
icon_state = "tentacle_end"
pass_flags = PASSTABLE
damage = 0
damage_type = BRUTE
range = 8
hitsound = 'sound/weapons/thudswoosh.ogg'
var/chain
var/obj/item/ammo_casing/magic/tentacle/source //the item that shot it

/obj/item/projectile/tentacle/New(obj/item/ammo_casing/magic/tentacle/tentacle_casing)
source = tentacle_casing
..()

/obj/item/projectile/tentacle/fire(setAngle)
if(firer)
chain = firer.Beam(src, icon_state = "tentacle", time = INFINITY, maxdistance = INFINITY, beam_sleep_time = 1)
..()

/obj/item/projectile/tentacle/proc/reset_throw(mob/living/carbon/human/H)
if(H.in_throw_mode)
H.throw_mode_off() //Don't annoy the changeling if he doesn't catch the item

/mob/proc/tentacle_grab(mob/living/carbon/C)
if(Adjacent(C))
var/obj/item/weapon/grab/G = C.grabbedby(src,1)
if(istype(G))
G.state = GRAB_AGGRESSIVE //Instant aggressive grab

/mob/proc/tentacle_stab(mob/living/carbon/C)
Copy link
Member

@Fox-McCloud Fox-McCloud Jun 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mob proc instead of a projectile proc?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried everything to make the projectile procs work, but they literally never fired regardless of how i setup the callback, addtimer, spawned call, the projectile always managed to get deleted beforehand. This was the easiest solution.

Copy link
Member

@Fox-McCloud Fox-McCloud Jun 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahhhh, so this is what you were referring to.

Sounds like something, somewhere, need to be updated in projectile code.

if(Adjacent(C))
var/obj/item/I = r_hand
if(!is_sharp(I))
I = l_hand
if(!is_sharp(I))
C.visible_message("<span class='danger'>[C] falls at [src]'s feet!</span>", "<span class='userdanger'>You are thrown at [src]'s feet!</span>")
C.Weaken(2)
Copy link
Member

@Fox-McCloud Fox-McCloud Jun 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the two lines above can be removed; they got ride of weakening for this ability as it was deemed too powerful: https://github.com/tgstation/tgstation/blob/1c8badd8fef34ab8ecd3729b01a2bccf01de4db6/code/game/gamemodes/changeling/powers/mutations.dm#L302

Unless I'm missing something.

return

C.visible_message("<span class='danger'>[src] impales [C] with [I]!</span>", "<span class='userdanger'>[src] impales you with [I]!</span>")
C.apply_damage(I.force, BRUTE, "chest")
do_attack_animation(C)
add_blood(C)
playsound(get_turf(src), I.hitsound, 75, 1)


/obj/item/projectile/tentacle/on_hit(atom/target, blocked = 0)
qdel(source.gun) //one tentacle only unless you miss
if(blocked >= 100)
return 0
var/mob/living/carbon/human/H = firer
if(istype(target, /obj/item))
var/obj/item/I = target
if(!I.anchored)
to_chat(firer, "<span class='notice'>You pull [I] towards yourself.</span>")
H.throw_mode_on()
I.throw_at(H, 10, 2)
. = 1

else if(isliving(target))
var/mob/living/L = target
if(!L.anchored && !L.throwing)//avoid double hits
if(iscarbon(L))
var/mob/living/carbon/C = L
switch(firer.a_intent)
if(INTENT_HELP)
C.visible_message("<span class='danger'>[L] is pulled by [H]'s tentacle!</span>","<span class='userdanger'>A tentacle grabs you and pulls you towards [H]!</span>")
C.throw_at(get_step_towards(H,C), 8, 2)
return 1

if(INTENT_DISARM)
var/obj/item/I = C.get_active_hand()
if(I)
if(C.drop_item())
C.visible_message("<span class='danger'>[I] is yanked out of [C]'s hand by [src]!</span>","<span class='userdanger'>A tentacle pulls [I] away from you!</span>")
on_hit(I) //grab the item as if you had hit it directly with the tentacle
return 1
else
to_chat(firer, "<span class='danger'>You can't seem to pry [I] out of [C]'s hands!<span>")
return 0
else
to_chat(firer, "<span class='danger'>[C] has nothing in hand to disarm!<span>")
return 0

if(INTENT_GRAB)
C.visible_message("<span class='danger'>[L] is grabbed by [H]'s tentacle!</span>","<span class='userdanger'>A tentacle grabs you and pulls you towards [H]!</span>")
C.throw_at(get_step_towards(H,C), 8, 2, callback=CALLBACK(H, /mob/proc/tentacle_grab, C))
return 1

if(INTENT_HARM)
C.visible_message("<span class='danger'>[L] is thrown towards [H] by a tentacle!</span>","<span class='userdanger'>A tentacle grabs you and throws you towards [H]!</span>")
C.throw_at(get_step_towards(H,C), 8, 2, callback=CALLBACK(H, /mob/proc/tentacle_stab, C))
return 1
else
L.visible_message("<span class='danger'>[L] is pulled by [H]'s tentacle!</span>","<span class='userdanger'>A tentacle grabs you and pulls you towards [H]!</span>")
L.throw_at(get_step_towards(H,L), 8, 2)
. = 1

/obj/item/projectile/tentacle/Destroy()
qdel(chain)
source = null
return ..()


/***************************************\
|****************SHIELD*****************|
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/living_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,8 @@
if(!supress_message)
visible_message("<span class='warning'>[user] has grabbed [src] passively!</span>")

return G

/mob/living/incapacitated()
if(stat || paralysis || stunned || weakened || restrained())
return 1
Binary file modified icons/effects/beam.dmi
Binary file not shown.
Binary file modified icons/mob/inhands/items_lefthand.dmi
Binary file not shown.
Binary file modified icons/mob/inhands/items_righthand.dmi
Binary file not shown.
Binary file modified icons/obj/projectiles.dmi
Binary file not shown.
Binary file modified icons/obj/weapons.dmi
Binary file not shown.