Skip to content

Commit

Permalink
Fixes Venus Human Trap Tangle (#3396)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull request process. -->

## About The Pull Request
Title
Fixes #2194
<!-- Describe The Pull Request. Please be sure every change is documented or this can delay review and even discourage maintainers from merging your PR! -->

## Why It's Good For The Game
Fixes Human Trap powers and makes them more fun
<!-- Argue for the merits of your changes and how they benefit the game, especially if they are controversial and/or far reaching. If you can't actually explain WHY what you are doing will improve the game, then it probably isn't good for the game in the first place. -->

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely observed by players or admins you should add a changelog. If your change does NOT meet this description, remove this section. Be sure to properly mark your PRs to prevent unnecessary GBP loss. You can read up on GBP and it's effects on PRs in the tgstation guides for contributors. Please note that maintainers freely reserve the right to remove and add tags should they deem it appropriate. You can attempt to finagle the system all you want, but it's best to shoot for clear communication right off the bat. -->

:cl:
fix: Vine Tangle for Venus Human traps works again
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put your name to the right of the first :cl: if you want to overwrite your GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the icon ingame) and delete the unneeded ones. Despite some of the tags, changelogs should generally represent how a player might be affected by the changes rather than a summary of the PR's contents. -->
  • Loading branch information
Shoddd authored Sep 24, 2024
1 parent 8a79a23 commit 745d425
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions code/modules/mob/living/basic/jungle/venus_human_trap.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
/obj/structure/alien/resin/flower_bud //inheriting basic attack/damage stuff from alien structures
name = "flower bud"
desc = "A large pulsating plant..."
icon = 'icons/effects/spacevines.dmi'
icon = 'icons/mob/spacevines.dmi'
icon_state = "bud0"
layer = SPACEVINE_MOB_LAYER
plane = GAME_PLANE_UPPER_FOV_HIDDEN
opacity = FALSE
canSmoothWith = null
smoothing_flags = NONE
Expand Down Expand Up @@ -130,12 +129,11 @@
/mob/living/basic/venus_human_trap
name = "venus human trap"
desc = "Now you know how the fly feels."
icon = 'icons/effects/spacevines.dmi'
icon = 'icons/mob/spacevines.dmi'
icon_state = "venus_human_trap"
health_doll_icon = "venus_human_trap"
mob_biotypes = MOB_ORGANIC | MOB_PLANT
layer = SPACEVINE_MOB_LAYER
plane = GAME_PLANE_UPPER_FOV_HIDDEN
health = 100
maxHealth = 100
obj_damage = 60
Expand Down Expand Up @@ -173,9 +171,11 @@

/mob/living/basic/venus_human_trap/Initialize(mapload)
. = ..()
var/datum/action/cooldown/vine_tangle/tangle = new(src)
tangle.Grant(src)
ai_controller.set_blackboard_key(BB_TARGETED_ACTION, tangle)
AddElement(/datum/element/lifesteal, 5)
var/static/list/innate_actions = list(
/datum/action/cooldown/mob_cooldown/projectile_attack/vine_tangle = BB_TARGETED_ACTION,
)
grant_actions_by_list(innate_actions)

/mob/living/basic/venus_human_trap/RangedAttack(atom/victim)
if(!(istate & ISTATE_HARM))
Expand All @@ -199,32 +199,32 @@

adjustBruteLoss(vines_in_range ? -weed_heal : no_weed_damage) //every life tick take 20 damage if not near vines or heal 10 if near vines, 5 times out of weeds = u ded

/datum/action/cooldown/vine_tangle
/datum/action/cooldown/mob_cooldown/projectile_attack/vine_tangle
name = "Tangle"
button_icon = 'icons/mob/spacevines.dmi'
button_icon_state = "Light1"
desc = "Grabs a target with a sticky vine, allowing you to pull it alongside you."
cooldown_time = 8 SECONDS
///how many vines can we handle
var/max_vines = 2
/// An assoc list of all the plant's vines (beam = leash)
var/list/datum/beam/vines = list()
/// How far away a plant can attach a vine to something
var/vine_grab_distance = 4
/// how long does a vine attached to something last (and its leash) (lasts twice as long on nonliving things)
var/vine_duration = 2 SECONDS

/datum/action/cooldown/vine_tangle/Remove(mob/remove_from)
/datum/action/cooldown/mob_cooldown/projectile_attack/vine_tangle/Remove(mob/remove_from)
QDEL_LIST(vines)
return ..()

/datum/action/cooldown/vine_tangle/Activate(atom/target_atom)
/datum/action/cooldown/mob_cooldown/projectile_attack/vine_tangle/Activate(atom/target_atom)
if(isturf(target_atom) || istype(target_atom, /obj/structure/spacevine))
return
if(length(vines) >= max_vines || get_dist(owner, target_atom) > vine_grab_distance)
if(get_dist(owner, target_atom) > vine_grab_distance)
owner.balloon_alert(owner, "too far!")
return
for(var/turf/blockage in get_line(owner, target_atom))
if(blockage.is_blocked_turf(exclude_mobs = TRUE))
owner.balloon_alert(owner, "something's in the way!")
return

var/datum/beam/new_vine = owner.Beam(target_atom, icon_state = "vine", time = vine_duration * (ismob(target_atom) ? 1 : 2), beam_type = /obj/effect/ebeam/vine, emissive = FALSE)
Expand All @@ -245,7 +245,7 @@
* Arguments:
* * datum/beam/vine - The vine to be removed from the list.
*/
/datum/action/cooldown/vine_tangle/proc/remove_vine(datum/beam/vine)
/datum/action/cooldown/mob_cooldown/projectile_attack/vine_tangle/proc/remove_vine(datum/beam/vine)
SIGNAL_HANDLER

qdel(vines[vine])
Expand Down

0 comments on commit 745d425

Please sign in to comment.