Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes carlarc's OP chocolate #6003

Merged
merged 19 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code/game/machinery/bots/bots.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@
if(hasvar(W,"force") && hasvar(W,"damtype"))
switch(W.damtype)
if("fire")
src.health -= W.force * fire_dam_coeff
health -= W.force * W.demolition_mod * fire_dam_coeff
if("brute")
src.health -= W.force * brute_dam_coeff
health -= W.force * W.demolition_mod * brute_dam_coeff
vero5123 marked this conversation as resolved.
Show resolved Hide resolved
..()
healthcheck()
else
Expand Down
8 changes: 4 additions & 4 deletions code/game/machinery/deployable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@
else
switch(W.damtype)
if("fire")
src.health -= W.force * 0.75
health -= W.force * W.demolition_mod * 0.75
if("brute")
src.health -= W.force * 0.5
if (src.health <= 0)
src.explode()
health -= W.force * W.demolition_mod * 0.5
if (health <= 0)
explode()
..()

/obj/structure/machinery/deployable/barrier/ex_act(severity)
Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
var/attack_speed = 11 //+3, Adds up to 10. Added an extra 4 removed from /mob/proc/do_click()
///Used in attackby() to say how something was attacked "[x] has been [z.attack_verb] by [y] with [z]"
var/list/attack_verb
/// A multiplier to an object's force when used against a stucture.
var/demolition_mod = 1

health = null

Expand Down
16 changes: 12 additions & 4 deletions code/game/objects/items/reagent_containers/food/snacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@
return FALSE

if(package)
to_chat(M, SPAN_WARNING("How do you expect to eat this with the package still on?"))
if(user.a_intent == INTENT_HARM)
return ..() // chunk box gaming

if(user == M)
to_chat(M, SPAN_WARNING("How do you expect to eat this with the package still on?"))
else
to_chat(M, SPAN_WARNING("[user] made an endearing attempt to force feed you a snack with the packaging still on."))
return FALSE

if(istype(M, /mob/living/carbon))
Expand Down Expand Up @@ -3289,8 +3295,11 @@
name = "CHUNK box"
desc = "A bar of \"The <b>CHUNK</b>\" brand chocolate. <i>\"The densest chocolate permitted to exist according to federal law. We are legally required to ask you not to use this blunt object for anything other than nutrition.\"</i>"
icon_state = "chunk"
force = 15 //LEGAL LIMIT OF CHOCOLATE
hitsound = "swing_hit"
force = 15
throwforce = 10
attack_speed = 10
demolition_mod = 0.3
bitesize = 2
wrapper = /obj/item/trash/chunk

Expand All @@ -3304,8 +3313,7 @@
desc = "A 'crate', as the marketing called it, of \"The <b>HUNK</b>\" brand chocolate. An early version of the CHUNK box, the HUNK bar was hit by a class action lawsuit and forced to go into bankruptcy and get bought out by the Company when hundreds of customers had their teeth crack from simply attempting to eat the bar."
icon_state = "hunk"
w_class = SIZE_MEDIUM
hitsound = "swing_hit"
force = 35 //ILLEGAL LIMIT OF CHOCOLATE
force = 35
vero5123 marked this conversation as resolved.
Show resolved Hide resolved
throwforce = 50
bitesize = 20
wrapper = /obj/item/trash/chunk/hunk
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/items/tools/surgery_tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
force = 10
sharp = IS_SHARP_ITEM_ACCURATE
edge = 1
demolition_mod = 0.1
w_class = SIZE_TINY
throwforce = 5
flags_item = CAN_DIG_SHRAPNEL
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/barricade/barricade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@
take_damage(dam * burn_flame_multiplier)

/obj/structure/barricade/proc/hit_barricade(obj/item/item)
take_damage(item.force * 0.5 * brute_multiplier)
take_damage(item.force * item.demolition_mod * 0.5 * brute_multiplier)

/obj/structure/barricade/proc/take_damage(damage)
for(var/obj/structure/barricade/barricade in get_step(src,dir)) //discourage double-stacking barricades by removing health from opposing barricade
Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/structures/barricade/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
/obj/structure/barricade/snow/hit_barricade(obj/item/I)
switch(I.damtype)
if("fire")
take_damage( I.force * 0.6 )
take_damage( I.force * I.demolition_mod * 0.6 )
if("brute")
take_damage( I.force * 0.3 )
take_damage( I.force * I.demolition_mod * 0.3 )

return

Expand Down Expand Up @@ -106,6 +106,6 @@
/obj/structure/barricade/wooden/hit_barricade(obj/item/I)
switch(I.damtype)
if("fire")
take_damage( I.force * 1.5 )
take_damage( I.force * I.demolition_mod * 1.5 )
if("brute")
take_damage( I.force * 0.75 )
take_damage( I.force * I.demolition_mod * 0.75 )
2 changes: 1 addition & 1 deletion code/game/objects/structures/displaycase.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@


/obj/structure/displaycase/attackby(obj/item/W as obj, mob/user as mob)
src.health -= W.force
src.health -= W.force * W.demolition_mod
src.healthcheck()
..()
return
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/structures/fence.dm
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@
else
switch(W.damtype)
if("fire")
health -= W.force
health -= W.force * W.demolition_mod
if("brute")
health -= W.force * 0.1
health -= W.force * W.demolition_mod * 0.1
healthcheck(1, 1, user, W)
..()

Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/structures/lamarr_cage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@


/obj/structure/lamarr/attackby(obj/item/W as obj, mob/user as mob)
src.health -= W.force
src.healthcheck()
health -= W.force * W.demolition_mod
healthcheck()
..()
return

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/mineral_doors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
Dismantle()
else if(!(W.flags_item & NOBLUDGEON) && W.force)
user.animation_attack_on(src)
hardness -= W.force/100
hardness -= W.force/100 * W.demolition_mod
to_chat(user, "You hit the [name] with your [W.name]!")
CheckHardness()
else
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/structures/mirror.dm
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@
playsound(loc, 'sound/effects/Glasshit.ogg', 25, 1)
return
if(shattered)
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 25, 1)
playsound(loc, 'sound/effects/hit_on_shattered_glass.ogg', 25, 1)
user.visible_message(SPAN_WARNING("[user] hits [src] with [I], but it's already broken!"), SPAN_WARNING("You hit [src] with [I], but it's already broken!"))
return
if(prob(I.force * 2))
if(prob(I.force * I.demolition_mod * 2))
user.visible_message(SPAN_WARNING("[user] smashes [src] with [I]!"), SPAN_WARNING("You smash [src] with [I]!"))
shatter()
else
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/structures/window.dm
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
to_chat(user, (state ? SPAN_NOTICE("You have pried the window into the frame.") : SPAN_NOTICE("You have pried the window out of the frame.")))
else
if(!not_damageable) //Impossible to destroy
health -= W.force
health -= W.force * W.demolition_mod
if(health <= 7 && !reinf && !static_frame && !not_deconstructable)
anchored = FALSE
update_nearby_icons()
Expand Down
4 changes: 2 additions & 2 deletions code/game/turfs/walls/wall_types.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ INITIALIZE_IMMEDIATE(/turf/closed/wall/indestructible/splashscreen)
/obj/structure/alien/movable_wall/attackby(obj/item/W, mob/living/user)
if(!(W.flags_item & NOBLUDGEON))
user.animation_attack_on(src)
take_damage(W.force*RESIN_MELEE_DAMAGE_MULTIPLIER, user)
take_damage(W.force*RESIN_MELEE_DAMAGE_MULTIPLIER*W.demolition_mod, user)
playsound(src, "alien_resin_break", 25)
else
return attack_hand(user)
Expand Down Expand Up @@ -1280,7 +1280,7 @@ INITIALIZE_IMMEDIATE(/turf/closed/wall/indestructible/splashscreen)

if(!(W.flags_item & NOBLUDGEON))
user.animation_attack_on(src)
take_damage(W.force*RESIN_MELEE_DAMAGE_MULTIPLIER, user)
take_damage(W.force*RESIN_MELEE_DAMAGE_MULTIPLIER*W.demolition_mod, user)
playsound(src, "alien_resin_break", 25)
else
return attack_hand(user)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/cm_aliens/XenoStructures.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@

/obj/effect/alien/resin/attackby(obj/item/W, mob/user)
if(!(W.flags_item & NOBLUDGEON))
var/damage = W.force * RESIN_MELEE_DAMAGE_MULTIPLIER
var/damage = W.force * W.demolition_mod * RESIN_MELEE_DAMAGE_MULTIPLIER
health -= damage
if(istype(src, /obj/effect/alien/resin/sticky))
playsound(loc, "alien_resin_move", 25)
Expand Down Expand Up @@ -391,7 +391,7 @@
return // defer to item afterattack
if(!(W.flags_item & NOBLUDGEON) && W.force)
user.animation_attack_on(src)
health -= W.force*RESIN_MELEE_DAMAGE_MULTIPLIER
health -= W.force * RESIN_MELEE_DAMAGE_MULTIPLIER * W.demolition_mod
to_chat(user, "You hit the [name] with your [W.name]!")
playsound(loc, "alien_resin_move", 25)
healthcheck()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/cm_aliens/weeds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@
else
to_chat(user, SPAN_WARNING("You cut \the [src] away with \the [attacking_item]."))

var/damage = attacking_item.force / 3
var/damage = (attacking_item.force * attacking_item.demolition_mod) / 3
playsound(loc, "alien_resin_break", 25)

if(iswelder(attacking_item))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/power/lighting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@
else if(status != LIGHT_BROKEN && status != LIGHT_EMPTY)


if(prob(1+W.force * 5))
if(prob(1+W.force * W.demolition_mod * 5))

to_chat(user, "You hit the light, and it smashes!")
for(var/mob/M as anything in viewers(src))
Expand Down
6 changes: 3 additions & 3 deletions code/modules/vehicles/vehicle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@
else if(W.force)
switch(W.damtype)
if("fire")
health -= W.force * fire_dam_coeff
health -= W.force * W.demolition_mod * fire_dam_coeff
if("brute")
health -= W.force * brute_dam_coeff
playsound(src.loc, "smash.ogg", 25, 1)
health -= W.force * W.demolition_mod * brute_dam_coeff
playsound(loc, "smash.ogg", 25, 1)
user.visible_message(SPAN_DANGER("[user] hits [src] with [W]."),SPAN_DANGER("You hit [src] with [W]."))
healthcheck()
else
Expand Down
Loading