Gets rid of hasvar usage and moves up some vars (#18262)

* Gets rid of hasvar usage

* thiiis

* moves damtype to /obj/item

* throwing

* Move vars moved

* matter as well

Pretty much only used for the robot lathe and when crafting...When you could only smelt down obj/item for its materials

* Update floor_light.dm

* exploitable

* this can be moved up...

* move persist to /item

you can't ever place /obj in storage anyway...It would imply you can store the supermatter, which I think we don't want.

* gets rid of being_used

I added this for xenoarch, that was a mistake

* move these

* move these to the base file

* Makes floorlight autolathe recipe not shit

* Update floor_light.dm

* Update floor_light.dm

* Mechs no longer gib when hitting things

---------

Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com>
This commit is contained in:
Cameron Lennox
2025-08-21 23:08:10 +02:00
committed by GitHub
co-authored by Selis
parent 56d0cd3e20
commit 37779acf01
56 changed files with 223 additions and 254 deletions
+22 -15
View File
@@ -240,24 +240,31 @@ var/list/slot_equipment_priority = list( \
//Outdated but still in use apparently. This should at least be a human proc.
/mob/proc/get_equipped_items()
var/list/items = new/list()
var/list/items = list()
if(hasvar(src,"back")) if(src:back) items += src:back
if(hasvar(src,"belt")) if(src:belt) items += src:belt
if(hasvar(src,"l_ear")) if(src:l_ear) items += src:l_ear
if(hasvar(src,"r_ear")) if(src:r_ear) items += src:r_ear
if(hasvar(src,"glasses")) if(src:glasses) items += src:glasses
if(hasvar(src,"gloves")) if(src:gloves) items += src:gloves
if(hasvar(src,"head")) if(src:head) items += src:head
if(hasvar(src,"shoes")) if(src:shoes) items += src:shoes
if(hasvar(src,"wear_id")) if(src:wear_id) items += src:wear_id
if(hasvar(src,"wear_mask")) if(src:wear_mask) items += src:wear_mask
if(hasvar(src,"wear_suit")) if(src:wear_suit) items += src:wear_suit
if(hasvar(src,"w_uniform")) if(src:w_uniform) items += src:w_uniform
return items
if(hasvar(src,"l_hand")) if(src:l_hand) items += src:l_hand
if(hasvar(src,"r_hand")) if(src:r_hand) items += src:r_hand
/mob/living/get_equipped_items()
var/list/items = ..()
if(back) items += back
if(l_hand) items += l_hand
if(r_hand) items += r_hand
if(wear_mask) items += wear_mask
return items
/mob/living/carbon/human/get_equipped_items()
var/list/items = ..()
if(belt) items += belt
if(l_ear) items += l_ear
if(r_ear) items += r_ear
if(glasses) items += glasses
if(gloves) items += gloves
if(head) items += head
if(shoes) items += shoes
if(wear_id) items += wear_id
if(wear_suit) items += wear_suit
if(w_uniform) items += w_uniform
return items
/mob/proc/delete_inventory()
@@ -423,14 +423,13 @@ emp_act
return
//VORESTATION EDIT END - Allows for thrown vore!
if(istype(AM,/obj/))
var/obj/O = AM
if(stat != DEAD && istype(O,/obj/item) && trash_catching && vore_selected) //Ported from chompstation
var/obj/item/I = O
if(adminbus_trash || is_type_in_list(I, GLOB.edible_trash) && I.trash_eatable && !is_type_in_list(I, GLOB.item_vore_blacklist))
visible_message(span_vwarning("[I] is thrown directly into [src]'s [lowertext(vore_selected.name)]!"))
I.throwing = 0
I.forceMove(vore_selected)
if(istype(AM,/obj/item))
var/obj/item/O = AM
if(stat != DEAD && trash_catching && vore_selected)
if(adminbus_trash || is_type_in_list(O, GLOB.edible_trash) && O.trash_eatable && !is_type_in_list(O, GLOB.item_vore_blacklist))
visible_message(span_vwarning("[O] is thrown directly into [src]'s [lowertext(vore_selected.name)]!"))
O.throwing = 0
O.forceMove(vore_selected)
return
if(in_throw_mode && speed <= THROWFORCE_SPEED_DIVISOR) //empty active hand and we're in throw mode
if(canmove && !restrained() && !src.is_incorporeal())
@@ -441,7 +440,6 @@ emp_act
throw_mode_off()
return
var/dtype = O.damtype
var/throw_damage = O.throwforce*(speed/THROWFORCE_SPEED_DIVISOR)
if(species && species.throwforce_absorb_threshold >= throw_damage)
@@ -491,34 +489,30 @@ emp_act
var/armor = run_armor_check(affecting, "melee", O.armor_penetration, "Your armor has protected your [hit_area].", "Your armor has softened hit to your [hit_area].") //I guess "melee" is the best fit here
if(armor < 100)
apply_damage(throw_damage, dtype, zone, armor, soaked, is_sharp(O), has_edge(O), O)
apply_damage(throw_damage, O.damtype, zone, armor, soaked, is_sharp(O), has_edge(O), O)
//thrown weapon embedded object code.
if(dtype == BRUTE && istype(O,/obj/item))
var/obj/item/I = O
if (!is_robot_module(I))
var/sharp = is_sharp(I)
if(O.damtype == BRUTE)
if (!is_robot_module(O))
var/sharp = is_sharp(O)
var/damage = throw_damage
if (soaked)
if(soaked)
damage -= soaked
if (armor)
if(armor)
damage /= armor+1
//blunt objects should really not be embedding in things unless a huge amount of force is involved
var/embed_chance = sharp? damage/I.w_class : damage/(I.w_class*3)
var/embed_threshold = sharp? 5*I.w_class : 15*I.w_class
var/embed_chance = sharp? damage/O.w_class : damage/(O.w_class*3)
var/embed_threshold = sharp? 5*O.w_class : 15*O.w_class
//Sharp objects will always embed if they do enough damage.
//Thrown sharp objects have some momentum already and have a small chance to embed even if the damage is below the threshold
if((sharp && prob(damage/(10*I.w_class)*100)) || (damage > embed_threshold && prob(embed_chance)))
affecting.embed(I)
if((sharp && prob(damage/(10*O.w_class)*100)) || (damage > embed_threshold && prob(embed_chance)))
affecting.embed(O)
// Begin BS12 momentum-transfer code.
var/mass = 1.5
if(istype(O, /obj/item))
var/obj/item/I = O
mass = I.w_class/THROWNOBJ_KNOCKBACK_DIVISOR
var/mass = O.w_class/THROWNOBJ_KNOCKBACK_DIVISOR
var/momentum = speed*mass
if(O.throw_source && momentum >= THROWNOBJ_KNOCKBACK_SPEED && !buckled)
@@ -539,7 +533,9 @@ emp_act
src.pinned += O
// This does a prob check to catch the thing flying at you, with a minimum of 1%
/mob/living/carbon/human/proc/can_catch(var/obj/O)
/mob/living/carbon/human/proc/can_catch(var/obj/item/O)
if(!isitem(O))
return FALSE
if(!get_active_hand()) // If active hand is empty
var/obj/item/organ/external/temp = organs_by_name[BP_R_HAND]
if (hand)
+8 -12
View File
@@ -263,14 +263,13 @@
/mob/living/hitby(atom/movable/AM as mob|obj,var/speed = THROWFORCE_SPEED_DIVISOR)//Standardization and logging -Sieve
if(is_incorporeal())
return
if(istype(AM,/obj/))
var/obj/O = AM
if(stat != DEAD && istype(O,/obj/item) && trash_catching && vore_selected) //ported from chompstation
var/obj/item/I = O
if(adminbus_trash || is_type_in_list(I, GLOB.edible_trash) && I.trash_eatable && !is_type_in_list(I, GLOB.item_vore_blacklist))
visible_message(span_vwarning("[I] is thrown directly into [src]'s [lowertext(vore_selected.name)]!"))
I.throwing = 0
I.forceMove(vore_selected)
if(istype(AM,/obj/item))
var/obj/item/O = AM
if(stat != DEAD && trash_catching && vore_selected)
if(adminbus_trash || is_type_in_list(O, GLOB.edible_trash) && O.trash_eatable && !is_type_in_list(O, GLOB.item_vore_blacklist))
visible_message(span_vwarning("[O] is thrown directly into [src]'s [lowertext(vore_selected.name)]!"))
O.throwing = 0
O.forceMove(vore_selected)
return
var/dtype = O.damtype
var/throw_damage = O.throwforce*(speed/THROWFORCE_SPEED_DIVISOR)
@@ -302,10 +301,7 @@
ai_holder.react_to_attack(O.thrower)
// Begin BS12 momentum-transfer code.
var/mass = 1.5
if(istype(O, /obj/item))
var/obj/item/I = O
mass = I.w_class/THROWNOBJ_KNOCKBACK_DIVISOR
var/mass = O.w_class/THROWNOBJ_KNOCKBACK_DIVISOR
var/momentum = speed*mass
if(O.throw_source && momentum >= THROWNOBJ_KNOCKBACK_SPEED)
+1 -5
View File
@@ -1166,10 +1166,6 @@
/mob/proc/is_muzzled()
return 0
//Exploitable Info Update
/obj
var/datum/weakref/exploit_for //if this obj is an exploit for somebody, this points to them
/mob/proc/amend_exploitable(var/obj/item/I)
if(istype(I))
exploit_addons |= I
@@ -1178,7 +1174,7 @@
I.exploit_for = WEAKREF(src)
/obj/Destroy()
/obj/item/Destroy()
if(exploit_for)
var/mob/exploited = exploit_for.resolve()
exploited?.exploit_addons -= src