mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 03:33:21 +00:00
@@ -213,6 +213,8 @@ Proc for attack log creation, because really why not
|
|||||||
/proc/do_after(mob/user, delay, atom/target = null, needhand = 1, progress = 1, var/incapacitation_flags = INCAPACITATION_DEFAULT)
|
/proc/do_after(mob/user, delay, atom/target = null, needhand = 1, progress = 1, var/incapacitation_flags = INCAPACITATION_DEFAULT)
|
||||||
if(!user)
|
if(!user)
|
||||||
return 0
|
return 0
|
||||||
|
if(!delay)
|
||||||
|
return 1 //Okay. Done.
|
||||||
var/atom/target_loc = null
|
var/atom/target_loc = null
|
||||||
if(target)
|
if(target)
|
||||||
target_loc = target.loc
|
target_loc = target.loc
|
||||||
|
|||||||
@@ -67,6 +67,7 @@
|
|||||||
syringestab(target, user)
|
syringestab(target, user)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
var/injtime = time // Calculated 'true' injection time (as added to by hardsuits and whatnot), 66% of this goes to warmup, then every 33% after injects 5u
|
||||||
switch(mode)
|
switch(mode)
|
||||||
if(SYRINGE_DRAW)
|
if(SYRINGE_DRAW)
|
||||||
if(!reagents.get_free_space())
|
if(!reagents.get_free_space())
|
||||||
@@ -169,9 +170,11 @@
|
|||||||
to_chat(user, "<span class='danger'>You cannot inject a robotic limb.</span>")
|
to_chat(user, "<span class='danger'>You cannot inject a robotic limb.</span>")
|
||||||
return
|
return
|
||||||
|
|
||||||
if(ismob(target) && target != user)
|
var/cycle_time = injtime*0.33 //33% of the time slept between 5u doses
|
||||||
|
var/warmup_time = cycle_time //If the target is another mob, this gets overwritten
|
||||||
|
|
||||||
var/injtime = time //Injecting through a hardsuit takes longer due to needing to find a port.
|
if(ismob(target) && target != user)
|
||||||
|
warmup_time = injtime*0.66 // Otherwise 66% of the time is warmup
|
||||||
|
|
||||||
if(istype(H))
|
if(istype(H))
|
||||||
if(H.wear_suit)
|
if(H.wear_suit)
|
||||||
@@ -181,32 +184,39 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
else if(isliving(target))
|
else if(isliving(target))
|
||||||
|
|
||||||
var/mob/living/M = target
|
var/mob/living/M = target
|
||||||
if(!M.can_inject(user, 1))
|
if(!M.can_inject(user, 1))
|
||||||
return
|
return
|
||||||
|
|
||||||
if(injtime == time)
|
if(injtime == time)
|
||||||
user.visible_message("<span class='warning'>[user] is trying to inject [target] with [visible_name]!</span>")
|
user.visible_message("<span class='warning'>[user] is trying to inject [target] with [visible_name]!</span>","<span class='notice'>You begin injecting [target] with [visible_name].</span>")
|
||||||
else
|
else
|
||||||
user.visible_message("<span class='warning'>[user] begins hunting for an injection port on [target]'s suit!</span>")
|
user.visible_message("<span class='warning'>[user] begins hunting for an injection port on [target]'s suit!</span>","<span class='notice'>You begin hunting for an injection port on [target]'s suit!</span>")
|
||||||
|
|
||||||
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
|
//The warmup
|
||||||
|
user.setClickCooldown(DEFAULT_QUICK_COOLDOWN)
|
||||||
|
if(!do_after(user,warmup_time,target))
|
||||||
|
return
|
||||||
|
|
||||||
if(!do_mob(user, target, injtime))
|
var/trans = 0
|
||||||
return
|
var/contained = reagentlist()
|
||||||
|
while(reagents.total_volume)
|
||||||
|
if(ismob(target))
|
||||||
|
trans += reagents.trans_to_mob(target, amount_per_transfer_from_this, CHEM_BLOOD)
|
||||||
|
else
|
||||||
|
trans += reagents.trans_to_obj(target, amount_per_transfer_from_this)
|
||||||
|
update_icon()
|
||||||
|
if(!reagents.total_volume || !do_after(user,cycle_time,target))
|
||||||
|
break
|
||||||
|
|
||||||
user.visible_message("<span class='warning'>[user] injects [target] with the syringe!</span>")
|
if (reagents.total_volume <= 0 && mode == SYRINGE_INJECT)
|
||||||
|
mode = SYRINGE_DRAW
|
||||||
|
update_icon()
|
||||||
|
|
||||||
var/trans
|
|
||||||
if(ismob(target))
|
|
||||||
var/contained = reagentlist()
|
|
||||||
trans = reagents.trans_to_mob(target, amount_per_transfer_from_this, CHEM_BLOOD)
|
|
||||||
admin_inject_log(user, target, src, contained, trans)
|
|
||||||
else
|
|
||||||
trans = reagents.trans_to_obj(target, amount_per_transfer_from_this)
|
|
||||||
if(trans)
|
if(trans)
|
||||||
to_chat(user, "<span class='notice'>You inject [trans] units of the solution. The syringe now contains [src.reagents.total_volume] units.</span>")
|
to_chat(user, "<span class='notice'>You inject [trans] units of the solution. The syringe now contains [src.reagents.total_volume] units.</span>")
|
||||||
|
if(ismob(target))
|
||||||
|
admin_inject_log(user, target, src, contained, trans)
|
||||||
else
|
else
|
||||||
to_chat(user, "<span class='notice'>The syringe is empty.</span>")
|
to_chat(user, "<span class='notice'>The syringe is empty.</span>")
|
||||||
if (reagents.total_volume <= 0 && mode == SYRINGE_INJECT)
|
if (reagents.total_volume <= 0 && mode == SYRINGE_INJECT)
|
||||||
|
|||||||
36
html/changelogs/Anewbe - Syringes.yml
Normal file
36
html/changelogs/Anewbe - Syringes.yml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
################################
|
||||||
|
# Example Changelog File
|
||||||
|
#
|
||||||
|
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
|
||||||
|
#
|
||||||
|
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
|
||||||
|
# When it is, any changes listed below will disappear.
|
||||||
|
#
|
||||||
|
# Valid Prefixes:
|
||||||
|
# bugfix
|
||||||
|
# wip (For works in progress)
|
||||||
|
# tweak
|
||||||
|
# soundadd
|
||||||
|
# sounddel
|
||||||
|
# rscadd (general adding of nice things)
|
||||||
|
# rscdel (general deleting of nice things)
|
||||||
|
# imageadd
|
||||||
|
# imagedel
|
||||||
|
# maptweak
|
||||||
|
# spellcheck (typo fixes)
|
||||||
|
# experiment
|
||||||
|
#################################
|
||||||
|
|
||||||
|
# Your name.
|
||||||
|
author: Anewbe
|
||||||
|
|
||||||
|
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
|
||||||
|
delete-after: True
|
||||||
|
|
||||||
|
# Any changes you've made. See valid prefix list above.
|
||||||
|
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
|
||||||
|
# SCREW THIS UP AND IT WON'T WORK.
|
||||||
|
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
|
||||||
|
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
|
||||||
|
changes:
|
||||||
|
- tweak: "Syringes now inject their entire payload with one click, but in 5 unit increments. There is a delay in between each of these."
|
||||||
Reference in New Issue
Block a user