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 17:08:10 -04:00
committed by GitHub
parent 56d0cd3e20
commit 37779acf01
56 changed files with 223 additions and 254 deletions
+2 -2
View File
@@ -139,11 +139,11 @@
visible_message(span_danger("\The [src] has been attacked with \the [W][(user ? " by [user]." : ".")]"))
var/damage = 0
switch(W.damtype)
if("fire")
if(BURN)
damage = (W.force / fire_resist)
if(istype(W, /obj/item/weldingtool))
playsound(src, W.usesound, 100, 1)
if("brute")
if(BRUTE)
damage = (W.force / brute_resist)
take_damage(damage)
+2 -8
View File
@@ -100,7 +100,7 @@
busy_bank = FALSE
icon_state = "item_bank"
return
var/obj/N = new I(get_turf(src))
var/obj/item/N = new I(get_turf(src))
log_admin("[key_name_admin(user)] retrieved [N] from the item bank.")
visible_message(span_notice("\The [src] dispenses the [N] to \the [user]."))
user.put_in_hands(N)
@@ -138,7 +138,7 @@
if(!choice || choice == "Cancel" || !Adjacent(user) || inoperable() || panel_open)
busy_bank = FALSE
return
for(var/obj/check in O.contents)
for(var/obj/item/check in O.contents)
if(!check.persist_storable)
to_chat(user, span_warning("\The [src] buzzes. \The [O] contains [check], which cannot be stored. Please remove this item before attempting to store \the [O]. As a reminder, any contents of \the [O] will be lost if you store it with contents."))
busy_bank = FALSE
@@ -162,12 +162,6 @@
/////STORABLE ITEMS AND ALL THAT JAZZ/////
//I am only really intending this to be used for single items. Mostly stuff you got right now, but can't/don't want to use right now.
//It is not at all intended to be a thing that just lets you hold on to stuff forever, but just until it's the right time to use it.
/obj
var/persist_storable = TRUE //If this is true, this item can be stored in the item bank.
//This is automatically set to false when an item is removed from storage
/////LIST OF STUFF WE DON'T WANT PEOPLE STORING/////
/obj/item/pda
+2 -2
View File
@@ -147,12 +147,12 @@
onfire = !(onfire)
if (onfire)
force = 3
damtype = "fire"
damtype = BURN
icon_state = "cake1"
START_PROCESSING(SSobj, src)
else
force = null
damtype = "brute"
damtype = BRUTE
icon_state = "cake0"
return
@@ -1,9 +1,3 @@
// This is on the base /item so badmins can play with it by calling hide_identity().
/obj/item
var/datum/identification/identity = null
var/identity_type = /datum/identification
var/init_hide_identity = FALSE // Set to true to automatically obscure the object on initialization.
/obj/item/Initialize(mapload)
if(init_hide_identity)
identity = new identity_type(src)
@@ -61,7 +61,7 @@ var/list/name_to_material
* Arguments:
* - breakdown_flags: A set of flags determining how exactly the materials are broken down. (unused)
*/
/obj/proc/get_material_composition(breakdown_flags=NONE)
/obj/item/proc/get_material_composition(breakdown_flags=NONE)
. = list()
for(var/mat in matter)
var/datum/material/M = GET_MATERIAL_REF(mat)
@@ -78,7 +78,7 @@ var/list/name_to_material
else
.[M] = matter[mat]
/obj/proc/set_custom_materials(list/materials, multiplier = 1)
/obj/item/proc/set_custom_materials(list/materials, multiplier = 1)
SHOULD_NOT_OVERRIDE(TRUE)
if(!LAZYLEN(materials))
+1 -1
View File
@@ -120,7 +120,7 @@
icon_state = "plasmacutter"
item_state = "plasmacutter"
w_class = ITEMSIZE_NORMAL //it is smaller than the pickaxe
damtype = "fire"
damtype = BURN
digspeed = 18 //Can slice though normal walls, all girders, or be used in reinforced wall deconstruction/light thermite on fire
origin_tech = list(TECH_MATERIAL = 4, TECH_PHORON = 3, TECH_ENGINEERING = 3)
matter = list(MAT_STEEL = 3000, MAT_PLASTEEL = 1500, MAT_DIAMONDS = 500, MAT_PHORON = 500)
@@ -263,7 +263,7 @@
return
remove_points(inserted_id, prize.cost)
var/obj/I = new prize.equipment_path(loc)
var/obj/item/I = new prize.equipment_path(loc)
I.persist_storable = FALSE
flick(icon_vend, src)
else
+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
-5
View File
@@ -84,11 +84,6 @@
*/
// Attaches to the end of dropped items' code.
/obj/item
var/destroy_on_drop = FALSE // Used by augments to determine if the item should destroy itself when dropped, or return to its master.
var/obj/item/organ/my_augment = null // Used to reference the object's host organ.
/obj/item/dropped(mob/user)
. = ..(user)
if(src)
@@ -199,7 +199,7 @@
middle.update_idle_power_usage(strength * range * 100)
. = TRUE
if("fire")
if(BURN)
fire(ui.user)
. = TRUE
-3
View File
@@ -2,9 +2,6 @@
// Vars and Default tesla_act behavior
////////////////////////////////////////
/obj
var/being_shocked = FALSE
/obj/proc/tesla_act(var/power)
being_shocked = TRUE
var/power_bounced = power / 2
-3
View File
@@ -59,9 +59,6 @@
cached_rad_resistance = 60 //Three times that of a steel wall. Rock is less dense than steel, but this is assuming that a normal wall isn't just solid steel all the way through like rock turfs are.
return
/obj
var/rad_resistance = 0 // Allow overriding rad resistance
// If people expand the system, this may be useful. Here as a placeholder until then
/atom/proc/rad_act(var/severity)
return 1
@@ -784,16 +784,18 @@
for(var/mob/living/carbon/M in viewers(world.view, location))
switch(get_dist(M, location))
if(0 to 3)
if(hasvar(M, "glasses"))
if(istype(M:glasses, /obj/item/clothing/glasses/sunglasses))
if(ishuman(M))
var/mob/living/carbon/human/target = M
if(istype(target.glasses, /obj/item/clothing/glasses/sunglasses))
continue
M.flash_eyes()
M.Weaken(15)
if(4 to 5)
if(hasvar(M, "glasses"))
if(istype(M:glasses, /obj/item/clothing/glasses/sunglasses))
if(ishuman(M))
var/mob/living/carbon/human/target = M
if(istype(target.glasses, /obj/item/clothing/glasses/sunglasses))
continue
M.flash_eyes()
@@ -10,7 +10,6 @@
anchored = FALSE
density = FALSE
pressure_resistance = 5*ONE_ATMOSPHERE
matter = list(MAT_STEEL = 1850)
level = 2
var/sortType = ""
var/ptype = 0
-3
View File
@@ -1,6 +1,3 @@
/obj/item
var/list/tool_qualities = list()
/obj/item/examine(mob/user)
. = ..()
for(var/qual in tool_qualities)
+3 -3
View File
@@ -123,12 +123,12 @@
else
to_chat(user, span_notice("Unable to repair while [src] is off."))
else if(hasvar(W,"force") && hasvar(W,"damtype"))
else if(W.force && W.damtype)
user.setClickCooldown(user.get_attack_speed(W))
switch(W.damtype)
if("fire")
if(BURN)
health -= W.force * fire_dam_coeff
if("brute")
if(BRUTE)
health -= W.force * brute_dam_coeff
..()
healthcheck()
@@ -16,13 +16,6 @@ var/list/gurgled_overlays = list(
"pink" = image('icons/effects/sludgeoverlay_vr.dmi', icon_state = "pink")
)
/obj/item
var/gurgled = FALSE
var/oldname
var/cleanname
var/cleandesc
var/gurgled_color
/obj/item/proc/gurgle_contaminate(atom/movable/item_storage = null, contamination_flavor = "Generic", contamination_color = "green")
if(!can_gurgle())
return FALSE
@@ -241,10 +241,3 @@
return FALSE
//moved prot organ digest to their appropriate file
// Gradual damage measurement
/obj/item
var/digest_stage = null
var/d_mult_old = 1 //digest stage descriptions
var/d_mult = 1 //digest stage descriptions
var/d_stage_overlay //digest stage effects
-3
View File
@@ -785,9 +785,6 @@
if(new_color)
glow_color = new_color
/obj/item
var/trash_eatable = TRUE
/mob/living/proc/get_digestion_nutrition_modifier()
return 1
@@ -80,11 +80,11 @@
continue
if(istype(O, /obj/machinery/artifact))
var/obj/machinery/artifact/A = O
if(A.being_used)
if(A.in_use)
artifact_in_use = 1
else
A.anchored = TRUE
A.being_used = 1
A.in_use = 1
if(artifact_in_use)
atom_say("Cannot scan. Too much interference.")
@@ -134,7 +134,7 @@
if(scanned_object && istype(scanned_object, /obj/machinery/artifact))
var/obj/machinery/artifact/A = scanned_object
A.anchored = FALSE
A.being_used = 0
A.in_use = 0
scanned_object = null
//hardcoded responses, oh well
@@ -123,7 +123,7 @@
inserted_battery.battery_effect.ToggleActivate()
harvesting = 0
cur_artifact.anchored = FALSE
cur_artifact.being_used = 0
cur_artifact.in_use = 0
cur_artifact = null
atom_say("Energy harvesting interrupted.")
icon_state = "incubator"
@@ -173,7 +173,7 @@
atom_say("Cannot harvest. No noteworthy energy signature isolated.")
return
if(analysed && analysed.being_used)
if(analysed && analysed.in_use)
atom_say("Cannot harvest. Source already being harvested.")
return
@@ -236,7 +236,7 @@
harvesting = 1
update_use_power(USE_POWER_ACTIVE)
cur_artifact.anchored = TRUE
cur_artifact.being_used = 1
cur_artifact.in_use = 1
icon_state = "incubator_on"
atom_say("Beginning energy harvesting.")
@@ -268,7 +268,7 @@
update_use_power(USE_POWER_IDLE)
harvesting = 0
cur_artifact.anchored = FALSE
cur_artifact.being_used = 0
cur_artifact.in_use = 0
cur_artifact = null
src.visible_message(span_bold("[name]") + " states, \"Battery is full.\"")
icon_state = "incubator"