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

A very strange roomba. #523

Open
wants to merge 58 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
bde259d
A durable roomba that floats after turning on combat mode. That's it.
Constellado Jul 5, 2024
27c3343
Dang! it very much prioritises cleaning over picking things up. As it…
Constellado Jul 6, 2024
9d970a6
some vroomba sounds
Constellado Jul 21, 2024
0ced948
actually fixes Volkan's shoulder companions space issue!! for real th…
Constellado Jul 30, 2024
f47ec40
Merge branch 'MrMelbert:master' into Vroomba
Constellado Jul 30, 2024
7231b0f
it can pick stuff up and (not intentional) steal things into the void…
Constellado Jul 30, 2024
71d2810
Merge branch 'Vroomba' of https://github.com/Constellado/MapleStation…
Constellado Jul 30, 2024
4f34ee6
undoing a change I accidentally did to a file I was not touching
Constellado Jul 30, 2024
669f283
trying to fix bug and making this more modular.
Constellado Jul 30, 2024
b49ddae
should be fully modular OK?
Constellado Jul 30, 2024
ccecfc2
attempting to fix bug
Constellado Jul 30, 2024
46f6eed
starting to code special abilities from scratch. wish me luck.
Constellado Aug 1, 2024
4c2be44
Tractor field comonent start...
Constellado Aug 1, 2024
0ce1bbf
linters!
Constellado Aug 1, 2024
3ed2403
THROWINGGGG HYAA!
Constellado Aug 1, 2024
11ca87a
Finished...?
Constellado Aug 1, 2024
3eca413
undo changes i did to telekinesis.dm
Constellado Aug 1, 2024
bef388a
okeeeee!
Constellado Aug 1, 2024
363ea46
all done. coding god?
Constellado Aug 1, 2024
4d7a899
moving stuff
Constellado Aug 1, 2024
6da5ee5
final final really.
Constellado Aug 1, 2024
96c5299
Merge branch 'MrMelbert:master' into master
Constellado Aug 2, 2024
fdd2f52
Merge branch 'MrMelbert:master' into Vroomba
Constellado Aug 2, 2024
a51c4e3
Merge branch 'MrMelbert:master' into master
Constellado Aug 23, 2024
12fe6b4
Merge branch 'MrMelbert:master' into Vroomba
Constellado Aug 23, 2024
66decbc
updated sounds to OGG
Constellado Aug 25, 2024
3df4dfb
Update maplestation_modules/story_content/volkan_equipment/code/volka…
Constellado Aug 25, 2024
ad727b1
Some more code review stuff. More needs to be done
Constellado Aug 25, 2024
789446b
Merge branch 'master' of https://github.com/Constellado/MapleStationCode
Constellado Sep 17, 2024
8f0ebbd
Merge branch 'master' into Vroomba
Constellado Sep 25, 2024
7a637cc
moves stuff in dme around
Constellado Sep 25, 2024
186ab7e
a sprite for the tractor field tech
Constellado Sep 25, 2024
279a434
A special drop! 50 percent drop chance.
Constellado Sep 25, 2024
ea25d23
Working part functionality.
Constellado Sep 25, 2024
ed6a49b
updates the attack to throw the target the direction you are facing i…
Constellado Sep 25, 2024
aed8f00
You better be a machine to use the special drop.
Constellado Sep 25, 2024
1303364
effects
Constellado Sep 25, 2024
b67c9be
linter hates capital letters.
Constellado Sep 25, 2024
6f7fe15
hats!!!
Constellado Sep 25, 2024
d2bde2d
stuff. hat offsets needs work still.
Constellado Sep 25, 2024
34ec30e
cant change hat offset on the fly so I will do a compromise
Constellado Sep 25, 2024
924b2ca
removes a empty line
Constellado Sep 25, 2024
9d5cd62
fix?
Constellado Sep 25, 2024
7c4a633
why can medbots have it but not me
Constellado Sep 25, 2024
d3f4cca
improve the "broken" fractor field attack
Constellado Sep 25, 2024
bda8a8a
typo
Constellado Sep 25, 2024
78e8892
remove hat signals or something idk im just doing what melbert told m…
Constellado Sep 26, 2024
7854fd2
medbot non module change...
Constellado Sep 26, 2024
56a57bf
fuck it
Constellado Sep 26, 2024
225dcf6
oops
Constellado Sep 26, 2024
a3b0da4
Merge branch 'master' into Vroomba
Constellado Sep 30, 2024
12171d6
Merge branch 'master' into Vroomba
Constellado Sep 30, 2024
31362ea
Roomba nerf
Constellado Sep 30, 2024
8f88268
The roomba can attack mobs now
Constellado Oct 21, 2024
a5345e2
a better way to do the roomba attack
Constellado Oct 21, 2024
daa3869
increases the roombas tractorfield force
Constellado Oct 21, 2024
a27d4bd
New vroomba sprite
Constellado Dec 1, 2024
dfc95c2
removes those TODOs, they were done already.
Constellado Dec 1, 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
2 changes: 2 additions & 0 deletions code/__DEFINES/DNA.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
#define ORGAN_SLOT_STOMACH "stomach"
#define ORGAN_SLOT_STOMACH_AID "stomach_aid"
#define ORGAN_SLOT_THRUSTERS "thrusters"
#define ORGAN_SLOT_TRACTOR_FIELD "tractor_field" // NON-MODULE CHANGE
#define ORGAN_SLOT_TONGUE "tongue"
#define ORGAN_SLOT_VOICE "vocal_cords"
#define ORGAN_SLOT_ZOMBIE "zombie_infection"
Expand Down Expand Up @@ -149,6 +150,7 @@ GLOBAL_LIST_INIT(organ_process_order, list(
ORGAN_SLOT_HEART,
ORGAN_SLOT_ZOMBIE,
ORGAN_SLOT_THRUSTERS,
ORGAN_SLOT_TRACTOR_FIELD, // NON-MODULE CHANGE
ORGAN_SLOT_HUD,
ORGAN_SLOT_LIVER,
ORGAN_SLOT_TONGUE,
Expand Down
1 change: 1 addition & 0 deletions maplestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -6530,6 +6530,7 @@
#include "maplestation_modules\story_content\story_posters\code\contraband.dm"
#include "maplestation_modules\story_content\stranger_equipment\code\strangerclothing.dm"
#include "maplestation_modules\story_content\volkan_equipment\code\sunitems.dm"
#include "maplestation_modules\story_content\volkan_equipment\code\volkancomponents.dm"
#include "maplestation_modules\story_content\volkan_equipment\code\volkanitems.dm"
#include "maplestation_modules\story_content\volkan_equipment\code\volkanpets.dm"
#include "maplestation_modules\story_content\volkan_equipment\code\volkanpets_ai.dm"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
bot_startup.ogg is a snippet from https://freesound.org/people/wtermini/sounds/546450/
1) bot_startup.ogg is a snippet from https://freesound.org/people/wtermini/sounds/546450/

2) All vroomba sounds were created by Constellado with Beepbox.co (yes. really.)
This has the instruments all set up for it if you want to use it to add more vroomba noises:
https://www.beepbox.co/#9n21sbk0l00e00t43a7g00j07r1i0o43T0v0u00f10u2qw02d03w5h0E0T1v0u01f0qw03d03A0F0BfQ0000PffffE0T3v0u03f0qw00d03SUUM0A060n0U07M0E0b4hp140000
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
/*
* # Components for Volkan pets or others!
* This file has a bunch of components as well as various things like HUDs and things like that.
* Ones not named for a specific mob is made to be used in more than one mob. Maybe.
*/

///signal for the vroomba's tools to know if it is in combat mode
#define COMSIG_COMBAT_MODE "combat_mode_active"

/*
* # Tractor field component
* A very important and complicated piece of Vtech (Volkan and Co technology).
* Invented by CaLE, based on gravity generators.
* In game it will basically act like telekinesis.
* Add it to a mob if the mob has tractor field Vtech inside.
*/

///A piece of Vtech. Like a tractor beam, but its a whole field around the object instead.
/datum/component/tractorfield
///the maximum range the tractorfield has influence over
var/max_range = 6
///the damage the tractor field does when doing a force attack. Shouldn't be not much damage.
var/damage = 5
///The pushing force does the tractor field has.
var/force = 4

///Stuff tractor field cannot interact with
var/static/list/blacklisted_atoms = typecacheof(list(/atom/movable/screen))

/datum/component/tractorfield/RegisterWithParent()
RegisterSignal(parent, COMSIG_MOB_ATTACK_RANGED, PROC_REF(on_ranged_attack))
RegisterSignal(parent, COMSIG_LIVING_UNARMED_ATTACK, PROC_REF(on_unarmed_attack))


/datum/component/tractorfield/UnregisterFromParent()
UnregisterSignal(parent, list(COMSIG_MOB_ATTACK_RANGED,COMSIG_LIVING_UNARMED_ATTACK))


///Checks if clicked on item is in tractor field's influence.
/datum/component/tractorfield/proc/tractorRangeCheck(mob/user, atom/target)
var/d = get_dist(user, target)
if(d > max_range)
user.balloon_alert(user, "can't lift, too far!")
return
return TRUE

///Same as /datum/component/tractorfield/proc/tractorRangeCheck() but for the telekinetic grab object instead.
/obj/item/tk_grab/tractor/proc/tractorRangeCheck(mob/user, atom/target) //Melbert if you know how to combine this with above one plz tell me. It works though.
var/d = get_dist(user, target)
if(d > max_range)
user.balloon_alert(user, "can't move, too far!")
return
return TRUE
Constellado marked this conversation as resolved.
Show resolved Hide resolved

///Manages all the stuff a tractor field can do from a distance.
/datum/component/tractorfield/proc/on_ranged_attack(mob/source, atom/target, src)
SIGNAL_HANDLER
if(is_type_in_typecache(target, blacklisted_atoms))
return
if(!tractorRangeCheck(source, target) || source.z != target.z)
return
if(ismob(target)) //atacking mobs
return target.attack_tractor(source, target, damage, force)
if(isitem(target))
return tractor_grab(source, target)
return on_unarmed_attack(source, target, TRUE)

//Grabs the item with the tractor field at a distance
/datum/component/tractorfield/proc/tractor_grab(mob/user, target)
var/obj/item/tk_grab/tractor/O = new(target)
O.tk_user = user
O.max_range = max_range + force //it can throw things just a little bit further than it can pick up
if(!O.focus_object(target))
return
INVOKE_ASYNC(O, TYPE_PROC_REF(/atom, attack_hand), user)
return COMPONENT_CANCEL_ATTACK_CHAIN
Comment on lines +75 to +76
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, if it fails to TK then it forces an attack_hand?

That seems very prone to causing bugs (off the top of my head you can click on any target out of range to interact with it, because out of range -> focus fails, which in turn means you can teleport stuff from across the room)

Copy link
Contributor Author

@Constellado Constellado Aug 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's so it can open doors and such if it cannot lift the object. Is there something else i can call for it to be able to do that?

EDIT: I got confused, this is the thing that actually makes the telekinesis work in the first place. If I do not have it, it cannot lift up objects telekinetically. The on_unarmed_attack proc is the one for doors, not this one.

Something similar is in the actual telekinesis code as well, so that is why it is here. I forgot the exaaact reason for it though.

As of right now, it cannot pick up items that is out of range due to a bunch of checks.

Unless you mean the COMPONENT_CANCEL_ATTACK_CHAIN part? I thought that cancels the attack chain. Did I misunderstand how that works?


///Tractor Field's "Telekinetic" grab object
/obj/item/tk_grab/tractor
name = "Tractor Field Grab"
desc = "Lifting things with complex gravity technology"

///The speed the tractor field moves things at.
var/speed = 6
///The maximum range a tractor field can move an object
var/max_range = 7

/obj/item/tk_grab/tractor/focus_object(obj/target)
if(!check_if_focusable(target))
return
focus = target
ADD_TRAIT(focus, TRAIT_TELEKINESIS_CONTROLLED, REF(tk_user))
update_appearance()
apply_focus_overlay()
return TRUE

/obj/item/tk_grab/tractor/check_if_focusable(obj/target)
if(!tk_user || QDELETED(target) || !istype(target))
qdel(src)
return
if(!tractorRangeCheck(tk_user, target) || target.anchored || !isturf(target.loc))
qdel(src)
return
return TRUE

/obj/item/tk_grab/tractor/afterattack(atom/target, mob/user, proximity, params)
. = ..()
move_object(user, target)

///Moving an object around
/obj/item/tk_grab/tractor/proc/move_object(mob/user, atom/target)
if(!focus)
return
if(!tractorRangeCheck(user, target))
return
apply_focus_overlay()
focus.throw_at(get_turf(target), 10, speed, thrower = user)
var/turf/start_turf = get_turf(focus)
var/turf/end_turf = get_turf(target)
user.log_message("has thrown [focus] from [AREACOORD(start_turf)] towards [AREACOORD(end_turf)] using a tractor field!", LOG_ATTACK)
update_appearance()

/// Interact with items at range. replaces on_unarmed_attack.
/datum/component/tractorfield/proc/on_unarmed_attack(mob/living/hand_haver, atom/target, proximity, modifiers)
SIGNAL_HANDLER
if (!proximity && target.loc != hand_haver)
var/obj/item/obj_item = target
if (istype(obj_item) && !obj_item.atom_storage && !(obj_item.item_flags & IN_STORAGE))
return NONE
Comment on lines +123 to +129
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little confused what's going on here exactly, I think this code is to make unarmed_attack call attack_hand?

Have you tried looking into resolve_unarmed_attack? It might cover this for you

Copy link
Contributor Author

@Constellado Constellado Aug 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is called so it can interact with doors and lockers and whatnot at range.

Its because the mobs that can get the tractor field component doesn't actually have a on_unarmed_attack. I tried to use resolve_unarmed_attack but that just made the Vroomba attack itself when I clicked on a door. doors do not have a resolve_unarmed_attack so I cannot call it on that either...

Maybe I am just confused.

if (LAZYACCESS(modifiers, RIGHT_CLICK))
INVOKE_ASYNC(target, TYPE_PROC_REF(/atom, attack_hand_secondary), hand_haver, modifiers)
else
INVOKE_ASYNC(target, TYPE_PROC_REF(/atom, attack_hand), hand_haver, modifiers)
INVOKE_ASYNC(hand_haver, TYPE_PROC_REF(/mob, update_held_items))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this update_held_items for?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no idea, I copied this from the dextrous component...

return COMPONENT_CANCEL_ATTACK_CHAIN

///Ranged attacking with the tractor field.
/atom/proc/attack_tractor(mob/user, mob/target, damage, force)
new /obj/effect/temp_visual/telekinesis(get_turf(src))
user.changeNext_move(CLICK_CD_MELEE)
//push them to where you are facing!!
target.throw_at(get_edge_target_turf(target, user.dir), force, damage, thrower = user)
balloon_alert(target, "gravity shifts!") // It essentially rotates gravity to the side for its target.
visible_message(span_danger("[user] pushes [target] back with an unknown force!"))
user.log_message("has attacked [target] using a tractor field!", LOG_ATTACK) //for the admins

return COMPONENT_CANCEL_ATTACK_CHAIN

/*
* # Broken tractor field
* This one is just fucked IC. Should feel chaotic to use.
*/
/datum/component/tractorfield/broken
max_range = 4
//less damage, throws things less far
damage = 2
force = 2

///throw yourself around if you try to touch something far away
/datum/component/tractorfield/broken/tractorRangeCheck(mob/user, atom/target)
var/d = get_dist(user, target)
if(d > max_range)
user.balloon_alert(user, "you feel something in your chest pull against you!")
new /obj/effect/temp_visual/telekinesis(get_turf(src))
user.throw_at(get_edge_target_turf(user, rand(0,8)), force, damage, thrower = user)
return
return TRUE

/datum/component/tractorfield/broken/on_ranged_attack(mob/source, atom/target, src)
if(is_type_in_typecache(target, blacklisted_atoms))
return
if(!tractorRangeCheck(source, target) || source.z != target.z)
return
if(ismob(target)) //atacking mobs
return target.attack_tractor_broken(source, target, damage, force)
if(isitem(target))
return target.throw_tractor_broken(source, target, damage, force) //ittl just throw it
return on_unarmed_attack(source, target, TRUE)

///A tractor field attack fro the broken tractor field
/atom/proc/attack_tractor_broken(mob/user, mob/target, damage, force)
new /obj/effect/temp_visual/telekinesis(get_turf(src))
user.changeNext_move(CLICK_CD_MELEE)

//throw people against eachother!
user.throw_at(get_turf(target), force, damage, thrower = user)
target.throw_at(get_turf(user), force, damage, thrower = user)

user.balloon_alert(target, "gravity shifts!")
user.balloon_alert(user, "you feel something in your chest pull you forward!")
balloon_alert(target, "gravity shifts uncomfortably!") // It essentially rotates gravity to the side for its target.
visible_message(span_danger("[user] pushes [target] with an unknown force!"))
user.log_message("has attacked [target] using a broken tractor field!", LOG_ATTACK) //for the admins
return COMPONENT_CANCEL_ATTACK_CHAIN

///A broken grab. Instead, it just throws the object around.
/atom/proc/throw_tractor_broken(mob/user, obj/item/target, damage, force, random = FALSE)
new /obj/effect/temp_visual/telekinesis(get_turf(src))
user.changeNext_move(CLICK_CD_MELEE)
target.throw_at(get_edge_target_turf(user, rand(0,8)), force + rand(force), damage, thrower = user)// randomly throws it, stronger than it would with a person.
visible_message(span_danger("[user] throws the [target] with an unknown force chaotically!"))
return COMPONENT_CANCEL_ATTACK_CHAIN

/*
* # Vroomba only stuff
* Components just for the vroomba.
*/
///The vroomba's hud!
/datum/hud/vroomba/New(mob/owner)
. = ..()
var/atom/movable/screen/using

using = new /atom/movable/screen/drop(null, src)
using.icon = ui_style
using.screen_loc = ui_drone_drop
static_inventory += using

pull_icon = new /atom/movable/screen/pull(null, src)
pull_icon.icon = ui_style
pull_icon.update_appearance()
pull_icon.screen_loc = ui_drone_pull
static_inventory += pull_icon

build_hand_slots()

action_intent = new /atom/movable/screen/combattoggle/flashy(null, src)
action_intent.icon = ui_style
action_intent.screen_loc = ui_combat_toggle
static_inventory += action_intent

zone_select = new /atom/movable/screen/zone_sel(null, src)
zone_select.icon = ui_style
zone_select.update_appearance()
static_inventory += zone_select

using = new /atom/movable/screen/area_creator(null, src)
using.icon = ui_style
static_inventory += using

mymob.canon_client?.clear_screen()

///The vroombas cleaner for when it is not in combat.
/datum/component/cleaner/vroomba/RegisterWithParent()
. = ..()
RegisterSignal(parent, COMSIG_COMBAT_MODE, PROC_REF(remove_self))

/datum/component/cleaner/vroomba/proc/remove_self()
SIGNAL_HANDLER

qdel(src)

///this tractor field removes itself when combat mode is deactivated.
/datum/component/tractorfield/vroomba
max_range = 3
force = 2

/datum/component/tractorfield/vroomba/RegisterWithParent()
. = ..()
RegisterSignal(parent, COMSIG_COMBAT_MODE, PROC_REF(remove_self))

/datum/component/tractorfield/vroomba/proc/remove_self()
SIGNAL_HANDLER

qdel(src)
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@

mobtype = /mob/living/basic/volkan/shoulder_pet


//--other misc--
//Imprint Key
//A key used to imprint a Volkan bot to whoever has it.
Expand All @@ -114,7 +115,6 @@


//---------------------cool boxes!-----------------------

//Unfoldable Box.
//A box designed to hold both a pet and the communication chips for transit. It is easy to unfold once the items inside has been taken out.
/obj/item/storage/box/volkan/unfoldable_box
Expand All @@ -141,6 +141,7 @@
)
generate_items_inside(items_inside, src)


//Chip box
//Designed to hold communication chips
/obj/item/storage/box/volkan/chip_box
Expand Down Expand Up @@ -186,3 +187,35 @@
atom_storage.numerical_stacking = TRUE
atom_storage.max_total_storage = 6
atom_storage.max_slots = 2 // I expect trades to only have two items max right now.


/*
* # Tractor field item
* A very important and complicated piece of Vtech (Volkan and Co technology).
* Invented by CaLE, based on gravity generators.
* In game it will basically act like telekinesis.
* Gives the tractor field component
*/

/obj/item/organ/internal/cyberimp/chest/tractorfield
name = "intricate metal toroid"
desc = "A strange toroid shaped mechanism with intricate machined metal shapes interlocked together. Two cables are sticking out from the inside."
icon = 'maplestation_modules/story_content/volkan_equipment/icons/misc_items.dmi'
icon_state = "tractor_field_component"
w_class = WEIGHT_CLASS_NORMAL
slot = ORGAN_SLOT_TRACTOR_FIELD

/obj/item/organ/internal/cyberimp/chest/tractorfield/on_mob_insert(mob/living/owner)

if (iscyborg(owner) || (owner.mob_biotypes & MOB_ROBOTIC))
owner.AddComponent(/datum/component/tractorfield)
else
owner.AddComponent(/datum/component/tractorfield/broken) //fleshy beings cannot control it...
. = ..()

/obj/item/organ/internal/cyberimp/chest/tractorfield/on_mob_remove(mob/living/carbon/organ_owner, special)
if (iscyborg(owner) || (owner.mob_biotypes & MOB_ROBOTIC))
qdel(owner.GetComponent(/datum/component/tractorfield))
else
qdel(owner.GetComponent(/datum/component/tractorfield/broken))
. = ..()
Loading
Loading