venus changes (#7692)

* venus changes

* better looking code

* suggestion

* one small forget
This commit is contained in:
jjpark-kb
2021-08-28 02:11:17 +01:00
committed by GitHub
parent 05e152461c
commit 12f795f23d
2 changed files with 55 additions and 8 deletions
@@ -107,7 +107,7 @@
icon_state = "venus_human_trap"
health_doll_icon = "venus_human_trap"
mob_biotypes = MOB_ORGANIC | MOB_PLANT
layer = SPACEVINE_MOB_LAYER
layer = ABOVE_ALL_MOB_LAYER //SKYRAT EDIT CHANGE Venus should be able to hide within the vines...
health = 60 //SKYRAT EDIT CHANGE
maxHealth = 60 //SKYRAT EDIT CHANGE
ranged = TRUE
@@ -142,10 +142,20 @@
ghost_controllable = TRUE //SKYRAT EDIT ADDITION
COOLDOWN_DECLARE(help_grow)
/mob/living/simple_animal/hostile/venus_human_trap/Life(delta_time = SSMOBS_DT, times_fired)
. = ..()
pull_vines()
//SKYRAT EDIT CHANGE
var/turf/src_turf = get_turf(src)
var/obj/structure/spacevine/find_vine = locate() in src_turf.contents
if(!find_vine)
adjustHealth(maxHealth * 0.05)
else
adjustHealth(maxHealth * -0.05)
//SKYRAT EDIT CHANGE
/mob/living/simple_animal/hostile/venus_human_trap/Moved(atom/OldLoc, Dir)
. = ..()
@@ -245,4 +255,41 @@
for(var/i in vines)
qdel(i)
return ..()
/mob/living/simple_animal/hostile/venus_human_trap/UnarmedAttack(atom/attack_target, proximity_flag, list/modifiers)
if(!istype(attack_target, /obj/structure/spacevine))
return ..()
if(!proximity_flag)
return
var/obj/structure/spacevine/attacked_spacevine = attack_target
if(COOLDOWN_FINISHED(src, help_grow))
COOLDOWN_START(src, help_grow, 1 SECONDS)
if(attacked_spacevine.energy >= 2)
attacked_spacevine.spread()
to_chat(src, span_notice("You help [attacked_spacevine] expand..."))
else
attacked_spacevine.grow()
to_chat(src, span_notice("You help [attacked_spacevine] grow..."))
var/turf/vine_turf = get_turf(attack_target)
var/static/list/break_list = typecacheof(list(
/obj/machinery/door,
/obj/structure/table,
/obj/structure/window,
/obj/structure/girder,
/obj/structure/grille,
/obj/structure/rack,
/obj/structure/door_assembly,
/obj/structure/closet,
))
for(var/check_contents in vine_turf.contents)
if(isliving(check_contents) && !istype(check_contents, /mob/living/simple_animal/hostile/venus_human_trap))
UnarmedAttack(check_contents)
if(is_type_in_typecache(check_contents, break_list))
UnarmedAttack(check_contents)
/mob/living/simple_animal/hostile/venus_human_trap/start_pulling(atom/movable/AM, state, force, supress_message)
if(isliving(AM))
to_chat(src, span_warning("You are unable to pull living creatures, they are too heavy!"))
return FALSE
return ..()
//SKYRAT EDIT END
@@ -636,13 +636,6 @@
return
for(var/datum/spacevine_mutation/vine_mutation in mutations)
vine_mutation.on_cross(src, moving_atom)
if(istype(moving_atom, /mob/living/simple_animal/hostile/venus_human_trap))
var/mob/living/simple_animal/hostile/venus_human_trap/venus_trap = moving_atom
if(venus_trap.health >= venus_trap.maxHealth)
return
venus_trap.adjustHealth(-clamp(venus_trap.health += 2, 0, venus_trap.maxHealth), TRUE, TRUE)
to_chat(venus_trap, span_notice("The vines attempt to regenerate some of your wounds!"))
return
// ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/structure/spacevine/attack_hand(mob/user, list/modifiers)
@@ -836,6 +829,13 @@
if(isvineimmune(mover))
return TRUE
/obj/structure/spacevine/attack_ghost(mob/user)
var/turf/src_turf = get_turf(src)
var/mob/living/simple_animal/hostile/venus_human_trap/check_venus = locate() in src_turf.contents
if(!check_venus)
return ..()
check_venus.attack_ghost(user)
/proc/isvineimmune(atom/checked_atom)
if(isliving(checked_atom))
var/mob/living/checked_living = checked_atom