Animal traps fixes and improvement (#6152)

Fixes #6150

Animal traps now visually display what prey is inside of them by adding mob's icon as underlay.

Tesla no longer logs spawn of new miniballs

Fixes main changelog where it is supposed to be addition.

Fixes #6158

Examining animal trap with prey now also displays examine message of the prey itself too.
This commit is contained in:
Mykhailo Bykhovtsev
2019-04-05 23:58:10 +03:00
committed by Erki
parent 82da8c4184
commit cfe684a8a4
4 changed files with 84 additions and 6 deletions
+32
View File
@@ -152,6 +152,27 @@
health = 100
var/datum/weakref/captured = null
/obj/item/weapon/trap/animal/process()
update_icon()
/obj/item/weapon/trap/animal/update_icon()
icon = initial(icon)
icon_state = "[icon_base][deployed]"
var/datum/L = captured ? captured.resolve() : null
if (!L)
deployed = FALSE
captured = null
release_time = world.time
underlays.Cut()
STOP_PROCESSING(SSprocessing, src)
return
if(isliving(L))
var/mutable_appearance/MA = new(L)
MA.layer = FLOAT_LAYER
MA.plane = FLOAT_PLANE
underlays.Cut()
underlays += MA
/obj/item/weapon/trap/animal/examine(mob/user)
..()
if(captured)
@@ -171,9 +192,11 @@
message += "<span class='warning'>wounded</span>"
message += ".</span>"
to_chat(user, message)
ll.examine(user)
else if (istype(L, /obj/effect/spider/spiderling))
var/obj/effect/spider/spiderling/S = L
to_chat(user, "<span class='notice'>\The [src] has [S] and it is alive.</span>")
else
to_chat(user, "<span class='notice'>\The [src] is empty.</span>")
@@ -201,6 +224,7 @@
deployed = 1
update_icon()
src.animate_shake()
START_PROCESSING(SSprocessing, src)
else if(istype(AM, /obj/effect/spider/spiderling) && spider) // for spiderlings
var/obj/effect/spider/spiderling/S = AM
@@ -289,6 +313,11 @@
if(!can_use(usr))
to_chat(usr, "<span class='warning'>You cannot use \the [src].</span>")
return
if(usr in contents)
to_chat(usr, "<span class='warning'>You cannot open lock \the [src] from the inside. You would have to forcefully open it.</span>")
return
if(!contents.len)
return
@@ -349,6 +378,7 @@
captured = null
release_time = world.time
update_icon()
STOP_PROCESSING(SSprocessing, src)
return
var/msg
@@ -356,6 +386,7 @@
var/mob/living/ll = L
ll.forceMove(target)
msg = "<span class='warning'>[ll] runs out of \the [src].</span>"
STOP_PROCESSING(SSprocessing, src)
else if (istype(L, /obj/effect/spider/spiderling))
var/obj/effect/spider/spiderling/S = L
S.forceMove(target)
@@ -386,6 +417,7 @@
new /obj/item/stack/rods(src.loc, resources["rods"])
if(resources.len == 2)
new /obj/item/stack/material/steel(src.loc, resources["metal"])
release()
qdel(src)
else if(W.isscrewdriver())
+7 -5
View File
@@ -51,10 +51,6 @@
pixel_x = 0
pixel_y = 0
// This now does just the animation of all balls shooting main ball
for (var/obj/singularity/energy_ball/ball in orbiting_balls)
ball.Beam(src, icon_state="lightning[rand(1,12)]", icon = 'icons/effects/effects.dmi', time=2)
// Instead of miniballs shooting stuff, decided to make it just count the power produced.
dir = tesla_zap(src, 10, TESLA_DEFAULT_POWER + orbiting_balls.len * TESLA_MINI_POWER, TRUE)
@@ -66,6 +62,12 @@
if(energy < 0)
qdel(src)
/obj/singularity/energy_ball/admin_investigate_setup()
if(orbiting)
return
else
..()
/obj/singularity/energy_ball/examine(mob/user)
..()
if(orbiting_balls.len)
@@ -338,7 +340,7 @@
var/obj/singularity/energy_ball/E = source
if(E.energy && (E.orbiting_balls.len > rods_count * 4)) // so that miniballs don't fry stuff.
melt = TRUE// 1 grounding rod can handle max 4 balls
E.visible_message(span("danger", "All [E.orbiting_balls.len] energize for a second, sending their energy to the main ball, which redirects it at the nearest object! Sacraficing one of its miniballs!"))
E.visible_message(span("danger", "All [E.orbiting_balls.len] energize for a second, sending their energy to the main ball, which redirects it at the nearest object! Sacrificing one of its miniballs!"))
for(var/obj/singularity/energy_ball/mini in E.orbiting_balls)
mini.Beam(source, icon_state="lightning[rand(1,12)]", icon = 'icons/effects/effects.dmi', time=2)
playsound(source.loc, 'sound/magic/lightning_chargeup.ogg', 100, 1, extrarange = 30)
+1 -1
View File
@@ -7464,7 +7464,7 @@ DO NOT EDIT THIS FILE BY HAND! AUTOMATICALLY GENERATED BY ss13_genchangelog.py.
- rscadd: Added Kinetic accelerator to mechs. RND can now research and make these
Kinetc accelerators. There is a regular and a burst(3 shots) version. It will
be better than average-decent man-held KA.
- rscdel: Added flamethrower for mechs. RND can now research and make this flamethrower.
- rscadd: Added flamethrower for mechs. RND can now research and make this flamethrower.
Works like man-held flamethrower.
- soundadd: Added flamethrower sound.
- tweak: The LBX AC 10 "Scattershot" now uses shotgun sound effect.
+44
View File
@@ -0,0 +1,44 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
# admin
# backend
# security
# refactor
#################################
# Your name.
author: PoZe
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- tweak: "Disassembling trap with things inside of it will release whatever is inside."
- rscadd: "Animal traps now display visually what prey is inside of them. And updates their sprite regularly, meaning if they fall down, loose limb, etc it will all be displayed visually."
- tweak: "Examining animal trap with prey inside will also give user examine message of the mob too."
- backend: "Tesla no longer logs spawn of new miniballs."