Skip to content

Commit

Permalink
Merge pull request Occulus-Server#997 from WeNeedMorePhoron/war-crimes
Browse files Browse the repository at this point in the history
Upstream Grenades: HESH Rocket, Buffed Fragmentation, Pipebomb, WP & Fix
  • Loading branch information
Jamini authored May 24, 2023
2 parents dbd85b1 + 0edf856 commit 04866dd
Show file tree
Hide file tree
Showing 27 changed files with 300 additions and 124 deletions.
1 change: 1 addition & 0 deletions cev_eris.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2892,6 +2892,7 @@
#include "zzzz_modular_occulus\code\datums\setup_option\core_implants.dm"
#include "zzzz_modular_occulus\code\datums\setup_option\backgrounds\origin.dm"
#include "zzzz_modular_occulus\code\datums\uplink\devices and tools.dm"
#include "zzzz_modular_occulus\code\datums\uplink\grenades.dm"
#include "zzzz_modular_occulus\code\datums\uplink\highly visible and dangerous weapons.dm"
#include "zzzz_modular_occulus\code\datums\uplink\implants.dm"
#include "zzzz_modular_occulus\code\datums\uplink\medical.dm"
Expand Down
16 changes: 16 additions & 0 deletions code/datums/craft/recipes/weapon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -298,3 +298,19 @@
list(/obj/item/device/assembly/igniter, 2),
list(/obj/item/stack/cable_coil, 5, "time" = 20)
)

/datum/craft_recipe/weapon/pipebomb
name = "improvised pipebomb"
result = /obj/item/grenade/frag/pipebomb
steps = list(
list(/obj/item/cell/medium, 1),
list(QUALITY_SAWING, 10),
list(CRAFT_MATERIAL, 2, MATERIAL_PLASTEEL),
list(QUALITY_WELDING, 10, "time" = 30),
list(CRAFT_MATERIAL, 1, MATERIAL_PHORON), //similary to the makeshift landmine, as explosive, frags come from the shell itself
list(QUALITY_WELDING, 10, "time" = 30),
list(/obj/item/device/assembly/igniter, 1),
list(QUALITY_SCREW_DRIVING, 10, "time" = 30),
list(/obj/item/stack/cable_coil, 5),
list(QUALITY_WIRE_CUTTING, 10, "time" = 20),
)
2 changes: 1 addition & 1 deletion code/datums/uplink/grenades.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
/datum/uplink_item/item/grenades/baton_rounds
name = "6xRubber rounds"
item_cost = 6
path = /obj/item/storage/box/baton_rounds
path = /obj/item/storage/box/sting_rounds

/datum/uplink_item/item/grenades/blast_rounds
name = "6xBlast rounds"
Expand Down
15 changes: 15 additions & 0 deletions code/game/objects/effects/effect_system.dm
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,19 @@ steam.start() -- spawns the effect
M.emote("cough")
spawn ( 20 )
M.coughedtime = 0

/////////////////////////////////////////////
// White phosphorus
/////////////////////////////////////////////

/obj/effect/effect/smoke/white_phosphorous
name = "white phosphorus smoke" // Occulus Edit: Correct typo for the name (not typepath)

/obj/effect/effect/smoke/white_phosphorous/affect(mob/living/carbon/M)
M.fire_stacks += 5
M.fire_act()


/////////////////////////////////////////////
// Mustard Gas
/////////////////////////////////////////////
Expand Down Expand Up @@ -406,6 +419,8 @@ steam.start() -- spawns the effect
/datum/effect/effect/system/smoke_spread/mustard
smoke_type = /obj/effect/effect/smoke/mustard

/datum/effect/effect/system/smoke_spread/white_phosphorous
smoke_type = /obj/effect/effect/smoke/white_phosphorous



Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/explosion.dm
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ proc/secondaryexplosion(turf/epicenter, range)
for(var/turf/tile in range(range, epicenter))
tile.ex_act(2)

proc/fragment_explosion(var/turf/epicenter, var/range, var/f_type, var/f_amount = 100, var/f_damage = null, var/f_step = 2, var/same_turf_hit_chance = 95)
proc/fragment_explosion(var/turf/epicenter, var/range, var/f_type, var/f_amount = 100, var/f_damage = null, var/f_step = 2, var/same_turf_hit_chance = 20)
if(!isturf(epicenter))
epicenter = get_turf(epicenter)

Expand Down
91 changes: 79 additions & 12 deletions code/game/objects/items/weapons/grenades/frag.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
icon_state = "frag"
item_state = "frggrenade"

var/fragment_type = /obj/item/projectile/bullet/pellet/fragment/strong
var/num_fragments = 150 //total number of fragments produced by the grenade
var/fragment_damage = 5
var/damage_step = 2 //projectiles lose a fragment each time they travel this distance. Can be a non-integer.
var/fragment_type = /obj/item/projectile/bullet/pellet/fragment
var/num_fragments = 50 //total number of fragments produced by the grenade
var/fragment_damage = 15
var/damage_step = 8 //projectiles lose a fragment each time they travel this distance. Can be a non-integer.
var/blast_radius = 2

//The radius of the circle used to launch projectiles. Lower values mean less projectiles are used but if set too low gaps may appear in the spread pattern
var/spread_range = 7
Expand All @@ -20,26 +21,92 @@
if(!O) return

if(num_fragments)
var/lying = FALSE
var/ontop = FALSE
if(isturf(src.loc))
for(var/mob/living/M in O)
//lying on a frag grenade while the grenade is on the ground causes you to absorb most of the shrapnel.
//you will most likely be dead, but others nearby will be spared the fragments that hit you instead.
if(M.lying)
lying = TRUE
ontop = TRUE
break

if(!lying)
if(!ontop)
fragment_explosion(O, spread_range, fragment_type, num_fragments, fragment_damage, damage_step)
else
fragment_explosion(O, 0, fragment_type, num_fragments, fragment_damage, damage_step)
if(blast_radius)
explosion(O, 0, 0, blast_radius, adminlog = "Frag nade explosion", z_transfer = FALSE)


qdel(src)

// Occulus Edit: Upstream don't have a NeoTheology (Mekhane) Defensive Frag nade anymore, instead they have blast nades. Keeping as is for now.
/obj/item/grenade/frag/nt
name = "NT DFG \"Holy Thunder\""
desc = "A military-grade defensive fragmentation grenade, designed to be thrown from cover."
icon_state = "frag_nt"
item_state = "frggrenade_nt"
matter = list(MATERIAL_BIOMATTER = 75)
fragment_damage = 7
damage_step = 3
fragment_damage = 15 // Occulus Edit: Keeping stat in line with normal Pomme
damage_step = 8 // Occulus Edit: Keeping stat in line with Pomme

/obj/item/grenade/frag/sting
name = "FS SG \"Hornet\""
desc = "A high-grade Frozen Star sting grenade, for use against unruly crowds."
icon_state = "sting_ih"
item_state = "fraggrenade"
fragment_type = /obj/item/projectile/bullet/pellet/fragment/rubber
num_fragments = 25
fragment_damage = 5
blast_radius = 0
damage_step = 12
spread_range = 7

/obj/item/grenade/frag/sting/AG
name = "AG SG \"Mosquito\""
desc = "A standard-issue Asters Guild sting grenade, for use against unruly crowds."
icon_state = "sting_ag"
item_state = "fraggrenade"
fragment_type = /obj/item/projectile/bullet/pellet/fragment/rubber/weak
num_fragments = 25
fragment_damage = 10
blast_radius = 0
damage_step = 8
spread_range = 7

/obj/item/grenade/frag/pipebomb
name = "improvised pipebomb"
desc = "A jury rigged medium cell filled with plasma. Throw at authorities."
icon_state = "frag_pipebomb"
item_state = "fraggrenade_pipebomb"
matter = list(MATERIAL_STEEL = 2, MATERIAL_PLASTEEL = 2, MATERIAL_PHORON = 2, MATERIAL_PLASTIC = 3, MATERIAL_SILVER = 2)
num_fragments = 25
fragment_damage = 10
blast_radius = 2
damage_step = 7

/obj/item/grenade/frag/white_phosphorous
name = "SA WPG \"Sabac \""
desc = "A modernized incendiary hailing popular use within assault troops of all kinds. Use with care, highly flammable."
icon_state = "white_phos"
item_state = "fraggrenade"
fragment_type = /obj/item/projectile/bullet/pellet/fragment/ember
num_fragments = 10
fragment_damage = 5
damage_step = 5
spread_range = 7
var/datum/effect/effect/system/smoke_spread/white_phosphorous/smoke

/obj/item/grenade/frag/white_phosphorous/prime()
playsound(loc, 'sound/effects/smoke.ogg', 50, 1, -3)
smoke.set_up(5, 0, usr.loc)
smoke.set_up(5, 0, get_turf(loc))
smoke.start()
..()

/obj/item/grenade/frag/white_phosphorous/New()
..()
smoke = new
smoke.attach(src)

/obj/item/grenade/frag/white_phosphorous/Destroy()
qdel(smoke)
smoke = null
return ..()
13 changes: 13 additions & 0 deletions code/game/objects/items/weapons/grenades/grenade.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,16 @@
walk(src, null, null)
..()
return

// Occulus Edit: Doesn't work lol
// /obj/item/grenade/fall_impact(turf/from, turf/dest)
// ..()
// var/found = dest.contents.Find(/mob/living/carbon/human)
// if(found)
// var/mob/living/carbon/human/bonk = dest.contents[found]
// if(bonk.incapacitated(INCAPACITATION_GROUNDED))
// return
// bonk.apply_damage(2, BRUTE, BP_HEAD, sharp = FALSE, edge = FALSE, used_weapon = src)
// bonk.visible_message(SPAN_DANGER("[src] falls from above and bonks [bonk.name] on \his head!"), SPAN_DANGER("[src] falls on your head and bounces to the side!"), "You hear a dull thud.", 5)
// var/turf/random = pick(orange(1, dest))
// forceMove(random)
25 changes: 19 additions & 6 deletions code/game/objects/items/weapons/storage/boxes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,19 @@
for(var/i in 1 to initial_amount)
new spawn_type(src)

/obj/item/storage/box/phosphorous
name = "box of white phosphorus grenades" // Occulus Edit: Correct phosphorus typo
desc = "A box containing 7 antipersonnel incendiary grenades.<br> WARNING: These devices are extremely dangerous and can cause severe burns and fires."
icon_state = "box_security"
illustration = "flashbang"
rarity_value = 60
initial_amount = 7
spawn_type = /obj/item/grenade/frag/white_phosphorous

/obj/item/storage/box/phosphorus/populate_contents()
for(var/i in 1 to initial_amount)
new spawn_type(src)

/obj/item/storage/box/teargas
name = "box of pepperspray grenades"
desc = "A box containing 6 tear gas grenades. A gas mask is printed on the label.<br> WARNING: Exposure carries risk of serious injury or death. Keep away from persons with lung conditions."
Expand Down Expand Up @@ -359,16 +372,16 @@
for(var/i in 1 to initial_amount)
new spawn_type(src)

/obj/item/storage/box/baton_rounds
name = "box of baton rounds"
desc = "A box containing 6 rubber rounds, designed to be fired from grenade launchers."
/obj/item/storage/box/sting_rounds
name = "box of sting rounds"
desc = "A box containing 6 sting rounds, designed to be fired from grenade launchers."
icon_state = "box_security"
illustration = "flashbang"
rarity_value = 60
initial_amount = 6
spawn_type = /obj/item/ammo_casing/grenade

/obj/item/storage/box/baton_rounds/populate_contents()
/obj/item/storage/box/sting_rounds/populate_contents()
for(var/i in 1 to initial_amount)
new spawn_type(src)

Expand Down Expand Up @@ -411,7 +424,7 @@
for(var/i in 1 to initial_amount)
new spawn_type(src)

/obj/item/storage/box/sting_rounds // occ
/obj/item/storage/box/sting_rounds
name = "box of sting grenade shells"
desc = "A box containing 6 sting grenade shells, designed to be fired from grenade launchers."
icon_state = "box_security"
Expand All @@ -422,7 +435,7 @@

/obj/item/storage/box/sting_rounds/populate_contents()
for(var/i in 1 to initial_amount)
new spawn_type(src) // end occ
new spawn_type(src)

/obj/item/storage/box/trackimp
name = "boxed tracking implant kit"
Expand Down
5 changes: 3 additions & 2 deletions code/game/objects/items/weapons/storage/deferred.dm
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@
/obj/item/storage/deferred/crate/antiarmor //change to demolitions, won't do now because will affect map
name = "demolitions crate"
icon_state = "serbcrate_deferred_black"
desc = "A crate containing one \"RPG-7\" launcher, and twelve 40mm PG-7VL warheads."
initial_contents = list(/obj/item/ammo_casing/rocket = 12,
desc = "A crate containing one \"RPG-7\" launcher, and twelve 40mm PG-7V warheads."
initial_contents = list(/obj/item/ammo_casing/rocket = 8,
/obj/item/ammo_casing/rocket/hesh = 4,
/obj/item/storage/pouch/tubular = 1,
/obj/item/gun/projectile/rpg = 1,
/obj/item/storage/pouch/tubular = 1)
Expand Down
6 changes: 4 additions & 2 deletions code/game/turfs/simulated/walls.dm
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@


/turf/simulated/wall/bullet_act(var/obj/item/projectile/Proj)
if(QDELETED(Proj))
return

if(src.ricochet_id != 0)
if(src.ricochet_id == Proj.ricochet_id)
Expand Down Expand Up @@ -230,9 +232,9 @@
var/damagediff = round(proj_damage / 2 + proj_damage * ricochetchance / 200) // projectile loses up to 50% of its damage when it ricochets, depending on situation
Proj.damage_types[BRUTE] = round(Proj.damage_types[BRUTE] / 2 + Proj.damage_types[BRUTE] * ricochetchance / 200)
Proj.damage_types[BURN] = round(Proj.damage_types[BURN] / 2 + Proj.damage_types[BURN] * ricochetchance / 200)
projectile_reflection(Proj) // Reflect before damage, runtimes occur in some cases if damage happens first.
visible_message("<span class='danger'>\The [Proj] ricochets off the surface of wall!</span>")
take_damage(min(proj_damage - damagediff, 100))
visible_message("<span class='danger'>The [Proj] ricochets from the surface of wall!</span>")
projectile_reflection(Proj)
new /obj/effect/sparks(get_turf(Proj))
return PROJECTILE_CONTINUE // complete projectile permutation

Expand Down
9 changes: 8 additions & 1 deletion code/modules/mob/living/living_defense.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#define ARMOR_HALLOS_COEFFICIENT 0.4
#define ARMOR_GDR_COEFFICIENT 0.1
#define MAX_ADDITIONAL_BURN_DAMAGE 2 // Occulus Edit: Maximum additional burn damage when on fire

//This calculation replaces old run_armor_check in favor of more complex and better system
//If you need to do something else with armor - just use getarmor() proc and do with those numbers all you want
Expand Down Expand Up @@ -326,9 +327,15 @@

if(!on_fire)
return 1
else if(fire_stacks <= 0)
// Occulus Edit: Fire are slowly consumed by -0.1, add burn damage scaling to fire stacks (Up to +2 per tick)
if(fire_stacks > 0)
adjust_fire_stacks(-0.1) // the fire is slowly consumed
var/scaled_burn_damage = MAX_ADDITIONAL_BURN_DAMAGE * (fire_stacks / FIRE_MAX_STACKS)
src.take_overall_damage(0, scaled_burn_damage, used_weapon = "thermal burns")
else
ExtinguishMob() //Fire's been put out.
return 1
// Occulus Edit END

var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment
if(G.gas["oxygen"] < 1)
Expand Down
7 changes: 6 additions & 1 deletion code/modules/multiz/turf.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define FALL_DAMAGE_KNOCKDOWN_THRESHOLD 5 // Occulus Edit: Normal size or above object can knock someone down
/*
see multiz/movement.dm for some info.
*/
Expand Down Expand Up @@ -167,8 +168,11 @@ see multiz/movement.dm for some info.
var/fall_damage = mover.get_fall_damage()
if(M == mover)
continue
if(M.getarmor(BP_HEAD, ARMOR_MELEE) < fall_damage || ismob(mover))
// Occulus Edit: 5 damage threshold and visible damage for knockdown
if(M.getarmor(BP_HEAD, ARMOR_MELEE) < (fall_damage - FALL_DAMAGE_KNOCKDOWN_THRESHOLD) || ismob(mover))
to_chat(M, SPAN_WARNING("\The [mover] slams into you from above and knocks you down!"))
M.Weaken(10)
// Occulus Edit End
if(fall_damage >= FALL_GIB_DAMAGE)
M.gib()
else
Expand Down Expand Up @@ -246,3 +250,4 @@ see multiz/movement.dm for some info.
else
return null

#undef FALL_DAMAGE_KNOCKDOWN_THRESHOLD
Loading

0 comments on commit 04866dd

Please sign in to comment.