Skip to content

Commit

Permalink
Update wrecks.dm
Browse files Browse the repository at this point in the history
  • Loading branch information
PawnAtWork committed Jun 30, 2023
1 parent 812d9b3 commit 25416ff
Showing 1 changed file with 3 additions and 45 deletions.
48 changes: 3 additions & 45 deletions code/game/objects/structures/wrecks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,56 +55,15 @@
name = "wrecked motorcycle"
desc = "An old pre-war motorcycle, rusted and destroyed with age and weathering."
icon_state = "rust_light_no_wheels"
uses_left = 2
inuse = FALSE

/obj/structure/wreck/car/bike/welder_act(mob/living/user, obj/item/I)
. = TRUE

if(inuse || uses_left <= 0) //this means that if mappers or admins want an nonharvestable version, set the uses_left to 0
return
inuse = TRUE //one at a time boys, this isn't some kind of weird party
if(!I.tool_start_check(user, amount=0)) //this seems to be called everywhere, so for consistency's sake
inuse = FALSE
return //the tool fails this check, so stop
user.visible_message("[user] starts disassembling [src].")
for(var/i1 in 1 to 2)
if(!I.use_tool(src, user, 75, volume=100))
user.visible_message("[user] stops disassembling [src].")
inuse = FALSE
return //you did something, like moving, so stop
var/fake_dismantle = pick("plating", "chassis", "suspension arm", "part of the frame")
user.visible_message("[user] slices through a [fake_dismantle].")

var/turf/usr_turf = get_turf(user) //Bellow are the changes made by PR#256
var/modifier = 0
if(HAS_TRAIT(user,TRAIT_TECHNOPHREAK))
modifier += rand(1,3)
var/obj/item/l = user.get_inactive_held_item()
if(istype(l,/obj/item/weldingtool))
var/obj/item/weldingtool/WO = l
if(WO.tool_start_check(user, amount=3))
WO.use(3)
modifier++
for(var/i2 in 1 to (2+modifier))
new /obj/item/salvage/low(usr_turf)
for(var/i3 in 1 to (1+modifier)) //this is just less lines for the same thing
if(prob(6))
new /obj/item/salvage/high(usr_turf)
uses_left--
inuse = FALSE //putting this after the -- because the first check prevents cheesing
if(uses_left <= 0) //I prefer to put any qdel stuff at the very end, with src being the very last thing
visible_message("[src] falls apart, the final components having been removed.")
qdel(src)

/obj/structure/wreck/bus
name = "wrecked bus"
desc = "An old pre-war vehicle, rusted and destroyed with age and weathering."
bound_width = 192
bound_height = 64
icon = 'icons/obj/vehicles/bus1.dmi'
uses_left = 4
inuse = FALSE
var/uses_left = 4
var/inuse = FALSE

/obj/structure/wreck/bus/welder_act(mob/living/user, obj/item/I)
. = TRUE
Expand Down Expand Up @@ -177,8 +136,7 @@
icon_state = "bus1"
bound_width = 32
bound_height = 32
uses_left = 2
inuse = FALSE
var/uses_left = 2

Check failure on line 139 in code/game/objects/structures/wrecks.dm

View workflow job for this annotation

GitHub Actions / Run Linters

/obj/structure/wreck/bus/rusted/segmented redeclares var "uses_left"

/obj/structure/wreck/bus/rusted/segmented1
name = "wrecked bus"
Expand Down

0 comments on commit 25416ff

Please sign in to comment.