mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-02-02 20:30:29 +00:00
# Conflicts: # code/__defines/holomap.dm # code/__defines/mobs.dm # code/_helpers/icons.dm # code/_helpers/unsorted.dm # code/_onclick/hud/hud.dm # code/_onclick/item_attack.dm # code/controllers/Processes/supply.dm # code/controllers/subsystems/planets.dm # code/datums/supplypacks/munitions.dm # code/datums/supplypacks/science.dm # code/datums/supplypacks/security.dm # code/datums/supplypacks/supply.dm # code/game/area/Space Station 13 areas.dm # code/game/atoms_movable.dm # code/game/machinery/autolathe.dm # code/game/machinery/doors/door.dm # code/game/machinery/jukebox.dm # code/game/machinery/recharger.dm # code/game/machinery/vending.dm # code/game/mecha/equipment/tools/medical_tools.dm # code/game/mecha/equipment/weapons/weapons.dm # code/game/objects/items/devices/PDA/PDA.dm # code/game/objects/items/devices/megaphone.dm # code/game/objects/items/poi_items.dm # code/game/objects/items/weapons/implants/implantlanguage.dm # code/game/objects/items/weapons/storage/firstaid.dm # code/game/objects/items/weapons/tools/weldingtool.dm # code/game/objects/structures/flora/trees.dm # code/game/objects/structures/plasticflaps.dm # code/game/supplyshuttle.dm # code/game/turfs/simulated/wall_attacks.dm # code/modules/admin/admin_verbs.dm # code/modules/assembly/infrared.dm # code/modules/client/client procs.dm # code/modules/client/preference_setup/loadout/loadout_utility.dm # code/modules/client/preferences.dm # code/modules/clothing/suits/miscellaneous.dm # code/modules/holomap/holomap_datum.dm # code/modules/holomap/station_holomap.dm # code/modules/integrated_electronics/core/printer.dm # code/modules/mining/machine_processing.dm # code/modules/mob/living/carbon/human/human_defense.dm # code/modules/mob/living/carbon/human/species/virtual_reality/avatar.dm # code/modules/mob/living/death.dm # code/modules/mob/living/silicon/ai/ai.dm # code/modules/mob/living/silicon/pai/pai.dm # code/modules/mob/living/silicon/robot/robot.dm # code/modules/mob/living/simple_animal/animals/parrot.dm # code/modules/mob/mob_movement.dm # code/modules/organs/organ_external.dm # code/modules/organs/organ_icon.dm # code/modules/organs/subtypes/standard.dm # code/modules/planet/weather.dm # code/modules/power/cable.dm # code/modules/power/fusion/core/core_control.dm # code/modules/power/fusion/fuel_assembly/fuel_control.dm # code/modules/power/fusion/gyrotron/gyrotron_control.dm # code/modules/projectiles/gun.dm # code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Food-Drinks.dm # config/names/first_name_skrell.txt # config/names/last_name_skrell.txt # icons/mob/head.dmi # icons/mob/robots.dmi # icons/mob/species/tajaran/helmet.dmi # icons/obj/ammo.dmi # icons/obj/gun.dmi # icons/obj/mining.dmi # icons/obj/projectiles.dmi # icons/obj/rig_modules.dmi # icons/obj/surgery.dmi # icons/turf/walls.dmi # maps/southern_cross/southern_cross-1.dmm # maps/southern_cross/southern_cross-3.dmm # maps/southern_cross/southern_cross-6.dmm # maps/southern_cross/southern_cross-8.dmm # maps/submaps/surface_submaps/mountains/backup/IceCave1.dmm # maps/submaps/surface_submaps/mountains/backup/IceCave1A.dmm # maps/submaps/surface_submaps/mountains/backup/IceCave1B.dmm # maps/submaps/surface_submaps/mountains/backup/IceCave1C.dmm # maps/submaps/surface_submaps/mountains/crashedcontainmentshuttle.dmm # maps/submaps/surface_submaps/mountains/deadspy.dmm # maps/submaps/surface_submaps/mountains/mountains_areas.dm # maps/submaps/surface_submaps/plains/Thiefc.dmm # maps/~map_system/maps.dm # vorestation.dme
255 lines
7.8 KiB
Plaintext
255 lines
7.8 KiB
Plaintext
/obj/structure/grille
|
|
name = "grille"
|
|
desc = "A flimsy lattice of metal rods, with screws to secure it to the floor."
|
|
icon = 'icons/obj/structures_vr.dmi' // VOREStation Edit - New icons
|
|
icon_state = "grille"
|
|
density = 1
|
|
anchored = 1
|
|
flags = CONDUCT
|
|
pressure_resistance = 5*ONE_ATMOSPHERE
|
|
layer = TABLE_LAYER
|
|
explosion_resistance = 1
|
|
var/health = 10
|
|
var/destroyed = 0
|
|
|
|
|
|
/obj/structure/grille/ex_act(severity)
|
|
qdel(src)
|
|
|
|
/obj/structure/grille/update_icon()
|
|
if(destroyed)
|
|
icon_state = "[initial(icon_state)]-b"
|
|
else
|
|
icon_state = initial(icon_state)
|
|
|
|
/obj/structure/grille/Bumped(atom/user)
|
|
if(ismob(user)) shock(user, 70)
|
|
|
|
/obj/structure/grille/attack_hand(mob/user as mob)
|
|
|
|
user.setClickCooldown(user.get_attack_speed())
|
|
playsound(loc, 'sound/effects/grillehit.ogg', 80, 1)
|
|
user.do_attack_animation(src)
|
|
|
|
var/damage_dealt = 1
|
|
var/attack_message = "kicks"
|
|
if(istype(user,/mob/living/carbon/human))
|
|
var/mob/living/carbon/human/H = user
|
|
if(H.species.can_shred(H))
|
|
attack_message = "mangles"
|
|
damage_dealt = 5
|
|
|
|
if(shock(user, 70))
|
|
return
|
|
|
|
if(HULK in user.mutations)
|
|
damage_dealt += 5
|
|
else
|
|
damage_dealt += 1
|
|
|
|
attack_generic(user,damage_dealt,attack_message)
|
|
|
|
/obj/structure/grille/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
|
if(air_group || (height==0)) return 1
|
|
if(istype(mover) && mover.checkpass(PASSGRILLE))
|
|
return 1
|
|
else
|
|
if(istype(mover, /obj/item/projectile))
|
|
return prob(30)
|
|
else
|
|
return !density
|
|
|
|
/obj/structure/grille/bullet_act(var/obj/item/projectile/Proj)
|
|
if(!Proj) return
|
|
|
|
//Flimsy grilles aren't so great at stopping projectiles. However they can absorb some of the impact
|
|
var/damage = Proj.get_structure_damage()
|
|
var/passthrough = 0
|
|
|
|
if(!damage) return
|
|
|
|
//20% chance that the grille provides a bit more cover than usual. Support structure for example might take up 20% of the grille's area.
|
|
//If they click on the grille itself then we assume they are aiming at the grille itself and the extra cover behaviour is always used.
|
|
switch(Proj.damage_type)
|
|
if(BRUTE)
|
|
//bullets
|
|
if(Proj.original == src || prob(20))
|
|
Proj.damage *= between(0, Proj.damage/60, 0.5)
|
|
if(prob(max((damage-10)/25, 0))*100)
|
|
passthrough = 1
|
|
else
|
|
Proj.damage *= between(0, Proj.damage/60, 1)
|
|
passthrough = 1
|
|
if(BURN)
|
|
//beams and other projectiles are either blocked completely by grilles or stop half the damage.
|
|
if(!(Proj.original == src || prob(20)))
|
|
Proj.damage *= 0.5
|
|
passthrough = 1
|
|
|
|
if(passthrough)
|
|
. = PROJECTILE_CONTINUE
|
|
damage = between(0, (damage - Proj.damage)*(Proj.damage_type == BRUTE? 0.4 : 1), 10) //if the bullet passes through then the grille avoids most of the damage
|
|
|
|
src.health -= damage*0.2
|
|
spawn(0) healthcheck() //spawn to make sure we return properly if the grille is deleted
|
|
|
|
/obj/structure/grille/attackby(obj/item/W as obj, mob/user as mob)
|
|
if(!istype(W))
|
|
return
|
|
if(W.is_wirecutter())
|
|
if(!shock(user, 100))
|
|
playsound(src, W.usesound, 100, 1)
|
|
new /obj/item/stack/rods(get_turf(src), destroyed ? 1 : 2)
|
|
qdel(src)
|
|
else if((W.is_screwdriver()) && (istype(loc, /turf/simulated) || anchored))
|
|
if(!shock(user, 90))
|
|
playsound(src, W.usesound, 100, 1)
|
|
anchored = !anchored
|
|
user.visible_message("<span class='notice'>[user] [anchored ? "fastens" : "unfastens"] the grille.</span>", \
|
|
"<span class='notice'>You have [anchored ? "fastened the grille to" : "unfastened the grille from"] the floor.</span>")
|
|
return
|
|
|
|
//window placing begin //TODO CONVERT PROPERLY TO MATERIAL DATUM
|
|
else if(istype(W,/obj/item/stack/material))
|
|
var/obj/item/stack/material/ST = W
|
|
if(!ST.material.created_window)
|
|
return 0
|
|
|
|
var/dir_to_set = 1
|
|
if(loc == user.loc)
|
|
dir_to_set = user.dir
|
|
else
|
|
if( ( x == user.x ) || (y == user.y) ) //Only supposed to work for cardinal directions.
|
|
if( x == user.x )
|
|
if( y > user.y )
|
|
dir_to_set = 2
|
|
else
|
|
dir_to_set = 1
|
|
else if( y == user.y )
|
|
if( x > user.x )
|
|
dir_to_set = 8
|
|
else
|
|
dir_to_set = 4
|
|
else
|
|
user << "<span class='notice'>You can't reach.</span>"
|
|
return //Only works for cardinal direcitons, diagonals aren't supposed to work like this.
|
|
for(var/obj/structure/window/WINDOW in loc)
|
|
if(WINDOW.dir == dir_to_set)
|
|
user << "<span class='notice'>There is already a window facing this way there.</span>"
|
|
return
|
|
user << "<span class='notice'>You start placing the window.</span>"
|
|
if(do_after(user,20))
|
|
for(var/obj/structure/window/WINDOW in loc)
|
|
if(WINDOW.dir == dir_to_set)//checking this for a 2nd time to check if a window was made while we were waiting.
|
|
user << "<span class='notice'>There is already a window facing this way there.</span>"
|
|
return
|
|
|
|
var/wtype = ST.material.created_window
|
|
if (ST.use(1))
|
|
var/obj/structure/window/WD = new wtype(loc, dir_to_set, 1)
|
|
user << "<span class='notice'>You place the [WD] on [src].</span>"
|
|
WD.update_icon()
|
|
return
|
|
//window placing end
|
|
|
|
else if(!(W.flags & CONDUCT) || !shock(user, 70))
|
|
user.setClickCooldown(user.get_attack_speed(W))
|
|
user.do_attack_animation(src)
|
|
playsound(loc, 'sound/effects/grillehit.ogg', 80, 1)
|
|
switch(W.damtype)
|
|
if("fire")
|
|
health -= W.force
|
|
if("brute")
|
|
health -= W.force * 0.1
|
|
healthcheck()
|
|
..()
|
|
return
|
|
|
|
|
|
/obj/structure/grille/proc/healthcheck()
|
|
if(health <= 0)
|
|
if(!destroyed)
|
|
density = 0
|
|
destroyed = 1
|
|
update_icon()
|
|
new /obj/item/stack/rods(get_turf(src))
|
|
|
|
else
|
|
if(health <= -6)
|
|
new /obj/item/stack/rods(get_turf(src))
|
|
qdel(src)
|
|
return
|
|
return
|
|
|
|
// shock user with probability prb (if all connections & power are working)
|
|
// returns 1 if shocked, 0 otherwise
|
|
|
|
/obj/structure/grille/proc/shock(mob/user as mob, prb)
|
|
|
|
if(!anchored || destroyed) // anchored/destroyed grilles are never connected
|
|
return 0
|
|
if(!prob(prb))
|
|
return 0
|
|
if(!in_range(src, user))//To prevent TK and mech users from getting shocked
|
|
return 0
|
|
var/turf/T = get_turf(src)
|
|
var/obj/structure/cable/C = T.get_cable_node()
|
|
if(C)
|
|
if(electrocute_mob(user, C, src))
|
|
if(C.powernet)
|
|
C.powernet.trigger_warning()
|
|
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
|
s.set_up(3, 1, src)
|
|
s.start()
|
|
if(user.stunned)
|
|
return 1
|
|
else
|
|
return 0
|
|
return 0
|
|
|
|
/obj/structure/grille/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
|
if(!destroyed)
|
|
if(exposed_temperature > T0C + 1500)
|
|
health -= 1
|
|
healthcheck()
|
|
..()
|
|
|
|
/obj/structure/grille/attack_generic(var/mob/user, var/damage, var/attack_verb)
|
|
visible_message("<span class='danger'>[user] [attack_verb] the [src]!</span>")
|
|
user.do_attack_animation(src)
|
|
health -= damage
|
|
spawn(1) healthcheck()
|
|
return 1
|
|
|
|
// Used in mapping to avoid
|
|
/obj/structure/grille/broken
|
|
destroyed = 1
|
|
icon_state = "grille-b"
|
|
density = 0
|
|
New()
|
|
..()
|
|
health = rand(-5, -1) //In the destroyed but not utterly threshold.
|
|
healthcheck() //Send this to healthcheck just in case we want to do something else with it.
|
|
|
|
/obj/structure/grille/cult
|
|
name = "cult grille"
|
|
desc = "A matrice built out of an unknown material, with some sort of force field blocking air around it"
|
|
icon_state = "grillecult"
|
|
health = 40 //Make it strong enough to avoid people breaking in too easily
|
|
|
|
/obj/structure/grille/cult/CanPass(atom/movable/mover, turf/target, height = 1.5, air_group = 0)
|
|
if(air_group)
|
|
return 0 //Make sure air doesn't drain
|
|
..()
|
|
|
|
/obj/structure/grille/broken/cult
|
|
icon_state = "grillecult-b"
|
|
|
|
/obj/structure/grille/rustic
|
|
name = "rustic grille"
|
|
desc = "A lattice of metal, arranged in an old, rustic fashion."
|
|
icon_state = "grillerustic"
|
|
|
|
/obj/structure/grille/broken/rustic
|
|
icon_state = "grillerustic-b"
|