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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPR Buddy 9000 #7092

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3c82deb
CPR Buddy 9000
HIDgamer Sep 3, 2024
5cfd524
Idle message and medical facts list fix.
HIDgamer Sep 3, 2024
d135e66
Garbage Collection
HIDgamer Sep 3, 2024
d3f4404
fixed indents
HIDgamer Sep 3, 2024
682a229
Code update
HIDgamer Sep 4, 2024
ea30948
Major code refinement and updates.
HIDgamer Sep 8, 2024
b9e4ce1
Merge branch 'cmss13-devs:master' into master
HIDgamer Sep 8, 2024
642561c
Updates and Bug fixes
HIDgamer Sep 9, 2024
ded3760
CPRbot sound update.
HIDgamer Sep 9, 2024
6e5aae0
Merge branch 'master' into master
HIDgamer Sep 9, 2024
f130138
Merge branch 'master' into master
HIDgamer Sep 9, 2024
9d7f9b5
CPR warning
HIDgamer Sep 10, 2024
b917f99
Merge branch 'master' into master
HIDgamer Sep 10, 2024
ae2f9af
Merge branch 'master' into master
HIDgamer Sep 11, 2024
4aac004
Minor tweaks
HIDgamer Sep 12, 2024
90bc2cf
Merge branch 'master' into master
HIDgamer Sep 13, 2024
1ad467d
Merge branch 'master' into master
HIDgamer Sep 13, 2024
c7d9310
Merge branch 'cmss13-devs:master' into master
HIDgamer Sep 14, 2024
75e732c
Merge branch 'cmss13-devs:master' into master
HIDgamer Sep 15, 2024
d0c4f34
Merge branch 'cmss13-devs:master' into master
HIDgamer Sep 17, 2024
73b02b4
Merge branch 'cmss13-devs:master' into master
HIDgamer Sep 18, 2024
d8f0a38
Merge branch 'cmss13-devs:master' into master
HIDgamer Sep 20, 2024
0827dae
minor tweaks
HIDgamer Sep 21, 2024
7244c1e
AI pathfinding update
HIDgamer Sep 21, 2024
65903b9
fixing taps
HIDgamer Sep 21, 2024
26b3046
Merge branch 'cmss13-devs:master' into master
HIDgamer Sep 26, 2024
5a71c0a
Pathfinding tweaks
HIDgamer Sep 26, 2024
56d6159
Merge branch 'master' of https://github.com/HIDgamer/cmss13
HIDgamer Sep 26, 2024
48feafa
Merge branch 'cmss13-devs:master' into master
HIDgamer Sep 29, 2024
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
509 changes: 509 additions & 0 deletions code/game/machinery/bots/cprbot.dm

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions code/game/machinery/vending/vendor_types/crew/synthetic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ GLOBAL_LIST_INIT(cm_vending_synth_tools, list(
list("Maintenance Jack", 15, /obj/item/maintenance_jack, null, VENDOR_ITEM_REGULAR),
list("Portable Dialysis Machine", 15, /obj/item/tool/portadialysis, null, VENDOR_ITEM_REGULAR),
list("Telescopic Baton", 15, /obj/item/weapon/telebaton, null, VENDOR_ITEM_REGULAR),
list("CPR Buddy 9k", 15, /obj/item/cprbot_item, null, VENDOR_ITEM_REGULAR),
))

//------------EXPERIMENTAL TOOL KITS---------------
Expand Down
112 changes: 112 additions & 0 deletions code/game/objects/items/cprbot.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
/obj/item/cprbot_item
name = "CPRbot"
desc = "A compact CPRbot 9000 assembly"
icon = 'icons/obj/structures/machinery/aibots.dmi'
icon_state = "cprbot"
w_class = SIZE_MEDIUM
var/deployment_path = /obj/structure/machinery/bot/cprbot

/obj/item/cprbot_item/attack_self(mob/user as mob)
if (..())
return TRUE

if(user)
deploy_cprbot(user, user.loc)

/obj/item/cprbot_item/proc/deploy_cprbot(mob/user, atom/location)
if(!user || !location)
return

if (istype(user) && !skillcheck(user, SKILL_MEDICAL, SKILL_MEDICAL_MEDIC))
to_chat(user, SPAN_WARNING("You don't seem to know how to use [src]..."))
return

qdel(src)

// Proceed with the CPRbot deployment
var/obj/structure/machinery/bot/cprbot/cprbot_entity = new deployment_path(location)
if(cprbot_entity)
cprbot_entity.add_fingerprint(user)
cprbot_entity.owner = user

/obj/item/cprbot_item/afterattack(atom/target, mob/user, proximity)
if(proximity && isturf(target))
var/turf/target_turf = target
if(!target_turf.density)
deploy_cprbot(user, target_turf)

/obj/item/cprbot_broken
name = "CPRbot"
desc = "A compact CPRbot 9000 assembly, it appears to be in bad shape"
icon = 'icons/obj/structures/machinery/aibots.dmi'
icon_state = "cprbot_broken"
w_class = SIZE_MEDIUM

/obj/item/cprbot_broken/attackby(obj/item/attacked_by, mob/living/user)
if(iswelder(attacked_by))
if(!HAS_TRAIT(attacked_by, TRAIT_TOOL_BLOWTORCH))
to_chat(user, SPAN_WARNING("You need a stronger blowtorch!"))
return

var/obj/item/tool/weldingtool/welder_tool = attacked_by
if(!welder_tool.isOn())
to_chat(user, SPAN_WARNING("The [welder_tool] needs to be on!"))
return

if(!welder_tool.remove_fuel(5, user)) // Ensure the welder has enough fuel to operate
to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task."))
return

playsound(src, 'sound/items/Welder.ogg', 25, 1)

if(!do_after(user, 10 * user.get_skill_duration_multiplier(SKILL_CONSTRUCTION), INTERRUPT_ALL | BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD))
return

var/obj/item/cprbot_item/new_cprbot_item = new /obj/item/cprbot_item(src.loc)

if(user)
if(!user.put_in_active_hand(new_cprbot_item))
if(!user.put_in_inactive_hand(new_cprbot_item))
new_cprbot_item.forceMove(src.loc)
else
new_cprbot_item.forceMove(src.loc)

/obj/item/cprbot_broken/attackby(obj/item/attacked_by, mob/living/user)
if(iswelder(attacked_by))
if(!HAS_TRAIT(attacked_by, TRAIT_TOOL_BLOWTORCH))
to_chat(user, SPAN_WARNING("You need a stronger blowtorch!"))
return

var/obj/item/tool/weldingtool/welder_tool = attacked_by
if(!welder_tool.isOn())
to_chat(user, SPAN_WARNING("The [welder_tool] needs to be on!"))
return

if(!welder_tool.remove_fuel(5, user)) // Ensure enough fuel is available
to_chat(user, SPAN_NOTICE("You need more welding fuel to complete this task."))
return

playsound(src, 'sound/items/Welder.ogg', 25, 1)

if(!do_after(user, 10 * user.get_skill_duration_multiplier(SKILL_CONSTRUCTION), INTERRUPT_ALL | BEHAVIOR_IMMOBILE, BUSY_ICON_BUILD))
return

// Create the repaired item
var/obj/item/cprbot_item/repaired_cprbot_item = new /obj/item/cprbot_item(src.loc)

// Check if the broken item is in the user's hand
var/hand_was_active = user.get_active_hand() == src
var/hand_was_inactive = user.get_inactive_hand() == src

// Remove the broken item
qdel(src)

// Attempt to place the new item into the user's hands
if (hand_was_active)
if (!user.put_in_active_hand(repaired_cprbot_item))
repaired_cprbot_item.forceMove(user.loc) // Place it at user's location if hands are full
else if (hand_was_inactive)
if (!user.put_in_inactive_hand(repaired_cprbot_item))
repaired_cprbot_item.forceMove(user.loc) // Place it at user's location if hands are full
else
repaired_cprbot_item.forceMove(user.loc) // Place at the original location if not in hand
2 changes: 2 additions & 0 deletions colonialmarines.dme
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,7 @@
#include "code\game\machinery\atmoalter\scrubber.dm"
#include "code\game\machinery\bots\bots.dm"
#include "code\game\machinery\bots\cleanbot.dm"
#include "code\game\machinery\bots\cprbot.dm"
#include "code\game\machinery\bots\floorbot.dm"
#include "code\game\machinery\bots\medbot.dm"
#include "code\game\machinery\bots\mulebot.dm"
Expand Down Expand Up @@ -1090,6 +1091,7 @@
#include "code\game\objects\items\contraband.dm"
#include "code\game\objects\items\cosmetics.dm"
#include "code\game\objects\items\cpr_dummy.dm"
#include "code\game\objects\items\cprbot.dm"
#include "code\game\objects\items\disks.dm"
#include "code\game\objects\items\fulton.dm"
#include "code\game\objects\items\gift_wrappaper.dm"
Expand Down
Binary file modified icons/obj/structures/machinery/aibots.dmi
Binary file not shown.
Binary file added sound/CPRbot/CPR.ogg
Binary file not shown.
Binary file added sound/CPRbot/CPRbot_beep.ogg
Binary file not shown.
Binary file added sound/CPRbot/CPRbot_poweroff.ogg
Binary file not shown.
Binary file added sound/CPRbot/CPRbot_poweron.ogg
Binary file not shown.
Loading