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

Merged
merged 61 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 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
f970efa
Merge branch 'cmss13-devs:master' into master
HIDgamer Oct 3, 2024
b05421f
Merge branch 'cmss13-devs:master' into master
HIDgamer Oct 10, 2024
a3ada23
Merge branch 'cmss13-devs:master' into master
HIDgamer Oct 26, 2024
f880052
Merge branch 'cmss13-devs:master' into master
HIDgamer Oct 28, 2024
ee200fd
Merge branch 'cmss13-devs:master' into master
HIDgamer Nov 22, 2024
e6e85bb
Merge branch 'cmss13-devs:master' into master
HIDgamer Dec 3, 2024
fb1fbf9
Temp_Christmas_Hat
HIDgamer Dec 6, 2024
ee27761
Merge branch 'cmss13-devs:master' into master
HIDgamer Dec 6, 2024
114ed52
Revert "Temp_Christmas_Hat"
HIDgamer Dec 6, 2024
8b2e95f
Merge branch 'cmss13-devs:master' into master
HIDgamer Dec 8, 2024
059c21b
Merge branch 'cmss13-devs:master' into master
HIDgamer Dec 13, 2024
4d708f5
Merge branch 'cmss13-devs:master' into master
HIDgamer Dec 19, 2024
46824dc
cleaning the code
HIDgamer Dec 21, 2024
f4f8399
more code cleaning.
HIDgamer Dec 21, 2024
140d773
Merge branch 'cmss13-devs:master' into master
HIDgamer Dec 21, 2024
6f952b3
Further code cleaning
HIDgamer Dec 22, 2024
115a5d0
more cleaning
HIDgamer Dec 22, 2024
3e0723b
Merge branch 'master' into master
HIDgamer Dec 22, 2024
095445a
Even more code cleaning.
HIDgamer Dec 23, 2024
556aeca
Merge branch 'master' into master
HIDgamer Dec 23, 2024
095d949
Merge branch 'master' into master
HIDgamer Dec 23, 2024
7c77798
Update code/game/machinery/bots/cprbot.dm
kiVts Dec 24, 2024
dcc3b97
Update code/game/machinery/bots/cprbot.dm
kiVts Dec 24, 2024
93514e1
Update code/game/machinery/bots/cprbot.dm
kiVts Dec 24, 2024
cb6f8a1
Update code/game/objects/items/cprbot.dm
kiVts Dec 24, 2024
1e8e457
Merge branch 'master' into master
kiVts Dec 24, 2024
6c9f76e
renamed file.
HIDgamer Dec 24, 2024
15385ad
renamed 2
HIDgamer Dec 24, 2024
eb4174a
renamed 3
HIDgamer Dec 24, 2024
c115453
Update code/game/machinery/bots/cprbot.dm
kiVts Dec 24, 2024
84da7f0
Merge branch 'master' into master
HIDgamer Dec 24, 2024
36095d5
removed from the coin vendor.
HIDgamer Dec 24, 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
485 changes: 485 additions & 0 deletions code/game/machinery/bots/cprbot.dm

Large diffs are not rendered by default.

112 changes: 112 additions & 0 deletions code/game/objects/items/cprbot_item.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(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(loc)
else
new_cprbot_item.forceMove(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(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 @@ -917,6 +917,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 @@ -1114,6 +1115,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_item.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