Skip to content

Commit

Permalink
many more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DTraitor committed Aug 28, 2023
1 parent 7da48bd commit a51412f
Show file tree
Hide file tree
Showing 15 changed files with 267 additions and 339 deletions.
2 changes: 2 additions & 0 deletions code/game/objects/effects/decals/cleanable/humans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
bloodiness = BLOOD_AMOUNT_PER_DECAL
beauty = -100
clean_type = CLEAN_TYPE_BLOOD
//Default value from 1.0
biomass = 0.2
var/smell_type = /datum/component/smell/strong
var/should_dry = TRUE
var/dryname = "dried blood" //when the blood lasts long enough, it becomes dry and gets a new name
Expand Down
3 changes: 3 additions & 0 deletions code/modules/surgery/bodyparts/_bodyparts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
icon_state = "" //Leave this blank! Bodyparts are built using overlays
layer = BELOW_MOB_LAYER //so it isn't hidden behind objects when on the floor

//Default value from 1.0
biomass = 2

VAR_PRIVATE/icon/current_icon = null
VAR_PRIVATE/icon/current_aux_icon = null

Expand Down
2 changes: 2 additions & 0 deletions code/modules/surgery/organs/_organ.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
icon = 'icons/obj/surgery.dmi'
w_class = WEIGHT_CLASS_SMALL
throwforce = 0
//Default value from 1.0
biomass = 1
///The mob that owns this organ.
var/mob/living/carbon/owner = null
var/status = ORGAN_ORGANIC
Expand Down
4 changes: 1 addition & 3 deletions daedalus.dme
Original file line number Diff line number Diff line change
Expand Up @@ -4836,15 +4836,13 @@
#include "deadspace\code\necromorph\abilities\shoot.dm"
#include "deadspace\code\necromorph\abilities\shout.dm"
#include "deadspace\code\necromorph\abilities\slam.dm"
#include "deadspace\code\necromorph\abilities\swing.dm"
#include "deadspace\code\necromorph\abilities\taunt.dm"
#include "deadspace\code\necromorph\abilities\wallrun.dm"
#include "deadspace\code\necromorph\abilities\frenzy\frenzy_buff.dm"
#include "deadspace\code\necromorph\abilities\frenzy\frenzy_shout.dm"
#include "deadspace\code\necromorph\abilities\regenerate\passive_regenerate.dm"
#include "deadspace\code\necromorph\abilities\regenerate\regenerate.dm"
#include "deadspace\code\necromorph\abilities\swing\arm.dm"
#include "deadspace\code\necromorph\abilities\swing\helpers.dm"
#include "deadspace\code\necromorph\abilities\swing\swing.dm"
#include "deadspace\code\necromorph\bodyparts\bodyparts.dm"
#include "deadspace\code\necromorph\bodyparts\brute.dm"
#include "deadspace\code\necromorph\bodyparts\divider.dm"
Expand Down
35 changes: 21 additions & 14 deletions deadspace/code/marker/abilities/absorb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,42 @@
desc = "Absorbs all pieces of biological matter within a two tile radius of the target location. Only works on or near corruption, or in sight of the marker"
cost = 10

/datum/action/cooldown/necro/psy/absorb/PreActivate(turf/target, mob/camera/marker_signal/caller)
/datum/action/cooldown/necro/psy/absorb/PreActivate(turf/target)
var/mob/camera/marker_signal/caller = owner
target = get_turf(target)
if(!target)
return FALSE
if(target.necro_corrupted)
return ..()
if(IN_GIVEN_RANGE(target, caller.marker, 5) && can_see(target, caller.marker, 5))
return ..()
for(var/turf/neraby as anything in RANGE_TURFS(2, target))
if(neraby.necro_corrupted)
return ..()
if(IN_GIVEN_RANGE(target, caller.marker, 6) && can_see(target, caller.marker, 6))
return ..()
to_chat(target, span_warning("Biomass may only be claimed when the target is <b>near the marker, or corruption</b>"))
to_chat(caller, span_warning("Biomass may only be claimed when the target is <b>near the marker, or corruption</b>"))
return FALSE

/datum/action/cooldown/necro/psy/absorb/Activate(turf/target, mob/camera/marker_signal/caller)
/datum/action/cooldown/necro/psy/absorb/Activate(turf/target)
var/mob/camera/marker_signal/caller = owner
target = get_turf(target)
var/absorbed_biomass = 0
var/list/absorbed_atoms = list()
for(var/obj/item/item in view(2, target))
if(item.biomass)
absorbed_biomass += item.biomass
absorbed_atoms += item
if(item.reagents?.flags & OPENCONTAINER)
for(var/datum/reagent/consumable/reagent in item.reagents.reagent_list)
FOR_DVIEW(var/obj/thing, 2, target, INVISIBILITY_LIGHTING)
if(thing.biomass)
absorbed_biomass += thing.biomass
absorbed_atoms += thing
if(thing.is_drainable() || istype(thing, /obj/item/food))
for(var/datum/reagent/consumable/reagent in thing.reagents.reagent_list)
absorbed_biomass += reagent.nutriment_factor * NUTRIMENTS_TO_BIOMASS_MULTIPLIER
item.reagents.remove_reagent(reagent.type, reagent.volume)
thing.reagents.remove_reagent(reagent.type, reagent.volume)

//default value from 1.0
absorbed_biomass += thing.reagents.get_reagent_amount(/datum/reagent/blood) * 0.01

//If it is food and wasn't added to the list before
if(istype(item, /obj/item/food) && !item.biomass)
absorbed_atoms += item
if(!thing.biomass && istype(thing, /obj/item/food))
absorbed_atoms += thing
FOR_DVIEW_END

if(!absorbed_biomass)
to_chat(caller, span_warning("No things containing asborbable biomass found."))
Expand Down
4 changes: 2 additions & 2 deletions deadspace/code/necromorph/abilities/long_charge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
RegisterSignal(charger, COMSIG_MOVABLE_MOVED, PROC_REF(update_charging))
RegisterSignal(charger, COMSIG_ATOM_DIR_CHANGE, PROC_REF(on_dir_change))
if(verbose)
to_chat(charger, span_notice("We will charge when moving, now."))
to_chat(charger, span_notice("Now you will charge when moving."))

/datum/action/cooldown/necro/long_charge/proc/charge_off(verbose = TRUE)
var/mob/living/carbon/human/necromorph/charger = owner
if(charger.charging != CHARGE_OFF)
do_stop_momentum()
UnregisterSignal(charger, list(COMSIG_MOVABLE_MOVED, COMSIG_ATOM_DIR_CHANGE))
if(verbose)
to_chat(charger, span_notice("We will no longer charge when moving."))
to_chat(charger, span_notice("You will no longer charge when moving."))
valid_steps_taken = 0
charge_ability_on = FALSE

Expand Down
4 changes: 2 additions & 2 deletions deadspace/code/necromorph/abilities/slam.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
cooldown_time = 8 SECOND
var/atom/movable/user //The mob or thing doing the slam attack
var/turf/epicentre //The turf we've targeted with the slam
var/damage = 40 //Base damage dealt
var/damage = 40 //Base damage dealt
var/power = 1 //Used for damage to atoms
var/down_factor = 2 //Base damage is multiplied by this on lying targets
var/weaken_time = 3 //Number of life ticks victims are weakened (knocked down) for. A life tick is generally 1 second
Expand Down Expand Up @@ -44,7 +44,7 @@
if (owner.incapacitated())
return FALSE

. = ..()
return ..()

/datum/action/cooldown/necro/slam/Activate(atom/target)
StartCooldown()
Expand Down
165 changes: 165 additions & 0 deletions deadspace/code/necromorph/abilities/swing.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
/datum/action/cooldown/necro/swing
name = "Swing"
desc = "An arm swing pulling in all enemies it hits"
click_to_activate = TRUE
cooldown_time = 8 SECOND
var/swing_time = 1.5 SECONDS
var/move_time = 2 SECONDS
var/angle = 150
var/range = 3
var/visual_type = /obj/effect/temp_visual/swing
var/hitsound = 'sound/weapons/slice.ogg'
var/damage = 10
var/knockdown_time = 2 SECONDS
var/actively_moving = FALSE
var/turf/swing_target

/datum/action/cooldown/necro/swing/PreActivate(atom/target)
if(owner.incapacitated())
return FALSE
if(!get_turf(target))
return FALSE

return ..()

/datum/action/cooldown/necro/swing/Activate(atom/target)
StartCooldown()
target = get_turf(target)
owner.face_atom(target)

var/datum/move_loop/new_loop = SSmove_manager.move_towards(owner, target, 1.6, FALSE, 0.25 SECONDS)
if(!new_loop)
return TRUE

actively_moving = FALSE
swing_target = target
windup()
RegisterSignal(owner, COMSIG_MOVABLE_PRE_MOVE, PROC_REF(on_move))
RegisterSignal(new_loop, COMSIG_MOVELOOP_PREPROCESS_CHECK, PROC_REF(pre_move))
RegisterSignal(new_loop, COMSIG_MOVELOOP_POSTPROCESS, PROC_REF(post_move))
RegisterSignal(new_loop, COMSIG_MOVELOOP_STOP, PROC_REF(loop_end))
return TRUE

/datum/action/cooldown/necro/swing/proc/windup()
var/cached_pixel_x = owner.pixel_x
var/cached_pixel_y = owner.pixel_y

animate(
owner,
pixel_x = owner.pixel_x + (SIGN(swing_target.x - owner.x) * -24),
pixel_y = owner.pixel_y + (SIGN(swing_target.y - owner.y) * -24),
time = 0.25 SECONDS,
easing = BACK_EASING
)
animate(pixel_x = cached_pixel_x, pixel_y = cached_pixel_y, time = 0.5 SECONDS, easing = BACK_EASING)

/datum/action/cooldown/necro/swing/proc/pre_move()
SIGNAL_HANDLER
actively_moving = TRUE

/datum/action/cooldown/necro/swing/proc/post_move()
SIGNAL_HANDLER
actively_moving = FALSE

/datum/action/cooldown/necro/swing/proc/on_move()
SIGNAL_HANDLER
if(!actively_moving)
return COMPONENT_BLOCK_MOVEMENT

/datum/action/cooldown/necro/swing/proc/loop_end()
SIGNAL_HANDLER
UnregisterSignal(owner, COMSIG_MOVABLE_PRE_MOVE, PROC_REF(on_move))
INVOKE_ASYNC(src, PROC_REF(swing))

/datum/action/cooldown/necro/swing/proc/swing()
ADD_TRAIT(owner, TRAIT_IMMOBILIZED, src)

//Calculate cone that we will hit
var/turf/our_loc = get_turf(owner)

var/angle_to_target = ATAN2(swing_target.x - our_loc.x, swing_target.y - our_loc.y)
var/smallest_angle = SIMPLIFY_DEGREES(angle_to_target - (angle / 2))
var/biggest_angle = SIMPLIFY_DEGREES(angle_to_target + (angle / 2))

var/list/list/stages[ROUND_UP(angle/30)]

for(var/i=1 to length(stages))
stages[i] = list()

for(var/turf/T as anything in RANGE_TURFS(range, our_loc)-our_loc)
var/angle_to_turf = SIMPLIFY_DEGREES(ATAN2(T.x - our_loc.x, T.y - our_loc.y))
if(angle_to_turf >= smallest_angle && angle_to_turf <= biggest_angle && get_dist_euclidian(our_loc, T) <= range)
stages[ROUND_UP(SIMPLIFY_DEGREES(angle_to_turf - smallest_angle)/30)] += T

// 1 is right, -1 is left
var/hand_modifier = (owner.active_hand_index % 2) ? - 1 : 1

execute_swing(stages, hand_modifier, ((hand_modifier > -1) ? biggest_angle : smallest_angle) * -1)

REMOVE_TRAIT(owner, TRAIT_IMMOBILIZED, src)

/datum/action/cooldown/necro/swing/proc/execute_swing(list/list/stages, hand_modifier, starting_degree)
var/sleep_time = swing_time/length(stages)
var/turf/our_loc = get_turf(owner)

var/obj/effect/visual_effect = new visual_type(our_loc, swing_time, angle, hand_modifier, starting_degree)

for(var/list/stage as anything in stages)
var/list/to_check = stage.Copy()
while(length(to_check))
var/turf/turf_to_check = to_check[1]
var/list/line = get_line(our_loc, turf_to_check)
to_check -= line
var/turf/previous_turf = our_loc
for(var/turf/T as anything in line)
if(!T.CanPass(visual_effect, get_dir(previous_turf, T)))
break
line -= T
previous_turf = T

stage -= line

for(var/turf/T as anything in stage)
hit_turf(T)

sleep(sleep_time)

/datum/action/cooldown/necro/swing/proc/hit_turf(turf/T)
for(var/mob/living/L in T)
hit_mob(L)

/datum/action/cooldown/necro/swing/proc/hit_mob(mob/living/L)
//Shouldn't happen, but I'd rather be safe than sorry
if(L == owner)
return

L.Knockdown(knockdown_time)
L.apply_damage(damage, BRUTE, owner.zone_selected)
playsound(L, hitsound, VOLUME_MID, TRUE)
return TRUE

/obj/effect/temp_visual/swing
name = "tentacle"
icon = 'deadspace/icons/necromorphs/swinging_limbs.dmi'
base_icon_state = "harvester_tentacle"
icon_state = "harvester_tentacle"
randomdir = FALSE
//Centered for hunter
pixel_x = -40
pixel_y = -32
var/variable_icon = FALSE

/obj/effect/temp_visual/swing/Initialize(mapload, duration, angle, swing_direction, starting_degree)
src.duration = duration
if(variable_icon)
icon_state = base_icon_state + ((swing_direction > -1) ? "_left" : "_right")
// Icons are actually at -90 degrees
transform = transform.Turn(starting_degree + 90)
. = ..()
var/turn_angle = angle * swing_direction * 1.1
animate(src, duration, transform = transform.Turn(turn_angle), easing = CIRCULAR_EASING)
playsound(src, pick(
'deadspace/sound/effects/attacks/big_swoosh_1.ogg',
'deadspace/sound/effects/attacks/big_swoosh_2.ogg',
'deadspace/sound/effects/attacks/big_swoosh_3.ogg',
), VOLUME_MID, 1)
67 changes: 0 additions & 67 deletions deadspace/code/necromorph/abilities/swing/arm.dm

This file was deleted.

Loading

0 comments on commit a51412f

Please sign in to comment.