Files
Paradise/code/game/objects/items/weapons/shards.dm
T
79bad427c8 Movement cross/uncross implementation. (#26762)
* refactor: Movement cross/uncross implementation.

* wrong var name

* fix unit tests dropping PDAs into nowhere

* Add documentation.

* remove unused constants

* say which procs are off limits

* fix simpleanimal z change runtime

* helps not to leave merge conflicts

* kill me

* fix typecast

* fix projectile/table collision

* treadmills don't cause MC to crash anymore

* connect_loc is appropriate here

* fix windoors and teleporters

* fix bonfires and clarify docs

* fix proximity sensors

Tested with sensors in crates, sensors in modsuits
Tested new proximity component with firing projectiles at singularity
Tested new proximity component with portable flashes
Tested new proximity component with facehuggers

* lint

* fix: polarized access helper false positives

* Revert "fix: polarized access helper false positives"

This reverts commit 9814f98cf6.

* hopefully the right change for mindflayer steam

* Changes following cameras

* fix glass table collision

* appears to fix doorspam

* fix ore bags not picking up ore

* fix signatures of /Exited

* remove debug log

* remove duplicate signal registrar

* fix emptying bags into locations

* I don't trust these nested Move calls

* use connect_loc for upgraded resonator fields

* use moveToNullspace

* fix spiderweb crossing

* fix pass checking for windows from a tile off

* fix bluespace closet/transparency issues

* fix mechs not interacting with doors and probably other things

* fix debug

* fix telepete

* add some docs

* stop trying to shoehorn prox monitor into cards

* I should make sure things build

* kill override signal warning

* undef signal

* not many prox monitors survive going off like this

* small fixes to storage

* make moving wormholes respect signals

* use correct signals for pulse demon

* fix pulse heart too

* fix smoke signals

* may have fucked singulo projectile swerve

* fix singulo projectile arcing

* remove duplicate define

* just look at it

* hopefully last cleanups of incorrect signal usage

* fix squeaking

* may god have mercy on my soul

* Apply suggestions from code review

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: warriorstar-orion <orion@snowfrost.garden>

* lewc review

* Apply suggestions from code review

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: warriorstar-orion <orion@snowfrost.garden>

* burza review

* fix bad args for grenade assemblies

* Update code/__DEFINES/is_helpers.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: warriorstar-orion <orion@snowfrost.garden>

---------

Signed-off-by: warriorstar-orion <orion@snowfrost.garden>
Co-authored-by: DGamerL <daan.lyklema@gmail.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
2024-12-21 08:07:44 +00:00

98 lines
3.3 KiB
Plaintext

// Glass shards
/obj/item/shard
name = "shard"
desc = "A nasty looking shard of glass."
icon = 'icons/obj/shards.dmi'
icon_state = "large"
w_class = WEIGHT_CLASS_TINY
force = 5
throwforce = 10
item_state = "shard-glass"
materials = list(MAT_GLASS = MINERAL_MATERIAL_AMOUNT)
attack_verb = list("stabbed", "slashed", "sliced", "cut")
hitsound = 'sound/weapons/bladeslice.ogg'
armor = list(MELEE = 100, BULLET = 0, LASER = 0, ENERGY = 100, BOMB = 0, RAD = 0, FIRE = 50, ACID = 100)
max_integrity = 40
resistance_flags = ACID_PROOF
sharp = TRUE
var/cooldown = 0
var/icon_prefix
var/obj/item/stack/sheet/welded_type = /obj/item/stack/sheet/glass
/obj/item/shard/suicide_act(mob/user)
to_chat(viewers(user), pick("<span class='danger'>[user] is slitting [user.p_their()] wrists with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>",
"<span class='danger'>[user] is slitting [user.p_their()] throat with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>"))
return BRUTELOSS
/obj/item/shard/proc/set_initial_icon_state()
icon_state = pick("large", "medium", "small")
switch(icon_state)
if("small")
pixel_x = rand(-12, 12)
pixel_y = rand(-12, 12)
if("medium")
pixel_x = rand(-8, 8)
pixel_y = rand(-8, 8)
if("large")
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
if(icon_prefix)
icon_state = "[icon_prefix][icon_state]"
/obj/item/shard/Initialize(mapload)
. = ..()
AddComponent(/datum/component/caltrop, force)
set_initial_icon_state()
var/static/list/loc_connections = list(
COMSIG_ATOM_ENTERED = PROC_REF(on_atom_entered)
)
AddElement(/datum/element/connect_loc, loc_connections)
/obj/item/shard/afterattack__legacy__attackchain(atom/movable/AM, mob/user, proximity)
if(!proximity || !(src in user))
return
if(isturf(AM))
return
if(isstorage(AM))
return
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(!H.gloves && !HAS_TRAIT(H, TRAIT_PIERCEIMMUNE))
var/obj/item/organ/external/affecting = H.get_organ("[user.hand ? "l" : "r" ]_hand")
if(affecting.is_robotic())
return
to_chat(H, "<span class='warning'>[src] cuts into your hand!</span>")
if(affecting.receive_damage(force * 0.5))
H.UpdateDamageIcon()
/obj/item/shard/welder_act(mob/user, obj/item/I)
. = TRUE
if(!I.use_tool(src, user, volume = I.tool_volume))
return
new welded_type(user.loc)
to_chat(user, "<span class='notice'>You add the newly-formed glass to the stack.</span>")
qdel(src)
/obj/item/shard/proc/on_atom_entered(datum/source, atom/movable/entered)
var/mob/living/living_entered = entered
if(istype(living_entered) && has_gravity(loc))
if(living_entered.incorporeal_move || HAS_TRAIT(living_entered, TRAIT_FLYING) || living_entered.floating)
return
playsound(loc, 'sound/effects/glass_step.ogg', 50, TRUE)
/obj/item/shard/decompile_act(obj/item/matter_decompiler/C, mob/user)
C.stored_comms["glass"] += 3
qdel(src)
return TRUE
/obj/item/shard/plasma
name = "plasma shard"
desc = "A shard of plasma glass. Considerably tougher then normal glass shards. Apparently not tough enough to be a window."
force = 6
throwforce = 11
icon_state = "plasmalarge"
materials = list(MAT_PLASMA = MINERAL_MATERIAL_AMOUNT * 0.5, MAT_GLASS = MINERAL_MATERIAL_AMOUNT)
icon_prefix = "plasma"
welded_type = /obj/item/stack/sheet/plasmaglass