Skip to content

Commit

Permalink
Merge pull request #5890 from Trilbyspaceclone/funny
Browse files Browse the repository at this point in the history
removes a doup, CRO stuff and cleaning, Centcom RnD
  • Loading branch information
Trilbyspaceclone authored Dec 8, 2024
2 parents c66b2f6 + 5ddfaee commit 4db595d
Show file tree
Hide file tree
Showing 11 changed files with 212 additions and 144 deletions.
80 changes: 80 additions & 0 deletions code/game/objects/items/weapons/grenades/hydrogen.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// Hydrogen Grenade, explode when hitting something, even if thrown.
/obj/item/hydrogen_grenade
name = "hydrogen grenade"
desc = "A case that can support a hydrogen fuel cell. It has a flimsy safe guard that barely prevents it from exploding from the weakest impact."
icon = 'icons/obj/guns/plasma/hydrogen.dmi'
icon_state = "grenade"
item_state = "grenade"
contained_sprite = TRUE
origin_tech = list(TECH_POWER = 3)
matter = list(MATERIAL_PLASTEEL = 3, MATERIAL_MHYDROGEN = 0.5, MATERIAL_OSMIUM = 0.5, MATERIAL_TRITIUM = 0.5)
force = WEAPON_FORCE_WEAK
throwforce = WEAPON_FORCE_WEAK
throw_speed = 3
throw_range = 7
w_class = ITEM_SIZE_SMALL
var/armed = FALSE
var/obj/item/hydrogen_fuel_cell/fuel_cell = null // The flask the sword consume to stay active
var/burn_min = 50 // How much burn damage the grenade do to nearby mobs.
var/burn_max = 75 // How much burn damage the grenade do to nearby mobs.
var/hydrogen_threshold = 10 // How much hydrogen must be in the cell for it to be viable.

/obj/item/hydrogen_grenade/attack_self(mob/living/user as mob)
if(!fuel_cell)
to_chat(user, "There isn't any hydrogen cell in the grenade, you can't arm it.")
return

if(fuel_cell.plasma < hydrogen_threshold)
to_chat(user, "There isn't enough hydrogen in the cell, arming it would be useless.")
return

armed = !armed
to_chat(user, SPAN_NOTICE("You [armed ? "arm" : "disarm"] the [src.name]."))
playsound(loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
update_icon()
add_fingerprint(user)

/obj/item/hydrogen_grenade/attackby(obj/item/W as obj, mob/living/user as mob)
if(istype(W, /obj/item/hydrogen_fuel_cell))
if(fuel_cell)
to_chat(usr, SPAN_WARNING("[src] is already loaded."))
return

if(insert_item(W, user))
fuel_cell = W
update_icon()
else
..()

/obj/item/hydrogen_grenade/MouseDrop(over_object)
if((src.loc == usr) && istype(over_object, /obj/screen/inventory/hand) && eject_item(fuel_cell, usr))
fuel_cell = null
if(armed)
armed = FALSE
update_icon()

/obj/item/hydrogen_grenade/update_icon()
cut_overlays()
if(fuel_cell)
add_overlay("[icon_state]_loaded")
if(armed)
add_overlay("[icon_state]_armed")

/obj/item/hydrogen_grenade/throw_impact(atom/hit_atom, var/speed)
..()
if(armed)
explode()

/obj/item/hydrogen_grenade/attack(mob/living/M, mob/living/user, target_zone)
if(..() && armed)
explode()

/obj/item/hydrogen_grenade/proc/explode()
var/turf/T = get_turf(src)
explosion(T, 0, 1, 2, 4) // Explode
new /obj/effect/explosion(T)
for(var/mob/M in view(2, T)) // Burn every mob nearby.
to_chat(M, SPAN_DANGER("You feel a wave of heat scorch your body!"))
M.take_overall_damage(0, rand(burn_min, burn_max))
spawn(20)
qdel(src)
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Hydrogen Sword, like an energy sword that use hydrogen fuel cell. It explode if it is EMP'ed while active.
/obj/item/tool/hydrogen_sword
name = "hydrogen-plasma sword"
desc = "An energy sword that uses super heated hydrogen shaped into plasma. The only thing preventing this from blowing up in your face is a magnetic field produced by the hilt."
desc = "An energy sword that uses super heated hydrogen shaped into plasma. \
The only thing preventing this from blowing up in your face is a magnetic field produced by the hilt."
icon = 'icons/obj/guns/plasma/hydrogen.dmi'
icon_state = "sword"
item_state = "hydrogen"
origin_tech = list(TECH_PLASMA = 10, TECH_POWER = 5, TECH_COMBAT = 12, TECH_MATERIAL = 7) // Currently it is a unique, CRO-only item.
origin_tech = list(TECH_PLASMA = 10, TECH_POWER = 5, TECH_COMBAT = 12, TECH_MATERIAL = 7)
matter = list(MATERIAL_PLASTEEL = 5, MATERIAL_MHYDROGEN = 0.8, MATERIAL_OSMIUM = 0.8, MATERIAL_TRITIUM = 0.8)
force = WEAPON_FORCE_WEAK
throwforce = WEAPON_FORCE_WEAK
Expand All @@ -27,13 +28,17 @@
var/obj/item/hydrogen_fuel_cell/fuel_cell = null // The flask the sword consume to stay active
var/use_plasma_cost = 0.1 // Active cost

/obj/item/tool/hydrogen_sword/no_starting_fuel
spawn_full = FALSE //For rnd

/obj/item/tool/hydrogen_sword/New()
..()
START_PROCESSING(SSobj, src)

/obj/item/tool/hydrogen_sword/Initialize(mapload = TRUE)
..()
fuel_cell = new(src)
if(spawn_full)
fuel_cell = new(src)

/obj/item/tool/hydrogen_sword/examine(mob/user)
..()
Expand All @@ -42,31 +47,28 @@
else
to_chat(user, SPAN_NOTICE("[src] doesn't have a fuel cell inserted."))

/obj/item/tool/hydrogen_sword/proc/activate()
if(!fuel_cell || active)
return
/obj/item/tool/hydrogen_sword/proc/activate(playsound = TRUE, force_update = FALSE)
if(!force_update)
if(!fuel_cell || active)
return
active = TRUE
force = active_force
throwforce = active_throwforce
armor_divisor = active_ap
force += active_force
throwforce += active_throwforce
armor_divisor += active_ap
sharp = TRUE
edge = TRUE
w_class = active_w_class
tool_qualities = switched_on_qualities
playsound(src, 'sound/weapons/saberon.ogg', 50, 1)
if(playsound)
playsound(src, 'sound/weapons/saberon.ogg', 50, 1)
update_icon()

/obj/item/tool/hydrogen_sword/proc/deactivate()
if(!active)
return
playsound(src, 'sound/weapons/saberoff.ogg', 50, 1)
active = FALSE
force = initial(force)
throwforce = initial(throwforce)
armor_divisor = initial(armor_divisor)
sharp = initial(sharp)
edge = initial(edge)
w_class = initial(w_class)
refresh_upgrades()
tool_qualities = initial(tool_qualities)
update_icon()

Expand Down Expand Up @@ -96,9 +98,10 @@
deactivate()
update_icon()

/*

/obj/item/tool/hydrogen_sword/emp_act(severity)
if(active) // Blow up.
if(active) // Blow up.
deactivate() //stops a feedback loop
var/turf/T = get_turf(src)
src.visible_message(SPAN_DANGER("[src]'s active magnetic field get disturbed by an EMP, violently exploding and scorching everything nearby!"))
explosion(T, 0, 1, 2, 4) // Explode
Expand All @@ -107,7 +110,7 @@
to_chat(M, SPAN_DANGER("You feel a wave of heat scorch your body!"))
M.take_overall_damage(0, rand(emp_burn_min, emp_burn_max))
qdel(src)
*/


/obj/item/tool/hydrogen_sword/attack(mob/M as mob, mob/living/user as mob)
..()
Expand All @@ -127,83 +130,8 @@
update_wear_icon()


// Hydrogen Grenade, explode when hitting something, even if thrown.
/obj/item/hydrogen_grenade
name = "hydrogen grenade"
desc = "A hilt that can support an hydrogen fuel cell. It has a flimsy safe guard that prevents it from exploding from the weakest impact."
icon = 'icons/obj/guns/plasma/hydrogen.dmi'
icon_state = "grenade"
item_state = "grenade"
contained_sprite = TRUE
origin_tech = list(TECH_POWER = 3)
matter = list(MATERIAL_PLASTEEL = 3, MATERIAL_MHYDROGEN = 0.5, MATERIAL_OSMIUM = 0.5, MATERIAL_TRITIUM = 0.5)
force = WEAPON_FORCE_WEAK
throwforce = WEAPON_FORCE_WEAK
throw_speed = 3
throw_range = 7
w_class = ITEM_SIZE_SMALL
var/armed = FALSE
var/obj/item/hydrogen_fuel_cell/fuel_cell = null // The flask the sword consume to stay active
var/burn_min = 50 // How much burn damage the grenade do to nearby mobs.
var/burn_max = 75 // How much burn damage the grenade do to nearby mobs.
var/hydrogen_threshold = 10 // How much hydrogen must be in the cell for it to be viable.

/obj/item/hydrogen_grenade/attack_self(mob/living/user as mob)
if(!fuel_cell)
to_chat(user, "There isn't any hydrogen cell in the grenade, you can't arm it.")
return

if(fuel_cell.plasma < hydrogen_threshold)
to_chat(user, "There isn't enough hydrogen in the cell, arming it would be useless.")
return

armed = !armed
to_chat(user, SPAN_NOTICE("You [armed ? "arm" : "disarm"] the [src.name]."))
playsound(loc, 'sound/weapons/armbomb.ogg', 75, 1, -3)
update_icon()
add_fingerprint(user)

/obj/item/hydrogen_grenade/attackby(obj/item/W as obj, mob/living/user as mob)
if(istype(W, /obj/item/hydrogen_fuel_cell))
if(fuel_cell)
to_chat(usr, SPAN_WARNING("[src] is already loaded."))
return

if(insert_item(W, user))
fuel_cell = W
update_icon()
else
..()

/obj/item/hydrogen_grenade/MouseDrop(over_object)
if((src.loc == usr) && istype(over_object, /obj/screen/inventory/hand) && eject_item(fuel_cell, usr))
fuel_cell = null
if(armed)
armed = FALSE
update_icon()

/obj/item/hydrogen_grenade/update_icon()
cut_overlays()
if(fuel_cell)
add_overlay("[icon_state]_loaded")
if(armed)
add_overlay("[icon_state]_armed")

/obj/item/hydrogen_grenade/throw_impact(atom/hit_atom, var/speed)
/obj/item/tool/hydrogen_sword/refresh_upgrades()
..()
if(armed)
explode()

/obj/item/hydrogen_grenade/attack(mob/living/M, mob/living/user, target_zone)
if(..() && armed)
explode()

/obj/item/hydrogen_grenade/proc/explode()
var/turf/T = get_turf(src)
explosion(T, 0, 1, 2, 4) // Explode
new /obj/effect/explosion(T)
for(var/mob/M in view(2, T)) // Burn every mob nearby.
to_chat(M, SPAN_DANGER("You feel a wave of heat scorch your body!"))
M.take_overall_damage(0, rand(burn_min, burn_max))
spawn(20)
qdel(src)
if(active)
activate(FALSE, TRUE) //So we dont null are on state
SStgui.update_uis(src)
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
if(populated_contents)
return
populated_contents = TRUE
new /obj/item/storage/backpack/satchel/leather/withwallet(src)
//Clothing
new /obj/item/clothing/suit/bio_suit/scientist(src)
new /obj/item/clothing/head/bio_hood/scientist(src)
new /obj/item/clothing/accessory/halfcape/cro(src)
Expand All @@ -65,22 +65,25 @@
new /obj/item/clothing/shoes/color(src)
new /obj/item/clothing/shoes/leather(src)
new /obj/item/clothing/gloves/latex(src)
new /obj/item/clothing/accessory/holster/saber/rapiersci/occupied(src)
new /obj/item/device/radio/headset/heads/rd(src)
new /obj/item/tank/air(src)
new /obj/item/clothing/mask/gas(src)
new /obj/item/device/flash(src)
new /obj/item/shield_projector/rectangle/soteria_personal(src)
new /obj/item/storage/belt/sci(src)
new /obj/item/rig/advhazmat/equipped(src)
//RD eclsuive disks
new /obj/item/computer_hardware/hard_drive/portable/design/xenobio/rd(src)
new /obj/item/computer_hardware/hard_drive/portable/design/rped/rd(src)
new /obj/item/computer_hardware/hard_drive/portable/design/computer/rd(src)
new /obj/item/oddity/chem_book(src)
new /obj/item/computer_hardware/hard_drive/portable/design/genetics_kit(src)
//Storage
new /obj/item/storage/bag/xenobio(src)
new /obj/item/storage/belt/sci(src)
new /obj/item/storage/backpack/satchel/leather/withwallet(src)
new /obj/item/bodybag/xenobio(src)
new /obj/item/tool/hydrogen_sword(src)
new /obj/item/computer_hardware/hard_drive/portable/design/genetics_kit(src)
new /obj/item/device/aicard(src)
//Misc
new /obj/item/tank/air(src)
new /obj/item/device/flash(src)
new /obj/item/shield_projector/rectangle/soteria_personal(src)
new /obj/item/circuitboard/teleporter(src)
new /obj/item/circuitboard/aicore(src)
new /obj/item/rig/hazmat/equipped(src)
new /obj/item/clothing/accessory/holster/saber/rapiersci/occupied(src)
new /obj/item/oddity/chem_book(src)
12 changes: 10 additions & 2 deletions code/modules/clothing/spacesuits/rig/suits/station.dm
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ Technomancer RIG
mag_slow = 1

/***************************************
Hazmat: Chief Research Overseer
Hazmat: Anomalous
****************************************/
/obj/item/rig/hazmat
name = "AMI control module"
Expand Down Expand Up @@ -283,7 +283,7 @@ Technomancer RIG

/obj/item/rig/hazmat/equipped

req_access = list(access_rd)
req_access = list(access_xenoarch)

initial_modules = list(
/obj/item/rig_module/ai_container,
Expand Down Expand Up @@ -344,6 +344,14 @@ Technomancer RIG
/obj/item/clothing/head/helmet/space/rig/advhazmat
camera_networks = list(NETWORK_RESEARCH)

/obj/item/rig/advhazmat/equipped
req_access = list(access_xenoarch)
initial_modules = list(
/obj/item/rig_module/ai_container,
/obj/item/rig_module/maneuvering_jets,
/obj/item/rig_module/device/anomaly_scanner,
)

/***************************************
Medical
****************************************/
Expand Down
4 changes: 3 additions & 1 deletion code/modules/projectiles/guns/energy/plasma/hydrogen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ Securing and unsecuring the flask is a long and hard task, and a failure when un
// Damage dealt when overheating
var/overheat_damage = 25 // Applied to the hand holding the gun.
serial_type = "SI"
var/spawn_flask = FALSE

/obj/item/gun/hydrogen/Initialize(mapload = TRUE)
..()
flask = new /obj/item/hydrogen_fuel_cell(src) // Give the gun a new flask when mapped in.
if(spawn_flask)
flask = new /obj/item/hydrogen_fuel_cell(src) // Give the gun a new flask when mapped in.

/obj/item/gun/hydrogen/New()
..()
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/guns/energy/plasma/variant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
set category = "Object"

if(!welder) // Safety check if there isn't a welder.
welder = new /obj/item/tool/plasma_torch(src)
welder = new /obj/item/tool/plasma_torch/no_starting_fuel(src) //So we dont spawn a second flask
welder.gun = src
if(flask) // Give the welder the same flask the gun has, but only if there's a flask.
welder.flask = flask // Link the flask to the welder
Expand Down
7 changes: 6 additions & 1 deletion code/modules/projectiles/guns/energy/plasma/welder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@
var/passive_cost = 0.03 // Passive cost

var/obj/item/gun/hydrogen/plasma_torch/gun = null // Hold the gun the welder turns into.
var/spawn_flask = TRUE

/obj/item/tool/plasma_torch/no_starting_fuel
spawn_flask = FALSE

/obj/item/tool/plasma_torch/Initialize(mapload = TRUE)
..()
flask = new /obj/item/hydrogen_fuel_cell(src) // Give the welder a new flask when mapped in.
if(spawn_flask)
flask = new /obj/item/hydrogen_fuel_cell(src)
update_icon()

/obj/item/tool/plasma_torch/New()
Expand Down
6 changes: 5 additions & 1 deletion code/modules/research/designs/weapon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,13 @@
name = "Hydrogen \"Sollex\" Cannon"
build_path = /obj/item/gun/hydrogen/cannon

/datum/design/research/item/weapon/hydrogen_sword
name = "Hydrogen Sword"
build_path = /obj/item/tool/hydrogen_sword/no_starting_fuel

/datum/design/research/item/weapon/hydrogen_welder
name = "Hydrogen Torch"
build_path = /obj/item/tool/plasma_torch
build_path = /obj/item/tool/plasma_torch/no_starting_fuel

/datum/design/research/item/weapon/hydrogrenade
name = "Hydrogen Grenade"
Expand Down
Loading

0 comments on commit 4db595d

Please sign in to comment.