mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-10 23:47:16 +01:00
Merge remote-tracking branch 'upstream/master' into nanites
This commit is contained in:
+363
-363
@@ -1,363 +1,363 @@
|
||||
#define CONFUSION_STACK_MAX_MULTIPLIER 2
|
||||
/obj/item/assembly/flash
|
||||
name = "flash"
|
||||
desc = "A powerful and versatile flashbulb device, with applications ranging from disorienting attackers to acting as visual receptors in robot production."
|
||||
icon_state = "flash"
|
||||
item_state = "flashtool"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
|
||||
throwforce = 0
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
materials = list(MAT_METAL = 300, MAT_GLASS = 300)
|
||||
crit_fail = FALSE //Is the flash burnt out?
|
||||
light_color = LIGHT_COLOR_WHITE
|
||||
light_power = FLASH_LIGHT_POWER
|
||||
var/flashing_overlay = "flash-f"
|
||||
var/times_used = 0 //Number of times it's been used.
|
||||
var/burnout_resistance = 0
|
||||
var/last_used = 0 //last world.time it was used.
|
||||
var/cooldown = 0
|
||||
var/last_trigger = 0 //Last time it was successfully triggered.
|
||||
|
||||
/obj/item/assembly/flash/suicide_act(mob/living/user)
|
||||
if (crit_fail)
|
||||
user.visible_message("<span class='suicide'>[user] raises \the [src] up to [user.p_their()] eyes and activates it ... but its burnt out!</span>")
|
||||
return SHAME
|
||||
else if (user.eye_blind)
|
||||
user.visible_message("<span class='suicide'>[user] raises \the [src] up to [user.p_their()] eyes and activates it ... but [user.p_theyre()] blind!</span>")
|
||||
return SHAME
|
||||
user.visible_message("<span class='suicide'>[user] raises \the [src] up to [user.p_their()] eyes and activates it! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
attack(user,user)
|
||||
return FIRELOSS
|
||||
|
||||
/obj/item/assembly/flash/update_icon(flash = FALSE)
|
||||
cut_overlays()
|
||||
attached_overlays = list()
|
||||
if(crit_fail)
|
||||
add_overlay("flashburnt")
|
||||
attached_overlays += "flashburnt"
|
||||
if(flash)
|
||||
add_overlay(flashing_overlay)
|
||||
attached_overlays += flashing_overlay
|
||||
addtimer(CALLBACK(src, .proc/update_icon), 5)
|
||||
if(holder)
|
||||
holder.update_icon()
|
||||
|
||||
/obj/item/assembly/flash/proc/clown_check(mob/living/carbon/human/user)
|
||||
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
|
||||
flash_carbon(user, user, 15, 0)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/assembly/flash/proc/burn_out() //Made so you can override it if you want to have an invincible flash from R&D or something.
|
||||
if(!crit_fail)
|
||||
crit_fail = TRUE
|
||||
update_icon()
|
||||
if(ismob(loc))
|
||||
var/mob/M = loc
|
||||
M.visible_message("<span class='danger'>[src] burns out!</span>","<span class='userdanger'>[src] burns out!</span>")
|
||||
else
|
||||
var/turf/T = get_turf(src)
|
||||
T.visible_message("<span class='danger'>[src] burns out!</span>")
|
||||
|
||||
/obj/item/assembly/flash/proc/flash_recharge(interval = 10)
|
||||
var/deciseconds_passed = world.time - last_used
|
||||
for(var/seconds = deciseconds_passed / 10, seconds >= interval, seconds -= interval) //get 1 charge every interval
|
||||
times_used--
|
||||
last_used = world.time
|
||||
times_used = max(0, times_used) //sanity
|
||||
if(max(0, prob(times_used * 3) - burnout_resistance)) //The more often it's used in a short span of time the more likely it will burn out
|
||||
burn_out()
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
//BYPASS CHECKS ALSO PREVENTS BURNOUT!
|
||||
/obj/item/assembly/flash/proc/AOE_flash(bypass_checks = FALSE, range = 3, power = 5, targeted = FALSE, mob/user)
|
||||
if(!bypass_checks && !try_use_flash())
|
||||
return FALSE
|
||||
var/list/mob/targets = get_flash_targets(get_turf(src), range, FALSE)
|
||||
if(user)
|
||||
targets -= user
|
||||
for(var/mob/living/carbon/C in targets)
|
||||
flash_carbon(C, user, power, targeted, TRUE)
|
||||
return TRUE
|
||||
|
||||
/obj/item/assembly/flash/proc/get_flash_targets(atom/target_loc, range = 3, override_vision_checks = FALSE)
|
||||
if(!target_loc)
|
||||
target_loc = loc
|
||||
if(override_vision_checks)
|
||||
return get_hearers_in_view(range, get_turf(target_loc))
|
||||
if(isturf(target_loc) || (ismob(target_loc) && isturf(target_loc.loc)))
|
||||
return viewers(range, get_turf(target_loc))
|
||||
else
|
||||
return typecache_filter_list(target_loc.GetAllContents(), GLOB.typecache_living)
|
||||
|
||||
/obj/item/assembly/flash/proc/try_use_flash(mob/user = null)
|
||||
if(crit_fail || (world.time < last_trigger + cooldown))
|
||||
return FALSE
|
||||
last_trigger = world.time
|
||||
playsound(src, 'sound/weapons/flash.ogg', 100, TRUE)
|
||||
flash_lighting_fx(FLASH_LIGHT_RANGE, light_power, light_color)
|
||||
times_used++
|
||||
flash_recharge()
|
||||
update_icon(TRUE)
|
||||
if(user && !clown_check(user))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/assembly/flash/proc/flash_carbon(mob/living/carbon/M, mob/user, power = 15, targeted = TRUE, generic_message = FALSE)
|
||||
if(!istype(M))
|
||||
return
|
||||
if(user)
|
||||
log_combat(user, M, "[targeted? "flashed(targeted)" : "flashed(AOE)"]", src)
|
||||
else //caused by emp/remote signal
|
||||
M.log_message("was [targeted? "flashed(targeted)" : "flashed(AOE)"]",LOG_ATTACK)
|
||||
if(generic_message && M != user)
|
||||
to_chat(M, "<span class='disarm'>[src] emits a blinding light!</span>")
|
||||
if(targeted)
|
||||
if(M.flash_act(1, 1))
|
||||
if(M.confused < power)
|
||||
var/diff = power * CONFUSION_STACK_MAX_MULTIPLIER - M.confused
|
||||
M.confused += min(power, diff)
|
||||
if(user)
|
||||
terrible_conversion_proc(M, user)
|
||||
visible_message("<span class='disarm'>[user] blinds [M] with the flash!</span>")
|
||||
to_chat(user, "<span class='danger'>You blind [M] with the flash!</span>")
|
||||
to_chat(M, "<span class='userdanger'>[user] blinds you with the flash!</span>")
|
||||
else
|
||||
to_chat(M, "<span class='userdanger'>You are blinded by [src]!</span>")
|
||||
var/toblur = 20 - M.eye_blurry
|
||||
if(toblur > 0)
|
||||
M.blur_eyes(toblur)
|
||||
else if(user)
|
||||
visible_message("<span class='disarm'>[user] fails to blind [M] with the flash!</span>")
|
||||
to_chat(user, "<span class='warning'>You fail to blind [M] with the flash!</span>")
|
||||
to_chat(M, "<span class='danger'>[user] fails to blind you with the flash!</span>")
|
||||
else
|
||||
to_chat(M, "<span class='danger'>[src] fails to blind you!</span>")
|
||||
else
|
||||
if(M.flash_act())
|
||||
var/diff = power * CONFUSION_STACK_MAX_MULTIPLIER - M.confused
|
||||
M.confused += min(power, diff)
|
||||
|
||||
/obj/item/assembly/flash/attack(mob/living/M, mob/user)
|
||||
if(!try_use_flash(user))
|
||||
return FALSE
|
||||
if(iscarbon(M))
|
||||
flash_carbon(M, user, 20, 1)
|
||||
return TRUE
|
||||
else if(issilicon(M))
|
||||
var/mob/living/silicon/robot/R = M
|
||||
log_combat(user, R, "flashed", src)
|
||||
update_icon(1)
|
||||
R.Knockdown(rand(80,120))
|
||||
var/diff = 5 * CONFUSION_STACK_MAX_MULTIPLIER - M.confused
|
||||
R.confused += min(5, diff)
|
||||
R.flash_act(affect_silicon = 1)
|
||||
user.visible_message("<span class='disarm'>[user] overloads [R]'s sensors with the flash!</span>", "<span class='danger'>You overload [R]'s sensors with the flash!</span>")
|
||||
return TRUE
|
||||
|
||||
user.visible_message("<span class='disarm'>[user] fails to blind [M] with the flash!</span>", "<span class='warning'>You fail to blind [M] with the flash!</span>")
|
||||
|
||||
/obj/item/assembly/flash/attack_self(mob/living/carbon/user, flag = 0, emp = 0)
|
||||
if(holder)
|
||||
return FALSE
|
||||
if(!AOE_flash(FALSE, 3, 5, FALSE, user))
|
||||
return FALSE
|
||||
to_chat(user, "<span class='danger'>[src] emits a blinding light!</span>")
|
||||
|
||||
/obj/item/assembly/flash/emp_act(severity)
|
||||
. = ..()
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
return
|
||||
if(!try_use_flash())
|
||||
return
|
||||
AOE_flash()
|
||||
burn_out()
|
||||
|
||||
/obj/item/assembly/flash/activate()//AOE flash on signal received
|
||||
if(!..())
|
||||
return
|
||||
AOE_flash()
|
||||
|
||||
/obj/item/assembly/flash/proc/terrible_conversion_proc(mob/living/carbon/human/H, mob/user)
|
||||
if(istype(H) && ishuman(user) && H.stat != DEAD)
|
||||
if(user.mind)
|
||||
var/datum/antagonist/rev/head/converter = user.mind.has_antag_datum(/datum/antagonist/rev/head)
|
||||
if(!converter)
|
||||
return
|
||||
if(!H.client)
|
||||
to_chat(user, "<span class='warning'>This mind is so vacant that it is not susceptible to influence!</span>")
|
||||
return
|
||||
if(H.stat != CONSCIOUS)
|
||||
to_chat(user, "<span class='warning'>They must be conscious before you can convert [H.p_them()]!</span>")
|
||||
return
|
||||
if(converter.add_revolutionary(H.mind))
|
||||
times_used -- //Flashes less likely to burn out for headrevs when used for conversion
|
||||
else
|
||||
to_chat(user, "<span class='warning'>This mind seems resistant to the flash!</span>")
|
||||
|
||||
|
||||
/obj/item/assembly/flash/cyborg
|
||||
|
||||
/obj/item/assembly/flash/cyborg/attack(mob/living/M, mob/user)
|
||||
..()
|
||||
new /obj/effect/temp_visual/borgflash(get_turf(src))
|
||||
|
||||
/obj/item/assembly/flash/cyborg/attack_self(mob/user)
|
||||
..()
|
||||
new /obj/effect/temp_visual/borgflash(get_turf(src))
|
||||
|
||||
/obj/item/assembly/flash/cyborg/attackby(obj/item/W, mob/user, params)
|
||||
return
|
||||
/obj/item/assembly/flash/cyborg/screwdriver_act(mob/living/user, obj/item/I)
|
||||
return
|
||||
|
||||
/obj/item/assembly/flash/memorizer
|
||||
name = "memorizer"
|
||||
desc = "If you see this, you're not likely to remember it any time soon."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "memorizer"
|
||||
item_state = "nullrod"
|
||||
|
||||
/obj/item/assembly/flash/handheld //this is now the regular pocket flashes
|
||||
|
||||
/obj/item/assembly/flash/armimplant
|
||||
name = "photon projector"
|
||||
desc = "A high-powered photon projector implant normally used for lighting purposes, but also doubles as a flashbulb weapon. Self-repair protocols fix the flashbulb if it ever burns out."
|
||||
var/flashcd = 20
|
||||
var/overheat = 0
|
||||
var/obj/item/organ/cyberimp/arm/flash/I = null
|
||||
|
||||
/obj/item/assembly/flash/armimplant/burn_out()
|
||||
if(I && I.owner)
|
||||
to_chat(I.owner, "<span class='warning'>Your photon projector implant overheats and deactivates!</span>")
|
||||
I.Retract()
|
||||
overheat = TRUE
|
||||
addtimer(CALLBACK(src, .proc/cooldown), flashcd * 2)
|
||||
|
||||
/obj/item/assembly/flash/armimplant/try_use_flash(mob/user = null)
|
||||
if(overheat)
|
||||
if(I && I.owner)
|
||||
to_chat(I.owner, "<span class='warning'>Your photon projector is running too hot to be used again so quickly!</span>")
|
||||
return FALSE
|
||||
overheat = TRUE
|
||||
addtimer(CALLBACK(src, .proc/cooldown), flashcd)
|
||||
playsound(src, 'sound/weapons/flash.ogg', 100, TRUE)
|
||||
update_icon(1)
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/item/assembly/flash/armimplant/proc/cooldown()
|
||||
overheat = FALSE
|
||||
|
||||
/obj/item/assembly/flash/shield
|
||||
name = "strobe shield"
|
||||
desc = "A shield with a built in, high intensity light capable of blinding and disorienting suspects. Takes regular handheld flashes as bulbs."
|
||||
icon = 'icons/obj/items_and_weapons.dmi'
|
||||
icon_state = "flashshield"
|
||||
item_state = "flashshield"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
|
||||
slot_flags = ITEM_SLOT_BACK
|
||||
force = 10
|
||||
throwforce = 5
|
||||
throw_speed = 2
|
||||
throw_range = 3
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
materials = list(MAT_GLASS=7500, MAT_METAL=1000)
|
||||
attack_verb = list("shoved", "bashed")
|
||||
block_chance = 50
|
||||
armor = list("melee" = 50, "bullet" = 50, "laser" = 50, "energy" = 0, "bomb" = 30, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 70)
|
||||
|
||||
/obj/item/assembly/flash/shield/flash_recharge(interval=10)
|
||||
if(times_used >= 4)
|
||||
burn_out()
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/assembly/flash/shield/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/assembly/flash/handheld))
|
||||
var/obj/item/assembly/flash/handheld/flash = W
|
||||
if(flash.crit_fail)
|
||||
to_chat(user, "No sense replacing it with a broken bulb.")
|
||||
return
|
||||
else
|
||||
to_chat(user, "You begin to replace the bulb.")
|
||||
if(do_after(user, 20, target = src))
|
||||
if(flash.crit_fail || !flash || QDELETED(flash))
|
||||
return
|
||||
crit_fail = FALSE
|
||||
times_used = 0
|
||||
playsound(src, 'sound/items/deconstruct.ogg', 50, TRUE)
|
||||
update_icon()
|
||||
flash.crit_fail = TRUE
|
||||
flash.update_icon()
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/assembly/flash/shield/update_icon(flash = FALSE)
|
||||
icon_state = "flashshield"
|
||||
item_state = "flashshield"
|
||||
|
||||
if(crit_fail)
|
||||
icon_state = "riot"
|
||||
item_state = "riot"
|
||||
else if(flash)
|
||||
icon_state = "flashshield_flash"
|
||||
item_state = "flashshield_flash"
|
||||
addtimer(CALLBACK(src, .proc/update_icon), 5)
|
||||
|
||||
if(holder)
|
||||
holder.update_icon()
|
||||
|
||||
/obj/item/assembly/flash/shield/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
|
||||
activate()
|
||||
return ..()
|
||||
|
||||
//ported from tg - check to make sure it can't appear where it's not supposed to.
|
||||
/obj/item/assembly/flash/hypnotic
|
||||
desc = "A modified flash device, programmed to emit a sequence of subliminal flashes that can send a vulnerable target into a hypnotic trance."
|
||||
flashing_overlay = "flash-hypno" //I cannot find this icon no matter how hard I look in tg, so I might just make my own.
|
||||
light_color = LIGHT_COLOR_PINK
|
||||
cooldown = 20
|
||||
|
||||
/obj/item/assembly/flash/hypnotic/burn_out()
|
||||
return
|
||||
|
||||
/obj/item/assembly/flash/hypnotic/flash_carbon(mob/living/carbon/M, mob/user, power = 15, targeted = TRUE, generic_message = FALSE)
|
||||
if(!istype(M))
|
||||
return
|
||||
if(user)
|
||||
log_combat(user, M, "[targeted? "hypno-flashed(targeted)" : "hypno-flashed(AOE)"]", src)
|
||||
else //caused by emp/remote signal
|
||||
M.log_message("was [targeted? "hypno-flashed(targeted)" : "hypno-flashed(AOE)"]",LOG_ATTACK)
|
||||
if(generic_message && M != user)
|
||||
to_chat(M, "<span class='disarm'>[src] emits a soothing light...</span>")
|
||||
if(targeted)
|
||||
if(M.flash_act(1, 1))
|
||||
var/hypnosis = FALSE
|
||||
if(M.hypnosis_vulnerable())
|
||||
hypnosis = TRUE
|
||||
if(user)
|
||||
user.visible_message("<span class='disarm'>[user] blinds [M] with the flash!</span>", "<span class='danger'>You hypno-flash [M]!</span>")
|
||||
|
||||
if(!hypnosis)
|
||||
to_chat(M, "<span class='notice'>The light makes you feel oddly relaxed...</span>")
|
||||
M.confused += min(M.confused + 10, 20)
|
||||
M.dizziness += min(M.dizziness + 10, 20)
|
||||
M.drowsyness += min(M.drowsyness + 10, 20)
|
||||
M.apply_status_effect(STATUS_EFFECT_PACIFY, 100)
|
||||
else
|
||||
M.apply_status_effect(/datum/status_effect/trance, 200, TRUE)
|
||||
|
||||
else if(user)
|
||||
user.visible_message("<span class='disarm'>[user] fails to blind [M] with the flash!</span>", "<span class='warning'>You fail to hypno-flash [M]!</span>")
|
||||
else
|
||||
to_chat(M, "<span class='danger'>[src] fails to blind you!</span>")
|
||||
|
||||
else if(M.flash_act())
|
||||
to_chat(M, "<span class='notice'>Such a pretty light...</span>")
|
||||
M.confused += min(M.confused + 4, 20)
|
||||
M.dizziness += min(M.dizziness + 4, 20)
|
||||
M.drowsyness += min(M.drowsyness + 4, 20)
|
||||
#define CONFUSION_STACK_MAX_MULTIPLIER 2
|
||||
/obj/item/assembly/flash
|
||||
name = "flash"
|
||||
desc = "A powerful and versatile flashbulb device, with applications ranging from disorienting attackers to acting as visual receptors in robot production."
|
||||
icon_state = "flash"
|
||||
item_state = "flashtool"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
|
||||
throwforce = 0
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
materials = list(MAT_METAL = 300, MAT_GLASS = 300)
|
||||
crit_fail = FALSE //Is the flash burnt out?
|
||||
light_color = LIGHT_COLOR_WHITE
|
||||
light_power = FLASH_LIGHT_POWER
|
||||
var/flashing_overlay = "flash-f"
|
||||
var/times_used = 0 //Number of times it's been used.
|
||||
var/burnout_resistance = 0
|
||||
var/last_used = 0 //last world.time it was used.
|
||||
var/cooldown = 0
|
||||
var/last_trigger = 0 //Last time it was successfully triggered.
|
||||
|
||||
/obj/item/assembly/flash/suicide_act(mob/living/user)
|
||||
if (crit_fail)
|
||||
user.visible_message("<span class='suicide'>[user] raises \the [src] up to [user.p_their()] eyes and activates it ... but its burnt out!</span>")
|
||||
return SHAME
|
||||
else if (user.eye_blind)
|
||||
user.visible_message("<span class='suicide'>[user] raises \the [src] up to [user.p_their()] eyes and activates it ... but [user.p_theyre()] blind!</span>")
|
||||
return SHAME
|
||||
user.visible_message("<span class='suicide'>[user] raises \the [src] up to [user.p_their()] eyes and activates it! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
attack(user,user)
|
||||
return FIRELOSS
|
||||
|
||||
/obj/item/assembly/flash/update_icon(flash = FALSE)
|
||||
cut_overlays()
|
||||
attached_overlays = list()
|
||||
if(crit_fail)
|
||||
add_overlay("flashburnt")
|
||||
attached_overlays += "flashburnt"
|
||||
if(flash)
|
||||
add_overlay(flashing_overlay)
|
||||
attached_overlays += flashing_overlay
|
||||
addtimer(CALLBACK(src, /atom/.proc/update_icon), 5)
|
||||
if(holder)
|
||||
holder.update_icon()
|
||||
|
||||
/obj/item/assembly/flash/proc/clown_check(mob/living/carbon/human/user)
|
||||
if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
|
||||
flash_carbon(user, user, 15, 0)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/assembly/flash/proc/burn_out() //Made so you can override it if you want to have an invincible flash from R&D or something.
|
||||
if(!crit_fail)
|
||||
crit_fail = TRUE
|
||||
update_icon()
|
||||
if(ismob(loc))
|
||||
var/mob/M = loc
|
||||
M.visible_message("<span class='danger'>[src] burns out!</span>","<span class='userdanger'>[src] burns out!</span>")
|
||||
else
|
||||
var/turf/T = get_turf(src)
|
||||
T.visible_message("<span class='danger'>[src] burns out!</span>")
|
||||
|
||||
/obj/item/assembly/flash/proc/flash_recharge(interval = 10)
|
||||
var/deciseconds_passed = world.time - last_used
|
||||
for(var/seconds = deciseconds_passed / 10, seconds >= interval, seconds -= interval) //get 1 charge every interval
|
||||
times_used--
|
||||
last_used = world.time
|
||||
times_used = max(0, times_used) //sanity
|
||||
if(max(0, prob(times_used * 3) - burnout_resistance)) //The more often it's used in a short span of time the more likely it will burn out
|
||||
burn_out()
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
//BYPASS CHECKS ALSO PREVENTS BURNOUT!
|
||||
/obj/item/assembly/flash/proc/AOE_flash(bypass_checks = FALSE, range = 3, power = 5, targeted = FALSE, mob/user)
|
||||
if(!bypass_checks && !try_use_flash())
|
||||
return FALSE
|
||||
var/list/mob/targets = get_flash_targets(get_turf(src), range, FALSE)
|
||||
if(user)
|
||||
targets -= user
|
||||
for(var/mob/living/carbon/C in targets)
|
||||
flash_carbon(C, user, power, targeted, TRUE)
|
||||
return TRUE
|
||||
|
||||
/obj/item/assembly/flash/proc/get_flash_targets(atom/target_loc, range = 3, override_vision_checks = FALSE)
|
||||
if(!target_loc)
|
||||
target_loc = loc
|
||||
if(override_vision_checks)
|
||||
return get_hearers_in_view(range, get_turf(target_loc))
|
||||
if(isturf(target_loc) || (ismob(target_loc) && isturf(target_loc.loc)))
|
||||
return viewers(range, get_turf(target_loc))
|
||||
else
|
||||
return typecache_filter_list(target_loc.GetAllContents(), GLOB.typecache_living)
|
||||
|
||||
/obj/item/assembly/flash/proc/try_use_flash(mob/user = null)
|
||||
if(crit_fail || (world.time < last_trigger + cooldown))
|
||||
return FALSE
|
||||
last_trigger = world.time
|
||||
playsound(src, 'sound/weapons/flash.ogg', 100, TRUE)
|
||||
flash_lighting_fx(FLASH_LIGHT_RANGE, light_power, light_color)
|
||||
times_used++
|
||||
flash_recharge()
|
||||
update_icon(TRUE)
|
||||
if(user && !clown_check(user))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/assembly/flash/proc/flash_carbon(mob/living/carbon/M, mob/user, power = 15, targeted = TRUE, generic_message = FALSE)
|
||||
if(!istype(M))
|
||||
return
|
||||
if(user)
|
||||
log_combat(user, M, "[targeted? "flashed(targeted)" : "flashed(AOE)"]", src)
|
||||
else //caused by emp/remote signal
|
||||
M.log_message("was [targeted? "flashed(targeted)" : "flashed(AOE)"]",LOG_ATTACK)
|
||||
if(generic_message && M != user)
|
||||
to_chat(M, "<span class='disarm'>[src] emits a blinding light!</span>")
|
||||
if(targeted)
|
||||
if(M.flash_act(1, 1))
|
||||
if(M.confused < power)
|
||||
var/diff = power * CONFUSION_STACK_MAX_MULTIPLIER - M.confused
|
||||
M.confused += min(power, diff)
|
||||
if(user)
|
||||
terrible_conversion_proc(M, user)
|
||||
visible_message("<span class='disarm'>[user] blinds [M] with the flash!</span>")
|
||||
to_chat(user, "<span class='danger'>You blind [M] with the flash!</span>")
|
||||
to_chat(M, "<span class='userdanger'>[user] blinds you with the flash!</span>")
|
||||
else
|
||||
to_chat(M, "<span class='userdanger'>You are blinded by [src]!</span>")
|
||||
var/toblur = 20 - M.eye_blurry
|
||||
if(toblur > 0)
|
||||
M.blur_eyes(toblur)
|
||||
else if(user)
|
||||
visible_message("<span class='disarm'>[user] fails to blind [M] with the flash!</span>")
|
||||
to_chat(user, "<span class='warning'>You fail to blind [M] with the flash!</span>")
|
||||
to_chat(M, "<span class='danger'>[user] fails to blind you with the flash!</span>")
|
||||
else
|
||||
to_chat(M, "<span class='danger'>[src] fails to blind you!</span>")
|
||||
else
|
||||
if(M.flash_act())
|
||||
var/diff = power * CONFUSION_STACK_MAX_MULTIPLIER - M.confused
|
||||
M.confused += min(power, diff)
|
||||
|
||||
/obj/item/assembly/flash/attack(mob/living/M, mob/user)
|
||||
if(!try_use_flash(user))
|
||||
return FALSE
|
||||
if(iscarbon(M))
|
||||
flash_carbon(M, user, 20, 1)
|
||||
return TRUE
|
||||
else if(issilicon(M))
|
||||
var/mob/living/silicon/robot/R = M
|
||||
log_combat(user, R, "flashed", src)
|
||||
update_icon(1)
|
||||
R.Knockdown(rand(80,120))
|
||||
var/diff = 5 * CONFUSION_STACK_MAX_MULTIPLIER - M.confused
|
||||
R.confused += min(5, diff)
|
||||
R.flash_act(affect_silicon = 1)
|
||||
user.visible_message("<span class='disarm'>[user] overloads [R]'s sensors with the flash!</span>", "<span class='danger'>You overload [R]'s sensors with the flash!</span>")
|
||||
return TRUE
|
||||
|
||||
user.visible_message("<span class='disarm'>[user] fails to blind [M] with the flash!</span>", "<span class='warning'>You fail to blind [M] with the flash!</span>")
|
||||
|
||||
/obj/item/assembly/flash/attack_self(mob/living/carbon/user, flag = 0, emp = 0)
|
||||
if(holder)
|
||||
return FALSE
|
||||
if(!AOE_flash(FALSE, 3, 5, FALSE, user))
|
||||
return FALSE
|
||||
to_chat(user, "<span class='danger'>[src] emits a blinding light!</span>")
|
||||
|
||||
/obj/item/assembly/flash/emp_act(severity)
|
||||
. = ..()
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
return
|
||||
if(!try_use_flash())
|
||||
return
|
||||
AOE_flash()
|
||||
burn_out()
|
||||
|
||||
/obj/item/assembly/flash/activate()//AOE flash on signal received
|
||||
if(!..())
|
||||
return
|
||||
AOE_flash()
|
||||
|
||||
/obj/item/assembly/flash/proc/terrible_conversion_proc(mob/living/carbon/human/H, mob/user)
|
||||
if(istype(H) && ishuman(user) && H.stat != DEAD)
|
||||
if(user.mind)
|
||||
var/datum/antagonist/rev/head/converter = user.mind.has_antag_datum(/datum/antagonist/rev/head)
|
||||
if(!converter)
|
||||
return
|
||||
if(!H.client)
|
||||
to_chat(user, "<span class='warning'>This mind is so vacant that it is not susceptible to influence!</span>")
|
||||
return
|
||||
if(H.stat != CONSCIOUS)
|
||||
to_chat(user, "<span class='warning'>They must be conscious before you can convert [H.p_them()]!</span>")
|
||||
return
|
||||
if(converter.add_revolutionary(H.mind))
|
||||
times_used -- //Flashes less likely to burn out for headrevs when used for conversion
|
||||
else
|
||||
to_chat(user, "<span class='warning'>This mind seems resistant to the flash!</span>")
|
||||
|
||||
|
||||
/obj/item/assembly/flash/cyborg
|
||||
|
||||
/obj/item/assembly/flash/cyborg/attack(mob/living/M, mob/user)
|
||||
..()
|
||||
new /obj/effect/temp_visual/borgflash(get_turf(src))
|
||||
|
||||
/obj/item/assembly/flash/cyborg/attack_self(mob/user)
|
||||
..()
|
||||
new /obj/effect/temp_visual/borgflash(get_turf(src))
|
||||
|
||||
/obj/item/assembly/flash/cyborg/attackby(obj/item/W, mob/user, params)
|
||||
return
|
||||
/obj/item/assembly/flash/cyborg/screwdriver_act(mob/living/user, obj/item/I)
|
||||
return
|
||||
|
||||
/obj/item/assembly/flash/memorizer
|
||||
name = "memorizer"
|
||||
desc = "If you see this, you're not likely to remember it any time soon."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "memorizer"
|
||||
item_state = "nullrod"
|
||||
|
||||
/obj/item/assembly/flash/handheld //this is now the regular pocket flashes
|
||||
|
||||
/obj/item/assembly/flash/armimplant
|
||||
name = "photon projector"
|
||||
desc = "A high-powered photon projector implant normally used for lighting purposes, but also doubles as a flashbulb weapon. Self-repair protocols fix the flashbulb if it ever burns out."
|
||||
var/flashcd = 20
|
||||
var/overheat = 0
|
||||
var/obj/item/organ/cyberimp/arm/flash/I = null
|
||||
|
||||
/obj/item/assembly/flash/armimplant/burn_out()
|
||||
if(I && I.owner)
|
||||
to_chat(I.owner, "<span class='warning'>Your photon projector implant overheats and deactivates!</span>")
|
||||
I.Retract()
|
||||
overheat = TRUE
|
||||
addtimer(CALLBACK(src, .proc/cooldown), flashcd * 2)
|
||||
|
||||
/obj/item/assembly/flash/armimplant/try_use_flash(mob/user = null)
|
||||
if(overheat)
|
||||
if(I && I.owner)
|
||||
to_chat(I.owner, "<span class='warning'>Your photon projector is running too hot to be used again so quickly!</span>")
|
||||
return FALSE
|
||||
overheat = TRUE
|
||||
addtimer(CALLBACK(src, .proc/cooldown), flashcd)
|
||||
playsound(src, 'sound/weapons/flash.ogg', 100, TRUE)
|
||||
update_icon(1)
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/item/assembly/flash/armimplant/proc/cooldown()
|
||||
overheat = FALSE
|
||||
|
||||
/obj/item/assembly/flash/shield
|
||||
name = "strobe shield"
|
||||
desc = "A shield with a built in, high intensity light capable of blinding and disorienting suspects. Takes regular handheld flashes as bulbs."
|
||||
icon = 'icons/obj/items_and_weapons.dmi'
|
||||
icon_state = "flashshield"
|
||||
item_state = "flashshield"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/shields_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/shields_righthand.dmi'
|
||||
slot_flags = ITEM_SLOT_BACK
|
||||
force = 10
|
||||
throwforce = 5
|
||||
throw_speed = 2
|
||||
throw_range = 3
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
materials = list(MAT_GLASS=7500, MAT_METAL=1000)
|
||||
attack_verb = list("shoved", "bashed")
|
||||
block_chance = 50
|
||||
armor = list("melee" = 50, "bullet" = 50, "laser" = 50, "energy" = 0, "bomb" = 30, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 70)
|
||||
|
||||
/obj/item/assembly/flash/shield/flash_recharge(interval=10)
|
||||
if(times_used >= 4)
|
||||
burn_out()
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/item/assembly/flash/shield/attackby(obj/item/W, mob/user)
|
||||
if(istype(W, /obj/item/assembly/flash/handheld))
|
||||
var/obj/item/assembly/flash/handheld/flash = W
|
||||
if(flash.crit_fail)
|
||||
to_chat(user, "No sense replacing it with a broken bulb.")
|
||||
return
|
||||
else
|
||||
to_chat(user, "You begin to replace the bulb.")
|
||||
if(do_after(user, 20, target = src))
|
||||
if(flash.crit_fail || !flash || QDELETED(flash))
|
||||
return
|
||||
crit_fail = FALSE
|
||||
times_used = 0
|
||||
playsound(src, 'sound/items/deconstruct.ogg', 50, TRUE)
|
||||
update_icon()
|
||||
flash.crit_fail = TRUE
|
||||
flash.update_icon()
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/assembly/flash/shield/update_icon(flash = FALSE)
|
||||
icon_state = "flashshield"
|
||||
item_state = "flashshield"
|
||||
|
||||
if(crit_fail)
|
||||
icon_state = "riot"
|
||||
item_state = "riot"
|
||||
else if(flash)
|
||||
icon_state = "flashshield_flash"
|
||||
item_state = "flashshield_flash"
|
||||
addtimer(CALLBACK(src, /atom/.proc/update_icon), 5)
|
||||
|
||||
if(holder)
|
||||
holder.update_icon()
|
||||
|
||||
/obj/item/assembly/flash/shield/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
|
||||
activate()
|
||||
return ..()
|
||||
|
||||
//ported from tg - check to make sure it can't appear where it's not supposed to.
|
||||
/obj/item/assembly/flash/hypnotic
|
||||
desc = "A modified flash device, programmed to emit a sequence of subliminal flashes that can send a vulnerable target into a hypnotic trance."
|
||||
flashing_overlay = "flash-hypno" //I cannot find this icon no matter how hard I look in tg, so I might just make my own.
|
||||
light_color = LIGHT_COLOR_PINK
|
||||
cooldown = 20
|
||||
|
||||
/obj/item/assembly/flash/hypnotic/burn_out()
|
||||
return
|
||||
|
||||
/obj/item/assembly/flash/hypnotic/flash_carbon(mob/living/carbon/M, mob/user, power = 15, targeted = TRUE, generic_message = FALSE)
|
||||
if(!istype(M))
|
||||
return
|
||||
if(user)
|
||||
log_combat(user, M, "[targeted? "hypno-flashed(targeted)" : "hypno-flashed(AOE)"]", src)
|
||||
else //caused by emp/remote signal
|
||||
M.log_message("was [targeted? "hypno-flashed(targeted)" : "hypno-flashed(AOE)"]",LOG_ATTACK)
|
||||
if(generic_message && M != user)
|
||||
to_chat(M, "<span class='disarm'>[src] emits a soothing light...</span>")
|
||||
if(targeted)
|
||||
if(M.flash_act(1, 1))
|
||||
var/hypnosis = FALSE
|
||||
if(M.hypnosis_vulnerable())
|
||||
hypnosis = TRUE
|
||||
if(user)
|
||||
user.visible_message("<span class='disarm'>[user] blinds [M] with the flash!</span>", "<span class='danger'>You hypno-flash [M]!</span>")
|
||||
|
||||
if(!hypnosis)
|
||||
to_chat(M, "<span class='notice'>The light makes you feel oddly relaxed...</span>")
|
||||
M.confused += min(M.confused + 10, 20)
|
||||
M.dizziness += min(M.dizziness + 10, 20)
|
||||
M.drowsyness += min(M.drowsyness + 10, 20)
|
||||
M.apply_status_effect(STATUS_EFFECT_PACIFY, 100)
|
||||
else
|
||||
M.apply_status_effect(/datum/status_effect/trance, 200, TRUE)
|
||||
|
||||
else if(user)
|
||||
user.visible_message("<span class='disarm'>[user] fails to blind [M] with the flash!</span>", "<span class='warning'>You fail to hypno-flash [M]!</span>")
|
||||
else
|
||||
to_chat(M, "<span class='danger'>[src] fails to blind you!</span>")
|
||||
|
||||
else if(M.flash_act())
|
||||
to_chat(M, "<span class='notice'>Such a pretty light...</span>")
|
||||
M.confused += min(M.confused + 4, 20)
|
||||
M.dizziness += min(M.dizziness + 4, 20)
|
||||
M.drowsyness += min(M.drowsyness + 4, 20)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
name = linked_pod.name
|
||||
. = ..()
|
||||
|
||||
/mob/living/simple_animal/pet/gondola/gondolapod/proc/update_icon()
|
||||
/mob/living/simple_animal/pet/gondola/gondolapod/update_icon_state()
|
||||
if(opened)
|
||||
icon_state = "gondolapod_open"
|
||||
else
|
||||
|
||||
@@ -59,6 +59,21 @@
|
||||
crate_name = "radiation protection crate"
|
||||
crate_type = /obj/structure/closet/crate/radiation
|
||||
|
||||
/datum/supply_pack/emergency/radiatione_emergency_bikini
|
||||
name = "Emergenc Beach Radiation Protection Crate"
|
||||
desc = "Survive(?) the Nuclear Summer and Supermatter Engine alike with two sets of Radkinis. Each set contains a mask, bikini, and Geiger counter. We'll even throw in a few pill bottles that are able to handles radiation and the affects of the poisoning."
|
||||
cost = 2000
|
||||
contains = list(/obj/item/clothing/mask/gas/radmask,
|
||||
/obj/item/clothing/mask/gas/radmask,
|
||||
/obj/item/clothing/under/radkini,
|
||||
/obj/item/clothing/under/radkini,
|
||||
/obj/item/geiger_counter,
|
||||
/obj/item/geiger_counter,
|
||||
/obj/item/storage/pill_bottle/mutarad,
|
||||
/obj/item/storage/firstaid/radbgone)
|
||||
crate_name = "beach radiation protection crate"
|
||||
crate_type = /obj/structure/closet/crate/radiation
|
||||
|
||||
/datum/supply_pack/emergency/rcds
|
||||
name = "Emergency RCDs"
|
||||
desc = "Bombs going off on station? SME blown and now you need to fix the hole it left behind? Well this crate has a pare of Rcds to be able to easily fix up any problem you may have!"
|
||||
|
||||
@@ -29,4 +29,10 @@
|
||||
name = "silver ring"
|
||||
item_state = "sring"
|
||||
icon_state = "ringsilver"
|
||||
desc = "A tiny silver ring, sized to wrap around a finger."
|
||||
desc = "A tiny silver ring, sized to wrap around a finger."
|
||||
|
||||
/obj/item/clothing/gloves/ring/lyricalpaws
|
||||
name = "Ornate Wedding Ring"
|
||||
item_state = "dring"
|
||||
icon_state = "ringpaws"
|
||||
desc = "A worn golden ring emblazoned with a finely cut Emerald and Ruby alongside each other. The inside of the ring has the phrase 'Per aspera ad astra.' engraved in to it."
|
||||
@@ -216,3 +216,14 @@
|
||||
A.UpdateButtonIcon()
|
||||
to_chat(M, "The Tiki Mask has now changed into the [choice] Mask!")
|
||||
return 1
|
||||
|
||||
//lewd(?) masks
|
||||
|
||||
/obj/item/clothing/mask/gas/radmask
|
||||
name = "radiation mask"
|
||||
desc = "An mask that somewhat protects the user from ratiation. Not as effective like a radiation hood, but is better than nothing."
|
||||
icon_state = "radmask"
|
||||
item_state = "radmask"
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0,"energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 30, "fire" = 10, "acid" = 10)
|
||||
|
||||
|
||||
|
||||
@@ -80,4 +80,15 @@
|
||||
item_color = "robotics_skirt"
|
||||
body_parts_covered = CHEST|GROIN|ARMS
|
||||
can_adjust = FALSE
|
||||
fitted = FEMALE_UNIFORM_TOP
|
||||
fitted = FEMALE_UNIFORM_TOP
|
||||
|
||||
/obj/item/clothing/under/radkini
|
||||
name = "radkini"
|
||||
desc = "A bikini that protects against radiation. It's surprisingly effective thanks to bluespace fabric, however is still recommended to wear it with a radiation suit."
|
||||
icon_state = "radkini"
|
||||
item_state = "radkini"
|
||||
item_color = "radkini"
|
||||
can_adjust = FALSE
|
||||
body_parts_covered = CHEST|GROIN
|
||||
armor = list("melee" = 0, "bullet" = 0, "laser" = 0,"energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 50, "fire" = 10, "acid" = 10)
|
||||
fitted = FEMALE_UNIFORM_TOP
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
mix_filling_color(S)
|
||||
S.reagents.trans_to(src,min(S.reagents.total_volume, 15)) //limit of 15, we don't want our custom food to be completely filled by just one ingredient with large reagent volume.
|
||||
foodtype |= S.foodtype
|
||||
update_overlays(S)
|
||||
update_snack_overlays(S)
|
||||
to_chat(user, "<span class='notice'>You add the [I.name] to the [name].</span>")
|
||||
update_name(S)
|
||||
else
|
||||
@@ -101,7 +101,7 @@
|
||||
rgbcolor[4] = (customcolor[4]+ingcolor[4])/2
|
||||
filling_color = rgb(rgbcolor[1], rgbcolor[2], rgbcolor[3], rgbcolor[4])
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/customizable/update_overlays(obj/item/reagent_containers/food/snacks/S)
|
||||
/obj/item/reagent_containers/food/snacks/customizable/update_snack_overlays(obj/item/reagent_containers/food/snacks/S)
|
||||
var/mutable_appearance/filling = mutable_appearance(icon, "[initial(icon_state)]_filling")
|
||||
if(S.filling_color == "#FFFFFF")
|
||||
filling.color = pick("#FF0000","#0000FF","#008000","#FFFF00")
|
||||
@@ -137,7 +137,7 @@
|
||||
/obj/item/reagent_containers/food/snacks/customizable/initialize_slice(obj/item/reagent_containers/food/snacks/slice, reagents_per_slice)
|
||||
..()
|
||||
slice.filling_color = filling_color
|
||||
slice.update_overlays(src)
|
||||
slice.update_snack_overlays(src)
|
||||
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/customizable/Destroy()
|
||||
|
||||
@@ -267,7 +267,7 @@ All foods are distributed among various categories. Use common sense.
|
||||
trash = null
|
||||
return
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/proc/update_overlays(obj/item/reagent_containers/food/snacks/S)
|
||||
/obj/item/reagent_containers/food/snacks/proc/update_snack_overlays(obj/item/reagent_containers/food/snacks/S)
|
||||
cut_overlays()
|
||||
var/mutable_appearance/filling = mutable_appearance(icon, "[initial(icon_state)]_filling")
|
||||
if(S.filling_color == "#FFFFFF")
|
||||
|
||||
@@ -822,13 +822,13 @@
|
||||
to_chat(user, "<span class='notice'>You add the [I] to the [name].</span>")
|
||||
P.name = initial(P.name)
|
||||
contents += P
|
||||
update_overlays(P)
|
||||
update_snack_overlays(P)
|
||||
if (P.contents.len)
|
||||
for(var/V in P.contents)
|
||||
P = V
|
||||
P.name = initial(P.name)
|
||||
contents += P
|
||||
update_overlays(P)
|
||||
update_snack_overlays(P)
|
||||
P = I
|
||||
clearlist(P.contents)
|
||||
return
|
||||
@@ -837,7 +837,7 @@
|
||||
return O.attackby(I, user, params)
|
||||
..()
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/pancakes/update_overlays(obj/item/reagent_containers/food/snacks/P)
|
||||
/obj/item/reagent_containers/food/snacks/pancakes/update_snack_overlays(obj/item/reagent_containers/food/snacks/P)
|
||||
var/mutable_appearance/pancake = mutable_appearance(icon, "[P.item_state]_[rand(1,3)]")
|
||||
pancake.pixel_x = rand(-1,1)
|
||||
pancake.pixel_y = 3 * contents.len - 1
|
||||
|
||||
@@ -111,11 +111,10 @@
|
||||
|
||||
/turf/open/floor/holofloor/carpet/Initialize()
|
||||
. = ..()
|
||||
addtimer(CALLBACK(src, .proc/update_icon), 1)
|
||||
addtimer(CALLBACK(src, /atom/.proc/update_icon), 1)
|
||||
|
||||
/turf/open/floor/holofloor/carpet/update_icon()
|
||||
if(!..())
|
||||
return 0
|
||||
. = ..()
|
||||
if(intact)
|
||||
queue_smooth(src)
|
||||
|
||||
|
||||
@@ -175,7 +175,8 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
|
||||
* Hair will always update its dir, so if your sprite has no dirs the haircut will go all over the place.
|
||||
* |- Ricotez
|
||||
*/
|
||||
/mob/dead/observer/proc/update_icon(new_form)
|
||||
/mob/dead/observer/update_icon(new_form)
|
||||
. = ..()
|
||||
if(client) //We update our preferences in case they changed right before update_icon was called.
|
||||
ghost_accs = client.prefs.ghost_accs
|
||||
ghost_others = client.prefs.ghost_others
|
||||
|
||||
@@ -820,7 +820,7 @@
|
||||
robot_suit.head.flash2.burn_out()
|
||||
robot_suit.head.flash2 = null
|
||||
robot_suit.head = null
|
||||
robot_suit.updateicon()
|
||||
robot_suit.update_icon()
|
||||
else
|
||||
new /obj/item/robot_suit(T)
|
||||
new /obj/item/bodypart/l_leg/robot(T)
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
weapon.attack(C, src)
|
||||
playsound(src, 'sound/weapons/blade1.ogg', 50, TRUE, -1)
|
||||
if(C.stat == DEAD)
|
||||
addtimer(CALLBACK(src, .proc/update_icon), 2)
|
||||
addtimer(CALLBACK(src, /atom/.proc/update_icon), 2)
|
||||
back_to_idle()
|
||||
|
||||
|
||||
|
||||
@@ -852,7 +852,7 @@ Pass a positive integer as an argument to override a bot's default speed.
|
||||
ejectpai(usr)
|
||||
update_controls()
|
||||
|
||||
/mob/living/simple_animal/bot/proc/update_icon()
|
||||
/mob/living/simple_animal/bot/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][on]"
|
||||
|
||||
// Machinery to simplify topic and access calls
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
/mob/living/simple_animal/bot/honkbot/proc/sensor_blink()
|
||||
icon_state = "honkbot-c"
|
||||
addtimer(CALLBACK(src, .proc/update_icon), 5, TIMER_OVERRIDE|TIMER_UNIQUE)
|
||||
addtimer(CALLBACK(src, /atom/.proc/update_icon), 5, TIMER_OVERRIDE|TIMER_UNIQUE)
|
||||
|
||||
//honkbots react with sounds.
|
||||
/mob/living/simple_animal/bot/honkbot/proc/react_ping()
|
||||
@@ -177,7 +177,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]"},
|
||||
playsound(src, "honkbot_e", 50, 0)
|
||||
spam_flag = TRUE // prevent spam
|
||||
icon_state = "honkbot-e"
|
||||
addtimer(CALLBACK(src, .proc/update_icon), 30, TIMER_OVERRIDE|TIMER_UNIQUE)
|
||||
addtimer(CALLBACK(src, /atom/.proc/update_icon), 30, TIMER_OVERRIDE|TIMER_UNIQUE)
|
||||
addtimer(CALLBACK(src, .proc/spam_flag_false), cooldowntimehorn)
|
||||
|
||||
/mob/living/simple_animal/bot/honkbot/proc/honk_attack(mob/living/carbon/C) // horn attack
|
||||
|
||||
@@ -252,7 +252,7 @@ Auto Patrol: []"},
|
||||
var/judgement_criteria = judgement_criteria()
|
||||
playsound(src, 'sound/weapons/egloves.ogg', 50, TRUE, -1)
|
||||
icon_state = "secbot-c"
|
||||
addtimer(CALLBACK(src, .proc/update_icon), 2)
|
||||
addtimer(CALLBACK(src, /atom/.proc/update_icon), 2)
|
||||
var/threat = 5
|
||||
if(ishuman(C))
|
||||
C.stuttering = 5
|
||||
|
||||
@@ -392,14 +392,10 @@ mob/visible_message(message, self_message, blind_message, vision_distance = DEFA
|
||||
spintime -= speed
|
||||
|
||||
/mob/proc/update_pull_hud_icon()
|
||||
if(hud_used)
|
||||
if(hud_used.pull_icon)
|
||||
hud_used.pull_icon.update_icon(src)
|
||||
hud_used?.pull_icon?.update_icon()
|
||||
|
||||
/mob/proc/update_rest_hud_icon()
|
||||
if(hud_used)
|
||||
if(hud_used.rest_icon)
|
||||
hud_used.rest_icon.update_icon(src)
|
||||
hud_used?.rest_icon?.update_icon()
|
||||
|
||||
/mob/verb/mode()
|
||||
set name = "Activate Held Object"
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
I'll make some notes on where certain variable defines should probably go.
|
||||
Changing this around would probably require a good look-over the pre-existing code.
|
||||
*/
|
||||
var/zone_selected = null
|
||||
var/zone_selected = BODY_ZONE_CHEST
|
||||
|
||||
var/computer_id = null
|
||||
var/list/logging = list()
|
||||
|
||||
+408
-408
@@ -1,408 +1,408 @@
|
||||
/mob/CanPass(atom/movable/mover, turf/target)
|
||||
if((mover.pass_flags & PASSMOB))
|
||||
return TRUE
|
||||
if(istype(mover, /obj/item/projectile) || mover.throwing)
|
||||
return (!density || lying)
|
||||
if(buckled == mover)
|
||||
return TRUE
|
||||
if(ismob(mover))
|
||||
if (mover in buckled_mobs)
|
||||
return TRUE
|
||||
return (!mover.density || !density || lying || (mover.throwing && mover.throwing.thrower == src && !ismob(mover)))
|
||||
|
||||
//DO NOT USE THIS UNLESS YOU ABSOLUTELY HAVE TO. THIS IS BEING PHASED OUT FOR THE MOVESPEED MODIFICATION SYSTEM.
|
||||
//See mob_movespeed.dm
|
||||
/mob/proc/movement_delay() //update /living/movement_delay() if you change this
|
||||
return cached_multiplicative_slowdown
|
||||
|
||||
/client/verb/drop_item()
|
||||
set hidden = 1
|
||||
if(!iscyborg(mob) && mob.stat == CONSCIOUS)
|
||||
mob.dropItemToGround(mob.get_active_held_item())
|
||||
return
|
||||
|
||||
/client/proc/Move_object(direct)
|
||||
if(mob && mob.control_object)
|
||||
if(mob.control_object.density)
|
||||
step(mob.control_object,direct)
|
||||
if(!mob.control_object)
|
||||
return
|
||||
mob.control_object.setDir(direct)
|
||||
else
|
||||
mob.control_object.forceMove(get_step(mob.control_object,direct))
|
||||
|
||||
#define MOVEMENT_DELAY_BUFFER 0.75
|
||||
#define MOVEMENT_DELAY_BUFFER_DELTA 1.25
|
||||
|
||||
/client/Move(n, direct)
|
||||
if(world.time < move_delay) //do not move anything ahead of this check please
|
||||
return FALSE
|
||||
else
|
||||
next_move_dir_add = 0
|
||||
next_move_dir_sub = 0
|
||||
var/old_move_delay = move_delay
|
||||
move_delay = world.time + world.tick_lag //this is here because Move() can now be called mutiple times per tick
|
||||
if(!mob || !mob.loc)
|
||||
return FALSE
|
||||
if(!n || !direct)
|
||||
return FALSE
|
||||
if(mob.notransform)
|
||||
return FALSE //This is sota the goto stop mobs from moving var
|
||||
if(mob.control_object)
|
||||
return Move_object(direct)
|
||||
if(!isliving(mob))
|
||||
return mob.Move(n, direct)
|
||||
if(mob.stat == DEAD)
|
||||
mob.ghostize()
|
||||
return FALSE
|
||||
if(mob.force_moving)
|
||||
return FALSE
|
||||
|
||||
var/mob/living/L = mob //Already checked for isliving earlier
|
||||
if(L.incorporeal_move) //Move though walls
|
||||
Process_Incorpmove(direct)
|
||||
return FALSE
|
||||
|
||||
if(mob.remote_control) //we're controlling something, our movement is relayed to it
|
||||
return mob.remote_control.relaymove(mob, direct)
|
||||
|
||||
if(isAI(mob))
|
||||
return AIMove(n,direct,mob)
|
||||
|
||||
if(Process_Grab()) //are we restrained by someone's grip?
|
||||
return
|
||||
|
||||
if(mob.buckled) //if we're buckled to something, tell it we moved.
|
||||
return mob.buckled.relaymove(mob, direct)
|
||||
|
||||
if(!mob.canmove)
|
||||
return FALSE
|
||||
|
||||
if(isobj(mob.loc) || ismob(mob.loc)) //Inside an object, tell it we moved
|
||||
var/atom/O = mob.loc
|
||||
return O.relaymove(mob, direct)
|
||||
|
||||
if(!mob.Process_Spacemove(direct))
|
||||
return FALSE
|
||||
//We are now going to move
|
||||
var/add_delay = mob.movement_delay()
|
||||
mob.set_glide_size(DELAY_TO_GLIDE_SIZE(add_delay * (((direct & 3) && (direct & 12)) ? 2 : 1))) // set it now in case of pulled objects
|
||||
if(old_move_delay + (add_delay*MOVEMENT_DELAY_BUFFER_DELTA) + MOVEMENT_DELAY_BUFFER > world.time)
|
||||
move_delay = old_move_delay
|
||||
else
|
||||
move_delay = world.time
|
||||
var/oldloc = mob.loc
|
||||
|
||||
if(L.confused)
|
||||
var/newdir = 0
|
||||
if(L.confused > 40)
|
||||
newdir = pick(GLOB.alldirs)
|
||||
else if(prob(L.confused * 1.5))
|
||||
newdir = angle2dir(dir2angle(direct) + pick(90, -90))
|
||||
else if(prob(L.confused * 3))
|
||||
newdir = angle2dir(dir2angle(direct) + pick(45, -45))
|
||||
if(newdir)
|
||||
direct = newdir
|
||||
n = get_step(L, direct)
|
||||
|
||||
. = ..()
|
||||
|
||||
if((direct & (direct - 1)) && mob.loc == n) //moved diagonally successfully
|
||||
add_delay *= 1.66
|
||||
move_delay += add_delay
|
||||
mob.set_glide_size(DELAY_TO_GLIDE_SIZE(add_delay))
|
||||
if(.) // If mob is null here, we deserve the runtime
|
||||
if(mob.throwing)
|
||||
mob.throwing.finalize(FALSE)
|
||||
|
||||
for(var/obj/O in mob.user_movement_hooks)
|
||||
O.intercept_user_move(direct, mob, n, oldloc)
|
||||
|
||||
var/atom/movable/P = mob.pulling
|
||||
if(P && !ismob(P) && P.density)
|
||||
mob.setDir(turn(mob.dir, 180))
|
||||
|
||||
///Process_Grab()
|
||||
///Called by client/Move()
|
||||
///Checks to see if you are being grabbed and if so attemps to break it
|
||||
/client/proc/Process_Grab()
|
||||
if(mob.pulledby)
|
||||
if(mob.incapacitated(ignore_restraints = 1))
|
||||
move_delay = world.time + 10
|
||||
return TRUE
|
||||
else if(mob.restrained(ignore_grab = 1))
|
||||
move_delay = world.time + 10
|
||||
to_chat(src, "<span class='warning'>You're restrained! You can't move!</span>")
|
||||
return TRUE
|
||||
else
|
||||
return mob.resist_grab(1)
|
||||
|
||||
///Process_Incorpmove
|
||||
///Called by client/Move()
|
||||
///Allows mobs to run though walls
|
||||
/client/proc/Process_Incorpmove(direct)
|
||||
var/turf/mobloc = get_turf(mob)
|
||||
if(!isliving(mob))
|
||||
return
|
||||
var/mob/living/L = mob
|
||||
switch(L.incorporeal_move)
|
||||
if(INCORPOREAL_MOVE_BASIC)
|
||||
var/T = get_step(L,direct)
|
||||
if(T)
|
||||
L.forceMove(T)
|
||||
L.setDir(direct)
|
||||
if(INCORPOREAL_MOVE_SHADOW)
|
||||
if(prob(50))
|
||||
var/locx
|
||||
var/locy
|
||||
switch(direct)
|
||||
if(NORTH)
|
||||
locx = mobloc.x
|
||||
locy = (mobloc.y+2)
|
||||
if(locy>world.maxy)
|
||||
return
|
||||
if(SOUTH)
|
||||
locx = mobloc.x
|
||||
locy = (mobloc.y-2)
|
||||
if(locy<1)
|
||||
return
|
||||
if(EAST)
|
||||
locy = mobloc.y
|
||||
locx = (mobloc.x+2)
|
||||
if(locx>world.maxx)
|
||||
return
|
||||
if(WEST)
|
||||
locy = mobloc.y
|
||||
locx = (mobloc.x-2)
|
||||
if(locx<1)
|
||||
return
|
||||
else
|
||||
return
|
||||
var/target = locate(locx,locy,mobloc.z)
|
||||
if(target)
|
||||
L.loc = target
|
||||
var/limit = 2//For only two trailing shadows.
|
||||
for(var/turf/T in getline(mobloc, L.loc))
|
||||
new /obj/effect/temp_visual/dir_setting/ninja/shadow(T, L.dir)
|
||||
limit--
|
||||
if(limit<=0)
|
||||
break
|
||||
else
|
||||
new /obj/effect/temp_visual/dir_setting/ninja/shadow(mobloc, L.dir)
|
||||
var/T = get_step(L,direct)
|
||||
if(T)
|
||||
L.forceMove(T)
|
||||
L.setDir(direct)
|
||||
if(INCORPOREAL_MOVE_JAUNT) //Incorporeal move, but blocked by holy-watered tiles and salt piles.
|
||||
var/turf/open/floor/stepTurf = get_step(L, direct)
|
||||
if(stepTurf)
|
||||
for(var/obj/effect/decal/cleanable/salt/S in stepTurf)
|
||||
to_chat(L, "<span class='warning'>[S] bars your passage!</span>")
|
||||
if(isrevenant(L))
|
||||
var/mob/living/simple_animal/revenant/R = L
|
||||
R.reveal(20)
|
||||
R.stun(20)
|
||||
return
|
||||
if(stepTurf.flags_1 & NOJAUNT_1)
|
||||
to_chat(L, "<span class='warning'>Some strange aura is blocking the way.</span>")
|
||||
return
|
||||
if (locate(/obj/effect/blessing, stepTurf))
|
||||
to_chat(L, "<span class='warning'>Holy energies block your path!</span>")
|
||||
return
|
||||
|
||||
L.forceMove(stepTurf)
|
||||
L.setDir(direct)
|
||||
return TRUE
|
||||
|
||||
|
||||
///Process_Spacemove
|
||||
///Called by /client/Move()
|
||||
///For moving in space
|
||||
///return TRUE for movement 0 for none
|
||||
/mob/Process_Spacemove(movement_dir = 0)
|
||||
if(spacewalk || ..())
|
||||
return TRUE
|
||||
var/atom/movable/backup = get_spacemove_backup()
|
||||
if(backup)
|
||||
if(istype(backup) && movement_dir && !backup.anchored)
|
||||
if(backup.newtonian_move(turn(movement_dir, 180))) //You're pushing off something movable, so it moves
|
||||
to_chat(src, "<span class='info'>You push off of [backup] to propel yourself.</span>")
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/mob/get_spacemove_backup()
|
||||
for(var/A in orange(1, get_turf(src)))
|
||||
if(isarea(A))
|
||||
continue
|
||||
else if(isturf(A))
|
||||
var/turf/turf = A
|
||||
if(isspaceturf(turf))
|
||||
continue
|
||||
if(!turf.density && !mob_negates_gravity())
|
||||
continue
|
||||
return A
|
||||
else
|
||||
var/atom/movable/AM = A
|
||||
if(AM == buckled)
|
||||
continue
|
||||
if(ismob(AM))
|
||||
var/mob/M = AM
|
||||
if(M.buckled)
|
||||
continue
|
||||
if(!AM.CanPass(src) || AM.density)
|
||||
if(AM.anchored)
|
||||
return AM
|
||||
if(pulling == AM)
|
||||
continue
|
||||
. = AM
|
||||
|
||||
/mob/proc/mob_has_gravity()
|
||||
return has_gravity()
|
||||
|
||||
/mob/proc/mob_negates_gravity()
|
||||
return FALSE
|
||||
|
||||
|
||||
/mob/proc/slip(s_amount, w_amount, obj/O, lube)
|
||||
return
|
||||
|
||||
/mob/proc/update_gravity()
|
||||
return
|
||||
|
||||
//bodypart selection - Cyberboss
|
||||
//8 toggles through head - eyes - mouth
|
||||
//4: r-arm 5: chest 6: l-arm
|
||||
//1: r-leg 2: groin 3: l-leg
|
||||
|
||||
/client/proc/check_has_body_select()
|
||||
return mob && mob.hud_used && mob.hud_used.zone_select && istype(mob.hud_used.zone_select, /obj/screen/zone_sel)
|
||||
|
||||
/client/verb/body_toggle_head()
|
||||
set name = "body-toggle-head"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/next_in_line
|
||||
switch(mob.zone_selected)
|
||||
if(BODY_ZONE_HEAD)
|
||||
next_in_line = BODY_ZONE_PRECISE_EYES
|
||||
if(BODY_ZONE_PRECISE_EYES)
|
||||
next_in_line = BODY_ZONE_PRECISE_MOUTH
|
||||
else
|
||||
next_in_line = BODY_ZONE_HEAD
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone(next_in_line, mob)
|
||||
|
||||
/client/verb/body_r_arm()
|
||||
set name = "body-r-arm"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone(BODY_ZONE_R_ARM, mob)
|
||||
|
||||
/client/verb/body_chest()
|
||||
set name = "body-chest"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone(BODY_ZONE_CHEST, mob)
|
||||
|
||||
/client/verb/body_l_arm()
|
||||
set name = "body-l-arm"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone(BODY_ZONE_L_ARM, mob)
|
||||
|
||||
/client/verb/body_r_leg()
|
||||
set name = "body-r-leg"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone(BODY_ZONE_R_LEG, mob)
|
||||
|
||||
/client/verb/body_groin()
|
||||
set name = "body-groin"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone(BODY_ZONE_PRECISE_GROIN, mob)
|
||||
|
||||
/client/verb/body_l_leg()
|
||||
set name = "body-l-leg"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone(BODY_ZONE_L_LEG, mob)
|
||||
|
||||
/client/verb/toggle_walk_run()
|
||||
set name = "toggle-walk-run"
|
||||
set hidden = TRUE
|
||||
set instant = TRUE
|
||||
if(mob)
|
||||
mob.toggle_move_intent(usr)
|
||||
|
||||
/mob/proc/toggle_move_intent(mob/user)
|
||||
if(m_intent == MOVE_INTENT_RUN)
|
||||
m_intent = MOVE_INTENT_WALK
|
||||
else
|
||||
if (HAS_TRAIT(src,TRAIT_NORUNNING)) // FULPSTATION 7/10/19 So you can't run during fortitude.
|
||||
to_chat(src, "You find yourself unable to run.")
|
||||
return FALSE
|
||||
m_intent = MOVE_INTENT_RUN
|
||||
if(hud_used && hud_used.static_inventory)
|
||||
for(var/obj/screen/mov_intent/selector in hud_used.static_inventory)
|
||||
selector.update_icon(src)
|
||||
|
||||
/mob/verb/up()
|
||||
set name = "Move Upwards"
|
||||
set category = "IC"
|
||||
|
||||
if(zMove(UP, TRUE))
|
||||
to_chat(src, "<span class='notice'>You move upwards.</span>")
|
||||
|
||||
/mob/verb/down()
|
||||
set name = "Move Down"
|
||||
set category = "IC"
|
||||
|
||||
if(zMove(DOWN, TRUE))
|
||||
to_chat(src, "<span class='notice'>You move down.</span>")
|
||||
|
||||
/mob/proc/zMove(dir, feedback = FALSE)
|
||||
if(dir != UP && dir != DOWN)
|
||||
return FALSE
|
||||
var/turf/target = get_step_multiz(src, dir)
|
||||
if(!target)
|
||||
if(feedback)
|
||||
to_chat(src, "<span class='warning'>There's nothing in that direction!</span>")
|
||||
return FALSE
|
||||
if(!canZMove(dir, target))
|
||||
if(feedback)
|
||||
to_chat(src, "<span class='warning'>You couldn't move there!</span>")
|
||||
return FALSE
|
||||
forceMove(target)
|
||||
return TRUE
|
||||
|
||||
/mob/proc/canZMove(direction, turf/target)
|
||||
return FALSE
|
||||
/mob/CanPass(atom/movable/mover, turf/target)
|
||||
if((mover.pass_flags & PASSMOB))
|
||||
return TRUE
|
||||
if(istype(mover, /obj/item/projectile) || mover.throwing)
|
||||
return (!density || lying)
|
||||
if(buckled == mover)
|
||||
return TRUE
|
||||
if(ismob(mover))
|
||||
if (mover in buckled_mobs)
|
||||
return TRUE
|
||||
return (!mover.density || !density || lying || (mover.throwing && mover.throwing.thrower == src && !ismob(mover)))
|
||||
|
||||
//DO NOT USE THIS UNLESS YOU ABSOLUTELY HAVE TO. THIS IS BEING PHASED OUT FOR THE MOVESPEED MODIFICATION SYSTEM.
|
||||
//See mob_movespeed.dm
|
||||
/mob/proc/movement_delay() //update /living/movement_delay() if you change this
|
||||
return cached_multiplicative_slowdown
|
||||
|
||||
/client/verb/drop_item()
|
||||
set hidden = 1
|
||||
if(!iscyborg(mob) && mob.stat == CONSCIOUS)
|
||||
mob.dropItemToGround(mob.get_active_held_item())
|
||||
return
|
||||
|
||||
/client/proc/Move_object(direct)
|
||||
if(mob && mob.control_object)
|
||||
if(mob.control_object.density)
|
||||
step(mob.control_object,direct)
|
||||
if(!mob.control_object)
|
||||
return
|
||||
mob.control_object.setDir(direct)
|
||||
else
|
||||
mob.control_object.forceMove(get_step(mob.control_object,direct))
|
||||
|
||||
#define MOVEMENT_DELAY_BUFFER 0.75
|
||||
#define MOVEMENT_DELAY_BUFFER_DELTA 1.25
|
||||
|
||||
/client/Move(n, direct)
|
||||
if(world.time < move_delay) //do not move anything ahead of this check please
|
||||
return FALSE
|
||||
else
|
||||
next_move_dir_add = 0
|
||||
next_move_dir_sub = 0
|
||||
var/old_move_delay = move_delay
|
||||
move_delay = world.time + world.tick_lag //this is here because Move() can now be called mutiple times per tick
|
||||
if(!mob || !mob.loc)
|
||||
return FALSE
|
||||
if(!n || !direct)
|
||||
return FALSE
|
||||
if(mob.notransform)
|
||||
return FALSE //This is sota the goto stop mobs from moving var
|
||||
if(mob.control_object)
|
||||
return Move_object(direct)
|
||||
if(!isliving(mob))
|
||||
return mob.Move(n, direct)
|
||||
if(mob.stat == DEAD)
|
||||
mob.ghostize()
|
||||
return FALSE
|
||||
if(mob.force_moving)
|
||||
return FALSE
|
||||
|
||||
var/mob/living/L = mob //Already checked for isliving earlier
|
||||
if(L.incorporeal_move) //Move though walls
|
||||
Process_Incorpmove(direct)
|
||||
return FALSE
|
||||
|
||||
if(mob.remote_control) //we're controlling something, our movement is relayed to it
|
||||
return mob.remote_control.relaymove(mob, direct)
|
||||
|
||||
if(isAI(mob))
|
||||
return AIMove(n,direct,mob)
|
||||
|
||||
if(Process_Grab()) //are we restrained by someone's grip?
|
||||
return
|
||||
|
||||
if(mob.buckled) //if we're buckled to something, tell it we moved.
|
||||
return mob.buckled.relaymove(mob, direct)
|
||||
|
||||
if(!mob.canmove)
|
||||
return FALSE
|
||||
|
||||
if(isobj(mob.loc) || ismob(mob.loc)) //Inside an object, tell it we moved
|
||||
var/atom/O = mob.loc
|
||||
return O.relaymove(mob, direct)
|
||||
|
||||
if(!mob.Process_Spacemove(direct))
|
||||
return FALSE
|
||||
//We are now going to move
|
||||
var/add_delay = mob.movement_delay()
|
||||
mob.set_glide_size(DELAY_TO_GLIDE_SIZE(add_delay * (((direct & 3) && (direct & 12)) ? 2 : 1))) // set it now in case of pulled objects
|
||||
if(old_move_delay + (add_delay*MOVEMENT_DELAY_BUFFER_DELTA) + MOVEMENT_DELAY_BUFFER > world.time)
|
||||
move_delay = old_move_delay
|
||||
else
|
||||
move_delay = world.time
|
||||
var/oldloc = mob.loc
|
||||
|
||||
if(L.confused)
|
||||
var/newdir = 0
|
||||
if(L.confused > 40)
|
||||
newdir = pick(GLOB.alldirs)
|
||||
else if(prob(L.confused * 1.5))
|
||||
newdir = angle2dir(dir2angle(direct) + pick(90, -90))
|
||||
else if(prob(L.confused * 3))
|
||||
newdir = angle2dir(dir2angle(direct) + pick(45, -45))
|
||||
if(newdir)
|
||||
direct = newdir
|
||||
n = get_step(L, direct)
|
||||
|
||||
. = ..()
|
||||
|
||||
if((direct & (direct - 1)) && mob.loc == n) //moved diagonally successfully
|
||||
add_delay *= 1.66
|
||||
move_delay += add_delay
|
||||
mob.set_glide_size(DELAY_TO_GLIDE_SIZE(add_delay))
|
||||
if(.) // If mob is null here, we deserve the runtime
|
||||
if(mob.throwing)
|
||||
mob.throwing.finalize(FALSE)
|
||||
|
||||
for(var/obj/O in mob.user_movement_hooks)
|
||||
O.intercept_user_move(direct, mob, n, oldloc)
|
||||
|
||||
var/atom/movable/P = mob.pulling
|
||||
if(P && !ismob(P) && P.density)
|
||||
mob.setDir(turn(mob.dir, 180))
|
||||
|
||||
///Process_Grab()
|
||||
///Called by client/Move()
|
||||
///Checks to see if you are being grabbed and if so attemps to break it
|
||||
/client/proc/Process_Grab()
|
||||
if(mob.pulledby)
|
||||
if(mob.incapacitated(ignore_restraints = 1))
|
||||
move_delay = world.time + 10
|
||||
return TRUE
|
||||
else if(mob.restrained(ignore_grab = 1))
|
||||
move_delay = world.time + 10
|
||||
to_chat(src, "<span class='warning'>You're restrained! You can't move!</span>")
|
||||
return TRUE
|
||||
else
|
||||
return mob.resist_grab(1)
|
||||
|
||||
///Process_Incorpmove
|
||||
///Called by client/Move()
|
||||
///Allows mobs to run though walls
|
||||
/client/proc/Process_Incorpmove(direct)
|
||||
var/turf/mobloc = get_turf(mob)
|
||||
if(!isliving(mob))
|
||||
return
|
||||
var/mob/living/L = mob
|
||||
switch(L.incorporeal_move)
|
||||
if(INCORPOREAL_MOVE_BASIC)
|
||||
var/T = get_step(L,direct)
|
||||
if(T)
|
||||
L.forceMove(T)
|
||||
L.setDir(direct)
|
||||
if(INCORPOREAL_MOVE_SHADOW)
|
||||
if(prob(50))
|
||||
var/locx
|
||||
var/locy
|
||||
switch(direct)
|
||||
if(NORTH)
|
||||
locx = mobloc.x
|
||||
locy = (mobloc.y+2)
|
||||
if(locy>world.maxy)
|
||||
return
|
||||
if(SOUTH)
|
||||
locx = mobloc.x
|
||||
locy = (mobloc.y-2)
|
||||
if(locy<1)
|
||||
return
|
||||
if(EAST)
|
||||
locy = mobloc.y
|
||||
locx = (mobloc.x+2)
|
||||
if(locx>world.maxx)
|
||||
return
|
||||
if(WEST)
|
||||
locy = mobloc.y
|
||||
locx = (mobloc.x-2)
|
||||
if(locx<1)
|
||||
return
|
||||
else
|
||||
return
|
||||
var/target = locate(locx,locy,mobloc.z)
|
||||
if(target)
|
||||
L.loc = target
|
||||
var/limit = 2//For only two trailing shadows.
|
||||
for(var/turf/T in getline(mobloc, L.loc))
|
||||
new /obj/effect/temp_visual/dir_setting/ninja/shadow(T, L.dir)
|
||||
limit--
|
||||
if(limit<=0)
|
||||
break
|
||||
else
|
||||
new /obj/effect/temp_visual/dir_setting/ninja/shadow(mobloc, L.dir)
|
||||
var/T = get_step(L,direct)
|
||||
if(T)
|
||||
L.forceMove(T)
|
||||
L.setDir(direct)
|
||||
if(INCORPOREAL_MOVE_JAUNT) //Incorporeal move, but blocked by holy-watered tiles and salt piles.
|
||||
var/turf/open/floor/stepTurf = get_step(L, direct)
|
||||
if(stepTurf)
|
||||
for(var/obj/effect/decal/cleanable/salt/S in stepTurf)
|
||||
to_chat(L, "<span class='warning'>[S] bars your passage!</span>")
|
||||
if(isrevenant(L))
|
||||
var/mob/living/simple_animal/revenant/R = L
|
||||
R.reveal(20)
|
||||
R.stun(20)
|
||||
return
|
||||
if(stepTurf.flags_1 & NOJAUNT_1)
|
||||
to_chat(L, "<span class='warning'>Some strange aura is blocking the way.</span>")
|
||||
return
|
||||
if (locate(/obj/effect/blessing, stepTurf))
|
||||
to_chat(L, "<span class='warning'>Holy energies block your path!</span>")
|
||||
return
|
||||
|
||||
L.forceMove(stepTurf)
|
||||
L.setDir(direct)
|
||||
return TRUE
|
||||
|
||||
|
||||
///Process_Spacemove
|
||||
///Called by /client/Move()
|
||||
///For moving in space
|
||||
///return TRUE for movement 0 for none
|
||||
/mob/Process_Spacemove(movement_dir = 0)
|
||||
if(spacewalk || ..())
|
||||
return TRUE
|
||||
var/atom/movable/backup = get_spacemove_backup()
|
||||
if(backup)
|
||||
if(istype(backup) && movement_dir && !backup.anchored)
|
||||
if(backup.newtonian_move(turn(movement_dir, 180))) //You're pushing off something movable, so it moves
|
||||
to_chat(src, "<span class='info'>You push off of [backup] to propel yourself.</span>")
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/mob/get_spacemove_backup()
|
||||
for(var/A in orange(1, get_turf(src)))
|
||||
if(isarea(A))
|
||||
continue
|
||||
else if(isturf(A))
|
||||
var/turf/turf = A
|
||||
if(isspaceturf(turf))
|
||||
continue
|
||||
if(!turf.density && !mob_negates_gravity())
|
||||
continue
|
||||
return A
|
||||
else
|
||||
var/atom/movable/AM = A
|
||||
if(AM == buckled)
|
||||
continue
|
||||
if(ismob(AM))
|
||||
var/mob/M = AM
|
||||
if(M.buckled)
|
||||
continue
|
||||
if(!AM.CanPass(src) || AM.density)
|
||||
if(AM.anchored)
|
||||
return AM
|
||||
if(pulling == AM)
|
||||
continue
|
||||
. = AM
|
||||
|
||||
/mob/proc/mob_has_gravity()
|
||||
return has_gravity()
|
||||
|
||||
/mob/proc/mob_negates_gravity()
|
||||
return FALSE
|
||||
|
||||
|
||||
/mob/proc/slip(s_amount, w_amount, obj/O, lube)
|
||||
return
|
||||
|
||||
/mob/proc/update_gravity()
|
||||
return
|
||||
|
||||
//bodypart selection - Cyberboss
|
||||
//8 toggles through head - eyes - mouth
|
||||
//4: r-arm 5: chest 6: l-arm
|
||||
//1: r-leg 2: groin 3: l-leg
|
||||
|
||||
/client/proc/check_has_body_select()
|
||||
return mob && mob.hud_used && mob.hud_used.zone_select && istype(mob.hud_used.zone_select, /obj/screen/zone_sel)
|
||||
|
||||
/client/verb/body_toggle_head()
|
||||
set name = "body-toggle-head"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/next_in_line
|
||||
switch(mob.zone_selected)
|
||||
if(BODY_ZONE_HEAD)
|
||||
next_in_line = BODY_ZONE_PRECISE_EYES
|
||||
if(BODY_ZONE_PRECISE_EYES)
|
||||
next_in_line = BODY_ZONE_PRECISE_MOUTH
|
||||
else
|
||||
next_in_line = BODY_ZONE_HEAD
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone(next_in_line, mob)
|
||||
|
||||
/client/verb/body_r_arm()
|
||||
set name = "body-r-arm"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone(BODY_ZONE_R_ARM, mob)
|
||||
|
||||
/client/verb/body_chest()
|
||||
set name = "body-chest"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone(BODY_ZONE_CHEST, mob)
|
||||
|
||||
/client/verb/body_l_arm()
|
||||
set name = "body-l-arm"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone(BODY_ZONE_L_ARM, mob)
|
||||
|
||||
/client/verb/body_r_leg()
|
||||
set name = "body-r-leg"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone(BODY_ZONE_R_LEG, mob)
|
||||
|
||||
/client/verb/body_groin()
|
||||
set name = "body-groin"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone(BODY_ZONE_PRECISE_GROIN, mob)
|
||||
|
||||
/client/verb/body_l_leg()
|
||||
set name = "body-l-leg"
|
||||
set hidden = 1
|
||||
|
||||
if(!check_has_body_select())
|
||||
return
|
||||
|
||||
var/obj/screen/zone_sel/selector = mob.hud_used.zone_select
|
||||
selector.set_selected_zone(BODY_ZONE_L_LEG, mob)
|
||||
|
||||
/client/verb/toggle_walk_run()
|
||||
set name = "toggle-walk-run"
|
||||
set hidden = TRUE
|
||||
set instant = TRUE
|
||||
if(mob)
|
||||
mob.toggle_move_intent(usr)
|
||||
|
||||
/mob/proc/toggle_move_intent(mob/user)
|
||||
if(m_intent == MOVE_INTENT_RUN)
|
||||
m_intent = MOVE_INTENT_WALK
|
||||
else
|
||||
if (HAS_TRAIT(src,TRAIT_NORUNNING)) // FULPSTATION 7/10/19 So you can't run during fortitude.
|
||||
to_chat(src, "You find yourself unable to run.")
|
||||
return FALSE
|
||||
m_intent = MOVE_INTENT_RUN
|
||||
if(hud_used && hud_used.static_inventory)
|
||||
for(var/obj/screen/mov_intent/selector in hud_used.static_inventory)
|
||||
selector.update_icon()
|
||||
|
||||
/mob/verb/up()
|
||||
set name = "Move Upwards"
|
||||
set category = "IC"
|
||||
|
||||
if(zMove(UP, TRUE))
|
||||
to_chat(src, "<span class='notice'>You move upwards.</span>")
|
||||
|
||||
/mob/verb/down()
|
||||
set name = "Move Down"
|
||||
set category = "IC"
|
||||
|
||||
if(zMove(DOWN, TRUE))
|
||||
to_chat(src, "<span class='notice'>You move down.</span>")
|
||||
|
||||
/mob/proc/zMove(dir, feedback = FALSE)
|
||||
if(dir != UP && dir != DOWN)
|
||||
return FALSE
|
||||
var/turf/target = get_step_multiz(src, dir)
|
||||
if(!target)
|
||||
if(feedback)
|
||||
to_chat(src, "<span class='warning'>There's nothing in that direction!</span>")
|
||||
return FALSE
|
||||
if(!canZMove(dir, target))
|
||||
if(feedback)
|
||||
to_chat(src, "<span class='warning'>You couldn't move there!</span>")
|
||||
return FALSE
|
||||
forceMove(target)
|
||||
return TRUE
|
||||
|
||||
/mob/proc/canZMove(direction, turf/target)
|
||||
return FALSE
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
playsound(src.loc, sound_engine_alert1, 55, 0)
|
||||
if (prob(5))
|
||||
playsound(src.loc, 'sound/weapons/emitter2.ogg', 100, 1, extrarange = 10)
|
||||
zapStuff(src, 5, min(genlev, 20000))
|
||||
zapStuff(src, 10, genlev)
|
||||
if (!grumping && grump >= 100 && prob(5))
|
||||
grumping = 1
|
||||
playsound(src.loc, "sound/machines/engine_grump1.ogg", 50, 0)
|
||||
@@ -178,7 +178,7 @@
|
||||
playsound(src.loc, sound_engine_alert2, 55, 0)
|
||||
if (prob(10)) // lowering a bit more
|
||||
playsound(src.loc, 'sound/weapons/emitter2.ogg', 100, 1, extrarange = 10)
|
||||
zapStuff(src, 5, min(genlev, 20000))
|
||||
zapStuff(src, 10, genlev)
|
||||
if (prob(5))
|
||||
src.visible_message("<span class='alert'>[src] starts smoking!</span>")
|
||||
if (!grumping && grump >= 100 && prob(10)) // probably not good if this happens several times in a row
|
||||
@@ -210,21 +210,31 @@
|
||||
if (prob(get_dist(W,src.loc)*6))
|
||||
continue
|
||||
W.deconstruct(FALSE)
|
||||
for (var/mob/living/M in range(6, src.loc))
|
||||
for (var/mob/living/M in range(9, src.loc))
|
||||
shake_camera(M, 3, 16)
|
||||
grumping = 0
|
||||
grump -= 30
|
||||
if (prob(33)) // lowered because all the DEL procs related to zap are stacking up in the profiler
|
||||
if(prob(5))
|
||||
playsound(src.loc, sound_bigzap, 100, 1, extrarange = 10)
|
||||
zapStuff(src, 5, min(genlev, 30000)) //BIG ZAP
|
||||
zapStuff(src, 10, genlev*2) //BIG ZAP
|
||||
else
|
||||
playsound(src.loc, 'sound/weapons/emitter2.ogg', 100, 1, extrarange = 10)
|
||||
zapStuff(src, 5, min(genlev, 20000))
|
||||
zapStuff(src, 10, genlev)
|
||||
if(prob(5))
|
||||
src.visible_message("<span class='alert'>[src] [pick("rumbles", "groans", "shudders", "grustles", "hums", "thrums")] [pick("ominously", "oddly", "strangely", "oddly", "worringly", "softly", "loudly")]!</span>")
|
||||
else if (prob(2))
|
||||
src.visible_message("<span class='alert'><b>[src] hungers!</b></span>")
|
||||
shake_animation(1)
|
||||
playsound(loc, 'sound/machines/clockcult/steam_whoosh.ogg', 75, TRUE)
|
||||
var/turf/T = get_turf(src)
|
||||
switch(rand(1,3))
|
||||
if(1)
|
||||
T.atmos_spawn_air("co2=25;TEMP=300]")
|
||||
if(2)
|
||||
T.atmos_spawn_air("tritium=5;TEMP=500]")
|
||||
if(3)
|
||||
T.atmos_spawn_air("miasma=10;TEMP=500]") //brapgenerator
|
||||
..()
|
||||
|
||||
/obj/machinery/power/generator/proc/get_menu(include_link = TRUE)
|
||||
@@ -357,8 +367,13 @@
|
||||
cold_circ.generator = null
|
||||
cold_circ = null
|
||||
|
||||
/obj/machinery/power/generator/proc/zapStuff(atom/zapstart, range = 3, power)
|
||||
. = zapstart.dir
|
||||
/obj/machinery/power/generator/proc/zapStuff(atom/zapstart, range = 5, power, icon_state)
|
||||
playsound(zapstart, 'sound/magic/lightningshock.ogg', 100, 1, extrarange = range)
|
||||
tesla_zap(zapstart, range, power, TESLA_MOB_DAMAGE | TESLA_MOB_STUN)
|
||||
if(prob(10))
|
||||
//REDO THE ZAP. YES, THIS MEANS FUCK YOU.
|
||||
zapStuff(zapstart, range*2, power)
|
||||
/*. = zapstart.dir
|
||||
if(power < 1000)
|
||||
return
|
||||
|
||||
@@ -424,3 +439,4 @@
|
||||
zapStuff(target_structure, 5, power / 2)
|
||||
else
|
||||
zapStuff(target_structure, 5, power / 1.5)
|
||||
*/
|
||||
|
||||
@@ -1,231 +1,231 @@
|
||||
// stored_power += (pulse_strength-RAD_COLLECTOR_EFFICIENCY)*RAD_COLLECTOR_COEFFICIENT
|
||||
#define RAD_COLLECTOR_EFFICIENCY 60 // radiation needs to be over this amount to get power
|
||||
#define RAD_COLLECTOR_COEFFICIENT 100
|
||||
#define RAD_COLLECTOR_STORED_OUT 0.04 // (this*100)% of stored power outputted per tick. Doesn't actualy change output total, lower numbers just means collectors output for longer in absence of a source
|
||||
#define RAD_COLLECTOR_MINING_CONVERSION_RATE 0.00001 //This is gonna need a lot of tweaking to get right. This is the number used to calculate the conversion of watts to research points per process()
|
||||
#define RAD_COLLECTOR_OUTPUT min(stored_power, (stored_power*RAD_COLLECTOR_STORED_OUT)+1000) //Produces at least 1000 watts if it has more than that stored
|
||||
|
||||
/obj/machinery/power/rad_collector
|
||||
name = "Radiation Collector Array"
|
||||
desc = "A device which uses Hawking Radiation and plasma to produce power."
|
||||
icon = 'icons/obj/singularity.dmi'
|
||||
icon_state = "ca"
|
||||
anchored = FALSE
|
||||
density = TRUE
|
||||
req_access = list(ACCESS_ENGINE_EQUIP)
|
||||
// use_power = NO_POWER_USE
|
||||
max_integrity = 350
|
||||
integrity_failure = 80
|
||||
circuit = /obj/item/circuitboard/machine/rad_collector
|
||||
var/obj/item/tank/internals/plasma/loaded_tank = null
|
||||
var/stored_power = 0
|
||||
var/active = 0
|
||||
var/locked = FALSE
|
||||
var/drainratio = 1
|
||||
var/powerproduction_drain = 0.001
|
||||
|
||||
var/bitcoinproduction_drain = 0.15
|
||||
var/bitcoinmining = FALSE
|
||||
rad_insulation = RAD_EXTREME_INSULATION
|
||||
|
||||
/obj/machinery/power/rad_collector/anchored
|
||||
anchored = TRUE
|
||||
|
||||
/obj/machinery/power/rad_collector/Destroy()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/rad_collector/process()
|
||||
if(!loaded_tank)
|
||||
return
|
||||
if(!bitcoinmining)
|
||||
if(!loaded_tank.air_contents.gases[/datum/gas/plasma])
|
||||
investigate_log("<font color='red'>out of fuel</font>.", INVESTIGATE_SINGULO)
|
||||
playsound(src, 'sound/machines/ding.ogg', 50, 1)
|
||||
eject()
|
||||
else
|
||||
var/gasdrained = min(powerproduction_drain*drainratio,loaded_tank.air_contents.gases[/datum/gas/plasma])
|
||||
loaded_tank.air_contents.gases[/datum/gas/plasma] -= gasdrained
|
||||
loaded_tank.air_contents.gases[/datum/gas/tritium] += gasdrained
|
||||
GAS_GARBAGE_COLLECT(loaded_tank.air_contents.gases)
|
||||
|
||||
var/power_produced = RAD_COLLECTOR_OUTPUT
|
||||
add_avail(power_produced)
|
||||
stored_power-=power_produced
|
||||
else if(is_station_level(z) && SSresearch.science_tech)
|
||||
if(!loaded_tank.air_contents.gases[/datum/gas/tritium] || !loaded_tank.air_contents.gases[/datum/gas/oxygen])
|
||||
playsound(src, 'sound/machines/ding.ogg', 50, 1)
|
||||
eject()
|
||||
else
|
||||
var/gasdrained = bitcoinproduction_drain*drainratio
|
||||
loaded_tank.air_contents.gases[/datum/gas/tritium] -= gasdrained
|
||||
loaded_tank.air_contents.gases[/datum/gas/oxygen] -= gasdrained
|
||||
loaded_tank.air_contents.gases[/datum/gas/carbon_dioxide] += gasdrained*2
|
||||
GAS_GARBAGE_COLLECT(loaded_tank.air_contents.gases)
|
||||
var/bitcoins_mined = RAD_COLLECTOR_OUTPUT
|
||||
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, bitcoins_mined*RAD_COLLECTOR_MINING_CONVERSION_RATE)
|
||||
stored_power-=bitcoins_mined
|
||||
|
||||
/obj/machinery/power/rad_collector/interact(mob/user)
|
||||
if(anchored)
|
||||
if(!src.locked)
|
||||
toggle_power()
|
||||
user.visible_message("[user.name] turns the [src.name] [active? "on":"off"].", \
|
||||
"<span class='notice'>You turn the [src.name] [active? "on":"off"].</span>")
|
||||
var/fuel
|
||||
if(loaded_tank)
|
||||
fuel = loaded_tank.air_contents.gases[/datum/gas/plasma]
|
||||
investigate_log("turned [active?"<font color='green'>on</font>":"<font color='red'>off</font>"] by [key_name(user)]. [loaded_tank?"Fuel: [round(fuel/0.29)]%":"<font color='red'>It is empty</font>"].", INVESTIGATE_SINGULO)
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='warning'>The controls are locked!</span>")
|
||||
return
|
||||
|
||||
/obj/machinery/power/rad_collector/can_be_unfasten_wrench(mob/user, silent)
|
||||
if(loaded_tank)
|
||||
if(!silent)
|
||||
to_chat(user, "<span class='warning'>Remove the plasma tank first!</span>")
|
||||
return FAILED_UNFASTEN
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/rad_collector/default_unfasten_wrench(mob/user, obj/item/I, time = 20)
|
||||
. = ..()
|
||||
if(. == SUCCESSFUL_UNFASTEN)
|
||||
if(anchored)
|
||||
connect_to_network()
|
||||
else
|
||||
disconnect_from_network()
|
||||
|
||||
/obj/machinery/power/rad_collector/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/tank/internals/plasma))
|
||||
if(!anchored)
|
||||
to_chat(user, "<span class='warning'>[src] needs to be secured to the floor first!</span>")
|
||||
return TRUE
|
||||
if(loaded_tank)
|
||||
to_chat(user, "<span class='warning'>There's already a plasma tank loaded!</span>")
|
||||
return TRUE
|
||||
if(panel_open)
|
||||
to_chat(user, "<span class='warning'>Close the maintenance panel first!</span>")
|
||||
return TRUE
|
||||
if(!user.transferItemToLoc(W, src))
|
||||
return
|
||||
loaded_tank = W
|
||||
update_icons()
|
||||
else if(W.GetID())
|
||||
if(allowed(user))
|
||||
if(active)
|
||||
locked = !locked
|
||||
to_chat(user, "<span class='notice'>You [locked ? "lock" : "unlock"] the controls.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>The controls can only be locked when \the [src] is active!</span>")
|
||||
else
|
||||
to_chat(user, "<span class='danger'>Access denied.</span>")
|
||||
return TRUE
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/rad_collector/wrench_act(mob/living/user, obj/item/I)
|
||||
default_unfasten_wrench(user, I)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/power/rad_collector/screwdriver_act(mob/living/user, obj/item/I)
|
||||
if(..())
|
||||
return TRUE
|
||||
if(loaded_tank)
|
||||
to_chat(user, "<span class='warning'>Remove the plasma tank first!</span>")
|
||||
else
|
||||
default_deconstruction_screwdriver(user, icon_state, icon_state, I)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/power/rad_collector/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(loaded_tank)
|
||||
if(locked)
|
||||
to_chat(user, "<span class='warning'>The controls are locked!</span>")
|
||||
return TRUE
|
||||
eject()
|
||||
return TRUE
|
||||
if(default_deconstruction_crowbar(I))
|
||||
return TRUE
|
||||
to_chat(user, "<span class='warning'>There isn't a tank loaded!</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/power/rad_collector/multitool_act(mob/living/user, obj/item/I)
|
||||
if(!is_station_level(z) && !SSresearch.science_tech)
|
||||
to_chat(user, "<span class='warning'>[src] isn't linked to a research system!</span>")
|
||||
return TRUE
|
||||
if(locked)
|
||||
to_chat(user, "<span class='warning'>[src] is locked!</span>")
|
||||
return TRUE
|
||||
if(active)
|
||||
to_chat(user, "<span class='warning'>[src] is currently active, producing [bitcoinmining ? "research points":"power"].</span>")
|
||||
return TRUE
|
||||
bitcoinmining = !bitcoinmining
|
||||
to_chat(user, "<span class='warning'>You [bitcoinmining ? "enable":"disable"] the research point production feature of [src].</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/power/rad_collector/analyzer_act(mob/living/user, obj/item/I)
|
||||
if(loaded_tank)
|
||||
loaded_tank.analyzer_act(user, I)
|
||||
|
||||
/obj/machinery/power/rad_collector/examine(mob/user)
|
||||
. = ..()
|
||||
if(active)
|
||||
if(!bitcoinmining)
|
||||
. += "<span class='notice'>[src]'s display states that it has stored <b>[DisplayPower(stored_power)]</b>, and is processing <b>[DisplayPower((RAD_COLLECTOR_OUTPUT)*((60 SECONDS)/SSmachines.wait))]</b> per minute. <br>The <b>plasma</b> within it's tank is being irradiated into <b>tritium</b>.</span>"
|
||||
else
|
||||
. += "<span class='notice'>[src]'s display states that it's producing a total of <b>[(stored_power*RAD_COLLECTOR_MINING_CONVERSION_RATE)*((60 SECONDS)/SSmachines.wait)]</b> research points per minute. <br>The <b>tritium</b> and <b>oxygen</b> within it's tank is being combusted into <b>carbon dioxide</b>.</span>"
|
||||
else
|
||||
if(!bitcoinmining)
|
||||
. += "<span class='notice'><b>[src]'s display displays the words:</b> \"Power production mode. Please insert <b>Plasma</b>. Use a multitool to change production modes.\"</span>"
|
||||
else
|
||||
. += "<span class='notice'><b>[src]'s display displays the words:</b> \"Research point production mode. Please insert <b>Tritium</b> and <b>Oxygen</b>. Use a multitool to change production modes.\"</span>"
|
||||
|
||||
/obj/machinery/power/rad_collector/obj_break(damage_flag)
|
||||
if(!(stat & BROKEN) && !(flags_1 & NODECONSTRUCT_1))
|
||||
eject()
|
||||
stat |= BROKEN
|
||||
|
||||
/obj/machinery/power/rad_collector/proc/eject()
|
||||
locked = FALSE
|
||||
var/obj/item/tank/internals/plasma/Z = src.loaded_tank
|
||||
if (!Z)
|
||||
return
|
||||
Z.forceMove(drop_location())
|
||||
Z.layer = initial(Z.layer)
|
||||
Z.plane = initial(Z.plane)
|
||||
src.loaded_tank = null
|
||||
if(active)
|
||||
toggle_power()
|
||||
else
|
||||
update_icons()
|
||||
|
||||
/obj/machinery/power/rad_collector/rad_act(pulse_strength)
|
||||
. = ..()
|
||||
if(loaded_tank && active && pulse_strength > RAD_COLLECTOR_EFFICIENCY)
|
||||
stored_power += (pulse_strength-RAD_COLLECTOR_EFFICIENCY)*RAD_COLLECTOR_COEFFICIENT
|
||||
|
||||
/obj/machinery/power/rad_collector/proc/update_icons()
|
||||
cut_overlays()
|
||||
if(loaded_tank)
|
||||
add_overlay("ptank")
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(active)
|
||||
add_overlay("on")
|
||||
|
||||
|
||||
/obj/machinery/power/rad_collector/proc/toggle_power()
|
||||
active = !active
|
||||
if(active)
|
||||
icon_state = "ca_on"
|
||||
flick("ca_active", src)
|
||||
else
|
||||
icon_state = "ca"
|
||||
flick("ca_deactive", src)
|
||||
update_icons()
|
||||
return
|
||||
|
||||
#undef RAD_COLLECTOR_EFFICIENCY
|
||||
#undef RAD_COLLECTOR_COEFFICIENT
|
||||
#undef RAD_COLLECTOR_STORED_OUT
|
||||
#undef RAD_COLLECTOR_MINING_CONVERSION_RATE
|
||||
#undef RAD_COLLECTOR_OUTPUT
|
||||
// stored_power += (pulse_strength-RAD_COLLECTOR_EFFICIENCY)*RAD_COLLECTOR_COEFFICIENT
|
||||
#define RAD_COLLECTOR_EFFICIENCY 60 // radiation needs to be over this amount to get power
|
||||
#define RAD_COLLECTOR_COEFFICIENT 100
|
||||
#define RAD_COLLECTOR_STORED_OUT 0.04 // (this*100)% of stored power outputted per tick. Doesn't actualy change output total, lower numbers just means collectors output for longer in absence of a source
|
||||
#define RAD_COLLECTOR_MINING_CONVERSION_RATE 0.00001 //This is gonna need a lot of tweaking to get right. This is the number used to calculate the conversion of watts to research points per process()
|
||||
#define RAD_COLLECTOR_OUTPUT min(stored_power, (stored_power*RAD_COLLECTOR_STORED_OUT)+1000) //Produces at least 1000 watts if it has more than that stored
|
||||
|
||||
/obj/machinery/power/rad_collector
|
||||
name = "Radiation Collector Array"
|
||||
desc = "A device which uses Hawking Radiation and plasma to produce power."
|
||||
icon = 'icons/obj/singularity.dmi'
|
||||
icon_state = "ca"
|
||||
anchored = FALSE
|
||||
density = TRUE
|
||||
req_access = list(ACCESS_ENGINE_EQUIP)
|
||||
// use_power = NO_POWER_USE
|
||||
max_integrity = 350
|
||||
integrity_failure = 80
|
||||
circuit = /obj/item/circuitboard/machine/rad_collector
|
||||
var/obj/item/tank/internals/plasma/loaded_tank = null
|
||||
var/stored_power = 0
|
||||
var/active = 0
|
||||
var/locked = FALSE
|
||||
var/drainratio = 1
|
||||
var/powerproduction_drain = 0.001
|
||||
|
||||
var/bitcoinproduction_drain = 0.15
|
||||
var/bitcoinmining = FALSE
|
||||
rad_insulation = RAD_EXTREME_INSULATION
|
||||
|
||||
/obj/machinery/power/rad_collector/anchored
|
||||
anchored = TRUE
|
||||
|
||||
/obj/machinery/power/rad_collector/Destroy()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/rad_collector/process()
|
||||
if(!loaded_tank)
|
||||
return
|
||||
if(!bitcoinmining)
|
||||
if(!loaded_tank.air_contents.gases[/datum/gas/plasma])
|
||||
investigate_log("<font color='red'>out of fuel</font>.", INVESTIGATE_SINGULO)
|
||||
playsound(src, 'sound/machines/ding.ogg', 50, 1)
|
||||
eject()
|
||||
else
|
||||
var/gasdrained = min(powerproduction_drain*drainratio,loaded_tank.air_contents.gases[/datum/gas/plasma])
|
||||
loaded_tank.air_contents.gases[/datum/gas/plasma] -= gasdrained
|
||||
loaded_tank.air_contents.gases[/datum/gas/tritium] += gasdrained
|
||||
GAS_GARBAGE_COLLECT(loaded_tank.air_contents.gases)
|
||||
|
||||
var/power_produced = RAD_COLLECTOR_OUTPUT
|
||||
add_avail(power_produced)
|
||||
stored_power-=power_produced
|
||||
else if(is_station_level(z) && SSresearch.science_tech)
|
||||
if(!loaded_tank.air_contents.gases[/datum/gas/tritium] || !loaded_tank.air_contents.gases[/datum/gas/oxygen])
|
||||
playsound(src, 'sound/machines/ding.ogg', 50, 1)
|
||||
eject()
|
||||
else
|
||||
var/gasdrained = bitcoinproduction_drain*drainratio
|
||||
loaded_tank.air_contents.gases[/datum/gas/tritium] -= gasdrained
|
||||
loaded_tank.air_contents.gases[/datum/gas/oxygen] -= gasdrained
|
||||
loaded_tank.air_contents.gases[/datum/gas/carbon_dioxide] += gasdrained*2
|
||||
GAS_GARBAGE_COLLECT(loaded_tank.air_contents.gases)
|
||||
var/bitcoins_mined = RAD_COLLECTOR_OUTPUT
|
||||
SSresearch.science_tech.add_point_type(TECHWEB_POINT_TYPE_DEFAULT, bitcoins_mined*RAD_COLLECTOR_MINING_CONVERSION_RATE)
|
||||
stored_power-=bitcoins_mined
|
||||
|
||||
/obj/machinery/power/rad_collector/interact(mob/user)
|
||||
if(anchored)
|
||||
if(!src.locked)
|
||||
toggle_power()
|
||||
user.visible_message("[user.name] turns the [src.name] [active? "on":"off"].", \
|
||||
"<span class='notice'>You turn the [src.name] [active? "on":"off"].</span>")
|
||||
var/fuel
|
||||
if(loaded_tank)
|
||||
fuel = loaded_tank.air_contents.gases[/datum/gas/plasma]
|
||||
investigate_log("turned [active?"<font color='green'>on</font>":"<font color='red'>off</font>"] by [key_name(user)]. [loaded_tank?"Fuel: [round(fuel/0.29)]%":"<font color='red'>It is empty</font>"].", INVESTIGATE_SINGULO)
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='warning'>The controls are locked!</span>")
|
||||
return
|
||||
|
||||
/obj/machinery/power/rad_collector/can_be_unfasten_wrench(mob/user, silent)
|
||||
if(loaded_tank)
|
||||
if(!silent)
|
||||
to_chat(user, "<span class='warning'>Remove the plasma tank first!</span>")
|
||||
return FAILED_UNFASTEN
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/rad_collector/default_unfasten_wrench(mob/user, obj/item/I, time = 20)
|
||||
. = ..()
|
||||
if(. == SUCCESSFUL_UNFASTEN)
|
||||
if(anchored)
|
||||
connect_to_network()
|
||||
else
|
||||
disconnect_from_network()
|
||||
|
||||
/obj/machinery/power/rad_collector/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/tank/internals/plasma))
|
||||
if(!anchored)
|
||||
to_chat(user, "<span class='warning'>[src] needs to be secured to the floor first!</span>")
|
||||
return TRUE
|
||||
if(loaded_tank)
|
||||
to_chat(user, "<span class='warning'>There's already a plasma tank loaded!</span>")
|
||||
return TRUE
|
||||
if(panel_open)
|
||||
to_chat(user, "<span class='warning'>Close the maintenance panel first!</span>")
|
||||
return TRUE
|
||||
if(!user.transferItemToLoc(W, src))
|
||||
return
|
||||
loaded_tank = W
|
||||
update_icon()
|
||||
else if(W.GetID())
|
||||
if(allowed(user))
|
||||
if(active)
|
||||
locked = !locked
|
||||
to_chat(user, "<span class='notice'>You [locked ? "lock" : "unlock"] the controls.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='warning'>The controls can only be locked when \the [src] is active!</span>")
|
||||
else
|
||||
to_chat(user, "<span class='danger'>Access denied.</span>")
|
||||
return TRUE
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/rad_collector/wrench_act(mob/living/user, obj/item/I)
|
||||
default_unfasten_wrench(user, I)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/power/rad_collector/screwdriver_act(mob/living/user, obj/item/I)
|
||||
if(..())
|
||||
return TRUE
|
||||
if(loaded_tank)
|
||||
to_chat(user, "<span class='warning'>Remove the plasma tank first!</span>")
|
||||
else
|
||||
default_deconstruction_screwdriver(user, icon_state, icon_state, I)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/power/rad_collector/crowbar_act(mob/living/user, obj/item/I)
|
||||
if(loaded_tank)
|
||||
if(locked)
|
||||
to_chat(user, "<span class='warning'>The controls are locked!</span>")
|
||||
return TRUE
|
||||
eject()
|
||||
return TRUE
|
||||
if(default_deconstruction_crowbar(I))
|
||||
return TRUE
|
||||
to_chat(user, "<span class='warning'>There isn't a tank loaded!</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/power/rad_collector/multitool_act(mob/living/user, obj/item/I)
|
||||
if(!is_station_level(z) && !SSresearch.science_tech)
|
||||
to_chat(user, "<span class='warning'>[src] isn't linked to a research system!</span>")
|
||||
return TRUE
|
||||
if(locked)
|
||||
to_chat(user, "<span class='warning'>[src] is locked!</span>")
|
||||
return TRUE
|
||||
if(active)
|
||||
to_chat(user, "<span class='warning'>[src] is currently active, producing [bitcoinmining ? "research points":"power"].</span>")
|
||||
return TRUE
|
||||
bitcoinmining = !bitcoinmining
|
||||
to_chat(user, "<span class='warning'>You [bitcoinmining ? "enable":"disable"] the research point production feature of [src].</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/power/rad_collector/analyzer_act(mob/living/user, obj/item/I)
|
||||
if(loaded_tank)
|
||||
loaded_tank.analyzer_act(user, I)
|
||||
|
||||
/obj/machinery/power/rad_collector/examine(mob/user)
|
||||
. = ..()
|
||||
if(active)
|
||||
if(!bitcoinmining)
|
||||
. += "<span class='notice'>[src]'s display states that it has stored <b>[DisplayPower(stored_power)]</b>, and is processing <b>[DisplayPower((RAD_COLLECTOR_OUTPUT)*((60 SECONDS)/SSmachines.wait))]</b> per minute. <br>The <b>plasma</b> within it's tank is being irradiated into <b>tritium</b>.</span>"
|
||||
else
|
||||
. += "<span class='notice'>[src]'s display states that it's producing a total of <b>[(stored_power*RAD_COLLECTOR_MINING_CONVERSION_RATE)*((60 SECONDS)/SSmachines.wait)]</b> research points per minute. <br>The <b>tritium</b> and <b>oxygen</b> within it's tank is being combusted into <b>carbon dioxide</b>.</span>"
|
||||
else
|
||||
if(!bitcoinmining)
|
||||
. += "<span class='notice'><b>[src]'s display displays the words:</b> \"Power production mode. Please insert <b>Plasma</b>. Use a multitool to change production modes.\"</span>"
|
||||
else
|
||||
. += "<span class='notice'><b>[src]'s display displays the words:</b> \"Research point production mode. Please insert <b>Tritium</b> and <b>Oxygen</b>. Use a multitool to change production modes.\"</span>"
|
||||
|
||||
/obj/machinery/power/rad_collector/obj_break(damage_flag)
|
||||
if(!(stat & BROKEN) && !(flags_1 & NODECONSTRUCT_1))
|
||||
eject()
|
||||
stat |= BROKEN
|
||||
|
||||
/obj/machinery/power/rad_collector/proc/eject()
|
||||
locked = FALSE
|
||||
var/obj/item/tank/internals/plasma/Z = src.loaded_tank
|
||||
if (!Z)
|
||||
return
|
||||
Z.forceMove(drop_location())
|
||||
Z.layer = initial(Z.layer)
|
||||
Z.plane = initial(Z.plane)
|
||||
src.loaded_tank = null
|
||||
if(active)
|
||||
toggle_power()
|
||||
else
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/power/rad_collector/rad_act(pulse_strength)
|
||||
. = ..()
|
||||
if(loaded_tank && active && pulse_strength > RAD_COLLECTOR_EFFICIENCY)
|
||||
stored_power += (pulse_strength-RAD_COLLECTOR_EFFICIENCY)*RAD_COLLECTOR_COEFFICIENT
|
||||
|
||||
/obj/machinery/power/rad_collector/update_icon()
|
||||
cut_overlays()
|
||||
if(loaded_tank)
|
||||
add_overlay("ptank")
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
if(active)
|
||||
add_overlay("on")
|
||||
|
||||
|
||||
/obj/machinery/power/rad_collector/proc/toggle_power()
|
||||
active = !active
|
||||
if(active)
|
||||
icon_state = "ca_on"
|
||||
flick("ca_active", src)
|
||||
else
|
||||
icon_state = "ca"
|
||||
flick("ca_deactive", src)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
#undef RAD_COLLECTOR_EFFICIENCY
|
||||
#undef RAD_COLLECTOR_COEFFICIENT
|
||||
#undef RAD_COLLECTOR_STORED_OUT
|
||||
#undef RAD_COLLECTOR_MINING_CONVERSION_RATE
|
||||
#undef RAD_COLLECTOR_OUTPUT
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
/obj/item/stock_parts/scanning_module = 5,
|
||||
/obj/item/stock_parts/micro_laser = 5,
|
||||
/obj/item/stock_parts/matter_bin = 5,
|
||||
/obj/item/stock_parts/manipulator = 5)
|
||||
/obj/item/stock_parts/manipulator = 5,
|
||||
/obj/item/clothing/under/radkini = 2,
|
||||
/obj/item/clothing/mask/gas/radmask = 2)
|
||||
armor = list("melee" = 100, "bullet" = 100, "laser" = 100, "energy" = 100, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 50)
|
||||
resistance_flags = FIRE_PROOF
|
||||
|
||||
@@ -86,7 +86,9 @@
|
||||
/obj/item/clothing/suit/hazardvest = 5,
|
||||
/obj/item/clothing/shoes/workboots = 5,
|
||||
/obj/item/clothing/head/hardhat = 5,
|
||||
/obj/item/clothing/head/hardhat/weldhat = 3)
|
||||
/obj/item/clothing/head/hardhat/weldhat = 3,
|
||||
/obj/item/clothing/under/radkini = 2,
|
||||
/obj/item/clothing/mask/gas/radmask = 2)
|
||||
refill_canister = /obj/item/vending_refill/wardrobe/engi_wardrobe
|
||||
|
||||
/obj/item/vending_refill/wardrobe/engi_wardrobe
|
||||
|
||||
Reference in New Issue
Block a user