diff --git a/code/__defines/mobs.dm b/code/__defines/mobs.dm index 4b454feca2e..d49c51cb614 100644 --- a/code/__defines/mobs.dm +++ b/code/__defines/mobs.dm @@ -137,8 +137,6 @@ #define FLASH_PROTECTION_NONE 0 #define FLASH_PROTECTION_MODERATE 1 #define FLASH_PROTECTION_MAJOR 2 -#define ANIMAL_SPAWN_DELAY round(config.respawn_delay / 6) -#define DRONE_SPAWN_DELAY round(config.respawn_delay / 3) #define ANIMAL_SPAWN_DELAY round(config.respawn_delay / 6) #define DRONE_SPAWN_DELAY round(config.respawn_delay / 3) diff --git a/code/datums/uplink/highly visible and dangerous weapons.dm b/code/datums/uplink/highly visible and dangerous weapons.dm index b7aa4de317d..82701d2765b 100644 --- a/code/datums/uplink/highly visible and dangerous weapons.dm +++ b/code/datums/uplink/highly visible and dangerous weapons.dm @@ -78,3 +78,8 @@ name = "Anti-materiel Rifle" item_cost = DEFAULT_TELECRYSTAL_AMOUNT path = /obj/item/weapon/gun/projectile/heavysniper + +/datum/uplink_item/item/visible_weapons/chainsaw + name = "Chainsaw" + item_cost = 10 + path = /obj/item/weapon/material/twohanded/chainsaw/fueled diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 384773c4f33..7eae7d4a80f 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -901,7 +901,7 @@ About the new airlock wires panel: /obj/machinery/door/airlock/proc/CanChainsaw(var/obj/item/weapon/material/twohanded/chainsaw/ChainSawVar) - return (ChainSawVar.powered && density) + return (ChainSawVar.powered && density && hashatch) /obj/machinery/door/airlock/attackby(C as obj, mob/user as mob) if(!istype(usr, /mob/living/silicon)) diff --git a/code/game/objects/items/trash.dm b/code/game/objects/items/trash.dm index 942902fe203..3b120543521 100644 --- a/code/game/objects/items/trash.dm +++ b/code/game/objects/items/trash.dm @@ -104,5 +104,10 @@ name = "empty basket" icon_state = "chipbasket_empty" +/obj/item/trash/uselessplastic + name = "useless plastic" + icon_state = "useless_plastic" + + /obj/item/trash/attack(mob/M as mob, mob/living/user as mob) return diff --git a/code/game/objects/items/weapons/material/twohanded.dm b/code/game/objects/items/weapons/material/twohanded.dm index 26eb2c42e3f..29dc2185dfe 100644 --- a/code/game/objects/items/weapons/material/twohanded.dm +++ b/code/game/objects/items/weapons/material/twohanded.dm @@ -308,16 +308,16 @@ qdel(src) // Chainsaws! - /obj/item/weapon/material/twohanded/chainsaw name = "chainsaw" + desc = "A robust tree-cutting chainsaw intended to cut down various types of invasive spaceplants that grow on the station." icon_state = "chainsaw_off" base_icon = "chainsaw_off" flags = CONDUCT force = 10 force_wielded = 20 - throwforce = 7 - w_class = 4 + throwforce = 5 + w_class = ITEMSIZE_LARGE sharp = 1 edge = 1 origin_tech = list(TECH_COMBAT = 5) @@ -327,6 +327,7 @@ applies_material_colour = 0 default_material = "steel" parry_chance = 5 + var/fuel_type = "fuel" var/opendelay = 30 // How long it takes to perform a door opening action with this chainsaw, in seconds. var/max_fuel = 300 // The maximum amount of fuel the chainsaw stores. var/fuel_cost = 1 // Multiplier for fuel cost. @@ -334,16 +335,26 @@ var/cutting = 0 //Ignore var/powered = 0 //Ignore -/obj/item/weapon/material/twohanded/chainsaw/op //For events or whatever - name = "bloody chainsaw" - opendelay = 5 - max_fuel = 1000 - fuel_cost = 0.5 - /obj/item/weapon/material/twohanded/chainsaw/Initialize() . = ..() create_reagents(max_fuel) +/obj/item/weapon/material/twohanded/chainsaw/fueled/Initialize() + . = ..() + reagents.add_reagent(fuel_type, max_fuel) + +/obj/item/weapon/material/twohanded/chainsaw/op //For events or whatever + opendelay = 5 + max_fuel = 1000 + fuel_cost = 0.5 + unbreakable = TRUE + parry_chance = 100 //Gotta punish those validhunters + default_material = "plasteel" + +/obj/item/weapon/material/twohanded/chainsaw/op/Initialize() + . = ..() + reagents.add_reagent(fuel_type, max_fuel) + /obj/item/weapon/material/twohanded/chainsaw/proc/PowerUp() var/turf/T = get_turf(src) T.audible_message(span("notice", "\The [src] rumbles to life.")) @@ -372,26 +383,36 @@ powered = 0 update_held_icon() +/obj/item/weapon/material/twohanded/chainsaw/shatter(var/consumed) + var/turf/T = get_turf(src) + new /obj/effect/decal/cleanable/blood/oil(T) + new /obj/effect/decal/cleanable/liquid_fuel(T) + new /obj/item/trash/uselessplastic(T) + . = ..() + /obj/item/weapon/material/twohanded/chainsaw/Destroy() STOP_PROCESSING(SSfast_process, src) return ..() /obj/item/weapon/material/twohanded/chainsaw/proc/RemoveFuel(var/amount = 1) - amount = amount * fuel_cost - reagents.remove_reagent("fuel", Clamp(amount,0,reagents.get_reagent_amount("fuel"))) - if(reagents.get_reagent_amount("fuel") <= 0) - powered = 0 + if(reagents && istype(reagents)) + amount *= fuel_cost + reagents.remove_reagent(fuel_type, Clamp(amount,0,reagents.get_reagent_amount(fuel_type))) + if(reagents.get_reagent_amount(fuel_type) <= 0) + PowerDown() + else PowerDown() /obj/item/weapon/material/twohanded/chainsaw/process() //TickRate is 0.1 var/FuelToRemove = 0.1 //0.1 Every 0.1 seconds - if(cutting) FuelToRemove = 1 playsound(loc, 'sound/weapons/chainsawloop2.ogg', 25, 0, 30) - spark(src, 3, alldirs) - eyecheck(loc) + if(prob(75)) + spark(src, 3, alldirs) + if(prob(25)) + eyecheck(2,loc) else playsound(loc, 'sound/weapons/chainsawloop.ogg', 25, 0, 30) @@ -399,7 +420,13 @@ /obj/item/weapon/material/twohanded/chainsaw/examine(mob/user) if(..(user, 1)) - user << "A heavy-duty chainsaw meant for cutting wood. Contains [round(reagents.total_volume)] unit\s of fuel." + user << "A heavy-duty chainsaw meant for cutting wood. Contains [round(reagents.get_reagent_amount(fuel_type))] unit\s of fuel." + +/obj/item/weapon/material/twohanded/chainsaw/attack(mob/M as mob, mob/living/user as mob) + . = ..() + if(powered) + playsound(loc, "sound/weapons/chainsword.ogg", 25, 0, 30) + RemoveFuel(3) /obj/item/weapon/material/twohanded/chainsaw/afterattack(obj/O as obj, mob/user as mob, proximity) if(!proximity) return @@ -409,51 +436,32 @@ playsound(loc, 'sound/effects/refill.ogg', 50, 1, -6) return else if(powered) - playsound(loc, "sound/weapons/chainsword.ogg", 25, 0, 30) - RemoveFuel(3) - user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) //No sound spam + if(!istype(O)) + user.visible_message(\ + "[user] revs the chainsaw!.",\ + "You rev the chainsaw!.",\ + "You hear a machine rev."\ + ) + + user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) + playsound(loc, "sound/weapons/chainsword.ogg", 25, 0, 30) + RemoveFuel(3) . = ..() -/obj/item/weapon/material/twohanded/chainsaw/proc/eyecheck(mob/living/carbon/human/H as mob) //Shamefully copied from the welder. Damage values multiplied by 0.1 +/obj/item/weapon/material/twohanded/chainsaw/proc/eyecheck(var/multiplier, mob/living/carbon/human/H as mob) //Shamefully copied from the welder. Damage values multiplied by 0.1 - if (!istype(H)) - return 1 + if (!istype(H) || H.status_flags & GODMODE) + return var/obj/item/organ/eyes/E = H.get_eyes() - if(!E) + if(!istype(E)) return - var/safety = H.eyecheck() - if(H.status_flags & GODMODE) - return - switch(safety) - if(FLASH_PROTECTION_MODERATE) - H << "Your eyes sting a little." - E.damage += rand(1, 2)*0.1 - if(E.damage > 12) - H.eye_blurry += rand(3,6)*0.1 - if(FLASH_PROTECTION_NONE) - H << "Your eyes burn." - E.damage += rand(2, 4)*0.1 - if(E.damage > 10) - E.damage += rand(4,10)*0.1 - if(FLASH_PROTECTION_REDUCED) - H << "Your equipment intensify the welder's glow. Your eyes itch and burn severely." - H.eye_blurry += rand(12,20)*0.1 - E.damage += rand(12, 16)*0.1 - if(safety 10) - H << "Your eyes are really starting to hurt. This can't be good for you!" - if (E.damage >= E.min_broken_damage) - H << "You go blind!" - H.sdisabilities |= BLIND - else if (E.damage >= E.min_bruised_damage) - H << "You go blind!" - H.eye_blind = 5 - H.eye_blurry = 5 - H.disabilities |= NEARSIGHTED - addtimer(CALLBACK(H, /mob/.proc/reset_nearsighted), 100) + var/eye_damage = max(0, (2 - H.eyecheck())*multiplier ) + E.damage += eye_damage + if(eye_damage > 0) + H << "Some stray sparks fly in your eyes!" /obj/item/weapon/material/twohanded/chainsaw/AltClick(mob/user as mob) diff --git a/html/changelogs/burgerbb-chainsaw_fixes.yml b/html/changelogs/burgerbb-chainsaw_fixes.yml new file mode 100644 index 00000000000..92199779531 --- /dev/null +++ b/html/changelogs/burgerbb-chainsaw_fixes.yml @@ -0,0 +1,7 @@ +author: BurgerBB + +delete-after: True + +changes: + - bugfix: "Fixed various chainsaw bugs." + - rscadd: "Added Chainsaws to traitor uplink." diff --git a/icons/mob/items/lefthand.dmi b/icons/mob/items/lefthand.dmi index 5f191bfe4f0..244e23fc7d8 100644 Binary files a/icons/mob/items/lefthand.dmi and b/icons/mob/items/lefthand.dmi differ diff --git a/icons/obj/trash.dmi b/icons/obj/trash.dmi index 219d93400a3..1b3c99e8938 100644 Binary files a/icons/obj/trash.dmi and b/icons/obj/trash.dmi differ