Skip to content

Commit

Permalink
Merge branch 'box-port-pump' of https://github.com/Kar4es/Paradise-SS220
Browse files Browse the repository at this point in the history
 into box-port-pump
  • Loading branch information
Kar4es committed Oct 31, 2023
2 parents 6e894c6 + 4ff3d22 commit 947a90e
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 63 deletions.
28 changes: 18 additions & 10 deletions _maps/map_files220/cyberiad/cyberiad.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -3319,13 +3319,8 @@
/turf/simulated/floor/plasteel,
/area/station/security/processing)
"apc" = (
/obj/structure/table,
/obj/item/paper_bin{
pixel_x = -3;
pixel_y = 7
},
/obj/item/pen,
/obj/machinery/newscaster/security_unit/east,
/obj/machinery/recharge_station,
/turf/simulated/floor/plasteel,
/area/station/security/processing)
"apd" = (
Expand Down Expand Up @@ -3987,9 +3982,6 @@
},
/area/station/security/brig)
"arE" = (
/obj/structure/chair{
dir = 1
},
/obj/machinery/light_switch/east,
/turf/simulated/floor/plasteel{
dir = 4;
Expand Down Expand Up @@ -5794,6 +5786,12 @@
pixel_y = -22;
dir = 1
},
/obj/structure/table,
/obj/item/paper_bin{
pixel_x = -3;
pixel_y = 7
},
/obj/item/pen,
/turf/simulated/floor/plasteel{
icon_state = "redcorner"
},
Expand Down Expand Up @@ -25043,6 +25041,7 @@
},
/area/station/medical/sleeper)
"bXI" = (
/obj/machinery/recharge_station,
/turf/simulated/floor/plasteel{
dir = 6;
icon_state = "whiteblue"
Expand Down Expand Up @@ -60292,6 +60291,7 @@
c_tag = "Medbay Treatment East";
dir = 8
},
/obj/machinery/recharge_station,
/turf/simulated/floor/plasteel{
dir = 5;
icon_state = "whiteblue"
Expand Down Expand Up @@ -62436,6 +62436,14 @@
icon_state = "darkyellowcorners"
},
/area/station/engineering/hallway)
"jZQ" = (
/obj/structure/chair{
dir = 4
},
/turf/simulated/floor/plasteel{
icon_state = "redcorner"
},
/area/station/security/processing)
"kaa" = (
/obj/structure/disposalpipe/segment,
/obj/structure/cable{
Expand Down Expand Up @@ -133344,7 +133352,7 @@ avB
avB
aAF
aAF
axR
jZQ
lSU
azW
aBb
Expand Down
11 changes: 7 additions & 4 deletions _maps/map_files220/delta/delta.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -66851,6 +66851,11 @@
icon_state = "green"
},
/area/station/medical/virology/lab)
"lzQ" = (
/obj/effect/decal/warning_stripes/yellow/hollow,
/obj/machinery/recharge_station,
/turf/simulated/floor/plasteel,
/area/station/public/storage/tools)
"lAk" = (
/obj/machinery/power/apc/directional/south,
/obj/structure/cable,
Expand Down Expand Up @@ -94090,9 +94095,7 @@
},
/area/station/public/locker)
"uXf" = (
/obj/structure/table/reinforced,
/obj/item/paper_bin,
/obj/item/pen,
/obj/machinery/recharge_station,
/turf/simulated/floor/plasteel{
dir = 1;
icon_state = "red"
Expand Down Expand Up @@ -134633,7 +134636,7 @@ aor
bOC
bCg
bDS
bFr
lzQ
bHc
bIT
bFr
Expand Down
15 changes: 5 additions & 10 deletions modular_ss220/objects/code/beretta.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
righthand_file = 'modular_ss220/objects/icons/inhands/guns_righthand.dmi'
icon_state = "beretta"
item_state = "beretta"
w_class = WEIGHT_CLASS_NORMAL
can_suppress = FALSE
mag_type = /obj/item/ammo_box/magazine/beretta
fire_sound = 'modular_ss220/objects/sound/weapons/gunshots/beretta_shot.ogg'
Expand All @@ -20,6 +21,8 @@
multi_sprite_step = 2
ammo_type = /obj/item/ammo_casing/beretta/mmrub919
max_ammo = 10
multiload = 0
slow_loading = TRUE
caliber = "919mm"

/obj/item/ammo_box/magazine/beretta/mm919
Expand Down Expand Up @@ -120,8 +123,6 @@
/datum/supply_packs/security/armory/berettarubberammo
name = "Beretta M9 Rubber Ammunition Crate"
contains = list(/obj/item/ammo_box/beretta,
/obj/item/ammo_box/beretta,
/obj/item/ammo_box/beretta,
/obj/item/ammo_box/beretta,
/obj/item/ammo_box/magazine/beretta,
/obj/item/ammo_box/magazine/beretta)
Expand All @@ -131,8 +132,6 @@
/datum/supply_packs/security/armory/berettalethalammo
name = "Beretta M9 Lethal Ammunition Crate"
contains = list(/obj/item/ammo_box/beretta/mm919,
/obj/item/ammo_box/beretta/mm919,
/obj/item/ammo_box/beretta/mm919,
/obj/item/ammo_box/beretta/mm919,
/obj/item/ammo_box/magazine/beretta/mm919,
/obj/item/ammo_box/magazine/beretta/mm919)
Expand All @@ -142,8 +141,6 @@
/datum/supply_packs/security/armory/berettaexperimentalammo
name = "Beretta M9 Bluespace Ammunition Crate"
contains = list(/obj/item/ammo_box/beretta/mmbsp919,
/obj/item/ammo_box/beretta/mmbsp919,
/obj/item/ammo_box/beretta/mmbsp919,
/obj/item/ammo_box/beretta/mmbsp919,
/obj/item/ammo_box/magazine/beretta/mmbsp919,
/obj/item/ammo_box/magazine/beretta/mmbsp919)
Expand All @@ -153,8 +150,6 @@
/datum/supply_packs/security/armory/berettaarmorpiercingammo
name = "Beretta M9 Armor-piercing Ammunition Crate"
contains = list(/obj/item/ammo_box/beretta/mmap919,
/obj/item/ammo_box/beretta/mmap919,
/obj/item/ammo_box/beretta/mmap919,
/obj/item/ammo_box/beretta/mmap919,
/obj/item/ammo_box/magazine/beretta/mmap919,
/obj/item/ammo_box/magazine/beretta/mmap919)
Expand All @@ -174,7 +169,7 @@
/datum/design/box_beretta/ap
name = "Beretta M9 AP Ammo Box (9mm)"
desc = "A box of 20 armor-piercing rounds for Beretta M9"
id = "box_beretta"
id = "box_beretta_ap"
req_tech = list("combat" = 3, "materials" = 2)
build_type = PROTOLATHE
materials = list(MAT_METAL = 6000, MAT_SILVER = 600, MAT_GLASS = 1000)
Expand All @@ -184,7 +179,7 @@
/datum/design/box_beretta/bluespace
name = "Beretta M9 Bluespace Ammo Box (9mm)"
desc = "A box of 20 high velocity bluespace rounds for Beretta M9"
id = "box_beretta"
id = "box_beretta_bsp"
req_tech = list("combat" = 6, "materials" = 5, "bluespace" = 6)
build_type = PROTOLATHE
materials = list(MAT_METAL = 8000, MAT_SILVER = 600, MAT_BLUESPACE = 1000)
Expand Down
89 changes: 50 additions & 39 deletions modular_ss220/wire_splicing/wiresplicing.dm
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
#define MAX_MESSINESS 10
#define WALKING_REDUCE_PROBABILITY 50

/obj/effect/spawner/wire_splicing
name = "wiring splicing spawner"
icon = 'modular_ss220/wire_splicing/structures_spawners.dmi'
icon_state = "wire_splicing"

/obj/effect/spawner/wire_splicing/Initialize()
. = ..()
new/obj/structure/wire_splicing(get_turf(src))
new /obj/structure/wire_splicing(get_turf(src))
return INITIALIZE_HINT_QDEL

/obj/effect/spawner/wire_splicing/thirty //70% chance to be nothing
name = "wiring splicing spawner 30%"

/obj/effect/spawner/wire_splicing/thirty/Initialize(mapload)
if (prob(70))
if(prob(70))
return INITIALIZE_HINT_QDEL
. = ..()

Expand All @@ -26,19 +29,18 @@
flags = CONDUCT
layer = WIRE_TERMINAL_LAYER
var/messiness = 0 // How bad the splicing was, determines the chance of shock
var/shock_chance_per_messiness = 10

/obj/structure/wire_splicing/Initialize(mapload)
. = ..()
messiness = rand (1,10)
icon_state = "wire_splicing[messiness]"

messiness = rand(1, MAX_MESSINESS)
update_icon(UPDATE_ICON_STATE)

//At messiness of 2 or below, triggering when walking on a catwalk is impossible
//Above that it becomes possible, so we will change the layer to make it poke through catwalks
if (messiness > 2)
layer = LOW_OBJ_LAYER // I wont do such stuff on splicing "reinforcement". Take it as nasty feature


//Wire splice can only exist on a cable. Lets try to place it in a good location
if (locate(/obj/structure/cable) in get_turf(src)) //if we're already in a good location, no problem!
return
Expand Down Expand Up @@ -90,60 +92,69 @@

loc = pick(candidates)

/obj/structure/wire_splicing/update_icon_state()
icon_state = "wire_splicing[messiness]"

/obj/structure/wire_splicing/examine(mob/user)
..()
to_chat(user, "It has [messiness] wire[messiness > 1?"s":""] dangling around.")
. = ..()
. += span_warning("It has [messiness] wire[messiness > 1 ? "s" : ""] dangling around.")

/obj/structure/wire_splicing/Crossed(AM as mob|obj)
/obj/structure/wire_splicing/Crossed(atom/movable/AM, oldloc)
. = ..()
if(isliving(AM))
var/mob/living/L = AM
//var/turf/T = get_turf(src)
var/chance_to_shock = messiness * 10
var/chance_to_shock = messiness * shock_chance_per_messiness
/*
var/turf/T = get_turf(src)
if(locate(/obj/structure/catwalk) in T)
chance_to_shock -= 20
*/
shock(L, chance_to_shock)
shock(AM, chance_to_shock)

/obj/structure/wire_splicing/proc/shock(mob/user, prb, siemens_coeff = 1)
if(!in_range(src, user))//To prevent TK and mech users from getting shocked
return FALSE
/obj/structure/wire_splicing/proc/shock(mob/living/user, prb, siemens_coeff = 1)
. = FALSE
if(!in_range(src, user)) //To prevent TK and mech users from getting shocked
return
if(user.m_intent == MOVE_INTENT_WALK) // Walk slowly to try to step over
prb = max(prb - WALKING_REDUCE_PROBABILITY, 0)
if(!prob(prb))
return FALSE
return
var/turf/T = get_turf(src)
var/obj/structure/cable/C = locate(/obj/structure/cable) in T
if(!C)
return FALSE
if (electrocute_mob(user, C.powernet, src, siemens_coeff))
return
if(electrocute_mob(user, C.powernet, src, siemens_coeff))
do_sparks(5, TRUE, src)
return TRUE
else
return FALSE
. = TRUE

/obj/structure/wire_splicing/wirecutter_act(mob/living/user, obj/item/I)
. = TRUE
if(!I.use_tool(src, user, 2 SECONDS, volume = I.tool_volume))
return
if(shock(user, 50))
return
user.visible_message(span_notice("[user] cuts the splicing."), span_notice("You cut the splicing."))
investigate_log(" was cut by [key_name(usr)] in [AREACOORD(src)]")
qdel(src)

/obj/structure/wire_splicing/attackby(obj/item/I, mob/user, params)
if(I.tool_behaviour == TOOL_WIRECUTTER)
if(I.use_tool(src, user, 2 SECONDS, volume = 50))
if (shock(user, 50))
return
user.visible_message("[user] cuts the splicing.", span_notice("You cut the splicing."))
investigate_log(" was cut by [key_name(usr)] in [AREACOORD(src)]")
qdel(src)

if(istype(I, /obj/item/stack/cable_coil) && user.a_intent == INTENT_HARM)
var/obj/item/stack/cable_coil/coil = I
if(coil.get_amount() >= 1)
reinforce(user, coil)
reinforce(user, coil)
return
. = ..()

/obj/structure/wire_splicing/proc/reinforce(mob/user, obj/item/stack/cable_coil/coil)
if(messiness >= 10)
to_chat(user,span_warning("You can't seem to jam more cable into the splicing!"))
if(messiness >= MAX_MESSINESS)
to_chat(user, span_warning("You can't seem to jam more cable into the splicing!"))
return
if(!do_after(user, 2 SECONDS, src))
if(!do_after(user, 2 SECONDS, target = src, progress = TRUE))
return
messiness = min(messiness + 1, 10)
investigate_log("wire splicing was reinforced to [messiness] by [key_name(usr)] in [AREACOORD(src)]")
if(messiness >= MAX_MESSINESS)
return
messiness = min(messiness + 1, MAX_MESSINESS)
coil.use(1)
if(messiness < 10 && coil.get_amount() >= 1)
reinforce(user, coil)
update_icon(UPDATE_ICON_STATE)
investigate_log("wire splicing was reinforced to [messiness] by [key_name(usr)] in [AREACOORD(src)]")

#undef MAX_MESSINESS
#undef WALKING_REDUCE_PROBABILITY

0 comments on commit 947a90e

Please sign in to comment.