-
-
Notifications
You must be signed in to change notification settings - Fork 655
Adds the Gravitational Jaunter #6323
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -209,3 +209,125 @@ | |
| if(active_portal_pairs[i] == P) | ||
| return DESTINATION_PORTAL | ||
| return FALSE | ||
|
|
||
| /* | ||
| * Gravitational Jaunter | ||
| */ | ||
|
|
||
| /obj/item/gravitational_jaunter | ||
| name = "gravitational jaunter" | ||
| desc = "A device that allows its users to bend space around themselves into a 'bubble'. The lensing of this bubble is set to send its user directly ahead of the direction they're facing. Upon contact with matter, the bubble loses form, but not without causing damage to structures -- or people -- in its way. Created as a result of research into gravitational phenomena." | ||
| icon = 'icons/obj/device.dmi' | ||
| icon_state = "gravitational_jaunter" | ||
| item_state = "electronic" | ||
| lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi' | ||
| righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi' | ||
| throwforce = 5 | ||
| w_class = WEIGHT_CLASS_SMALL | ||
| throw_speed = 4 | ||
| throw_range = 10 | ||
|
|
||
| //Uses of the device left | ||
| var/charges = 4 | ||
| //The maximum number of stored uses | ||
| var/max_charges = 4 | ||
| var/minimum_teleport_distance = 6 | ||
| var/maximum_teleport_distance = 8 | ||
| //How far the emergency teleport checks for a safe position | ||
| var/parallel_teleport_distance = 3 | ||
| //How long it takes to replenish a charge | ||
| var/recharge_time = 15 SECONDS | ||
| //If the device is recharging, prevents timers stacking | ||
| var/recharging = FALSE | ||
| //stores the recharge timer id | ||
| var/recharge_timer | ||
|
|
||
| /obj/item/gravitational_jaunter/examine(mob/user) | ||
| . = ..() | ||
| . += span_notice("[src] has [charges] out of [max_charges] charges left.") | ||
| if(recharging) | ||
| . += span_notice("<b>A small display on the back reads:</b>") | ||
| var/timeleft = timeleft(recharge_timer) | ||
| var/loadingbar = num2loadingbar(timeleft/recharge_time, reverse=TRUE) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. had no idea this proc even existed.... this is quite cool we should probably use it more lol.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right? It's pretty neat |
||
| . += span_notice("<b>CHARGING: [loadingbar] ([timeleft*0.1]s)</b>") | ||
|
|
||
| /obj/item/gravitational_jaunter/attack_self(mob/user) | ||
| ..() | ||
| attempt_teleport(user, FALSE) | ||
|
|
||
| /obj/item/gravitational_jaunter/proc/check_charges() | ||
| if(recharging) | ||
| return | ||
| if(charges < max_charges) | ||
| recharge_timer = addtimer(CALLBACK(src, PROC_REF(recharge)), recharge_time, TIMER_STOPPABLE) | ||
| recharging = TRUE | ||
|
|
||
| /obj/item/gravitational_jaunter/proc/recharge() | ||
| charges++ | ||
| playsound(src,'sound/machines/twobeep.ogg',10,TRUE, extrarange = SILENCED_SOUND_EXTRARANGE, falloff_distance = 0) | ||
| recharging = FALSE | ||
| check_charges() | ||
|
|
||
| /obj/item/gravitational_jaunter/emp_act(severity) | ||
| . = ..() | ||
| if(. & EMP_PROTECT_SELF) | ||
| return | ||
| if(!prob(50 / severity)) | ||
| return | ||
| if(istype(loc, /mob/living/carbon/human)) | ||
| var/mob/living/carbon/human/user = loc | ||
| to_chat(user, span_danger("[src] buzzes and activates!")) | ||
| attempt_teleport(user, TRUE) //EMP Activates a teleport with no safety. | ||
| else | ||
| visible_message(span_warning("[src] activates and blinks out of existence!")) | ||
| do_sparks(2, 1, src) | ||
| qdel(src) | ||
|
|
||
| /obj/item/gravitational_jaunter/proc/attempt_teleport(mob/user, EMP_D = FALSE) | ||
| if(!charges) | ||
| to_chat(user, span_warning("[src] is still recharging.")) | ||
| return | ||
|
|
||
| var/turf/original_location = get_turf(user) | ||
|
|
||
| var/teleport_distance = rand(minimum_teleport_distance,maximum_teleport_distance) | ||
| var/list/bagholding = user.GetAllContents(/obj/item/storage/backpack/holding) | ||
| var/direction = (EMP_D || length(bagholding)) ? pick(GLOB.cardinals) : user.dir | ||
| var/turf/destination = get_ranged_target_turf(user, direction, teleport_distance) | ||
|
|
||
| var/turf/new_location = do_dash(user, original_location, destination, obj_damage=150, phase=FALSE, on_turf_cross=CALLBACK(src, PROC_REF(telefrag), user)) | ||
| if(isnull(new_location)) | ||
| to_chat(user, span_notice("\The [src] is malfunctioning.")) | ||
| return | ||
|
|
||
| new /obj/effect/temp_visual/teleport_abductor/gravitational_jaunter(original_location) | ||
| new /obj/effect/temp_visual/teleport_abductor/gravitational_jaunter(new_location) | ||
| charges-- | ||
| check_charges() | ||
| playsound(new_location, 'sound/effects/phasein.ogg', 25, 1) | ||
| playsound(new_location, "sparks", 50, 1) | ||
|
|
||
| /obj/item/gravitational_jaunter/proc/telefrag(mob/user, turf/fragging_location) | ||
| for(var/mob/living/target in fragging_location)//Hit everything in the turf | ||
| // Skip any mobs that aren't standing, or aren't dense | ||
| if ((target.body_position == LYING_DOWN) || !target.density || user == target) | ||
| continue | ||
| // Run armour checks and apply damage | ||
| var/armor_block = target.run_armor_check(BODY_ZONE_CHEST, MELEE) | ||
| if(istype(target, /mob/living/simple_animal)) | ||
| target.apply_damage(60, BRUTE, blocked = armor_block) //because simplemobs can't be stunned or paralyzed, the total brute damage is increased | ||
| else | ||
| target.apply_damage(25, BRUTE, blocked = armor_block) | ||
| target.Paralyze(10 * (100 - armor_block) / 100) | ||
| target.Knockdown(40 * (100 - armor_block) / 100) | ||
| // Check if we successfully knocked them down | ||
| if (target.body_position == LYING_DOWN) | ||
| to_chat(target, span_userdanger("[user] teleports into you, knocking you to the floor with the bluespace wave!")) | ||
| else | ||
| to_chat(user, span_userdanger("[target] resists the force of your jaunt's wake, bringing you to stop!")) | ||
| to_chat(target, span_userdanger("[user] slams into you, falling out of their bluespace jaunt tunnel!")) | ||
|
Comment on lines
+325
to
+328
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gravity-ify your fluff a bit |
||
| return FALSE | ||
| return TRUE | ||
|
|
||
| /obj/effect/temp_visual/teleport_abductor/gravitational_jaunter | ||
| duration = 5 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it could probably be good to make it battery operated instead,maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having it be anomaly tech is cool enough on its own. I'm unsure it needs to be cell based too.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could potentially do both? In that it could use an internal cell and also make use of the current system where an internal capacitor charges up charges -- giving 20 to 30 total jaunts with a maximum jaunt quantity of 4 at a time. I could potentially reduce the charge rate as well, if we take this avenue. My thinking here is that this implementation can imply that a link between gravity and the other three fundamental forces, much like how gravity generators currently do (since they require electricity to operate). I'm good with anything though and, I'm happy to let you both discuss it