Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 4b3881b

Browse filesBrowse files
authored
[PORT] Demolition Modifier (#20988)
* i am going to create an environment that is so demolished -bottles/broken bottles (0.25x) -scalpels (0.25x) -screwdrivers (0.5x) -shotgun pellets (0.5x) -all incendiary bullets (0.75x) -knives (0.8x) -welders (0.5 inactive, 1.5 active) -7.62mm bullets (1.2x standard, 1.5x AP) -pickaxes (1.2x) -chainsaw (1.5x) -crowbars (2x) -plasma cutter beams (2x) -shotgun slugs (2x standard, 3x uranium) -.50 rounds (2.2x standard, 1x penetrator, replaces unique check) -emitter beams (3x) -sledgehammer (3x, replaces unique check) -vxtvul hammer (3x) -fire axe (3x standard, 4x energy, replaces unique checks) -rockets (4x) -cannonballs (4x) -breaching slugs (50x, 8x vs mech/silicon, replaces unique check) * Update shotgun.dm * Update silicon_defense.dm * Update tools.dm * Update sniper.dm * Update items.dm * stuff * bug spotted, neurons activate * YARRRRR * Update beam_rifle.dm
1 parent 84d19e5 commit 4b3881b
Copy full SHA for 4b3881b

26 files changed

+83-70Lines changed: 83 additions & 70 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎code/_onclick/item_attack.dm‎

Copy file name to clipboardExpand all lines: code/_onclick/item_attack.dm
+14-6Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,20 @@
119119
/atom/movable/proc/attacked_by()
120120
return
121121

122-
/obj/attacked_by(obj/item/I, mob/living/user)
123-
if(I.force)
124-
visible_message(span_danger("[user] has hit [src] with [I]!"), null, null, COMBAT_MESSAGE_RANGE)
125-
//only witnesses close by and the victim see a hit message.
126-
log_combat(user, src, "attacked", I)
127-
take_damage(I.force, I.damtype, MELEE, 1)
122+
/obj/attacked_by(obj/item/attacking_item, mob/living/user)
123+
if(!attacking_item.force)
124+
return
125+
126+
var/damage = take_damage(attacking_item.force * attacking_item.demolition_mod, attacking_item.damtype, MELEE, 1, armour_penetration = attacking_item.armour_penetration)
127+
var/damage_verb = "hit"
128+
if(attacking_item.demolition_mod > 1 && damage)
129+
damage_verb = "pulverized"
130+
if(attacking_item.demolition_mod < 1 || !damage)
131+
damage_verb = "ineffectively pierced"
132+
133+
visible_message(span_danger("[user] [damage_verb] [src] with [attacking_item][damage ? "" : ", without leaving a mark"]!"), null, null, COMBAT_MESSAGE_RANGE)
134+
//only witnesses close by and the victim see a hit message.
135+
log_combat(user, src, "attacked", attacking_item)
128136

129137
/mob/living/attacked_by(obj/item/I, mob/living/user)
130138
send_item_attack_message(I, user)
Collapse file

‎code/game/objects/items.dm‎

Copy file name to clipboardExpand all lines: code/game/objects/items.dm
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,11 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
296296
if(HAS_TRAIT(src, TRAIT_NO_STORAGE))
297297
. += "[gender == PLURAL ? "They are" : "It is"] too bulky, fragile, or cumbersome to fit in a container."
298298

299+
if(demolition_mod > 1)
300+
. += "[src] seems exceptionally good at breaking things!"
301+
else if(demolition_mod < 1)
302+
. += "[src] seems exceptionally bad at breaking things."
303+
299304
if(resistance_flags & INDESTRUCTIBLE)
300305
. += "[src] seems extremely robust! It'll probably withstand anything that could happen to it!"
301306
else
Collapse file

‎code/game/objects/items/kitchen.dm‎

Copy file name to clipboardExpand all lines: code/game/objects/items/kitchen.dm
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
hitsound = 'sound/weapons/bladeslice.ogg'
9393
throw_speed = 3
9494
throw_range = 6
95+
demolition_mod = 0.8
9596
materials = list(/datum/material/iron=12000)
9697
attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
9798
sharpness = SHARP_EDGED
Collapse file

‎code/game/objects/items/tools/crowbar.dm‎

Copy file name to clipboardExpand all lines: code/game/objects/items/tools/crowbar.dm
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
slot_flags = ITEM_SLOT_BELT
1111
force = 5
1212
throwforce = 7
13+
demolition_mod = 2 // the right tool in the wrong place can make all the difference
1314
w_class = WEIGHT_CLASS_SMALL
1415
materials = list(/datum/material/iron=50)
1516
drop_sound = 'sound/items/handling/crowbar_drop.ogg'
Collapse file

‎code/game/objects/items/tools/screwdriver.dm‎

Copy file name to clipboardExpand all lines: code/game/objects/items/tools/screwdriver.dm
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
flags_1 = CONDUCT_1
1010
slot_flags = ITEM_SLOT_BELT
1111
force = 5
12+
demolition_mod = 0.5
1213
w_class = WEIGHT_CLASS_TINY
1314
throwforce = 5
1415
throw_speed = 3
Collapse file

‎code/game/objects/items/tools/weldingtool.dm‎

Copy file name to clipboardExpand all lines: code/game/objects/items/tools/weldingtool.dm
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
light_on = FALSE
2424
throw_speed = 3
2525
throw_range = 5
26+
demolition_mod = 0.5 // not very good at smashing
2627
w_class = WEIGHT_CLASS_SMALL
2728
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 100, ACID = 30)
2829
resistance_flags = FIRE_PROOF
@@ -225,6 +226,7 @@
225226
playsound(loc, acti_sound, 50, 1)
226227
force = 12
227228
damtype = BURN
229+
demolition_mod = 1.5 // pretty good at cutting
228230
hitsound = 'sound/items/welder.ogg'
229231
update_appearance(UPDATE_ICON)
230232
START_PROCESSING(SSobj, src)
@@ -243,6 +245,7 @@
243245
force = 3
244246
damtype = "brute"
245247
hitsound = "swing_hit"
248+
demolition_mod = initial(demolition_mod)
246249
update_appearance(UPDATE_ICON)
247250

248251

Collapse file

‎code/game/objects/items/tools/wrench.dm‎

Copy file name to clipboardExpand all lines: code/game/objects/items/tools/wrench.dm
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
slot_flags = ITEM_SLOT_BELT
1010
force = 5
1111
throwforce = 7
12+
demolition_mod = 1.5
1213
w_class = WEIGHT_CLASS_SMALL
1314
usesound = 'sound/items/ratchet.ogg'
1415
materials = list(/datum/material/iron=150)
Collapse file

‎code/game/objects/items/two_handed/chainsaw.dm‎

Copy file name to clipboardExpand all lines: code/game/objects/items/two_handed/chainsaw.dm
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
throwforce = 13
1515
throw_speed = 2
1616
throw_range = 4
17+
demolition_mod = 1.5
1718
materials = list(/datum/material/iron=13000)
1819
attack_verb = list("sawed", "torn", "cut", "chopped", "diced")
1920
hitsound = "swing_hit"
Collapse file

‎code/game/objects/items/two_handed/fireaxe.dm‎

Copy file name to clipboardExpand all lines: code/game/objects/items/two_handed/fireaxe.dm
+4-15Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
desc = "Truly, the weapon of a madman. Who would think to fight fire with an axe?"
99
force = 5
1010
throwforce = 15
11+
demolition_mod = 3 // specifically designed for breaking things
1112
w_class = WEIGHT_CLASS_BULKY
1213
slot_flags = ITEM_SLOT_BACK
1314
attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut", "axed")
@@ -42,19 +43,15 @@
4243
. = ..()
4344
if(!proximity)
4445
return
46+
if(QDELETED(A))
47+
return
4548
if(HAS_TRAIT(src, TRAIT_WIELDED)) //destroys shit faster, generally in 1-2 hits.
4649
if(istype(A, /obj/structure/window))
4750
var/obj/structure/window/W = A
4851
W.take_damage(W.max_integrity*2, BRUTE, MELEE, FALSE, null, armour_penetration)
4952
else if(istype(A, /obj/structure/grille))
5053
var/obj/structure/grille/G = A
5154
G.take_damage(G.max_integrity*2, BRUTE, MELEE, FALSE, null, armour_penetration)
52-
else if(istype(A, /obj/machinery/door)) //Nines hits for reinforced airlock, seven for normal
53-
var/obj/machinery/door/D = A
54-
D.take_damage((force+25), BRUTE, MELEE, FALSE, null, armour_penetration)
55-
else if(istype(A, /obj/structure/door_assembly)) //Two hits for frames left behind
56-
var/obj/machinery/door/D = A
57-
D.take_damage((force+25), BRUTE, MELEE, FALSE, null, armour_penetration)
5855

5956
/*
6057
* Metal Hydrogen Axe
@@ -85,6 +82,7 @@
8582
icon = 'icons/obj/weapons/energy.dmi'
8683
icon_state = "energy-fireaxe0"
8784
base_icon_state = "energy-fireaxe"
85+
demolition_mod = 4 // DESTROY
8886
armour_penetration = 50 // Probably doesn't care much for armor given how it can destroy solid metal structures
8987
block_chance = 50 // Big handle and large flat energy blade, good for blocking things
9088
heat = 1800 // It's a FIRE axe
@@ -130,15 +128,6 @@
130128
..()
131129
M.ignite_mob() // Ignites you if you're flammable
132130

133-
/obj/item/fireaxe/energy/afterattack(atom/A, mob/user, proximity)
134-
. = ..()
135-
if(!proximity)
136-
return
137-
if(HAS_TRAIT(src, TRAIT_WIELDED)) // Does x2 damage against inanimate objects like machines, structures, mechs, etc
138-
if(isobj(A) && !isitem(A))
139-
var/obj/O = A
140-
O.take_damage(force, BRUTE, MELEE, FALSE, null, armour_penetration)
141-
142131
/obj/item/fireaxe/energy/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text, final_block_chance, damage, attack_type)
143132
if(!HAS_TRAIT(src, TRAIT_WIELDED))
144133
return 0 // large energy blade can only block stuff if it's actually on
Collapse file

‎code/game/objects/obj_defense.dm‎

Copy file name to clipboardExpand all lines: code/game/objects/obj_defense.dm
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
playsound(src, P.hitsound, 50, 1)
8181
visible_message(span_danger("[src] is hit by \a [P]!"), null, null, COMBAT_MESSAGE_RANGE)
8282
if(!QDELETED(src)) //Bullet on_hit effect might have already destroyed this object
83-
take_damage(P.damage, P.damage_type, P.armor_flag, 0, turn(P.dir, 180), P.armour_penetration)
83+
take_damage(P.damage * P.demolition_mod, P.damage_type, P.armor_flag, 0, turn(P.dir, 180), P.armour_penetration)
8484

8585
///Called to get the damage that hulks will deal to the obj.
8686
/obj/proc/hulk_damage()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.