code folder. 221 files changed wew
This commit is contained in:
@@ -0,0 +1,151 @@
|
||||
//CREATOR'S NOTE: DO NOT FUCKING GIVE THIS TO BOTANY!
|
||||
/obj/item/hot_potato
|
||||
name = "hot potato"
|
||||
desc = "A label on the side of this potato reads \"Product of DonkCo Service Wing. Activate far away from populated areas. Device will only attach to sapient creatures.\" <span class='boldnotice'>You can attack anyone with it to force it on them instead of yourself!</span>"
|
||||
icon = 'icons/obj/hydroponics/harvest.dmi'
|
||||
icon_state = "potato"
|
||||
flags_1 = NOBLUDGEON_1
|
||||
force = 0
|
||||
var/icon_off = "potato"
|
||||
var/icon_on = "potato_active"
|
||||
var/detonation_timerid
|
||||
var/activation_time = 0
|
||||
var/timer = 600 //deciseconds
|
||||
var/show_timer = FALSE
|
||||
var/reusable = FALSE //absolute madman
|
||||
var/sticky = TRUE
|
||||
var/forceful_attachment = TRUE
|
||||
var/stimulant = TRUE
|
||||
var/detonate_explosion = TRUE
|
||||
var/detonate_dev_range = 0
|
||||
var/detonate_heavy_range = 0
|
||||
var/detonate_light_range = 2
|
||||
var/detonate_flash_range = 5
|
||||
var/detonate_fire_range = 5
|
||||
|
||||
var/color_val = FALSE
|
||||
|
||||
/obj/item/hot_potato/proc/detonate()
|
||||
var/atom/location = loc
|
||||
location.visible_message("<span class='userdanger'>[src] [detonate_explosion? "explodes" : "activates"]!</span>", "<span class='userdanger'>[src] activates! You've ran out of time!</span>")
|
||||
if(detonate_explosion)
|
||||
explosion(src, detonate_dev_range, detonate_heavy_range, detonate_light_range, detonate_flash_range, flame_range = detonate_fire_range)
|
||||
deactivate()
|
||||
if(!reusable)
|
||||
var/mob/M = loc
|
||||
if(istype(M))
|
||||
M.dropItemToGround(src, TRUE)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/hot_potato/proc/is_active()
|
||||
return isnull(detonation_timerid)? FALSE : TRUE
|
||||
|
||||
/obj/item/hot_potato/attack_self(mob/user)
|
||||
if(activate(timer, user))
|
||||
user.visible_message("<span class='boldwarning'>[user] squeezes [src], which promptly starts to flash red-hot colors!</span>", "<span class='boldwarning'>You squeeze [src], activating its countdown and attachment mechanism!</span>",
|
||||
"<span class='boldwarning'>You hear a mechanical click and a loud beeping!</span>")
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/item/hot_potato/process()
|
||||
if(stimulant)
|
||||
if(isliving(loc))
|
||||
var/mob/living/L = loc
|
||||
L.SetStun(0)
|
||||
L.SetKnockdown(0)
|
||||
L.SetSleeping(0)
|
||||
L.SetUnconscious(0)
|
||||
L.reagents.add_reagent("muscle_stimulant", CLAMP(5 - L.reagents.get_reagent_amount("muscle_stimulant"), 0, 5)) //If you don't have legs or get bola'd, tough luck!
|
||||
color_val = !color_val
|
||||
L.add_atom_colour(color_val? "#ffff00" : "#00ffff", FIXED_COLOUR_PRIORITY)
|
||||
|
||||
/obj/item/hot_potato/examine(mob/user)
|
||||
. = ..()
|
||||
if(is_active())
|
||||
to_chat(user, "<span class='warning'>[src] is flashing red-hot! You should probably get rid of it!</span>")
|
||||
if(show_timer)
|
||||
to_chat(user, "<span class='warning'>[src]'s timer looks to be at [(activation_time - world.time) / 10] seconds!</span>")
|
||||
|
||||
/obj/item/hot_potato/equipped(mob/user)
|
||||
. = ..()
|
||||
if(is_active())
|
||||
to_chat(user, "<span class='userdanger'>You have a really bad feeling about [src]!</span>")
|
||||
|
||||
/obj/item/hot_potato/afterattack(atom/target, mob/user, adjacent, params)
|
||||
if(!adjacent || !ismob(target))
|
||||
return ..()
|
||||
force_onto(target, user)
|
||||
|
||||
/obj/item/hot_potato/proc/force_onto(mob/living/victim, mob/user)
|
||||
if(!istype(victim) || user != loc || victim == user)
|
||||
return FALSE
|
||||
if(!victim.client)
|
||||
to_chat(user, "<span class='boldwarning'>[src] refuses to attach to a non-sapient creature!</span>")
|
||||
if(victim.stat != CONSCIOUS || !victim.get_num_legs())
|
||||
to_chat(user, "<span class='boldwarning'>[src] refuses to attach to someone incapable of using it!</span>")
|
||||
user.temporarilyRemoveItemFromInventory(src, TRUE)
|
||||
. = FALSE
|
||||
if(!victim.put_in_hands(src))
|
||||
if(forceful_attachment)
|
||||
victim.dropItemToGround(victim.get_inactive_held_item())
|
||||
if(!victim.put_in_hands(src))
|
||||
victim.dropItemToGround(victim.get_active_held_item())
|
||||
if(victim.put_in_hands(src))
|
||||
. = TRUE
|
||||
else
|
||||
. = TRUE
|
||||
else
|
||||
. = TRUE
|
||||
if(.)
|
||||
add_logs(user, victim, "forced a hot potato with explosive variables ([detonate_explosion]-[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_flash_range]/[detonate_fire_range]) onto")
|
||||
user.visible_message("<span class='userdanger'>[user] forces [src] onto [victim]!</span>", "<span class='userdanger'>You force [src] onto [victim]!</span>", "<span class='boldwarning'>You hear a mechanical click and a beep.</span>")
|
||||
user.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY)
|
||||
else
|
||||
add_logs(user, victim, "tried to force a hot potato with explosive variables ([detonate_explosion]-[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_flash_range]/[detonate_fire_range]) onto")
|
||||
user.visible_message("<span class='boldwarning'>[user] tried to force [src] onto [victim], but it could not attach!</span>", "<span class='boldwarning'>You try to force [src] onto [victim], but it is unable to attach!</span>", "<span class='boldwarning'>You hear a mechanical click and two buzzes.</span>")
|
||||
user.put_in_hands(src)
|
||||
|
||||
/obj/item/hot_potato/dropped(mob/user)
|
||||
. = ..()
|
||||
user.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY)
|
||||
|
||||
/obj/item/hot_potato/proc/activate(delay, mob/user)
|
||||
if(is_active())
|
||||
return
|
||||
update_icon()
|
||||
if(sticky)
|
||||
flags_1 |= NODROP_1
|
||||
name = "primed [name]"
|
||||
activation_time = timer + world.time
|
||||
detonation_timerid = addtimer(CALLBACK(src, .proc/detonate), delay, TIMER_STOPPABLE)
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
var/turf/T = get_turf(src)
|
||||
message_admins("[user? "[ADMIN_LOOKUPFLW(user)] has primed [src]" : "A [src] has been primed"] (Timer:[delay],Explosive:[detonate_explosion],Range:[detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_fire_range]) for detonation at [COORD(T)]([T.loc])")
|
||||
log_game("[user? "[user] has primed [src]" : "A [src] has been primed"] ([detonate_dev_range]/[detonate_heavy_range]/[detonate_light_range]/[detonate_fire_range]) for detonation at [COORD(T)]([T.loc])")
|
||||
|
||||
/obj/item/hot_potato/proc/deactivate()
|
||||
update_icon()
|
||||
name = initial(name)
|
||||
flags_1 &= ~NODROP_1
|
||||
deltimer(detonation_timerid)
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
detonation_timerid = null
|
||||
if(ismob(loc))
|
||||
var/mob/user = loc
|
||||
user.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY)
|
||||
|
||||
/obj/item/hot_potato/update_icon()
|
||||
icon_state = is_active()? icon_on : icon_off
|
||||
|
||||
/obj/item/hot_potato/syndicate
|
||||
detonate_light_range = 4
|
||||
detonate_fire_range = 5
|
||||
|
||||
/obj/item/hot_potato/harmless
|
||||
detonate_explosion = FALSE
|
||||
|
||||
/obj/item/hot_potato/harmless/toy
|
||||
desc = "A label on the side of this potato reads \"Product of DonkCo Toys and Recreation department.\" <span class='boldnotice'>You can attack anyone with it to put it on them instead, if they have a free hand to take it!</span>"
|
||||
sticky = FALSE
|
||||
reusable = TRUE
|
||||
forceful_attachment = FALSE
|
||||
Reference in New Issue
Block a user