mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-20 03:26:37 +01:00
Merge pull request #9553 from GinjaNinja32/reagent_protection
Fixes #5945, de-copy-pastes parapens and sleepypens
This commit is contained in:
@@ -51,66 +51,54 @@
|
||||
msg_admin_attack("[user.name] ([user.ckey]) Used the [name] to stab [M.name] ([M.ckey]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
return
|
||||
|
||||
/*
|
||||
* Reagent pens
|
||||
*/
|
||||
|
||||
/obj/item/weapon/pen/reagent
|
||||
flags = OPENCONTAINER
|
||||
slot_flags = SLOT_BELT
|
||||
|
||||
/obj/item/weapon/pen/reagent/New()
|
||||
..()
|
||||
create_reagents(30)
|
||||
|
||||
/obj/item/weapon/pen/reagent/attack(mob/living/M as mob, mob/user as mob)
|
||||
|
||||
if(!istype(M))
|
||||
return
|
||||
|
||||
. = ..()
|
||||
|
||||
if(M.can_inject(user,1))
|
||||
if(reagents.total_volume)
|
||||
if(M.reagents)
|
||||
var/contained_reagents = reagents.get_reagents()
|
||||
var/trans = reagents.trans_to_mob(M, 30, CHEM_BLOOD)
|
||||
admin_inject_log(user, M, src, contained_reagents, trans)
|
||||
|
||||
/*
|
||||
* Sleepy Pens
|
||||
*/
|
||||
/obj/item/weapon/pen/sleepypen
|
||||
/obj/item/weapon/pen/reagent/sleepy
|
||||
desc = "It's a black ink pen with a sharp point and a carefully engraved \"Waffle Co.\""
|
||||
flags = OPENCONTAINER
|
||||
slot_flags = SLOT_BELT
|
||||
origin_tech = "materials=2;syndicate=5"
|
||||
|
||||
|
||||
/obj/item/weapon/pen/sleepypen/New()
|
||||
var/datum/reagents/R = new/datum/reagents(30) //Used to be 300
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
R.add_reagent("chloralhydrate", 22) //Used to be 100 sleep toxin//30 Chloral seems to be fatal, reducing it to 22./N
|
||||
/obj/item/weapon/pen/reagent/sleepy/New()
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/pen/sleepypen/attack(mob/M as mob, mob/user as mob)
|
||||
if(!(istype(M,/mob)))
|
||||
return
|
||||
..()
|
||||
if(reagents.total_volume)
|
||||
if(M.reagents) reagents.trans_to_mob(M, 50, CHEM_BLOOD) //used to be 150
|
||||
return
|
||||
reagents.add_reagent("chloralhydrate", 22) //Used to be 100 sleep toxin//30 Chloral seems to be fatal, reducing it to 22./N
|
||||
|
||||
|
||||
/*
|
||||
* Parapens
|
||||
*/
|
||||
/obj/item/weapon/pen/paralysis
|
||||
flags = OPENCONTAINER
|
||||
slot_flags = SLOT_BELT
|
||||
/obj/item/weapon/pen/reagent/paralysis
|
||||
origin_tech = "materials=2;syndicate=5"
|
||||
|
||||
|
||||
/obj/item/weapon/pen/paralysis/attack(mob/living/M as mob, mob/user as mob)
|
||||
|
||||
if(!(istype(M,/mob)))
|
||||
return
|
||||
|
||||
/obj/item/weapon/pen/reagent/paralysis/New()
|
||||
..()
|
||||
|
||||
|
||||
if(M.can_inject(user,1))
|
||||
if(reagents.total_volume)
|
||||
if(M.reagents) reagents.trans_to_mob(M, 50, CHEM_BLOOD)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/pen/paralysis/New()
|
||||
var/datum/reagents/R = new/datum/reagents(50)
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
R.add_reagent("zombiepowder", 10)
|
||||
R.add_reagent("cryptobiolin", 15)
|
||||
..()
|
||||
return
|
||||
reagents.add_reagent("zombiepowder", 10)
|
||||
reagents.add_reagent("cryptobiolin", 15)
|
||||
|
||||
/*
|
||||
* Chameleon pen
|
||||
|
||||
@@ -19,23 +19,22 @@
|
||||
reagents.add_reagent("tricordrazine", 30)
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/hypospray/attack(mob/M as mob, mob/user as mob)
|
||||
/obj/item/weapon/reagent_containers/hypospray/attack(mob/living/M as mob, mob/user as mob)
|
||||
if(!reagents.total_volume)
|
||||
user << "<span class='warning'>[src] is empty.</span>"
|
||||
return
|
||||
if (!istype(M))
|
||||
return
|
||||
if(!M.can_inject(user, 1))
|
||||
return
|
||||
|
||||
user << "<span class='notice'>You inject [M] with [src].</span>"
|
||||
M << "<span class='notice'>You feel a tiny prick!</span>"
|
||||
|
||||
if(M.reagents)
|
||||
|
||||
var/contained = reagentlist()
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been injected with [name] by [user.name] ([user.ckey]). Reagents: [contained]</font>")
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [name] to inject [M.name] ([M.key]). Reagents: [contained]</font>")
|
||||
msg_admin_attack("[user.name] ([user.ckey]) injected [M.name] ([M.key]) with [name]. Reagents: [contained] (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
|
||||
var/trans = reagents.trans_to_mob(M, amount_per_transfer_from_this, CHEM_BLOOD)
|
||||
admin_inject_log(user, M, src, contained, trans)
|
||||
user << "<span class='notice'>[trans] units injected. [reagents.total_volume] units remaining in \the [src].</span>"
|
||||
|
||||
return
|
||||
|
||||
@@ -171,16 +171,11 @@
|
||||
|
||||
user.visible_message("<span class='warning'>[user] injects [target] with the syringe!</span>")
|
||||
|
||||
if(istype(target, /mob/living))
|
||||
var/mob/living/M = target
|
||||
var/contained = reagentlist()
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been injected with [name] by [user.name] ([user.ckey]). Reagents: [contained]</font>")
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Used the [name] to inject [M.name] ([M.key]). Reagents: [contained]</font>")
|
||||
msg_admin_attack("[user.name] ([user.ckey]) injected [M.name] ([M.key]) with [name]. Reagents: [contained] (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
|
||||
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(target, amount_per_transfer_from_this)
|
||||
user << "<span class='notice'>You inject [trans] units of the solution. The syringe now contains [src.reagents.total_volume] units.</span>"
|
||||
@@ -219,10 +214,6 @@
|
||||
|
||||
proc/syringestab(mob/living/carbon/target as mob, mob/living/carbon/user as mob)
|
||||
|
||||
user.attack_log += "\[[time_stamp()]\]<font color='red'> Attacked [target.name] ([target.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>"
|
||||
target.attack_log += "\[[time_stamp()]\]<font color='orange'> Attacked by [user.name] ([user.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>"
|
||||
msg_admin_attack("[user.name] ([user.ckey]) attacked [target.name] ([target.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
|
||||
var/mob/living/carbon/human/H = target
|
||||
@@ -244,6 +235,11 @@
|
||||
O.show_message(text("\red <B>[user] tries to stab [target] in \the [hit_area] with [src.name], but the attack is deflected by armor!</B>"), 1)
|
||||
user.remove_from_mob(src)
|
||||
qdel(src)
|
||||
|
||||
user.attack_log += "\[[time_stamp()]\]<font color='red'> Attacked [target.name] ([target.ckey]) with \the [src] (INTENT: HARM).</font>"
|
||||
target.attack_log += "\[[time_stamp()]\]<font color='orange'> Attacked by [user.name] ([user.ckey]) with [src.name] (INTENT: HARM).</font>"
|
||||
msg_admin_attack("[key_name_admin(user)] attacked [key_name_admin(target)] with [src.name] (INTENT: HARM) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
|
||||
return
|
||||
|
||||
user.visible_message("<span class='danger'>[user] stabs [target] in \the [hit_area] with [src.name]!</span>")
|
||||
@@ -255,8 +251,13 @@
|
||||
user.visible_message("<span class='danger'>[user] stabs [target] with [src.name]!</span>")
|
||||
target.take_organ_damage(3)// 7 is the same as crowbar punch
|
||||
|
||||
|
||||
|
||||
var/syringestab_amount_transferred = rand(0, (reagents.total_volume - 5)) //nerfed by popular demand
|
||||
reagents.trans_to_mob(target, syringestab_amount_transferred, CHEM_BLOOD)
|
||||
var/contained_reagents = reagents.get_reagents()
|
||||
var/trans = reagents.trans_to_mob(target, syringestab_amount_transferred, CHEM_BLOOD)
|
||||
if(isnull(trans)) trans = 0
|
||||
admin_inject_log(user, target, src, contained_reagents, trans, violent=1)
|
||||
break_syringe(target, user)
|
||||
|
||||
proc/break_syringe(mob/living/carbon/target, mob/living/carbon/user)
|
||||
|
||||
@@ -254,7 +254,7 @@
|
||||
if(prob(75))
|
||||
new_item = new /obj/item/weapon/pen(src.loc)
|
||||
else
|
||||
new_item = new /obj/item/weapon/pen/sleepypen(src.loc)
|
||||
new_item = new /obj/item/weapon/pen/reagent/sleepy(src.loc)
|
||||
if(prob(30))
|
||||
apply_image_decorations = 1
|
||||
if(16)
|
||||
|
||||
Reference in New Issue
Block a user