mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 02:54:41 +01:00
Migrate pens to the new attack chain. (#31992)
* Migrate pens to the new attack chain. * Set attack chain var to new. * Migrate more procs in pen.dm and misc_robot_items.dm * Call parent attack proc in pen.dm. * Apply suggestions from CRUNCH review. Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com> Signed-off-by: Alan <alfalfascout@users.noreply.github.com> * Change sleepy pen attack() to interact_with_atom(). * Apply suggestions from CRUNCH review. Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com> Signed-off-by: Alan <alfalfascout@users.noreply.github.com> --------- Signed-off-by: Alan <alfalfascout@users.noreply.github.com> Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
This commit is contained in:
@@ -6,10 +6,12 @@
|
||||
name = "Printing Pen"
|
||||
var/mode = 1
|
||||
|
||||
/obj/item/pen/multi/robopen/attack_self__legacy__attackchain(mob/user as mob)
|
||||
var/choice = tgui_input_list(user, "Would you like to change colour or mode?", name, list("Colour","Mode"))
|
||||
/obj/item/pen/multi/robopen/activate_self(mob/user)
|
||||
if(!user)
|
||||
return ..()
|
||||
var/choice = tgui_input_list(user, "Would you like to change colour or mode?", name, list("Colour", "Mode"))
|
||||
if(!choice)
|
||||
return
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
switch(choice)
|
||||
if("Colour")
|
||||
@@ -21,7 +23,7 @@
|
||||
mode = 1
|
||||
to_chat(user, "Changed printing mode to '[mode == 2 ? "Rename Paper" : "Write Paper"]'")
|
||||
playsound(src.loc, 'sound/effects/pop.ogg', 50, 0)
|
||||
return
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
// Copied over from paper's rename verb
|
||||
// see code\modules\paperwork\paper.dm line 62
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
materials = list(MAT_METAL=10)
|
||||
var/colour = "black" //what colour the ink is!
|
||||
pressure_resistance = 2
|
||||
new_attack_chain = TRUE
|
||||
|
||||
/obj/item/pen/suicide_act(mob/user)
|
||||
to_chat(viewers(user), SPAN_SUICIDE("[user] starts scribbling numbers over [user.p_themselves()] with [src]! It looks like [user.p_theyre()] trying to commit sudoku!"))
|
||||
@@ -71,8 +72,11 @@
|
||||
playsound(loc, 'sound/effects/pop.ogg', 50, 1)
|
||||
update_icon()
|
||||
|
||||
/obj/item/pen/multi/attack_self__legacy__attackchain(mob/living/user as mob)
|
||||
/obj/item/pen/multi/activate_self(mob/living/user)
|
||||
if(!user)
|
||||
return ..()
|
||||
select_colour(user)
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/item/pen/multi/update_overlays()
|
||||
. = ..()
|
||||
@@ -143,26 +147,25 @@
|
||||
origin_tech = "engineering=4;syndicate=2"
|
||||
var/transfer_amount = 50
|
||||
|
||||
/obj/item/pen/sleepy/attack__legacy__attackchain(mob/living/M, mob/user)
|
||||
if(!istype(M))
|
||||
return
|
||||
/obj/item/pen/sleepy/interact_with_atom(mob/living/target, mob/user, list/modifiers)
|
||||
if(!istype(target))
|
||||
return ..()
|
||||
|
||||
if(!M.can_inject(user, TRUE))
|
||||
return
|
||||
if(!target.can_inject(user, TRUE))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
var/transfered = 0
|
||||
var/contained = list()
|
||||
|
||||
for(var/R in reagents.reagent_list)
|
||||
var/datum/reagent/reagent = R
|
||||
for(var/datum/reagent/reagent in reagents.reagent_list)
|
||||
contained += "[round(reagent.volume, 0.01)]u [reagent]"
|
||||
|
||||
if(reagents.total_volume && M.reagents)
|
||||
if(reagents.total_volume && target.reagents)
|
||||
var/fraction = min(transfer_amount / reagents.total_volume, 1)
|
||||
reagents.reaction(M, REAGENT_INGEST, fraction)
|
||||
transfered = reagents.trans_to(M, transfer_amount)
|
||||
to_chat(user, SPAN_WARNING("You sneakily stab [M] with the pen."))
|
||||
add_attack_logs(user, M, "Stabbed with (sleepy) [src]. [transfered]u of reagents transfered from pen containing [english_list(contained)].")
|
||||
return TRUE
|
||||
reagents.reaction(target, REAGENT_INGEST, fraction)
|
||||
transfered = reagents.trans_to(target, transfer_amount)
|
||||
to_chat(user, SPAN_WARNING("You sneakily stab [target] with the pen."))
|
||||
add_attack_logs(user, target, "Stabbed with (sleepy) [src]. [transfered]u of reagents transfered from pen containing [english_list(contained)].")
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/item/pen/sleepy/Initialize(mapload)
|
||||
. = ..()
|
||||
@@ -213,19 +216,20 @@
|
||||
armor_penetration_flat = 20
|
||||
throw_speed = 4
|
||||
|
||||
/obj/item/pen/edagger/attack__legacy__attackchain(mob/living/M, mob/living/user, def_zone)
|
||||
if(cigarette_lighter_act(user, M))
|
||||
return
|
||||
/obj/item/pen/edagger/interact_with_atom(mob/living/target, mob/living/user, list/modifiers)
|
||||
if(cigarette_lighter_act(user, target))
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/item/pen/edagger/attack(mob/living/target, mob/living/user)
|
||||
var/extra_force_applied = FALSE
|
||||
if(active && user.dir == M.dir && !HAS_TRAIT(M, TRAIT_FLOORED) && user != M)
|
||||
if(active && user.dir == target.dir && !HAS_TRAIT(target, TRAIT_FLOORED) && user != target)
|
||||
force += backstab_damage
|
||||
extra_force_applied = TRUE
|
||||
add_attack_logs(user, M, "Backstabbed with [src]", ATKLOG_ALL)
|
||||
M.apply_damage(40, STAMINA) //Just enough to slow
|
||||
M.KnockDown(2 SECONDS)
|
||||
M.visible_message(
|
||||
SPAN_WARNING("[user] stabs [M] in the back!"),
|
||||
add_attack_logs(user, target, "Backstabbed with [src]", ATKLOG_ALL)
|
||||
target.apply_damage(40, STAMINA) //Just enough to slow
|
||||
target.KnockDown(2 SECONDS)
|
||||
target.visible_message(
|
||||
SPAN_WARNING("[user] stabs [target] in the back!"),
|
||||
SPAN_USERDANGER("[user] stabs you in the back! The energy blade makes you collapse in pain!")
|
||||
)
|
||||
|
||||
@@ -267,7 +271,10 @@
|
||||
/obj/item/pen/edagger/get_clamped_volume() //So the parent proc of attack isn't the loudest sound known to man
|
||||
return FALSE
|
||||
|
||||
/obj/item/pen/edagger/attack_self__legacy__attackchain(mob/living/user)
|
||||
/obj/item/pen/edagger/activate_self(mob/living/user)
|
||||
if(!user)
|
||||
return ..()
|
||||
|
||||
if(active)
|
||||
active = FALSE
|
||||
force = initial(force)
|
||||
@@ -294,6 +301,7 @@
|
||||
set_light(brightness_on, 1)
|
||||
set_sharpness(active)
|
||||
update_icon()
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
/obj/item/pen/edagger/update_icon_state()
|
||||
if(active)
|
||||
@@ -309,7 +317,7 @@
|
||||
/obj/item/pen/multi/poison
|
||||
var/current_poison = null
|
||||
|
||||
/obj/item/pen/multi/poison/attack_self__legacy__attackchain(mob/living/user)
|
||||
/obj/item/pen/multi/poison/activate_self(mob/living/user)
|
||||
. = ..()
|
||||
switch(colour)
|
||||
if("black")
|
||||
@@ -322,7 +330,7 @@
|
||||
current_poison = "teslium"
|
||||
if("yellow")
|
||||
current_poison = "pancuronium"
|
||||
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
/obj/item/pen/multi/poison/on_write(obj/item/paper/P, mob/user)
|
||||
if(current_poison)
|
||||
if(P.contact_poison)
|
||||
@@ -338,7 +346,9 @@
|
||||
/obj/item/pen/chameleon
|
||||
var/forge_name
|
||||
|
||||
/obj/item/pen/chameleon/attack_self__legacy__attackchain(mob/user)
|
||||
/obj/item/pen/chameleon/activate_self(mob/user)
|
||||
if(!user)
|
||||
return ..()
|
||||
if(!iscarbon(user))
|
||||
return
|
||||
|
||||
@@ -346,4 +356,4 @@
|
||||
return
|
||||
|
||||
forge_name = tgui_input_text(user, "Enter the name of the person whose signature you want to forge", "Forge name", max_length = MAX_NAME_LEN)
|
||||
|
||||
return ITEM_INTERACT_COMPLETE
|
||||
|
||||
Reference in New Issue
Block a user