mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-27 23:29:10 +01:00
[MIRROR] Misc fixes (#12698)
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
co-authored by
Cameron Lennox
parent
b7cd4306a4
commit
e9b4335888
@@ -35,6 +35,7 @@
|
||||
var/power_usage = 1
|
||||
var/power_use = 1
|
||||
var/flickering = FALSE
|
||||
var/single_use = FALSE
|
||||
pickup_sound = 'sound/items/pickup/device.ogg'
|
||||
drop_sound = 'sound/items/drop/device.ogg'
|
||||
|
||||
@@ -96,6 +97,8 @@
|
||||
. = ..(user)
|
||||
if(.)
|
||||
return TRUE
|
||||
if(single_use && on)
|
||||
return FALSE
|
||||
if(special_handling)
|
||||
return FALSE
|
||||
if(flickering)
|
||||
@@ -409,16 +412,17 @@
|
||||
icon_state = "flare"
|
||||
item_state = "flare"
|
||||
actions_types = list() //just pull it manually, neckbeard.
|
||||
var/fuel = 0
|
||||
var/fuel = 800
|
||||
var/on_damage = 7
|
||||
var/produce_heat = 1500
|
||||
power_use = 0
|
||||
drop_sound = 'sound/items/drop/gloves.ogg'
|
||||
pickup_sound = 'sound/items/pickup/gloves.ogg'
|
||||
light_system = MOVABLE_LIGHT
|
||||
single_use = TRUE
|
||||
|
||||
/obj/item/flashlight/flare/Initialize(mapload)
|
||||
fuel = rand(800, 1000) // Sorry for changing this so much but I keep under-estimating how long X number of ticks last in seconds.
|
||||
fuel += rand(0, 200)
|
||||
. = ..()
|
||||
|
||||
/obj/item/flashlight/flare/process()
|
||||
@@ -443,11 +447,9 @@
|
||||
if(.)
|
||||
return TRUE
|
||||
// Usual checks
|
||||
if(!fuel)
|
||||
if(!fuel || on)
|
||||
to_chat(user, span_notice("It's out of fuel."))
|
||||
return
|
||||
if(on)
|
||||
return
|
||||
// All good, turn it on.
|
||||
if(. == CAN_USE)
|
||||
user.visible_message(span_notice("[user] activates the flare."), span_notice("You pull the cord on the flare, activating it!"))
|
||||
@@ -477,11 +479,12 @@
|
||||
light_color = "#49F37C"
|
||||
icon_state = "glowstick_green"
|
||||
item_state = "glowstick_green"
|
||||
var/fuel = 0
|
||||
power_use = 0
|
||||
var/fuel = 1600
|
||||
power_use = FALSE
|
||||
single_use = TRUE
|
||||
|
||||
/obj/item/flashlight/glowstick/Initialize(mapload)
|
||||
fuel = rand(1600, 2000)
|
||||
fuel += rand(0, 400)
|
||||
. = ..()
|
||||
|
||||
/obj/item/flashlight/glowstick/process()
|
||||
@@ -493,18 +496,16 @@
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
|
||||
/obj/item/flashlight/glowstick/proc/turn_off()
|
||||
on = 0
|
||||
on = FALSE
|
||||
update_brightness()
|
||||
|
||||
/obj/item/flashlight/glowstick/attack_self(mob/user)
|
||||
. = ..(user)
|
||||
if(.)
|
||||
return TRUE
|
||||
if(!fuel)
|
||||
if(!fuel || on)
|
||||
to_chat(user, span_notice("The glowstick has already been turned on."))
|
||||
return
|
||||
if(on)
|
||||
return
|
||||
|
||||
if(. == CAN_USE)
|
||||
user.visible_message(span_notice("[user] cracks and shakes \the [name]."), span_notice("You crack and shake \the [src], turning it on!"))
|
||||
|
||||
@@ -90,6 +90,10 @@
|
||||
var/atom/movable/output_atom = output_dest?.resolve()
|
||||
if(!output_atom)
|
||||
return
|
||||
var/mob/living/attachment_holder //If we have someone holding the vac_attachment, so we don't suck them up by mistake.
|
||||
if(vac_owner) //If we have a vac owner, treat the vac owner as the user.
|
||||
attachment_holder = user
|
||||
user = vac_owner
|
||||
if(istype(output_atom, /obj/item/storage/bag/trash))
|
||||
if(get_turf(output_atom) != get_turf(user))
|
||||
vac_power = 0
|
||||
@@ -141,7 +145,7 @@
|
||||
I.singularity_pull(target, STAGE_THREE)
|
||||
suckables += I
|
||||
for(var/mob/living/L in oview(pull_range, target))
|
||||
if(L.anchored || !L.devourable || L == user || L.buckled || !L.can_be_drop_prey)
|
||||
if(L.anchored || !L.devourable || L == user || L.buckled || !L.can_be_drop_prey || L == attachment_holder)
|
||||
continue
|
||||
L.singularity_pull(target, STAGE_THREE)
|
||||
suckables += L
|
||||
@@ -154,7 +158,7 @@
|
||||
continue
|
||||
suckables += I
|
||||
for(var/mob/living/L in target)
|
||||
if(L.anchored || !L.devourable || L == user || L.buckled || !L.can_be_drop_prey)
|
||||
if(L.anchored || !L.devourable || L == user || L.buckled || !L.can_be_drop_prey || L == attachment_holder)
|
||||
continue
|
||||
if(L.size_multiplier < 0.5 || vac_power >= 6)
|
||||
suckables += L
|
||||
@@ -266,8 +270,14 @@
|
||||
|
||||
/obj/item/vac_attachment/proc/prepare_sucking(atom/movable/target, mob/user, turf/target_turf)
|
||||
var/atom/movable/output_atom = output_dest?.resolve()
|
||||
if(!target.Adjacent(user) || src.loc != user || vac_power < 2 || !output_atom) //Cancel if moved/unpowered/dropped
|
||||
|
||||
if(vac_owner) //Embedded vacs have special handling.
|
||||
var/turf/item_turf = get_turf(src)
|
||||
if(vac_power < 2 || !output_atom || (!target.Adjacent(user) && !item_turf.Adjacent(target))) //Swoopie vacs check to see if you're adjacent to the person holding the vac OR the swoopie itself.
|
||||
return
|
||||
else if(!target.Adjacent(user) || src.loc != user || vac_power < 2 || !output_atom) //Cancel if moved/unpowered/dropped
|
||||
return
|
||||
|
||||
if(!is_allowed_suck(target, user, output_atom)) //cancel if you're not allowed
|
||||
return
|
||||
target.SpinAnimation(5,1)
|
||||
@@ -277,8 +287,14 @@
|
||||
if(target_turf && target.loc != target_turf)
|
||||
return
|
||||
var/atom/movable/output_atom = output_dest?.resolve()
|
||||
if(!target.Adjacent(user) || src.loc != user || vac_power < 2 || !output_atom) //Cancel if moved/unpowered/dropped
|
||||
|
||||
if(vac_owner)
|
||||
var/turf/item_turf = get_turf(src)
|
||||
if(vac_power < 2 || !output_atom || (!target.Adjacent(user) && !item_turf.Adjacent(target))) //Swoopie vacs check to see if you're adjacent to the person holding the vac OR the swoopie itself.
|
||||
return
|
||||
else if(!target.Adjacent(user) || src.loc != user || vac_power < 2 || !output_atom) //Cancel if moved/unpowered/dropped
|
||||
return
|
||||
|
||||
if(!is_allowed_suck(target, user, output_atom)) //Does it obey restrictions on what the target could otherwise consume?
|
||||
return
|
||||
if(isitem(target))
|
||||
|
||||
@@ -43,6 +43,9 @@
|
||||
var/mob/living/carbon/human/leash_master = leash_master_ref?.resolve()
|
||||
if(!leash_pet)
|
||||
return
|
||||
if(leash_pet.absorbed) //Glrk'd
|
||||
clear_leash()
|
||||
return
|
||||
if(!is_wearing_collar(leash_pet)) //The pet has slipped their collar and is not the pet anymore.
|
||||
leash_pet.visible_message(
|
||||
span_warning("[leash_pet] has slipped out of [leash_pet.p_their()] collar!"),
|
||||
@@ -109,6 +112,9 @@
|
||||
var/mob/living/carbon/human/leash_master = leash_master_ref?.resolve()
|
||||
if(!leash_pet || leash_master) //No pet, no tug.
|
||||
return
|
||||
if(leash_pet.absorbed) //Glrk'd.
|
||||
clear_leash()
|
||||
return
|
||||
//Yank the pet. Yank em in close.
|
||||
apply_tug_mob_to_mob(leash_pet, leash_master, 1)
|
||||
|
||||
@@ -119,6 +125,9 @@
|
||||
//Make sure the dom still has a pet
|
||||
if(!leash_master || !leash_pet)
|
||||
return
|
||||
if(leash_pet.absorbed)
|
||||
clear_leash()
|
||||
return
|
||||
addtimer(CALLBACK(src, PROC_REF(after_master_move)), 0.2 SECONDS)
|
||||
|
||||
/obj/item/leash/proc/after_master_move()
|
||||
@@ -132,7 +141,7 @@
|
||||
|
||||
//Knock the pet over if they get further behind. Shouldn't happen too often.
|
||||
sleep(3) //This way running normally won't just yank the pet to the ground.
|
||||
if(!leash_master || !leash_pet) //Just to stop error messages. Break the loop early if something removed the master
|
||||
if(!leash_master || !leash_pet || leash_pet.absorbed) //Just to stop error messages. Break the loop early if something removed the master
|
||||
clear_leash()
|
||||
return
|
||||
if(get_dist(leash_pet, leash_master) > 3 && !leash_pet.stunned)
|
||||
@@ -144,7 +153,7 @@
|
||||
|
||||
//This code is to check if the pet has gotten too far away, and then break the leash.
|
||||
sleep(3) //Wait to snap the leash
|
||||
if(!leash_master || !leash_pet) //Just to stop error messages
|
||||
if(!leash_master || !leash_pet || leash_pet.absorbed) //Just to stop error messages
|
||||
clear_leash()
|
||||
return
|
||||
if(get_dist(leash_pet, leash_master) > 5)
|
||||
@@ -171,7 +180,7 @@
|
||||
/obj/item/leash/proc/after_pet_move()
|
||||
var/mob/living/carbon/human/leash_pet = leash_pet_ref?.resolve()
|
||||
var/mob/living/carbon/human/leash_master = leash_master_ref?.resolve()
|
||||
if(!leash_master || !leash_pet)
|
||||
if(!leash_master || !leash_pet || leash_pet.absorbed)
|
||||
return
|
||||
for(var/i in 3 to get_dist(leash_pet, leash_master)) // Move the pet to a minimum of 2 tiles away from the master, so the pet trails behind them.
|
||||
step_towards(leash_pet, leash_master)
|
||||
@@ -181,7 +190,7 @@
|
||||
. = ..()
|
||||
var/mob/living/carbon/human/leash_pet = leash_pet_ref?.resolve()
|
||||
var/mob/living/carbon/human/leash_master = leash_master_ref?.resolve()
|
||||
if(!leash_pet || !leash_master) //There is no pet. Stop this silliness
|
||||
if(!leash_pet || !leash_master || leash_pet.absorbed) //There is no pet. Stop this silliness
|
||||
clear_leash()
|
||||
return
|
||||
//Dropping procs any time the leash changes slots. So, we will wait a tick and see if the leash was actually dropped
|
||||
@@ -216,6 +225,9 @@
|
||||
/obj/item/leash/proc/struggle_leash()
|
||||
var/mob/living/carbon/human/leash_pet = leash_pet_ref?.resolve()
|
||||
var/mob/living/carbon/human/leash_master = leash_master_ref?.resolve()
|
||||
if(leash_pet && leash_pet.absorbed)
|
||||
clear_leash()
|
||||
return
|
||||
leash_pet.visible_message(span_danger("\The [leash_pet] is attempting to unhook [leash_pet.p_their()] leash!"), span_danger("You attempt to unhook your leash"))
|
||||
add_attack_logs(leash_master,leash_pet,"Self-unleash (attempt)")
|
||||
|
||||
|
||||
@@ -252,6 +252,7 @@
|
||||
|
||||
charge = 100
|
||||
maxcharge = 100
|
||||
item_flags = ABSTRACT
|
||||
|
||||
var/mob/living/carbon/human/hume
|
||||
|
||||
|
||||
Reference in New Issue
Block a user