Skip to content

Commit

Permalink
Merge pull request Civ13#2494 from HaultyAnonie/trenchunfuck
Browse files Browse the repository at this point in the history
Universal Shovel un-fuck.
  • Loading branch information
Bierkraan authored Nov 11, 2023
2 parents 1093108 + 1604b22 commit 09e6a25
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
2 changes: 1 addition & 1 deletion code/game/turfs/floor_attackby.dm
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
var/turf/T = get_turf(src)
var/mob/living/human/H = user
var/obj/item/weapon/material/shovel/SH = C
if (H.a_intent != I_DISARM)
if (H.a_intent != I_HARM)
if (!H.shoveling)
if (T.icon == 'icons/turf/snow.dmi' && istype(H))
if (T.available_snow > 0)
Expand Down
30 changes: 18 additions & 12 deletions code/modules/1713/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@

/obj/item/weapon/foldable/generic
name = "Foldable Mortar"
desc = "A light-weight portable mortar"
desc = "A light-weight portable mortar."
icon_state = "mortar"
item_state = "type89"
path = /obj/structure/cannon/mortar/foldable/generic

/obj/item/weapon/foldable/type89_mortar
name = "Type 89 Mortar"
desc = "A light-weight portable mortar"
desc = "A light-weight portable mortar."
icon_state = "type89"
item_state = "type89"
path = /obj/structure/cannon/mortar/foldable/type89

/obj/item/weapon/foldable/atgm
name = "Anti-Tank Guided Missile system"
desc = "A light-weight portable ATGM"
desc = "A light-weight portable ATGM."
icon_state = "atgm"
item_state = "atgm"
path = /obj/item/weapon/gun/projectile/automatic/stationary/atgm/foldable
Expand Down Expand Up @@ -117,6 +117,7 @@
sharp = FALSE
edge = TRUE
slot_flags = SLOT_BACK|SLOT_BELT
var/dig_speed = 7
var/usespeed = 1.5
default_material = "iron"
force_divisor = 0.25
Expand All @@ -130,20 +131,24 @@
default_material = "steel"
health = 50
maxhealth = 50
dig_speed = 7

/obj/item/weapon/material/shovel/bone
icon_state = "shovel_bone"
desc = "A shovel made out of some bone."
usespeed = 0.6
default_material = "bone"
health = 7.5
maxhealth = 7.5
dig_speed = 7

// Foldable shovels
/obj/item/weapon/material/shovel/spade/foldable
name = "foldable shovel"
icon_state = "trench_shovel"
item_state = "lopata"
usespeed = 0.9
dig_speed = 7
var/path = /obj/item/weapon/foldable_shovel
secondary_action = TRUE

Expand All @@ -156,26 +161,24 @@

/obj/item/weapon/material/shovel/trench
name = "entrenching tool"
desc = "A shovel used specifically for digging trenches."
desc = "A compact shovel used specifically for digging and moving dirt."
icon_state = "trench_shovel"
var/dig_speed = 7
dig_speed = 7
force = 35
usespeed = 0.8

/obj/item/weapon/material/shovel/trench/foldable
name = "foldable entrenching tool"
desc = "A foldable shovel used specifically for digging trenches."
desc = "A foldable shovel used specifically for digging and moving dirt."
icon_state = "trench_shovel"
dig_speed = 8
usespeed = 0.8
var/path = /obj/item/weapon/foldable_shovel/trench
secondary_action = TRUE

/obj/item/weapon/material/shovel/trench/foldable/etool
name = "foldable entrenching tool"
desc = "A foldable shovel used specifically for digging trenches."
desc = "A foldable shovel used specifically for digging and moving dirt."
icon_state = "etool"
dig_speed = 8
usespeed = 0.8
path = /obj/item/weapon/foldable_shovel/trench/etool

Expand All @@ -196,9 +199,11 @@
w_class = ITEM_SIZE_SMALL
weight = 1.18
usespeed = 0.8
dig_speed = 7

/obj/item/weapon/material/shovel/spade/wood
usespeed = 0.4
dig_speed = 7
default_material = "wood"
material = "wood"
icon_state = "spadem"
Expand All @@ -207,7 +212,7 @@
/obj/item/weapon/foldable_shovel
name = "foldable shovel"
icon = 'icons/obj/items.dmi'
desc = "A foldable shovel which is currently, folded"
desc = "A foldable shovel which is currently, folded."
icon_state = "trench_shovel_folded"
item_state = "lopata"
edge = FALSE
Expand All @@ -219,14 +224,14 @@

/obj/item/weapon/foldable_shovel/trench
name = "foldable entrenching tool"
desc = "A foldable entrenching tool which is currently, folded"
desc = "A foldable entrenching tool which is currently, folded."
icon_state = "trench_shovel_folded"
item_state = "lopata"
path = /obj/item/weapon/material/shovel/trench/foldable

/obj/item/weapon/foldable_shovel/trench/etool
name = "foldable entrenching tool"
desc = "A foldable entrenching tool which is currently, folded"
desc = "A foldable entrenching tool which is currently, folded."
icon_state = "etool_folded"
item_state = "lopata"
path = /obj/item/weapon/material/shovel/trench/foldable/etool
Expand All @@ -242,6 +247,7 @@
name = "small shovel"
icon_state = "lopata"
item_state = "lopata"
dig_speed = 7
usespeed = 0.9

/obj/item/weapon/material/pickaxe
Expand Down
11 changes: 6 additions & 5 deletions code/modules/1713/trench.dm
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ var/list/global/floor_cache = list()
return ..()

/turf/floor/dirt/attackby(obj/item/C as obj, mob/user as mob)
if (istype(C, /obj/item/weapon/material/shovel/trench))
if (istype(C, /obj/item/weapon/material/shovel) && user.a_intent == I_HARM)
var/obj/item/weapon/material/shovel/trench/S = C
visible_message("<span class = 'notice'>[user] starts to dig a trench.</span>")
if (!do_after(user, (10 - S.dig_speed)*10, src))
Expand All @@ -345,7 +345,7 @@ var/list/global/floor_cache = list()
/turf/floor/beach/sand
var/trench_stage = 0
/turf/floor/beach/sand/attackby(obj/item/C as obj, mob/user as mob)
if (istype(C, /obj/item/weapon/material/shovel/trench))
if (istype(C, /obj/item/weapon/material/shovel) && user.a_intent == I_HARM)
var/obj/item/weapon/material/shovel/trench/S = C
visible_message("<span class = 'notice'>[user] starts to dig a trench.</span>")
if (!do_after(user, (10 - S.dig_speed)*10, src))
Expand All @@ -367,7 +367,7 @@ var/list/global/floor_cache = list()
..()

/turf/floor/dirt/attackby(obj/item/C as obj, mob/user as mob)
if (istype(C, /obj/item/weapon/material/shovel/trench))
if (istype(C, /obj/item/weapon/material/shovel) && user.a_intent == I_HARM)
var/obj/item/weapon/material/shovel/trench/S = C
visible_message("<span class = 'notice'>[user] starts to dig a trench.</span>")
if (!do_after(user, (10 - S.dig_speed)*10, src))
Expand All @@ -388,9 +388,10 @@ var/list/global/floor_cache = list()
return
..()


/turf/floor/grass/attackby(obj/item/C as obj, mob/user as mob)
var/mob/living/human/H = user
if (istype(C, /obj/item/weapon/material/shovel/trench))
if (istype(C, /obj/item/weapon/material/shovel))
var/obj/item/weapon/material/shovel/trench/S = C
visible_message("<span class = 'notice'>[user] starts to remove grass layer.</span>")
if (!do_after(user, (100/(H.getStatCoeff("strength"))/(12/S.dig_speed)))) //Think a DEFINE for the number being divided over S.dig_speed could be helpful, keeping it this for now
Expand Down Expand Up @@ -420,7 +421,7 @@ var/list/global/floor_cache = list()

/turf/floor/winter/attackby(obj/item/C as obj, mob/user as mob)
var/mob/living/human/H = user
if (istype(C, /obj/item/weapon/material/shovel/trench))
if (istype(C, /obj/item/weapon/material/shovel))
var/obj/item/weapon/material/shovel/trench/S = C
visible_message("<span class = 'notice'>[user] starts to remove snow layer.</span>")
if (!do_after(user, (100/(H.getStatCoeff("strength"))/(12/S.dig_speed))))
Expand Down

0 comments on commit 09e6a25

Please sign in to comment.