Skip to content

Commit

Permalink
bugfix: runtimes and implanter fix (#5947)
Browse files Browse the repository at this point in the history
* some meowfixes

* QDELETEB to QDELETED roflcat
  • Loading branch information
Antoonij authored Sep 26, 2024
1 parent 359eecc commit 8fc0a3d
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 16 deletions.
18 changes: 18 additions & 0 deletions code/datums/components/eatable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
)
if(!isitem(parent))
return COMPONENT_INCOMPATIBLE

src.current_bites = current_bites
src.material_type = material_type
src.max_bites = max_bites
Expand All @@ -55,20 +56,26 @@

if(material_type & human.dna.species.special_diet)
examine_list += "Вкуснятина! [is_only_grab_intent ? "\nНужно аккуратно есть." : ""]"

if(!isstack(parent))
examine_list += get_bite_info()

/datum/component/eatable/proc/get_bite_info()
var/text
var/bites_split = max_bites > 3 ? round(max_bites / 4) : 1

if(current_bites >= 1 && current_bites <= bites_split)
text = "Выглядит покусанным..."

else if(current_bites >= bites_split && current_bites <= (bites_split * 2))
text = "Видны оторванные части..."

else if((current_bites >= bites_split * 2) && current_bites <= (bites_split * 3))
text = "Видна внутренняя часть..."

else if((current_bites >= bites_split * 3))
text = "Осталась одна труха..."

return text

/datum/component/eatable/proc/item_string_material()
Expand All @@ -89,13 +96,16 @@

if(!istype(target))
return FALSE

if(!(material_type & target.dna.species.special_diet) && !is_always_eatable)
return FALSE

if(is_only_grab_intent && user.a_intent != INTENT_GRAB)
return FALSE

target.changeNext_move(CLICK_CD_MELEE)
INVOKE_ASYNC(src, PROC_REF(try_eat_item), target, user)

return COMPONENT_CANCEL_ATTACK_CHAIN

/datum/component/eatable/proc/try_eat_item(mob/living/carbon/human/target, mob/user)
Expand All @@ -121,11 +131,13 @@
if(target != user)
if(!forceFed(target, user, FALSE, NONE))
return FALSE

to_chat(target, span_notice("[chat_message_to_target]"))
add_attack_logs(user, item, "Force Fed [target], item [item]")

if(!isstack(item))
to_chat(user, span_notice("[chat_message_to_user]"))

eat(target, user)
return

Expand All @@ -135,6 +147,7 @@
playsound(target.loc, 'sound/items/eatfood.ogg', 50, FALSE)
if(!isvampire(target)) //Dont give nutrition to vampires
target.adjust_nutrition(nutritional_value)

SSticker.score.score_food_eaten++

if(isstack(item))
Expand Down Expand Up @@ -163,12 +176,17 @@
/datum/component/eatable/proc/get_colour()
var/bites_split = max_bites > 3 ? round(max_bites / 4) : 1
var/colour

if(current_bites >= 1 && current_bites <= bites_split)
colour = "#d9e0e7ff"

else if(current_bites >= bites_split && current_bites <= (bites_split * 2))
colour = "#b7c3ccff"

else if((current_bites >= bites_split * 2) && current_bites <= (bites_split * 3))
colour = "#929eabff"

else if((current_bites >= bites_split * 3))
colour = "#697581ff"

return colour
3 changes: 3 additions & 0 deletions code/game/objects/items/devices/voice.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
switch(mimic_option)
if("Real Voice")
var/mob/living/carbon/human/human = input(user, "Select a voice to copy from.", "Set Voice Changer") in GLOB.human_list
if(!human)
return

mimic_voice = human.real_name
mimic_voice_tts = human.dna.tts_seed_dna
if("Custom Voice")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@
/obj/item/implanter/add_eatable_component()
AddComponent( \
/datum/component/eatable, \
is_only_grab_intent = TRUE, \
material_type = MATERIAL_CLASS_TECH, \
nutritional_value = 15, \
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -572,22 +572,29 @@ Difficulty: Very Hard
return

/mob/living/simple_animal/hostile/megafauna/ancient_robot/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
if(movement_dir)
leg_walking_controler(movement_dir)
if(charging)
if(mode == PYRO)
var/turf/C = get_turf(src)
new /obj/effect/temp_visual/lava_warning(C, enraged ? 18 SECONDS : 6 SECONDS)
for(var/turf/T in range (1,src))
new /obj/effect/hotspot(T)
T.hotspot_expose(700,50,1)
if(mode == VORTEX)
var/turf/T = get_turf(src)
for(var/atom/A in T)
A.ex_act(3) //Body is immune to explosions of this strength.
T.ex_act(3)

beam.forceMove(get_turf(src))
if(!movement_dir)
return ..()

leg_walking_controler(movement_dir)
if(!charging)
return ..()

switch(mode)
if(PYRO)
var/turf/C = get_turf(src)
new /obj/effect/temp_visual/lava_warning(C, enraged ? 18 SECONDS : 6 SECONDS)
for(var/turf/T in range (1,src))
new /obj/effect/hotspot(T)
T.hotspot_expose(700,50,1)
if(VORTEX)
var/turf/T = get_turf(src)
for(var/atom/A in T)
A.ex_act(3) //Body is immune to explosions of this strength.
T.ex_act(3)

if(beam && !QDELETED(beam))
beam.forceMove(get_turf(src))

return ..()


Expand Down

0 comments on commit 8fc0a3d

Please sign in to comment.